Is it possible to remove or revoke permission from an application in Android Marshmallow? Note that it should be done on runtime, so using ADB shell scripts or converting app to it's byte DEX code is out of question, as architectural changes is not an option for the required solution.
Only if your application is a system app, signed with the platform key then the answer is yes.
You can revoke and apps permission with:
getPackageManager().revokeRuntimePermission("com.example.application", permissionName, Process.myUserHandle());
Refer the source here: PackageManager.revokeRuntimePermissions
It may not be accessible when you are building your app with Android SDK rather than AOSP source, use of reflection might help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With