Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't executing grant permission command #66

Open
gplcn opened this issue Apr 2, 2022 · 12 comments
Open

Can't executing grant permission command #66

gplcn opened this issue Apr 2, 2022 · 12 comments
Labels
question Further information is requested

Comments

@gplcn
Copy link

gplcn commented Apr 2, 2022

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
Copy link

Rozia13 commented Apr 10, 2022

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
Copy link

Same. Have you got the solution?

@N-X-T
Copy link

N-X-T commented Apr 14, 2022

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

@gplcn
Copy link
Author

gplcn commented Apr 14, 2022 via email

@gplcn
Copy link
Author

gplcn commented Apr 14, 2022 via email

@mirh
Copy link

mirh commented Jun 10, 2022

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
Copy link

teou1 commented Oct 14, 2022

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
Copy link

mirh commented Oct 15, 2022

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

@teou1
Copy link

teou1 commented Oct 15, 2022

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
Copy link

mirh commented Oct 15, 2022

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
Copy link
Owner

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.

@tytydraco tytydraco added the question Further information is requested label Oct 15, 2022
@Luisdeugarza
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants