mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-18 08:53:57 +00:00
Compare commits
25 Commits
v1.1.2-dev
...
v1.2.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b89993505 | ||
|
|
5896968358 | ||
|
|
cd73bd39ce | ||
|
|
77416b6bf4 | ||
|
|
4227a57fc7 | ||
|
|
cc3de84d25 | ||
|
|
0545341f9a | ||
|
|
035870e08d | ||
|
|
b58ea35f6a | ||
|
|
3f61394f0a | ||
|
|
9536413fa3 | ||
|
|
7b1ca25a6c | ||
|
|
79640bcb8c | ||
|
|
aea1d69157 | ||
|
|
7a6977aff2 | ||
|
|
c221ab1482 | ||
|
|
fda3eca74f | ||
|
|
d2e367e901 | ||
|
|
3e460805bc | ||
|
|
6019320d9e | ||
|
|
0dc83c3e0a | ||
|
|
dc0c9f6cc9 | ||
|
|
33f48f1f3f | ||
|
|
9de5348351 | ||
|
|
adfb41c737 |
46
CHANGELOG.md
46
CHANGELOG.md
@@ -1,3 +1,49 @@
|
|||||||
|
# [1.2.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.5...v1.2.0-dev.1) (2023-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Catch exceptions when serializing invalid patch options ([cd73bd3](https://github.com/ReVanced/revanced-library/commit/cd73bd39ce7be5963a3c84ec43409b87c327579b))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Use better log messages when handling exceptions ([5896968](https://github.com/ReVanced/revanced-library/commit/58969683582e70f36d6ed169b41c37928a2cf602))
|
||||||
|
|
||||||
|
## [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.1.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.1...v1.1.2-dev.1) (2023-10-05)
|
## [1.1.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.1...v1.1.2-dev.1) (2023-10-05)
|
||||||
|
|
||||||
## [1.1.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1) (2023-10-04)
|
## [1.1.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1) (2023-10-04)
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.9.0"
|
kotlin("jvm") version "1.9.10"
|
||||||
alias(libs.plugins.binary.compatibility.validator)
|
alias(libs.plugins.binary.compatibility.validator)
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "app.revanced"
|
group = "app.revanced"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
maven { url = uri("https://jitpack.io") }
|
||||||
|
google()
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.revanced.patcher)
|
implementation(libs.revanced.patcher)
|
||||||
implementation(libs.kotlin.reflect)
|
implementation(libs.kotlin.reflect)
|
||||||
@@ -34,17 +41,6 @@ java {
|
|||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven {
|
|
||||||
name = "GitHubPackages"
|
|
||||||
url = uri("https://maven.pkg.github.com/revanced/revanced-library")
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("GITHUB_ACTOR")
|
|
||||||
password = System.getenv("GITHUB_TOKEN")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("gpr") {
|
create<MavenPublication>("gpr") {
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 1.1.2-dev.1
|
version = 1.2.0-dev.1
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
[versions]
|
[versions]
|
||||||
apksig = "8.1.1"
|
apksig = "8.1.2"
|
||||||
bcpkix-jdk18on = "1.76"
|
bcpkix-jdk18on = "1.76"
|
||||||
jackson-module-kotlin = "2.14.3"
|
jackson-module-kotlin = "2.14.3"
|
||||||
jadb = "2531a28109"
|
jadb = "1.2.1"
|
||||||
kotlin-reflect = "1.9.0"
|
kotlin-reflect = "1.9.10"
|
||||||
kotlin-test = "1.8.20-RC"
|
kotlin-test = "1.8.20-RC"
|
||||||
revanced-patcher = "16.0.1"
|
revanced-patcher = "19.0.0"
|
||||||
binary-compatibility-validator = "0.13.2"
|
binary-compatibility-validator = "0.13.2"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
apksig = { module = "com.android.tools.build:apksig", version.ref = "apksig" }
|
apksig = { module = "com.android.tools.build:apksig", version.ref = "apksig" }
|
||||||
bcpkix-jdk18on = { module = "org.bouncycastle:bcpkix-jdk18on", version.ref = "bcpkix-jdk18on" }
|
bcpkix-jdk18on = { module = "org.bouncycastle:bcpkix-jdk18on", version.ref = "bcpkix-jdk18on" }
|
||||||
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson-module-kotlin" }
|
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson-module-kotlin" }
|
||||||
jadb = { module = "com.github.revanced:jadb", version.ref = "jadb" }
|
jadb = { module = "app.revanced:jadb", version.ref = "jadb" }
|
||||||
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-reflect" }
|
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-reflect" }
|
||||||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" }
|
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" }
|
||||||
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
|
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
|
||||||
|
|||||||
@@ -1,23 +1 @@
|
|||||||
val githubUsername: String = providers.gradleProperty("gpr.user").orNull ?: System.getenv("GITHUB_ACTOR")
|
|
||||||
val githubPassword: String = providers.gradleProperty("gpr.key").orNull ?: System.getenv("GITHUB_TOKEN")
|
|
||||||
|
|
||||||
dependencyResolutionManagement {
|
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
mavenLocal()
|
|
||||||
google()
|
|
||||||
maven { url = uri("https://jitpack.io") }
|
|
||||||
listOf("revanced-patcher", "jadb").forEach { repo ->
|
|
||||||
maven {
|
|
||||||
url = uri("https://maven.pkg.github.com/revanced/$repo")
|
|
||||||
credentials {
|
|
||||||
username = githubUsername
|
|
||||||
password = githubPassword
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rootProject.name = "revanced-library"
|
rootProject.name = "revanced-library"
|
||||||
@@ -30,7 +30,16 @@ object Options {
|
|||||||
.map { patch ->
|
.map { patch ->
|
||||||
Patch(
|
Patch(
|
||||||
patch.name!!,
|
patch.name!!,
|
||||||
patch.options.values.map { option -> Option(option.key, option.value) }
|
patch.options.values.map { option ->
|
||||||
|
val optionValue = try {
|
||||||
|
option.value
|
||||||
|
} catch (e: PatchOptionException) {
|
||||||
|
logger.warning("Using default option value for the ${patch.name} patch: ${e.message}")
|
||||||
|
option.default
|
||||||
|
}
|
||||||
|
|
||||||
|
Option(option.key, optionValue)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// See https://github.com/revanced/revanced-patches/pull/2434/commits/60e550550b7641705e81aa72acfc4faaebb225e7.
|
// See https://github.com/revanced/revanced-patches/pull/2434/commits/60e550550b7641705e81aa72acfc4faaebb225e7.
|
||||||
@@ -71,7 +80,7 @@ object Options {
|
|||||||
try {
|
try {
|
||||||
patch.options[option] = value
|
patch.options[option] = value
|
||||||
} catch (e: PatchOptionException) {
|
} catch (e: PatchOptionException) {
|
||||||
logger.severe(e.toString())
|
logger.warning("Could not set option value for the ${patch.name} patch: ${e.message}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package app.revanced.library.adb
|
|||||||
|
|
||||||
import se.vidstige.jadb.JadbDevice
|
import se.vidstige.jadb.JadbDevice
|
||||||
import se.vidstige.jadb.RemoteFile
|
import se.vidstige.jadb.RemoteFile
|
||||||
import se.vidstige.jadb.ShellProcess
|
|
||||||
import se.vidstige.jadb.ShellProcessBuilder
|
import se.vidstige.jadb.ShellProcessBuilder
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@@ -16,19 +15,14 @@ internal fun JadbDevice.buildCommand(command: String, su: Boolean = true): Shell
|
|||||||
return shellProcessBuilder(cmd, *args.toTypedArray())
|
return shellProcessBuilder(cmd, *args.toTypedArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun JadbDevice.run(command: String, su: Boolean = true): ShellProcess {
|
internal fun JadbDevice.run(command: String, su: Boolean = true) =
|
||||||
return this.buildCommand(command, su).start()!!
|
this.buildCommand(command, su).start()
|
||||||
}
|
|
||||||
|
|
||||||
internal fun JadbDevice.hasSu() =
|
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) =
|
internal fun JadbDevice.push(file: File, targetFilePath: String) =
|
||||||
push(file, RemoteFile(targetFilePath))
|
push(file, RemoteFile(targetFilePath))
|
||||||
|
|
||||||
internal fun JadbDevice.createFile(targetFile: String, content: String) =
|
internal fun JadbDevice.createFile(targetFile: String, content: String) =
|
||||||
push(content.byteInputStream(), System.currentTimeMillis(), 644, RemoteFile(targetFile))
|
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()
|
|
||||||
Reference in New Issue
Block a user