How to root the CDMA Hero

Search This thread

chuckhriczko

Inactive Recognized Developer
Ok everyone. First off do not update your phone if Sprint offers an upate. I don't think they are going to but if they do anytime soon and you update this exploit could likely be fixed. When updates are released the devs will make updates that keep root so do not update!

That said, this is a very newbie guide. This is meant for Windows but I will post instructions for linux as well (Ubuntu). I just need to warn you that I can't adb into my phone from Ubuntu so I have to do it through Windows. Don't know why it doesnt work but it doesnt. Mac users you can always (assuming you can get it to work in Ubuntu) download a live cd and boot into Ubuntu to try this. I don't have a mac (nor do I want one) so I can't give instructions (though I assume they should be relatively the same).

Step 1:
First you need to download the Android SDK. It may soumd confusing but it's not. There are tools in here that we need. You can get it from http://developer.android.com/sdk/index.html. This is a modular SDK and all the tools we need are in this download. Once downloaded you just need to extract it in a directory of choice.

The next thing we download is asroot2. This is a script that was developed that runs an exploit in Android's linux that allows us to run root. The link for that is here: http://xdaforums.com/attachment.php?attachmentid=244212&d=1257621154. Unzip that file and place it in a directory of your choice. Also download http://www.androidspin.com/downloads.php?dir=amon_ra/RECOVERY/&file=recovery-RA-heroc-v1.2.3.img and place that into the same directory you extracted asroot2.

Step 2:
Connect the phone to the USB port.

Ubuntu is easy for this (again assuming it works for you). Simply open a terminal and cd into the directory that you extracted the sdk into. Then cd into the tools directory. Then run the following commands:
sudo ./adb push /directory_you_placed_asroot2/asroot2 /data/local/
sudo ./adb shell chmod 0755 /data/local/asroot2
/data/local/asroot2 /system/bin/sh
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4755 su

If all goes well you should be presented with a new prompt. This is the linux terminal built into Android. This will allow us to execute all the commands we need to execute because the asroot2 script gave us root access.

In Windows it is a little more difficult. You have to first install the driver for the phone. When Windows asks you for the drivers direct Windows to the directory you extracted the SDK into. You should see a folder called usb_driver. If you are running the 32 bit version of Windows select the x86 folder. If you are using a 64 bit version then select the x64 folder. Then select the android_usb.inf file. This should install the drivers.

If running XP or lower you will need to go to the start menu and click run, then you enter cmd and press enter. If Vista or higher you will press the start button and type cmd and press enter. When you are at the command prompt you cd to the directory you extracted the sdk into. Then cd into the tools directory. Then execute the following commands:

adb push /directory_you_placed_asroot2/asroot2 /data/local/
adb shell
chmod 0755 /data/local/asroot2
/data/local/asroot2 /system/bin/sh
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4755 su

Now your phone is officially rooted! We arent done yet though. Now you need to flash the recovery image. If you are still in adb shell type in exit until you are out. You should be in the directory where you extracted the recovery image. If not go there. Type in the following:

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

Once that is done, type in adb shell (or sudo ./adb shell in ubuntu). If your command prompt is a dollar sign then type in su and press enter. If it is a pound sign you are good. Then type in the following:

adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img

Once that is finished you are done. To reboot into recovery type in adb shell reboot recovery. You should reboot into recovery mode. Right now there is not a lot you can do but once we have some devs who make some roms then we will be well on our way to an even more awesome phone. Any questions please ask away. Also, I am sorry if this tutorial is hard to understand or badly laid out. My daughter is crawling all over me so it's hard to type or think. Good luck all and thanks to everyone who rooted this phone and made the recovery and did such a great job!
 
  • Like
Reactions: ssojyeti2

Treefallingquietly

Senior Member
Nov 6, 2009
51
0
You beat me to it!!!! I was planning on laying out the steps to make sure I had my head on straight.

To continue with your guide: (The following are questions, not procedures)

1. We run a Nandroid back up to lock in our stock ROM so if we ever do something stupid, aka brick the phone, we can push this back on?

2. What comes on the SD card? Is it needing to be backed up when I go to a 16GB class 6 card?

3. Insert the new SDcard and use the ext2/swap/fat32 script

4. convert ext2 to ext3, (now ready for apps2SD?)

Anything else you can add would be nice.

Again thanks for the steps! They are clear for me.
 

chuckhriczko

Inactive Recognized Developer
Is this the right command, every time I try I get : "adb: not found"

The transfer to the sd card seemed to go fine, and I am @ root (#).

Am I missing something?

You may currently be in adb shell already. If you are showing the pound sign this is likely. The command is supposed to be run outside of adb shell. Try the command below:

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

rockcrawler

Senior Member
Nov 7, 2009
214
3
Elk Grove, CA
Sounds like you need to add the directory where you have adb to be added to he path. is your adb in the same dir as the image?

I apologize, but that went right over my head.

I have used this command to copy the image to the sd card.

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

I got this output:

Code:
C:\androidSDK\android-sdk-windows\tools>adb push recovery-RA-heroc-v1.2.3.img /s
dcard/
1640 KB/s (3352576 bytes in 1.996s)
I then do the following with the noted result:
Code:
C:\androidSDK\android-sdk-windows\tools>adb shell
$ su
su
# adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img
adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img
adb: not found

Any help as to where I making my mistake would be greatly appreciated.
 

chuckhriczko

Inactive Recognized Developer
You beat me to it!!!! I was planning on laying out the steps to make sure I had my head on straight.

To continue with your guide: (The following are questions, not procedures)

1. We run a Nandroid back up to lock in our stock ROM so if we ever do something stupid, aka brick the phone, we can push this back on?

Yes. A nandroid backup completely backs up every piece of information on your phone. It is a complete image of your phone and if it needs to be restored for whatever reason you just load up recovery and can restore it the way it was before.

2. What comes on the SD card? Is it needing to be backed up when I go to a 16GB class 6 card?

What do you mean exactly? The only thing that gets copied to an sd card is the nandroid backup so yes, when switching to an sd card just do another backup. Or you can also copy the nandroid folder from your existing sd card to your new one.

3. Insert the new SDcard and use the ext2/swap/fat32 script

4. convert ext2 to ext3, (now ready for apps2SD?)

Yes and no. Just run the ext2/swap/fat32 script and it should be ready for apps2sd. You can convert to ext3 if you want. Generally on normal hard drives ext3 is faster, however there has been some controversy with that on android phones. As for converting to apps2sd, right now the best way is probably the manual method which I can write up a tutorial on as well. The dream forum has some good tutorials on it as they were the first to do it. I actually need to go back and re read some of those because it's been so long since I did it. I tried the apps2sd apk but that didnt seem to work for me.
 

chuckhriczko

Inactive Recognized Developer
I apologize, but that went right over my head.

I have used this command to copy the image to the sd card.

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

I got this output:

Code:
C:\androidSDK\android-sdk-windows\tools>adb push recovery-RA-heroc-v1.2.3.img /s
dcard/
1640 KB/s (3352576 bytes in 1.996s)
I then do the following with the noted result:
Code:
C:\androidSDK\android-sdk-windows\tools>adb shell
$ su
su
# adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img
adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img
adb: not found

Any help as to where I making my mistake would be greatly appreciated.

Yeah. The problem is that you are trying to adb shell twice. After you adb push then just run the command adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img. That should work.
 

rockcrawler

Senior Member
Nov 7, 2009
214
3
Elk Grove, CA
You may currently be in adb shell already. If you are showing the pound sign this is likely. The command is supposed to be run outside of adb shell. Try the command below:

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

Now I get the Following:

Code:
# flash_image recovery recovery-RA-heroc-v1.2.3.img
flash_image recovery recovery-RA-heroc-v1.2.3.img
error opening recovery-RA-heroc-v1.2.3.img: No such file or directory
#

And this outside adb shell, in the same directory where I did the push:
Code:
C:\androidSDK\android-sdk-windows\tools>adb shell flash_image recovery recovery-
RA-heroc-v1.2.3.img
error opening recovery-RA-heroc-v1.2.3.img: No such file or directory

Ideas?
 
Last edited:

chuckhriczko

Inactive Recognized Developer
Now I get the Following:

Code:
# flash_image recovery recovery-RA-heroc-v1.2.3.img
flash_image recovery recovery-RA-heroc-v1.2.3.img
error opening recovery-RA-heroc-v1.2.3.img: No such file or directory
#

And this outside adb shell, in the same directory where I did the push:
Code:
C:\androidSDK\android-sdk-windows\tools>adb shell flash_image recovery recovery-
RA-heroc-v1.2.3.img
error opening recovery-RA-heroc-v1.2.3.img: No such file or directory

Ideas?

Ok. Most likely you dont have the recovery image in the directory. Try this. Copy the recovery image to the tools directory of the sdk. Then, outside of adb shell, (making sure you are in the tools directory of the sdk) execute the following command:

adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img

This should work as long as you have the recovery image in the correct directory.
 

rockcrawler

Senior Member
Nov 7, 2009
214
3
Elk Grove, CA
Ok. Most likely you dont have the recovery image in the directory. Try this. Copy the recovery image to the tools directory of the sdk. Then, outside of adb shell, (making sure you are in the tools directory of the sdk) execute the following command:

adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img

This should work as long as you have the recovery image in the correct directory.

I am feeling really special, not being able to make this work, but that is the folder that it has been in all this time. I have even downloaded and pushed it several times. :confused: Proof:

sdk_error.PNG


So I am not sure where I am messing up. :confused:

Thanks for all the help and hard work on this BTW!
 

chuckhriczko

Inactive Recognized Developer
I am feeling really special, not being able to make this work, but that is the folder that it has been in all this time. I have even downloaded and pushed it several times. :confused: Proof:

So I am not sure where I am messing up. :confused:

Thanks for all the help and hard work on this BTW!

Meh. Not hard work. Just experience. The hard work is what the rom devs do. And it is difficult at first but once you get it trust me, you get it.Okay let's try this. Go into the command prompt (not adb shell) into the folder where adb and the recovery image is. Try to execute the following command and see if it works.

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

This will put the recovery image on the sdcard. If this works then we will continue.
 

rockcrawler

Senior Member
Nov 7, 2009
214
3
Elk Grove, CA
Meh. Not hard work. Just experience. The hard work is what the rom devs do. And it is difficult at first but once you get it trust me, you get it.Okay let's try this. Go into the command prompt (not adb shell) into the folder where adb and the recovery image is. Try to execute the following command and see if it works.

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

This will put the recovery image on the sdcard. If this works then we will continue.

Done.

Code:
C:\androidSDK\android-sdk-windows\tools>adb push recovery-RA-heroc-v1.2.3.img /s
dcard/
1747 KB/s (3352576 bytes in 1.873s)

C:\androidSDK\android-sdk-windows\tools>
 

chuckhriczko

Inactive Recognized Developer
Done.

Code:
C:\androidSDK\android-sdk-windows\tools>adb push recovery-RA-heroc-v1.2.3.img /s
dcard/
1747 KB/s (3352576 bytes in 1.873s)

C:\androidSDK\android-sdk-windows\tools>

Sweetness. Ok. Now type in the following:

Code:
$ adb shell
$ cd /sdcard/
$ su
# flash_image recovery recovery-RA-heroc-v1.2.3.img

That should work. Note, don't type in the $ or the #. Those are just there to show what the command prompt should look like.
 

rockcrawler

Senior Member
Nov 7, 2009
214
3
Elk Grove, CA
THANK YOU!!!!!

Sweetness. Ok. Now type in the following:

Code:
$ adb shell
$ cd /sdcard/
$ su
# flash_image recovery recovery-RA-heroc-v1.2.3.img

That should work. Note, don't type in the $ or the #. Those are just there to show what the command prompt should look like.

Worked Like a charm, THANK YOU!!! Just booted to the recovery image and all is well.

p.s. Might want to edit the origional instructions, one your daughter goes to bed, to include the cd to the sd card, that is where my problem was. :D
 

chuckhriczko

Inactive Recognized Developer
Worked Like a charm, THANK YOU!!! Just booted to the recovery image and all is well.

p.s. Might want to edit the origional instructions, one your daughter goes to bed, to include the cd to the sd card, that is where my problem was. :D

If I am able to I will. I understand that the instructions were a little hard to follow for beginners which was what I wanted to avoid. Glad you got it working though. Welcome to the world of Android hacking and please enjoy your stay :)
 

WhiteWidows

Senior Member
Jul 27, 2009
839
240
I'm getting suck trying to push the recovery img out to my sdcard

Code:
C:\AndroidSDK\tools>adb push recovery-RA-heroc-v1.2.3.img /sdcard/
cannot stat 'recovery-RA-heroc-v1.2.3.img': No such file or directory

I believe I have root access:

Code:
C:\AndroidSDK\tools>adb shell
$ su
su
#
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Ok everyone. First off do not update your phone if Sprint offers an upate. I don't think they are going to but if they do anytime soon and you update this exploit could likely be fixed. When updates are released the devs will make updates that keep root so do not update!

    That said, this is a very newbie guide. This is meant for Windows but I will post instructions for linux as well (Ubuntu). I just need to warn you that I can't adb into my phone from Ubuntu so I have to do it through Windows. Don't know why it doesnt work but it doesnt. Mac users you can always (assuming you can get it to work in Ubuntu) download a live cd and boot into Ubuntu to try this. I don't have a mac (nor do I want one) so I can't give instructions (though I assume they should be relatively the same).

    Step 1:
    First you need to download the Android SDK. It may soumd confusing but it's not. There are tools in here that we need. You can get it from http://developer.android.com/sdk/index.html. This is a modular SDK and all the tools we need are in this download. Once downloaded you just need to extract it in a directory of choice.

    The next thing we download is asroot2. This is a script that was developed that runs an exploit in Android's linux that allows us to run root. The link for that is here: http://xdaforums.com/attachment.php?attachmentid=244212&d=1257621154. Unzip that file and place it in a directory of your choice. Also download http://www.androidspin.com/downloads.php?dir=amon_ra/RECOVERY/&file=recovery-RA-heroc-v1.2.3.img and place that into the same directory you extracted asroot2.

    Step 2:
    Connect the phone to the USB port.

    Ubuntu is easy for this (again assuming it works for you). Simply open a terminal and cd into the directory that you extracted the sdk into. Then cd into the tools directory. Then run the following commands:
    sudo ./adb push /directory_you_placed_asroot2/asroot2 /data/local/
    sudo ./adb shell chmod 0755 /data/local/asroot2
    /data/local/asroot2 /system/bin/sh
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    cd /system/bin
    cat sh > su
    chmod 4755 su

    If all goes well you should be presented with a new prompt. This is the linux terminal built into Android. This will allow us to execute all the commands we need to execute because the asroot2 script gave us root access.

    In Windows it is a little more difficult. You have to first install the driver for the phone. When Windows asks you for the drivers direct Windows to the directory you extracted the SDK into. You should see a folder called usb_driver. If you are running the 32 bit version of Windows select the x86 folder. If you are using a 64 bit version then select the x64 folder. Then select the android_usb.inf file. This should install the drivers.

    If running XP or lower you will need to go to the start menu and click run, then you enter cmd and press enter. If Vista or higher you will press the start button and type cmd and press enter. When you are at the command prompt you cd to the directory you extracted the sdk into. Then cd into the tools directory. Then execute the following commands:

    adb push /directory_you_placed_asroot2/asroot2 /data/local/
    adb shell
    chmod 0755 /data/local/asroot2
    /data/local/asroot2 /system/bin/sh
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    cd /system/bin
    cat sh > su
    chmod 4755 su

    Now your phone is officially rooted! We arent done yet though. Now you need to flash the recovery image. If you are still in adb shell type in exit until you are out. You should be in the directory where you extracted the recovery image. If not go there. Type in the following:

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

    Once that is done, type in adb shell (or sudo ./adb shell in ubuntu). If your command prompt is a dollar sign then type in su and press enter. If it is a pound sign you are good. Then type in the following:

    adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img

    Once that is finished you are done. To reboot into recovery type in adb shell reboot recovery. You should reboot into recovery mode. Right now there is not a lot you can do but once we have some devs who make some roms then we will be well on our way to an even more awesome phone. Any questions please ask away. Also, I am sorry if this tutorial is hard to understand or badly laid out. My daughter is crawling all over me so it's hard to type or think. Good luck all and thanks to everyone who rooted this phone and made the recovery and did such a great job!
    1
    Might not b called hero rooter but was a one touch apk. Formatted SD so dnt have the apk to check. But originally tried the hero rooter mentioned above. Couldn't complete process due to lack of wifi. All done with handset. Rename flash file HERCIMG.ZIP
    Hope this was helpful. I'm still learning but glad to share any info I can.

    Sent from my HERO200 using XDA

    If your talking about my RegawMOD Hero Rooter, you don't need wifi for it to work...
    1
    Umm Nah first off you mean that it wasn't his method you were referring to. Also his method didn't work for you " for unknown reasons " doesn't mean it was his method. The method your referring to is the method I suggested to you when I sent you the apk. That's how you were able to root you phone and install a recovery.

    Root_Hack-Mod*Always\
    1
    Glad you got everything up and running. If you need anything else let me know.

    Root_Hack-Mod*Always\