Skip to content

Commit

Permalink
microG Installer Revived 4.0.0-0
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Sep 6, 2024
1 parent 8339a6f commit b54f5b3
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 48 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Update microG suite to 0.3.2
rework install process (see README for details)
but upgrading should not require manual intervention
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,34 @@

This is a Magisk module - originally based on Hieu Van's microG Installer - that installs microG GmsCore, GsfProxy and Companion (or Play Store if you want so) to `/system/priv-app`.

There are two copies of this online: The [Magisk alt module repo](https://github.com/Magisk-Modules-Alt-Repo/microG_Installer) and the [personal](https://github.com/nift4/microg_installer) one. The personal one contains the latest development version and is used for pull requests and issues and the Magisk alt repo one is the stable code only.

## Why you may want to use it

In short: this is the cleanest option to install microG and just be done with it.

UnifiedNlp, which is bundled with GmsCore, if installed as an user app doesn't work on Android 7 and newer without [an additional patch](https://github.com/microg/android_packages_apps_UnifiedNlp/blob/master/patches/android_frameworks_base-N.patch). An another solution to the above problem is to install the app as a privileged system app. However, this way is not perfect, due to those kind of apps being wiped after an OTA update. Therefore, I'm creating this module to help simplify the installation of microG with working network-based location. Aditionally, this module forces UnifiedNlp support even when no NLP provider is configured in your ROM.

Currently, GmsCore 0.3.2 (including Companion, previously known as FakeStore), GsfProxy 0.1.0 and MapsV1 0.1.0 are bundled in the module.
Currently, GmsCore 0.3.2 (including Companion, previously known as FakeStore) and earlier are supported. GsfProxy 0.1.0 and MapsV1 0.1.0 are bundled in the module.

**Note**: Install this module before installing any GMS-dependent apps, as well as do not disable it after installing such apps, unless you know what you're doing.

There are two copies of this online: The [Magisk alt module repo](https://github.com/Magisk-Modules-Alt-Repo/microG_Installer) and the [personal](https://github.com/nift4/microg_installer) one. The personal one contains the latest development version and is used for pull requests and issues and the Magisk alt repo one is the stable code only.

## Installation
**Again, if you have Google services currently installed, DO NOT INSTALL THIS MODULE.**
- Choose an solution for [Signature spoofing](https://github.com/microg/android_packages_apps_GmsCore/wiki/Signature-Spoofing) (Note: If your ROM does not support signature spoofing, I recommened [whew-inc's FakeGApps fork](https://github.com/whew-inc/FakeGApps/releases))
- Install the module
- Install microG 0.3.2 and Companion (or real Play Store) as normal user app
- Install the module to convert them to system apps with all bells and whistles (like Maps V1, GsfProxy, etc)

## How do I get the real Play Store?

First, if you experience an bootloop, use [Magisk Safe Mode](https://topjohnwu.github.io/Magisk/faq.html#q-i-installed-a-module-and-it-bootlooped-my-device-help) to disable the module and use an older Play Store APK, then post a bug report. This module needs to be updated for new Play Store versions every while. If it boots, but Play Store is broken, it's probably a microG issue. Feel free to report issues in the bugtracker here though.

Get an Play Store APK (I suggest unpatched Play Store from APKMirror) - please note that the file has to be a non-bundle APK, which means APKM files are not supported. Then put it into `/data/adb/` named `Phonesky.apk`(`/data/adb/Phonesky.apk`). You need to do that only once. If you now install, update or reflash microG Installer Revived there will be an message "Installing real Play Store". This indicates it worked. Now grant all permissions. You can now install updates for the Play Store like for every app.
Get an Play Store APK (I suggest unpatched Play Store from APKMirror) - please note that the file has to be a non-bundle APK, which means APKM files are not supported. Then, just install it before flashing the module! If you now install, update or reflash microG Installer Revived there will be an message "Installing real Play Store". This indicates it worked. Now grant all permissions. You can now install updates for the Play Store like for every app.

Note: previously, this module told you to put it into `/data/adb/Phonesky.apk`. This is no longer needed and the module will ignore that file.

## Can I update to new versions without waiting for module updates?

**Yes**, just download the new APK (in the normal variant, not -hw or -lh) from microG GitHub, download page or microG F-Droid repo (all those use the exact same APK files!) and install it as you always would. If you use Companion, update it this way too. Please note that some F-Droid clients report signature compatibility issues, which however appears to be a problem with interactions between the microG repo, clients and signature spoofing. In this case, download the APKs using a web browser and install them normally.
**Yes**, just download the new APK (in the normal variant, not -hw or -lh) from microG GitHub, download page or microG F-Droid repo (all those use the exact same APK files!) and install it as you always would **without reflashing the module**. If you use Companion, update it this way too. Please note that some F-Droid clients report signature compatibility issues, which however appears to be a problem with interactions between the microG repo, clients and signature spoofing. In this case, download the APKs using a web browser and install them normally.

## Common issues

- Magisk crashes while installation: Ignore it and manually reboot
- microG Companion / real Play Store keeps crashing: Remove it from Magisk Hide / Denylist / disable KSU Unmount modules from its app profile
- black screen / bootloop: don't use Magisk Delta's SuList
- app misbehaves/crashes with missing microg overlay (eg. chromium based browsers): disable KSU Unmount modules from its app profile
- microG itself keeps crashing: [download](https://github.com/nift4/microg_installer_revived/raw/master/system/priv-app/microG/microG.apk) & install APK as update
- can't grant background location and SMS permission: [download](https://github.com/nift4/microg_installer_revived/raw/master/system/priv-app/microG/microG.apk) & install APK as update
- can grant SMS permission but can't grant background location: go to App Info > Permissions > Location > (press "Location access" in the warning dialog), then go back to self test and try to grant background location again - it should now work

## Build
Expand Down
83 changes: 60 additions & 23 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,68 @@ if ! $BOOTMODE; then
fi
mmm_exec setSupportLink "https://github.com/nift4/microg_installer_revived/issues"

MAX_VER="240913004"
MAX_VERN="0.3.2.240913"

if [ -f /data/adb/Phonesky.apk ]; then
ui_print "- Installing real Play Store"
cp /data/adb/Phonesky.apk "$MODPATH/system/priv-app/Phonesky/Phonesky.apk"
else
ui_print "- Real Play Store not found, installing Companion"
ui_print "- INFO: Phonesky.apk is found in /data/adb, but this module no longer uses this file."
ui_print "- INFO: It won't break anything, but having that there won't make you use real Play Store anymore."
fi
# If the real Play Store is already installed, don't install it again since
# it will result in an error if real Play Store is not patched and has
# already auto-updated itself
if [ ! $(pm list packages | grep com.android.vending) ]; then
mmm_exec showLoading
pm install "$MODPATH/system/priv-app/Phonesky/Phonesky.apk"
mmm_exec hideLoading
fi
pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE 2>/dev/null

ui_print "- Installing microG GmsCore"
# If we install GmsCore update, Magisk Manager will be killed
# that's because Magisk Manager creates classloader of GmsCore in SSL provider
# so if GmsCore gets killed, Magisk Manager gets killed by framework as well
# if we just dont kill GmsCore, it's fine. we use --dont-kill for that
# however thats only intended for split APKs and google enforced that
# it stopped working after https://github.com/aosp-mirror/platform_frameworks_base/commit/93c2c2a292ea8695038afdd044bcb51e2e366780
# keep it here for legacy while i think of a better solution
# (workaround this by installing gmscore as last step)
mmm_exec showLoading
pm install --dont-kill -g "$MODPATH/system/priv-app/GmsCore/GmsCore.apk"
ui_print "Collecting information about com.google.android.gms"
# check microG
DUMP_GMS="$(pm dump-package com.google.android.gms)"
ui_print "Checking if com.google.android.gms is installed"
if (echo "$DUMP_GMS" | grep "Unable to find package: com.google.android.gms") >/dev/null; then
abort "- ERROR: You do not have official microG installed."
fi
ui_print "Collecting file path of com.google.android.gms"
GMS_PATH="$(realpath $(echo "$DUMP_GMS" | grep path: | cut -d: -f2))"
ui_print "Checking if file path of com.google.android.gms is on /data"
if [[ "$GMS_PATH" = "${GMS_PATH#/data/}" ]]; then
abort "- ERROR: expected microG install path to be on /data, but it's $GMS_PATH"
fi
ui_print "Checking if file path of com.google.android.gms exists"
if ! [[ -f "$GMS_PATH" ]]; then
abort "- ERROR: expected microG install path to exist: $GMS_PATH"
fi
ui_print "Checking if com.google.android.gms is microG"
if ! (echo "$DUMP_GMS" | grep "android.permission.FAKE_PACKAGE_SIGNATURE") >/dev/null; then
abort "- ERROR: You appear to have Google Play Services installed instead of microG."
fi
ui_print "Checking if com.google.android.gms is a supported version"
GMS_VER="$(echo "$DUMP_GMS" | grep versionCode | head -n1 | cut -d" " -f5 | cut -d= -f2)"
GMS_VERN="$(echo "$DUMP_GMS" | grep versionName | head -n1 | cut -d" " -f5 | cut -d= -f2)"
if [[ "$GMS_VER" -gt "$MAX_VER" ]]; then
abort "- ERROR: You have microG version $GMS_VERN ($GMS_VER) but the maximum supported version is $MAX_VERN ($MAX_VER)."
fi
# check Vending
ui_print "Collecting information about com.android.vending"
DUMP_VD="$(pm dump-package com.android.vending)"
ui_print "Checking if com.android.vending is installed"
if (echo "$DUMP_VD" | grep "Unable to find package: com.android.vending") >/dev/null; then
abort "- ERROR: You do not have microG Companion or Play Store installed."
fi
ui_print "Collecting file path of com.android.vending"
VD_PATH="$(realpath $(echo "$DUMP_VD" | grep path: | cut -d: -f2))"
ui_print "Checking if file path of com.android.vending is on /data"
if [[ "$VD_PATH" = "${VD_PATH#/data/}" ]]; then
abort "- ERROR: expected microG Companion / Play Store install path to be on /data, but it's $VD_PATH"
fi
ui_print "Checking if file path of com.android.vending exists"
if ! [[ -f "$VD_PATH" ]]; then
abort "- ERROR: expected microG Companion / Play Store install path to exist: $VD_PATH"
fi
# Do install tasks
ui_print "- Installing microG GmsCore"
cp "$GMS_PATH" "$MODPATH/system/priv-app/GmsCore/GmsCore.apk"
if (echo "$DUMP_VD" | grep "android.permission.FAKE_PACKAGE_SIGNATURE") >/dev/null; then
ui_print "- Installing microG Companion"
pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE 2>/dev/null
ui_print "Installing microG Companion"
else
ui_print "- Installing Play Store"
fi
cp "VD_PATH" "$MODPATH/system/priv-app/Phonesky/Phonesky.apk"
mmm_exec hideLoading
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=microg_installer
name=microG Installer Revived
version=Revived 3.4.4-0
versionCode=30440
version=Revived 4.0.0-0
versionCode=40000
author=nift4
description=Install microG GmsCore, Companion (or Play Store if you want so), GsfProxy and MapsV1 to /system/
updateJson=https://raw.github.com/nift4/microg_installer_revived/master/update.json
Expand Down
Empty file.
Binary file removed system/priv-app/Phonesky/Phonesky.apk
Binary file not shown.
Empty file added system/priv-app/microG/.gitkeep
Empty file.
Binary file removed system/priv-app/microG/microG.apk
Binary file not shown.
2 changes: 0 additions & 2 deletions uninstall.sh

This file was deleted.

8 changes: 4 additions & 4 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "Revived 3.4.4-0",
"versionCode": 30440,
"zipUrl": "https://github.com/nift4/microg_installer_revived/releases/download/v3.4.4-0/microG_Installer_Revived.zip",
"changelog": "https://github.com/nift4/microg_installer_revived/raw/v3.4.4-0/CHANGELOG"
"version": "Revived 4.0.0-0",
"versionCode": 40000,
"zipUrl": "https://github.com/nift4/microg_installer_revived/releases/download/v4.0.0-0/microG_Installer_Revived.zip",
"changelog": "https://github.com/nift4/microg_installer_revived/raw/v4.0.0-0/CHANGELOG"
}

0 comments on commit b54f5b3

Please sign in to comment.