Skip to content

Instantly share code, notes, and snippets.

@Trigus42
Last active July 14, 2025 15:15
Show Gist options
  • Select an option

  • Save Trigus42/e33fe89c6fd19aff095dd0f1a3277ce0 to your computer and use it in GitHub Desktop.

Select an option

Save Trigus42/e33fe89c6fd19aff095dd0f1a3277ce0 to your computer and use it in GitHub Desktop.
Fix Play Services SMS Permission

Issue

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_SMS

And 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:

Get the base apk path

pm path com.google.android.gms

Reinstall the base apk and grant all permissions (-g)

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.

Last steps

Now reboot. Optionally uninstall the app updates from the Settings app and update using the Google Play Store.

Related:

microg/GmsCore#1100 (comment)
https://gitlab.com/Nanolx/NanoDroid/-/issues/165
https://gitlab.com/LineageOS/issues/android/-/issues/4922

@aveao
Copy link

aveao commented Nov 8, 2024

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:

API 79 requires missing permission groups: [android.permission-group.PHONE, android.permission-group.SMS]
TapAndPay.TAP_AND_PAY_API is not available on this device.

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.gms added 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment