microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.44k stars 1.71k forks source link

Documentation: Additional patch needed at installation? #1384

Open sicherist opened 3 years ago

sicherist commented 3 years ago

In the installation instructions on the MicroG wiki it says: Note: On Android 7 (or later) an additional patch is needed to make location work, or alternatively: You can install GmsCore.apk in the /system/priv-app folder. This can be done by using adb push.

Is this still the case? I'm running Android 7 and installed GmsCore from the Fdroid-store and now have a directory "/system/priv-app/GmsCore" that is apparently empty except for a "lib/arm64" subfolder that is empty, too.

Now there is no "GmsCore.apk" in the repo, i can only find "com.google.android.gms-204714034.apk". Is this the file that should be copied into "/system/priv-app/GmsCore"? Or should I move the "base.apk" from "data/com.google.android.gms" to "/system/priv-app/GmsCore"?

ghost commented 3 years ago

7 or later needs this patch, unless you use a custom rom that includes it by default. You'd need to ask the maintainers of your rom about it.

For GmsCore.apk, rename the download from this repo, or the one you got from F-Droid. They are identical. I would recommend an addon.d file too, so it can be preserved between each rom upgrade, without having to manually push the apk into priv-app every time. Example:

#!/sbin/sh
#
# ADDOND_VERSION=2
#
# /system/addon.d/51-microg.sh
# During a system upgrade, this script backs up microG GmsCore,
# /system is formatted and reinstalled, then the files are restored.
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
priv-app/GmsCore/GmsCore.apk
EOF
}

case "$1" in
  backup)
    list_files | while read FILE DUMMY; do
      backup_file $S/"$FILE"
    done
  ;;
  restore)
    list_files | while read FILE REPLACEMENT; do
      R=""
      [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
      [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
    done
  ;;
  pre-backup)
    # Stub
  ;;
  post-backup)
    # Stub
  ;;
  pre-restore)
    # Stub
  ;;
  post-restore)
    # Stub
  ;;
esac

Save as 51-microg.sh, push to /system/addon.d

(This assumes GmsCore.apk in /system/priv-app/GmsCore, if you just put it loose in /system/priv-app then you want to adjust the directory accordingly.)