[One (M9+) General] tbalden:
How-to: root the HTC M9+ (tested on Chinese model)

This is a short step by step guide about rooting the device. So far tested on a chinese HTC M9+

A collection of stock partitionas, RUUs, and twrps: https://xdaforums.com/one-m9+-me-e9+/one-m9-general/ruu-m9-hiauml-ruu-recovery-collection-t3690966

DISCLAIMER, WARNING: If you use this guide, all responsibility is yours. The author is not responsible in any way if something goes haywire or any damage happening to the device :)

This was tested on a Chinese M9+. Please if you try, report back how it goes. Also be aware that currently there are some regions with firmware where we miss the stock recovery image for the different stock ROMs the different M9+ models come with in different countries, and the process contains steps that overwrite Stock recovery, and as of now, I can't provide you with your stock recovery for all possible carriers only a selected few ones and there's no way I know of to save it. (The fastboot boot recovery.img didn't work for me, since the new Download mode didn't allow me to just boot the custom recovery without flashing it. If you know a new way how to do that (boot recovery without flashing it), you can save your own Stock recovery that way, then don't forget to let us know how that can be done!!!) Some region's stock recovery if you want to revert to them: link. Also as soon as you mount ReadWrite the system partition OTA flashing will stop working. You need to back up the system partition in Read-Only mode, available in TWRP 2.8.7.0., and restore that untouched system backup to make OTA work again along with the stock recovery.

Hit the Thanks button if you like the work being done.

You will need

- for Windows:

-- HTC Sync installed (and fastboot.exe inside it's installation, look the fastboot.exe up there)

(-- Optional: Oracle Java JDK 7 + Android SDK platform tools installed (for fastboot.exe, HTC Sync contains fastboot.exe too))

- for Linux:

-- fastboot and working adb connection

- in general:

-- A third party (custom) recovery downloaded, like TWRP (you can get one here: http://xdaforums.com/one-m9/one-m9-general/recovery-twrp-2-8-6-0-english-m9pw-t3116099 ), to flash the SuperSU installer

-- SuperSU installer downloaded (e.g. https://download.chainfire.eu/1001/SuperSU/UPDATE-SuperSU-v2.78-20160905010000.zip )

-- Phone and USB cable

Steps to root the device (starting with a locked device):

1. Unlock the Bootloader. You can do it online here: http://www.htcdev.com/bootloader Select the 'All Other Supported Models'. Proceed as the HTC site directs you. Read everything carefully.

2. Go into Download mode (with an unlocked bootloader): with a device fully booted you can do so with Power off the phone and then long Power + Vol Down

3. Connect phone to PC with USB cable

4. Flash custom recovery with fastboot in command line:

fastboot flash recovery recovery_xy.img

output for a successful recovery flashing:

target reported max download size of 800000000 bytes
sending 'recovery' (13996 KB)...
OKAY [ 1.454s]
writing 'recovery'...
(bootloader) HOSD CL#534001
(bootloader) start@1
(bootloader) recovery@100%
(bootloader) Update partition OK
(bootloader) end@Done
OKAY [ 1.272s]
finished. total time: 2.728s

4.1 After a successful flashing of recovery, you can create a full backup with the installed recovery if you wish, before rooting the device, check point 6th. how to go into recovery mode. There select Backup and do it. Then Reboot to normal mode and continue:

5. Boot the phone to normal mode, copy the SuperSU update flashable installer zip to device from your PC From fastboot Download mode to boot to normal mode: just navigate with volume buttons and select Reboot with pressing the Power button.

6. Go into recovery mode: Power off. Long press Power + Vol Down. In Download mode with volume buttons navigate to reboot to bootloader, press power. In bootloader navigate with volume buttons to BOOT TO RECOVERY MODE, press Power.

7. In booted Recovery, install SuperSU flashable zip with Install button: Select Install in the recovery, browse the SuperSU zip and flash it

Then reboot. The SuperSU app should be there amongst the accessible apps, and also now you can go super user in an adb shell (you'll need to enable USB Debugging in Developer options by going into Settings/About/Software information/More and pressing Build number 6+ times to get Developer Options, and then go into Developer options and enable USB Debugging):

c:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
shell@htc_hiau_ml_tuhl:/ $ su
su
root@htc_hiau_ml_tuhl:/ #

In general in Download mode and Bootloader mode, you can navigate with Volume Up/Down buttons and select an option with pressing the Power button.

Have a successful flashing, and be careful! And don't forget: We only have a selected few region's stock firmware's stock recovery images to replace the custom ones here on this forum, so only do this if you are okay with custom ROM development (that can be flashed from TWRP/custom recovery) or you can get your hands on a stock recovery for your model's appropriate official stock rom version otherwise official OTA updates might not work with TWRP.

Also as soon as you mount ReadWrite the system partition OTA flashing will stop working. You need to back up the system partition in Read-Only mode, available in TWRP 2.8.7.0., and restore that untouched system backup to make OTA work again along with the stock recovery.

You'll find a bunch of stock recoveries here: http://xdaforums.com/one-m9/one-m9-general/firmware-stock-recoveries-regions-t3120826