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.

Metadata

Release files for stitch 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stitch 1.1.0
File Size Uploaded
stitch-1.1.0.tar.gz 17.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for stitch 1.1.0
File Interpreter ABI Platform
stitch-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 MB

Release files / stitch-1.1.0.tar.gz

Download URL stitch-1.1.0.tar.gz
Size 17.1 MB
Tags Source
SHA-256 checksum
How to use checksums
ac6822c02e60af1153db32ec0c237d883a7530d6b101e2b6416c31d3838c8488
BLAKE2b-256 checksum
How to use checksums
6b3aa7dc85411eb8c357c0c3b6b020dd3cddfa3bec992a7306493f52c71c34e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / stitch-1.1.0-py3-none-any.whl

Download URL stitch-1.1.0-py3-none-any.whl
Size 17.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
da53d99d7bcea31e39f970140293916f435f5dc278d61d4c6655a4305d3d71c6
BLAKE2b-256 checksum
How to use checksums
1a9517f5046c9a0f89fbb49397e03bcebafc2e69feb06c56ae10b96857705569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.3.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.21

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page