Navigation

Friday, November 20, 2009

Applying Sprint's HTC Hero OTA Update to your Modified Stock ROM (1.56.651.2)

So, you hacked your Hero, rooted it and customized your stock rom. You removed stuff you don't use, like Stocks, Peep, whatever your tastes are.. But now the update refuses to apply.

Well, hang tight because we can do this, but its a long road.

First, you will need to reboot into Amon's recovery and nake a nandroid backup of your current setup. Once you have backed up your current setup, you will need to revert to factory, using a RUU pack (see my previous post).

Once you are back to factory status, simply install the OTA update. Reboot and wait for the system to update. When the system boots up, you need to re-root the new rom, and re-flash Amon's recovery (http://forum.xda-developers.com/showthread.php?t=581577). Once you have Amon's recovery back on there, reboot into it and create a second nandroid backup.

Now here is where it gets messy... Take the data.img and cache.img from your first nandroid backup, and place them in the latest one, overwriting existing files. Also be sure to edit the nandroid.md5 in the latest backup with the hashes for data.img and cache.img from your first. Once you have done that, simply restore your modified nandroid backup.

When the backup has restored, DO NOT REBOOT THE PHONE YET! We have more to do.

This part pertains only to 1.56.651.2, but you can easily figure out what needs to be done on a per-update basis by reading and understanding the update-script file in the update package.

Remember, we have replaced 1.56.651.2's data and cache partitions with 1.56.651.1's, so we need to manually run some of the script commands to bring our data partition up to date, otherwise everything will force close when you reboot. So, open an adb shell to the phone while still in Amon's recovery. This should automatically drop you to a root shell.

The script has the following commands on the DATA partition:
delete_recursive DATA:dalvik-cache/
delete_recursive DATA:boot-cache/
delete DATA:data/com.smithmicro.DM/libomc.so


So we must execute these manually. In the adb shell run the following:
mount /data
rm -r /data/dalvik-cache
rm -r /data/boot-cache
rm /data/data/com.smithmicro.DM/libomc.so
reboot


Now your phone will reboot. It will take a while as it rebuilds the caches, but if done correctly, and with some luck, you now have upgraded to 1.56.651.2 without losing your apps and customizations You are welcome to re-remove the apps you did before, however remember you will need to do this again next time there is an update, and it may not be so easy next time!

No comments:

Post a Comment