Skip to content

Generic patcher for APKs that allow you to patch APKs with java instead of smali.

Notifications You must be signed in to change notification settings

Schwartzblat/UltimatePatcher

Repository files navigation

Ultimate Patcher

This repo will be a generic APK patcher that works with java instead of smali.

Currently, this project is in POC stage, it's working but not fully tested.

How it works

  1. Decompile the APK with apktool
  2. Compile the patch's java code with gradlew to apk
  3. Extract the smali code of your patch apk
  4. Copy it to the original apk
  5. Add a call to the patch entry point in the original apk within every onCreate and init of exposed classes.
  6. Recompile the apk with apktool
  7. Sign the apk with uber-apk-signer

And that's it. When the app will be launched, the patch will be executed by the onCreate of the MainActivity.

Installation

  1. Clone the repo.
git clone [email protected]:Schwartzblat/UltimatePatcher.git
  1. Override the java files in the ./smali_generator/app/src/main/com/smali_generator/* with your own patch code.
  2. Setup the python environment.
python -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt
  1. Run the script with the path to the apk you want to patch.
python main.py -p apk_to_patch.apk -o output_apk.apk

About

Generic patcher for APKs that allow you to patch APKs with java instead of smali.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published