|
1 | 1 | # 🛠️ Using ReVanced CLI
|
2 | 2 |
|
3 | 3 | Learn how to use ReVanced CLI.
|
| 4 | +The following examples will show you how to perform basic operations. |
| 5 | +You can list patches, patch an app, uninstall, and install an app. |
4 | 6 |
|
5 |
| -## 🔨 Usage |
6 |
| - |
7 |
| -ReVanced CLI is divided into the following fundamental commands: |
8 |
| - |
9 |
| -- ### 🚀 Show all available options for ReVanced CLI |
10 |
| - |
11 |
| - ```bash |
12 |
| - java -jar revanced-cli.jar -h |
13 |
| - ``` |
14 |
| - |
15 |
| -- ### 📃 List patches |
16 |
| - |
17 |
| - ```bash |
18 |
| - java -jar revanced-cli.jar list-patches \ |
19 |
| - --with-packages \ |
20 |
| - --with-versions \ |
21 |
| - --with-options \ |
22 |
| - revanced-patches.jar [<patch-bundle> ...] |
23 |
| - ``` |
24 |
| - |
25 |
| -- ### ⚙️ Generate options |
26 |
| - |
27 |
| - This will generate an `options.json` file for the patches from a list of supplied patch bundles. |
28 |
| - The file can be supplied to ReVanced CLI later on. |
29 |
| - |
30 |
| - ```bash |
31 |
| - java -jar revanced-cli.jar options \ |
32 |
| - --path options.json \ |
33 |
| - --overwrite \ |
34 |
| - revanced-patches.jar [<patch-bundle> ...] |
35 |
| - ``` |
36 |
| - |
37 |
| - > **ℹ️ Note** |
38 |
| - > A default `options.json` file will be automatically created if it does not exist |
39 |
| - > without any need for intervention when using the `patch` command. |
40 |
| -
|
41 |
| -- ### 💉 Patch an app |
42 |
| - |
43 |
| - You can patch apps by supplying patch bundles and the app to patch. |
44 |
| - After patching, ReVanced CLI can install the patched app on your device using two methods: |
45 |
| - |
46 |
| - > **💡 Tip** |
47 |
| - > For ReVanced CLI to be able to install the patched app on your device, make sure ADB is working: |
48 |
| - > |
49 |
| - > ```bash |
50 |
| - > adb shell exit |
51 |
| - > ``` |
52 |
| - > |
53 |
| - > If you want to mount the patched app on top of the un-patched app, make sure you have root permissions: |
54 |
| - > |
55 |
| - > ```bash |
56 |
| - > adb shell su -c exit |
57 |
| - > ``` |
58 |
| -
|
59 |
| - > **⚠️ Warning** |
60 |
| - > Some patches may require integrations |
61 |
| - > such as [ReVanced Integrations](https://github.com/revanced/revanced-integrations). |
62 |
| - > Supply them with the option `--merge`. ReVanced Patcher will automatically determine if they are necessary. |
63 |
| -
|
64 |
| - - #### 👾 Patch an app and install it on your device regularly |
65 |
| -
|
66 |
| - ```bash |
67 |
| - java -jar revanced-cli.jar patch \ |
68 |
| - --patch-bundle revanced-patches.jar \ |
69 |
| - -d \ |
70 |
| - input.apk |
71 |
| - ``` |
72 |
| -
|
73 |
| - - #### 👾 Patch an app and mount it on top of the un-patched app with root permissions |
74 |
| -
|
75 |
| - > **❗ Caution** |
76 |
| - > Ensure that the same app you are patching and mounting over is installed on your device: |
77 |
| - > |
78 |
| - > ```bash |
79 |
| - > adb install app.apk |
80 |
| - > ``` |
81 |
| -
|
82 |
| - ```bash |
83 |
| - java -jar revanced-cli.jar patch \ |
84 |
| - --patch-bundle revanced-patches.jar \ |
85 |
| - --include "Some patch" \ |
86 |
| - --ii 123 \ |
87 |
| - --exclude "Some other patch" \ |
88 |
| - -d \ |
89 |
| - --mount \ |
90 |
| - app.apk |
91 |
| - ``` |
92 |
| -
|
93 |
| - > **💡 Tip** |
94 |
| - > You can use the option `--ii` to include or `--ie` to exclude |
95 |
| - > patches by their index in relation to supplied patch bundles, |
96 |
| - > similarly to the option `--include` and `--exclude`. |
97 |
| - > |
98 |
| - > This is useful in case two patches have the same name, and you must include or exclude one. |
99 |
| - > The patch index is calculated by the position of the patch in the list of patches |
100 |
| - > from patch bundles supplied using the option `--patch-bundle`. |
101 |
| - > |
102 |
| - > You can list all patches with their indices using the command `list-patches`. |
103 |
| - > |
104 |
| - > Keep in mind that the indices can change based on the order of the patch bundles supplied, |
105 |
| - > as well if the patch bundles are updated because patches can be added or removed. |
106 |
| -
|
107 |
| -- ### 🗑️ Uninstall an app |
108 |
| -
|
109 |
| - ```bash |
110 |
| - java -jar revanced-cli.jar utility uninstall \ |
111 |
| - --package-name <package-name> \ |
112 |
| - [<device-serial>] |
113 |
| - ``` |
114 |
| -
|
115 |
| - > **💡 Tip** |
116 |
| - > You can unmount an APK file |
117 |
| - > by adding the option `--unmount`. |
118 |
| -
|
119 |
| -- ### ️ 📦 Install an app |
120 |
| -
|
121 |
| - ```bash |
122 |
| - java -jar revanced-cli.jar utility install \ |
123 |
| - -a input.apk \ |
124 |
| - [<device-serial>] |
125 |
| - ``` |
126 |
| -
|
127 |
| - > **💡 Tip** |
128 |
| - > You can mount an APK file |
129 |
| - > by supplying the app's package name to mount the supplied APK file over the option `--mount`. |
| 7 | +## 🚀 Show all commands |
| 8 | + |
| 9 | +```bash |
| 10 | +java -jar revanced-cli.jar -h |
| 11 | +``` |
| 12 | + |
| 13 | +## 📃 List patches |
| 14 | + |
| 15 | +```bash |
| 16 | +java -jar revanced-cli.jar list-patches --with-descriptions --with-packages --with-versions --with-options --with-universal-patches revanced-patches.rvp |
| 17 | +``` |
| 18 | + |
| 19 | +## 💉 Patch an app with the default list of patches |
| 20 | + |
| 21 | +```bash |
| 22 | +java -jar revanced-cli.jar patch -b revanced-patches.rvp input.apk |
| 23 | +``` |
| 24 | + |
| 25 | +You can also use multiple patch bundles: |
| 26 | + |
| 27 | +```bash |
| 28 | +java -jar revanced-cli.jar patch -b revanced-patches.rvp -b another-patches.rvp input.apk |
| 29 | +``` |
| 30 | + |
| 31 | +To manually include or exclude patches, use the options `-i` and `-e`. |
| 32 | +Keep in mind the name of the patch must be an exact match. |
| 33 | +You can also use the options `--ii` and `--ie` to include or exclude patches by their index |
| 34 | +if two patches have the same name. |
| 35 | +To know the indices of patches, use the option `--with-indices` when listing patches: |
| 36 | + |
| 37 | +```bash |
| 38 | +java -jar revanced-cli.jar list-patches --with-indices revanced-patches.rvp |
| 39 | +``` |
| 40 | + |
| 41 | +Then you can use the indices to include or exclude patches: |
| 42 | + |
| 43 | +```bash |
| 44 | +java -jar revanced-cli.jar patch -b revanced-patches.rvp --ii 123 --ie 456 input.apk |
| 45 | +``` |
| 46 | + |
| 47 | +> [!TIP] |
| 48 | +> You can use the option `-d` to automatically install the patched app after patching. |
| 49 | +> Make sure ADB is working: |
| 50 | +> |
| 51 | +> ```bash |
| 52 | +> adb shell exit |
| 53 | +> ``` |
| 54 | +
|
| 55 | +
|
| 56 | +> [!TIP] |
| 57 | +> You can use the option `--mount` to mount the patched app on top of the un-patched app. |
| 58 | +> Make sure you have root permissions and the same app you are patching and mounting over is installed on your device: |
| 59 | +> |
| 60 | +> ```bash |
| 61 | +> adb shell su -c exit |
| 62 | +> adb install input.apk |
| 63 | +> ``` |
| 64 | +
|
| 65 | +## 📦 Install an app manually |
| 66 | +
|
| 67 | +```bash |
| 68 | +java -jar revanced-cli.jar utility install -a input.apk |
| 69 | +``` |
| 70 | +
|
| 71 | +> [!TIP] |
| 72 | +> You can use the option `--mount` to mount the patched app on top of the un-patched app. |
| 73 | +> Make sure you have root permissions and the same app you are patching and mounting over is installed on your device: |
| 74 | +> |
| 75 | +> ```bash |
| 76 | +> adb shell su -c exit |
| 77 | +> adb install input.apk |
| 78 | +> ``` |
| 79 | +
|
| 80 | +## 🗑️ Uninstall an app manually |
| 81 | +
|
| 82 | +Here `<package-name>` is the package name of the app you want to uninstall: |
| 83 | +
|
| 84 | +```bash |
| 85 | +java -jar revanced-cli.jar utility uninstall --package-name <package-name> |
| 86 | +``` |
| 87 | +
|
| 88 | +If the app is mounted, you need to unmount it by using the option `--unmount`: |
| 89 | + |
| 90 | +```bash |
| 91 | +java -jar revanced-cli.jar utility uninstall --package-name <package-name> --unmount |
| 92 | +``` |
| 93 | + |
| 94 | +> [!TIP] |
| 95 | +> By default, the app is installed or uninstalled to the first connected device. |
| 96 | +> You can append one or more devices by their serial to install or uninstall an app on your selected choice of devices: |
| 97 | +> |
| 98 | +> ```bash |
| 99 | +> java -jar revanced-cli.jar utility uninstall --package-name <package-name> [<device-serial> ...] |
| 100 | +> ``` |
0 commit comments