mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-11-19 01:59:25 +01:00
fix: check for root even though when not needed
This commit is contained in:
parent
d55ca86e5c
commit
0d7581ad75
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user