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.2

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.2
File Size Uploaded
stitch-1.1.2.tar.gz 17.1 MB Details

Built distribution (wheel)

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

Total release size: 34.1 MB

Release files / stitch-1.1.2.tar.gz

Download URL stitch-1.1.2.tar.gz
Size 17.1 MB
Tags Source
SHA-256 checksum
How to use checksums
dc245d25b3d9d2280ca877e2149841e9c2de48599e07fc01696d3692fde04b89
BLAKE2b-256 checksum
How to use checksums
290486dd1dfb8fea8f3ff6b315d4ede7d12256a93c48a9403e43896f83613cf2
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.2-py3-none-any.whl

Download URL stitch-1.1.2-py3-none-any.whl
Size 17.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e9387720cd8a3d76e23179ae7ecd0d9ca61c206ff4f1e7c208c9f4ff75e20538
BLAKE2b-256 checksum
How to use checksums
76841435a44446105c89fc15f3242b7e2921f070ed0167426c9d713f25f44712
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

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

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