So you’re trying to use your phone without Google’s Play Services, but you’ve found that you still have some use for it. You…

  • Use apps that require Google Cloud Messaging for notifications (most apps on the Play Store)
  • Use paid apps that use runtime license checks

Alright, you think. I guess it’s time to flash GAPPS again… But, thanks to the work of XDA Developers user MaR-V-iN, there now exists an open source implementation of Google Play Services called MicroG.

MicroG is currently considered beta status and does not implement all of the functionality of Google’s Play Services. You can see the current implementation status on the wiki.

Prerequisites

In order for MicroG to work, it needs to pretend to be the official implementation of Play Services. To do this, MicroG must be able to spoof Google’s Play Service’s package signature.

Signature spoofing is not available in most custom ROMs, though patches are available for ROM developers to include in their project. For Marshmallow and Nougat ROMs, spoofing is provided as a runtime permission that the user can grant or deny to apps, which is an added bonus.

For those ROMs that do not include the spoofing patch, scripts exist to patch the system in-place to allow signature spoofing. Note that patching using these scripts currently does not provide the ability to selectively allow or deny the permission like the above ROM patches do. The in-place patch scripts require a deodexed ROM to be able to patch successfully. A ROM with the patch baked in should be able to be odexed, though.

Installing

If you are using MicroG with any ROM running Marshmallow or below or a Nougat ROM with signature spoofing support baked in, you should be able to install MicroG as a user app either by downloading from the official site or the official F-Droid repository. Be sure to download the latest preview version, not the latest stable. The preview versions are stable enough (I have had no issues) and the older “stable” version will leave apps prompting you to upgrade to the latest version of Play Services. To make it easier, you can also install MicroG as a system app by using one of my flashable zips (see below).

If you are running a Nougat ROM patched with one of the scripts mentioned in the prerequisites section above, MicroG has to be installed as a system app to be able to provide network location data. To make the process easier, I provide flashable zip files to install MicroG, either with the official Play Store or with the FakeStore app that fakes the existence of the Play Store if you wish to use a different app store.

If you wish to use the official Play Store client with MicroG as a user app (e.g. you need runtime license checks to pass), a standalone zip for installing only the Play Store is also available.

Initial Setup

To begin, open up the microG Settings app and go to “Self Check”.

MicroG Settings home screen.

MicroG Settings home screen.

On the next screen you will see a list of items, each with a checkbox next to it. If the box is checked, the item is satisfied. If not, you will have to do something to satisfy the requirements. For instance, people on ROMs with signature spoofing built in will likely see this:

MicroG Self Check with Signature Spoofing unchecked

MicroG Self Check with Signature Spoofing unchecked

People who have patched the system using a script will see this instead:

MicroG Self Check on patched LineageOS with spoofing checked.

MicroG Self Check on patched LineageOS with spoofing checked.

If you see the above, you can ignore the unchecked box. You system spoofs the signature, it just doesn’t have it built in.

If the “System grants signature spoofing permission” option is unchecked and your ROM supports signature spoofing, just tap on the item and a permissions-granting dialog will open:

System prompting to allow spoofing to MicroG.

System prompting to allow spoofing to MicroG.

Tap “Allow” and the checkboxes will become checked, like so:

System granted spoofing to MicroG.

System granted spoofing to MicroG.

There are two other things that will start out unchecked:

Battery optimizations…

MicroG is currently "optimized"

MicroG is currently "optimized"

… and UnifiedNLP. For more on UnifiedNLP, see the page in the Setup Guide for Network Location Services. The instructions are the same for the standalone UnifiedNLP and the one built into MicroG.

Back to the battery, you’ll want to disable battery optimizations (aka “Doze”) for MicroG so that it provide app notifications through GCM even when the device is not in use. The easiest way to disable Doze for MicroG is to tap on the “Battery optimizations ignored” text. This prompt will appear:

MicroG prompting to disable Doze for it.

MicroG prompting to disable Doze for it.

Tap “yes” and the checkbox will become checked:

MicroG with Doze disabled

MicroG with Doze disabled

Optional Steps: GCM

If you are going to use MicroG for GCM, you’ll want to follow these steps to get GCM set up.

First of all: for apps to use GCM, MicroG must be installed and configured to use GCM before the apps requiring GCM are installed.

When you are on the MicroG Settings home screen, you’ll notice the following options:

MicroG home screen showing options for Google Cloud Messaging and SafetyNet.

MicroG home screen showing options for Google Cloud Messaging and SafetyNet.

To begin, you want to tap on that first option, “Google device registration”. On the next screen, tap the switch so that it is enabled, then tap the back button to go back to the home screen.

MicroG with device registration enabled

MicroG with device registration enabled

Next, tap on the option “Google Cloud Messaging” and tap the switch to enable GCM.

MicroG with Google Cloud Messaging enabled.

MicroG with Google Cloud Messaging enabled.

You’ll notice the three-dot menu in the top right corner. It contains some advanced options that you can modify.

MicroG Google Cloud Messaging advanced settings.

MicroG Google Cloud Messaging advanced settings.

I find the heartbeat setting to be fine at the default. The ability to confirm apps for GCM is nice, but (as of March 2017) I found that the prompting dialogue sometimes froze and never actually granted the permission. Your mileage may vary with this option.

Now any apps that you install that use GCM will be able to register with MicroG.

Optional Steps: SafetyNet

I personally do not use SafetyNet, so these setup directions may be lacking. If anything is missing, please let me know in the comments below.

To set up SafetyNet, first go to the home screen of the MicroG settings app and tap on the “Google SafetyNet” option.

MicroG home screen showing options for Google Cloud Messaging and SafetyNet

MicroG home screen showing options for Google Cloud Messaging and SafetyNet

To enable SafetyNet, just tap the switch (currently disabled in the image):

MicroG settings screen for SafetyNet

MicroG settings screen for SafetyNet

You may find that your system is failing to pass SafetyNet. Note in the above picture the explanation that the official server requires requests to be signed with the DroidGuard system. You can download an app that contains a sandboxed version of DroidGuard from the official MicroG F-Droid repo. Just search for “DroidGuard”.

MicroG DroidGuard addon

MicroG DroidGuard addon

Once you have DroidGuard installed (if you choose to install it), tap that three-dot menu and go to the advanced settings.

MicroG SafetyNet advanced settings

MicroG SafetyNet advanced settings

Tap the option to “Use official server”. Provided that you are not rooted (or are using a su-hide program), you should be able to pass SafetyNet now.

Comments