[One (M9) General] Flippy498:
Take me back to the Overview​

Unlocking the Bootloader and Rooting the M9/Installing a Custom Rom​

Prerequisites and important infos:

You'll need an external SD card with a size of at least 8 GB.

This guide assumes that you're using the latest 4.x firmware.

You're going to verify that with step 1 of the instructions.

You can't follow step 4 (which is optional) if you don't use at least firmware 3.x!

Check Q4 and Q5 of the FAQ section if you skip step 2 while using firmware 1.x, 2.x or 3.x since these require older TWRP and SuperSU versions than firmware 4.x. Your phone will not be able to boot to recovery mode or end in a bootloop if you don't use the correct files.

You need a working ADB/Fastboot/HTC_Fastboot environment.

You need the official TWRP 3.2.2-0.

(Optional) Read the RUU section or TWRP section II if you want to restore an untouched system image and the stock recovery after following this guide.

The instructions aren't usable with a Verizon M9 due to the bootloader unlock being blocked by Verizon. You need S-OFF for being able to unlock it. Sunshine S-OFF only works on firmware 3.x or below (Android Marshmallow and older). Alternatively, you can look for someone who owns a Java card or an XTC clip. I recomend you taking a look at the Verizon M9 forum. Chances are higher that you'll find what you need over there.

Instructions:

Boot to download mode and look at the line with "OS" at the beginning for finding out your current firmware version.

That means: Power off the device, wait some seconds and turn it on again while you keep volume down pressed until you see a black screen with red, blue and yellow text. If you see a white screen with multicoloured text then you're facing the Bootloader mode. In that case you can navigate to "Boot to Download Mode" with the volume keys and select the option with the power button.

(Optional) Install all available OTAs (via the software update function of the system settings) if you aren't using the latest 4.x firmware

Unlock your phone's bootloader via HTCdev.

Your internal storage will get wiped by doing so!

Since you already have a working ADB/Fastboot/HTC_Fastboot environment you don't need to download the android SDK from HTCdev.

(Optional) I highly recommend to follow the instructions in the TWRP section I.

Even if you don't want to share your backup with us you should at least keep it on your PC so that you're prepared if you need to revocer your phone.

Boot Download Mode, again.

Open the folder that contains your ADB/fastboot/HTC_fastboot files on your PC.

Press and hold Shift on your keyboard.

Right-click into the folder.

Choose "open command window here".

If you're using the Win 10 Creator's update or any newer version then you need to choose "open powershell window here".

Type "start cmd" without the quotation marks and execute the command with pressing Enter on your keyboard.

Use the command

fastboot flash recovery twrp-3.2.2-0-hima.img

(execute it with Enter).

Wait a bit. TWRP should get flashed on your phone.

Reboot to Bootloader Mode.

Choose "Boot to Recovery Mode".

If you want to keep the stock rom and only gain root you need to follow instruction A. If you want to install a custom rom you need to follow instruction B. (Be aware that most custom roms come pre-rooted.)

Get either SuperSU 2.79 SR3

or

the latest Magisk version and copy the *.zip you chose into the download folder of your external sd card. Choose "Install" and navigate to your external sd card's download folder. Select the SuperSU/Magisk file and install it by swiping. Reboot your phone after the flash got finished. It's rooted, now.

Get the latest version of the rom you want to flash from either the android development section or the original android development section (

make sure that you read all important information that got posted in the first posts of the rom thread

) and copy the *.zip you chose into the download folder of your external sd card. Choose "Wipe" and wipe everything except for "Micro SDcard", "USB-OTG" and "SD-Ext" via the advanced wipe. Get back to the main menu and choose "Install" and navigate to your external sd card's download folder. Select the rom and install it by swiping. (Be aware that roms that aren't based on HTC's stock rom (e.g. LineageOS or Resurection Remix) may lack all google apps. You can download them from here. Choose the ARM64 version that corresponds to the android version of your custom rom. It doesn't matter which variant you use so choose the one that suits you best and install it via the install option after you flashed the rom. This is not needed for roms like Android Revolution, ICE, MaximusHD, Viper or Leedroid.) Reboot your phone after the flash got finished. The first boot may take a while.

(Optional) If you want you can set your phone S-OFF with the Sunshine app, now. Be aware that this is only possible on roms that are based on HTC's stock rom or the stock rom itself. More information about S-OFF can be found here.

Take me back to the Overview​