The right place to ask about play store for microG is in nanodroid thread. But be aware: that play store is a real Google app, which you tried to avoid.Hello,
I have OnePlus 7 Pro with crDroid 6 (Android 10) and I try to upgrade (Clear Fresh install) crDroid 7.2.( Android 11).
I've got some issue:
MicroG Magisk module works fine on Android 10 along with Play Market (from Fdroid Nanolx rep.) but behaves strangely on Android 11, i.e. MicroG works normally only if a "dummy' (Fake Store) is installed instead of PlayMarket
As soon as I get a real PlayMarket (from Fdroid Nanolx rep.), the device falls into bootloop after reboot.
Tried to workaround by using NanoDroid-MicroG TWRP installer instead of MicroG Magisk module but failed.
01-19 00:38:19.511 I/Google Maps Android API(4165): Google Play services client version: 11951000
01-19 00:38:19.512 I/Google Maps Android API(4165): Google Play services package version: 204714034
01-19 00:38:19.552 W/ActivityManager(1395): Unable to start service Intent { cmp=com.google.android.gms/.maps.auth.ApiTokenService } U=0: not found
01-19 00:38:19.639 I/ActivityTaskManager(1395): START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity (has extras)} from uid 10229
01-19 00:38:20.975 W/DynamiteModule(23560): Failed to load module via V2: java.lang.NoSuchFieldException: No field sClassLoader in class Lcom/google/android/m4b/maps/t/a$b; (declaration of 'com.google.android.m4b.maps.t.a$b' appears in base.apk)
Since Android 6, a location provider has to be a priviledged app and thus, its apk has be be pushed to /system/priv-app.Any known condition comes in mind to you which could cause either the network location or the maps problem?
Privileged permission android.permission.INSTALL_LOCATION_PROVIDER for package com.google.android.gms (/system/priv-app/com.google.android.gms) not in privapp-permissions whitelist
<permissions>
<privapp-permissions package="com.google.android.gms">
<permission name="android.permission.READ_PHONE_STATE"/>
<permission name="android.permission.READ_CONTACTS"/>
<permission name="android.permission.WRITE_CONTACTS"/>
<permission name="android.permission.GET_ACCOUNTS"/>
<permission name="android.permission.ACCESS_FINE_LOCATION"/>
<permission name="android.permission.ACCESS_COARSE_LOCATION"/>
<permission name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<permission name="org.microg.permission.FORCE_COARSE_LOCATION"/>
<permission name="android.permission.INSTALL_LOCATION_PROVIDER"/>
<permission name="android.permission.RECEIVE_SMS"/>
<permission name="android.permission.READ_EXTERNAL_STORAGE"/>
<permission name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>
<permission name="android.permission.UPDATE_APP_OPS_STATS"/>
</privapp-permissions>
</permissions>
mv /data/data/org.fdroid.fdroid/cache/apks/f-droid.org--1/com.google.android.gms<new_version>.apk /system/priv-app/microg/
chmod 644 /system/priv-app/microg/com.google.android.gms<new_version>.apk
rm /system/priv-app/microg/com.google.android.gms<old_version>.apk
restart
This post is great and I honestly think it should be included in the first post or somewhere visible.Since Android 6, a location provider has to be a priviledged app and thus, its apk has be be pushed to /system/priv-app.
For any priveledged app on the other hand, any permission it requests has to be well defined in a xml file within /etc/permissions. Otherwise, the OS will stay in a boot loop and continuously recheck the permissions.
The thing is, we get the new microg-releases via f-droid, but f-droid will install it als non-priviledged app. That's why you'll see location updates on the location modules page of gms-core, but no other app can receive it. E.g. Osmand will output "no network location provider found" in the system log.
You'll notice the difference when granting gms-core its permissions on the self-check page: If Android asks you to grant the selected permission after you clicked it, it means gms-core is running as non-priviledged.
If it is priviledged, you'll just have to check the checkboxes without getting asked by the OS.
To get gms-core running as a priviledged app,
- connect via adb root and remount
- make a directory /system/privapp/microg (naming is unrevelant)
- push a gms-core release to that folder, e.g. com.google.android.gms-204714034.apk
- set the correct file permissions: chmod 644 <file.apk> (this is important, since files with 777 or 600 are ignored)
For the sake of better understanding, reboot. You will be stuck in a boot loop because of missing permissions. This is intended. Find that permissions by
- connecting via adb root and remounting
- executing adb logcat | grep android.permission
- leave that terminal open
Now, if you use a terminal emulator on you PC that supports backscrolling, watch out for the "permission not in whitelist" messages. You'll get the exact names of missing permissions, e.g.
Now, create a xml file granting gms-core the permissions in question byCode:Privileged permission android.permission.INSTALL_LOCATION_PROVIDER for package com.google.android.gms (/system/priv-app/com.google.android.gms) not in privapp-permissions whitelist
- opening another terminal
- touch /etc/permissions/privapp-permissions-microg.xml (filename doesn't matter)
- edit that file via vim or nano and paste the following:
Last but not leastCode:<permissions> <privapp-permissions package="com.google.android.gms"> <permission name="android.permission.READ_PHONE_STATE"/> <permission name="android.permission.READ_CONTACTS"/> <permission name="android.permission.WRITE_CONTACTS"/> <permission name="android.permission.GET_ACCOUNTS"/> <permission name="android.permission.ACCESS_FINE_LOCATION"/> <permission name="android.permission.ACCESS_COARSE_LOCATION"/> <permission name="android.permission.ACCESS_BACKGROUND_LOCATION"/> <permission name="org.microg.permission.FORCE_COARSE_LOCATION"/> <permission name="android.permission.INSTALL_LOCATION_PROVIDER"/> <permission name="android.permission.RECEIVE_SMS"/> <permission name="android.permission.READ_EXTERNAL_STORAGE"/> <permission name="android.permission.WRITE_EXTERNAL_STORAGE"/> <permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/> <permission name="android.permission.UPDATE_APP_OPS_STATS"/> </privapp-permissions> </permissions>
- set the correct file permissions: chmod 644 <file.xml>
No reboot required: Android will immediately continue starting.
These permissions are taken from Nanodroid because that was easier that grepping through the logs: https://github.com/Nanolx/NanoDroid...tc/default-permissions/microg-permissions.xml
Now, if there is any permission issue in the future, fire up the above logcat command, find the missing permission and add it to the xml file.
Addendum
For me that workes using LineageOS 17.1 and 18.1 (thank you @derf elot and @modpunk ) with the latest gms-core releases. I prefer Local GSM Location by deveee as a network location provider. Find it on f-droid.
The only downside is you can't update gms-core via f-droid. But you can enable the "include incompatible versions" option in the f-droid client to receive update notifications. If you then let the f-droid client download the update (and do checksum and pgp verifications), you can install it manually via root terminal:
The upside is you wont't have to waint until a new Nanodroid bundle or Magisk module is released. You can update gms-core by yourself anytime.Code:mv /data/data/org.fdroid.fdroid/cache/apks/f-droid.org--1/com.google.android.gms<new_version>.apk /system/priv-app/microg/ chmod 644 /system/priv-app/microg/com.google.android.gms<new_version>.apk rm /system/priv-app/microg/com.google.android.gms<old_version>.apk restart
LineageOS 14 has a feature to select location mode in settings. If you select " device only" the network location services are disable and you only get satellite location (GPS etc.)Hello folks,
in order to check a problem with microG crashes, I downgraded from microG 0.17 to 0.15 on a lineageOS 14 device: deinstalled the 0.17, installed 0.15. Since then, I can no longer make my location services work. I reinstalled several times 0.15 and 0.17, reinstalled my location providers, tried another, previously unused location provider (Apple); deinstalled microG core and all location providers, then reinstalled all - nothing worked. When using "Here GPS location" (network > read) it says "network not enabled".
Guess I messed up permissions - what should I do?
Cheers,
Wolf
Thank you for your hint. I'm familiar with that feature and set the control to "energy saving - use network only".LineageOS 14 has a feature to select location mode in settings. If you select " device only" the network location services are disable and you only get satellite location (GPS etc.)
Great post and I wish I could execute. Unfortunately I don't have the necessary knowledge of ADB commands to be able to work out exactly what to put and would probably end up in a big mess! Especially the "whitelist part"Since Android 6, a location provider has to be a priviledged app and thus, its apk has be be pushed to /system/priv-app.
For any priveledged app on the other hand, any permission it requests has to be well defined in a xml file within /etc/permissions. Otherwise, the OS will stay in a boot loop and continuously recheck the permissions.
The thing is, we get the new microg-releases via f-droid, but f-droid will install it als non-priviledged app. That's why you'll see location updates on the location modules page of gms-core, but no other app can receive it. E.g. Osmand will output "no network location provider found" in the system log.
You'll notice the difference when granting gms-core its permissions on the self-check page: If Android asks you to grant the selected permission after you clicked it, it means gms-core is running as non-priviledged.
If it is priviledged, you'll just have to check the checkboxes without getting asked by the OS.
To get gms-core running as a priviledged app,
- connect via adb root and remount
- make a directory /system/privapp/microg (naming is unrevelant)
- push a gms-core release to that folder, e.g. com.google.android.gms-204714034.apk
- set the correct file permissions: chmod 644 <file.apk> (this is important, since files with 777 or 600 are ignored)
For the sake of better understanding, reboot. You will be stuck in a boot loop because of missing permissions. This is intended. Find that permissions by
- connecting via adb root and remounting
- executing adb logcat | grep android.permission
- leave that terminal open
Now, if you use a terminal emulator on you PC that supports backscrolling, watch out for the "permission not in whitelist" messages. You'll get the exact names of missing permissions, e.g.
Now, create a xml file granting gms-core the permissions in question byCode:Privileged permission android.permission.INSTALL_LOCATION_PROVIDER for package com.google.android.gms (/system/priv-app/com.google.android.gms) not in privapp-permissions whitelist
- opening another terminal
- touch /etc/permissions/privapp-permissions-microg.xml (filename doesn't matter)
- edit that file via vim or nano and paste the following:
Last but not leastCode:<permissions> <privapp-permissions package="com.google.android.gms"> <permission name="android.permission.READ_PHONE_STATE"/> <permission name="android.permission.READ_CONTACTS"/> <permission name="android.permission.WRITE_CONTACTS"/> <permission name="android.permission.GET_ACCOUNTS"/> <permission name="android.permission.ACCESS_FINE_LOCATION"/> <permission name="android.permission.ACCESS_COARSE_LOCATION"/> <permission name="android.permission.ACCESS_BACKGROUND_LOCATION"/> <permission name="org.microg.permission.FORCE_COARSE_LOCATION"/> <permission name="android.permission.INSTALL_LOCATION_PROVIDER"/> <permission name="android.permission.RECEIVE_SMS"/> <permission name="android.permission.READ_EXTERNAL_STORAGE"/> <permission name="android.permission.WRITE_EXTERNAL_STORAGE"/> <permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/> <permission name="android.permission.UPDATE_APP_OPS_STATS"/> </privapp-permissions> </permissions>
- set the correct file permissions: chmod 644 <file.xml>
No reboot required: Android will immediately continue starting.
These permissions are taken from Nanodroid because that was easier that grepping through the logs: https://github.com/Nanolx/NanoDroid...tc/default-permissions/microg-permissions.xml
Now, if there is any permission issue in the future, fire up the above logcat command, find the missing permission and add it to the xml file.
Addendum
For me that workes using LineageOS 17.1 and 18.1 (thank you @derf elot and @modpunk ) with the latest gms-core releases. I prefer Local GSM Location by deveee as a network location provider. Find it on f-droid.
The only downside is you can't update gms-core via f-droid. But you can enable the "include incompatible versions" option in the f-droid client to receive update notifications. If you then let the f-droid client download the update (and do checksum and pgp verifications), you can install it manually via root terminal:
The upside is you wont't have to waint until a new Nanodroid bundle or Magisk module is released. You can update gms-core by yourself anytime.Code:mv /data/data/org.fdroid.fdroid/cache/apks/f-droid.org--1/com.google.android.gms<new_version>.apk /system/priv-app/microg/ chmod 644 /system/priv-app/microg/com.google.android.gms<new_version>.apk rm /system/priv-app/microg/com.google.android.gms<old_version>.apk restart
Check the Magisk module "App Systemizer". Easy to use without ADB knowledge.Great post and I wish I could execute. Unfortunately I don't have the necessary knowledge of ADB commands to be able to work out exactly what to put and would probably end up in a big mess! Especially the "whitelist part"
I have downloaded and installed microG apk on AOSP Extended Android 10 ROM without issue but want to use the location back ends - and apparently cannot unless in privapp folder.
I have magisk (not used to install microG) and TWRP installed. I am not using F droid installer. If I use the Systemiser Terminal app via magisk do you know if it will achieve the same end? I am a bit concerned about the 644 permissions.
Are there any other options I should consider?
Thanks that was the one I was referring to. Still concerned about the permissions however. I would prefer to use ADB and found many articles online I could follow but not sure how efficacious they are with Android 10 and the whitelist/permissions aspect.Check the Magisk module "App Systemizer". Easy to use without ADB knowledge.
Personally, I'm pretty much concerned about privacy and security as my own threads probably show. However, every apk that I've in priv-app has the permission "644" and its respective folder, in which the apk is located, has the permission "755".Thanks that was the one I was referring to. Still concerned about the permissions however. I would prefer to use ADB and found many articles online I could follow but not sure how efficacious they are with Android 10 and the whitelist/permissions aspect.
I guess I should just try and see........![]()
Sorry I wasn't very clear. I do not have any concerns about granting the respective permissions but in the mechanics of doing so as per the post I replied to originally. That is the creating and editing of an xml file etc.However, every apk that I've in priv-app has the permission "644" and its respective folder, in which the apk is located, has the permission "755".
Nah, safety net not working currently. Doesn't look like a difficult fix though. I feel like there have been a few devs who have privately fixed it without publishing (so google isn't encouraged to roll out hardware attestation)will paying via google pay work with this?