Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
View Poll Results: Do you have a Singel Sim or Dual Sim Desire 500?
Single SIim 87 66.41%
Dual Sim 44 33.59%
Voters: 131. You may not vote on this poll

Post Reply

[How to]Root - Install cwm/twrp - Install a custom kernel - Install a custom rom

OP dummie999

4th July 2014, 04:21 PM   |  #1  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
A complete guide on rooting your HTC Desire 500, both single sim and dual sim.
Sorry for my English!

Before you begin, you might want to check for updates on your phone, because it is harder to install an update after your phone is unlocked.

If you see any english mistakes, please pm me about them. English is not my native tongue.

The steps:
1. Unlock the bootloader via htcdev.com
2. Flash a custom recovery, ClockWorkMod or TeamWinRecoveryProject
3. Flash SuperSU
4. Flash a kernel without system write protection

Alternatively:
1. Flash a custom rom
2. Simunlock your device
3. Install Busybox
4. Install an ota upgrade

Everything is at your own risk!
Last edited by dummie999; 13th July 2014 at 12:08 PM.
The Following 9 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:21 PM   |  #2  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
[How to]Unlock the bootloader
On HTC phones, by default, you can not replace a partition on the phone from your computer. To enable this, your phone has to be Unlocked.
There is a very good video guide about this, made by @Fliwatt: http://www.youtube.com/watch?v=yWLK5XhsVAE

Unlocking your bootloader will wipe all your data!
Unlocking your bootloader may void your warranty!


It is, however, necessary to root your phone. Currently, there is no other way to unlock the phone or install a custom recovery.

To start, go to http://www.htcdev.com
Then in the top bar, click register. Create an account and fill in all your data. You will get an e-mail from HTC and your account will be activated.

Once you are logged in on the site, you need to go to "Unlock bootloader", and then click get started. On the right, you see a dropdown box. Click it, and select "All Other Supported Models", then click "Begin Unlock Bootloader"

Next install fastboot. I'm not gonna hold your hand here, there are 400+ tutorials on installing fastboot, for every OS you can think of. Search for one and install it.
And, if you are on windows, then install HTC sync as well, pretty basic, even a Windows user should be able to do it

Next, on your phone, got to Settings->Battery and scroll down. There, disable the checkbox "fast boot" (not to confuse with fastboot, that's something entirely different).

Once you have done that, shut down your phone, then hold the volume down button, and the power button. This is commonly referred to as "booting into fastboot".
To move around in the fastboot menu, you need the volume keys to go up and down, and the power keys to select an option.

If the options you can choose from are:
Quote:

FASTBOOT
RECOVERY
FACTORY RESET
SIMLOCK
SHOW BARCODE

then you need to navigate to fastboot, and then hit the powerkey.
The option you can choose from must be:
Quote:

BOOTLOADER
REBOOT
REBOOT BOOTLOADER
POWER DOWN

Then, on your computer, type:
Code:
fastboot oem get_identifier_token
Your output will be something like:
Code:
...
(bootloader)    
(bootloader) < Please cut following message >
(bootloader) <<<< Identifier Token Start >>>>
(bootloader) 2ADE05B9466F0DD398559C7B5A6D636F
(bootloader) 70E8FB65B9523AE73B8A22DDCD0092A2
(bootloader) D52C617B971383374332044C0D04C492
(bootloader) 707A43C4AAEC77A36DDE3060F7665574
(bootloader) 22453BF1F9FDCA6E2118385B96A3C88B
(bootloader) 4FE90D89BC086A9E9B0EA2086456D658
(bootloader) 5831DBA6ADF940D3B0DD0618B745DD18
(bootloader) AE37DC63341E4CBC66A8ACCB494E6AEE
(bootloader) 5982C1432A5C5535836953243D6B8353
(bootloader) 648EFDFD3B5F0C6D47987A0F47BC1A9F
(bootloader) 0ABF9438C059A604832ABB87696CFDD7
(bootloader) 1847D317701DC2C140294FD486109872
(bootloader) 559EE22C73E4F2F9B00AF03FB12A9F9D
(bootloader) 61DFDDD3FAB40CD8537F300078566632
(bootloader) 2142B7EC56E99DD8C4DFB1B819F9F449
(bootloader) 9B2DB0EA3E2FB18C293BD246012909ED
(bootloader) <<<<< Identifier Token End >>>>>
OKAY [  0.076s]
finished. total time: 0.076s
Don't use this code, it won't work. Do it yourself!

Troubleshoot:

Problem: I get
Code:
...
FAILED (status malformed (1 bytes))
finished. total time: 0.000s
Solution: Select the fastboot option with the powerkey.

Copy the relevant part to the HTC dev site, and submit your token. You will (should) get an e-mail that contains your unlock code. Save the attachment (Unlock_code.bin) to a location where you can find it.

Next type:
Code:
fastboot flash unlocktoken Unlock_code.bin
If you are in the same location as your unlock code, of course.

On your phone, you will now see a screen where you have to confirm that you want to unlock your phone, and that it will wipe all your data, and may void your warranty. Use the volume buttons and the power button to choose what you want.

If you selected that you want to unlock your device, then:
Congrats, your bootloader is unlocked

But hold it, before you reboot your phone to confirm that you will have to re-type your very long wifi password, you might as well continue to installing a custom recovery:
Last edited by dummie999; 5th July 2014 at 07:39 PM.
The Following 8 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:21 PM   |  #3  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
[How to]Install a custom recovery
This is actually quite easy, if you just unlocked your bootloader. The only trick will be selecting the right recovery to flash

Dual sim users, be careful here. On some phones flashing cwm or twrp causes serious bootup issues. I don't know a fix, since I only have single sim.
Not everybody has problems, however.

Now, there are two things you need to think about when choosing a recovery:
1. Do I have hboot 1.03 or a lower version
2. Do I want ClockWorkMod or TeamWinRecoveryProject (both are usually abbreviated as you might expect)

1. To check your hboot version, boot your phone into fastboot mode (you got this, check the post up there ^). The third line will be something like:
HBOOT-1.02.0001 or HBOOT-1.01.0001 or HBOOT-1.03.0001. As you might have guessed, this is your hboot
2. cwm or twrp, that's the question.
Cwm is a no touch recovery. That means you have to use the powerbuttons/volumebuttons to move around which is quite annoying. Twrp however, is a touch recovery, much easier to use.
But with twrp, adb doesn't work, which can sometimes be useful if you are a developer.

So, it's your choice: twrp or cwm. (My recommendation? It doesn't matter. Pick one)
Downloads:
hboot 1.02 and below:
ClockWorkMod
TeamWinRecoveryProject
hboot 1.03:
ClockWorkMod
TeamWinRecoveryProject
Credits for cwm go to @SPSPaWn and credits for the fix of the dancing screen go to @galaxyfreak
(credits for twrp go to me)
Now, assuming your phone is still in fastboot:
Code:
fastboot flash recovery recovery.img
Or recovery_cwm.img etc. I assume you get it.

Wait for it to finish, and then hit BOOTLOADER, and then click one down to RECOVERY, and select it. Your phone should now boot into recovery.

Congrats, you now have a custom recovery!

Now, before jumping with joy because you did it, there is one thing you should do before you do anything else!
Make. A. Backup.
Not optional. You need to have a sdcard in your phone. On twrp, touch backup and follow the onscreen instructions (backup all the partitions that are already checked)
On cwm, you will have to use the volume buttons to scroll down to backup and restore, then select backup, and it should begin immediately.

It can take a very long time, depending on your sdcard.


-very long time-


Now, you are ready to actually root your phone.
Last edited by dummie999; 16th October 2014 at 09:37 PM.
The Following 7 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:22 PM   |  #4  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
[How to]Root your HTC Desire 500
Once you have your recovery installed, you can actually root your phone.
Reboot your phone, then download SuperSU, and put it on your sdcard. Then boot into your new recovery another time. Select either "Install" or "Install zip", then install zip from sdcard, and select the SuperSU.zip you downloaded earlier.
Congrats! You now have (partial) root!

Quote:

partial??

Yes, you are not done yet. As an extra layer of security, htc prevents you from editing the system partition, with something called system write protection. To get it away, you need to install a custom kernel.
First, check your software version. You can do this by going to "Settings"->"About Phone"->"Software version".
Mine, for example, is: 1.32.401.3
Now, if your software version starts with 1.20 or something lower, then you must install the Kangbang kernel, else, install the Ultimate kernel.

To install the Kangbang kernel, go here. But the installation instructions are slightly different, basically the only thing you have to do is mount /system, and then flash the zip. Don't forget to mount system!

For installation instruction on flashing the Ultimate Kernel, go here.
Remember, you already flashed a superuser app.

Troubleshoot:
Problem: After installing the kernel I cannot make phone calls
Solution: Install the right kernel, according to your software version


Once you have one of the kernels installed, then your phone is fully rooted!
Last edited by dummie999; 13th July 2014 at 12:18 PM.
The Following 9 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:22 PM   |  #5  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
wip install rom
The Following 3 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:22 PM   |  #6  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
[How to]Install an ota upgrade
After unlocking your bootloader, the installation of ota (over the air) upgrades fails, because it requires a locked bootloader.
Steps to install the upgrade anyway:

Part 1:
First, you need to download the ota. Next, pull the zip to your computer, it should be located in your downloads folder.
Next, open the zip and remove the file firmware.zip, you will need it later. Next, open in the zip the file META-INF/com/google/android/updater-script. There, you need to remove this part:
Code:
ifelse( is_ship_bootloader(getprop("ro.bootloader")) == "t" ,
assert(check_cid(getprop("ro.cid"), "00000000" , "11111111" ,
"22222222" , "33333333" , "44444444" , "55555555" , "66666666" ,
"77777777" , "88888888" , "99999999" , "HTC__001" , "HTC__E11" ,
"HTC__102" , "HTC__032" , "HTC__Y13" , "HTC__M27" , "HTC__A48" ,
"HTC__J15" , "HTC__203" , "HTC__304" , "HTC__N34" , "HTC__405") == "t");
);
ifelse( is_ship_bootloader(getprop("ro.bootloader")) == "t" ,
assert(check_mid("full", "0P3Z11200") == "t");,
assert(check_mid("simple", "0P3Z11200") == "t");
);
assert(getprop("ro.product.device") == "z4u" ||
getprop("ro.build.product") == "z4u");
What you find might slightly different. For example, z4u might be z4dug, if you are on dual sim. But it usually starts at the second line of the file, so it should be to hard to find.
Then, restore the first nandroid back-up you made, because the ota checks if the files on your system partition are modified.
Next, you push the zip back to the sdcard again, and then flash it via your custom recovery.

Part 2:
While you are still in your recovery, make a backup of only your data partition! Don't make a backup of your complete system!
Now, to flash the firmware.zip, you need to lock your bootloader. Because you will have to re-unlock your bootloader after you are done, you will lose all your data again. If you are S-off, then you don't have to relock your bootloader, you can skip this.

How to re-lock your bootloader:
1. In recovery, select: Reboot Bootloader
2. Connect your phone to fastboot
3. Type: fastboot oem lock
That was easy! Your phone, however, might not boot. Don't worry about that, we will fix that later.

Now, type:
Code:
fastboot oem rebootRUU
fastboot flash zip firmware.zip
This can take a short while.
Next:
Code:
fastboot reboot
You now have flashed the firmware.zip

Congrats, you have the ota installed.
It might be a good idea to keep your modified ota around, you might need it later on.

Now, you can unlock your bootloader again (htc dev, second post), check your hboot version again, install a custom recovery again (make a new backup. Don't throw away your old backup), root your phone again etc.
You can now install The Ultimate Kernel!

Credits go to @ricardo-nl, this post http://forum.xda-developers.com/show...597314&page=45

To do: Make a cool bash/awk script that removes all the assert(), so the updating won't fail if you have deleted some system files.
Last edited by dummie999; 11th October 2014 at 10:03 PM.
The Following 8 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:23 PM   |  #7  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
[How to]Simunlock
To sim unlock your device, you need to have CWM on your device and you need to have adb installed.
It doesn't work with twrp, because adb doesn't work.
Boot your device into cwm. Connect your device to your computer (with the cable), and connect with:
Code:
adb shell
then, type:
Code:
strings -n 8 /dev/block/mmcblk0p7
The output will be a lot of rubbish, but you need to
Quote:

look for a 8 digit combination that MAKES SENSE for a CODE.

And In the case of ATRAC3, it was K65151479, so his unlock code was 65151479. I haven't tested this myself, because my device was never sim locked, but it should work.
Full credits for this go to @ATRAC3, this post.
Last edited by dummie999; 4th July 2014 at 09:43 PM.
The Following 6 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:23 PM   |  #8  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
[How to]Install busybox and Xposed
Requires: full root (custom kernel!)

Install busybox:
Easy: Install this app. Then open it, and click install.
Told you it was easy!

Xposed framework:
Well, this is basically outlined here: http://forum.xda-developers.com/xpos...gelog-t2714053. I can't bring it easier. But remember it requires full root!
Last edited by dummie999; 12th July 2014 at 10:13 PM.
The Following 2 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:23 PM   |  #9  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
[How to]Get a logcat and a dmesg
Well, everything is done and working. You have rooted your phone, installed a custom kernel and a custom rom, and everything is working fine.

But, then, at once, you get: "unfortunately camera has stopped" and your camera app refuses to start. And now, when you tell the dev that the camera is not working, he replies:
Quote:

logcat. dmesg.

So, I'll explain what they both are:
dmesg - This is basically a print of /devlog/kernel_log. All the messages from the kernel get stored there. If you think a problem is kernel related, you should at least include this.
logcat - This is a print of /devlog/system_log. All other messages get stored there. If you think something is related to a rom, you should at least include it.

It requires you to have adb installed.

How to get one:
1. Enable adb on your phone. Go to Settings->Developer Options->enable it->enable USB-debugging
2. Next, connect your phone with a cable, and type (on the computer cmdline): adb devices
You should see something like: SH3BRWE00258 device. This means your phone is succesfully connected.

If you want a logcat, now type: adb logcat > logcat
This stores all the logs in logcat. You have to let this run for a few seconds, and then hit ctrl+c. Then, there should be a file called logcat, containing, well, your logcat.

If you want a dmesg, type: adb shell
Then, you need to check, whether the text you see ends with a #. If it doesn't, type: su, and then unlock your phone. You might see a warning, asking for superuser access, grant it.
If you are sure it ends with #, then type: dmesg > storage/sdcard0/dmesg
The dmesg is then stored on your sdcard (called dmesg), pull it to your computer and post it on the forums.
Last edited by dummie999; 23rd August 2014 at 09:44 AM.
The Following 3 Users Say Thank You to dummie999 For This Useful Post: [ View ]
4th July 2014, 04:27 PM   |  #10  
OP Senior Member
Thanks Meter: 353
 
684 posts
Join Date:Joined: Mar 2014
More
Tips for further reading
Some places where you might want to look for more info:
1. http://xda-university.com/ is a good start. Read the "As a user", and perhaps the "As a developer" as well.
2. http://forum.xda-developers.com/show....php?t=1877040 a good guide on github
3. http://forum.xda-developers.com/show....php?t=1680928 and http://www.htcdev.com/bootloader/about_unlock_process Some info about S-off and why you probably don't need it.

A word about posting a proper question:

be short, but post everything, for example:
bad:
Quote:

My recovery doesn't work

ok:
Quote:

I installed the recovery_cwm.img from this thread but the backup doesn't work, i'm on hboot 1.02 btw

better:
Quote:

Making a backup of /system doesn't work in cwm. Steps:

unlocked htcdev
fastboot flash recovery recovery_cwm.img
hboot: 1.02
software version: 1.32
kernel: whatever@kernel

This way I don't have to ask "what is your hboot version" etc.
Last edited by dummie999; 21st August 2014 at 05:42 PM.

The Following 3 Users Say Thank You to dummie999 For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes