Skip to content

Commit

Permalink
fix: Ask for root permissions before trying to use them
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Oct 10, 2023
1 parent 7a6977a commit aea1d69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/library/adb/Commands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit aea1d69

Please sign in to comment.