Skip to content

Commit 32da961

Browse files
committed
feat: use separate command to patch
1 parent 8a5daab commit 32da961

File tree

12 files changed

+547
-112
lines changed

12 files changed

+547
-112
lines changed

docs/0_prerequisites.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ To use ReVanced CLI, you will need to fulfil specific requirements.
55
## 🤝 Requirements
66

77
- Java SDK 11 (Azul Zulu JDK or OpenJDK)
8-
- [Android Debug Bridge (adb)](https://developer.android.com/studio/command-line/adb) if you want to deploy the patched APK file on your device
8+
- [Android Debug Bridge (adb)](https://developer.android.com/studio/command-line/adb) if you want to install the patched APK file on your device
99
- An ABI other than ARMv7 such as x86 or x86-64 (or a custom AAPT binary that supports ARMv7)
1010
- ReVanced Patches
1111
- ReVanced Integrations, if the patches require it

docs/1_usage.md

+15-17
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Learn how to ReVanced CLI.
1010
adb shell exit
1111
```
1212

13-
If you want to deploy the patched APK file on your device by mounting it on top of the original APK file, you will need root access. This is optional.
13+
If you want to install the patched APK file on your device by mounting it on top of the original APK file, you will need root access. This is optional.
1414

1515
```bash
1616
adb shell su -c exit
@@ -33,8 +33,7 @@ Learn how to ReVanced CLI.
3333
- ### 📃 List patches from supplied patch bundles
3434

3535
```bash
36-
java -jar revanced-cli.jar \
37-
list-patches \
36+
java -jar revanced-cli.jar list-patches \
3837
--with-packages \
3938
--with-versions \
4039
--with-options \
@@ -49,40 +48,39 @@ Learn how to ReVanced CLI.
4948

5049
> **Note**: The `options.json` file will be generated at the first time you use ReVanced CLI to patch an APK file for now. This will be changed in the future.
5150
52-
- ### 💉 Use ReVanced CLI to patch an APK file but deploy without root permissions
51+
- ### 💉 Use ReVanced CLI to patch an APK file but install without root permissions
5352

54-
This will deploy the patched APK file on your device by installing it.
53+
This will install the patched APK file regularly on your device.
5554

5655
```bash
57-
java -jar revanced-cli.jar \
58-
-a input.apk \
59-
-o patched-output.apk \
56+
java -jar revanced-cli.jar patch \
6057
-b revanced-patches.jar \
61-
-d device-serial
58+
-o patched-output.apk \
59+
-d device-serial \
60+
input-apk
6261
```
6362

64-
- ### 👾 Use ReVanced CLI to patch an APK file but deploy with root permissions
63+
- ### 👾 Use ReVanced CLI to patch an APK file but install with root permissions
6564

66-
This will deploy the patched APK file on your device by mounting it on top of the original APK file.
65+
This will install the patched APK file on your device by mounting it on top of the original APK file.
6766

6867
```bash
6968
adb install input.apk
70-
java -jar revanced-cli.jar \
71-
-a input.apk \
69+
java -jar revanced-cli.jar patch \
7270
-o patched-output.apk \
7371
-b revanced-patches.jar \
74-
-e vanced-microg-support \
72+
-e some-patch \
7573
-d device-serial \
76-
--mount
74+
--mount \
75+
input-apk
7776
```
7877

7978
> **Note**: Some patches from [ReVanced Patches](https://github.com/revanced/revanced-patches) also require [ReVanced Integrations](https://github.com/revanced/revanced-integrations). Supply them with the option `-m`. ReVanced Patcher will merge ReVanced Integrations automatically, depending on if the supplied patches require them.
8079
package
8180

8281
- ### 🗑️ Uninstall a patched
8382
```bash
84-
java -jar revanced-cli.jar \
85-
uninstall \
83+
java -jar revanced-cli.jar uninstall \
8684
-p package-name \
8785
device-serial
8886
```

src/main/kotlin/app/revanced/cli/aligning/Aligning.kt

-37
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package app.revanced.cli.command
2+
3+
import app.revanced.cli.logging.impl.DefaultCliLogger
4+
import app.revanced.patcher.patch.PatchClass
5+
import picocli.CommandLine
6+
import picocli.CommandLine.Command
7+
import picocli.CommandLine.IVersionProvider
8+
import java.util.*
9+
10+
fun main(args: Array<String>) {
11+
CommandLine(Main).execute(*args)
12+
}
13+
14+
internal typealias PatchList = List<PatchClass>
15+
16+
internal val logger = DefaultCliLogger()
17+
18+
object CLIVersionProvider : IVersionProvider {
19+
override fun getVersion(): Array<String> {
20+
Properties().apply {
21+
load(Main::class.java.getResourceAsStream("/app/revanced/cli/version.properties"))
22+
}.let {
23+
return arrayOf("ReVanced CLI v${it.getProperty("version")}")
24+
}
25+
}
26+
}
27+
28+
@Command(
29+
name = "revanced-cli",
30+
description = ["Command line application to use ReVanced"],
31+
mixinStandardHelpOptions = true,
32+
versionProvider = CLIVersionProvider::class,
33+
subcommands = [
34+
ListPatchesCommand::class,
35+
PatchCommand::class,
36+
UninstallCommand::class
37+
]
38+
)
39+
internal object Main

0 commit comments

Comments
 (0)