[Desire HD General] XanderDiesAlone:
myNotes

I just revived this old phone thanks to you all!

These are the notes that I've made for myself. This is the 2nd phone I've ever put a custom rom onto. Sorry if I get some terminology wrong. I hope that my notes help someone. Since I'm n00b at this, I hope that other n00bs find it useful. I created an xda account just for you all. (Your mileage with my notes below may vary)

OVERVIEW

-- Unlock the phone via htcdev website - will need the unique code from your phone. Send it to them, and they will reply via email with an unlock .bin file along with instructions on how to unlock

-- Once the phone is unlocked, go into fastboot mode and flash OpenTWRP to the Recovery partition

-- Once OpenTWRP is on the Recovery Partition, get to the Boot Loader (Vol Down + Power) > then Recovery

-- Do a TWRP Backup to SD card if needed

-- Do a TWRP Basic Wipe of the phone

-- Install the CyanogenMod zip file

-- Install the openGapps zip file

-- from TWRP, hit Reboot directly into Bootloader (no need for key presses)

-- Get to fastboot mode

-- Flash the boot.img to the BOOT partition (do NOT flash it to the Recovery partition by mistake and vice-versa - else you have to start over)

-- reboot

-- boot partition loads up the Cyanogen's boot.img and goes through the install

-- meanwhile, you still have S-ON, the Bootloader is still Unlocked, and the Recovery partition is holding TWRP

-- optional - you can lock the Bootloader again via adb: 'fastboot oem lock'

DETAILED NOTES

- before you do anything, you need to 'unlock' the bootloader

- you must have the HTC Sync Manager installed in order to extract the code from the phone

- send the code to HTC via their website (htcdev.com/bootloader/) - you'll get a 'Unlock_code.bin' file by email

- copy your adb folder to a general location (Mine was version 1.0.39 from the Android SDK - once you install their official package, you can go into the Preferences and install 'Platform Tools' and 'Google Drivers') but you can also get adb and fastboot by just using Google

- copy the 'Unlock_code.bin' that you got from htcDev to that same folder, open a cmd as admin, navigate to that folder

- make sure to put the phone into 'fastboot' mode by either pressing power+volDown, or issue the command 'adb reboot bootloader'

- select 'fastboot' from the phone menu

- back to adb cmd, run 'fastboot flash unlocktoken Unlock_code.bin'

- you'll see something like this:

< waiting for any device >

target didn't report max-download-size

sending 'unlocktoken' (0 KB)...

OKAY [ 0.021s]

writing 'unlocktoken'...

(bootloader) unlock token check successfully

OKAY [ 0.026s]

finished. total time: 0.059s

- on phone, it asks to confirm bootloader unlocking: "unlocking the bootloader allows you to install a custom OS ... [generic warning message]"

- you have to use the 'Volume' buttons to select 'Yes' and then the 'Power' button to click okay (remember, you're in the basic bootloader, like bios, and touchscreen won't work)

- from htcDev website:

"To re-lock your bootloader, in the command prompt, type 'fastboot oem lock'

Note: This will not restore the factory default lock, but will simply re-lock the bootloader so no further changes can be made. Furthermore, if you want to unlock your bootloader again, simply repeat step 9 with your original unlock key file to unlock your phone again"

- the phone will reboot and you have to go through the initial setup again

- go back into phone Settings > Power > disable 'Fast boot', and Applications > Development > enable 'USB debugging'

- boot into fastboot

- You should now see "UNLOCKED" on top of the menu in pink, and "FASTBOOT USB" in red

- get this UNOFFICIAL OpenTWRP: openrecovery-TWRP-ace-2.8.1.2-unofficial.img

- in cmd, go to the folder where you have a copy of your 'platform-tools' folder with adb, fastboot, the Unlock .bin file and the openTWRP .img file

- run 'fastboot flash recovery openrecovery-TWRP-ace-2.8.1.2-unofficial.img'

- example output:

cmd> fastboot flash recovery openrecovery-TWRP-ace-2.8.1.2-unofficial.img

target didn't report max-download-size

sending 'recovery' (4732 KB)...

OKAY [ 0.901s]

writing 'recovery'...

OKAY [ 0.710s]

finished. total time: 1.621s

- NOTICE that before the HTC official bootloader unlock, you'd have been blocked from writing twrp to the phone

- now GET READY for some quick fingers

- we're going to reboot, then you need to get back into bootloader mode and from there you'll go into the 'Recovery' menu and there you'll find twrp waiting for you (some phones may overwrite the twrp if you mess this up and you'll have to run the 'fastboot flash recovery openrecovery-TWRP-ace-2.8.1.2-unofficial.img' process again

- on cmd, type in 'fastboot reboot'

- on phone, once in bootloader menu, go to 'Recovery' and you'll find twrp waiting for you

- download:

-- Cyanogen Mod 12.1 Unofficial mediafire.com/download/ox1wf15javgoto1/cm-12.1-20150509-UNOFFICIAL-ace.zip

-- THIS GAPPS FAILED - gApps 5.1.1 Base

mediafire.com/download/po262bj23q70o1t/gapps-511-base-20150508-1-signed.zip

-- THIS gAPPS WORKED - you can get OPENgapps from opengapps.org but you need to know some phone specs

The HTC Desire HD has an ARM-x86 chipset (Qualcomm MSM8255 Snapdragon S2, gsmarena.com/htc_desire_hd-3468.php, notebookcheck.net/Qualcomm-Snapdragon-S2-MSM8255-SoC.86960.0.html), so you can select the package you want for the ARM (not 64bit), Android 5.1 version. I prefer 'pico' or 'nano' as they only have the basic apps I need.

github.com/opengapps/opengapps/wiki/Nano-Package

github.com/opengapps/opengapps/wiki/Pico-Package

It's just a matter of how many apps you want to install as default. the bigger the package, the more apps you get by default. (WARNING: I used the 'pico' package and after installation, the phone was complaining that it was running out of space. If I do this process again, maybe I'll try the 'tvstock' package :\ )

- now put the cyanogenMod (cm12...) and openGapps files on MicroSD card

- insert the SD card into the phone

- get to Recovery Mode (i.e. to TWRP)

- now in TWRP, back up any partitions that you wish

- then go back to the main menu and click the 'Install' button to make sure that you can see your sd card with the CyanogenMod (cm12) and gApps zipped files that you downloaded

- go 'back' to the main twrp screen

- click the 'Wipe' button

- we're going to do the basic Wipe, which includes the directories Data, Cache, and Dalvik

- swipe right on 'Swipe to Factory Reset'

- click 'Back' after the wipe is done

- go 'Back' again to the main twrp screen

- click the 'Install' button

- select the 'cm12...' zip file

- on the next screen, select the 'Add More Zips' button

- select the 'gapps' zip file

- you can select a max of 10 files to install at once

- swipe right on 'Swipe to Confirm Flash'

- If things fail, it's time to Google stuff

- Note that error 7 or 0 mean that you need the proper openTWRP version specified on the first page

- Once both cm12 and gapps are done installing, then from within twrp, click 'Reboot' > 'Bootloader'

- Go into Fastboot if not already there

- in adb, even if it doesn't see your device, run:

'fastboot flash boot boot.img'

(boot.img is in the cm12.1 zip file)

- NOTICE the third word of the following 2 DIFFERENT commands

'fastboot flash boot boot.img'

= in fastboot mode, flash the boot.img to the boot partition

WHEREAS

'fastboot flash recovery TWRP-ace-2.8.1.2.img'

= in fastboot mode, flash the "TWRP-ace-2.8.1.2.img" to the RECOVERY partition

(i.e. in recovery, you want to put the opentwrp image, and in the boot partition, you want to put the boot.img that came with the unofficial CyanogenMod's zip file - DON'T MIX IT UP)

- now that your boot.img file from the cm12 package has been flashed to the phone's boot partition, you can reboot

- If you did it right, you'll go past the HTC startup screen and then you'll see a blue android animation - be patient - go take a nap - it'll take a while - when it's done, you'll be in Android 5.1 on your HTC Desire HD

There goes my weekend ...

:eek: