FORUMS
Remove All Ads from XDA

[Guide/tutorial] HTC One M7 stock to Android 7.1 Nougat/Lineage OS 14.1

353 posts
Thanks Meter: 255
 
By djibe89, Senior Member on 23rd April 2018, 11:44 AM
Post Reply Email Thread
[Guide] HTC One M7 Android 7.1 Nougat/Lineage OS 14.1
[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
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).
###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.

Disconnect phone.


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 :
Code:
cd C:\Users\YOURUSERNAME\Desktop\djibe\flash
Enter command :
Code:
adb devices
, confirm by pressing Enter.
Command returns :
Code:
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 :
Code:
adb reboot bootloader
Phone restarts in Fastboot mode. Wait till phone screen is blank in fastboot mode.

Type :
Code:
fastboot devices
Command returns :
Code:
HT35****   fastboot
Type :
Code:
fastboot oem get_identifier_token
, confirm by pressing Enter.
Command returns multiple lines.
Select with your mouse all the lines from
Code:
<<<< Identifier Token Start >>>>
(included)
to the line
Code:
<<<<< 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).
Now copy the Unlock_code.bin file attached to email in my "flash" folder you unzipped.

Now in Windows command, type :
Code:
fastboot flash unlocktoken Unlock_code.bin
, confirm with Enter.
Command returns :
Code:
unlock token check successfully
Now on phone, confirm bootloader flash with Volume+ to select "Yes, unlock bootloader" and confirm flash with a press on the Power button.

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 :
Code:
fastboot devices
to make sure phone is still available.
Then
Code:
fastboot flash recovery twrp-3.2.1-0-m7.img
Command returns :
Code:
finished. total time: x.xxxxs
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 ) 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/

That's it.


Enjoy,
djibe

THANKS --------------
Teams of : TWRP, Lineage OS, alray, .:B:.
The Following 2 Users Say Thank You to djibe89 For This Useful Post: [ View ] Gift djibe89 Ad-Free
 
 
25th April 2018, 12:24 AM |#2  
Recognized Contributor
Thanks Meter: 3,584
 
Donate to Me
More
Just my 2 cents
Just my 2 cents if it can help
Quote:
Originally Posted by djibe89

- a microSD card (FAT32 format). Copy the zips of ROM, GApps, addonsu and deviceid*.apk (both in my pack) on the root folder of microSD, then insert it in phone.

The M7 is not equipped with a mircoSD card slot, only a virtual /sdcard (symlink to /data/media/0) ... So they'll either have to adb sideload or adb push the files to internal memory which is pointless at this stage since it will be wiped during bootloader unlock. Or drag n drop the files using mtp from twrp once it's installed on the phone.

Quote:

3 ) UNLOCK BOOTLOADER
[...]
Now wait while phone is going to Factory reset.
Setup Android again on next boot.


4 ) FLASH RECOVERY
Now re-enable USB debugging in Android.
Using the same Windows command prompt, type

Code:
adb reboot bootloader
again.

You could save a lot of time just force rebooting to bootloader (power + vol down) right after BL unlock/factory reset are completed so you don't have to setup the system you're going to wipe 2 steps later. USB debug anyway isn't required to fastboot flash recovery so it's not like booting back in system is mandatory before flashing recovery.

25th April 2018, 09:20 AM |#3  
OP Senior Member
Thanks Meter: 255
 
More
@alray : Thank you so much for help.
I'm lazy with baby waking up every night and did some awful copy-paste.
I correct all these right now.
Thanks.
The Following User Says Thank You to djibe89 For This Useful Post: [ View ] Gift djibe89 Ad-Free
25th April 2018, 10:26 AM |#4  
Senior Member
Thanks Meter: 849
 
More
I would highly recommend to use the official downloads of twrp, HTC drivers, roms and so on, you uploaded these files to your google drive and there is stuff in it nobody will ever need. And nobody knows if those files are in original condition. Strange thats the third time this year someone tries to get users to use their stuff (for a five years old device) there are already a lot of guides out there and several thousand people did it several thousand times without problems. Also you wrote that this would be official lineage but its unofficial, and for that there is already a thread here. The other two threads got deleted by mods because they tried to get users to use files from unknown suspects sources. Use android file host and maybe tell in los thread where those files are stored, whats the source and who made it.
25th April 2018, 11:02 AM |#5  
OP Senior Member
Thanks Meter: 255
 
More
Quote:
Originally Posted by saturday_night

I would highly recommend to use the official downloads of twrp, HTC drivers, roms and so on, you uploaded these files to your google drive and there is stuff in it nobody will ever need. And nobody knows if those files are in original condition. Strange thats the third time this year someone tries to get users to use their stuff (for a five years old device) there are already a lot of guides out there and several thousand people did it several thousand times without problems. Also you wrote that this would be official lineage but its unofficial, and for that there is already a thread here. The other two threads got deleted by mods because they tried to get users to use files from unknown suspects sources. Use android file host and maybe tell in los thread where those files are stored, whats the source and who made it.

Because you are a senior member you know where to download everything.
But everyone is not like you.
So I tried to compile a ready-to-go pack for the newcomers, like I did for many devices by know.
This allows noobs to profit from custom ROMs and don't keep it esoteric.

Like you say, many downloads are just hacks, so I tried to bundle lowest size safe files.
25th April 2018, 11:05 AM |#6  
OP Senior Member
Thanks Meter: 255
 
More
Quote:
Originally Posted by saturday_night

I would highly recommend to use the official downloads of twrp, HTC drivers, roms and so on, you uploaded these files to your google drive and there is stuff in it nobody will ever need. And nobody knows if those files are in original condition. Strange thats the third time this year someone tries to get users to use their stuff (for a five years old device) there are already a lot of guides out there and several thousand people did it several thousand times without problems. Also you wrote that this would be official lineage but its unofficial, and for that there is already a thread here. The other two threads got deleted by mods because they tried to get users to use files from unknown suspects sources. Use android file host and maybe tell in los thread where those files are stored, whats the source and who made it.

For the official LOS ROM, tell LOS to store official builds. As they don't do it anymore, we must rely on personnal builds.

A lot of guides out there ? Made extensive search for cracking this phone, never found a step by step one.

Five year old device ? Still so good once unleashed. Custom ROMs are for these devices isn't it ?
25th April 2018, 10:10 PM |#7  
Senior Member
Thanks Meter: 186
 
More
@djibe89 Might be useful to point out in your opening post that the 20180420 build has DT2W enabled, but I'd like feedback from people with a functional battery if it makes their device reboot or not, similar to issues reported in the original kernel thread. I suspect my battery is on its way out. The 20180416 build is completely stock upstream LineageOS, no DT2W.

Thanks for the credit .
3rd May 2018, 06:59 PM |#8  
OP Senior Member
Thanks Meter: 255
 
More
Quote:
Originally Posted by .:B:.

@djibe89 Might be useful to point out in your opening post that the 20180420 build has DT2W enabled, but I'd like feedback from people with a functional battery if it makes their device reboot or not, similar to issues reported in the original kernel thread. I suspect my battery is on its way out. The 20180416 build is completely stock upstream LineageOS, no DT2W.

Thanks for the credit .

Thanks for your explanations.
22nd June 2018, 02:39 PM |#9  
OP Senior Member
Thanks Meter: 255
 
More
Any trouble following this tutorial guys ? How to enhence it ?
1st July 2018, 08:11 PM |#10  
Senior Member
Thanks Meter: 61
 
More
802D device supported?
3rd July 2018, 07:04 PM |#11  
OP Senior Member
Thanks Meter: 255
 
More
Quote:
Originally Posted by M.Z.F

802D device supported?

Hi, no idea, does your model has another model name/code ?
Post Reply Subscribe to Thread

Tags
android 7.1.2 nougat, bootloader / fastboot, htc one (m7), lineage os 14.1, tutorial

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes