You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5cb51f8
Browse filesBrowse the repository at this point in the historyBrowse files
"adb shell pm grant $pkg android.permission.BATTERY_STATS",
418
-
"adb shell pm grant $pkg android.permission.DUMP",
419
-
"adb shell pm grant $pkg android.permission.PACKAGE_USAGE_STATS",
420
-
"adb shell pm grant $pkg android.permission.INTERACT_ACROSS_USERS"
421
-
)
422
-
}
423
-
val oneLiner = remember(pkg) { "for p in DUMP BATTERY_STATS PACKAGE_USAGE_STATS INTERACT_ACROSS_USERS; do adb shell pm grant $pkg android.permission.\$p; done" }
valout=RootStatsCollector.runAsRoot("pm grant $pkg$perm")
491
-
if (out!=null&&!out.contains("Exception") &&!out.contains("Error")) ok++
492
-
}
493
-
refreshChecks()
494
-
snackbarHost.showSnackbar(if (ok>0) "Granted via root ($ok/3), recheck"else"Root grant failed — check su")
495
-
}
496
-
}
497
-
}, enabled = hasRoot) { Text("Grant via Root") }
498
-
}
499
-
Text("Enable Developer options → USB debugging. On Xiaomi/HyperOS/OnePlus also enable “USB debugging (Security settings)” / “Disable permission monitoring”, then reboot. After grant: force-stop app or reboot.", style =MaterialTheme.typography.bodySmall, color =MaterialTheme.colorScheme.onSurfaceVariant)
Text("• Enable Developer options → USB debugging.", style =MaterialTheme.typography.bodySmall)
283
-
Text("• On Xiaomi/MIUI/HyperOS/OnePlus: also enable “USB debugging (Security settings)” / “Disable permission monitoring”, then reboot.", style =MaterialTheme.typography.bodySmall)
284
-
Text("• Run: adb devices → accept prompt → run grant commands → force-stop BatStats or reboot.", style =MaterialTheme.typography.bodySmall)
285
-
Text("• Grant fails with “Neither user 2000 … GRANT_RUNTIME_PERMISSIONS”? Enable security settings above.", style =MaterialTheme.typography.bodySmall)
286
-
Text("• Grants persist until uninstall. Use pm grant via root (su -c pm grant ...) as alternative.", style =MaterialTheme.typography.bodySmall)
282
+
Text("- Enable Developer options, enable USB debugging.", style =MaterialTheme.typography.bodySmall)
283
+
Text("- On Xiaomi/MIUI/HyperOS/OnePlus: also enable USB debugging (Security settings) / Disable permission monitoring, then reboot.", style =MaterialTheme.typography.bodySmall)
284
+
Text("- Run: adb devices, accept prompt, run grant commands, then force-stop BatStats or reboot.", style =MaterialTheme.typography.bodySmall)
285
+
Text("- Grant fails with Neither user 2000 nor current process has GRANT_RUNTIME_PERMISSIONS? Enable security settings above.", style =MaterialTheme.typography.bodySmall)
286
+
Text("- Grants persist until uninstall. Use pm grant via root (su -c pm grant ...) as alternative.", style =MaterialTheme.typography.bodySmall)
287
287
}
288
288
}
289
289
}
@@ -294,7 +294,7 @@ private fun PrivilegeRequiredCard(
Text("Run once via ADB, survives reboots/updates (until uninstall). No need to keep Shizuku running.", style =MaterialTheme.typography.bodySmall, color =MaterialTheme.colorScheme.onSurfaceVariant)
Text("Run once via ADB, survives reboots and updates until uninstall. No need to keep Shizuku running.", style =MaterialTheme.typography.bodySmall, color =MaterialTheme.colorScheme.onSurfaceVariant)
0 commit comments