mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-04 09:22:54 +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 file: File,
|
||||||
private val packageName: String,
|
private val packageName: String,
|
||||||
deviceName: String,
|
deviceName: String,
|
||||||
private val install: Boolean = false,
|
private val modeInstall: Boolean = false,
|
||||||
private val logging: Boolean = true
|
private val logging: Boolean = true
|
||||||
) {
|
) {
|
||||||
private val device: JadbDevice
|
private val device: JadbDevice
|
||||||
@ -19,7 +19,7 @@ internal class Adb(
|
|||||||
device = JadbConnection().devices.find { it.serial == deviceName }
|
device = JadbConnection().devices.find { it.serial == deviceName }
|
||||||
?: throw IllegalArgumentException("No such device with name $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.")
|
throw IllegalArgumentException("Root required on $deviceName. Deploying failed.")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ internal class Adb(
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal fun deploy() {
|
internal fun deploy() {
|
||||||
if (install) {
|
if (modeInstall) {
|
||||||
PackageManager(device).install(file)
|
PackageManager(device).install(file)
|
||||||
} else {
|
} else {
|
||||||
// push patched file
|
// push patched file
|
||||||
|
Loading…
Reference in New Issue
Block a user