mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
fix: root shell prompt for scripts
This commit is contained in:
@@ -12,9 +12,10 @@ object RootShell {
|
||||
|
||||
fun requestRootPermission(): Boolean {
|
||||
return try {
|
||||
val result = Shell.cmd("true").exec()
|
||||
result.isSuccess
|
||||
val shell = Shell.cmd("su").exec()
|
||||
shell.isSuccess
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Root permission request failed or timed out")
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user