Search

HTC Wildfire - Unlock Bootloader and Flash CyanogenMod under Ubuntu

Contents[Hide]

dropcap-android-cyanogenmod-72

HTC Wildfire

Last week I recovered an old HTC Wildfire and I decided to give it a new youth with latest Stable CyanogenMod 7.2.

Since HTC has changed its policy toward developpers, I decided to unlock its bootloader directly with HTC procedure available on HTDDev Unlock Bootloader official site.

To my surprise, procedure is not that simple, especially if you don't have any Windows OS under the hood.

In fact, you need to upgrade your phone bootloader with one of these HTC specific RUU.exe files, which is not supported under Linux. But, as always under Linux, some people made it possible ...

This guide explains how to convert your fully locked HTC Wildfire mobile phone to a fully open CyanogenMod device, by using only a Linux computer, without the help of any proprietary OS.

It deals with following steps :

  • Unlock bootloader
  • Flash up-to-date ClockworkMod Recovery
  • Flash latest stable CyanogenMod

Even if the target is a HTC Wildfire, you may use this procedure as a framework to unlock bootloader of many other HTC phones (it has been tested on HTC Wildfire S).

All the following steps are done on a Ubuntu workstation, but it should be easily adapted to any other Linux flavour.

As a pre-requisite, you need to have installed Android Tools (ADB, Fastboot, ...) on your computer.

1. Create Udev rule for Fastboot

To be able to detect your HTC Wildfire in fastboot mode on your Ubuntu workstation, first thing is to create the proper udev rules that will allow the system to detect the phone. This udev rule should also handle other HTC phones in Fastboot mode.

Start your HTC Wildfire in fastbot mode (Vol- and Power at the same time when switching on the phone) and connect it thru USB.

# lsusb
...
Bus 002 Device 082: ID 0bb4:0fff High Tech Computer Corp. Android Fastboot Bootloader

Your HTC Wildfire has been detected. Its Vendor ID and Device ID are 0bb4 and 0fff.

The udev rule will be declared in /etc/udev/rules.d/99-android.rules. If file already exists, just append the content at the end of it.

/etc/udev/rules.d/99-android.rules

# HTC Fastboot mode
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0666", OWNER="your-login" # Fastboot mode

Replace your-login with your own Ubuntu login.

Once done, udev service has to be restarted.

# sudo service udev restart

2. Unlock Bootloader

Go to http://www.htcdev.com/, register and follow instructions for HTC Wildfire.

At some stage you'll be directed to page http://www.htcdev.com/bootloader/ruu-downloads where you need to download a RUU corresponding to your device.

For HTC Wildfire, this RUU brings HBOOT 1.002 which is needed for the boot unlocking procedure.

Download it. It should be named PC4910000_Buzz....exe

As we are under Linux, we can't run this RUU as it is.

We will need to extract the embedded ROM and to convert it to a file that can be flashed straight from the SD card.

2.1. Install Unruu

To convert this RUU exe file into a flashable ROM, we will use a tool called unruu.

This tool extracts the rom.zip file embedded in the RUU exe.

A binary snapshot of unruu is available from http://psi.kennynet.co.uk/software/unruu/snapshots/.

We will download it and instal it under /usr/local/sbin.

# wget http://psi.kennynet.co.uk/software/unruu/snapshots/unruu-0.3.0-beta-44bfd31-STATIC-BINARY.gz -O - | gunzip > /tmp/unruu
# sudo mv /tmp/unruu /usr/local/sbin/unruu
# chmod +x /usr/local/sbin/unruu

2.2. Extract & Flash the ROM

We can now extract the ROM from the RUU exe file.

# unruu PC4910000*.exe
Extracting temporary files...
Extracting rom zip files...
Extracting rom.zip...done.
Cleaning up...
Done!

We you have a rom.zip file in our current directory. This ROM is directly flashable thru SD Card, but it needs to be renamed.

In fact, during its fastboot process, HTC phones look for a flashable ROM at the root of the SD Card :

  • HTC Wildfire : PC49IMG.zip
  • HTC Wildfire S : PC76IMG.zip (thanks to Michal Skuza)

This filename is different for every HTC model.

As we are dealing with HTC Wildfire, we just have to rename rom.zip to PC49IMG.zip and to copy it at the root of the Wildfire SD Card.

Next step is to reboot Wildfire in fastboot mode (Vol- and Power at the same time).

After few seconds, the phone will propose to flash HBOOT. Just accept it.

Your phone will reboot at the end of the operation.

2.3. Get Unlock Code

Remove PC49IMG.zip from the SD card and reboot in fastboot mode again.

Now that your HTC Wildfire is running HBOOT 1.002, you can extract the Identifier Token.

The first command will make sure that the device is detected in fastboot mode.

# fastboot devices
HT168V408897 fastboot
# fastboot oem get_identifier_token 2>/tmp/bootloader
# cat /tmp/bootloader | grep "(bootloader)" | sed 's/(bootloader) //g'

< Please cut following message >
<<<< Identifier Token Start >>>>
3EBBBE9D48808F7C6C6204AA46C41038
4FADB237007FF5D6B96A25503467C18C
9E6EA4A50A828FC7417649FB3D0403DF
BE0B17F14D02C018822BCA09AE5CF66C
59EE451868B1B5F5D1C051B9684DC7B4
794F476E02DEA24B15A73DC8759EF74F
243E69903A0917B1CFA200F9490384D5
694B58ACB0F40357D35B0D7CE9B8C48E
AEF046F8AAF9C88259A3C50F184F53A7
FEEBD0765B525E01F3E5529636198707
879389E4F224EB36BF18AE9E4C812340
46394FF705611654AE12114C357CEE12
87A054D620958AD5D0030231F02E44D8
72A493B8ACB857EDF043024E52BFB0E3
5E3418AD4ECF439D27AD36807F6885B8
F721A0D398377AC9C16377CFB3327A45
<<<<< Identifier Token End >>>>>

You can now cut & paste the Identifier token according to the instructions given on the HTC Unlock site.

You'll receive a mail with a Unlock_code.bin attachment.

We can now use this attachment to unlock the phone.

Unlocking your bootloader will erase all your data for safety reasons.
So if you go ahead, make sure you've backed-up all your important data.

# fastboot flash unlocktoken Unlock_code.bin
sending 'unlocktoken' (0 KB)...
OKAY [ 0.140s]
writing 'unlocktoken'...
(bootloader) unlock token check successfully
OKAY [ 0.009s]
finished. total time: 0.149s

On your phone, validate the unlocking operation.

htc-wildfire-unlock-choice

Your HTC Wildfire is now having an unlocked bootloader ...

htc-wildfire-unlocked

3. Flash ClockworkMod Recovery

You are now ready to flash a custom ClockworkMod Recovery that will allow to wipe partitions, flash ROM and handle backup & restore.

Different versions of ClockWorkMod recovery are available from http://forum.xda-developers.com/showthread.php?t=1029318.

ClockWorkMod v5.0.2.0 works pretty well. I've uploaded ClockWorkMod v5.0.2.0 for HTC Wildfire to my Google Drive.

Connect your Wildfire in fastboot mode and flash the recovery :

# fastboot flash recovery recovery-clockwork-5.0.2.0-buzz.img
sending 'recovery' (3032 KB)...
OKAY [ 0.916s]
writing 'recovery'...
OKAY [ 1.259s]
finished. total time: 2.174s

Then :

  1. Select Reboot Bootloader
  2. Select Bootloader
  3. Select Recovery

You now enter ClockworkMod Recovery v5.0.2.0.

htc-wildfire-cwm-recovery

You can navigate thru the menus and select them with the lower joystick.

4. Flash CyanogenMod 7.2

It is now time to install CyanogenMod 7.2 and Google Apps on your HTC Wildfire.

# wget http://download.cyanogenmod.org/get/jenkins/2808/cm-7.2.0-buzz.zip
# wget http://goo.im/gapps/gapps-gb-20110828-signed.zip

On your phone, within CWM Recovery, select Mount & storage / Mount USB storage.

Copy both zip files to your USB storage, eject the drive and select Unmount on the phone.

You are now ready to flash CyanogenMod 7.2 and Google Apps.

From CWM Recovery, follow carefully these steps in this specific order :

  1. Wipe data / factory reset
  2. Wipe cache
  3. Format System
  4. Install cm-7.2.0-buzz.zip
  5. Install gapps-gb-20110828-signed.zip
  6. Fix permissions

That's it !

You can now reboot your HTC Wildfire into Gingerbread 2.3.7.

 

Enjoy !

Signature Technoblog

This article is published "as is", without any warranty that it will work for your specific need.
If you think this article needs some complement, or simply if you think it saved you lots of time & trouble,
just let me know at This email address is being protected from spambots. You need JavaScript enabled to view it.. Cheers !

icon linux icon debian icon apache icon mysql icon php icon piwik icon googleplus