Sp3EdeR / revanced-auto-patcher

Python script to easily patch APKs with ReVanced or RVX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReVanced Automatic Patcher

This script patches Android applications to change their behaviour. Patches are provided by the ReVanced or ReVanced Extended projects.

Prerequisites

The script requires Python 3 or above to be installed on the computer. Python can be downloaded from this link, or your operating system's official package manager. The ReVanced tools require Java SDK 11 or above to be installed on the computer. It is recommended to get it from this link or your operating system's official package manager.

Patching

Both ReVanced and ReVanced Extended support a limited list of applications and versions. Trying to patch an unsupported application or a supported app's unsupported version will result in errors. The list of supported applications and their versions can be found at the following links:

The original version of the application must be downloaded before patching can begin. To download a compatible version of the APK file, it is recommended to get it from APKMirror, since that site is a fairly safe download source. Find direct links to popular applications below (but choose compatible versions):

Default Usage

By default, the script uses ReVanced Extended patches to modify APKs. Only place supported APKs, and only supported versions in this folder, otherwise the patching will fail. Create the following folder structure:

ReVanced
└── Sources
    ├── patch.py
    ├── SomeAppToPatch 10.5.2.apk
    └── OtherAppToPatch 1.0.0.apk

Then run python patch.py. After the script finishes running, you will get the following folder structure:

ReVanced Extended
├── Sources
│   ├── tools
│   │   ├── revanced-cli-*.*.*-all.jar
│   │   ├── revanced-integrations-*.*.*.apk
│   │   └── revanced-patches-*.*.*.jar
│   ├── patch.keystore
│   ├── patch.py
│   ├── SomeAppToPatch.json
│   ├── SomeAppToPatch 10.5.2.apk
│   ├── OtherAppToPatch.json
│   └── OtherAppToPatch 1.0.0.apk
├── RVX SomeAppToPatch 10.5.2.apk
└── RVX OtherAppToPatch 1.0.0.apk

Where the created directories / files are:

  • tools: Contains the downloaded ReVanced Extended patches used to patch your APK. Keeping these files can save internet bandwidth when re-patching your APKs.
  • patch.keystore: Your unique keys with which the generated APKs were signed. Keep this file to be able to upgrade existing, installed software with newer versions without needing to uninstall the older version.
  • *.json files: These files store patch options for the application. Initially these contain default options, but you can edit these files to build customised versions of the patched application.
  • RVX *.apk: These are the generated, patched APKs, ready for you to install them.

Edited Usage

It is possible to relatively easily edit the default behaviour of the patcher script. To edit its default behaviour, open the file in any other text editor application (on Windows you can use notepad). Look for the following text near the top of the file:

# The following are the default settings. Edit to change the defaults.
settings = {

The text lines following this contain the configuration of how the script behaves when run without command-line arguments. Each configurable line has a comment (followed by the # character), which explains what that option controls. Change any of these values (to valid ones) to customise the script's behaviour.

For example, to create a directory that applies ReVanced patches, set up a directory as explained in the Default Usage section, then edit the following line of patch.py from:

'defaultPatchSource': 'rvx',

to:

'defaultPatchSource': 'rv',

This makes the script use ReVanced patches instead of ReVanced Extended in that folder. The usage remains the same otherwise.

Command-line Options

It is possible to thoroughly customise the script's behaviour using command-line arguments, without editing the script. To see the available arguments, run python patch.py --help. This will explain the usage of the the command-line interface.

About

Python script to easily patch APKs with ReVanced or RVX

License:GNU General Public License v3.0


Languages

Language:Python 100.0%