mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-11 13:56:17 +00:00
fix: Execute ADB commands sequentially to fix mounting issues (#12)
This commit is contained in:
@@ -84,14 +84,14 @@ sealed class AdbManager private constructor(deviceSerial: String? = null) {
|
|||||||
|
|
||||||
device.push(apk.file, TMP_PATH)
|
device.push(apk.file, TMP_PATH)
|
||||||
|
|
||||||
device.run("$CREATE_DIR $INSTALLATION_PATH")
|
device.run("$CREATE_DIR $INSTALLATION_PATH").waitFor()
|
||||||
device.run(INSTALL_PATCHED_APK, packageName)
|
device.run(INSTALL_PATCHED_APK, packageName).waitFor()
|
||||||
|
|
||||||
device.createFile(TMP_PATH, MOUNT_SCRIPT.applyReplacement(packageName))
|
device.createFile(TMP_PATH, MOUNT_SCRIPT.applyReplacement(packageName))
|
||||||
|
|
||||||
device.run(INSTALL_MOUNT, packageName)
|
device.run(INSTALL_MOUNT, packageName).waitFor()
|
||||||
device.run(UMOUNT, packageName) // Sanity check.
|
device.run(UMOUNT, packageName).waitFor() // Sanity check.
|
||||||
device.run(MOUNT_PATH, packageName)
|
device.run(MOUNT_PATH, packageName).waitFor()
|
||||||
device.run(RESTART, packageName)
|
device.run(RESTART, packageName)
|
||||||
device.run(DELETE, TMP_PATH)
|
device.run(DELETE, TMP_PATH)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ internal fun JadbDevice.run(command: String, su: Boolean = true): ShellProcess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal fun JadbDevice.hasSu() =
|
internal fun JadbDevice.hasSu() =
|
||||||
this.startCommand("su -h", false).waitFor() == 0
|
this.startCommand("which su", false).waitFor() == 0
|
||||||
|
|
||||||
internal fun JadbDevice.push(file: File, targetFilePath: String) =
|
internal fun JadbDevice.push(file: File, targetFilePath: String) =
|
||||||
push(file, RemoteFile(targetFilePath))
|
push(file, RemoteFile(targetFilePath))
|
||||||
|
|||||||
Reference in New Issue
Block a user