fix: Ask for root permissions before trying to use them

This commit is contained in:
oSumAtrIX
2023-10-10 10:23:39 +02:00
parent 7a6977aff2
commit aea1d69157

View File

@@ -19,7 +19,7 @@ internal fun JadbDevice.run(command: String, su: Boolean = true) =
this.buildCommand(command, su).start()
internal fun JadbDevice.hasSu() =
this.startCommand("which su", false).waitFor() == 0
this.run("whoami", true).waitFor() == 0
internal fun JadbDevice.push(file: File, targetFilePath: String) =
push(file, RemoteFile(targetFilePath))