blog/source/_posts/microg-google-play-replacem...

8.4 KiB

title excerpt date updated tags
microG, a replacement for the proprietary Google Play Services The core of the Android OS is open source, but much of the core apps, libraries and APIs are proprietary. 2019-01-12 2021-09-18
android

microG is an open source re-implementation of Google Play Service/Services Framework. While the core of the Android OS is still open source, much of the core apps, libraries and APIs are proprietary. Refer to this article for more info.

Adding to this issue is having all the APIs packaged into a single monolithic Play Services APK. So, all the APIs are loaded at all time, even though some APIs like Cast is not going to be used 24/7. This leads to memory bloat. Despite effort to split it into separate APKs, subsequent updates are seldom smaller. The current version (as of writing) is 40+ MB, while microG's implementation is merely 2.6 MB.

Despite the minimal size of microG, it's actually usable if you can shift away from the Google Apps (which is the goal of microG anyway). Most of us have grown to rely on services offered by Google and moving away from them is not easy. The good news is, there are plenty of great alternatives out there.

microG requires Signature Spoofing to function on behalf of Google Play Services APK (com.google.android.gms). The best way to get signature spoofing is to use ROMs (list) that have built-in support, though you could also manually patch a ROM.

Once you have signature spoofing enabled, there are 2 options of installing microG:

  1. Flash OTA zip (instruction).
  2. Magisk module.

Personally I use microG-bundled LineageOS as I'm already using LineageOS. It basically mirrors all the upstream ROMs, so you can get similar updates as upstream's. There's also a GSI ROM with built-in microG.

(Edit: 18 Sep 2021) I'm currently using LineageOS GSI in my new phone, which is not yet officially supported by LineageOS. I use a Magisk module (installable via Magisk repo) to install microG, which works better for me than flashing an OTA zip. Even with vndklite (which makes system partition writeable), OTA zip installation may fails sometimes because I can't reliably switch the A/B partition (TWRP is not supported in my phone). microG's data will be wiped (due to missing app) if an installation fails; when that happens, I'll need to re-apply this workaround to get cloud messaging to work every time I update the ROM. With a Magisk module, both microG's app and data are stored in the user partition instead of system partition.

microG is not an 100% replacement of the Google Play Services, possibly will never be—it hasn't implement all the APIs. Following are the problematic apps and their alternatives. (Edit: I wrote a {% post_link recommended-android-apps 'list of alternative apps' %} which includes the apps below plus some others which are not necessarily incompatible with microG.)

App: Play Store Issue: No app or in-app purchase (NanoDroid claimed to support). Alternative: F-Droid/Aurora Droid + Aurora Store Info: F-Droid is an app store for open source apps. Many of the apps I'm going to recommend can be installed through it. With privileged extension (usually installed alongside with microG), it can auto update installed apps. I use Aurora Droid, an alternative app to access F-Droid repository. I find it easier to use and pairs well with Aurora Store. For proprietary apps, use Aurora Store. You can use built-in credential to install free apps or use your credential to install purchased apps. Purchase apps through Play Store's website. I recommend installing Aurora Services to enable auto-installation of downloaded apps in Aurora Droid/Store, essentially making them a privileged app.


App: Google Maps Issue: No location, possibly due to absence of incomplete/outdated Maps API. Edit: Google Maps v10.6.2 works again on microG v0.2.6.13280 Alternative: Organic Maps, OsmAnd, HERE WeGo Info: HERE WeGo supports public transit and offline maps. Despite being funded by the Germany big 3 autos, the app looks dated and not as smooth as Google and iOS Maps. Organic Maps and OsmAnd are open source and utilise OpenStreetMap. They do not have public transport info though. Use Transportr for that. Organic Maps is a fork of MAPS.ME without the proprietary bits and it's available on F-Droid.


App: Google Calendar Issue: Crash on boot. Depends on the proprietary GoogleCalendarSyncAdapter.apk. Possibly due to incomplete Account Authentication API. Alternative: Simple Calendar + DAVx⁵ Info: It's still problematic even with GoogleCalendarSyncAdapter.apk installed. Google Account is not well-supported in microG. While you can use DAVx⁵ to sync calendar events in Google Account, it's a hit-or-miss and reminders are not supported. This is due to the lack of OAuth 2.0 support in DAVx⁵. Alternatively, you can migrate your data to free email providers that supports CalDAV/CardDav, i.e. Disroot (using Nextcloud), GMX and Yandex.


App. Google Contacts Issue: Depends on the proprietary GoogleContactsSyncAdapter.apk Alternative: Simple Contacts + DAVx⁵ Info: Email providers mentioned in Google Calendar section can sync contacts using CardDAV.


App. Google Pay Issue: Failed SafetyNet Alternative: Catima, Loyalty Card Keychain Info: SafetyNet can be bypassed through 1) DroidGuard Helper (available from microG's F-Droid repo, install as a system app) or 2) Magisk Module.


App. Whatsapp, Facebook Messenger and other chatting apps Issue: A delay in receiving message Info: Enable "Google Cloud Messaging" in microG Settings and allow relevant apps to register.