Compare commits

...

25 Commits

Author SHA1 Message Date
semantic-release-bot
94b9e2bc6c chore: Release v5.0.0-dev.9 [skip ci]
# [5.0.0-dev.9](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.8...v5.0.0-dev.9) (2024-11-05)

### Bug Fixes

* Print in new line correctly ([c2dc9d7](c2dc9d76be))
2024-11-05 15:55:05 +00:00
oSumAtrIX
c2dc9d76be fix: Print in new line correctly 2024-11-05 16:53:03 +01:00
oSumAtrIX
3d0c8c1526 chore: Remove unused variable 2024-10-27 05:13:31 +01:00
oSumAtrIX
b54308b0e2 docs: Fix spelling mistakes [skip ci] 2024-10-23 21:08:49 +02:00
semantic-release-bot
504c6c1ea5 chore: Release v5.0.0-dev.8 [skip ci]
# [5.0.0-dev.8](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.7...v5.0.0-dev.8) (2024-10-17)
2024-10-17 18:06:32 +00:00
oSumAtrIX
f58b101636 build(Needs bump): Bump ReVanced Patcher 2024-10-17 20:02:26 +02:00
cyberboh
292b93b609 docs: Use correct option name in command example (#342) 2024-10-16 15:27:58 +02:00
semantic-release-bot
e60a61b098 chore: Release v5.0.0-dev.7 [skip ci]
# [5.0.0-dev.7](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.6...v5.0.0-dev.7) (2024-10-16)

### Bug Fixes

* Check for null when no device serial was specified ([1da8ae9](1da8ae9e46))
2024-10-16 02:57:57 +00:00
oSumAtrIX
1da8ae9e46 fix: Check for null when no device serial was specified 2024-10-16 04:55:52 +02:00
semantic-release-bot
a9f2538827 chore: Release v5.0.0-dev.6 [skip ci]
# [5.0.0-dev.6](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.5...v5.0.0-dev.6) (2024-10-10)

### Bug Fixes

* Use the first connected device when no ADB device is specified ([5f952f3](5f952f35f5))
2024-10-10 21:05:17 +00:00
oSumAtrIX
5f952f35f5 fix: Use the first connected device when no ADB device is specified 2024-10-10 23:03:20 +02:00
oSumAtrIX
280ded2281 ci: Adjust release commit message 2024-10-01 17:30:15 +02:00
semantic-release-bot
bb6bc1ba9a chore: Release 5.0.0-dev.5 [skip ci]
# [5.0.0-dev.5](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.4...v5.0.0-dev.5) (2024-09-30)
2024-09-30 20:27:43 +00:00
oSumAtrIX
04b178b701 build(Needs bump): Update dependencies 2024-09-30 22:25:06 +02:00
oSumAtrIX
32e6aae132 ci: Adjust release commit message 2024-09-30 22:24:40 +02:00
oSumAtrIX
7ee4f15ab9 ci: Use permissions and regular GitHub token instead of PAT 2024-09-30 22:24:18 +02:00
oSumAtrIX
a7af611ef0 docs: Use correct option keys in command examples [skip ci] 2024-09-21 23:08:32 +02:00
semantic-release-bot
9440dc769e chore(release): 5.0.0-dev.4 [skip ci]
# [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](751fa1d889))
* Make the patch command work without specifying any selection ([ba159a3](ba159a35a9))

### Features

* Show error about no installation device found at the beginning ([3300e6b](3300e6b433))
2024-09-17 23:18:07 +00:00
oSumAtrIX
751fa1d889 fix: Make patches selectable by using a mutable collection for the selection option 2024-09-05 23:08:18 +04:00
oSumAtrIX
3300e6b433 feat: Show error about no installation device found at the beginning 2024-09-05 23:00:22 +04:00
oSumAtrIX
ba159a35a9 fix: Make the patch command work without specifying any selection 2024-09-05 22:54:09 +04:00
kitadai31
74ff94037e docs: List supported ABIs correctly and add a mention how to use other ones
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-09-01 16:36:34 +02:00
oSumAtrIX
7e8fb5722a docs: Link to JRE downloads instead of JDK 2024-08-23 13:21:27 +04:00
semantic-release-bot
7b4af46c94 chore(release): 5.0.0-dev.3 [skip ci]
# [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)

### Features

* Simplify option descriptions ([45c998b](45c998b335))
2024-08-14 13:36:05 +00:00
oSumAtrIX
45c998b335 feat: Simplify option descriptions 2024-08-14 15:34:02 +02:00
13 changed files with 1024 additions and 1513 deletions

View File

@@ -10,6 +10,8 @@ on:
jobs: jobs:
release: release:
name: Release name: Release
permissions:
contents: write
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -46,5 +48,5 @@ jobs:
- name: Release - name: Release
env: env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec semantic-release run: npm exec semantic-release

View File

@@ -23,7 +23,8 @@
"assets": [ "assets": [
"CHANGELOG.md", "CHANGELOG.md",
"gradle.properties" "gradle.properties"
] ],
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
} }
], ],
[ [

View File

@@ -1,3 +1,48 @@
# [5.0.0-dev.9](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.8...v5.0.0-dev.9) (2024-11-05)
### Bug Fixes
* Print in new line correctly ([c2dc9d7](https://github.com/ReVanced/revanced-cli/commit/c2dc9d76be33c98284741e23c406500483c47753))
# [5.0.0-dev.8](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.7...v5.0.0-dev.8) (2024-10-17)
# [5.0.0-dev.7](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.6...v5.0.0-dev.7) (2024-10-16)
### Bug Fixes
* Check for null when no device serial was specified ([1da8ae9](https://github.com/ReVanced/revanced-cli/commit/1da8ae9e46000dd3c4eecd793c559e75012cf535))
# [5.0.0-dev.6](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.5...v5.0.0-dev.6) (2024-10-10)
### Bug Fixes
* Use the first connected device when no ADB device is specified ([5f952f3](https://github.com/ReVanced/revanced-cli/commit/5f952f35f5cb388b6509b2b4d905b8143ebc7996))
# [5.0.0-dev.5](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.4...v5.0.0-dev.5) (2024-09-30)
# [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)
### Features
* Simplify option descriptions ([45c998b](https://github.com/ReVanced/revanced-cli/commit/45c998b335b65ac233fece8b804dc7410142691c))
# [5.0.0-dev.2](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.1...v5.0.0-dev.2) (2024-08-14) # [5.0.0-dev.2](https://github.com/ReVanced/revanced-cli/compare/v5.0.0-dev.1...v5.0.0-dev.2) (2024-08-14)

View File

@@ -63,11 +63,11 @@
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-cli/release.yml) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-cli/release.yml)
![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg) ![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)
Command line application to use ReVanced. Command-line application to use ReVanced.
## ❓ About ## ❓ About
ReVanced CLI is a command line application that uses [ReVanced Patcher](https://github.com/revanced/revanced-patcher) to patch Android apps. ReVanced CLI is a command-line application that uses [ReVanced Patcher](https://github.com/revanced/revanced-patcher) to patch Android apps.
## 💪 Features ## 💪 Features
@@ -75,7 +75,7 @@ Some of the features ReVanced CLI provides are:
- 💉 **Patch apps**: Harness ReVanced Patcher to patch Android apps - 💉 **Patch apps**: Harness ReVanced Patcher to patch Android apps
- 💾 **Install and uninstall apps**: Install and uninstall Apps via ADB, - 💾 **Install and uninstall apps**: Install and uninstall Apps via ADB,
using the Android package manager, or by mounting using root permissions using the Android package manager or by mounting using root permissions
- 📃 **List patches from patch bundles**: List available patches, compatible packages, and versions - 📃 **List patches from patch bundles**: List available patches, compatible packages, and versions
- 💪 **Flexibility and functionality**: Apply any combination of patches to any version of Android apps - 💪 **Flexibility and functionality**: Apply any combination of patches to any version of Android apps

View File

@@ -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

View File

@@ -24,10 +24,10 @@ To patch an app using the default list of patches, use the `patch` command:
java -jar revanced-cli.jar patch -p patches.rvp input.apk java -jar revanced-cli.jar patch -p patches.rvp input.apk
``` ```
You can also use multiple files containing patches: You can also use multiple RVP files:
```bash ```bash
java -jar revanced-cli.jar patch -p patches.rvp -b another-patches.rvp input.apk java -jar revanced-cli.jar patch -p patches.rvp -p another-patches.rvp input.apk
``` ```
To change the default set of enabled or disabled patches, use the option `-e` or `-d` to enable or disable specific patches. To change the default set of enabled or disabled patches, use the option `-e` or `-d` to enable or disable specific patches.
@@ -51,13 +51,13 @@ java -jar revanced-cli.jar list-patches patches.rvp
Then you can use the indices to enable or disable patches: Then you can use the indices to enable or disable patches:
```bash ```bash
java -jar revanced-cli.jar patch -b patches.rvp --ei 123 --di 456 input.apk java -jar revanced-cli.jar patch -p patches.rvp --ei 123 --di 456 input.apk
``` ```
You can combine the option `-e`, `-d`, `--ei`, `--di` and `--exclusive`. Here is an example: You can combine the option `-e`, `-d`, `--ei`, `--di` and `--exclusive`. Here is an example:
```bash ```bash
java -jar revanced-cli.jar patch -p patches.rvp --exclusive -i "Patch name" --ei 123 input.apk java -jar revanced-cli.jar patch -p patches.rvp --exclusive -e "Patch name" --ei 123 input.apk
``` ```
@@ -91,13 +91,13 @@ For example, to set the options for the patch with the name `Patch name`
with the key `key1` and `key2` to `value1` and `value2` respectively, use the following command: with the key `key1` and `key2` to `value1` and `value2` respectively, use the following command:
```bash ```bash
java -jar revanced-cli.jar patch -b patches.rvp -e "Patch name" -Okey1=value1 -Okey2=value2 input.apk java -jar revanced-cli.jar patch -p patches.rvp -e "Patch name" -Okey1=value1 -Okey2=value2 input.apk
``` ```
If you want to set the option value to `null`, you can omit the value: If you want to set the option value to `null`, you can omit the value:
```bash ```bash
java -jar revanced-cli.jar patch -b revanced-patches.rvp -i "Patch name" -Okey1 input.apk java -jar revanced-cli.jar patch -p patches.rvp -i "Patch name" -Okey1 input.apk
``` ```
> [!WARNING] > [!WARNING]

View File

@@ -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.2 version = 5.0.0-dev.9

View File

@@ -1,9 +1,9 @@
[versions] [versions]
shadow = "8.1.1" shadow = "8.1.1"
kotlin = "2.0.0" kotlin = "2.0.20"
kotlinx = "1.8.1" kotlinx = "1.8.1"
picocli = "4.7.6" picocli = "4.7.6"
revanced-patcher = "20.0.0" revanced-patcher = "20.0.2"
revanced-library = "3.0.0" revanced-library = "3.0.0"
[libraries] [libraries]

2387
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
"@saithodev/semantic-release-backmerge": "^4.0.1", "@saithodev/semantic-release-backmerge": "^4.0.1",
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"gradle-semantic-release-plugin": "^1.9.1", "gradle-semantic-release-plugin": "^1.10.1",
"semantic-release": "^23.0.8" "semantic-release": "^24.1.2"
} }
} }

View File

@@ -12,14 +12,14 @@ import java.util.logging.Logger
name = "list-versions", name = "list-versions",
description = [ description = [
"List the most common compatible versions of apps that are compatible " + "List the most common compatible versions of apps that are compatible " +
"with the patches in the supplied files containing patches.", "with the patches from RVP files.",
], ],
) )
internal class ListCompatibleVersions : Runnable { internal class ListCompatibleVersions : Runnable {
private val logger = Logger.getLogger(this::class.java.name) private val logger = Logger.getLogger(this::class.java.name)
@CommandLine.Parameters( @CommandLine.Parameters(
description = ["One or more paths to files containing patches."], description = ["Paths to RVP files."],
arity = "1..*", arity = "1..*",
) )
private lateinit var patchesFiles: Set<File> private lateinit var patchesFiles: Set<File>

View File

@@ -11,13 +11,13 @@ import app.revanced.patcher.patch.Option as PatchOption
@Command( @Command(
name = "list-patches", name = "list-patches",
description = ["List patches from supplied files containing patches."], description = ["List patches from supplied RVP files."],
) )
internal object ListPatchesCommand : Runnable { internal object ListPatchesCommand : Runnable {
private val logger = Logger.getLogger(this::class.java.name) private val logger = Logger.getLogger(this::class.java.name)
@Parameters( @Parameters(
description = ["One or more paths to files containing patches."], description = ["Paths to RVP files."],
arity = "1..*", arity = "1..*",
) )
private lateinit var patchesFiles: Set<File> private lateinit var patchesFiles: Set<File>
@@ -59,7 +59,7 @@ internal object ListPatchesCommand : Runnable {
@Option( @Option(
names = ["-i", "--index"], names = ["-i", "--index"],
description = ["List the index of each patch in relation to the supplied files containing patches."], description = ["List the index of each patch in relation to the supplied RVP files."],
showDefaultValue = ALWAYS, showDefaultValue = ALWAYS,
) )
private var withIndex: Boolean = true private var withIndex: Boolean = true
@@ -111,7 +111,7 @@ internal object ListPatchesCommand : Runnable {
if (withDescriptions) append("\nDescription: ${patch.description}") if (withDescriptions) append("\nDescription: ${patch.description}")
append("Enabled: ${patch.use}") append("\nEnabled: ${patch.use}")
if (withOptions && patch.options.isNotEmpty()) { if (withOptions && patch.options.isNotEmpty()) {
appendLine("\nOptions:") appendLine("\nOptions:")

View File

@@ -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")
@@ -50,7 +50,7 @@ internal object PatchCommand : Runnable {
@CommandLine.Option( @CommandLine.Option(
names = ["--ei"], names = ["--ei"],
description = ["Index of the patch in the combined list of all supplied files containing patches."], description = ["Index of the patch in the combined list of the supplied RVP files."],
required = true, required = true,
) )
internal var index: Int? = null internal var index: Int? = null
@@ -82,7 +82,7 @@ internal object PatchCommand : Runnable {
@CommandLine.Option( @CommandLine.Option(
names = ["--di"], names = ["--di"],
description = ["Index of the patch in the combined list of all supplied files containing patches."], description = ["Index of the patch in the combined list of the supplied RVP files."],
required = true, required = true,
) )
internal var index: Int? = null internal var index: Int? = null
@@ -200,7 +200,7 @@ internal object PatchCommand : Runnable {
@CommandLine.Option( @CommandLine.Option(
names = ["-p", "--patches"], names = ["-p", "--patches"],
description = ["One or more path to files containing patches."], description = ["One or more path to RVP files."],
required = true, required = true,
) )
@Suppress("unused") @Suppress("unused")
@@ -245,6 +245,34 @@ internal object PatchCommand : Runnable {
keyStoreFilePath ?: outputFilePath.parentFile keyStoreFilePath ?: outputFilePath.parentFile
.resolve("${outputFilePath.nameWithoutExtension}.keystore") .resolve("${outputFilePath.nameWithoutExtension}.keystore")
val installer = if (deviceSerial != null) {
val deviceSerial = deviceSerial!!.ifEmpty { null }
try {
if (mount) {
AdbRootInstaller(deviceSerial)
} else {
AdbInstaller(deviceSerial)
}
} catch (e: DeviceNotFoundException) {
if (deviceSerial?.isNotEmpty() == true) {
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
@@ -329,16 +357,8 @@ internal object PatchCommand : Runnable {
// region Install. // region Install.
deviceSerial?.let { deviceSerial?.let {
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!!