FORUMS

[TUTORIAL][LINUX][HOW_TO]Unlocking bootloader and Rooting HTC Explorer in Linux

1,385 posts
Thanks Meter: 3,140
 
By thewisenerd, Senior Member on 23rd April 2013, 10:33 AM
Post Reply Email Thread
Hi everyone at XDA! You might have bought your HTC Explorer, and, even had decided to root it, but, didn't still try because you were on linux, and most of the tutorials talked about using Microsoft Windows?

That isn't a problem anymore. If you have some basic knowledge of linux, you can easily root your device, on a linux machine!!!

There are some advantages of using a traditional linux machine, instead of Microsoft Windows, to root your device. The first and foremost among them, is linux not requiring special drivers. Microsoft Windows needs drivers for almost every smartphone nowadays, but, this is not the case with linux. It is very versatile, and supports many smartphones, natively, without the need to install any extra drivers. The next being that, Android is based on Linux. So, most of the features that you can find on any Linux machine, you can find on Android too (if you know where exactly to look).

Why this tutorial? Many are finding it difficult to unlock their bootloaders on a linux machine, and many, are also finding it difficult, to use linux to root their device.

First, you need to get an understanding of what this “rooting” process is all about.

“Unlocking your bootloader” and “rooting” your device are completely different steps, and unless you get an understanding of them both, you wouldn't be able to go about doing these steps.

To quote @mikevipsr at http://forum.xda-developers.com/show....php?t=1839477,

Quote:

WHAT IS A BOOTLOADER?
The bootloader performs basic hardware initialization, verifies the integrity of the operating system, starts the operating system, and provides a method to update device software. This validation is important to verify that the software loaded on the device will not damage sensitive components (radios, processors, etc.) or violate regulatory or carrier requirements. Google provides a base bootloader as part of the Android operating system, and most device manufacturers optimize this for their specific devices.

Quote:

WHAT DOES IT MEAN TO UNLOCK THE BOOTLOADER?
Unlocking the bootloader is the first step towards gaining root privileges. Some developers and enthusiasts unlock and root in order to experiment with applications or with custom builds of Android. Needless to say, you should not attempt to unlock the bootloader unless you know what you are doing.

So, now that unlocking the bootloader is the first step towards gaining root priviledges, you must also know what “rooting” exactly means.

Quote:

WHAT IS ROOTING?
Rooting is when the user has gained root or administrative privileges on the device. In general, this gives users access to make modifications that would not normally be possible. With such privileges comes both risk and additional capability-best left to the very technically savvy. With rooting, you could make changes to the device that may permanently damage it or render it inoperable.

Ok, so, the risks are permanent damage to device, or an inoperable device. Frankly speaking, I never even bothered about what would happen to my device if I messed up while unlocking the bootloader or rooting it. And, its not because I can afford another phone. Its because I had the hope that I can resurrect it if I mess up things

All to be said has been said. Now, if you wish, you can proceed to unlock your bootloader, or, turn back, having your same old device, with the Stock firmware (and the additional bloatware that comes with it)
The Following 12 Users Say Thank You to thewisenerd For This Useful Post: [ View ] Gift thewisenerd Ad-Free
23rd April 2013, 10:33 AM |#2  
OP Senior Member
Thanks Meter: 3,140
 
More
Info 2 Unlocking bootloader!
Ok, so, you want to unlock your bootloader, and root your device; and not to forget the fact that you are on a linux machine. Please note that this tutorial is made specifically for linux machines, and it WILL NOT work on windows, though the steps are pretty similar.

Now, that you are a linux user, you MUST have the courage to boldly tamper around with your system files and all the stuff, and most importantly, have knowledge about the command line.

The operating system that I would be using for this tutorial is Ubuntu 11.10. This can be done even in Ubuntu 12.10 without any hassles.

Click image for larger version

Name:	01.jpg
Views:	2370
Size:	39.1 KB
ID:	1904793

Some basic terminology I will be using in this tutorial:
1. machine: your PC, or laptop
2. device: your htc explorer
That's it!

So, now, let's get to work.

First, we have to set up ADB and fastboot for our machine. Contradicting the fact that you have to download the massive Android SDK tools and set them up, ITS NOT REQUIRED (if you are just going to root your device). You can simply install them using “aptitude”.

Open up the command prompt, and run the following commands, one by one.

Don't copy-paste them, or, you will never get to experience linux fully.

Code:
sudo apt-get install openjdk-7-jre
Code:
sudo apt-get install android-tools-adb
Code:
sudo apt-get install android-tools-fastboot
Remember that it may ask for your password. Just type in your password and hit “enter”. IT WILL NOT SHOW YOUR PASSWORD!

ADB and Fastboot set up, now, you have to head over to https://www.htcdev.com/register/ and register yourself as a user there.

Click image for larger version

Name:	02.jpg
Views:	2090
Size:	44.5 KB
ID:	1904794 Click image for larger version

Name:	03.jpg
Views:	1734
Size:	33.4 KB
ID:	1904795

Make sure you give a working mail id, because they are going to send you an email with an Unlock_code, with which we will be unlocking the bootloader of your device.

After registering yourself as a user and logging into your account, head over to https://www.htcdev.com/bootloader/.

Click image for larger version

Name:	04.jpg
Views:	1544
Size:	51.8 KB
ID:	1904796

There, you will be given some terms and conditions which you will have to accept. Among all, the most important one is that, you will be losing your warranty.

Click image for larger version

Name:	05.jpg
Views:	1422
Size:	37.4 KB
ID:	1904797 Click image for larger version

Name:	06.jpg
Views:	1312
Size:	33.3 KB
ID:	1904798

So, you will be faced with the HTC's instructions on unlocking the bootloader. We will be skipping most of the steps, because this is Linux. The steps are different, and I will be saying them shortly. Skip to page 3 of the instructions( http://www.htcdev.com/bootloader/unl...uctions/page-3 ) and scroll down to the end.

If you can see a similar image in your browser, you are at the right place.

Click image for larger version

Name:	07.jpg
Views:	2338
Size:	19.7 KB
ID:	1904807

Open up the Terminal in Linux.

Here, we are going to type in some commands which will help us unlock the bootloader.

Before that, take out the battery of your device, and insert it again. Now, switch on the mobile by pressing down the “Power Button + Volume Down Button” key combination.

If you see a screen similar to the one below, you are doing it correctly.

Click image for larger version

Name:	DSCN1433.JPG
Views:	3695
Size:	230.4 KB
ID:	1904827

You can navigate through the four options using the “Volume Up” and “Volume Down” keys. Below are the screenshots, which shows you the option “Fastboot” and “Recovery” highlighted.

Click image for larger version

Name:	DSCN1433.JPG
Views:	3695
Size:	230.4 KB
ID:	1904827 Click image for larger version

Name:	DSCN1434.JPG
Views:	2547
Size:	228.7 KB
ID:	1904831

Now, make sure that “Fastboot” is highlighted, and press the “Power” button to select the option. Now, connect your device to your machine using the USB cable. If you see “Fastboot USB” at top, like in the image below, you are doing it correctly.

Click image for larger version

Name:	DSCN1437.JPG
Views:	2561
Size:	226.2 KB
ID:	1904833

Now, in your machine, you had opened up the terminal (remember?).
Let us make a new directory to avoid confusion. Type in the following commands to make a new directory, and navigate to that directory.

Code:
mkdir android
Code:
cd android
The above commands make a directory named “android” in your home folder, and the next command “cd android” changes the directory i.e. Navigates into the folder which had been created.

Now, in the terminal, type the following command:

Code:
fastboot devices
If you can see a similar image, then, your device is connected properly, and is also identified by your machine.

Click image for larger version

Name:	08.jpg
Views:	4009
Size:	14.3 KB
ID:	1904814

Now, type in the following command.

Code:
fastboot oem get_identifier_token
You will see the following image below.

Click image for larger version

Name:	09.jpg
Views:	3454
Size:	57.9 KB
ID:	1904815

Now, select the data and copy it, by right-clicking on the screen.

Click image for larger version

Name:	10.jpg
Views:	3052
Size:	60.2 KB
ID:	1904816 Click image for larger version

Name:	11.jpg
Views:	2049
Size:	61.5 KB
ID:	1904817

Now, execute the following command.

Code:
gedit
It will open up “GEdit” which is similar to notepad in linux. We now paste the data which we copied using “Control + V” key combination. We need to edit this data, so that it can be recognised by the server.

Click image for larger version

Name:	12.jpg
Views:	1680
Size:	31.3 KB
ID:	1904820

Delete all the <bootloader> text, so that it looks like the following below. If all the lines end at the same place, then, you have done it correctly.

Click image for larger version

Name:	13.jpg
Views:	1958
Size:	26.0 KB
ID:	1904822

Now, press “Control + A” and copy the following data. We have to paste this data into the browser window which was open.

Click image for larger version

Name:	14.jpg
Views:	1709
Size:	33.0 KB
ID:	1904840

Click on the submit button, and an Unlock_code will be sent to your email address. You can close the Gedit program which was open.

Click image for larger version

Name:	15.jpg
Views:	1699
Size:	50.7 KB
ID:	1904844 Click image for larger version

Name:	16.jpg
Views:	1362
Size:	51.5 KB
ID:	1904845

Copy-paste the “Unlock_code.bin” file into the “android” folder, which is in your home directory. Note that this file is small, very small, only 256 bytes of data, yet, is essential.
Attached Thumbnails
Click image for larger version

Name:	DSCN1435.JPG
Views:	1251
Size:	235.0 KB
ID:	1904832  
The Following 16 Users Say Thank You to thewisenerd For This Useful Post: [ View ] Gift thewisenerd Ad-Free
23rd April 2013, 10:34 AM |#3  
OP Senior Member
Thanks Meter: 3,140
 
More
Phone Flashing a Recovery
Now, execute the following command:

Code:
fastboot flash unlocktoken Unlock_code.bin
Click image for larger version

Name:	18.jpg
Views:	1430
Size:	13.3 KB
ID:	1904855

You will see the following screen in your terminal.

Click image for larger version

Name:	19.jpg
Views:	1418
Size:	20.5 KB
ID:	1904856

You will see the following screen in your device. Make sure you select “Yes” using the “Volume keys” to navigate between “Yes” and “No”.

Click image for larger version

Name:	DSCN1438.jpg
Views:	26303
Size:	80.5 KB
ID:	1904859

Click image for larger version

Name:	DSCN1441.jpg
Views:	1136
Size:	68.6 KB
ID:	1904860 Click image for larger version

Name:	DSCN1442.jpg
Views:	887
Size:	63.8 KB
ID:	1904861

On selecting "Yes", your phone will automatically reboot into the operating system. But, that's not what we want. We want to root the device. So, let it boot into your operating system. After it does, pull out the battery again, and boot your phone into “Fastboot” using the “Power button + Volume Down” button key combination. Select “Fastboot” and make sure your device is connected and your device reads “Fastboot USB” on the screen.


Download the following file: http://www.mediafire.com/?a17t0atwqg4tai7

Copy-Paste the file into the “android” folder in your root directory. Now, execute the following command in your phone.

Code:
fastboot flash recovery recovery.img
then,

Code:
fastboot reboot-bootloader
Your device will reboot into bootloader.
Make sure that “Bootloader” is selected and press the “Power” button.

Now, make sure that “Recovery” is selected, and press the power button. If you see a similar image in your device, then, you have successfully unlocked the bootloader of your device, and even flashed a “recovery” which is used to flash custom ROMs.

Click image for larger version

Name:	DSCN1447.JPG
Views:	1387
Size:	252.0 KB
ID:	1904866

Go to “Reboot” and reboot your phone (system), as we have to copy some files to your SD Card.

Click image for larger version

Name:	DSCN1448.JPG
Views:	1081
Size:	245.7 KB
ID:	1904870
Attached Thumbnails
Click image for larger version

Name:	20.jpg
Views:	917
Size:	21.8 KB
ID:	1904857  
The Following 13 Users Say Thank You to thewisenerd For This Useful Post: [ View ] Gift thewisenerd Ad-Free
23rd April 2013, 10:34 AM |#4  
OP Senior Member
Thanks Meter: 3,140
 
More
Rooting the Device!
Now we have to root the device.

Download this file: http://www.mediafire.com/download/0b.../Superuser.zip

Copy this file to your SD Card by whatever means possible

Reboot your phone into “Recovery” and go to “Install”. Browse to the place where you have kept the “Superuser.zip” file.

Click image for larger version

Name:	DSCN1449.JPG
Views:	25474
Size:	252.1 KB
ID:	1904879 Click image for larger version

Name:	DSCN1450.JPG
Views:	25387
Size:	255.0 KB
ID:	1904880

Swipe to confirm flashing the file. Then, “Reboot system”.

Thus, you have successfully rooted your phone.

If you ran into any troubles, please notify in the thread.
The Following 10 Users Say Thank You to thewisenerd For This Useful Post: [ View ] Gift thewisenerd Ad-Free
23rd April 2013, 10:35 AM |#5  
OP Senior Member
Thanks Meter: 3,140
 
More
Wink Reserved
the last one

This is for future updates.

Note: Recovery used in this is TWRP 2.4.1
Using the old superuser.zip (with updated binaries to solve probs when flashing) by jaggyjags, until i figure out something.

Special thanks to @Rishik999, for giving me this idea
The Following 10 Users Say Thank You to thewisenerd For This Useful Post: [ View ] Gift thewisenerd Ad-Free
23rd April 2013, 12:19 PM |#7  
OP Senior Member
Thanks Meter: 3,140
 
More
Thanks. This is my first tutorial. Meanwhile, you can spare me some "thanks" too, in case you haven't spent your 8 thanks per day already

Will make a tutorial on unlocking bootloader using windows as soon as I install windows

Sent from my HTC Explorer A310e using xda app-developers app
The Following 2 Users Say Thank You to thewisenerd For This Useful Post: [ View ] Gift thewisenerd Ad-Free
25th April 2013, 12:52 AM |#9  
Junior Member
Thanks Meter: 0
 
More
First of all thanks! I've been trying to get my phone unlocked and rooted for the longest time and nothing seemed to work for me, I used your guide for my HTC One S and it worked perfectly, I just substituted and renamed Paul's Recovery: http://forum.xda-developers.com/show....php?t=1579584 and Chainfire's SuperSU: http://forum.xda-developers.com/show....php?t=1538053 to make it work. I don't know if either of those steps are necessary, but it worked regardless!

Thanks again!
25th April 2013, 09:14 AM |#10  
OP Senior Member
Thanks Meter: 3,140
 
More
Talking Thanks for the appreciation.
Quote:
Originally Posted by SC54

First of all thanks! I've been trying to get my phone unlocked and rooted for the longest time and nothing seemed to work for me, I used your guide for my HTC One S and it worked perfectly, I just substituted and renamed Paul's Recovery: http://forum.xda-developers.com/show....php?t=1579584 and Chainfire's SuperSU: http://forum.xda-developers.com/show....php?t=1538053 to make it work. I don't know if either of those steps are necessary, but it worked regardless!

Thanks again!

Renaming the recovery wouldn't have been needed. You could have directly done

Code:
fastboot flash recovery *name-of-your-recovery*.img
I had added that step to reduce the confusion.

Meanwhile, Chanfire's SuperSU is what I had originally intended to add in this tutorial, but, decided that it would be better to add the same which jaggyjags had decided to use. Then, users can add any superuser app that they want. You needn't have had renamed the zip file to superuser.zip. You could have just copied the file to your sdcard, and flashed it, whatever its name might be
The Following User Says Thank You to thewisenerd For This Useful Post: [ View ] Gift thewisenerd Ad-Free
25th May 2013, 03:03 PM |#11  
maurici0m0ra's Avatar
Junior Member
Flag Lima
Thanks Meter: 2
 
More
Question No Recovery Window
Quote:
Originally Posted by vineethraj49

Now, execute the following command:

Code:
fastboot flash recovery recovery.img
then,

Code:
fastboot reboot-bootloader
Your device will reboot into bootloader.
Make sure that “Bootloader” is selected and press the “Power” button.

Now, make sure that “Recovery” is selected, and press the power button. If you see a similar image in your device, then, you have successfully unlocked the bootloader of your device, and even flashed a “recovery” which is used to flash custom ROMs.

Attachment 1904866

Hi,

I have done fine every step in your tutorial...

But in this process I think I am not flashing good the recovery.img because, after executing that flash command (I have all Ok in command line), but when I went to Recovery Option in Bootloader I do not get that image which is the one I need to Root the phone. Every time I select "recovery" the only thing I see in the phone is a white screen with the HTC Logo and a red text telling me something like "This built is for development purposes only. Do not distribute outside of HTC without HTC's written permission. Failure to comply may lead to legal action."

What is wrong?
Since Every step I followed is OK.

Quote:

Code:
[email protected]:/home/unity/android# fastboot flash recovery recovery.img
sending 'recovery' (5030 KB)...
OKAY [  2.779s]
writing 'recovery'...
OKAY [  2.083s]
finished. total time: 4.862s
[email protected]:/home/unity/android# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [  0.436s]
finished. total time: 0.436s

Post Reply Subscribe to Thread

Tags
bootloader, explorer, htc, linux, root

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes