home | heroImage | actionText | actionLink | features | footer | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
true |
/logo.png |
瞭解更多 |
/zh-hant/introduction.html |
|
Copyright © 2019 RikkaApps |
private static final IPackageManager PACKAGE_MANAGER = IPackageManager.Stub.asInterface(
new ShizukuBinderWrapper(SystemServiceHelper.getSystemService("package")));
public static void grantRuntimePermission(String packageName, String permissionName, int userId) {
try {
PACKAGE_MANAGER.grantRuntimePermission(packageName, permissionName, userId);
} catch (RemoteException tr) {
throw new RuntimeException(tr.getMessage(), tr);
}
}
::: tip
還有一些步驟要做,比如檢查權限或 Shizuku 是否正在執行。 :::