Android 10 without Google services (replacement with microg) on an LG G6 (H870)

Posted on November 22, 2020 in Smartphone • 4 min read

This article is a quick summary of the steps I used to get a working Lineage + microg setup on my European LG G6 (h870), acting as a reminder for me and hoping it can help others. I voluntarily give little details since I expect the reader to be already familiar with Android alternative ROMs and flashing them.

Installation steps

  1. First, you should unlock your bootloader.
  2. (Windows required for this step) Then, you should update to the latest official firmware (v30b) using LG Bridge. Pro-tip: to make sure the upgrade process works smoothly, go into “Download Mode” (phone powered off, press volume up and connect USB cable). Make sure you do all the available official upgrades.
  3. Then, you can install a custom recovery. You should install SHRP which is maintained and Android 10 compatible. Otherwise, the only working version of TWRP I could find for the LG G6 is the 3.3.0-0 version. This however is not fully compatible with Android 10 and has issues with the /data partition (it works perfectly fine for Lineage 15.1 / 16.0 though!). Other versions would result in boot loops (recovery boot loops or, worse, boot logo boot loops) or be unable to mount the system partition (red error message “Failed to mount /system (device or resource busy)”).
  4. Then, format data, reboot and go to “Wipe” > “Advanced wipe” and select “cache Dalvik / ART”, “cache”, “data” et “system”). Be advised that checking “system” here will wipe your existing operating system on your device, I used it here to be sure to make a clean flash of the Lineage ROM. Reboot in recovery afterwards.
  5. Then, adb push the Lineage 17.1 ROM and install it through TWRP.
  6. Flash Magisk to get root abilities (this is now the standard way of having root, see https://www.xda-developers.com/lineageos-dropping-superuser-addonsu-implementation-favor-magisk-manager/. Also flash [https://f-droid.org/fr/packages/org.fdroid.fdroid.privileged.ota/] if you want F-Droid to be able to automatically update your apps.
  7. Reboot the normal system and go through the initial configuration wizard.
  8. Install F-Droid.
  9. Install NanoDroid patcher, following the deodexing procedure in their wiki (I had both the vdex and odex file, but following vdex instructions were enough) and flashing the NanoDroid-patcher-*.zip file through recovery (this one takes quite a few minutes, this is normal).
  10. Use a barcode scanner to scan the microg F-Droid repo QRCode and install “Services Core” (GmsCore), “Services Framework Proxy” and “Fake Store” through F-Droid. Also install “DroidGuard Helper” if you need to pass SafetyNet. Note that on Android 7 or later, GmsCore has to be installed as a system app, see microG wiki.
  11. Install a network geolocation backend, such as “Apple UnifiedNip” (or any other of your preference).
  12. Start the “GmsCore” app and run the autotest (checking signature spoofing is enabled, permissions are granted, etc.).
  13. You might be interested in Shelter from F-Droid if you plan on installing non-opensource apps.
  14. If you want to download APKs from the Play Store, you can install Aurora Store from F-Droid.

Tips

  • I got stuck once in a boot logo boot loop (device would reboot automatically, never going further than the LG boot logo). This is very annoying and I did not find any way to do a hard power-off of this device. Since the battery is not removable, it seems the only option is to let the device run out of battery.
  • I got stuck in a reboot recovery loop sometimes, although I did have a system (ROM) installed on the device. The device would never boot into the OS. This post did the trick: powering off the device, going into normal recovery (power + volume down until LG logo, then release power and push it again) and picking “yes” twice would get you into recovery and fix the boot loop.
  • I got stuck once in the LG “Firmware update” mode, with the device waiting for a firmware on USB and no possibility to exit. You can exit this mode by pressing simultaneously volume up + volume down + power for a few seconds.
  • NanoDroid promises to give an easy way to install the full microg suite. It is however bloated with features you do not necessarily want (see this comment).
  • XPosed Installer is an alternative option, letting you install the XPosed Framework and use the “Fake GApps” XPosed module for signature spoofing. This however requires adding the whole XPosed framework, which seems unmaintained and latest version source code is not published. It seems XPosed has been superseded by EdXPosed.
  • If you want to flash Lineage 15.1 or Lineage 16.0, you might end up with a message such as
Comparing TZ versions:
Max TZ version: TZ.BF.4.0.1.C4-126433
Current TZ version: TZ.BF.4.0.1-143200

and an error due to a failed assertion. This is because your bootloader is too high version, and you should flash a Nougat bootloader (downgrade).

  • If you want to dump the official KDZ images, copy the files appearing in C:\Users\YourUsername\AppData\Local\LG Electronics\LG Bridge\SWUpgrade\Image somewhere safe. These files are automatically purged after a successful upgrade!
  • Special boot modes of the LG G6 are described in the Lineage wiki.
  • If you want to go back to Stock mode, simply start the device in Download Mode and use the official “LG Bridge” tool to perform update / reinitialization.