Switch to microG, partially or fully
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
andandroid-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:
- Launch Settings
- Navigate to About phone -> Build number and tap it 7 times to enable developer mode
- Go back, and enter System -> Developer options
- 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 | adb shell mkdir -p /product/priv-app |
And we would also install those as a user app
1 | for apk in GsfProxy.apk com.google.android.gms.apk PhoneskyMG.apk; do |
Then, disconnect your device, turn off Rooted debugging and reconnect.
We aren’t done yet, execute the following to get sufficient permission:
1 | 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 |
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.