Skip to content

Instantly share code, notes, and snippets.

@He-Is-HaZaRdOuS
Last active November 23, 2025 01:55
Show Gist options
  • Select an option

  • Save He-Is-HaZaRdOuS/97691ea56de09357d291ed620c8ad86d to your computer and use it in GitHub Desktop.

Select an option

Save He-Is-HaZaRdOuS/97691ea56de09357d291ed620c8ad86d to your computer and use it in GitHub Desktop.
Installing LineageOS + microG with Working SMS/Geolocation and Passing SafetyNet Without Google Accounts

Installing LineageOS + microG with Working SMS/Geolocation and Passing PlayIntegrity Without Google Accounts

This guide documents the process of installing LineageOS with microG and passing PlayIntegrity without logging into any Google accounts. It also ensures SMS and GPS functionality while maintaining privacy.


Prerequisites

  • A device compatible with LineageOS.
  • Familiarity with unlocking bootloaders, flashing custom ROMs, and using terminal commands.
  • Backup your data before proceeding.

Installing LineageOS with microG

  1. Install LineageOS for Your Device

  2. Install F-Droid

    • Download and install F-Droid, the open-source app store for Android.
  3. Add and Install microG Repositories and Apps

    • Add the microG repositories to F-Droid by following this guide.
    • Install the following microG components:
      • microG Services Core
      • microG Settings (companion app)
      • microG Services Framework Proxy (This might not install due to being outdated; we resolve this in step 5.)
  4. Install Kitsune Magisk

    • Download and install Kitsune Magisk (fork) from 1q23lyc45's GitHub.
    • Enable all features in Kitsune Magisk, such as Zygisk and MagiskHide, except for "Enforcing Sulist" (this may cause issues).
  5. Install microG Installer Revived

    • Install microG Installer Revived to obtain Google Services Framework (GSF), required for SMS functionality.
    • If the installer fails, either:
      • Wait for an update.
      • Modify the customize.sh script in the installer to bypass version checks manually.
  6. Install Nominatim for GPS Functionality

    • Install Nominatim from F-Droid. This tool resolves GPS data for microG.
    • Enable Nominatim in the Location section of the microG settings.
    • In the same section, enable relevant options for:
      • Wi-Fi localization
      • Cellular localization

Adjust these settings based on your privacy preferences.

  1. Modify the Kernel Name
    • Use the kr_offset.sh script to change your kernel name to something unique (e.g., "bushcat"):
      ./kr_offset.sh --auto --patch "bushcat"
      • Reboot your device after running the script.
      • Verify the kernel name change using a terminal emulator or ADB:
        uname -r
        The output should show the new kernel name.

Why Change the Kernel Name?
Google blacklists popular kernel names, causing PlayIntegrity to automatically fail on devices with these names. Changing the kernel name bypasses this blacklist.

  1. Register Your Device in microG
  • Use MagiskHide to hide root access from the microG Services Core app.
  • Open the microG Settings app and register your device using the Device Registration feature.

Updating LineageOS with microG

Follow these steps to update your LineageOS installation while ensuring everything remains functional:

  1. Download the new build and boot image

    • Obtain the latest LineageOS build and its respective boot image for your device.
  2. Patch the boot image

    • Use Kitsune Magisk to patch the boot image.
    • Copy the patched boot image back to your computer.
  3. Reboot to recovery and sideload the new build

    • Boot into recovery mode.
    • Sideload the new build using the following command:
      adb -d sideload filename.zip
  4. Switch to the updated slot

    • After sideloading, you will be prompted to reboot recovery to install additional zips.
    • Accept this option even if you don’t plan to install additional zips. This ensures your device switches to the updated slot.
  5. Flash the patched boot image

    • Reboot to the bootloader (fastboot mode).
    • Flash the patched boot image with the following command:
      fastboot flash boot magisk_patched_boot.img
  6. Reboot to system and verify the update

    • Reboot your device into the system.
    • Ensure the update was installed correctly and the system is functioning as expected.
  7. Update the kernel name if necessary

    • If required, change the kernel name as described in the earlier sections.
    • Reboot your device after making this change.
  8. Verify microG functionality

    • Ensure microG is functioning correctly.

By following these steps, you can safely update your system while preserving your setup.


Strong Integrity setup

  1. Install PlayIntegrityFork

  2. Install ReZygisk

  3. Install TrickyStore

  4. Install TrickyAddon

  5. Install MMRL

    • Download and install MMRL.
  6. Install WebUI-X

  7. Reboot Device

  8. Configure TrickyStore

    • Launch TrickyStore module from inside the MMRL app.
    • Enter the TrickyStore module configuration from inside the WebUI-X app.
    • Tap ☰ icon and select All from the menu.
    • Tap Set valid keybox.
    • Tap Set security patch and choose Set to auto.
    • Tap Save.
  9. Generate a new PIF Config

    • Open a terminal session on your device and obtain sudo rights by typing su and granting permissions.
    • cd to the following directory /data/adb/modules/playintegrityfix.
    • Execute the following command sh autopif2.sh -s -p to crawl the Android Platform Preview builds for unrevoked pixel PIF configurations.
  10. Profit?

    • Check if your device now passes all Play Integrity tests. If not, consult the PlayIntegrityFork github page for more advanced options to generate PIF configurations.
    • If you're still failing Strong Integrity, then it's likely that your keybox got invalidated, in this case you need to set a new one as per the previous step.
    • You generally need to generate a new PIF configuration every week or so as Google tends to invalidate older ones. This is the only true hassle of using this setup.
  • Credits go to 306bobby for his wonderful guide on bypassing PlayIntegrity checks!

FOSS Alternatives and App Recommendations

  • To maintain privacy and avoid Google accounts, consider using the following FOSS apps and services:

    Browser: IronFox or Cromite
    Email: Thunderbird
    Messaging: Element
    Navigation: Organic Maps or OsmAnd+
    App Store: Aurora Store for downloading apps from the Play Store anonymously.

Feel free to explore F-Droid for more free and open-source applications.


Troubleshooting

If PlayIntegrity fails:
Ensure all modules and microG components are installed correctly.
Reboot your device and try the tests again.
Check for updates to any of the tools or scripts.
Verify that the kernel name has been changed successfully.
If all else fails, seek help on relevant forums or communities.


Screenshots:

About Android PlayIntegrity microG Services

@camlafit
Copy link

@He-Is-HaZaRdOuS
Copy link
Author

@camlafit Hello, thanks for pointing that out.

I believe the original PIF was discontinued and as for Kitsune Magisk I'm not so sure, might have went private.

The guide is due for an update anyways as Google now also started checking keyboxes and other device specific properties. I'll try updating it with the new instruction set within 48 hours :)

@camlafit
Copy link

Hello

Don't worry :)
I was searching some complement to update my microg lineageOS FP4 and found your useful gist :)

@He-Is-HaZaRdOuS
Copy link
Author

@camlafit Updated!

@camlafit
Copy link

👍 thanks a lot

@sewnie
Copy link

sewnie commented Jul 13, 2025

doesn't work unfortunately. however, i observed that you're using normal Lineage.

have you tried los4microg?

@He-Is-HaZaRdOuS
Copy link
Author

@sewnie The PlayIntegrity part is hit and miss, practically luck, depending on the status of PIF and keyboxes, and on the banking apps' security mechanisms.

The MicroG part works fine to this day as I use it as my daily driver. I use normal LOS builds and I compiled custom LOS with my own MicroG setup and private keys and it works on there too. I haven't tried los4microg as I didn't see a need for it personally, however I took inspiration from their automation scripts to produce my own lineage builds.

@CloisteredCaiman
Copy link

nice work on the guide very detailed. I was also unsuccessful in getting anything more than "meets basic integrity" however

@sewnie
Copy link

sewnie commented Oct 26, 2025

the keyboxes have been revoked and its quite difficult to chase nowadays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment