From d5465e88473b14cebc0fb429c96f14a467bbbb20 Mon Sep 17 00:00:00 2001 From: Zhao Guangyu <62810902+ZhaoGY-N@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:11:55 +0800 Subject: [PATCH] Update faq.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加“手动写入安全设置权限失败”的内容 --- docs/guide/faq.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 1d01de9..5b09934 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -91,3 +91,32 @@ 以 Xiaomi HyperOS 为例子, 下面是完整的关闭弹窗流程截图 + +## 手动写入安全设置权限失败 {#fail_setting_secure_settings} + +在使用adb手动写入安全设置时可能会提示权限不够,具体报错如下: + +``` +adb shell pm grant li.songe.gkd android.permission.WRITE_SECURE_SETTINGS + +Exception occurred while executing 'grant': +java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS. + at android.app.ContextImpl.enforce(ContextImpl.java:2384) + at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2412) + at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermissionInternal(PermissionManagerServiceImpl.java:1383) + at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermission(PermissionManagerServiceImpl.java:1365) + at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:573) + at android.permission.PermissionManager.grantRuntimePermission(PermissionManager.java:610) + at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2717) + at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:301) + at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97) + at android.os.ShellCommand.exec(ShellCommand.java:38) + at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6840) + at android.os.Binder.shellCommand(Binder.java:1092) + at android.os.Binder.onTransact(Binder.java:912) + at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4352) + at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6824) + at android.os.Binder.execTransactInternal(Binder.java:1392) + at android.os.Binder.execTransact(Binder.java:1299) +``` +在开发者选项中找到“禁止权限监控”,打开后重新运行adb指令即可。