diff --git a/src/main/kotlin/app/revanced/library/adb/Commands.kt b/src/main/kotlin/app/revanced/library/adb/Commands.kt index 2b4d5ee..42a4e34 100644 --- a/src/main/kotlin/app/revanced/library/adb/Commands.kt +++ b/src/main/kotlin/app/revanced/library/adb/Commands.kt @@ -2,7 +2,6 @@ package app.revanced.library.adb import se.vidstige.jadb.JadbDevice import se.vidstige.jadb.RemoteFile -import se.vidstige.jadb.ShellProcess import se.vidstige.jadb.ShellProcessBuilder import java.io.File @@ -16,9 +15,8 @@ internal fun JadbDevice.buildCommand(command: String, su: Boolean = true): Shell return shellProcessBuilder(cmd, *args.toTypedArray()) } -internal fun JadbDevice.run(command: String, su: Boolean = true): ShellProcess { - return this.buildCommand(command, su).start()!! -} +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 @@ -27,8 +25,4 @@ internal fun JadbDevice.push(file: File, targetFilePath: String) = push(file, RemoteFile(targetFilePath)) internal fun JadbDevice.createFile(targetFile: String, content: String) = - push(content.byteInputStream(), System.currentTimeMillis(), 644, RemoteFile(targetFile)) - - -private fun JadbDevice.startCommand(command: String, su: Boolean) = - shellProcessBuilder(if (su) "su -c '$command'" else command).start() \ No newline at end of file + push(content.byteInputStream(), System.currentTimeMillis(), 644, RemoteFile(targetFile)) \ No newline at end of file