Skip to content

Commit 0d7581a

Browse files
committed
fix: check for root even though when not needed
1 parent d55ca86 commit 0d7581a

File tree

1 file changed

+3
-3
lines changed
  • src/main/kotlin/app/revanced/utils/adb

1 file changed

+3
-3
lines changed

src/main/kotlin/app/revanced/utils/adb/Adb.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal class Adb(
1010
private val file: File,
1111
private val packageName: String,
1212
deviceName: String,
13-
private val install: Boolean = false,
13+
private val modeInstall: Boolean = false,
1414
private val logging: Boolean = true
1515
) {
1616
private val device: JadbDevice
@@ -19,7 +19,7 @@ internal class Adb(
1919
device = JadbConnection().devices.find { it.serial == deviceName }
2020
?: throw IllegalArgumentException("No such device with name $deviceName")
2121

22-
if (device.run("su -h", false) != 0)
22+
if (!modeInstall && device.run("su -h", false) != 0)
2323
throw IllegalArgumentException("Root required on $deviceName. Deploying failed.")
2424
}
2525

@@ -28,7 +28,7 @@ internal class Adb(
2828
}
2929

3030
internal fun deploy() {
31-
if (install) {
31+
if (modeInstall) {
3232
PackageManager(device).install(file)
3333
} else {
3434
// push patched file

0 commit comments

Comments
 (0)