question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Permissions not requested

See original GitHub issue

First, thank you very much for latest release! (v0.2.11.202414) Even though I collected all the checkmarks in self-check, gmscore is still missing permissions ACCESS_FINE_LOCATION and READ_EXTERNAL_STORAGE. It does not request them.

One can check for ungranted permissions with: $ dumpsys package com.google.android.gms | grep granted=false

For now I have granted the permissions manually: $ pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION $ pm grant com.google.android.gms android.permission.READ_EXTERNAL_STORAGE

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
Nanolxcommented, Jan 3, 2021

The fix is to install microG not just as a priv-app, but also as a user-app, i. e. an update.

a) go to /data/adb/modules/microG_blabla/system/priv-app/GmsCore/GmsCore.apk and tap on the APK to install it as update b) remove any runtime-permissions.xml from /data/users/*/ c) reboot d) grant all permissions again

profit.

3reactions
Nanolxcommented, Oct 17, 2020

Yes, it’s just like that. Installing NanoDroid into /system before booting the ROM the first time (just as one does with GApps; install ROM > install NanoDroid to /system > boot into ROM) solves that issue. It also properly auto-grants all permissions to GmsCore (except android.permission.FAKE_PACKAGE_SIGNATURE), which is desireable, though.

Most A/B or S-A-R devices require /data to be clean when starting the first time (observed this on OnePlus 5T and OnePlus 6), thus installing NanoDroid as Magisk Module is always “dirty flashed” (flash ROM > boot into ROM > boot into TWRP > Flash Magisk > Flash NanoDroid); “clean flash” (install ROM > install Magisk > install NanoDroid > boot into ROM) like mentioned above results in a boot loop on those devices, thus is not possible.

For one reason or another Android does deny android.permission.ACCESS_BACKGROUND_LOCATION on “dirty flashes”, even though it is properly privapp-whitelisted. Also all other should-be auto-granted permission need to be manually granted, as opposed to /system mode installation.

On older devices where you can flash ROM and Magisk in one go and sucessfully boot up, this does not happen. As mentioned before pm install -r /data/adb/modules/NanoDroid/system/priv-app/GmsCore/GmsCore.apk fixes the issue for Magisk Installations aswell.

I observed this on both Android 10 (AICP 15) and Android 11 (Syberia 4.1). Tomorrow I’ll update the Magisk Modules’s service.sh in order to silently auto-“userify” GmsCore, to workaround the issue.

Since no Magisk GApps package exists (until now I never thought about why that’s the case) and given that privapps should be available right from the very first start, I suspect that behaviour is actually on purpose, so that proposed change to service.sh is likely the ultimate best I could come up with for installing NanoDroid as Magisk Module.

Unless someone can point me into a different direction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android permissions not being requested - Stack Overflow
First thing to note here is that Android permissions are no longer asked when the app is installed, but rather when the app...
Read more >
Change app permissions on your Android phone
On your phone, open the Settings app. Tap Privacy And then Permission manager. Tap a permission type. If you allowed or denied permission...
Read more >
Request app permissions - Android Developers
Overview · Standalone apps · Authentication · Request permissions · Detect location · Playing audio on wearables · Appear in Recents and App...
Read more >
Understanding App Permissions | CodePath Android Cliffnotes
When an app requests a permission that belongs to a particular permission group (i.e. READ_CONTACTS), Android asks the user about the higher level...
Read more >
Requesting Android Permissions - HERE Developer
permissions request code */ private final static int ... makeText(this, "Required permission '" + permissions[index] + "' not granted, exiting", Toast.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found