diff --git a/src/main/kotlin/app/revanced/utils/adb/Adb.kt b/src/main/kotlin/app/revanced/utils/adb/Adb.kt index 5097956..9533994 100644 --- a/src/main/kotlin/app/revanced/utils/adb/Adb.kt +++ b/src/main/kotlin/app/revanced/utils/adb/Adb.kt @@ -10,7 +10,7 @@ internal class Adb( private val file: File, private val packageName: String, deviceName: String, - private val install: Boolean = false, + private val modeInstall: Boolean = false, private val logging: Boolean = true ) { private val device: JadbDevice @@ -19,7 +19,7 @@ internal class Adb( device = JadbConnection().devices.find { it.serial == deviceName } ?: throw IllegalArgumentException("No such device with name $deviceName") - if (device.run("su -h", false) != 0) + if (!modeInstall && device.run("su -h", false) != 0) throw IllegalArgumentException("Root required on $deviceName. Deploying failed.") } @@ -28,7 +28,7 @@ internal class Adb( } internal fun deploy() { - if (install) { + if (modeInstall) { PackageManager(device).install(file) } else { // push patched file