After hearing that HTC is helping its customers who want to unlock their phones for developmental work, I had signed in at htcdev.com in June 2012 to request an account. I got a prompt response and created the account. However, at that point the website still had some message for Wildfire users like "we are working on it---please be patient." Obviously, other activities then took priority for me, so I did not go back until recently.
The good news is that the unlocking the bootloader of the HTC Wildfire (aka Buzz) is relative painless and risk-free.
Given that one faces the risk of "brick"ing while messing around with the bootloader on any device. So it is important to know that as far as the usability of the pre-installed software on the phone is concerned, the operation described is identical to a "Reset to Factory Default".
Getting fastboot
and adb
First of all one needs to get the tools adb
and
fastboot
for the computer from which one is going to
access the phone (via USB). One natural location would appear to
be the
Android Developers Website.
As it turns, it is simpler to just install the tools from
Debian (sid
as of now) packages
android-tools-*
.
apt-get install android-tools-adb android-tools-fastboot
android-tools-fsutils
Really "getting" fastboot and adb
It`s not enough to download the tools---one has to figure out how they work! In order to save readers the trouble, here is a quick summary:
- both programs work with a phone/device that is connected to the computer (laptop) over a usb cable.
adb
works with a phone/device that has booted android and has enabled debugging android over the usb "bridge".fastboot
works with a phone/device that is booted into the bootloader and the latter is displaying "fastboot usb" on the phone/device screen.
One can get more details by running "adb -h" and "fastboot -h". One can get even more information from the Android Developers Site.
Backup the data on the phone
The procedure of unlocking will (like a factory reset) wipe out user entered data on the phone. However, it does not touch the micro SD card. Hence, one can save most of the data on that card.
- The "HtcContacts" application allows one to save the contacts list as a "vcard" database on the SD card.
- Ritesh Sahu has written "APNBackupRestore", "SMSBackupRestore" and "CallLogsBackupRestore" which can be used to backup these three lists to the SD Card.
- I could find no way to backup the applications installed
from Google Play. The "obvious" method would be to use a
command like
adb pull /data/app/ download_apps/
after connecting the phone to the computer with USB cable. However, that would not work as /data/app/ appears to need root privileges to read --- and root privilege is what we are trying to obtain!
Luckily, all apps on my phone which I installed were free, so I only needed to note down which these were and install them again.
Studying the bootloader
To begin one must power-off the device and reboot into the bootloader. After power-off one gets to the bootloader on the HTC Wildfie by holding the "Volume Control Button" in pressed position and the press the "Power Button" briefly. The possibly confusing aspect of the bootloader is that it has four screens as follows:
- "FASTBOOT" screen. This is usually the first screen that shows up. The Wildfire then automatically tries to load some zip files from the (micro) SD card --- luckily, I had no files with those names on the SD card!
- "HBOOT" screen. This screen allows one to go to fastboot or recovery.
- "FASTBOOT USB" screen. This screen indicates that the bootloader is in the state which we need to use for the unlocking. This only appears when the USB cable is plugged into the computer.
- "HBOOT USB PLUG" screen. This is the version of the second screen when the USB cable is plugged into the computer.
We can switch between "FASTBOOT ..." and "HBOOT ..." screens by selecting the first option in each screen (which is "BOOTLOADER" in the "FASTBOOT ..." screen and is "FASTBOOT" in the "HBOOT ..." screen). We can switch between each screen and its USB version by plugging/unplugging the USB cable to a computer (which must be powered up!).
Getting the Phone Identifier Token
Once the phone shows the "FASTBOOT USB" screen, one can check that the link between the computer and the phone is working by running the command:
fastboot devices
This should show the phone as one of the devices connected (and it should be the only device connected for the remaining command to work!) by a line like:
List of devices attached
XXXXXXXXXXXX fastboot
We can then run the command to get the phone identifier token as required by the HTC developer website:
fastboot oem get_identifier_token | tee id_token
If you get some "FAILED" message, you are on the wrong screen on your phone. Press the power button to get to the other screen.
The output file needs to be trimmed as described on the HTC
developer web site. The instructions on that web site are pretty
clear. Following those and submitting in the
id_token
obtained above leads to an e-mail send to
the registered address containing the file
Unlock_code.bin
as an attachment.
One uses this file in the command
fastboot flash unlocktoken Unlock_code.bin
to unlock the bootloader of the phone.
Once the unlocking is done, can reboot the phone through the "HBOOT" menu.