home | heroImage | actionText | actionLink | features | footer | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
true |
/logo.png |
Learn more |
/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
There a few more steps to do, like checking permission or if Shizuku is running. :::