Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
theresthatguy
Old
(Last edited by theresthatguy; 11th August 2010 at 06:22 PM.)
#1  
theresthatguy's Avatar
Retired Forum Mod - OP
Thanks Meter 11
Posts: 424
Join Date: Nov 2009
Default [GUIDE] How To Root The Sprint CDMA Hero (Linux)

If you have any suggestions on making this guide better or to correct any mistakes I may have made please let me know.

This guide is intended for any Linux OS and includes detailed instructions. It should work with another Linux OS although I have only verified these steps using Ubuntu 9.10 aka Karmic. includes detailed instructions. This will work with software versions 1.29.651.1 and 1.56.651.2 (aka Android 1.5). It will cover the steps necessary to root, flash the new recovery image, create a full backup. I am not responsible for any damage done to your phone using this guide. Root at your own risk.

Step 1: Download the Android SDK from http://developer.android.com/sdk/index.html The linux file is called android-sdk_r06-linux_86.tgz. Extract the files to your home user directory so that you now have the folder /home/USERNAME/android-sdk-linux. Please note you must replace USERNAME with your own.

Step 2: Download the asroot2 exploit file from http://forum.xda-developers.com/atta...2&d=1257621154 Extract asroot2.zip to /home/username/android-sdk-linux/tools folder.

Step 3: Download the Hero recovery image from http://forum.xda-developers.com/show...5&postcount=1g DO NOT OPEN. Simply place this file in /home/username/android-sdk-linux/tools as well.

Step 4: USB Debugging should be disable before connecting your phone via the USB cable. Connect your phone and now enable USB Debugging.

Step 5: Open a terminal found under Applications>Accessories>Terminal

Step 6: You will now enter a series of commands which I will place in code boxes to indicate the entire command.
A.
Code:
cd ~/android-sdk-linux/tools
B.
Code:
sudo su
C.
Code:
./adb push asroot2 /data/local/
D.
Code:
./adb shell
E.
Code:
chmod 0755 /data/local/asroot2
F.
Code:
/data/local/asroot2 /system/bin/sh
You should see an output that says:
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pope_inode_info layout
Opening: /proc/857/fd/3
SUCCESS: Enjoy the shell.
#
Now for a few last commands.
G.
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
H.
Code:
cd /system/bin
I.
Code:
cat sh > su
J.
Code:
chmod 4755 su
You are now officially rooted. A few more steps and you will have flashed the recovery image.
K.
Code:
exit
L.
Code:
exit
This will return the command line to ~/android-sdk-linux/tools.
M.
Code:
./adb push recovery-RA-heroc-v1.6.2.img /sdcard
N.
Code:
./adb shell reboot
This will cause to power off then back on automatically. Wait till the phone is fully booted to continue.
O.
Code:
./adb shell
P.
Code:
su
Q.
Code:
cd /sdcard/
R.
Code:
flash_image recovery recovery-RA-heroc-v1.6.2.img
FLASHING TO THE RECOVERY TAKES SEVERAL SECONDS-- BE PATIENT. ENTER THE NEXT COMMAND ONLY AFTER THE COMMAND PROMPT RETURNS TO THE # (ROOT SYMBOL).
S.
Code:
reboot recovery
Step 8: This is the last command; You may now close the terminal. It will cause your phone to boot into recovery mode; it should take no longer than 30 secs.
The third option on the list is "- Backup/Restore"; select it. Now, select the first option "- Nand backup". The phone will prompt you to press HOME to confirm which is want you want to do. The backup will begin. You will see the screen say, "Performing backup : .........." When done, the bottom of the screen will say "Backup complete!" and you will be given the menu options again. Go back to the main menu and select reboot system.

Step 9: Once your phone is fully booted, mount the sdcard. You will see a folder called "nandroid"; I highly recommend you copy this to your pc in case you lose your sdcard data or reformat it. Your phone is rooted, 100% backed up, and ready to install a custom rom if you wish!
 
lepri13
Old
(Last edited by lepri13; 13th December 2009 at 12:05 AM.) Reason: aditional info
#2  
Junior Member
Thanks Meter 1
Posts: 21
Join Date: Dec 2009
Location: Dublin
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# sudo su lepri
lepri@lepri-laptop:~/android-sdk-linux/tools$ su root
Password:
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# /adb push asroot2 /data/local/
bash: /adb: No such file or directory
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# ./adb push asroot2 /data/local/
828 KB/s (74512 bytes in 0.087s)
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# ./adb shell
$ chmod 0755 /data/local/asroot2


$ /abd shell
/abd: not found


$ /data/local/asroot2 /system/bin/sh
[+] Using newer pipe_inode_info layout
Opening: /proc/493/fd/3
SUCCESS: Enjoy the shell.
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /system/bin
# cat sh > su
# chmod 4755 su
# exit
$ exit
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# ./adb shell
$ su
# cd /sdcard/
# flash_image recovery recovery-RA-heroc-v1.2.3.img


Thanks for guide but I dont think it worked for me, HTC logo stays on but thats it... have to pull out battery to start the phone phone works but no joy with recovery image ((
I have HTC hero with sim(If this info any use to you)
 
theresthatguy
Old
#3  
theresthatguy's Avatar
Retired Forum Mod - OP
Thanks Meter 11
Posts: 424
Join Date: Nov 2009
Quote:
Originally Posted by lepri13 View Post
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# sudo su lepri
lepri@lepri-laptop:~/android-sdk-linux/tools$ su root
Password:
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# /adb push asroot2 /data/local/
bash: /adb: No such file or directory
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# ./adb push asroot2 /data/local/
828 KB/s (74512 bytes in 0.087s)
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# ./adb shell
$ chmod 0755 /data/local/asroot2


$ /abd shell
/abd: not found


$ /data/local/asroot2 /system/bin/sh
[+] Using newer pipe_inode_info layout
Opening: /proc/493/fd/3
SUCCESS: Enjoy the shell.
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /system/bin
# cat sh > su
# chmod 4755 su
# exit
$ exit
root@lepri-laptop:/home/lepri/android-sdk-linux/tools# ./adb shell
$ su
# cd /sdcard/
# flash_image recovery recovery-RA-heroc-v1.2.3.img


Thanks for guide but I dont think it worked for me, HTC logo stays on but thats it... have to pull out battery to start the phone phone works but no joy with recovery image ((
I have HTC hero with sim(If this info any use to you)
You have a GSM HERO not a CDMA. This guide is intended for CDMA heros only.
 
theresthatguy
Old
#4  
theresthatguy's Avatar
Retired Forum Mod - OP
Thanks Meter 11
Posts: 424
Join Date: Nov 2009
Updated for recovery 1.5.1 image.
 
iamjfarrell
Old
(Last edited by iamjfarrell; 17th December 2009 at 05:30 PM.)
#5  
Member
Thanks Meter 0
Posts: 31
Join Date: Jan 2008
I keep getting the same error of insufficient permissions for device. What am I doing wrong? I disable USB debugging before I plug my phone in. Then I plug my phone in and enable USB debugging and then actually connect my mounting the SD card.

Edit: Ok. I found how to fix the insufficient permission problem...

Code:
./adb kill-server
sudo ./adb start-server
That will get your permissions correct but once I did that, I ran across a new error once I did ./adb shell the second time after the "chmod 0755".

Code:
root@justin-laptop:/home/justin/android-sdk-linux_86/tools# ./adb push asroot2 /data/local/
711 KB/s (74512 bytes in 0.102s)
root@justin-laptop:/home/justin/android-sdk-linux_86/tools# ./adb shell
$ chmod 0755 /data/local/asroot2
$ ./adb shell
./adb: not found
Whats wrong now?
 
iamjfarrell
Old
#6  
Member
Thanks Meter 0
Posts: 31
Join Date: Jan 2008
I couldn't edit my post anymore but I found that it works if I just skip the second ./adb shell. It just caused problems for me because I was already in shell and was coming up with errors. I skipped it and my root smoothly after that.


Part I skipped...
You must replace username with your own actual username.
C. "./adb push asroot2 /data/local/"
D. "./adb shell"
E. "chmod 0755 /data/local/asroot2"
F. "./adb shell"
G. "/data/local/asroot2 /system/bin/sh"
 
iamjfarrell
Old
#7  
Member
Thanks Meter 0
Posts: 31
Join Date: Jan 2008
For some reason the forums are letting me edit my posts. I know I'm wasting space but I would like to give credit to jnwhiteh for the ./adb fix. I searched for it and found it in a different part of the forums.
 
goshi0
Old
#8  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Jan 2010
Default Problem flashing recovery

Thank you for the Howto.

I have no problem with the howto, until i try to flash recovery. It seems its going ok without error messages, but when i try to boot in recovery mode it does'nt work. Remains with the HERO logo in the screen and nothing happens.



Anyone can help me.
 
theresthatguy
Old
#9  
theresthatguy's Avatar
Retired Forum Mod - OP
Thanks Meter 11
Posts: 424
Join Date: Nov 2009
Quote:
Originally Posted by goshi0 View Post
Thank you for the Howto.

I have no problem with the howto, until i try to flash recovery. It seems its going ok without error messages, but when i try to boot in recovery mode it does'nt work. Remains with the HERO logo in the screen and nothing happens.



Anyone can help me.
You're not giving the terminal enough time to flash the image probably. Give it like 10 secs to be on the safe side.
 
goyanks
Old
#10  
Junior Member
Thanks Meter 0
Posts: 15
Join Date: Dec 2009
Default flash image not found

everything works fine up until i get to the part where you actually flash the recovery image, at which point i get an error reading : flash_image: not found
this is my code for the last part.

"root@andrew-desktop:/home/amills/android-sdk-linux/tools# ./adb push recovery-RA-heroc-v1.5.2.img /sdcard
1106 KB/s (3356672 bytes in 2.962s)
root@andrew-desktop:/home/amills/android-sdk-linux/tools# ./adb shell reboot
root@andrew-desktop:/home/amills/android-sdk-linux/tools# ./adb shell
# su
# cd /sdcard/
# flash_image recovery recovery-RA-heroc-v1.5.2.img
flash_image: not found"

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Job Interview Prep: Phone Screen Part 1 – XDA Developer TV

XDA Developer TV Producer Jayce has been very busy creating videos to help … more

Auto Test Your Android Apps with Robotium

You’ve just finished coding your very first app, but before you release it to the wild, you … more

Open Source CPU Info App for Windows

So you’re playing with your shiny new Windows 8 tablet PC, when one of your like-minded geeky … more

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more