Skip to content

This tool is simply an easier way to use some collection of other tools which can inject a network security config into an Android APK. Mainly it's sole pupose is making it easier to use the tools in the requirements list below with one line of command.

License

Notifications You must be signed in to change notification settings

xlith/ansinject

Repository files navigation

ANS INJECT

Image by Darwin Laganzon from Pixabay

Android Network Security Config Injector

PyPI - Python Version PyPI - Implementation GitHub top language PyPI - License PyPI PyPI - Format PyPI - Status

This tool is simply an easier way to use some collection of other tools which can inject a network security config into an Android APK. Mainly it's sole pupose is making it easier to use the tools in the requirements list below with one line of command.

This is useful when you want to test an app that uses HTTPS but you don't have a valid certificate. This tool will allow you to bypass the certificate check.

Disclaimer

This tool is provided as is. I am not responsible for any damage caused by this tool. Use it at your own risk.

Requirements

Installation

pip install ansinject

Usage

ansinject --help
ansinject inject [input_apk] [output_apk] --temp-dir [temp_dir]

Basicly the script will do the following:

  1. Extract the APK
  2. Copy the following network security config onto /res/xml/network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
            <certificates src="user" />
        </trust-anchors>
    </base-config>
</network-security-config>
  1. Rebuild the APK
  2. Generate a keystore in order to sign the APK
  3. Sign the APK
  4. Align the output

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgements

About

This tool is simply an easier way to use some collection of other tools which can inject a network security config into an Android APK. Mainly it's sole pupose is making it easier to use the tools in the requirements list below with one line of command.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages