[Tutorial] Root, Unlock, Recovery and flashing a Custom ROM

ixrs

Senior Member
Aug 2, 2011
121
137
0
This is long, but it's nice for noobs because it's detailed. It's honestly kind of fun, I promise. I'm assuming you have WINDOWS. This is based off of the guide by torxx!. It's modified because some of the info is outdated (you don't have to flash the boot.mg separately, for example). If you are NOT a noob you can just look at the "overview" for each step.

UNLOCKING YOUR DEVICE WILL WIPE YOUR DEVICE. THIS IS A SECURITY FEATURE. BACKUP FIRST.

Part 1- gaining unlock token

Overview: go to htcdev.com and unlock bootloader

Be sure you've turned off fast boot option in power menu; usb debugging should be on (settings -> developer options).

Go to http://www.htc.com/www/software/htc-sync-manager/[1] and install HTC SYNC. Alternatively, if you know what you're doing, you can install these drivers:
x86 http://www.mediafire.com/?qabo1tue2v1ky75 x64 http://www.mediafire.com/?8dl8s3l9mr6ggr9

Go on http://www.htcdev.com[4] and create yourself an account on HTCDEV.

Download these adb/fastboot files: http://d-h.st/RvD

Make a new folder anywhere. We'll use C:/fastboot as an example.

Extract the zip downloaded to the new folder

Go Here http://www.htcdev.com/bootloader/[6] and select "All Other Supported Models" and "then begin unlock bootloader" (check the boxes, click proceed, all that good stuff). YOU CAN IGNORE THE DIRECTIONS THAT THEY TELL YOU (and follow this guide instead).

Power off your phone. Power your phone on by holding power and volume down.

Highlight 'Fastboot' the volume buttons then press power to "select".

Plug your phone into your PC and open a Command Prompt. (windows XP - Click Start > Run > type CMD in box then press OK; Windows 7 - Click Start > type CMD in search box then press Enter) Change directory to your folder where we put fastboot files by typing cd c:\fastboot for example.*

*Alternatively, you can just hold down shift and right click in the folder and select "open command window here". Neat huh?

Type this into your command prompt window: fastboot oem get_identifier_token

Select & copy the text as per step 9 on the HTCDev website

Paste your identifier token into the box at the bottom and submit

You Will Very Shortly Receive an email from HTCDev with a link to the second part of the instructions and your "Unlock_code.bin" attached

Download the "Unlock_code.bin" from the email and save it to the same folder that we extracted fastboot files

Type this into your command prompt window: fastboot flash unlocktoken Unlock_code.bin

The Display Will change on your phone, press Vol+ to accept and power to confirm.

Part 2

Overview: flash your recovery. Boot into recovery. Turn phone off if it boots into OS. Boot into back into recovery. You're done!


Download a recovery:

TWRP (the one I use): http://forum.xda-developers.com/showthread.php?t=2173870

CWM 2: http://forum.xda-developers.com/showthread.php?t=2172979

CWM: http://forum.xda-developers.com/showthread.php?t=2173863

Place the Recovery file to the folder where the fastboot.exe is.

Same thing as above- boot (volume down + power) into the bootloader and highlight 'Fastboot' the volume buttons then press power to "select".

Do the same thing as with the command prompt above. This time, however, you'll be typing:

fastboot flash recovery "name_of_the_recovery.img"

For example:

fastboot flash recovery openrecovery-twrp-2.5.0.0-m7.img

then type:

fastboot erase cache

From the menu, boot into recovery (use volume to move up and down, power to select). The phone might boot to the OS instead of recovery, don't worry!

Turn off phone then turn on (while holding volume down) to boot back into the bootloader.

TAMPERED shows up, boot into recovery and now your recovery should be working!

Part 3- obtaining root

Overview: flash a super tool


Download a super user tool for root:

SuperSU (I use this one): http://forum.xda-developers.com/showthread.php?t=1538053

SuperUser: http://download.clockworkmod.com/superuser/superuser.zip

Alternatively, download this: http://forum.xda-developers.com/showthread.php?t=2252959. This is a stock rooted rom for ATT. If you download and flash this instead of the super user tool, you're done. (This rom includes super user) Or you can download a custom rom such as this one: http://forum.xda-developers.com/showthread.php?t=2183023

Turn on your phone again (and disable usb debugging) and connect to computer, copy the .zip super user tool to a location you remember ON the phone.

Flash it with the Recovery: Power off your device and then hold the VOL DOWN + Power to boot into the Bootloader Navigate with VOL and Power to Recovery Now flash the .zip:

- install zip from sdcard
- choose zip from sdcard
- select the downloaded SuperSU/SuperUser zip file and flash it
- Reboot now

You're not out of the woods yet! The stock kernel is system write protected, so you still can't modify it (changes won't "stick"). You'll have to flash a custom rom or a kernel if you want stock instead.

I recommend these kernels: http://forum.xda-developers.com/showthread.php?t=2255900 or http://forum.xda-developers.com/showthread.php?t=2233665&highlight=menu

Download it.

Installing custom rom/kernel ("flashing a rom")

Overview: Download Rom, boot into recovery and wipe and then flash.

According to Shenye, even though your device is s-on, you can still flash boot now. So just do this:

Turn on your phone again (and disable usb debugging) and connect to computer, copy the .zip kernel/cutom rom to a location you remember ON the phone.

Flash it with the Recovery: Power off your device and then hold the VOL DOWN + Power to boot into the Bootloader Navigate with VOL and Power to Recovery Now flash the .zip:

- install zip from sdcard
- choose zip from sdcard
- select the downloaded SuperSU/SuperUser zip file and flash it
- Reboot now
 
Last edited:

Hemotherapy

Senior Member
May 5, 2011
207
36
0
Oddity - Did everything, I've got root but I -AM- out of the woods. Was installing bulletproof mod through recovery but it kept failing due to missing a MD5 file or something -- Trying to work that out through that thread atm but anyway, rebooted the phone a couple of times now and I still have root, Tit back up works OR are we talking about things like CPU clocking won't work since it can't rewrite?
 
Last edited:

DannySmurf

Member
Dec 29, 2010
25
2
0
Excellent tutorial. One thing to add:

If you flash the TWRP recovery you link to, after TWRP boots for the first time, if you reboot into System, TWRP will offer to install SuperSU for you; no need to find another to flash. Once the system reboots, you can launch the GUI installer to finish the SU install (it will boot into TWRP and back one more time to do the actual flash).
 

Ken4G

Senior Member
Sep 7, 2011
354
87
0
Buffalo, NY USA
Thank you. Followed this last night. Worked flawlessly. The only thing that threw me was rebooting into recovery. It took maybe 3 or 4 reboots for it to say "TAMPERED" at the top. When it didn't say tampered, it would not boot to recovery.
 

richnanaimo

Member
Feb 5, 2008
14
0
0
Calgary
TELUS?

Excellent tutorial. One thing to add:

If you flash the TWRP recovery you link to, after TWRP boots for the first time, if you reboot into System, TWRP will offer to install SuperSU for you; no need to find another to flash. Once the system reboots, you can launch the GUI installer to finish the SU install (it will boot into TWRP and back one more time to do the actual flash).
Did you happen do run this tutorial on a TELUS device?
 

spitfire2425

Senior Member
Jun 12, 2012
1,561
255
0
Narnia
I'm on ubuntu 13.04 and I get stuck at getting the token. I type in fastboot oem get unlock_identifier_token and it says waiting for device. Tried it with sudo and it says error and sudo ./fastboot and it says no such command.

Sent from my HTC One using xda app-developers app
 

Barsky

Senior Member
Aug 23, 2010
1,344
201
93
MintMobile
Having a really odd problem. I flash the twrp recovery per instructions. I try to reboot to recovery and it seems to try and then, blam, the att boot.
I have tried this from the bootloader, selecting Recovery, as well as from a booted stated using "adb reboot recovery".
Any hints for me? I originally had a silver One and today got my Black One replacement,. Had no issues on the original one. Hmm. Guess I will try CWM.

FYI: Yes I unlocked the bootloader and it says Unlocked in there :)

-I also notice that I seem to go right into fastboot, when I boot the bootloader. Now, I believe that is normal if you have the usb cable attached, but this happens regardless.

-flashed stock recovery back and can get into it. trying twrp again, renaming the file to "recovery.img" just because...and it worked on that stock recovery file :)

-Also, very hard to get into bootloader from powered off state. I may flash RUU_M7_UL_JB_50_Cingular and see if it helps me.
OK, maybe it is the phone or ATT has done something screwy on the latest. I can not even get the RUU install to pass inspection. Wants me to check the connection. I know all my stuff is in order, as I did this all on the previous one. grrr
-Just noticed mine does say Unlocked but it does not say Tampered.

-Crazy. I decided to get a new Unlock token and redo the unlock with it. Now, the bootloader finally says Tampered and I got into TWRP. I have no idea why, since I would think that if the original Unlock token was incorrect, it would not have unlocked the phone.

So, rather than providing worthwhile information for anyone else having problems, I think this post is probably deletable and that is fine by me should the powers so decide. :)
 
Last edited:
  • Like
Reactions: phuckwithfire

Barsky

Senior Member
Aug 23, 2010
1,344
201
93
MintMobile
How would one go back to locking the device for a return?!?

Sent from my Nexus 4 using xda premium
fastboot oem lock

but, it will say relocked. nobody cares or seems to check. also, it will say tampered until you restore a stock ruu to flash. I used RUU_M7_UL_JB_50_Cingular.exe for mine when switching from silver to black. it is the right one for att. sorry, don't have the link to the download anymore.
 

nhshah7

Senior Member
Feb 14, 2009
2,069
568
0
Boston
great writeup! quick comment though, just helped my brother unlock his phone. i had a similar issue to @Barsky above so I decided to try to reflash the recovery. The first time I used the line fastboot erase cache after flashing the recovery and I think that's what caused it to not boot into recovery. The second time I flashed TWRP, I didn't enter that line and voila it worked on the first try!
 

mbroch89

Member
Feb 4, 2011
29
6
0
help please

I seem to be stuck in recovery after installing super su/ rom. I messed up the order and did the rom then su. Any ideas on how I can get it to boot? I tried installing clean rom 2.5 and used the su file i found here ----> http://www.teamandroid.com/2013/03/17/root-htc-one-supersu-android-41-jelly-bean-tutorial/2/

any help is greatly appreciated... I just want my phone back :(

---------- Post added at 09:44 AM ---------- Previous post was at 09:36 AM ----------

also, i did hit factory reset under bootloader/fastboot screen (where it says tampered/unlocked),
 

nhshah7

Senior Member
Feb 14, 2009
2,069
568
0
Boston
I seem to be stuck in recovery after installing super su/ rom. I messed up the order and did the rom then su. Any ideas on how I can get it to boot? I tried installing clean rom 2.5 and used the su file i found here ----> http://www.teamandroid.com/2013/03/17/root-htc-one-supersu-android-41-jelly-bean-tutorial/2/

any help is greatly appreciated... I just want my phone back :(

---------- Post added at 09:44 AM ---------- Previous post was at 09:36 AM ----------

also, i did hit factory reset under bootloader/fastboot screen (where it says tampered/unlocked),
I think the last bit was your problem. You can't factory reset from bootloader. Try to push twrp again in fastboot then load/flash clean romantic, then boot up. It already has root so you don't need to push su.

Sent from my HTC One X using xda app-developers app