How to use MicroG on LineageOS or CyanogenMod without Xposed

LineageOS logo

How to use MicroG on LineageOS or CyanogenMod without Xposed

LineageOS, the official fork of CyanogenMod, does not have an Xposed version available yet.

So after I upgraded from the last CyanogenMod 13 nightly (Android 6.0.1) to the latest LineageOS 14.1 (Android 7.1.1), MicroG wasn’t working anymore.

Fortunately there is still hope!

Here is how I proceeded to upgrade my OnePlus One (codename bacon):

Upgrading from CyanogenMod 13 to LineageOS 14.1

The upgrade process is quite painless:

  1. Download the Experimental and Nightly build for your device. For mine, it was available here.
    1. (optional) Download the zip corresponding to your platform to make your phone rootable in the extras section. Mine was arm.
    2. Verify that the md5sum of the downloaded files matches. If you’re on Windows, you can use the HashTab extension. If the MD5 sum is different, download your file again. If the file is corrupt, the upgrade process will fail very likely.
    3. If you want, you can verify the signature of the files as well.
  2. Backup original system with your recovery (mine is MultiRom’s TWRP). Make sure you backup the system partition!
  3. Flash the experimental zip first.
    1. It can look like it’s stuck during the system partition detection, but it’s not! Just wait. On my phone the installation needed almost 10 minutes.
    2. If you could not wait and stopped during flash, you broke your system partition. You will have no other choice than to restore your system partition from your backup!
    3. Once done, reboot and wait that the Experimental ROM is fully loaded. It can take some time to boot… Be patient.
    4. Reboot into recovery
  4. Flash the nightly zip
    1. It can take some time as well… Be patient.
  5. (optional) Flash the root zip
  6. Reboot your phone (can take time… Patience is the key…)

At this point, you should be able to boot into LineageOS 14.1. You may find that some apps are not working correctly. Try clearing the data for those apps.

You will also find that MicroG does not work anymore because the OS does not have Signature Spoofing!

Enabling signature spoofing on LineageOS (works for CyanogenMod 13 too)

As of today (27/01/2017) there is still no Xposed available. So I looked for a way to enable signature spoofing without Xposed. Fortunately there are some!

I used Tingle from ale5000. You will need:

  1. ADB (for Windows; for MacOS; for Linux) available in your PATH environment variable
  2. Python 3
  3. Java
  4. Enabling USB debugging and ADB root in the device’s Developer Options
  5. Extracting the tingle-master directory from the master.zip somewhere

Then open a command prompt or terminal and type:


adb pull /system/framework/framework.jar /path/to/tingle/input/

python /path/to/tingle/main.py

 

Choose choice #2 (Patch file from the input folder).

If everything is okay, you should have an output like:

C:\platform-tools>python tingle-master\main.py
MENU

    1 - Patch file from a device (adb)
    2 - Patch file from the input folder

> 2

 *** OS: Windows 10 (win32)
 *** Mode: 2
 *** Working dir: c:\users\ghautc~1\appdata\local\temp\Tingle-aabopb
 *** Decompressing framework...
      DEBUG: Decompressing framework.jar
 *** Disassembling classes...
      DEBUG: Disassembling framework/classes.dex
 *** Patching...
 *** Detected: Android 7.x / Android 6.0.x / CyanogenMod 13-14
 *** Patching succeeded.
 *** Reassembling classes...
      DEBUG: Assembling out/classes.dex
 *** Recompressing framework...
      DEBUG: Compressing framework.jar
 *** Copying the patched file to the output folder...
 *** All done! 🙂

Your original file is present at C:\platform-tools\tingle-master\output\framework.jar.backup

If your device bootloop, please run this command on the pc when the connected device is inside recovery:
adb push "C:\platform-tools\tingle-master\output\framework.jar.backup" /system/framework/framework.jar

Then you need to push the patched framework.jar back into your system partition!

Make sure your system partition is mounted read AND write:


adb shell

su

mount -o rw,remount,rw /system

Then type the following:

adb push /path/to/tingle/output/framework.jar /system/framework/framework.jar

If this step does not work, try pushing to /mnt/sdcard, then in the device using a root file explorer, copy the framework.jar file into /system/framework/ and overwrite the existing file.

Reboot phone…

Go into MicroG self-check menu. It should now say that the device has signature spoofing enabled! That’s all MicroG needs to work as expected.

(optional) Reinstall the Play Store

If you don’t want to use the Blank Store app but would rather prefer to use the official Play Store app, that’s also possible:

  1. Uninstall or delete any previous Play Store or Blank Store apk
  2. Delete any Google account on the device (Settings > Accounts > tap your Google account > tap your account again > […] > Delete account)
  3. Download the latest Play Store apk for your device (read the notes if necessary!)
  4. Copy it in your device and rename it to com.android.vending.apk
  5. Place it in /system/priv-app/ (make sure your system partition is writeable)
  6. Reboot
  7. Run the Play Store app and setup your account again
  8. Should work!