mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-11 22:06:18 +00:00
Compare commits
17 Commits
v1.1.3-dev
...
v1.1.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4227a57fc7 | ||
|
|
cc3de84d25 | ||
|
|
0545341f9a | ||
|
|
035870e08d | ||
|
|
b58ea35f6a | ||
|
|
3f61394f0a | ||
|
|
9536413fa3 | ||
|
|
7b1ca25a6c | ||
|
|
79640bcb8c | ||
|
|
aea1d69157 | ||
|
|
7a6977aff2 | ||
|
|
c221ab1482 | ||
|
|
fda3eca74f | ||
|
|
d2e367e901 | ||
|
|
3e460805bc | ||
|
|
6019320d9e | ||
|
|
0dc83c3e0a |
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,3 +1,33 @@
|
||||
## [1.1.5](https://github.com/ReVanced/revanced-library/compare/v1.1.4...v1.1.5) (2023-10-23)
|
||||
|
||||
## [1.1.5-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.4...v1.1.5-dev.1) (2023-10-23)
|
||||
|
||||
## [1.1.4](https://github.com/ReVanced/revanced-library/compare/v1.1.3...v1.1.4) (2023-10-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ask for root permissions before trying to use them ([aea1d69](https://github.com/ReVanced/revanced-library/commit/aea1d6915766d9757075ee459955aa335d906bab))
|
||||
* Execute ADB commands sequentially to fix mounting issues ([#12](https://github.com/ReVanced/revanced-library/issues/12)) ([fda3eca](https://github.com/ReVanced/revanced-library/commit/fda3eca74f30b968d8ee816d63a3dcf493e026de))
|
||||
|
||||
## [1.1.4-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.4-dev.1...v1.1.4-dev.2) (2023-10-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ask for root permissions before trying to use them ([aea1d69](https://github.com/ReVanced/revanced-library/commit/aea1d6915766d9757075ee459955aa335d906bab))
|
||||
|
||||
## [1.1.4-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.3...v1.1.4-dev.1) (2023-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Execute ADB commands sequentially to fix mounting issues ([#12](https://github.com/ReVanced/revanced-library/issues/12)) ([fda3eca](https://github.com/ReVanced/revanced-library/commit/fda3eca74f30b968d8ee816d63a3dcf493e026de))
|
||||
|
||||
## [1.1.3](https://github.com/ReVanced/revanced-library/compare/v1.1.2...v1.1.3) (2023-10-09)
|
||||
|
||||
## [1.1.3-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.3-dev.1...v1.1.3-dev.2) (2023-10-09)
|
||||
|
||||
## [1.1.3-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.2...v1.1.3-dev.1) (2023-10-09)
|
||||
|
||||
## [1.1.2](https://github.com/ReVanced/revanced-library/compare/v1.1.1...v1.1.2) (2023-10-05)
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.9.0"
|
||||
kotlin("jvm") version "1.9.10"
|
||||
alias(libs.plugins.binary.compatibility.validator)
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
group = "app.revanced"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = uri("https://jitpack.io") }
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.revanced.patcher)
|
||||
implementation(libs.kotlin.reflect)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 1.1.3-dev.1
|
||||
version = 1.1.5
|
||||
|
||||
@@ -5,7 +5,7 @@ jackson-module-kotlin = "2.14.3"
|
||||
jadb = "1.2.1"
|
||||
kotlin-reflect = "1.9.0"
|
||||
kotlin-test = "1.8.20-RC"
|
||||
revanced-patcher = "17.0.0"
|
||||
revanced-patcher = "18.0.0"
|
||||
binary-compatibility-validator = "0.13.2"
|
||||
|
||||
[libraries]
|
||||
|
||||
@@ -1,10 +1 @@
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = uri("https://jitpack.io") }
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "revanced-library"
|
||||
@@ -84,14 +84,14 @@ sealed class AdbManager private constructor(deviceSerial: String? = null) {
|
||||
|
||||
device.push(apk.file, TMP_PATH)
|
||||
|
||||
device.run("$CREATE_DIR $INSTALLATION_PATH")
|
||||
device.run(INSTALL_PATCHED_APK, packageName)
|
||||
device.run("$CREATE_DIR $INSTALLATION_PATH").waitFor()
|
||||
device.run(INSTALL_PATCHED_APK, packageName).waitFor()
|
||||
|
||||
device.createFile(TMP_PATH, MOUNT_SCRIPT.applyReplacement(packageName))
|
||||
|
||||
device.run(INSTALL_MOUNT, packageName)
|
||||
device.run(UMOUNT, packageName) // Sanity check.
|
||||
device.run(MOUNT_PATH, packageName)
|
||||
device.run(INSTALL_MOUNT, packageName).waitFor()
|
||||
device.run(UMOUNT, packageName).waitFor() // Sanity check.
|
||||
device.run(MOUNT_PATH, packageName).waitFor()
|
||||
device.run(RESTART, packageName)
|
||||
device.run(DELETE, TMP_PATH)
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package app.revanced.library.adb
|
||||
|
||||
import se.vidstige.jadb.JadbDevice
|
||||
import se.vidstige.jadb.RemoteFile
|
||||
import se.vidstige.jadb.ShellProcess
|
||||
import se.vidstige.jadb.ShellProcessBuilder
|
||||
import java.io.File
|
||||
|
||||
@@ -16,19 +15,14 @@ internal fun JadbDevice.buildCommand(command: String, su: Boolean = true): Shell
|
||||
return shellProcessBuilder(cmd, *args.toTypedArray())
|
||||
}
|
||||
|
||||
internal fun JadbDevice.run(command: String, su: Boolean = true): ShellProcess {
|
||||
return this.buildCommand(command, su).start()!!
|
||||
}
|
||||
internal fun JadbDevice.run(command: String, su: Boolean = true) =
|
||||
this.buildCommand(command, su).start()
|
||||
|
||||
internal fun JadbDevice.hasSu() =
|
||||
this.startCommand("su -h", false).waitFor() == 0
|
||||
this.run("whoami", true).waitFor() == 0
|
||||
|
||||
internal fun JadbDevice.push(file: File, targetFilePath: String) =
|
||||
push(file, RemoteFile(targetFilePath))
|
||||
|
||||
internal fun JadbDevice.createFile(targetFile: String, content: String) =
|
||||
push(content.byteInputStream(), System.currentTimeMillis(), 644, RemoteFile(targetFile))
|
||||
|
||||
|
||||
private fun JadbDevice.startCommand(command: String, su: Boolean) =
|
||||
shellProcessBuilder(if (su) "su -c '$command'" else command).start()
|
||||
push(content.byteInputStream(), System.currentTimeMillis(), 644, RemoteFile(targetFile))
|
||||
Reference in New Issue
Block a user