[GUIDE] Root Hero [MAC], Load Unofficial MoDaCo 1.2c, Nandroid Backup/Restore!

Search This thread

theraginasian

Senior Member
Nov 9, 2009
116
0
Ann Arbor, MI
NOTE: This is a work in progress. While I have completed this guide myself SEVERAL times to ensure accuracy, It is possible that typos or errors in understanding exist. Please use at your own risk, and expect NOTHING from me. I will do my best to update this guide and improve the formatting as I find time. Feel free to leave feedback!

I cannot stress this enough: always have backups of any important information. While we may not be able to do full image-based backups until after root, you can still make sure we aren't deleting needed data. While yes, Google should hold your most important data and allow you to sync at any time, what would you do if Google went down? And I've even had trouble using the "Offline" function for some of the Apps. Therefore, Make a copy of everything on your SD card and read this excellent guide from Lifehacker about how to backup Google Apps data: Lifehacker

You will need an SD card. I recommend AT LEAST an 8GB Class 4. Most actually recommend a Class 6 for use with apps2sd, but I just wanted to let you know that it would still work with a Class 4. For those unaware, apps2sd allows you to save internal phone memory by placing after-market applications onto your SD card. Most users notice a speed benefit from this.

If you would like to purchase a Class 6 SD card, you can get a one here with three sizes available (4GB, 8GB, 16GB):
A-DATA MicroSDHC Class 6 Turbo With SD Adapter

To ensure the best possible load, perform a factory reset, and WIPE your SD card!

Code:
Menu > Settings > Security > Factory data reset > Reset phone > Erase everything

TRUE FACTORY RESET (UN-ROOT)
If you, like me, have already rooted and are trying to perform this process over again, you will unfortunately have to download the original ROM and flash it in Windows.

Download: RUU_Hero_C_Sprint_1.29.651.1_signed_release.exe

Run in Windows (I used XP through VMWare Fusion), and this will return the phone to the TRULY factory loaded state. Any other Factory data reset will simply reload the last ROM image saved, which, if you rooted and loaded MoDaCo, would be MoDaCo. I am encouraging you to follow this process to avoid any problems that may exist while the phone is rooted or loaded with the unofficial ROM. And even if you perform this process as a first-time rooter, it certainly wont hurt!

ROOT HERO [MAC]
(This is the process that allows modifications to occur on your phone):

The guide I follow and can verify is this:
Rooting CDMA Hero [Mac]

I do not use Windows as a primary platform, so I would recommend following this guide if you are on Windows:
How to root the CDMA Hero (DETAILED Windows guide)

You should be able to return to this guide after you have successfully completed the root process on Windows. Continue from the section "NANDROID BACKUP" below.

Per the purpose of this guide, I will detail my exact steps from the "Rooting CDMA Hero [Mac]" post. Thanks ajones7279!

Plug in your phone

Download Android SDK: http://developer.android.com/sdk/index.html

Unpack, Rename the extracted folder to "AndroidSDK" (This is case sensitive!), and Move it to "Applications" (I consider the Android SDK a set of applications.)

Open TextEdit, Click Format>Make Plain Text, then copy and paste the following:

Code:
export PATH=${PATH}:/Applications/AndroidSDK/tools

Save as: ".bash_profile"

On Phone: Go to Settings > Applications > Development>USB Debugging and make sure the option is checked.

On your Mac: Download asroot2: http://zenthought.org/tmp/asroot2
Save this file into: /Applications/AndroidSDK/tools

Open Terminal and run the following commands (You can copy and paste):

Code:
cd /Applications/AndroidSDK/tools
adb push asroot 2 /data/local
adb shell chmod 0755 /data/local/asroot2
adb shell
/data/local/asroot2 /system/bin/sh
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4775 su
exit
exit

At this point, the phone has root access.

Download: http://rapidshare.com/files/303797523/recovery-RA-heroc-v1.2.3.img
Save this file into: /Applications/AndroidSDK/tools

Go back to your terminal and type:

Code:
adb push recovery-RA-heroc-v1.2.3.img /sdcard/
adb shell
su
flash_image recovery /sdcard/recovery-RA-heroc-v1.2.3.img
exit
exit
adb shell reboot recovery

Now, the phone will reboot into recovery mode. To preserve our freshly rooted state, we will make a Nandroid backup.

NANDROID BACKUP
*NOTE: These steps assume that you have already entered Recovery Mode on the phone through Terminal "adb shell reboot recovery" or the "Quick Boot" app.*

On phone: Using the trackball, scroll down and select "Nandroid v2.2 backup". This will create a backup of the phone in its freshly rooted state to your SD card, under the nandroid directory.

After it completes the backup, we want to make sure that we have the backup "backed up" by copying it to our Mac (Just in case anything happens to the SD card!).

Select "USB Mass storage on"

After your SD Card appears, copy the contents of the "nandroid" folder to anywhere you wish on your Mac (You are using Time Machine right?)

Once the copy is complete, eject the sdcard in mac and select "USB Mass storage off" on the phone.

NOTE: Nandroid does not backup the contents of your SD card. If you don't want to lose what's on your SD card, MAKE A BACKUP COPY!

From this point forward, if you do something that seems to really mess with the phones functionality, you can simply go back to your Nandroid backup!

RESTORE NANDROID BACKUPS

Select "Nandroid v2.2 restore" *THIS WILL ERASE EVERYTHING ON YOUR PHONE*

Your phone will be returned to the condition it was in as of the last Nandroid backup. You can control which backup is restored by deleting the unwanted, time-stamped folders within the "nandroid" directory on your SD card. If you leave only one time-stamped backup folder, that is the backup that will be restored.

Note that this will leave the custom Recovery ROM we loaded (recovery-RA-heroc-v1.2.3.img) in place.

I actually perform a Restore after every Backup. While this takes extra time, you know your Backup is intact and not corrupted in any way!

If you are looking for a complete factory reset, you will need to scroll up to "TRUE FACTORY RESET (UN-ROOT)"

PREPARE SD CARD FOR APPS2SD (A2SD)
For those unaware, apps2sd allows you to save internal phone memory by placing after-market applications onto your SD card. Most users notice a speed benefit from this.

Select "Wipe SD: fat32+ext2+swap" *THIS WILL ERASE EVERYTHING ON YOUR SDCARD*
Select "USB Mass storage on"

The mounted drive should now be empty. Double-check that it was partitioned correctly by opening Disk Utility and verifying 3 partitions on the sdcard: NONAME, disk1s2, and disk1s3. Close Disk Utility.

LOAD Unofficial MoDaCo 1.2c Core ROM
Forum Post: Unofficial MoDaCo 1.2

Download: Unofficial MoDaCo 1.2c Core
Save this file into: your SD card. (the root of your SD card, probably named "NONAME" if you didn't change it. You can change it to whatever you want though.)
Save the file as: "update.zip" (Or rename it)

Eject your sdcard and Select "USB Mass storage off"

Select "Apply sdcard:update.zip"
Select "Reboot system now"

If it successfully loaded, you now have a fresh load of the Unofficial MoDaCo 1.2c ROM! Congrats!

I would recommend that you create another Nandroid backup. Scroll back up to "NANDROID BACKUP" and follow the steps over again and come back to this point.

Now you are ready for the workarounds!

Guide: Workaround Issues (Unofficial MoDaCo 1.2c)
 
Last edited:

theraginasian

Senior Member
Nov 9, 2009
116
0
Ann Arbor, MI
I made another guide because while many of the forum posts acomplish bits and pieces, my guide provides the overall picture. Root, ROM, and Backup. And my upcoming "Workarond Issues" guide will collect scattered information in a similar fashion.

I find it ironic that I thanked you for your contribution and you find this guide excessive. Would you prefer that I removed the guide?
 

ajones7279

Senior Member
Nov 6, 2007
683
40
Somewhere
www.twitter.com
No not at all. Yours is nice and concise. There's just a lot, that's all. That's why I said it would be nice if a moderator could have merged all the ones that were already written at the end of mine. Didn't mean any harm.
 

theraginasian

Senior Member
Nov 9, 2009
116
0
Ann Arbor, MI
Ah, I see what you mean. To be honest, I am also making this guide for self reference. If most all of the information I need is together its easier to help myself as well as my friends and the community. Thanks again for all your contributions.
 

jonnythan

Senior Member
Oct 27, 2008
1,200
84
Just to raise awareness, Nandroid does NOT back up your apps if you are using AppsToSD as in MoDaCo. You must back up your apps separately.
 

theraginasian

Senior Member
Nov 9, 2009
116
0
Ann Arbor, MI
True, thanks for the heads up. I'll work on a separate guide that details how to backup your other apps. I believe that anything after-market can be backed up and restored through ASTRO though, and this is much easier for most than adb and Terminal commands (push/pull).

The whole 1.56.651.2 Firmware update is also making me wait to post any further guides, as some of my worksarounds may prove useless. It looks like we still have the Apps Renaming and Reverting issue though, and I didn't see the Sprint admin adress such issues specfically.
 

mqguitar

Senior Member
Nov 25, 2009
73
11
Miami, FL
?

ok i did the update to the hero. and now found out about rooting(im new to all this) do i run that program you put in the beginning with windows? and then does that rom resolve the issue with battery with sms and other things the OTA update fixed? or should i get another rom or .img idk what to call it really and what does RUU stand for?
 

Hamspiced

Senior Member
Dec 14, 2009
345
139
Alright,

A couple things to add to this guide, for the complete noob, as I can try to explain it a little more clear.

This should be done prior to doing anything within the guide.

First, connect your phone to your computer and mount your sd card. This can be done by connecting the usb cable, then on your phone, drop down the menu and chose, connect to p.c., Mount SD card. Make a folder and backup your entire sd card to this folder. Once done, delete everything off the card. if you don't, you will run into format and partitions errors later in the guide.

Eject the sd card on the computer, and end usb sharing on the phone. remove the USB cable from the computer.

Next, on the phone Go to Settings > Applications > Development>USB Debugging

Make sure that USB debugging is NOT CHECKED. If its checked later in the guide you will run into errors pushing the files onto the phone.

At this point you can start the guide from the beginning, under the main heading Root Hero [MAC]

I am running OSX 10.6.2 so i ran into a couple of issues.

Next. Under the part where you have to create the .bash file. This file should be saved in your user folder.

/Users/USERNAME where USERNAME is the name of your user account.

For instance my User account is Hamspiced so my user folder is:

/Users/Hamspiced/

when saving the file, uncheck "if no extension is provided, use .txt".


Next, I couldn't copy paste the code because it wasn't parsed properly. This is what i had to do.

And this should be a direct copy paste into terminal. If you don't know how to access terminal click the spyglass in the upper right hand of the screen, and type in terminal. then you should be able to directly copy paste this text.


Code:
cd /Applications/AndroidSDK/tools

./adb push asroot2 /data/local

./adb shell chmod 0755 /data/local/asroot2

./adb shell

 /data/local/asroot2 /system/bin/sh

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

cd /system/bin

cat sh > su

chmod 4775 su

 exit

 exit

As stated you should have root access on the phone. you can verify this by downloading Terminal emulator from the Market, then running the app. Once inside the app if you hold Menu, you should bring up the onscreen keyboard. if you type in "su" (stands for super user) it will change the prompt from $ to #. If yours does not change, start over, something went wrong. If it did change then you can proceed to the next part of this guide.

Next the guide is trying to put the recovery Image to your phone. This doesnt restore your phone, it just puts the recovery portion to it, and it allows you to do all the cool things to your phone, like allow you to create backups, restore backups, and load customs roms.

again i ran into issues with parsing the correct format so these are copy pastes from terminal.

Code:
./adb push recovery-RA-heroc-v1.2.3.img /sdcard/

./adb shell

su

flash_image recovery /sdcard/recovery-RA-heroc-v1.2.3.img

exit

exit

adb shell reboot recovery

If you get an access denied error pushing the recovery image, its because you had debugging turned on prior to connecting your phone to the computer. it must be off, then turned on once the phone is connected.

This will result in headaches, and endless google searching with no results.

Follow the rest of the guide regarding the Nandroid backup this backs up the entire phone settings. you want to save the raw phone backup as well as the backup after you load the rom. both are incredibly important!


Prepare SD Card for Apps2sd….

If when you checked Disk Utility and your SD card didnt partition properly follow these steps.

You must erase everything on your sd card for these steps to work. I ran into errors creating the partition. What i had to do was in the recovery mode chose factory recovery. when the phone restarted i had to go to Settings>Security>Factory Data Reset.

This restored EVERYTHING. THe phone, Sd Card, Etc. Everything was lost, however since in the begining, we made a backup of the SD card, and then we made a backup of our phone, we are fine.

Restart the phone in recovery mode once this finishes and restarts. (Hold Home and Power to turn on)

Next chose Part SD: fat32+ext2+swap this will partition the card properly. Then choose restart phone.

Once the phone restarts, we have to go through the normal steps that we did once we first received the phone for its first bootup. connect it to the computer, transfer over the Nandroid backup that should be saved from the first time you saved it on your phone. then restart the phone again in recovery mode.

Now you need to restore the nandroid backup. since you transferred it over, its the only nandroid backup there is, it will restore the phones origional settings. from here you can load the official MoDaCO rom fine on the SD card that is now formatted properly.


These are about all the issues and resolutions i ran into. Hopefully it helps someone else.
 

ajones7279

Senior Member
Nov 6, 2007
683
40
Somewhere
www.twitter.com
Guess it's subjective. I think I haven't turned off USB Debugging since shortly after I got the phone and didn't run into any problems. It's always on before I plug it in and I haven't ran into any errors while pushing a file to my sd card. Also didn't erase my sd card before I formatted (did back it up though of course) and everything went smooth. Dunno. It's always good to hear from diff people though. Also just edited my thread, thanks for the heads up.
 

quis5550

Member
Mar 14, 2010
7
1
need help rooting htc hero from sprint

i have 1.5 firmware bb version is 1.04.01.09.21 kernel version 2.6.27-533ce29dhtc kernelA@and18-2 build number1.56.651.2 cl85027software 1.56 cant get root on this device can someone please help me :D
 

ajblue98

Member
Aug 19, 2010
5
0
First, excellent guide! Personally, I used Universal Androot (snipurl.com/uaroot) to root my Hero, but this was a huge help in getting the SDK installed!

I'm running into a problem while trying to do the Nandroid backup. When I try to flash the recovery image, I get the following error message....

AJBlue98$ ./adb shell
$ cd /sdcard/
$ su
# flash_image recovery recovery-RA-herocv1.6.2.img
flash_image: not found

I even try the command with the leading "./" and I get essentially the same thing...
# ./flash_image recovery recovery-RA-herocv1.6.2.img
./flash_image: not found

I'm running the latest official Sprint 2.1 ROM on my Hero and Terminal on Mac OS X Snow Leopard 10.6.4 on a late-2009, 17 in. MacBook Pro. Oh, and I installed the Android SDK into another directory (had it installed before I found this tutorial), so here's my $PATH...

-bash: type: /opt/local/bin:/opt/local/sbin:/Users/AJBlue98/soylatte/bin:/Users/AJBlue98/android-sdk-mac_86:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin: not found

Am I missing something? I'll really appreciate the help!

—Adam
 
Last edited:

regaw_leinad

Inactive Recognized Developer
Jan 30, 2010
3,667
3,787
Seattle, WA
www.regawmod.com
First, excellent guide! Personally, I used Universal Androot (snipurl.com/uaroot) to root my Hero, but this was a huge help in getting the SDK installed!

I'm running into a problem while trying to do the Nandroid backup. When I try to flash the recovery image, I get the following error message....



I even try the command with the leading "./" and I get essentially the same thing...


I'm running the latest official Sprint 2.1 ROM on my Hero and Terminal on Mac OS X Snow Leopard 10.6.4 on a late-2009, 17 in. MacBook Pro. Oh, and I installed the Android SDK into another directory (had it installed before I found this tutorial), so here's my $PATH...



Am I missing something? I'll really appreciate the help!

—Adam
yeah, you're missing the "flash_image" binary on your phone lol search xda for it and push it to /system/bin, then try the command again.
 

ajblue98

Member
Aug 19, 2010
5
0
yeah, you're missing the "flash_image" binary on your phone lol search xda for it and push it to /system/bin, then try the command again.

Thanks, regaw_leinad, for the lead! I found a copy of the flash_image file and copied it to my Android SDK folder, but when I try to push it to my phone, I get this:

AJBlue98$ ./adb push flash_image /system/bin
failed to copy 'flash_image' to '/system/bin/flash_image': Permission denied
failed to copy 'flash_image' to '/system/bin/flash_image': Read-only file system
(I rebooted the phone and tried again after my original post. The error message changed. BTW I'm connected via USB with debugging turned on and "Charge only" selected as my connection type.)

I've tried running adb as root, but I get this:

AJBlue98$ ./adb root
adbd cannot run as root in production builds

Again, any help will be greatly appreciated!

—AJBlue98
 
Last edited:

regaw_leinad

Inactive Recognized Developer
Jan 30, 2010
3,667
3,787
Seattle, WA
www.regawmod.com
Thanks, regaw_leinad, for the lead! I found a copy of the flash_image file and copied it to my Android SDK folder, but when I try to push it to my phone, I get this:


(I rebooted the phone and tried again after my original post. The error message changed. BTW I'm connected via USB with debugging turned on and "Charge only" selected as my connection type.)

I've tried running adb as root, but I get this:



Again, any help will be greatly appreciated!

—AJBlue98

ok type

adb shell

then

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

to mount it as r/w

then try the flash image command again.

Adb root or adb remount won't work, because your boot.img isn't patched yet.
 

ajblue98

Member
Aug 19, 2010
5
0
ok type

adb shell

then

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

to mount it as r/w

then try the flash image command again.

Adb root or adb remount won't work, because your boot.img isn't patched yet.

Okay, I did that. I'm still charge-only and debugging turned on, and here's what happened.

(N.B.: I'm on a Mac, so I have to include "./" before running an application in the current directory. Also, I'm including "AJBlue98" in front of my "$" prompts to differentiate my Mac's local prompts from the adb shell prompts.)
AJBlue98$ ./adb shell
$ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mount: Operation not permitted

So I tried these few things...
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /sdcard/
# mv flash_image /system/bin
failed on 'flash_image' - Cross-device link
# exit
$ exit
AJBlue98$ ./adb shell su mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Permission denied
AJBlue98$ ./adb push flash_image /system/bin
failed to copy 'flash_image' to '/system/bin/flash_image': Permission denied
Now I'm completely flummoxed. As always, please help and thanks in advance!

Update: I got frisky, so I tried this, just for the heck of it...
AJBlue98$ ./adb shell
$ su
# cd /sdcard
# ./flash_image recovery /sdcard/recovery-RA-heroc_v1.2.3.img
./flash_image: permission denied
# chmod 755 ./flash_image
# ./flash_image recovery /sdcard/recovery-RA-heroc_v1.2.3.img
./flash_image: permission denied
# su ./flash_image recovery /sdcard/recovery-RA-heroc_v1.2.3.img
Permission denied

Update 2:
I got some help at irc.twit.tv from a good soul in the #twitlive channel, who pointed me to ROM Manager (downloadable from the Market). That just did the whole backup, hey-presto, no flash_image BS required.

Thanks for the help anyway, all!
 
Last edited:

regaw_leinad

Inactive Recognized Developer
Jan 30, 2010
3,667
3,787
Seattle, WA
www.regawmod.com
Okay, I did that. I'm still charge-only and debugging turned on, and here's what happened.

(N.B.: I'm on a Mac, so I have to include "./" before running an application in the current directory. Also, I'm including "AJBlue98" in front of my "$" prompts to differentiate my Mac's local prompts from the adb shell prompts.)


So I tried these few things...

Now I'm completely flummoxed. As always, please help and thanks in advance!

Update: I got frisky, so I tried this, just for the heck of it...


Update 2:
I got some help at irc.twit.tv from a good soul in the #twitlive channel, who pointed me to ROM Manager (downloadable from the Market). That just did the whole backup, hey-presto, no flash_image BS required.

Thanks for the help anyway, all!

sweet, glad you got it worked out :)
there were a few errors in what you did above, but looks like you got everything working without it, so that's good :)