If for one reason or another you need to enable the SMS permissions using the Settings app or like this:
adb shell pm grant com.google.android.gms android.permission.RECEIVE_SMS
adb shell pm grant com.google.android.gms android.permission.READ_SMS
adb shell pm grant com.google.android.gms android.permission.SEND_SMSAnd it doesn't apply or in the syslog you get an error like:
E/PermissionManager( 1325): Cannot grant hard restricted non-exempt permission android.permission.RECEIVE_SMS for package com.google.android.gms
Then the following might help:
pm path com.google.android.gms
pm install -g -r /data/app/.../base.apk
The -g is optional. You should also be able to set the permissions using the Settings app later.
Now reboot. Optionally uninstall the app updates from the Settings app and update using the Google Play Store.
microg/GmsCore#1100 (comment)
https://gitlab.com/Nanolx/NanoDroid/-/issues/165
https://gitlab.com/LineageOS/issues/android/-/issues/4922
Thanks for this gist! I was having issues with google pay payments working but the app not wanting to open after showing the account picker after a dirty gapps flash issue after a rom upgrade.
In hopes of making this gist show up more to people looking at same issue, I had the following in my adb logcat:
Granting SMS permissions via settings app didn't work, adb grants went through but didn't change state in settings or fix the issue. So I tried reinstalling the base apk, which in turn failed due to it wanting the rest of the splits.
So I instead ran
pm install -g -p com.google.android.gms -r '/data/app/.../base.apk', with the-p com.google.android.gmsadded and that did immediately have visible effects on my phone (I had the error message of gpay open, it disappeared). It however never seemed to finish installing. I Ctrl-c'd it and restarted my phone after 5 minutes or so, hoping that was enough time, and now I got all the functionality that I was missing back. Perhaps this info is useful to others.