This tutorial shows the entire process of oficially unlocking, TWRP recovery flashing, and Magisk rooting your european LG G5.
- Unlocking bootloader wipes all your phone data, backup first.
- Do not flash no-verity-opt-encrypt.zip, it causes random issues and it's not needed unless you want a writable system partition, and you probably don't (it prevent stock roms from being updated).
- DO NOT WIPE data partition: As long user-data partition is encrypted with a key stored there, it will be no longer available.
- If you have working root support, remove it (binary and application) before installing Magisk.
- Root APPs with Magisk-related issues:
- All non-magisk root managers.
- Xposed (it has an unofficial magisk-compatible version at its own post on xda-developers forums).
- AFWall+ (use a root-less alternative like NetGuard or Opera Max).
- Install Android-SDK, open AVD Manager and make sure you have the last platform-tools version installed.
- Head to your Android-SDK installation directory, head to platform-tools directory, adb and fastboot commands are there.
- On your phone, head to
Settings > About phone > Software info
. - Tap 7 times on
Build number
. - Head to
Settings > Developer options
. - Enable
USB debugging
. - Activate
Enable OEM unlock
.
IMEI (International Mobile Station Equipment Identity) is an unique ID given to every cell-phone-related device.
You have two options:
- On your phone dialer, enter
*#06#
. - Request it from your carrier, as the IMEI is sent to them everytime you connect to a cell network, useful if your phone is bricked.
- Go to device bootloader (fastboot), you have two options:
- Using adb command
adb reboot bootloader
(see Installing Android-SDK). - Turn off phone, unplug USB, wait 10 seconds, hold Volume key up while plugin USB.
- Use fastboot command
fastboot oem device-id
, some lines will be shown. - Copy lines showing an hexadecimal code (alphanumerical characters ranging from 0 to 9 and A to F), remove console prompts, whitespace, linebreaks in order to get a code like
CD58B679A38D6B613ED518F37A05E013F93190BD558261DBBC5584E8EF8789B1
. - Optional: You can use fastboot command
fastboot reboot
to reboot your device.
IMPORTANT: this procedure will WIPE ALL YOUR PHONE DATA, EVERYTHING (files, configuration, apps...). BACKUP your data first elsewhere.
LG provides an official method to unlock european G5/H850 fastboot bootloaders for developers (they also allow to unlock european G4/H815 and V10/H960A devices).
- Register at developer.lge.com.
- Head to http://developer.lge.com/resource/mobile/IssueDeviceInfo.dev (their full instructions are at http://developer.lge.com/resource/mobile/RetrieveBootloader.dev).
- Complete all data (including IME and Device ID), accept terms, and continue.
- Head to your email inbox, you should receive an email containing the bootloader unlock key.
- One email arrives, download the
unlock.bin
attachment file. - Boot to device's bootloader (see Getting Device ID section).
- Use fastboot command (see Installing Android-SDK section)
fastboot flash unlock unlock.bin
, making sure unlock.bin refers to downloadedunlock.bin
path. - Your phone will be wiped and a warning message will be shown on every boot from now on.
- Optional: You can use fastboot command
fastboot reboot
to reboot your device.
TWRP is one of the best recoveries out there.
- Download TWRP from here https://twrp.me/devices/lgg5h850.html (you will end with a
.img
file) - Boot to device's bootloader (see Getting Device ID section).
- Use fastboot command (see Installing Android-SDK section)
fastboot flash recovery recovery.img
, making sure recovery.img refers to downloaded TWRP.img
path. - Optional: You can use fastboot command
fasboot reboot
to reboot your device.
Magisk provides root with fast root-unroot switching for root-incompatible apps like Pokemon Go or Android Pay, automatically thanks to AutoMagisk.
- Download Magisk and phh-superuser flashable zip files from the official Magisk post at xda-developers forum.
- Boot to TWRP:
- Shut down phone, unplug, wait 10 seconds.
- Hold volume down.
- Hold power until LG logo show up, quickly release and hold again.
- Ignore TWRP encryption-related messages (it's not working for this device yet), and DO NOT enable system partition write support (it causes random problems with stock rom).
- Head to advanced options and enable sideload.
- Use adb command (see Installing Android-SDK section)
adb sideload magisk.zip
, making sure magisk.zip refers to downloaded Magisk zip path. - Head to advanced options and enable sideload again.
- Use adb command (see Installing Android-SDK section)
adb sideload phh-superuser.zip
, making sure phh-superuser.zip refers to downloaded phh-superuser zip path. - Head to reboot and choose System.
- You phone should boot normally.
- Enable
Unknown sources
inSettings > Security
. - Install Magisk Manager apk, phh-superuser apk, both also available at the official Magisk post at xda-developers forum (phh-superuser apk is also available on Google Play).
- Install AutoMagisk apk, optional but highly recommended as it disables root automatically while using conflictive apps, from the official AutoMagisk post at xda-developers forum.
- If TWRP does not survive across reboots, you can use Flashify (available at Google Play) to flash and boot-to-recovery only when needed.
- If some app suffers force-closing, try ONE of this (from easier to harder):
- Go to
Settings > Applications
(use the menu to show it if it's a system one) and wipe its data and cache. - Wipe cache from TWRP, but DO NOT WIPE DATA (see Important section above).
- Flash a clean stock ROM, and do everything above, again, as some issues may arise with previously
modded
system partitions.
- Go to
PLEASE HELP!! -
C:\Users$h4mDr!v3\Desktop\4nDr01d\adbfastboot>adb reboot bootloader
C:\Users$h4mDr!v3\Desktop\4nDr01d\adbfastboot>fastboot flash recovery recovery.img
sending 'recovery' (19076 KB)...
OKAY [ 0.576s]
writing 'recovery'...
FAILED (remote: unknown command)
finished. total time: 0.596s
C:\Users$h4mDr!v3\Desktop\4nDr01d\adbfastboot>