Making RC30 safe

Search This thread

Fnorder

Senior Member
Nov 8, 2008
153
327
Lake Vostok
I've looked through the update.zip and it seems only a few changes are needed to -keep- root.
* Flash the recovery image from http://xdaforums.com/showthread.php?t=443041
* Unzip the FULL rc30
* Replace the system/recovery.img with the one from the above url.
* Copy system/bin/sh to system/bin/rootshell, and make the following changes to META-INF/com/google/android/update-script (or download a modified copy from a trusted source)

Add this to the end of the first line, which should start with: assert getprop("ro.build.finger.......

|| getprop("ro.build.fingerprint") == "generic/htc_dream/dream/trout:1.0/TC3/eng.jesusfreke.20081105.164210:eng/test-keys"


After
set_perm_recursive 0 2000 0755 0755 SYSTEM:bin
add
set_perm 0 2000 04755 SYSTEM:bin/rootshell


BACKUP anything from /system as it will be formatted. Do -not- use the 4 meg rc30 patch, as it bricks systems.

Resign with the utility provided in the above link, copy to sdcard, enter recovery, and pray. If it works, you can run the following from the terminal app (not pterminal)
/system/bin/rootshell

I've sucessfully done this on my machine.
 
Last edited:

Koush

Retired Recognized Developer
Sep 21, 2007
917
872
That looks right, but just in case, I would also try to add a couple back doors, and close a few of Google's:
  • Add a test cert to the list of accepted OTA certs.
  • Remove Google's OTA cert.
  • Include a setuid shell somewhere in the patch.
 
Last edited:

cookzitall

Senior Member
Oct 16, 2007
223
5
has ne1 tryed this? does it work...

im not sure wat changes to make to the script...its kind of confusing..can sum1 post an changed script?
 

Fnorder

Senior Member
Nov 8, 2008
153
327
Lake Vostok
That looks right, but just in case, I would also try to add a couple back doors, and close a few of Google's:
  • Add a test cert to the list of accepted OTA certs.
  • Remove Google's OTA cert.
  • Include a setuid shell somewhere in the patch.

The setuid shell is added by means of chmodding /system/bin/sh. I'm not clear on the syntax for the 'concat' function that's apparently in the updater, so for safety's sake I won't try to make a copy. Regarding the other stuff....


Warning - Several people have bricked phones because a file that the updater intends to patch is either modified or missing. This includes otacerts.zip, so it would be a good idea to look through META-INF/com/google/android/update-script and make sure that none of the files listed have been tampered with.
 

Koush

Retired Recognized Developer
Sep 21, 2007
917
872
The setuid shell is added by means of chmodding /system/bin/sh. I'm not clear on the syntax for the 'concat' function that's apparently in the updater, so for safety's sake I won't try to make a copy. Regarding the other stuff....


Warning - Several people have bricked phones because a file that the updater intends to patch is either modified or missing. This includes otacerts.zip, so it would be a good idea to look through META-INF/com/google/android/update-script and make sure that none of the files listed have been tampered with.

You are right, otacerts.zip is one of the files they are patching. So we'd need to remove that applypatch line and leave our own copy on the file system. Or just leave it as is...
 
Mar 6, 2007
23
0
So, if we want the modified rc30 update, we absolutely have to have the modded recovery and boot imgs at the link you provided? Can we not have the option to simply resign the modified update and install it?
 

Fnorder

Senior Member
Nov 8, 2008
153
327
Lake Vostok
So, if we want the modified rc30 update, we absolutely have to have the modded recovery and boot imgs at the link you provided? Can we not have the option to simply resign the modified update and install it?

Just the modified recovery.img, and yes it's required to install any modified update - since you don't have google's private key, you can't put google's signature on the update, and google's recovery only allows updates signed with that.