SlateDroid.com: Changing impersonations etc. without replacing whole build.prop - SlateDroid.com

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Changing impersonations etc. without replacing whole build.prop - and even a way to cope with QM/TM kernels vs. unified userspace

#1 User is offline   Steve8x8 

  • Advanced Member
  • PipPipPip
  • Group: Jr. Member
  • Topics: 8
  • Posts: 254
  • Joined: 12-September 12

Posted 17 October 2012 - 05:12 AM

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?
0

#2 User is offline   Christian Troy 

  • Advanced Member
  • PipPipPip
  • Group: FW Developer
  • Topics: 43
  • Posts: 4,884
  • Joined: 09-December 11

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

#!/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

Posted Image
0

#3 User is offline   Steve8x8 

  • Advanced Member
  • PipPipPip
  • Group: Jr. Member
  • Topics: 8
  • Posts: 254
  • Joined: 12-September 12

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...
0

#4 User is offline   nognir 

  • Newbie
  • Pip
  • Group: Jr. Member
  • Topics: 0
  • Posts: 1
  • Joined: 19-January 13

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?
0

#5 User is offline   maniacmansion 

  • Member
  • PipPip
  • Group: Jr. Member
  • Topics: 0
  • Posts: 12
  • Joined: 19-October 12

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users