Tuesday, February 19, 2013

CyanogenMod on HTC Desire HD

Before I start describing the process I took to root my phone and install a custom mod, I should probably point out that this isn't a process that's guaranteed to work for all versions of the Desire HD and could brick a device. The kit I used to root the device felt it necessary to pepper it's manual and homepage with warnings that the process could brick incompatible devices.

I've included complete a of warnings from the Advanced Ace Hack Kit site here for clarity:

  • Do not attempt to hack a phone with a broken control (like a volume button). We will not help you. There is good reason for this; if the phone gets to an unbootable state, then you can’t recover it. Stay stock.
  • If your PC environment is not ready to run this kit, there is a good chance your device will not boot properly until you fix your PC or switch to another and re-run the hack kit from the partial boot. READ THIS ENTIRE POST and READ THE EFFEN MANUAL! There is no substitute for READING for COMPREHENSION
  • Do NOT use earlier versions Ace Hack Kit (12.x and lower) on Inspire or DHD devices shipped with Gingerbread.
  • Do NOT attempt to downgrade a Inspire or DHD shipped with Gingerbread with a Froyo RUU.
  • Do NOT attempt to install earlier ENG HBOOTs on these models. AAHK now has Hboots that safely support fastboot image flashing.
  • Doing this WILL severely degrade bootloader performance on Inspires and DHDs and causes issues trying to install RUUs. In other words, it WILL jam you up. (Note: Issue confirmed on later DHDs – ignore at your own risk).
  • Sense 3, including those with RELOCKED HTC BOOTLOADERS (NOTE: NOT UNLOCKED – MUST BE LOCKED OR RELOCKED) is auto-detected in hack step. Option is given to download a GB RUU and downgrade or abort. This WILL wipe data.

The first step I took was to back up all the data on my device; exporting data from apps that required it and taking a copy of everything stored on the SD card. This is always a good idea if you're going to attempt to install a ROM manually, but later on this turned out to have been an essential step.

I've installed CyanogenMod on devices before (a T-Mobile G1/HTC Dream and a HTC Hero), but upon navigating to the installation guide for the device on the CM wiki, I realised the Desire HD would be a little different. The page simply consisted of a message stating that the Ace Hack tool should be used to root the device, as the previous instructions were liable to brick devices running Gingerbread; a little concerning given the fact that this was the version of Android that was running on my phone. However, after carefully reading the homepage for the Ace Hack Tool I found that the build of Android running on my phone (HTC WWE Europe 3.12.405.1) was in fact supported by the tool and would simply require a downgrade to a exploitable version (a task handled by the tool itself).

Another noteworthy point I found in the manual was the strong recommendation to wipe the phone, especially as I was going to be moving to a completely different ROM (CyanogenMod vs. stock). Not doing so could result in unexpected behaviour later on down the line. At this point, I was extremely happy to have already backed up my important data from the device!

Running the Tool

My first execution attempt resulted in the script attempting to elevate it's privileges via the use of sudo (preceded by an impossible-to-miss final warning to READ THE EFFEN MANUAL). This allows for the execution of the Android Debug Bridge (ADB) tool, which requires root privileges to communicate with Android devices connected via USB (and have debug mode enabled).

During this initial run, the tool detected my device required a downgrade before attempting the rooting process. I allowed the tool to proceed and after a short wait, my phone rebooted into the once familiar stock HTC Froyo ROM.

A second execution rooted the device and installed the ClockworkMod Recovery tool, which completed without issue. I was then able to confirm the process had worked correctly by running "adb reboot bootloader" in the terminal window, then checking for the "S-OFF" message at the top of the screen (not "S-ON").

Satisfied the process was successful, I downloaded the latest version of CyanogenMod compatible with the HTC Desire HD (7.2.0) and the separate Google Apps package from the XDA developer forums and copied them over to the device's SD card. Then I simply followed the steps outlined in the Ace Hack Tool manual:

  1. Disabled Fast Boot in the Froyo OS:
    1. Menu
    2. Settings
    3. Applications
    4. uncheck fast boot
  2. Turned the phone off.
  3. Disconnected the USB cable from the phone.
  4. Held the volume-down button, then pressed power and kept holding the volume-down button until the Hboot menu shows up.
  5. Waited for some file checks to complete, then used the volume-down button to scroll down to the recovery menu option.
  6. Pressed the power button to start recovery.
  7. Once recovery loaded, I was able to use the volume buttons to navigate the menus and and the capacitive search button (bottom row of buttons, far right) to perform the following steps:
    1. Navigate to and select "Install zip from sdcard".
    2. Navigate to and select "Choose zip from sdcard".
    3. Navigate to and select the Cyanogenmod Zip file previously copied to the SD card (cm-7.2.0-ace.zip).
    4. Navigate to and select "Yes - cm-7.2.0-ace.zip"
    5. Repeated the above process for the Google Apps archive
    6. Press back button when flashing is complete until "reboot system now" is at the top of the menu screen.
    7. Press power to reboot the system into the newly installed ROM.