[Hero, G2 Touch Android Development] Dayzee:
A GUIDE FOR TOTAL NOOBS to SDK + Rooting of HERO.

Right - a nice clear NOOB guide - I'll asume no previous SDK experience :) and XP Throughout, the stuff you need to type into the cmd will be in quotes " but you DO NOT TYPE THE QUOTES! :) UPDATED FROM EXPERIENCE!

1 GETTING THE SDK and INSTALLING IT

Firstly you need to download the Android SDK (Software Developers Kit if you were wondering) from http://developer.android.com/index.html

They tell you to install it but really, what you need to do is just make sure the unzipped folder with everything in is placed in the root of your main drive (Usually c) so that its easier to point at it I guess. When unzipped, this folder is named something longwinded - I renamed mine to sdk and i'll use that in the following instructions.

2 INSTALLING SDK USB DRIVERS and USB DEBUGGING

Firstly on your device, go to Settings - Applications -Development - USB Debugging and make sure it has a green tick :)

Now you need to install the USB Drivers - Plug your fone in using the USB and it should come up Unknown device and ask you to install drivers - choose the Specific location option and then browse to the USB Driver folder in sdk - for XP choose the x86 folder - if you have a different OS you probably know which one to choose more than me. The drivers should install and the phone is now recognised when you plug it in (Remember if you plug it in a different USB port it may not recognise it again - stick to the same one if you have more than one USB port)

Additional - in my case, when I got to the adb section (Step6), my device wasn't recognised again. I had to do the exact same process above for adb functions. If you get a second pop up later on when starting the adb process, then navigate to the same folder. I had to specifically browse to the x86 folder. Checking USB debugging first should stop this but if not you are forewarned. :)

3 CHECKING ON SDK TOOLS

Firstly have a look in the sdk folder to find the tools folder and make sure you have fastboot.exe and adb.exe in there. If yes then cool and groovy.

4 CHECKING IF FASTBOOT or ADB SEES YOUR HERO.

Shutdown the phone and restart by pressing and holding power and the Back Button - you should be in bootloader - plug in your device to the USB BUT DON'T MOUNT IT!! should now say Fastboot USB on your hero. If you get prompted for drivers or device not recognised on plugging in the USB, follow step 2 again - just to be safe. :)

Open a comand Prompt Window - in XP its in Accessories/system from programs - I dragged the shortcut to my desktop, just so it was easier. You can also get to a command prompt by going to "RUN" and typing cmd (Ta Republik)

Double click and you'll see a line pointing to C drive probably Docs and settings, and your user name. You need to cd (change directory) into the tools folder so type (if you changed the name of the SDK folder to sdk like me)

"cd C:\sdk\tools" (and press enter)

should look like this now C:\sdk\tools>_

Next type in "fastboot devices" and press enter -

You should see something recognised - if nothing happens you need a different driver or more help. It might be worth going through step 2 again by unplugging from the PC then replugging in to force the driver request. (If that fails, ask on XDA for help)

If your device is listed, then you're set to start the Hero Rooting Process.

5 ROOTING!!! BOOTING INTO RECOVERY IMAGE

Now you need to get the recovery image that will allow you to root from here

http://rapidshare.com/files/262621147/cm-hero-recovery.img.zip

Once downloaded, unzip and place the file cm-hero-recovery.img INTO YOUR TOOLS FOLDER IN SDK (Don't forget to Unzip the zip file like I did. LOL You need the .img file in the root of the tools folder)

Now restart your fone into bootloader as mentioned above (HOLDing Back and Power) then plug into the USB and cd into the tools folder (You may already be there if you didn't unplug from before when you checked if the device was seen in part 4 above )

In the command window on your PC type "fastboot boot cm-hero-recovery.img" and press enter. Your fone should boot into a recovery console.

AT THIS POINT YOU SHOULD CONSIDER DOING A NANDROID BACKUP OF YOUR PRE ROOTED HERO ROM - scroll down to the nandroid backup option and press the scrollwheel. Once the Backup is finished, carry on with the next step - the backup will be on your SD Card and if anything goes wrong, can be restored by getting into this recovery console again :)

6 ROOTING - MODIFYING THE CODE TO GET ROOT ACCESSS

enlightener says - download Superuser.zip here http://xdaforums.com/attachment.php?attachmentid=211569&d=1249225060 and extract the contents. You get a folder with two files : su and superuser.apk. Put those two files directly into the TOOLS folder in sdk (Same place as the recovery.img in step 5 above) (superuser.zip contains Superuser.apk and the su binary ) once that's done type the following code into your command window, pressing enter after each line.

"adb shell mount /system"

"adb push su /system/bin/"

"adb shell chmod 4755 /system/bin/su"

"adb push Superuser.apk /system/app/"

"adb shell reboot"

Now your fone should be rebooting itself. At this point you can unplug from USB and let it reboot - it *should* be rooted - You can check by plugging in the USB without mounting - from a Command console cd to the tools directory and then type "adb shell" (You see a little dollar sign) then type "su" (must be lower case) - the Superuser app should ask for permission, click allow always and then you'll see the little rooted # sign - You are rooted!!

Use the script below if you fail anywhere along the line, in case you need to remove the previous Superuser then push it back.

"adb shell mount /system"

"adb shell rm /system/app/Superuser.apk"

(will give error if you don't have it... ignore the error)

"adb push su /system/bin/"

"adb shell chmod 4755 /system/bin/su"

"adb push Superuser.apk /system/app"

"adb shell reboot"

7 CHEcKING IF YOU ARE ROOTED

Download and install a programme from the market that requires root eg

Root Booter and test its functions if this works, you have root! You already have Superuser Permissions installed. Once installed, any programme needing root access must ask for permission (Choose allow always) and this is another way you know root has been successful. Other good ROOT prgs to try are Root Explorer (a great file explorer) bluex (For BT file transfer)

Warning - some folk get errors trying to upgrade to Superuser Whitelist (Including me) - if Superuser Permissions is working fine, leave it as is :)

Additional - Lots of posters reporting that Root Explorer not working as it should on the HTC Hero.

Hope that is NOOB FRIENDLY enough - Love Dayzee.

ALL the info is from this thread or the earlier ones so much THANKS to all involved. Please let me know if I've got any bits wrong or they could be clearer and I'll edit. I know there will be a lot of new to Android folks who need these "Granny suckingEggs" type instructions, because I was one of them 6 months ago!!