[One (M9) General] djibe89:
[GUIDE/TUTORIAL/HOWTO] HTC One M9 from Stock to Android 12

[GUIDE/TUTORIAL/HOWTO] HTC One M9 any model from Stock to Android 12

This detailed step-by-step guide helps you transform your HTC One M9 (any model) to a powerful one with Android 12.

Make sure you have the HTC One M9 model, in Android, go to Settings > About > Phone identity and check Model number.

### FM Radio doesn't work with Android 11.

Models supported:

- Himauhl (Europe WWE | GSM | MID 0PJA10000)

- Himaul or Himaulatt (AT&T, Developer Edition, Unlocked | GSM | MID OPJA11000)

- Himaultmus (T-Mobile | GSM | MID OPJA12000), not sure you can get Android 7

- Himauhl (Chunghwa Telecom | GSM | MID 0PJA13000)

- Himawhl (Sprint | CDMA | MID OPJA20000)

Himawl (Verizon | CDMA | MID OPJA30000) is not guaranteed, see: https://xdaforums.com/f/verizon-htc-one-m9.4125/

* MID = Model ID

CHANGELOG

v1. Initial release

1) DOWNLOAD

- djibe HTC One M9 pack : https://bit.ly/djibe-onem9-pack

(includes HTC USB Drivers, recovery TWRP 3.6.2_9-0 for all M9, Magisk Root, adb, fastboot.exe and htc_fastboot.exe).

Unzip the djibe folder from the zip on root folder of C:\ drive.

- ROM for Himaul or Himawl: Unofficial LineageOS 18.1: https://xdaforums.com/t/rom-11-0-0-himaul-himawl-lineageos-18-1-unofficial.4199175/unread

Download latest build here: https://mirror.codebucket.de/claymore1297/LineageOS/18.1/hima

Android 12.1 / LOS 19.1 is WIP (no telephony yet): https://xdaforums.com/t/rom-12-1-0-himaul-himawl-lineageos-19-1-unofficial.4378803/unread

Or you can use AICP 17.1 right below

- ROM Android 12 for other Hima models: Android Ice Cold Project Official 17.1: https://xdaforums.com/t/rom-12-1-0-hima-android-ice-cold-project-17-1-unofficial.4399865/

Download latest build here: https://dwnld.aicp-rom.com/

### Localisation (GPS) must stay turned ON to get Telephony

Or try crDroid 7.12

- NikGapps-SL ARM64 Core or Basic: https://sourceforge.net/projects/nikgapps/files/Releases/NikGapps-SL/

- Charge phone to 100%

- 8+ GB MicroSD card formatted in FAT32

- Copy ROM + Google Apps +/- Magisk root zipfiles without unzipping content. Insert microSD in phone.

WARNING. This tutorial uses Microsoft Windows.

WARNING. Warranty is now void.

WARNING. Read carefully the sentences starting with ###.

2) BACKUP DATA AND INSTALL DRIVERS

Disable Antivirus.

Install drivers from my pack:

right click on HTCDriver.exe > click on Run as administrator and continue the setup.

Connect HTC One (while phone on) to PC, let drivers install.

In Windows explorer, HTC One should be available.

### If not make sure phone connection is in File transfer mode (see Android notifications).

### Phone is still not visible in Windows Explorer ? See fix at end of tutorial.

Collect all personal photos, videos, etc ... and backup these on PC.

Use an app like Backupyourmobile/SMS Backup & Resotre to backup texts, contacts, etc.

Check that backup is located on microSD card.

Then copy the backup on your PC.

Disconnect phone.

### If your phone is Simlocked/carrier locked/Network locked, don't go further.

Visit official website of your network carrier (or call their support) to retrieve your desimlock code.

Ask them for details on how to remove simlock.

How do I know my phone is simlocked ? When you insert a SIM card from another operator, network is inaccessible.

Only a stock ROM can remove simlock.

To go back from custom ROM to stock, see dedicated section at the end of tutorial.

2) KNOW YOUR MODEL

Shutdown phone.

Start in fastboot mode: hold Power + Volume- until it vibrates and release both buttons.

Wait until hTC download mode shows up.

On mine I see:

SECURITY: *** UNLOCKED ***

model: htc_himawhl

CID-11111111

SECURITY UNLOCKED means S-OFF for SECURITY-OFF, otherwise S-ON. With S-ON you can upgrade firmwares but cannot use previous versions.

3) UPGRADE TO LATEST OFFICIAL ROM

In Android, go to Settings > About > Software information.

Android version is 7 and HTC Sense version is 8.0.

If Android is already 7, go to next chapter.

But before, search for IMEI and note this number somewhere safe (we never know).

Otherwise, we need to flash suitable stock Android 7 Nougat firmware, depending on your model.

In Settings > About > Software information, note down Software version (in case of future error).

For me it is 3.41.651.4 (651 is the SKU part, meaning Sprint US ROM).

See Sneakyghost's and Behold_this' SKU-, CID- and MID-List: https://docs.google.com/spreadsheets/d/10H7RftecZZKb5tT2zpShfYNFAfSe-imhhqtVfeMPVDA/edit?pli=1#gid=0

Now tap on More > tap 7 times on Build number. It unlocks Developer options.

Go back to Settings menu, you can see the new Developer options menu.

Tap on it, accept the warning.

Switch ON USB debugging option.

Connect phone, a message appears on phone : Allow USB debugging?

check Always allow and confirm by tapping on OK.

But before upgrading to Android 7 Nougat, you need the latest Android 6 official ROM available for your model.

- Himaul or Himaulatt: RUU_HIMA_UL_M60_SENSE70_ATT_MR_NA_Gen_Unlock_3.35.617.16.exe

- Himaultmus, not sure you can get Android 7: http://downloadmirror.co/android/29Ri/RUU_HIMA_UL_M60_SENSE70_TMUS_MR_TMOUS_3.39.531.7.exe

- Himawhl: https://www.androidfilehost.com/?w=files&flid=334967 or https://downloadmirror.co/1KrL/RUU_HIMA_WHL_M60_SENSE70_SPCS_MR_Sprint_WWE_3.41.651.21.exe

- Himawl: http://downloadmirror.co/android/29...0105_CNV_1.26_002_release_469809_signed_1.zip

RUU*.exe: launch installer, connect phone (from within Android started or in Download mode) and follow executable steps.

Wait during flash.

After reboot, you have access to HTC software updates.

Go to Settings > System updates > HTC software update > CHECK NOW

Install available updates.

Repeat after each update until update 4.x is fetched.

Here you go with Android 7.

### I succeeded with Sprint model, tell us here if you experience problems with other models.

### Flash a RUU in *.zip format

### Copy RUU zipfile to microSD card and insert in phone. Shutdown phone.

### Start in fastboot mode: hold Power + Volume- until it vibrates and release both buttons.

### Use Volume- to Reboot to Bootloader. Confirm with Power.

### Use Volume- to BOOT TO RECOVERY MODE. Confirm with Power.

### Once in recovery, use Volume- to: Apply update from SD card

### Use Volume to select RUU zipfile

### Wait during flash

4) UNLOCK BOOTLOADER

Save IMEI, go to Settings > About > Phone identity > IMEI (15 digits).

In Settings > About > Software information > More.

Tap 7 times on Build number. It unlocks Developer options.

Go back to Settings menu, you can see the new Developer options menu.

Tap on it, accept the warning.

Check ON OEM unlocking and USB debugging options.

Go to Settings > Security > Screen lock > None

Go to Settings > Storage > Phone storage, scroll down and make sure Phone storage encryption is unchecked.

Now, open a Windows command on my "flash" folder (hold Shift + right click on folder -> Open a windows command here).

Or type cmd in Windows address bar and hit enter to launch a Command prompt in actual folder.

Enter command :

adb devices

, confirm by pressing Enter.

Command returns :

List of devices attached
HT53****** device

### If no device is found, uninstall and reinstall properly the drivers while antivirus is off. Or see fix at the end of this tuto.

### Or start fresh on another PC.

Now type :

adb reboot bootloader

Phone restarts in Fastboot mode. Wait till phone screen is blank in fastboot mode.

Use volume keys to switch to Download mode !!!

### With HTC One M9, fastboot commands have to be sent from Download mode (took me hours to figure it out, thanks @DigiGoon).

Type :

fastboot devices

Command returns :

HT53**** fastboot

### You may have to fix drivers again (see fix at the end of tuto)

Type :

fastboot oem get_identifier_token

, confirm by pressing Enter.

Command returns multiple lines.

Select with your mouse all the lines from

<<<< Identifier Token Start >>>>

(included)

to the line

<<<<< Identifier token end >>>>>

(included).

Now on keyboard copy (Ctrl + C combo), then open Notepad.

In Notepad, paste those lines (Ctrl + V combo).

Now manually remove all the (bootloader) strings from each line.

Your notepad should now look like this :

<<<< Identifier Token Start >>>>

37A5DBF4FE5F0D9F4425E54AA91AFDBF

2A20E9C67C3BB4FAE60263F76BDEC6AC

847BF9FFB11DAEA4AB88AC8710435449

9BC12E93DF4C54FFE3D064C4C810C49A

2CDAF2E0CD3A164FED4A568CB0FD2AC6

C01AA991733D949C00987062D691DE91

8AA1C97CEBC3ACE83FECE75A1D03CE72

62414C7DC36A73AFCBF433E1EBE2EDC7

E272F73309632D3EF8C86E472B65E8EF

37E46B52FE3F94FC69D1854CA3DE6F48

C3E10001B233A70B1EAF35134F51FCC6

353E0CC98534E6E60A241A7063D0BE2F

A5B752E75C1C47E6F739BDBE67D024DA

3292A14278247557632639802722A86C

E61424F7666AE085AA9905096FEED1AD

5ECBBD867544E95ABDDA277690B8CB55

<<<<< Identifier Token End >>>>>

Now visit this website: https://www.htcdev.com/bootloader/

Register on the site. Confirm registration with your email.

In the select menu, choose HTC One M9, click Begin Unlock Bootloader button.

Agree to legal terms.

Next page, go to the bottom and click continue to step 5.

In the bottom of this page, in the lower textarea "My Device Identifier Token",

copy and paste the multiple lines you just edited (my example is just above).

Click Submit.

HTC tells you: Token Submitted Successfully!

Open your mailbox (associated to your HTC account).

Copy the Unlock_code.bin file attached to email in my "flash" folder you unzipped.

In Windows command, type:

fastboot flash unlocktoken Unlock_code.bin

, confirm with Enter.

Command should return:

Device is unlocked

4) FLASH TWRP RECOVERY

Using the same Windows command prompt, enter:

fastboot devices

to make sure phone is still available.

Then

fastboot flash recovery twrp-3.6.2_9-0-hima.img

Command returns :

finished. total time: x.xxxs

Now enter:

fastboot reboot-bootloader

Press Volume- to navigate to BOOT TO RECOVERY MODE, and confirm with Power button.

Phone reboots to TWRP recovery (with red message alert).

5) BACKUP STOCK SYSTEM

In TWRP, check Never show this screen and Swipe to Allow Modifications.

You land on TWRP Home screen.

Always make a backup of your stock system. We never know when a weird bug will decapitate the system.

Go to Backup menu, select all partitions and Backup to microSD card (Select Storage button).

Backup the generated TWRP folder content from your microSD card to PC.

6) WIPE PARTITIONS

Back to Home menu, go to Wipe > Format data, type yes and confirm with bottom righ icon.

Go to Wipe > Advanced wipe.

Select Dalvik / ART Cache, Cache, System, Data, Internal Storage then Swipe to Wipe, go back to Wipe menu.

### Don't wipe SDcard

Got ot Reboot > Recovery

7) FLASH ROM AND GAPPS +/- ROOT/MAGISK

Back to Home screen, tap on Install > choose aicp*.zip

(if you don't see the files, tap on Select Storage and make sure Micro SDCard is active)

then Add more Zips -> open_gapps*.zip,

then Swipe to confirm Flash.

Wait for operation to end (can be long).

### To flash Magisk, go to Reboot > Recovery and flash Magisk after reboot.

We need to format Data once more to remove an encryption that took me time to figure out.

Go back to Wipe one more > Format Data > yes

When format complete, tap on Reboot system

Wait during long first boot.

Setup Android.

8) You can use Backupyourmobile to restore data,

use GPS Status & Toolbox app to enhance GPS fix.

That's it.

Enjoy,

djibe

THANKS to TWRP team, AICP team, All M9 contributors.

You can find all my tutorials at: https://github.com/djibe/Android-tutorials

##################################################

## Unlock bootloader without Unlock key from HTCDev

See: https://xdaforums.com/t/how-to-lock-unlock-your-bootloader-without-htcdev-s-off-required.3092036/

## Seek help for your model:

- Sprint: https://xdaforums.com/t/ruu-firmwar...tc-one-m9-4-27-651-4-updated-4-13-17.3073355/

## Change 4G/LTE region

Edit build.prop

Reboot to recovery > Mount > select System

adb devices

adb root

adb remount

adb pull /system/build.prop

Edit with Notepad++

add ro.telephony.default_network=20

save file

adb push build.prop /system/build.prop

adb shell chmod 644 /system/build.prop