Skip to main content

Stitch

Stitch is a powerful APK patching python library that allows you to inject your own java module into any APK, bundle or XAPK file.

How it works

Will be added soon.

Projects using Stitch:

How to use

Installation

You can install Stitch using pip:

# For now, install the test version from TestPyPI
pip install stitch

Basic Usage

Create an Android Gradle project like my smali_generator (Check it out in on of the examples) that generates the java module you want to inject.

Then, use the following code to patch an APK:

from stitch import Stitch
from stitch.common import ExternalModule
from pathlib import Path

with Stitch(
        apk_path='./input.apk',
        output_apk='./output.apk',
        external_modules=[ExternalModule(Path(__file__).parent / './smali_generator',
                                         'invoke-static {}, Lcom/smali_generator/TheAmazingPatch;->on_load()V')]
) as stitch:
    stitch.patch()

And that's it! Your APK will be patched with the injected module.

Contributing

I will be happy if you want to contribute to this project. Feel free to open issues or submit pull requests.

Disclaimer

For educational purpose only or something like that. I am not responsible for any misuse of this software.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stitch-1.0.2.tar.gz (17.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stitch-1.0.2-py3-none-any.whl (17.1 MB view details)

Uploaded Python 3

File details

Details for the file stitch-1.0.2.tar.gz.

File metadata

  • Download URL: stitch-1.0.2.tar.gz
  • Upload date:
  • Size: 17.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for stitch-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a9a8b2a28f380e8e3af202bb88d187d1763457af533f57921326a0a05bc67906
MD5 cf5cb28d3148ea5398ad5769ffea1f2c
BLAKE2b-256 670696bb0c18672dc6a49f104a2e1c4bd1b451b3308e92a1492dc11d0c845ffe

See more details on using hashes here.

File details

Details for the file stitch-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: stitch-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for stitch-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 28d182d9ae44a20a9f07bb0457053dc3b898c31aab573cd39d02e3bf8647a6b0
MD5 3c0e660c618b4b0e1d37adb890ad90b2
BLAKE2b-256 4928628fe288ca0ce9876e09ac931822fe41796b24e2117cf70fd8298177720b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

2 files

1.0.0

2 files

0.0.21

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page