Is there a way to programmatically revoke other apps' permissions?
I tried shell but no luck
B4X:
Dim P As Phone
Dim sbOut, sbErr As StringBuilder
sbOut.Initialize
sbErr.Initialize
p.Shell("pm revoke com.google.android.apps.authenticator2 android.permission.CAMERA", Null, sbOut, sbErr)
Log("sbOut: " & sbOut.ToString &CRLF& "sbErr: " &CRLF& sbErr.ToString)
sbErr output is:
Operation not allowed: java.lang.SecurityException: revokeRuntimePermission: Neither user 10351 nor current process has android.permission.REVOKE_RUNTIME_PERMISSIONS.
I have AddPermission(android.permission.REVOKE_RUNTIME_PERMISSIONS) in the manifest.
Background I'm trying to create an app that can grant and revoke permissions of other apps. To do this I'm using adb commands: pm grant packageName permissionName This works great if I call it