tytydraco / LADB

A local ADB shell for Android!
https://play.google.com/store/apps/details?id=com.draco.ladb
Other
1.69k stars 461 forks source link

Can't executing grant permission command #66

Open gplcn opened 2 years ago

gplcn commented 2 years ago

When i submit command adb shell pm grant com.arumcomm.crashlogviewer android.permission.PACKAGE_USAGE_STATS,the result is :

Exception occurred while executing 'grant':
java.lang.IllegalArgumentException: Unknown permission: android.permission.PACKAGE_USAGE_STATS
    at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1467)
    at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1426)
    at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2300)
    at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:251)
    at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
    at android.os.ShellCommand.exec(ShellCommand.java:44)
    at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22179)
    at android.os.Binder.shellCommand(Binder.java:929)
    at android.os.Binder.onTransact(Binder.java:813)
    at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4687)
    at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4405)
    at android.os.Binder.execTransactInternal(Binder.java:1159)
    at android.os.Binder.execTransact(Binder.java:1123)
Rozia13 commented 2 years ago

When i submit command adb shell pm grant com.arumcomm.crashlogviewer android.permission.PACKAGE_USAGE_STATS,the result is :

Exception occurred while executing 'grant':
java.lang.IllegalArgumentException: Unknown permission: android.permission.PACKAGE_USAGE_STATS
  at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1467)
  at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1426)
  at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2300)
  at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:251)
  at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
  at android.os.ShellCommand.exec(ShellCommand.java:44)
  at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22179)
  at android.os.Binder.shellCommand(Binder.java:929)
  at android.os.Binder.onTransact(Binder.java:813)
  at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4687)
  at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4405)
  at android.os.Binder.execTransactInternal(Binder.java:1159)
  at android.os.Binder.execTransact(Binder.java:1123)
Kashifrazabb commented 2 years ago

Same. Have you got the solution?

N-X-T commented 2 years ago

LADB auto jump to shell, try sending "pm grant com.arumcomm.crashlogviewer android.permission.PACKAGE_USAGE_STATS"

gplcn commented 2 years ago

No

sdgaopeilei

@.*** |

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2022年04月13日 04:14 | | 收件人 | @.> | | 抄送至 | @.**@.> | | 主题 | Re: [tytydraco/LADB] Can't executing grant permission command (Issue #66) |

Same. Have you got the solution?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

gplcn commented 2 years ago

Tried it before, but it didn't work.

sdgaopeilei

@.*** |

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2022年04月14日 19:19 | | 收件人 | @.> | | 抄送至 | @.**@.> | | 主题 | Re: [tytydraco/LADB] Can't executing grant permission command (Issue #66) |

LADB auto jump to shell, try sending "pm grant com.arumcomm.crashlogviewer android.permission.PACKAGE_USAGE_STATS"

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

mirh commented 2 years ago

The "adb shell" part is already assumed by LADB. You have just to enter pm grant com.arumcomm.crashlogviewer android.permission.PACKAGE_USAGE_STATS

teou1 commented 1 year ago

And type everything manually, that error indicates wrong permission name, if you are copy pasting it from somewhere you might have caught a space with it.

mirh commented 1 year ago

Spaces shouldn't cause any issue in a cli.. and copy pasting is usually more robust to errors.

teou1 commented 1 year ago

In a nomal desktop OS yes, and if someone pastes the wrong type of quote or hyphen or nonenglish encoding the shell says so....but android adb throws weird and not understandable errors like this, so it is worth trying. Just my experience, it happened to me. Maybe i am wrong.

mirh commented 1 year ago

I reckon unicode handling may be odd yes, especially if you are going from a CP 850 cmd.exe to the native unix shell. But I don't think I have ever seen anything bad with spaces.

tytydraco commented 1 year ago

I have a feeling that either the permission name you're entering is wrong (android.permission.PACKAGE_USAGE_STATS) or maybe, which OEM do you have? If it's like Xiaomi or something it might be removed in the OS.

Luisdeugarza commented 1 week ago

I have a feeling that either the permission name you're entering is wrong (android.permission.PACKAGE_USAGE_STATS) or maybe, which OEM do you have? If it's like Xiaomi or something it might be removed in the OS.

I have a Xiaomi and I have this problem, what I can do?