I found this thread on xda-developers discussing a means to change build.prop from within a running Android, but this (by using a shell script unpacked into /tmp, ran in "run_program") could also be applied from an updater-script.
This way, impersonation setups would _only_ consist of information relevant to the impersonation (ro.build.* and ro.product.*).
Likewise, localization setups would only sport persist.sys.timezone and ro.product.locale.* entries.
There could be an upgrade zip that switches hw.nophone on/off, same for gps.enable ... etc pp
Eventually, by using file_getprop() on a config file provided on the SDcard (and erroring out if that one doesn't exist!), it would even be possible to choose the right boot and recovery kernels - obsoleting the need to duplicate the whole userspace and providing two firmware install packages...
(It would be even smarter to read the device configuration from the bootloader, dunno whether that's possible at all, but it would stop users from using the wrong display drivers.)
Any opinions?
| ||
Page 1 of 1
Changing impersonations etc. without replacing whole build.prop - and even a way to cope with QM/TM kernels vs. unified userspace
#2
Posted 17 October 2012 - 07:58 AM
you can use sed... on my aosp roms you can use a "cm10_nexus7_to_sgs2.zip" file that will convert nexus7 to sgs2; using sed is pretty easy
you just have to create an updater-script like this
#!/sbin/sh sed -i 's,ro.product.brand=Google,ro.product.brand=samsung,g' /system/build.prop sed -i 's,ro.product.model=Nexus 7,ro.product.model=GT-I9100,g' /system/build.prop sed -i 's,ro.product.manufacturer=Asus,ro.product.manufacturer=samsung,g' /system/build.prop sed -i 's,ro.product.name=nakasi,ro.product.name=GT-I9100,g' /system/build.prop sed -i 's,ro.product.device=grouper,ro.product.device=GT-I9100,g' /system/build.prop sed -i 's,ro.build.fingerprint=google/nakasi/grouper:4.1.1/JRO03D/402395:user/release-keys,ro.build.fingerprint=samsung/GT-I9100/GT-I9100:4.0.3/IML74K/XXLPQ:user/release-keys,g' /system/build.prop sed -i 's,ro.build.description=nakasi-user 4.1.1 JRO03D 402395 release-keys,ro.build.description=GT-I9100-user 4.0.3 IML74K XXLPQ release-keys,g' /system/build.prop
you just have to create an updater-script like this
package_extract_file("nexus7_to_sgs2", "/tmp/nexus7_to_sgs2");
set_perm(0, 0, 0777, "/tmp/nexus7_to_sgs2");
mount("ubifs", "UBI", "system", "/system");
run_program("/tmp/nexus7_to_sgs2");
unmount("/system");
mount("ubifs", "UBI", "data", "/data");
delete_recursive("/data/data/com.android.vending");
delete_recursive("/data/data/com.google.android.gsf");
unmount("/data");
This post has been edited by Christian Troy: 17 October 2012 - 07:59 AM
If you appreciate my work and would like to support me with a donation you can follow this link. Thank you very much.
* Allwinner A31 - CM10 - AOKP
* Pipo M9 Max - Stock repacks
* Ainol Spark - Stock repacks
* Zenithink C97 / C93 - CM10.1, CM10, AOKP, CM9
* Ainol ELF-II / Aurora-II / Crystal / Fire / Hero - CM10.1, CM10, AOKP, ParanoidAndroid, CM9
* Allwinner A10 - CM10, CM9, AOKP
* Allwinner A31 - CM10 - AOKP
* Pipo M9 Max - Stock repacks
* Ainol Spark - Stock repacks
* Zenithink C97 / C93 - CM10.1, CM10, AOKP, CM9
* Ainol ELF-II / Aurora-II / Crystal / Fire / Hero - CM10.1, CM10, AOKP, ParanoidAndroid, CM9
* Allwinner A10 - CM10, CM9, AOKP
#3
Posted 17 October 2012 - 10:19 AM
But: sed would _not_ add entries which don't exist yet. Instead, (used as above) it would replace commented-out entries...
Both issues can be addressed properly: by using grep (does busybox grep know about -q?), and sed matching on line starts (use ^).
What I'd prefer: an impersonation.prop file which just contains the entries which define the fake platform, and an algorithm to merge them into the build.prop properly. With some error fallbacks in place.
Since I'm pretty new to Edify, it will take a while until I can come up with a solution. Got to do some reading...
Both issues can be addressed properly: by using grep (does busybox grep know about -q?), and sed matching on line starts (use ^).
What I'd prefer: an impersonation.prop file which just contains the entries which define the fake platform, and an algorithm to merge them into the build.prop properly. With some error fallbacks in place.
Since I'm pretty new to Edify, it will take a while until I can come up with a solution. Got to do some reading...
#4
Posted 19 January 2013 - 04:00 PM
Does the impersonation work properly in stock rom? I'm running 1212/TM/Freescale.
Should I just paste the build.prop from a custom rom or is it a stupid idea?
Should I just paste the build.prop from a custom rom or is it a stupid idea?
#5
Posted 13 February 2013 - 08:35 AM
sed -i 's,ro.product.brand=Google,ro.product.brand=samsung,g' /system/build.prop
sed -i 's,ro.product.model=Nexus 7,ro.product.model=GT-I9100,g' /system/build.prop
sed -i 's,ro.product.manufacturer=Asus,ro.product.manufacturer=samsung,g' /system/build.prop
sed -i 's,ro.product.name=nakasi,ro.product.name=GT-I9100,g' /system/build.prop
sed -i 's,ro.product.device=grouper,ro.product.device=GT-I9100,g' /system/build.prop
sed -i 's,ro.build.fingerprint=google/nakasi/grouper:4.1.1/JRO03D/402395:user/release-keys,ro.build.fingerprint=samsung/GT-I9100/GT-I9100:4.0.3/IML74K
Hi,
I want to switch from Samsung Galaxy 2 back to Nexus 7
as I are not able to install some apps from the store.
If I change the build.prop file manually with editor,
will I screw up my system (play store)?
Thank you.
Best regards
Mirco
sed -i 's,ro.product.model=Nexus 7,ro.product.model=GT-I9100,g' /system/build.prop
sed -i 's,ro.product.manufacturer=Asus,ro.product.manufacturer=samsung,g' /system/build.prop
sed -i 's,ro.product.name=nakasi,ro.product.name=GT-I9100,g' /system/build.prop
sed -i 's,ro.product.device=grouper,ro.product.device=GT-I9100,g' /system/build.prop
sed -i 's,ro.build.fingerprint=google/nakasi/grouper:4.1.1/JRO03D/402395:user/release-keys,ro.build.fingerprint=samsung/GT-I9100/GT-I9100:4.0.3/IML74K
Hi,
I want to switch from Samsung Galaxy 2 back to Nexus 7
as I are not able to install some apps from the store.
If I change the build.prop file manually with editor,
will I screw up my system (play store)?
Thank you.
Best regards
Mirco
Share this topic:
Page 1 of 1

Help












