mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-18 08:53:58 +00:00
Compare commits
6 Commits
v5.0.0-dev
...
v5.0.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9440dc769e | ||
|
|
751fa1d889 | ||
|
|
3300e6b433 | ||
|
|
ba159a35a9 | ||
|
|
74ff94037e | ||
|
|
7e8fb5722a |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
|||||||
|
# [5.0.0-dev.4](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.3...v5.0.0-dev.4) (2024-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Make patches selectable by using a mutable collection for the selection option ([751fa1d](https://github.com/ReVanced/revanced-cli/commit/751fa1d889f40c51b291116029fd84f2b051f2f0))
|
||||||
|
* Make the patch command work without specifying any selection ([ba159a3](https://github.com/ReVanced/revanced-cli/commit/ba159a35a9a99d18a4c1e04128b08ae336a49b3e))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Show error about no installation device found at the beginning ([3300e6b](https://github.com/ReVanced/revanced-cli/commit/3300e6b4333ed1c4e6785cb82eca9016fc6d4a20))
|
||||||
|
|
||||||
# [5.0.0-dev.3](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.2...v5.0.0-dev.3) (2024-08-14)
|
# [5.0.0-dev.3](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.2...v5.0.0-dev.3) (2024-08-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ To use ReVanced CLI, you will need to fulfill specific requirements.
|
|||||||
|
|
||||||
## 🤝 Requirements
|
## 🤝 Requirements
|
||||||
|
|
||||||
- Java Runtime Environment 11 ([Azul Zulu JRE](https://www.azul.com/downloads/?version=java-11-lts&package=jdk#zulu) or [OpenJDK](https://jdk.java.net/archive/))
|
- Java Runtime Environment 11 ([Azul Zulu JRE](https://www.azul.com/downloads/?version=java-11-lts&package=jre#zulu) or [OpenJDK](https://jdk.java.net/archive/))
|
||||||
- [Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb) if you want to install the patched APK file on your device
|
- [Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb) if you want to install the patched APK file on your device
|
||||||
- An ABI other than ARMv7 such as x86 or x86-64 (or a custom AAPT binary that supports ARMv7)
|
- x86 or x86-64 (For [other architectures](https://github.com/ReVanced/revanced-manager/tree/main/android/app/src/main/jniLibs) use the `--custom-aapt2-binary` option)
|
||||||
|
|
||||||
## ⏭️ Whats next
|
## ⏭️ Whats next
|
||||||
|
|
||||||
|
|||||||
@@ -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 = 5.0.0-dev.3
|
version = 5.0.0-dev.4
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ internal object PatchCommand : Runnable {
|
|||||||
private lateinit var spec: CommandSpec
|
private lateinit var spec: CommandSpec
|
||||||
|
|
||||||
@ArgGroup(multiplicity = "0..*")
|
@ArgGroup(multiplicity = "0..*")
|
||||||
private lateinit var selection: Set<Selection>
|
private var selection = mutableSetOf<Selection>()
|
||||||
|
|
||||||
internal class Selection {
|
internal class Selection {
|
||||||
@ArgGroup(exclusive = false, multiplicity = "1")
|
@ArgGroup(exclusive = false, multiplicity = "1")
|
||||||
@@ -245,6 +245,32 @@ internal object PatchCommand : Runnable {
|
|||||||
keyStoreFilePath ?: outputFilePath.parentFile
|
keyStoreFilePath ?: outputFilePath.parentFile
|
||||||
.resolve("${outputFilePath.nameWithoutExtension}.keystore")
|
.resolve("${outputFilePath.nameWithoutExtension}.keystore")
|
||||||
|
|
||||||
|
val installer = if (deviceSerial != null) {
|
||||||
|
try {
|
||||||
|
if (mount) {
|
||||||
|
AdbRootInstaller(deviceSerial)
|
||||||
|
} else {
|
||||||
|
AdbInstaller(deviceSerial)
|
||||||
|
}
|
||||||
|
} catch (e: DeviceNotFoundException) {
|
||||||
|
if (deviceSerial!!.isNotEmpty()) {
|
||||||
|
logger.severe(
|
||||||
|
"Device with serial $deviceSerial not found to install to. " +
|
||||||
|
"Ensure the device is connected and the serial is correct when using the --install option.",
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
logger.severe(
|
||||||
|
"No device has been found to install to. " +
|
||||||
|
"Ensure a device is connected when using the --install option.",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Load patches
|
// region Load patches
|
||||||
@@ -332,13 +358,7 @@ internal object PatchCommand : Runnable {
|
|||||||
val deviceSerial = it.ifEmpty { null }
|
val deviceSerial = it.ifEmpty { null }
|
||||||
|
|
||||||
runBlocking {
|
runBlocking {
|
||||||
val result = if (mount) {
|
when (val result = installer!!.install(Installer.Apk(outputFilePath, packageName))) {
|
||||||
AdbRootInstaller(deviceSerial)
|
|
||||||
} else {
|
|
||||||
AdbInstaller(deviceSerial)
|
|
||||||
}.install(Installer.Apk(outputFilePath, packageName))
|
|
||||||
|
|
||||||
when (result) {
|
|
||||||
RootInstallerResult.FAILURE -> logger.severe("Failed to mount the patched APK file")
|
RootInstallerResult.FAILURE -> logger.severe("Failed to mount the patched APK file")
|
||||||
is AdbInstallerResult.Failure -> logger.severe(result.exception.toString())
|
is AdbInstallerResult.Failure -> logger.severe(result.exception.toString())
|
||||||
else -> logger.info("Installed the patched APK file")
|
else -> logger.info("Installed the patched APK file")
|
||||||
@@ -366,14 +386,14 @@ internal object PatchCommand : Runnable {
|
|||||||
packageVersion: String,
|
packageVersion: String,
|
||||||
): Set<Patch<*>> = buildSet {
|
): Set<Patch<*>> = buildSet {
|
||||||
val enabledPatchesByName =
|
val enabledPatchesByName =
|
||||||
selection.asSequence().mapNotNull { it.enabled?.selector?.name }.toSet()
|
selection.mapNotNull { it.enabled?.selector?.name }.toSet()
|
||||||
val enabledPatchesByIndex =
|
val enabledPatchesByIndex =
|
||||||
selection.asSequence().mapNotNull { it.enabled?.selector?.index }.toSet()
|
selection.mapNotNull { it.enabled?.selector?.index }.toSet()
|
||||||
|
|
||||||
val disabledPatches =
|
val disabledPatches =
|
||||||
selection.asSequence().mapNotNull { it.disable?.selector?.name }.toSet()
|
selection.mapNotNull { it.disable?.selector?.name }.toSet()
|
||||||
val disabledPatchesByIndex =
|
val disabledPatchesByIndex =
|
||||||
selection.asSequence().mapNotNull { it.disable?.selector?.index }.toSet()
|
selection.mapNotNull { it.disable?.selector?.index }.toSet()
|
||||||
|
|
||||||
this@filterPatchSelection.withIndex().forEach patchLoop@{ (i, patch) ->
|
this@filterPatchSelection.withIndex().forEach patchLoop@{ (i, patch) ->
|
||||||
val patchName = patch.name!!
|
val patchName = patch.name!!
|
||||||
|
|||||||
Reference in New Issue
Block a user