Skip to content

Commit 6e7797a

Browse files
authored
feat: Simplify command and option names and descriptions (#338)
BREAKING CHANGE: Options have been renamed.
1 parent 6306b1a commit 6e7797a

File tree

6 files changed

+100
-98
lines changed

6 files changed

+100
-98
lines changed

docs/1_usage.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,56 @@ java -jar revanced-cli.jar -h
1313
## 📃 List patches
1414

1515
```bash
16-
java -jar revanced-cli.jar list-patches --with-packages --with-versions --with-options revanced-patches.rvp
16+
java -jar revanced-cli.jar list-patches --with-packages --with-versions --with-options patches.rvp
1717
```
1818

1919
## 💉 Patch an app
2020

2121
To patch an app using the default list of patches, use the `patch` command:
2222

2323
```bash
24-
java -jar revanced-cli.jar patch -b revanced-patches.rvp input.apk
24+
java -jar revanced-cli.jar patch -p patches.rvp input.apk
2525
```
2626

27-
You can also use multiple patch bundles:
27+
You can also use multiple files containing patches:
2828

2929
```bash
30-
java -jar revanced-cli.jar patch -b revanced-patches.rvp -b another-patches.rvp input.apk
30+
java -jar revanced-cli.jar patch -p patches.rvp -b another-patches.rvp input.apk
3131
```
3232

33-
To change the default set of used patches, use the option `-i` or `-e` to use or disuse specific patches.
34-
You can use the `list-patches` command to see which patches are used by default.
33+
To change the default set of enabled or disabled patches, use the option `-e` or `-d` to enable or disable specific patches.
34+
You can use the `list-patches` command to see which patches are enabled by default.
3535

36-
To only use specific patches, you can use the option `--exclusive` combined with `-i`.
37-
Remember that the options `-i` and `-e` match the patch's name exactly. Here is an example:
36+
To only enable specific patches, you can use the option `--exclusive` combined with `-e`.
37+
Remember that the options `-e` and `-d` match the patch's name exactly. Here is an example:
3838

3939
```bash
40-
java -jar revanced-cli.jar patch -b revanced-patches.rvp --exclusive -i "Patch name" -i "Another patch name" input.apk
40+
java -jar revanced-cli.jar patch -p patches.rvp --exclusive -e "Patch name" -e "Another patch name" input.apk
4141
```
4242

43-
You can also use the options `--ii` and `--ie` to use or disuse patches by their index.
44-
This is useful, if two patches happen to have the same name.
43+
You can also use the options `--ei` or `--di` to enable or disable patches by their index.
44+
This is useful, if two patches happen to have the same name, or if typing the names is too cumbersome.
4545
To know the indices of patches, use the command `list-patches`:
4646

4747
```bash
48-
java -jar revanced-cli.jar list-patches revanced-patches.rvp
48+
java -jar revanced-cli.jar list-patches patches.rvp
4949
```
5050

51-
Then you can use the indices to use or disuse patches:
51+
Then you can use the indices to enable or disable patches:
5252

5353
```bash
54-
java -jar revanced-cli.jar patch -b revanced-patches.rvp --ii 123 --ie 456 input.apk
54+
java -jar revanced-cli.jar patch -b patches.rvp --ei 123 --di 456 input.apk
5555
```
5656

57-
You can combine the option `-i`, `-e`, `--ii`, `--ie` and `--exclusive`. Here is an example:
57+
You can combine the option `-e`, `-d`, `--ei`, `--di` and `--exclusive`. Here is an example:
5858

5959
```bash
60-
java -jar revanced-cli.jar patch -b revanced-patches.rvp --exclusive -i "Patch name" --ii 123 input.apk
60+
java -jar revanced-cli.jar patch -p patches.rvp --exclusive -i "Patch name" --ei 123 input.apk
6161
```
6262

6363

6464
> [!TIP]
65-
> You can use the option `-d` to automatically install the patched app after patching.
65+
> You can use the option `-i` to automatically install the patched app after patching.
6666
> Make sure ADB is working:
6767
>
6868
> ```bash
@@ -83,26 +83,26 @@ Patches can have options you can set using the option `-O` alongside the option
8383
To know the options of a patch, use the option `--with-options` when listing patches:
8484
8585
```bash
86-
java -jar revanced-cli.jar list-patches --with-options revanced-patches.rvp
86+
java -jar revanced-cli.jar list-patches --with-options patches.rvp
8787
```
8888
8989
Each patch can have multiple options. You can set them using the option `-O`.
9090
For example, to set the options for the patch with the name `Patch name`
9191
with the key `key1` and `key2` to `value1` and `value2` respectively, use the following command:
9292

9393
```bash
94-
java -jar revanced-cli.jar patch -b revanced-patches.rvp -i "Patch name" -Okey1=value1 -Okey2=value2 input.apk
94+
java -jar revanced-cli.jar patch -b patches.rvp -e "Patch name" -Okey1=value1 -Okey2=value2 input.apk
9595
```
9696

97-
If you want to set a value to `null`, you can omit the value:
97+
If you want to set the option value to `null`, you can omit the value:
9898

9999
```bash
100100
java -jar revanced-cli.jar patch -b revanced-patches.rvp -i "Patch name" -Okey1 input.apk
101101
```
102102

103103
> [!WARNING]
104104
> Option values are usually typed. If you set a value with the wrong type, the patch can fail.
105-
> Option value types can be seen when listing patches with the option `--with-options`.
105+
> The value types can be seen when listing patches with the option `--with-options`.
106106
>
107107
> Example option values:
108108
>
@@ -131,7 +131,7 @@ java -jar revanced-cli.jar patch -b revanced-patches.rvp -i "Patch name" -Okey1
131131
> Example command with an escaped integer as a string:
132132
>
133133
> ```bash
134-
> java -jar revanced-cli.jar -b revanced-patches.rvp -i "Patch name" -OstringKey=\'1\' input.apk
134+
> java -jar revanced-cli.jar -p patches.rvp -e "Patch name" -OstringKey=\'1\' input.apk
135135
> ```
136136
## 📦 Install an app manually
137137

src/main/kotlin/app/revanced/cli/command/ListCompatibleVersions.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ import java.util.logging.Logger
1212
name = "list-versions",
1313
description = [
1414
"List the most common compatible versions of apps that are compatible " +
15-
"with the patches in the supplied patch bundles.",
15+
"with the patches in the supplied files containing patches.",
1616
],
1717
)
1818
internal class ListCompatibleVersions : Runnable {
1919
private val logger = Logger.getLogger(this::class.java.name)
2020

2121
@CommandLine.Parameters(
22-
description = ["Paths to patch bundles."],
22+
description = ["One or more paths to files containing patches."],
2323
arity = "1..*",
2424
)
25-
private lateinit var patchBundles: Set<File>
25+
private lateinit var patchesFiles: Set<File>
2626

2727
@CommandLine.Option(
2828
names = ["-f", "--filter-package-names"],
@@ -56,7 +56,7 @@ internal class ListCompatibleVersions : Runnable {
5656
appendLine(versions.buildVersionsString().prependIndent("\t"))
5757
}
5858

59-
val patches = loadPatchesFromJar(patchBundles)
59+
val patches = loadPatchesFromJar(patchesFiles)
6060

6161
patches.mostCommonCompatibleVersions(
6262
packageNames,

src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ import app.revanced.patcher.patch.Option as PatchOption
1111

1212
@Command(
1313
name = "list-patches",
14-
description = ["List patches from supplied patch bundles."],
14+
description = ["List patches from supplied files containing patches."],
1515
)
1616
internal object ListPatchesCommand : Runnable {
1717
private val logger = Logger.getLogger(this::class.java.name)
1818

1919
@Parameters(
20-
description = ["Paths to patch bundles."],
20+
description = ["One or more paths to files containing patches."],
2121
arity = "1..*",
2222
)
23-
private lateinit var patchBundles: Set<File>
23+
private lateinit var patchesFiles: Set<File>
2424

2525
@Option(
2626
names = ["-d", "--with-descriptions"],
@@ -59,7 +59,7 @@ internal object ListPatchesCommand : Runnable {
5959

6060
@Option(
6161
names = ["-i", "--index"],
62-
description = ["List the index of each patch in relation to the supplied patch bundles."],
62+
description = ["List the index of each patch in relation to the supplied files containing patches."],
6363
showDefaultValue = ALWAYS,
6464
)
6565
private var withIndex: Boolean = true
@@ -111,6 +111,8 @@ internal object ListPatchesCommand : Runnable {
111111

112112
if (withDescriptions) append("\nDescription: ${patch.description}")
113113

114+
append("Enabled: ${patch.use}")
115+
114116
if (withOptions && patch.options.isNotEmpty()) {
115117
appendLine("\nOptions:")
116118
append(
@@ -135,7 +137,7 @@ internal object ListPatchesCommand : Runnable {
135137
compatiblePackages?.any { (compatiblePackageName, _) -> compatiblePackageName == name }
136138
?: withUniversalPatches
137139

138-
val patches = loadPatchesFromJar(patchBundles).withIndex().toList()
140+
val patches = loadPatchesFromJar(patchesFiles).withIndex().toList()
139141

140142
val filtered =
141143
packageName?.let { patches.filter { (_, patch) -> patch.filterCompatiblePackages(it) } } ?: patches

0 commit comments

Comments
 (0)