[GUIDE/TUTORIAL/HOWTO] Motorola Moto G5 Stock to Android 11

Search This thread

djibe89

Senior Member
May 24, 2014
1,067
561
Samsung Galaxy Tab S2
Google Pixel 4a
[GUIDE/TUTORIAL/HOWTO] Motorola Moto G5 Stock to Android 11
[GUIDE/TUTORIAL/HOWTO] Motorola Moto G5 (cedric) Stock Android 11/LineageOS 18.1

Complete guide to install Android 11 on your Motorola Moto G5.
This tutorial only applies to this model, to check the correct version:
in Android, go to Settings > System > About phone, make sure it is one of these models:

- XT1670
- XT1671
- XT1672
- XT1675
- XT1676
- XT1677

Netflix and Disney+ are working.

See all my tutorials at https://github.com/djibe/Android-tutorials


CHANGELOG

v3. Magisk config for Netflix and Disney+
v2. Remove Warning Bootloader Unlocked Message (thx @Jospe)
v1. Initial release


1) WHAT YOU NEED

- djibe Moto G5 pack: https://bit.ly/motoG5djibepack
(Contains link to Motorola Bootloader unlock + TWRP Recovery 3.5.2_9-0 + Magisk root + Motorola USB drivers x32/64 + fastboot + logo.bin
+ latest modem firmware)

+ ROM LineageOS Official 18.1: https://forum.xda-developers.com/t/rom-official-cedric-11-lineageos-18-1.4260293/
Download latest build here: https://download.lineageos.org/cedric

+ BitGApps ARM64 11: https://github.com/BiTGApps/BiTGApps-Release
+/- extra apps: https://bitgapps.github.io/addon/ARM64.html

+ a microSD card formatted in FAT32: copy ROM, GApps (and Magisk). Insert it in phone

+ Charge phone to 100%


2) INSTALL DRIVERS

Install Motorola 64 bits drivers (32 or 64 bits depending on your Windows version).
Then plug Moto G5 to PC and let the install go on.


3) BACKUP YOUR DATA

When your phone is connected to Windows, search for all .jpg, .mp3, .mp4 files on your phone and make copies on your PC.

Then, with an app like Backupyourmobile, backup all your SMS, MMS, contacts.
Make sure the backup is located on microSD card.


4) UNLOCK BOOTLOADER

Update your Moto G5 to the latest official Android 8.1 Oreo.
In Android, go to Settings > System > System updates. Make sure you have latest version.

Go to Settings > System > About phone.
Tap 7 times on Build number to unlock Developer options.

Go to Settings > System > Developer options.
Switch ON "OEM onlocking"
### OEM Unlocking is disabled ? Reset phone to factory settings and start all over.

Then, go to Motorola website (shortcut in my archive or right below):
Subscribe using your Google Account or email.

Shut down phone.
Power it on in fastboot mode: Hold Power et Volume- during 3-4 secondes and release.
Screen is black with lines of text, starting with AP Fastboot Flash Mode (Secure).
Connect phone to USB, wait for fastboot drivers to install.

In Windows, select the /flash subfolder you unzipped from my archive.
On keyboard, make a combo Shift + right click > Open command windows here.
(or type cmd in Address bar and then hit Enter)

Write this command in Windows terminal :
Code:
fastboot oem get_unlock_data
confirm using Enter.
Command sends back a message like this :
Code:
$ fastboot oem get_unlock_data
(bootloader) 3A15680508256597#
(bootloader) 5A59333232324C373354004D6F746F2047200000#
(bootloader) 73FAD5B03353BBDAB1B0DCF7AC5D45AD99CB7DD8#
(bootloader) 348B937F00000000000000000000000
OKAY [  0.016s]

Select all text > right click > select all.
Open a notepad editor, and paste text.
Rework the text to get it on 1 line, and remove all spaces and "(bootloader)" messages.
It should look like this : 3A15680508256597#5A59333232324C373354004D6F746F2047200000#73FAD5B03353BBDAB1B0DCF7AC5D45AD99CB7DD8#348B937F000000000000000000000000

Now, copy this line and paste it in Motorola website: https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-b
Below, click on "Can my device be unlocked?" button.

Wait and then go to bottom of page.
I agree to be bound by the terms of the legal agreement: select Yes and click on "Request Unlock key"

You get the unlock key by email, looking like: C2L3N73RV6BUR7RT4ZTY

Use this unlock key in the following Windows command:
Code:
fastboot oem unlock YOUR_UNLOCK_CODE

Terminal asks for a second run of the same command:
Code:
fastboot oem unlock YOUR_UNLOCK_CODE

Confirm with enter and wait a moment ... till success is confirmed : " Bootloader is unlocked! Rebooting phone".

Keep Windows command opened.


4) FLASH RECOVERY

Now enter this command:
Code:
fastboot flash recovery twrp-3.5.2_9-0-cedric.img
Confirm with Enter.

Terminal confirms : "Finished. Total time: 0.670s".
### For future TWRP updates, TWRP.img can be flashed from TWRP recovery itself (Install > Install Image).

To remove bootloader unlock warning:
Code:
fastboot flash logo logo.bin

Back to the phone (still in fastboot/bootloader mode).
Press Volume- to select "RECOVERY MODE". Confirm by pressing Power.

Welcome to TWRP 3.5 recovery.

TWRP asks for Data partition password.
Tap on Cancel button.
### Well you already did a backup isn't it ?

TWRP asks for Keep System Read Only ? Swipe to Allow Modifications.
### You don't see this warning screen? Then you'll get "TWRP unable to mount storage" while trying to wipe partitions.
### > in TWRP, go to Reboot > Recovery so Recovery will refresh and popup the partition writing privilege.

In TWRP home screen, go to Wipe > Format data.
This will remove encryption.
Type yes and confirm to format partition.

Go to Reboot > Recovery.

Back to TWRP, go straight to Backup menu.
Select System, System Image, Boot, Vendor, Vendor image, persist_img and EFS partitions.
Tap on Select Storage and set Micro SD card.
Swipe to Backup and wait during backup.
### If MicroSD card is too small. Backup on data partition and after backup has ended, go to Mount and connect phone to PC to retrieve TWRP backup folder.
### Store this backup (aka nandroid backup) somewhere safe before going further.


5) WIPE PARTITIONS

Go to Wipe and Swipe to Factory reset.


6) FLASH ROM, BITGAPPS +/- MAGISK

Back to TWRP Home menu. Then 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 > BiTGApps*.zip,
then Swipe to confirm Flash.
Wait for operation to end.

### You probably get this error: ERROR: This package requires firmware from an Android 8.1 based stock ROM build. Please upgrade firmware and retry!
### Your modem doesn't seem to be latest one (even though all official updates were stated as installed on my phone).
### Restart to fastboot mode (bootloader) and enter this new command:
Code:
fastboot flash modem NON-HLOS.bin
### Then go back to the beggining of this chapter.

Then tap Wipe cache/dalvik, swipe to confirm,
then Reboot System.

Android 11 is installed !
Wait for the phone to boot during 10 minutes.


7) ROOT WITH MAGISK (OPTIONAL)

### Only if you flashed Magisk via TWRP recovery

Configure Android as you like.
Magisk root starts with Android.
You can manage permissions and extra modules with Magisk Manager app.

If Magisk Manager doesn't download apk. Download official apk here: https://github.com/topjohnwu/Magisk/releases


10) OTHER APPS

- You can use GPS Status & Toolbox for faster GPS fix.
- Developer options
Settings > About phone.
Tap 7 times on build number.
Back to Settings > System > Advanced > Developer options
Select USB Configuration > set MTP
Set Windows animation scale, Transition animation scale and Animator duration scale to .5x


11) NETFLIX, DISNEY+

For Netflix and Disney+, follow this tutorial, all required files are included in my pack: https://www.droidwin.com/how-to-hide-root-from-apps-via-magisk-denylist/
Netflix is available as an APK from my pack.
Even though CTS profile match didn't work, both apps work.

That's it.

Enjoy ;-)

djibe

Thanks: @JarlPenguin, LineageOS team, TWRP team, BitGapps team, TopJohnWu (Magisk), @Jospe (Bootloader warning)
 
Last edited: