Method 1: apk-mitm
Last updated
Last updated
is a CLI application that prepares Android APK files for HTTPS inspection that automates the entire process. In the section you will find more details, but as a summary all you have to do is give it an APK file and apk-mitm
will:
decode the APK file using
modify the app's AndroidManifest.xml
to make it
modify the app's to allow user-added certificates ()
to disable logic
encode the patched APK file using
sign the patched APK file using
You can also use apk-mitm
to and rooting your phone is not required.
Apktool
apk-mitm
automates the entire process. All you have to do is give it an APK file and apk-mitm
will:
decode the APK file using
modify the app's AndroidManifest.xml
to make it
modify the app's to allow user-added certificates
to disable logic
encode the patched APK file using
sign the patched APK file using
AndroidManifest.xml
To allow user-added certificates. The Network Security Configuration feature lets apps customize their network security settings in a safe, declarative configuration file without modifying app code. These settings can be configured for specific domains and for a specific app. So you can customize which Certificate Authorities (CA) are trusted for an app's secure connections. For example, trusting particular self-signed certificates or restricting the set of public CAs that the app trusts.
Once your target APK is properly disassembled, look for AndroidManifest.xml
at the root folder and add the following attribute to the application
element:
That attribute points to the file res/xml/network_security_config.xml
inside your project. If it doesn't, create it now and change its contents to be like this:
If the app uses Google Maps and the map is broken after patching, then the app's API key is probably . You'll have to without restrictions and replace it in the app's AndroidManifest.xml
file.
If apk-mitm
crashes while decoding or encoding the issue is probably related to . Check to find possible workarounds. If you happen to find an Apktool version that's not affected by the issue, you can instruct apk-mitm
to use it by specifying the path of its JAR file through the --apktool
option.
You can now install the example-patched.apk
file on your Android device and use a proxy like , , , etc, to look at the app's traffic.
Using
To make it
This rule tells the Android system to accept any system or user certificates, overriding default behavior. See for other overriding options.
To disable logic
Using
Using