[TUTORIAL] Unlocking, rooting, custom roms installing, going back to stock

Search This thread

mielsvs

New member
Apr 27, 2010
3
0
can't get root

Thanks for the guide, written really well.

Something doesn't seem to work for me though. I went through the opening post of this topic:
  • I have succesfully unlocked my device (phone says "UNLOCKED" when entering boot menu)
  • I have installed Clockwork recovery and can enter it
  • I have put Superuser-3.2-RC3-arm-signed.zip on my SD card and I have been able to install it via Clockwork
  • I have (manually) installed the Superuser app
After rebooting I don't seem to have root privileges though:
  • Superusers says (at the tab 'info'): su binary not found
  • Titanium says "can't get root priviliges (..) tried this with the command /data/bin/su
  • Root Checker Basic also confirms this.
NB: When in Clockwork I noticed some log entries in the lower part of the screen:
E: Can't open /cache/recovery/log
E: Can't mount /cache/recovery/last_log

I also tried Superuser-3.1.3-arm-signed.zip

I'm using an HTC Desire X running Android 4.1.1
 

GtrCraft

Recognized Developer
Jun 3, 2013
6,818
17,854
Moto G5 Plus
Xiaomi Poco F1
Thanks for the guide, written really well.

Something doesn't seem to work for me though. I went through the opening post of this topic:
  • I have succesfully unlocked my device (phone says "UNLOCKED" when entering boot menu)
  • I have installed Clockwork recovery and can enter it
  • I have put Superuser-3.2-RC3-arm-signed.zip on my SD card and I have been able to install it via Clockwork
  • I have (manually) installed the Superuser app
After rebooting I don't seem to have root privileges though:
  • Superusers says (at the tab 'info'): su binary not found
  • Titanium says "can't get root priviliges (..) tried this with the command /data/bin/su
  • Root Checker Basic also confirms this.
NB: When in Clockwork I noticed some log entries in the lower part of the screen:
E: Can't open /cache/recovery/log
E: Can't mount /cache/recovery/last_log

I also tried Superuser-3.1.3-arm-signed.zip

I'm using an HTC Desire X running Android 4.1.1

You are using the wrong recovery for your hboot, check your hboot in the bootloader and download the right recovery for that
 

mielsvs

New member
Apr 27, 2010
3
0
You are using the wrong recovery for your hboot, check your hboot in the bootloader and download the right recovery for that

Thanks, didn't know that mattered! Did try some different recoveries even before my previous post, since the opening post said "Some of them have a few bugs". I tried:
  • recovery-clockwork-nontouch-6.1.5 (supplied with Hasoon2000's Desire X all-in-one kit)
  • openrecovery-twrp-2.6.3.0-protou
  • recovery-clockwork-touch-6.0.3.2-protou
Non of them seemed to work.

I'm on Hboot-1.25.0002

But I'm having a hard time finding a (preferably touch) recovery that claims to be compliant.
 

GtrCraft

Recognized Developer
Jun 3, 2013
6,818
17,854
Moto G5 Plus
Xiaomi Poco F1
Thanks, didn't know that mattered! Did try some different recoveries even before my previous post, since the opening post said "Some of them have a few bugs". I tried:
  • recovery-clockwork-nontouch-6.1.5 (supplied with Hasoon2000's Desire X all-in-one kit)
  • openrecovery-twrp-2.6.3.0-protou
  • recovery-clockwork-touch-6.0.3.2-protou
Non of them seemed to work.

I'm on Hboot-1.25.0002

But I'm having a hard time finding a (preferably touch) recovery that claims to be compliant.

Look in the original development secton for recoveries. There can you see which recovery works on hboot 1.25
 

nlooooo

Senior Member
Oct 29, 2011
2,432
817
Nis
Do you want to remain OP of this thread then? I could take over and update, if you like...

I tried that once but didn't got reply from moderators.

Of course I would like, so one more to the moderators:

Dansou901 would like to take over the thread so is there a posibility for that?

Thanks in advance.
 

dansou901

Inactive Recognized Contributor
Apr 10, 2012
3,121
1,209
33
Aachen
OnePlus 5
OnePlus Nord
Good luck to the new OP!

Thanks nlooooo, just edited a few things (removed link to hasooons toolkit as the download links there were removed from mods, instead included link to the new toolkit by WindyCityRockr, also included my hboot guide as resource for recoveries to stop the flashing of inadequate recoveries to the wrong hboots).. I'll update the thread according to things like JB update and nandroid restores tomorrow or later.
 
  • Like
Reactions: Will_Xda

nlooooo

Senior Member
Oct 29, 2011
2,432
817
Nis
Thanks nlooooo, just edited a few things (removed link to hasooons toolkit as the download links there were removed from mods, instead included link to the new toolkit by WindyCityRockr, also included my hboot guide as resource for recoveries to stop the flashing of inadequate recoveries to the wrong hboots).. I'll update the thread according to things like JB update and nandroid restores tomorrow or later.

Nice having someone to keep it alive. Now I track some other threads so I don't have time to track DesX development anymore.
 
  • Like
Reactions: Will_Xda

dansou901

Inactive Recognized Contributor
Apr 10, 2012
3,121
1,209
33
Aachen
OnePlus 5
OnePlus Nord
One little question: As of now, Superuser is deprecated and only SuperSu is maintained properly. Does SuperSu qualify now for initial root as well? I'm asking this because @nlooooo stated it in OP and because of superuser being deprecated I would like to remove that part from the tutorial to avoid confusion...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 56
    Credits go to @nlooooo for starting this thread!

    WARNING
    I’m not responsible for bricked devices, all you do is on your own responsibility. Most of the processes I’ll mention will work with some vital parts of your phone, so if you don’t have enough courage or until you don’t understand all the things you should do I recommend not to get involved with this.


    Ok, there's a tool for almost all of that. Tool is updated, but you need to be sure to click the button for the right recovery, explanation below.
    1. UNLOCKING OF BOOTLOADER
    Everything starts with this. Unlocking of bootloader will allow you to make changes to some critical partitions of your phone (boot, system and recovery) and will allow you to flash custom recovery that can be used for installing of custom roms, mods and all kind of flashable zips. However, it won't s-off your phone, and other critical partitions (bootloader, radio) remain inaccessible.

    So, I won't explain how to do that. Why? Because if you successfully unlock bootloader on your phone it means that you received enough knowledge for the rest of the process and you're qualified to go further.

    This process will factory reset your phone (erase data partition) so backup your stuff before you proceed.

    Ok, now go to htcdev.com, register your account, go to unlock bootloader section, for the device choose 'All other supported models' and follow the instructions carefully everything is explained in details. Pay attention to 'Required resources' on the first page after confirmation - you need Android SDK platform tools Java Runtime Environment and HTC Sync installed and there are all needed links. Files mentioned in step 5 you will find in Android Bundle zip you downloaded in folder adt-bundle-windows-x86_64\sdk\platform tools.
    Here are some useful links about Android SDK platform tools, you won’t be needing most of it but it won't be bad to read.

    Remark: once unlocked bootloader can be relocked but can never be locked again. This can be done issuing command from fastboot:
    fastboot oem lock​
    This means that on the top of you bootloader screen you’ll have a sign RELOCKED instead of LOCKED, which is a notice to HTC that you unlocked it once. Plus they have data about all users that requested unlock_code so they can deny your warranty whenever they want.

    If you’ve successfully unlocked your phone bootloader we can proceed to the next step.


    2. CUSTOM RECOVERY INSTALLING

    - Go to this address:
    There you can find custom recoveries for DesX. Some of them have a few bugs but they are generally functional. Download one of your choice, rename it to recovery.img and put it on the root of c: drive on your PC. Before downloading, read the thread linked to carefully, as it is important to check your hboot before installing a custom recovery.

    Remark: you can use recovery image provided in WindyCityRockr's tool.

    - Go here:
    download SuperSU, connect your phone to PC and put it somewhere on your phone sd card.

    - Do not disconnect your phone from PC, reboot phone to fastboot on one of this ways :
    1. choose restart from power menu and when the screen comes off wait for the buttons to turn off and immediately push volume down, the phone will boot to bootloader, then select fastboot from bootloader menu
    2. issuing command
    adb reboot-bootloader​
    from command prompt that will take you directly to fastboot

    - once you’re in fastboot mode open command prompt, lead it to folder where you installed adb and fastboot (remark: unlocking bootloader guide pointed you to make a folder c:\Android for this) and issue commands
    fastboot flash recovery c:\recovery.img
    fastboot reboot-bootloader
    fastboot erase cache​

    The second and third commands are not quite necessary but they don’t harm and leave your phone with no trails of previous recoveries. Now you can disconnect your phone from your PC.

    3. BACKING UP STOCK ROM
    Now it is really important to backup your stock ROM. Dependent on your CID and hboot version, you can't use RUU to get back to stock, especially if your phone is branded by your carrier. Also, RUUs are only available for ICS bootloader (hboot 1.24 and lower). For JB there are only nand backups for a few CIDs uploaded by some nice xda members. So if you definitely want to be able to get back to stock any time, you'll have to backup your current configuration first. That's done by:
    Reboot your phone to recovery
    Backup -> Select all partitions -> Swipe to Backup​
    That will take some time. After that's finished, you should make a copy of that backup somewhere safe (it's located on the sdcard in folder TWRP, just copy the whole folder somewhere).

    4. ROOTING YOUR PHONE

    - From fastboot menu choose bootloader and then recovery to reboot phone to recovery
    - If you successfully boot to recovery choose options:
    Install zip from sd card
    Choose zip from sd card​
    Navigate to UPDATE-SuperSU-vx.xx.zip you stored on sd card and choose it. Once the installation is finished reboot your phone. Now you should see SuperSU app in app drawer and your phone is rooted.



    5. CUSTOM ROMS INSTALLING
    There are already quite a few ROMs available for our device. But watch out... many of them are discontinued, mostly the CM ROMs as well as the ROMs based off CM. Go here for the index:
    That’s the Index thread I created for all user to track development for our device. There you’ll find roms that can be installed.

    I have to emphasize that every chef gives an instruction how to install his rom, so here I’ll just give you the basics for custom rom installing using custom recovery.

    - Download the rom of your choice and put it on the sd card of your device
    - Unpack boot.img from rom.zip and put it on the root of c: drive on your PC
    - Reboot phone to recovery
    - Choose option ‘wipe data/factory reset’
    - Choose option ‘wipe cache partition’
    - Choose option ‘advanced’ and in next menu choose ‘wipe dalvik cache’
    - Go back to main menu and choose ‘install zip from sd card’ and then ‘choose zip from sd card’
    - Navigate recovery to rom zip you put on sd card and choose it
    - Wait until the installation is finished
    - Reboot your phone to fastboot and connect it to your PC
    - Open command prompt, lead it to folder where you installed adb and fastboot (remark: unlocking bootloader guide pointed you to make a folder c:\Android for this) and issue commands
    fastboot flash boot c:\boot.img
    fastboot reboot-bootloader
    fastboot erase cache​
    - Reboot your phone

    The last few steps are needed since there is no way to s-off our device, so boot.img included in rom.zip has to be flashed separately via fastboot.


    Remark:
    don’t ever forget for the golden rule of flashing ‘Always make a nand backup before you flash something'.


    6. S-OFF
    As S-OFF makes your device vibrating 7 tmes on each boot, you should really think about if you need it. If you are not sure about it, then it's not for you. If you still want to do it, go here:
    Use the first link to get to the files needed to do your S-OFF. In the second link you'll find the things you can do after the S-OFF procedure including downgrading the hboot in order to install RUUs etc.


    Ok, I did what I had promised, all suggestions and corrections are more than welcome.

    All this came as 2 years experience with HTC phones (had Desire and Incredible S before), unlocking, rooting and taking their guts out :D.

    Sources and links posted:
    - HTC Developers site
    - WinDroid HTC Desire X Toolkit v2.1 made by WindyCityRockr
    - Android Developers site
    - Cyanogen Wiki site
    - SuperSU made by Chainfire
    - Thanks to ckpv5 for nand ICS backup thread
    - Thanks to Izzy Stinson for pointing me to things not explained enough
    - Sources for recoveries can be found in my recovery thread
    - Thanks to GtrCraft for the idea to include the backup of stockrom
    - Thanks to nightwalkerkg and the rumrunners team for getting us the S-OFF
    - Again thanks to ckpv5 for the S-OFF tutorial
    23
    Going back to stock for official update

    Now to say more about a reverse part. The point of this is to make your phone available for official updates, and make it possible to do. Thanks to Ranalakshay36 and Bedroom we have information that you can apply OTA without need to relock bootloader on the phone. However, relocking is still mandatory if you want to install a fresh new rom using RUU.

    The first important thing for this is: PEOPLE, MAKE A NAND BACKUP OF STOCK ROM BEFORE REMOVING OF ANY APP FROM SYSTEM OR INSTALLING A CUSTOM ROM!!! This will make this process much easier to do.

    RECEIVING AND OFFICIAL UPDATES INSTALLING

    Part one:

    Ok, you just unlocked bootloader and rooted your phone (no custom rom installed), but you received a notification that you have an official update available and you want to install it. No problem at all if you didn't touch the apps on system partition (some of them are necessary for official support), and all you have to do are these 2 things:

    1. Reinstall stock recovery - I attached it. Remember the part about custom recovery? The process for this is the same:
    - download recovery I attached, rename it to recovery.img and put it on the root of c: drive on your PC
    - reboot phone to fastboot
    - connect it to a PC
    - open command prompt and guide it to the folder where you have adb platform tools installed
    - issue commands
    fastboot flash recovery c:\recovery.img
    fastboot reboot-bootloader
    fastboot erase cache​

    Now your phone should be ready to apply official update.

    Part two:
    1. You installed a custom rom, however you made a nand backup of your intact stock rooted, so all you need is to restore your nand backup and go to "Part one", that will do a thing.

    2. You installed a custom rom, however you didn't make a nand backup of your intact stock rooted, or you deleted some important files from system partiton. So, you're almost scre**d. I said almost because you can ask some of your geeky friends to borrow you his nand backup that you can use for restore.

    The best option is to revert back to stock using RUU, but that's currently limited only for devices with Europe based firmware. Here is the thread I made where you can find info about 1.18.401.1 RUU and CID compatibility and a way to check CID of your phone to make sure you can use it:


    To run RUU you need to relock your bootloader. This is how you can do it:
    - reboot phone to fastboot
    - connect it to a PC
    - open command prompt and guide it to the folder where you have adb platform tools installed
    - issue command
    fastboot oem lock​
    - the phone should restart automatically and you'll have a sign RELOCKED on the top of bootloader screen.

    After you successfully relock bootloader you can run RUU directly from fastboot. With earlier HTC models there was I a way to bypass CID checking and use any RUU to revert back to stock using a GoldCard, but someone told me that it's not possible with Desire X.

    Remark: once you relock bootloader it can be unlocked again in the same way you did it for the first time, and, of course, it will factory reset you phone. Also, going in this order is mandatory, cause if you relock bootloader before you flash stock recovery, you won't be able to do that with relocked bootloader

    If you can't run a RUU because of incompatible CID, you have to have a nand backup ready for restoring or else to find one in the forums. Here is a thread with different nand backups incompatible from the RUUs:

    Follow the instructions in the above thread to restore your backup.


    Credits:
    - Cobje - stock recovery img from latest update (1.18.xx)
    http://xdaforums.com/showpost.php?p=35031493&postcount=25
    - Ranalakshay36 and Bedroom for the intel.
    6
    Reserved once more...
    2
    Good job writing this tutorial!

    One small remark: unlocking bootloader via htcdev will hard-reset the device so all data on the phone will be lost. Might be useful to mention this so users can back-up as much as possible on an un-rooted device.
    2
    i finally unlocked my bootloader and rooted my phone with this method :good:

    i think you should update the command in this "- once you’re in fastboot mode open command prompt, lead it to folder where you installed adb and fastboot (remark: unlocking bootloader guide pointed you to make a folder "c:\Android)" TO "cd c:\Android"

    and also you should also mention that everytime if wish to enter fastboot, you need to remove and reinsert battery. if you go fastboot reboot, then go to fastboot again with voldown + power keys it will not work. you need to remove and reinsert battery then retry then it will work. at least thats what happened to me.

    and also i want you to update this "- Do not disconnect your phone from PC, reboot phone to fastboot on one of this ways :
    1. power it on holding power+vol down then select fastboot from bootloader menu
    2. issuing command" TO "disconnect phone from pc, turn off phone, then remove and reinsert battery then enter fastboot, then connect phone to pc again".

    other than it works smooth and my phone now rooted.