Learn how to use ReVanced CLI. The following examples will show you how to perform basic operations. You can list patches, patch an app, uninstall, and install an app.
Note
For demonstrative purposes, -b is used to
bypass patches signature and build provenance verification for some commands.
java -jar revanced-cli.jar -hjava -jar revanced-cli.jar list-patches --packages --versions --options -bp patches.rvpTo patch an app using the default list of patches, use the patch command.
java -jar revanced-cli.jar patch -bp patches.rvp input.apkYou can also use multiple RVP files:
java -jar revanced-cli.jar patch -bp patches.rvp -bp another-patches.rvp input.apkTo change the default set of enabled or disabled patches, use the option -e or -d to enable or
disable specific patches.
You can use the list-patches command to see which patches are enabled by default.
To only enable specific patches, you can use the option --exclusive combined with -e.
Remember that the options -e and -d match the patch's name exactly. Here is an example:
java -jar revanced-cli.jar patch -bp patches.rvp --exclusive -e "Patch name" -e "Another patch name" input.apkYou can also use the options --ei or --di to enable or disable patches by their index.
This is useful, if two patches happen to have the same name, or if typing the names is too
cumbersome.
To know the indices of patches, use the command list-patches:
java -jar revanced-cli.jar list-patches -bp patches.rvpThen you can use the indices to enable or disable patches:
java -jar revanced-cli.jar patch -bp patches.rvp --ei 123 --di 456 input.apkYou can combine the option -e, -d, --ei, --di and --exclusive. Here is an example:
java -jar revanced-cli.jar patch -bp patches.rvp --exclusive -e "Patch name" --ei 123 input.apkTip
You can use the option -i to automatically install the patched app after patching.
Make sure ADB is working:
adb shell exitTip
You can use the option --mount to mount the patched app on top of the un-patched app.
Make sure you have root permissions and the same app you are patching and mounting over is
installed on your device:
adb shell su -c exit
adb install input.apkPatches can have options you can set using the option -O alongside the option to include the patch
by name or index.
To know the options of a patch, use the option --options when listing patches:
java -jar revanced-cli.jar list-patches --options -bp patches.rvpEach patch can have multiple options. You can set them using the option -O.
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:
java -jar revanced-cli.jar patch -bp patches.rvp -e "Patch name" -Okey1=value1 -Okey2=value2 input.apkIf you want to set the option value to null, you can omit the value:
java -jar revanced-cli.jar patch -bp patches.rvp -i "Patch name" -Okey1 input.apkWarning
Option values are usually typed. If you set a value with the wrong type, the patch can fail.
The value types can be seen when listing patches with the option --options.
Example option values:
- String:
string - Boolean:
true,false - Integer:
123 - Double:
1.0 - Float:
1.0f - Long:
1234567890,1L - List:
[item1,item2,item3] - List of type
Any:[item1,123,true,1.0] - Empty list of type
Any:[] - Typed empty list:
int[] - Typed and nested empty list:
[int[]] - List with null value and two empty strings:
[null,\'\',\"\"]
Quotes and commas escaped in strings (\", \', \,) are parsed as part of the string.
List items are recursively parsed, so you can escape values in lists:
- Escaped integer as a string:
[\'123\'] - Escaped boolean as a string:
[\'true\'] - Escaped list as a string:
[\'[item1,item2]\'] - Escaped null value as a string:
[\'null\'] - List with an integer, an integer as a string and a string with a comma, and an escaped list: [
123,\'123\',str\,ing,\'[]\']
Example command with an escaped integer as a string:
java -jar revanced-cli.jar -bp patches.rvp -e "Patch name" -OstringKey=\'1\' input.apkjava -jar revanced-cli.jar utility install -a input.apkTip
You can use the option --mount to mount the patched app on top of the un-patched app.
Make sure you have root permissions and the same app you are patching and mounting over is
installed on your device:
adb shell su -c exit
adb install input.apkHere <package-name> is the package name of the app you want to uninstall:
java -jar revanced-cli.jar utility uninstall --package-name <package-name>If the app is mounted, you need to unmount it by using the option --unmount:
java -jar revanced-cli.jar utility uninstall --package-name <package-name> --unmountTip
By default, the app is installed or uninstalled to the first connected device. You can append one or more devices by their serial to install or uninstall an app on your selected choice of devices:
java -jar revanced-cli.jar utility uninstall --package-name <package-name> [<device-serial> ...]To increase confidence and security that the patches you are applying are from a trusted source and have not been tampered with, artifacts such as the patches files are signed with PGP by the respective author and their provenance attested by the platform in which they are built.
ReVanced CLI currently supports build provenance verification for these platforms:
- GitHub
By default, ReVanced CLI requires additional inputs to verify the signature and provenance,
but to bypass these verifications, you can use the option --bypass-verification or -b
for each input of patches.
java -jar revanced-cli.jar patch -bp patches.rvp input.apkTo verify the signature and provenance, you need to provide the following options for each input of patches:
--public-key-ringor-k: Path to the PGP public key ring containing the public key of the author who signed the patches file--signatureor-s: Path to the PGP signature file--attestationor-a: Path to the build provenance attestation file- Additional verification options for the respective platform which produced the patches file:
- GitHub:
--repositoryor-r: GitHub repository in the format 'owner/repo'
- GitHub:
For example, to verify the signature and provenance of a patches file from GitHub
when using the list-patches command, use the following command:
java -jar revanced-cli.jar list-patches -p patches.rvp -k public-key-ring.gpg -s patches.rvp.asc -a patches.rvp.sigstore.json -r owner/repo