2023-05-08 01:20:20 +02:00
|
|
|
|
# 🛠️ Using ReVanced CLI
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
2023-05-08 01:20:20 +02:00
|
|
|
|
Learn how to ReVanced CLI.
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
2023-06-30 19:40:52 +02:00
|
|
|
|
## ⚡ Setup ADB
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
2023-06-30 19:40:52 +02:00
|
|
|
|
1. Ensure that ADB is working
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
adb shell exit
|
|
|
|
|
```
|
|
|
|
|
|
2023-08-23 03:53:24 +02:00
|
|
|
|
Optionally, you can install the patched APK file on your device by mounting it on top of the original APK file.
|
|
|
|
|
You will need root permissions for this. Check if you have root permissions by running the following command:
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
adb shell su -c exit
|
|
|
|
|
```
|
|
|
|
|
|
2023-08-23 05:39:31 +02:00
|
|
|
|
2. Get your device's serial
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
adb devices
|
|
|
|
|
```
|
|
|
|
|
|
2023-06-30 19:40:52 +02:00
|
|
|
|
## 🔨 Using ReVanced CLI
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
2023-06-30 19:40:52 +02:00
|
|
|
|
- ### ⚙️ Show all available options for ReVanced CLI
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
java -jar revanced-cli.jar -h
|
|
|
|
|
```
|
|
|
|
|
|
2023-08-22 22:59:32 +02:00
|
|
|
|
- ### 📃 List patches from supplied patch bundles
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
2023-08-23 03:08:21 +02:00
|
|
|
|
java -jar revanced-cli.jar list-patches \
|
2023-08-22 22:59:32 +02:00
|
|
|
|
--with-packages \
|
|
|
|
|
--with-versions \
|
|
|
|
|
--with-options \
|
2023-08-23 03:53:24 +02:00
|
|
|
|
revanced-patches.jar [<patch-bundle> ...]
|
2023-01-08 14:37:10 +01:00
|
|
|
|
```
|
|
|
|
|
|
2023-08-23 03:35:38 +02:00
|
|
|
|
- ### ⚙️ Generate options from patches using ReVanced CLI
|
|
|
|
|
|
2023-08-23 03:53:24 +02:00
|
|
|
|
This will generate an `options.json` file for the patches from a list of supplied patch bundles.
|
|
|
|
|
The file can be supplied to ReVanced CLI later on.
|
2023-08-23 03:35:38 +02:00
|
|
|
|
|
|
|
|
|
- ```bash
|
|
|
|
|
java -jar revanced-cli.jar options \
|
2023-08-23 03:53:24 +02:00
|
|
|
|
--path options.json \
|
2023-08-23 03:35:38 +02:00
|
|
|
|
--overwrite \
|
2023-08-23 03:53:24 +02:00
|
|
|
|
revanced-patches.jar [<patch-bundle> ...]
|
2023-08-23 03:35:38 +02:00
|
|
|
|
```
|
2023-08-22 23:35:02 +02:00
|
|
|
|
|
2023-08-23 03:35:38 +02:00
|
|
|
|
> **Note**: A default `options.json` file will be automatically generated, if it does not exist
|
2023-08-23 05:39:31 +02:00
|
|
|
|
without any need for intervention when using the `patch` command.
|
2023-08-22 23:35:02 +02:00
|
|
|
|
|
2023-08-23 03:08:21 +02:00
|
|
|
|
- ### 💉 Use ReVanced CLI to patch an APK file but install without root permissions
|
2023-06-30 19:40:52 +02:00
|
|
|
|
|
2023-08-23 03:08:21 +02:00
|
|
|
|
This will install the patched APK file regularly on your device.
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
2023-08-23 03:08:21 +02:00
|
|
|
|
java -jar revanced-cli.jar patch \
|
2023-08-23 03:53:24 +02:00
|
|
|
|
--patch-bundle revanced-patches.jar \
|
|
|
|
|
--out output.apk \
|
|
|
|
|
--device-serial <device-serial> \
|
|
|
|
|
input.apk
|
2023-01-08 14:37:10 +01:00
|
|
|
|
```
|
|
|
|
|
|
2023-08-23 03:08:21 +02:00
|
|
|
|
- ### 👾 Use ReVanced CLI to patch an APK file but install with root permissions
|
2023-06-30 19:40:52 +02:00
|
|
|
|
|
2023-08-23 03:08:21 +02:00
|
|
|
|
This will install the patched APK file on your device by mounting it on top of the original APK file.
|
2023-01-08 14:37:10 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
2023-06-30 19:40:52 +02:00
|
|
|
|
adb install input.apk
|
2023-08-23 03:08:21 +02:00
|
|
|
|
java -jar revanced-cli.jar patch \
|
2023-08-23 03:53:24 +02:00
|
|
|
|
--patch-bundle revanced-patches.jar \
|
|
|
|
|
--include some-other-patch \
|
|
|
|
|
--exclude some-patch \
|
|
|
|
|
--out patched-output.apk \
|
|
|
|
|
--device-serial <device-serial> \
|
2023-08-23 03:08:21 +02:00
|
|
|
|
--mount \
|
2023-08-23 03:53:24 +02:00
|
|
|
|
input.apk
|
2023-01-08 14:37:10 +01:00
|
|
|
|
```
|
|
|
|
|
|
2023-08-23 03:53:24 +02:00
|
|
|
|
> **Note**: Some patches may require integrations
|
|
|
|
|
such as [ReVanced Integrations](https://github.com/revanced/revanced-integrations).
|
2023-08-24 16:50:10 +02:00
|
|
|
|
Supply them with the option `--merge`. If any patches accepted by ReVanced Patcher require ReVanced Integrations,
|
2023-08-23 03:53:24 +02:00
|
|
|
|
they will be merged into the APK file automatically.
|
2023-06-30 19:40:52 +02:00
|
|
|
|
|
2023-08-23 05:39:31 +02:00
|
|
|
|
- ### 🗑️ Uninstall a patched APK file
|
2023-08-22 23:35:02 +02:00
|
|
|
|
```bash
|
2023-08-24 16:50:10 +02:00
|
|
|
|
java -jar revanced-cli.jar utility uninstall \
|
2023-08-23 03:53:24 +02:00
|
|
|
|
--package-name <package-name> \
|
|
|
|
|
<device-serial>
|
2023-08-22 23:35:02 +02:00
|
|
|
|
```
|
2023-08-24 16:50:10 +02:00
|
|
|
|
|
|
|
|
|
> **Note**: You can unmount an APK file
|
|
|
|
|
with the option `--unmount`.
|
|
|
|
|
|
|
|
|
|
- ### ️ ⚙️ Manually install an APK file
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
java -jar revanced-cli.jar utility install \
|
|
|
|
|
-a input.apk \
|
|
|
|
|
<device-serial>
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
> **Note**: You can mount an APK file
|
|
|
|
|
by supplying the package name of the app to mount the supplied APK file to over the option `--mount`.
|