- Decompile the APK with apktool
- Compile the patch's java code with gradlew to apk
- Extract the smali code of your patch apk
- Copy it to the original apk
- Add a call to the patch entry point in the original apk within every onCreate and init of exposed classes.
- Recompile the apk with apktool
- 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.
- Clone the repo.
git clone [email protected]:Schwartzblat/UltimatePatcher.git
- Override the java files in the
./smali_generator/app/src/main/com/smali_generator/*
with your own patch code. - Setup the python environment.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- 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