Allow permission from adb

Anza

New member
Hi to all,
Macrodroid ask two permission is possible send directly from adb ?


the first is for accessibility and the second is for design levels

1- events --> application close (accessibility)

2- action --> application --> launch application (design levels)

??
./adb shell pm grant com.arlosoft.macrodroid.helper android.permission.WRITE_SECURE_SETTINGS

./adb shell pm grant com.arlosoft.macrodroid android.permission.READ_LOGS

./adb shell pm grant com.arlosoft.macrodroid android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER

./adb shell pm grant com.arlosoft.macrodroid android.permission.CHANGE_CONFIGURATION

./adb shell pm grant com.arlosoft.macrodroid android.permission.DUMP

Thanks
 

Dimlos

Well-known member
MacroDroid cannot send adb commands directly, please refer to the following thread in Help and Troubleshooting.
ADB Hack - Granting extra capabilities via the ADB tool
ADB hack without a PC (Android 11+)
 

Endercraft

Moderator (& bug finder :D)
I'm pretty sure that permission is not something you can grant automatically (unless UI Interaction). Maybe root can achieve this.

But the permission shouldn't go away at any time anyway unlike accessibility.
 

Anza

New member
MacroDroid cannot send adb commands directly, please refer to the following thread in Help and Troubleshooting.
ADB Hack - Granting extra capabilities via the ADB tool
ADB hack without a PC (Android 11+)
I follow the discussion and I sended the below command via adb

adb shell pm grant com.arlosoft.macrodroid android.permission.WRITE_SECURE_SETTINGS
adb shell pm grant com.arlosoft.macrodroid android.permission.CHANGE_CONFIGURATION
adb shell pm grant com.arlosoft.macrodroid android.permission.DUMP
adb shell pm grant com.arlosoft.macrodroid android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER
adb shell pm grant com.arlosoft.macrodroid android.permission.READ_LOGS
adb shell pm grant com.arlosoft.macrodroid.helper android.permission.WRITE_SECURE_SETTINGS

But nothing, Macrodroid ask me the same request .
There are other permissions that I can send via adb ?
 

Anza

New member
Try settings -> apps -> macrodroid -> permissions -> draw over other apps
I think it's named like this, and maybe under advanced

I need approve permission via adb because I have many devices to programs.
I create a little script to save time
 

Dimlos

Well-known member
@Anza
Unfortunately, security is getting stricter every year, and it is difficult to grant all permissions with the adb command.
It is recommended to ask the user for permission to overlay, and I think MacroDroid has such specification.

@Snurre
Unfortunately, it could not be granted for Android 12.
 

Snurre

Well-known member
@Anza
Unfortunately, security is getting stricter every year, and it is difficult to grant all permissions with the adb command.
It is recommended to ask the user for permission to overlay, and I think MacroDroid has such specification.

@Snurre
Unfortunately, it could not be granted for Android 12.
Do you know what version op have ?
 

Anza

New member
Maybe this will work
pm grant <package-name-here> android.permission.SYSTEM_ALERT_WINDOW
Thanks working
The SO is Android TV 12

But there is no way to send via adb:
./adb shell pm grant com.arlosoft.macrodroid android.permission.BIND_ACCESSIBILITY_SERVICE

I can only enable it from the UI, below the error



Exception occurred while executing 'grant':


java.lang.SecurityException: Permission android.permission.BIND_ACCESSIBILITY_SERVICE requested by com.arlosoft.macrodroid is not a changeable permission type


at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1508)


at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1436)


at android.permission.PermissionManager.grantRuntimePermission(PermissionManager.java:380)


at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2384)


at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:260)


at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)


at android.os.ShellCommand.exec(ShellCommand.java:38)


at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:24626)


at android.os.Binder.shellCommand(Binder.java:950)


at android.os.Binder.onTransact(Binder.java:834)


at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4818)


at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:8506)


at android.os.Binder.execTransactInternal(Binder.java:1184)


at android.os.Binder.execTransact(Binder.java:1143)
 

Endercraft

Moderator (& bug finder :D)
Thanks working
The SO is Android TV 12

But there is no way to send via adb:
./adb shell pm grant com.arlosoft.macrodroid android.permission.BIND_ACCESSIBILITY_SERVICE

I can only enable it from the UI, below the error



Exception occurred while executing 'grant':


java.lang.SecurityException: Permission android.permission.BIND_ACCESSIBILITY_SERVICE requested by com.arlosoft.macrodroid is not a changeable permission type


at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1508)


at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1436)


at android.permission.PermissionManager.grantRuntimePermission(PermissionManager.java:380)


at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2384)


at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:260)


at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)


at android.os.ShellCommand.exec(ShellCommand.java:38)


at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:24626)


at android.os.Binder.shellCommand(Binder.java:950)


at android.os.Binder.onTransact(Binder.java:834)


at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4818)


at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:8506)


at android.os.Binder.execTransactInternal(Binder.java:1184)


at android.os.Binder.execTransact(Binder.java:1143)
That means it's not a changeable permission. These permissions are not something you must allow/disallow but rather a permission that is declared to the system to get access to the related services (think of it as a permission that is always enabled).

I'm not sure but I think android.permission.BIND_ACCESSIBILITY_SERVICE is just MacroDroid saying it has accessibility services.

Accessibility permissions are not the same as the permission shown above.
 
Top