5,594,077 Members 46,559 Now Online
XDA Developers Android and Mobile Development Forum

How to root the CDMA Hero

Tip us?
 
chuckhriczko
Old
#1  
Recognized Developer - OP
Thanks Meter 41
Posts: 1,083
Join Date: Aug 2008
Location: Walnutport, PA

 
DONATE TO ME
Default How to root the CDMA Hero

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://forum.xda-developers.com/atta...2&d=1257621154. Unzip that file and place it in a directory of your choice. Also download http://www.androidspin.com/downloads...roc-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!
The Following User Says Thank You to chuckhriczko For This Useful Post: [ Click to Expand ]
 
rockcrawler
Old
#2  
rockcrawler's Avatar
Senior Member
Thanks Meter 3
Posts: 214
Join Date: Nov 2009
Location: Elk Grove, CA
Quote:
Originally Posted by chuckhriczko View Post

adb shell flash_image recovery recovery-RA-heroc-v1.2.3.img
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?
 
Treefallingquietly
Old
#3  
Member
Thanks Meter 0
Posts: 51
Join Date: Nov 2009
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.
 
Treefallingquietly
Old
#4  
Member
Thanks Meter 0
Posts: 51
Join Date: Nov 2009
Quote:
Originally Posted by rockcrawler View Post
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?
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?
 
chuckhriczko
Old
#5  
Recognized Developer - OP
Thanks Meter 41
Posts: 1,083
Join Date: Aug 2008
Location: Walnutport, PA

 
DONATE TO ME
Quote:
Originally Posted by rockcrawler View Post
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
Old
#6  
rockcrawler's Avatar
Senior Member
Thanks Meter 3
Posts: 214
Join Date: Nov 2009
Location: Elk Grove, CA
Quote:
Originally Posted by Treefallingquietly View Post
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
Old
#7  
Recognized Developer - OP
Thanks Meter 41
Posts: 1,083
Join Date: Aug 2008
Location: Walnutport, PA

 
DONATE TO ME
Quote:
Originally Posted by Treefallingquietly View Post
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.

Quote:
Originally Posted by Treefallingquietly View Post
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.

Quote:
Originally Posted by Treefallingquietly View Post
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
Old
#8  
Recognized Developer - OP
Thanks Meter 41
Posts: 1,083
Join Date: Aug 2008
Location: Walnutport, PA

 
DONATE TO ME
Quote:
Originally Posted by rockcrawler View Post
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
Old
(Last edited by rockcrawler; 8th November 2009 at 03:06 AM.)
#9  
rockcrawler's Avatar
Senior Member
Thanks Meter 3
Posts: 214
Join Date: Nov 2009
Location: Elk Grove, CA
Quote:
Originally Posted by chuckhriczko View Post
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?
 
Active666
Old
#10  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Jul 2006
Quote:
Originally Posted by rockcrawler View Post
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?
yes he left out the /sdcard/in the path and if you are in teh shell you don't need the adb portion of the command.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes