Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add note about flashing after /data has been set up #43

Closed
git-bruh opened this issue Sep 9, 2022 · 3 comments
Closed

Add note about flashing after /data has been set up #43

git-bruh opened this issue Sep 9, 2022 · 3 comments

Comments

@git-bruh
Copy link

git-bruh commented Sep 9, 2022

Hi, I spent a few hours troubleshooting this error today:

E/PackageManager: Cannot grant hard restricted non-exempt permission android.permission.ACCESS_BACKGROUND_LOCATION for package com.google.android.gms

It occurs when you try to run adb shell pm grant com.google.android.gms android.permission.ACCESS_BACKGROUND_LOCATION. I was trying this because location permission was not being granted to microg and even after adding this permission to the xml files in the minmicrog zip, it didn't work.

Turns out that if you install microg after setting up your rom, you have to run pm install -r /path.to/GmsCore.apk/ to make it both a system and user application -- microg/GmsCore#1100 (comment)

Would be nice to have this mentioned somewhere in the README

I was doing this on lineage 19.1 official (non-microg) as I only need unifiednlp functionality and not the rest of gmscore so signature spoofing isn't necessary

@git-bruh
Copy link
Author

oh the npem script is actually supposed to do this -- i always used to get the same error (pm fails, broken pipe) at the start of running npem so it probably fails due to that, will debug

@FriendlyNeighborhoodShane
Copy link
Owner

The readme does recommend you not to do a dirty flash:

Notes

Dirty flashing not recommended. you'll mess up all your permissions and may
even cause conflicts in app data, leading to crashes.

INSTALL.md also has a troubleshooting section for this exact problem that teels you to try npem and those other workarounds if permissions cannot be granted: https://github.com/FriendlyNeighborhoodShane/MinMicroG/blob/master/INSTALL.md#permission-troubles-with-microg-and-gang

npem is also run automatically on boot on magisk installations. Not on system installs, but only because there is no reliable way to run init scripts without magisk these days.

oh the npem script is actually supposed to do this -- i always used to get the same error (pm fails, broken pipe) at the start of running npem so it probably fails due to that, will debug

But yeah, if running the script didn't fix it then something else is going on. The broken pipe error is a red herring because android embeds a broken toybox, the shell complains about weird exit codes from grep etc. in pipes. If pm throws an error, that's an issue. You could try running the install and grant commands manually and see what happens.

@git-bruh
Copy link
Author

Hmm that issue only happened with gmscore for some reason, hasn't happened with my custom unifiednlp build https://github.com/git-bruh/unifiednlp-standalone

Will investigate if I ever have to flash gmscore again

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants