Whether it’s the extra battery life, selectable third-party NLP (network location provider) or the privacy stuff, switching to microG instead of using Google apps might be beneficial.

Prerequisits

  • Rooted phone, with NO pre-installed Google services
  • Linux computer with android-tools and android-udev installed

Downloading sources

Visit microG Releases for the latest versions, grab something like com.android.vending-84022618.apk and com.google.android.gms-250932018.apk. Strip the version suffix to com.android.vending.apk and com.google.android.gms.apk.

You may also want GsfProxy.apk for legacy purposes.

Warning: please do not download packages with a -hw suffix.

After which, rename the file starting as com.android.vending to PhoneskyMG.apk

If you want the real Play Store instead of Aurora Store + FakeStore (for asset delivery and missing features etc.), go to apkmirror. Grab the latest version which is APK rather than a BUNDLE and replace the aforementioned PhoneskyMG.apk.

Connecting

On your Android phone, do the following:

  1. Launch Settings
  2. Navigate to About phone -> Build number and tap it 7 times to enable developer mode
  3. Go back, and enter System -> Developer options
  4. Enable USB debugging and Rooted debugging

Now connect your phone to the computer via USB cable, and allow USb debugging.

Installing

First, launch a terminal window and type:

1
adb devices -l

Make sure there’s only your phone attached. Then obtain root privileges via:

1
adb root

If nothing errors out, exit out the current terminal session and start a new one. Next we want to make the /product partition writable:

1
adb shell mount /product -o rw,remount

This would allow us pushing packages to it. cd to your downloads or select Open in console in the file manager:

1
2
3
4
adb shell mkdir -p /product/priv-app
adb push GsfProxy.apk /product/priv-app
adb push com.google.android.gms.apk /product/priv-app
adb push PhoneskyMG.apk /product/priv-app

And we would also install those as a user app

1
2
3
4
5
for apk in GsfProxy.apk com.google.android.gms.apk PhoneskyMG.apk; do
adb install \
--bypass-low-target-sdk-block \
"${apk}"
done

Then, disconnect your device, turn off Rooted debugging and reconnect.

We aren’t done yet, execute the following to get sufficient permission:

1
2
3
4
5
6
7
8
9
10
for perm in CAMERA BODY_SENSORS WAKE_LOCK READ_HEART_RATE TAKE_AUDIO_FOCUS CONTROL_AUDIO CONTROL_AUDIO_PARTIAL COARSE_LOCATION FINE_LOCATION GPS VIBRATE WIFI_SCAN SYSTEM_ALERT_WINDOW READ_CLIPBOARD MONITOR_LOCATION MONITOR_HIGH_POWER_LOCATION RUN_ANY_IN_BACKGROUND RUN_IN_BACKGROUND READ_MEDIA_AUDIO READ_MEDIA_VIDEO READ_MEDIA_IMAGES QUERY_ALL_PACKAGES INTERACT_ACROSS_PROFILES MANAGE_CREDENTIALS BLUETOOTH_CONNECT BLUETOOTH_ADVERTISE BLUETOOTH_SCAN ACCESS_RESTRICTED_SETTINGS SYSTEM_EXEMPT_FROM_SUSPENSION SYSTEM_EXEMPT_FROM_HIBERNATION SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION READ_CONTACTS POST_NOTIFICATION RECEIVE_SMS READ_PHONE_STATE READ_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE; do
adb shell cmd appops set com.google.android.gms "${perm}" allow
done

for perm in WRITE_SETTINGS POST_NOTIFICATION; do
adb shell cmd appops set com.android.vending "${perm}" allow
done
for perm in WAKE_LOCK READ_CLIPBOARD RUN_IN_BACKGROUND; do
adb shell cmd appops set com.android.vending "${perm}" ignore
done

You can reboot now, or Android will not recognise them as system apps:

1
adb reboot

Post installation

After a full reboot, launch microG Settings and go through the self-check to grant permissions. A Google account can then be added in Google Accounts tab. After which, follow the steps:

  • In Google Accounts, enable everything except Strip device name for authentication.
  • In Google device registration, register your device
  • Turn on Receive push notifications in Cloud Messaging
  • Tap Location, and turn on both Request from online service options. Select BeaconDB if asked. Turn on Use Nominatim.

You are set. Note that some minor features like Google sign-in might or might not work.