Skip to content

Instantly share code, notes, and snippets.

@Marenostrum81
Marenostrum81 / patch_apk_for_sniffing.md
Created September 16, 2021 11:09 — forked from unoexperto/patch_apk_for_sniffing.md
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d net.flixster.android-9.1.3@APK4Fun.com.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
Delivered-To: email@gmail.com
Received: by 2002:ac8:6748:0:0:0:0:0 with SMTP id n8csp6812143qtp;
Thu, 31 Jan 2019 13:26:16 -0800 (PST)
X-Google-Smtp-Source: ALg8bN5A4zcl/T20Bp15nFFg43v8YBHoWA8N3jRnMJWkeZrI1Nd2iQQQSc8opakij1aqpbPDX/8i
X-Received: by 2002:a25:2f83:: with SMTP id v125mr34752444ybv.269.1548969976102;
Thu, 31 Jan 2019 13:26:16 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1548969976; cv=none;
d=google.com; s=arc-20160816;
b=oQHP0nxI3AIYxOopgHqXWyt87e/SWp+COhBIsHaS7DpV0AUvn7faWnZASZEkr76fUV
5V8mUT7Adnrmu1+EvV0tvuJP/fKcjNOMdIthemjRvLwdTB/lg6M8kPyXB9FV2kmX0SCp