[One (M7) General] djibe89:
[GUIDE/TUTORIAL/HOWTO] HTC One M7 Stock to Android 11 / LineageOS 18.1

[GUIDE/TUTORIAL/HOWTO] HTC One M7 any version (m7, m7ul, m7spr, m7vzw) stock to Android 11 R / LineageOS 18.1

This detailed step-by-step guide helps you transform your HTC One M7 (any version) to a powerful one with Android 11.

Make sure you have the One M7 model, in Android, go to Settings > About phone and check the model.

CHANGELOG

v8. Upgrade to Android 11, improve readability, update pack

v7. Updated pack with MagiskManager 8.0.7 and Magisk 21.4

v6. Infos in case of Simlock

v5. Moved to Android 10 thanks to @tarkzim, updated pack with Magisk 20.4

v4. Moving to Android 9. I was wrong in v3 ;- Thx @tarkzim), good for all M7 versions

v3. Reverted back to Android 7.1. No stable ROM for Android 8 or 9 (and will never be)

v2. Tutorial updated for Android 8.1 Oreo, updated pack with TWRP 3.3.1-0

v1. Initial release

1) DOWNLOAD

- djibe HTC One M7 pack (44.3 Mo) v2 : http://bit.ly/djibe-onem7-v1

(includes HTC drivers, recovery TWRP 3.6.1_9-0 for all m7 by Xeno1, Magisk Root 23 adb & fastboot.exe).

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

- ROM Unofficial Lineage OS 18.1 for M7: https://xdaforums.com/t/rom-11-0-unofficial-m7-all-lineageos-18-1-stable.4454219/

Download latest build for M7 here: https://androidfilehost.com/?w=files&flid=334598&sort_by=date&sort_dir=DESC

+ BitGApps ARM 11 v1.4+: https://github.com/BiTGApps/BiTGApps-Release/releases/

+ Charge phone to 100 %

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.

Then install HTC_BMP_USB_Driver_x64.msi (or *_x86 if you have a 32bits Windows edition).

### Install doesn't work ? Try these drivers for Win10 : https://htcusbdriver.com/download/htc-usb-driver-v4-02-0-001

Now go to my folder flash, and right click the adb 15seconds installer > Run as administrator.

During install, every time the command asks you a confirmation, enter Y and confirm with Enter.

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).

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

Use an app like Backupyourmobile 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 not accessible.

Only a stock ROM can remove simlock.

To go back from custom ROM to stock in 1 zipfile flash, follow this tutorial: https://tcg96.github.io/m7gurureset

3) UNLOCK BOOTLOADER

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

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

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

Tap on it, accept the warning.

Toggle on the USB debugging option.

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

check Always allow and confirm by tapping on OK.

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

### Then navigate to my flash folder (if it is on desktop) with this command :

cd /d C:\djibe\flash

Enter command :

adb devices

, confirm by pressing Enter.

Command returns :

List of devices attached
HT35****** device

### If no device is found, uninstall and reinstall properly the drivers while antivirus is off.

### Or start fresh on another PC.

Now type :

adb reboot bootloader

Authorize ADB commands on phone.

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

Type :

fastboot devices

Command returns :

HT35**** fastboot

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, chose HTC One (M7), 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 :

unlock token check successfully

Back to phone, press Volume+ to select "Yes, unlock bootloader", then Power button to confirm flash.

Now wait while phone is going to Factory reset.

Don't let Android restart by holding both Power + Volume- to enter bootloader immediately.

FASTBOOT menu is overlined in red.

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.1_9-0-m7univ.img

Command returns :

finished. total time: x.xxxxs

##€ If it fails, tries with a Windows Powershell shell.

Now on phone, press Volume- to select Bootloader, confirm with Power button.

You are back to the booloader screen (UNLOCKED is written on top line), press Volume- to navigate to RECOVERY, and confirm with Power button.

Phone reboots in TWRP recovery.

5) WIPE PARTITIONS

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

You land on TWRP Home screen.

Go to Wipe > Advanced wipe.

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

6) FLASH ROM, GAPPS AND ROOT (OPTIONNAL)

We first have to get our zips on the phone.

Still on TWRP Home screen, tap on Mount > deselect all partitions except Data, then connect phone to PC.

In Windows Explorer, you can see MTP Device, copy the zips of ROM, GApps, Magisk + Magisk Manager right in the Internal Storage folder.

Tap on Disable MTP once copy is finished.

Then back to Home screen, tap on Install > choose lineage*.zip,

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

then Add more Zips -> Magisk*.zip,

then Add more Zips -> bitgapps*.zip,

then Swipe to confirm Flash.

Wait for operation to end (can be long).

When completed successfully, tap on Reboot.

Tap on Do not install when TWRP asks for the app install.

Wait during long first boot.

Setup Android.

7) You can use Backupyourmobile to restore data,

use GPS Status & Toolbox app to enhance GPS fix.

That's it.

Enjoy,

djibe

THANKS --------------

Teams of : TWRP, LineageOS team, tarkzim, zsoerenm, alray, .🅱️, Flyhalf205, icxj1, R1ghtC, gimmeitorilltell, All M7/MSM8960 contributors.