Forcing permission READ_PRIVILEGED_PHONE_STATE on Android 10 (Q) on emulator and/or rooted device-ThrowExceptions

Exception or error:

I’m trying to run some tests on custom SIM cards, and want to be able to change the configuration of cards inserted into Android 10 phones. I understand this permission is not accessible by 3rd party software.

I have tried using the grant command to force this permission, but I receive the below error. Is there any work-around to grant this permission (using firmware such as XPosed)?

1|generic_x86:/ $ pm grant pl.itger.dualsimcard android.permission.READ_PRIVILEGED_PHONE_STATE                                                                                                                                                                                                                                                                      
Security exception: Permission android.permission.READ_PRIVILEGED_PHONE_STATE requested by pl.itger.dualsimcard is not a changeable permission type

java.lang.SecurityException: Permission android.permission.READ_PRIVILEGED_PHONE_STATE requested by pl.itger.dualsimcard is not a changeable permission type
        at com.android.server.pm.permission.BasePermission.enforceDeclaredUsedAndRuntimeOrDevelopment(BasePermission.java:429)
        at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:2096)
        at com.android.server.pm.permission.PermissionManagerService.access$900(PermissionManagerService.java:120)
        at com.android.server.pm.permission.PermissionManagerService$PermissionManagerServiceInternalImpl.grantRuntimePermission(PermissionManagerService.java:2999)
        at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:5734)
        at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1955)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:230)
        at android.os.ShellCommand.exec(ShellCommand.java:104)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21729)
        at android.os.Binder.shellCommand(Binder.java:881)
        at android.os.Binder.onTransact(Binder.java:765)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4860)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4014)
        at android.os.Binder.execTransactInternal(Binder.java:1021)
        at android.os.Binder.execTransact(Binder.java:994)
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *