Make : Motorola/Google
Model : Moto G5
Model Code : XT1676
Model Codename : Cedric
Purchased : 2017-05-30
Storage : 16GB
RAM : 3GB
Latest : NPP25.137-93
Rooting
- https://technewswith.me/unlock-root-moto-g5/
- https://forum.xda-developers.com/g5-plus/how-to/how-to-root-moto-g5-plus-t3579659
-
Unlock Bootloader
adb reboot-bootloader sudo fastboot oem get_unlock_data
paste together code and post into moto form ...
wait for unlock key from motorola ...
sudo fastboot oem unlock KEY sudo fastboot oem unlock KEY # have to run it twice sudo fastboot reboot
-
Flash TWRP
adb reboot-bootloader sudo fastboot flash recovery twrp-3.3.1--cedric.img
"Image not signed or corrupt" is harmless.
Immediately select recovery using bootloader screen
otherwise boot will overwrite twrp
-
Wipe
- In the Decrypt /data screen, press cancel, then "Swipe to Allow Modifications"
- Go to WIPE, then "Swipe to Factory Reset"
- Come back to TWRP main menu, go to REBOOT, then RECOVERY, then DO NOT INSTALL
- "Swipe to Allow Modifications"
- Disable forced encryption
- Push and flash "no-verity-opt-encrypt-5.1.zip"
- Flash SuperSU
- Flash Magisk
- Push and flash "Magisk-v11.6.zip" # NOT VERSION 12!
- After the setup, come back to TWRP main menu, go to REBOOT, then SYSTEM, then DO NOT INSTALL
- Run and update Magisk App
Updates for Oreo
It seems like twrp-3.3.1 can unlock encrypted partitions so no-verity-opt-encrypt may not be needed.
Troubleshooting
Slow Google search widget
Clear Launcher3 Data
Settings > Apps > top right tri-colon > Show System > Launcher3 > storage > delete
This will reset the home screen.
Backup and Restore
UIDs and GIDs
adb shell
su
cat /data/system/packages.xml
List userId
s or sharedUserId
s:
xmlstarlet sel -t -m '//package' -v @sharedUserId -v @userId -o ' ' -v @name -n