Unlocking and Re-locking the HTC M8 bootloader

1. Introduction

Unlocking the Android bootloader allows for the installation of a custom Android OS — known as a ROM — to the device. Android OSes are read-only, hence the term ROM — read-only memory. The bootloader determines which software, including which ROM, is to be run when the device is powered on.

Based on the guide provided by HTC, this guide provides some additional details along with edits and illustrations for further clarity. For downloadable code, you may need to follow along in the HTC step-by-step instructions. This guide has been tested with, and is specific to, the HTC One M8 handset with Android version 6.0.

Reference

Additional Resources

2. Unlocking the bootloader

WARNING: Unlocking the bootloader will erase all user data and third-party apps from the Internal Storage. Backup all user data or move it to Removable Storage.

Desktop – Download desktop executable

1. Download to your desktop and unpack the fastboot binary executable appropriate to your OS. (Instructions are for MacOS. Link to Linux executable is included for convenience.)

Device – Enable fastboot mode

2. Power off your device. Press and hold the Volume Down button and then simultaneously press and hold the Power button for several seconds. This will launch the device into bootloader mode.

3. The Volume buttons are used to make selections in the bootloader screen. Highlight “fastboot” and then press the Power button. A label FASTBOOT should now appear highlighted in red on the device screen.

4. Connect your device to your computer with a USB cable. The FASTBOOT label should now read FASTBOOT USB.

m8_hboot
Bootloader screen “HBOOT”
m8_fastboot-usb
Bootloader screen “FASTBOOT USB”

Desktop – Generating a token

5. Using Terminal (MacOS) from your desktop, issue the following command.

6. A code block will be generated. Copy this text, including the lines “<<<< Identifier Token Start >>>>” and “<<<<< Identifier Token End >>>>”.  Omit any line prefixes, such as “INFO.” On device SH45FWM01420 (I nicknamed this device “sapphire”), the code block was as follows.

HTC Web Site – Requesting the unlock binary

7. Paste the code block from the previous step into the form provided at Step 7 on the HTC web site. Click the Submit button.

Desktop – Flashing the unlock binary

8. An unlock code binary file will be sent to you by email. It will be an attachment named Unlock_code.bin. Save this file to your desktop alongside your earlier fastboot files.

9.  Using Terminal (MacOS) from your desktop, issue the following command.

Device – Confirm

10. Your device should now display a disclaimer. Use the Volume buttons to select and press the Power button to confirm your selection.

  • If you select Yes, your device will be reset to its factory default settings and your bootloader will be unlocked. This step will erase all user data and third-party apps from the Internal Storage.
  • If you select No, your device will reboot and no modifications will have been made.

3. Relocking the bootloader

(Steps 1 through 3 below are identical to steps 2 through 4 above.)

1. Power off your device. Press and hold the Volume Down button and then simultaneously press and hold the Power button for several seconds. This will launch the device into bootloader mode.

2. The Volume buttons are used to make selections in the bootloader screen. Highlight “fastboot” and then press the Power button. A label FASTBOOT should now appear highlighted in red on the device screen.

3. Connect your device to your computer with a USB cable. The FASTBOOT label should now read FASTBOOT USB.

4. Use the following command in Terminal for MacOS.

5. Note: This will not restore the factory default lock, but will simply re-lock the bootloader so no further changes can be made. If you want to unlock your bootloader again, simply reinstate FASTBOOT USB mode (steps 2 through 4 for unlocking), then repeat step 9 for unlocking with your original unlock key file.

Appendix 1 — Stock (Official) ROM Information

  • M8_UL PVT SHIP S-ON
  • HBOOT-3.19.0.0000
  • RADIO-1.29.214500021.11G
  • OpenDSP-v51.2.2-00593-M8974_FO.1015
  • OS-6.13.631.7
  • eMMC-boot 2048MB
  • Dec 12 2015,16:24:40.0
See this page at https://kinasevych.ca/index.php