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

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

Built distribution (wheel)

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

Total release size: 34.1 MB

Release files / stitch-1.1.1.tar.gz

Download URL stitch-1.1.1.tar.gz
Size 17.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1fca592cf64b81f4086cb9886a95871792c7596e73962b349c694182e1f577c1
BLAKE2b-256 checksum
How to use checksums
ae29ccaad69a007a096097898a79b6aa2ea0467231431c290eed2f1f125a5307
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.1-py3-none-any.whl

Download URL stitch-1.1.1-py3-none-any.whl
Size 17.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e83da95703d938503640dd5cb87c0f3c5ee4ef8315d0c1fd1a2895fb620ad653
BLAKE2b-256 checksum
How to use checksums
1fa342b145a830759c83e77af5e598a2dca832427aa728b1675f65f75cb6aab6
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

This release

1.1.1 This release

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