[Guide/tutorial] HTC One M7 stock to Android 7.1 Nougat/Lineage OS 14.1 or Android 8.1/AICP 13
This detailed step-by-step guide helps you transform your HTC One M7 to a powerful one with Android 7.1 Nougat.
Make sure you have the One M7 model, in Android, go to Settings -> About phone.
### I'm not sure it works for the M7vzw and M7spr, so leave this page if you have these models
CHANGELOG OF TUTORIAL -----------
v1. Initial release
1 ) DOWNLOAD ---------------------
- djibe HTC One M7 pack (39 Mo) v1 : http://bit.ly/djibe-onem7-v1
(includes HTC drivers, root, recovery TWRP 3.2.1-0, adb.exe, fastboot.exe, DeviceID app).
Unzip the djibe folder from the zip on desktop.
I am not here to infect you (noone ever reported any of my packs), so here is the VirusTotal scanner : https://www.virustotal.com/#/file/72...8c48/detection
- ROM Lineage OS 14.1 unofficial build by XDA user @.:B:. : https://volatilesystems.org/dl/lineageos/14.1/m7/
OR XenonHD : https://forum.xda-developers.com/htc...12-14-t2986038
Download from here : https://mirrors.c0urier.net/android/...N/Official/m7/
OR Slim7 : https://forum.xda-developers.com/htc...lim-7-t3486656
WANT to try Android 8.1 Oreo ?
Try AICP 13.1 : https://forum.xda-developers.com/htc...o-8-1-t3756651
Download GApps for Android 8.1 and follow the same tutorial.
- OpenGApps ARM 7.1 (I prefer nano version, but you can choose your prefered) : https://opengapps.org/?arch=arm&api=7.1&variant=nano
- 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
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).
###It doesn't work ? Try these drivers for Win10 : https://htcusbdriver.com/download/ht...er-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.
3 ) UNLOCK BOOTLOADER
In Android, go to Settings -> About -> Software information -> More.
Tap 7 times on Build number. It unlocks Developer options.
Now in Android -> Settings, above the About menu you can see the 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).
### If you have Powershell installed, click on windows start menu, search for command, right click on the shortcut and set Run as administrator.
### Then navigate to my flash folder (if it is on desktop) with this command :
Command returns :
List of devices attached HT35****** device
### Or start fresh on another PC.
Now type :
adb reboot bootloader
fastboot oem get_identifier_token
Command returns multiple lines.
Select with your mouse all the lines from
<<<< Identifier Token Start >>>>
to the line
<<<<< Identifier token end >>>>>
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 >>>>
<<<<< 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).
HTC tells you : Token Submitted Successfully.
Open your mailbox (associated to your HTC account).
Now copy the Unlock_code.bin file attached to email in my "flash" folder you unzipped.
Now in Windows command, type :
fastboot flash unlocktoken Unlock_code.bin
Command returns :
unlock token check successfully
Now wait while phone is going to Factory reset.
Don't let Android restart by holding Power + Volume- to enter bootloader immediately. Curose is over Fastboot, confirm with Power.
4 ) FLASH RECOVERY
Using the same Windows command prompt, enter :
fastboot flash recovery twrp-3.2.1-0-m7.img
finished. total time: x.xxxxs
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 ) FORMAT TO F2FS AND WIPE PARTITIONS
INFO : F2FS is the fastest filesystem for read and write partitions on flash memories. Compared to EXT4, gain is from 15 to 280 %.
No need to format the /System partition because it is Read only and Ext4 is still faster.
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.
Then back to Advanced Wipe,
Select cache -> Repair or change filesystem -> change filesystem -> F2FS,
Do this step again for the Data partition.
Go back to TWRP home screen.
6) FLASH ROM, ROOT, GAPPS
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, addonsu and deviceid*.apk (both in my pack) 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 -> addonsu*.zip,
then Add more Zips -> open_gapps*.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.
7 ) ROOT ACCESS
Settup your fresh Android.
Once in Android, open the Settings menu, select "About Phone".
Go to Settings -> About -> Hit 7 times on the build number, go back,
Go to the Developer options menu, root access -> activate ADB+apps.
You are now root !
8) CALIBRATE BATTERY
After a system flash, it's always good to recalibrate battery.
In Google Play Store, download App Battery Calibration (from IMobS Ltd).
Launch the App.
Confirm root acces.
Plug tab and wait till charge hits 100%, then hit BATTERY CALIBRATION and unplug it.
9) You can use Backupyourmobile to restore data,
you can use GPS Status & Toolbox app to enhance GPS fix.
10 ) OBTAIN GOOGLE MOBILE SERVICES (GMS) CERTIFICATION
Google now restricts Google Play and Google apps access to certificated devices. Since you have a custom ROM, you are banned.
We now need to subscribe for the Google Play Certification.
In Android, go to Settings -> Security and activate the Unknow sources.
Now launch the built-in Files app, navigate to your microSD card.
Tap on the deviceID app you copied earlier.
Install it, launch it.
Tap on the Google Service Framework (GSF) line, then tap on the COPY button.
In your Android webbrowser, go to : https://www.google.com/android/uncertified/
Connect to Google using your Google/Android account.
In the input field of the page, paste the 16 digits code.
Click on the Save button, a success message confirms your device is Certified.
Do I need to re-certify it ?
"Your device’s GSF ID is reset every time your device is factory reset (or when you wipe the GSF app itself) since it is stored in your data partition, so you must re-register your GSF ID every time you perform either of these actions."
More info here : https://lineageos.org/Google-Play-Certification/
Teams of : TWRP, Lineage OS, alray, .:B:.