mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-11 22:06:20 +00:00
Compare commits
21 Commits
v4.4.1-dev
...
v4.6.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dd460f056 | ||
|
|
223629c663 | ||
|
|
45a2ffa2dd | ||
|
|
932494eeab | ||
|
|
0d28a49773 | ||
|
|
366f400c5a | ||
|
|
d5c27408f3 | ||
|
|
8ee5b754da | ||
|
|
9476f5a2e4 | ||
|
|
5ff105cf6b | ||
|
|
f0f3e5614b | ||
|
|
48a1a39b94 | ||
|
|
c45ed69adf | ||
|
|
8641d301b1 | ||
|
|
44b72ca99d | ||
|
|
240f2cfb6b | ||
|
|
304275ddbb | ||
|
|
483590726a | ||
|
|
cf20efd467 | ||
|
|
164d09dec1 | ||
|
|
1e92239616 |
58
CHANGELOG.md
58
CHANGELOG.md
@@ -1,3 +1,61 @@
|
|||||||
|
# [4.6.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.5.1-dev.1...v4.6.0-dev.1) (2024-03-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Use correct option description ([45a2ffa](https://github.com/ReVanced/revanced-cli/commit/45a2ffa2dd95ee8ac3c4d466463c9a5b869b8da1))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Use more consistent option name ([223629c](https://github.com/ReVanced/revanced-cli/commit/223629c663dcd94d237110e09e4e152aa03867f9))
|
||||||
|
|
||||||
|
## [4.5.1-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.5.0...v4.5.1-dev.1) (2024-03-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Copy APK to output path when it is not being signed ([366f400](https://github.com/ReVanced/revanced-cli/commit/366f400c5a46491f3f262c7ff4b0df1ae3721f74))
|
||||||
|
|
||||||
|
# [4.5.0](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0) (2024-03-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Show path for missing files instead of just the name ([f0f3e56](https://github.com/ReVanced/revanced-cli/commit/f0f3e5614b99b34391e0492177706f9c09781cad))
|
||||||
|
* Sign APKs correctly ([5ff105c](https://github.com/ReVanced/revanced-cli/commit/5ff105cf6b3fac9cd12478efd10caf90d1ecf589))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Remove deprecated CLI options ([48a1a39](https://github.com/ReVanced/revanced-cli/commit/48a1a39b94dd9121c400d28e3e93dec3fc13e3be))
|
||||||
|
|
||||||
|
# [4.5.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0-dev.1) (2024-03-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Show path for missing files instead of just the name ([f0f3e56](https://github.com/ReVanced/revanced-cli/commit/f0f3e5614b99b34391e0492177706f9c09781cad))
|
||||||
|
* Sign APKs correctly ([5ff105c](https://github.com/ReVanced/revanced-cli/commit/5ff105cf6b3fac9cd12478efd10caf90d1ecf589))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Remove deprecated CLI options ([48a1a39](https://github.com/ReVanced/revanced-cli/commit/48a1a39b94dd9121c400d28e3e93dec3fc13e3be))
|
||||||
|
|
||||||
|
## [4.4.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2) (2024-03-10)
|
||||||
|
|
||||||
|
## [4.4.2-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.2-dev.1...v4.4.2-dev.2) (2024-03-10)
|
||||||
|
|
||||||
|
## [4.4.2-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2-dev.1) (2024-03-09)
|
||||||
|
|
||||||
|
## [4.4.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.0...v4.4.1) (2024-03-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Bump dependencies to support BCS keystore ([1c10a77](https://github.com/ReVanced/revanced-cli/commit/1c10a7760d76ea850260ca49b448be7ad121de44))
|
||||||
|
|
||||||
## [4.4.1-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1-dev.1...v4.4.1-dev.2) (2024-03-04)
|
## [4.4.1-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1-dev.1...v4.4.1-dev.2) (2024-03-04)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlin)
|
alias(libs.plugins.kotlin)
|
||||||
alias(libs.plugins.shadow)
|
alias(libs.plugins.shadow)
|
||||||
@@ -35,7 +37,15 @@ dependencies {
|
|||||||
testImplementation(libs.kotlin.test)
|
testImplementation(libs.kotlin.test)
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin { jvmToolchain(11) }
|
kotlin {
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget.set(JvmTarget.JVM_11)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -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 = 4.4.1-dev.2
|
version = 4.6.0-dev.1
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ kotlin = "1.9.22"
|
|||||||
kotlinx-coroutines-core = "1.7.3"
|
kotlinx-coroutines-core = "1.7.3"
|
||||||
picocli = "4.7.5"
|
picocli = "4.7.5"
|
||||||
revanced-patcher = "19.3.1"
|
revanced-patcher = "19.3.1"
|
||||||
revanced-library = "2.1.0"
|
revanced-library = "2.3.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package app.revanced.cli.command
|
|||||||
|
|
||||||
import app.revanced.library.ApkUtils
|
import app.revanced.library.ApkUtils
|
||||||
import app.revanced.library.ApkUtils.applyTo
|
import app.revanced.library.ApkUtils.applyTo
|
||||||
import app.revanced.library.ApkUtils.sign
|
|
||||||
import app.revanced.library.Options
|
import app.revanced.library.Options
|
||||||
import app.revanced.library.Options.setOptions
|
import app.revanced.library.Options.setOptions
|
||||||
import app.revanced.library.adb.AdbManager
|
import app.revanced.library.adb.AdbManager
|
||||||
@@ -86,6 +85,7 @@ internal object PatchCommand : Runnable {
|
|||||||
names = ["-o", "--out"],
|
names = ["-o", "--out"],
|
||||||
description = ["Path to save the patched APK file to. Defaults to the same directory as the supplied APK file."],
|
description = ["Path to save the patched APK file to. Defaults to the same directory as the supplied APK file."],
|
||||||
)
|
)
|
||||||
|
@Suppress("unused")
|
||||||
private fun setOutputFilePath(outputFilePath: File?) {
|
private fun setOutputFilePath(outputFilePath: File?) {
|
||||||
this.outputFilePath = outputFilePath?.absoluteFile
|
this.outputFilePath = outputFilePath?.absoluteFile
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,6 @@ internal object PatchCommand : Runnable {
|
|||||||
)
|
)
|
||||||
private var keystoreFilePath: File? = null
|
private var keystoreFilePath: File? = null
|
||||||
|
|
||||||
// key store password
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = ["--keystore-password"],
|
names = ["--keystore-password"],
|
||||||
description = ["The password of the keystore to sign the patched APK file with. Empty password by default."],
|
description = ["The password of the keystore to sign the patched APK file with. Empty password by default."],
|
||||||
@@ -124,16 +123,26 @@ internal object PatchCommand : Runnable {
|
|||||||
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = ["--alias"],
|
names = ["--alias"],
|
||||||
description = ["The alias of the key from the keystore to sign the patched APK file with."],
|
description = ["The alias of the keystore entry to sign the patched APK file with."],
|
||||||
showDefaultValue = ALWAYS,
|
showDefaultValue = ALWAYS,
|
||||||
)
|
)
|
||||||
private var alias = "ReVanced Key"
|
private fun setKeyStoreEntryAlias(alias: String = "ReVanced Key") {
|
||||||
|
logger.warning("The --alias option is deprecated. Use --keystore-entry-alias instead.")
|
||||||
|
keyStoreEntryAlias = alias
|
||||||
|
}
|
||||||
|
|
||||||
|
@CommandLine.Option(
|
||||||
|
names = ["--keystore-entry-alias"],
|
||||||
|
description = ["The alias of the keystore entry to sign the patched APK file with."],
|
||||||
|
showDefaultValue = ALWAYS,
|
||||||
|
)
|
||||||
|
private var keyStoreEntryAlias = "ReVanced Key"
|
||||||
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = ["--keystore-entry-password"],
|
names = ["--keystore-entry-password"],
|
||||||
description = ["The password of the entry from the keystore for the key to sign the patched APK file with."],
|
description = ["The password of the entry from the keystore for the key to sign the patched APK file with."],
|
||||||
)
|
)
|
||||||
private var password = "" // Empty password by default
|
private var keyStoreEntryPassword = "" // Empty password by default
|
||||||
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = ["--signer"],
|
names = ["--signer"],
|
||||||
@@ -142,17 +151,6 @@ internal object PatchCommand : Runnable {
|
|||||||
)
|
)
|
||||||
private var signer = "ReVanced"
|
private var signer = "ReVanced"
|
||||||
|
|
||||||
@CommandLine.Option(
|
|
||||||
names = ["-r", "--resource-cache"],
|
|
||||||
description = ["Path to temporary resource cache directory."],
|
|
||||||
)
|
|
||||||
private var resourceCachePath: File? = null
|
|
||||||
set(value) {
|
|
||||||
logger.warning("The --resource-cache option is deprecated. Use --temporary-files-patch instead.")
|
|
||||||
field = value
|
|
||||||
temporaryFilesPath = value
|
|
||||||
}
|
|
||||||
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = ["-t", "--temporary-files-path"],
|
names = ["-t", "--temporary-files-path"],
|
||||||
description = ["Path to temporary files directory."],
|
description = ["Path to temporary files directory."],
|
||||||
@@ -184,7 +182,7 @@ internal object PatchCommand : Runnable {
|
|||||||
if (!apk.exists()) {
|
if (!apk.exists()) {
|
||||||
throw CommandLine.ParameterException(
|
throw CommandLine.ParameterException(
|
||||||
spec.commandLine(),
|
spec.commandLine(),
|
||||||
"APK file ${apk.name} does not exist",
|
"APK file ${apk.path} does not exist",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
this.apk = apk
|
this.apk = apk
|
||||||
@@ -197,7 +195,7 @@ internal object PatchCommand : Runnable {
|
|||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
private fun setIntegrations(integrations: Array<File>) {
|
private fun setIntegrations(integrations: Array<File>) {
|
||||||
integrations.firstOrNull { !it.exists() }?.let {
|
integrations.firstOrNull { !it.exists() }?.let {
|
||||||
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.name} does not exist.")
|
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.path} does not exist.")
|
||||||
}
|
}
|
||||||
this.integrations += integrations
|
this.integrations += integrations
|
||||||
}
|
}
|
||||||
@@ -273,12 +271,13 @@ internal object PatchCommand : Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
|
||||||
val (packageName, patcherResult) = Patcher(
|
val (packageName, patcherResult) = Patcher(
|
||||||
PatcherConfig(
|
PatcherConfig(
|
||||||
apk,
|
apk,
|
||||||
temporaryFilesPath,
|
patcherTemporaryFilesPath,
|
||||||
aaptBinaryPath?.path,
|
aaptBinaryPath?.path,
|
||||||
temporaryFilesPath.absolutePath,
|
patcherTemporaryFilesPath.absolutePath,
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
).use { patcher ->
|
).use { patcher ->
|
||||||
@@ -315,21 +314,24 @@ internal object PatchCommand : Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// region Save
|
// region Save
|
||||||
|
apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply {
|
||||||
apk.copyTo(outputFilePath, overwrite = true)
|
patcherResult.applyTo(this)
|
||||||
|
}.let { patchedApkFile ->
|
||||||
patcherResult.applyTo(outputFilePath)
|
if (!mount) {
|
||||||
|
ApkUtils.signApk(
|
||||||
if (!mount) {
|
patchedApkFile,
|
||||||
outputFilePath.sign(
|
outputFilePath,
|
||||||
ApkUtils.SigningOptions(
|
|
||||||
keystoreFilePath,
|
|
||||||
keyStorePassword,
|
|
||||||
alias,
|
|
||||||
password,
|
|
||||||
signer,
|
signer,
|
||||||
),
|
ApkUtils.KeyStoreDetails(
|
||||||
)
|
keystoreFilePath,
|
||||||
|
keyStorePassword,
|
||||||
|
keyStoreEntryAlias,
|
||||||
|
keyStoreEntryPassword,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
patchedApkFile.copyTo(outputFilePath, overwrite = true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Saved to $outputFilePath")
|
logger.info("Saved to $outputFilePath")
|
||||||
|
|||||||
Reference in New Issue
Block a user