Ein Python -Skript (zuvor bash ), das Android APK (oder AAB, XAPK) für die HTTPS -Verkehrsinspektion vorbereitet.
Das Skript ermöglicht es, SSL auf Android> = 7 durch den Wiederaufbau der APK -Datei und das Vertrauen des Benutzeranmeldeinformationsspeichers zu umgehen. Nach der Verarbeitung ist die Ausgabe -APK -Datei für die HTTPS -Verkehrsprüfung bereit.
Wenn eine AAB -Datei das Skript zur Verfügung stellt, erstellt sie eine universelle APK und verarbeitet sie. Wenn eine XAPK -Datei dem Skript bereitgestellt hat, entlarvt es und verarbeitet jede APK -Datei.
Funktioniert auf MacOS, Linux und Windows.
[Muss getestet werden] Die Leistung unter den Fenstern wird wahrscheinlich einige Male (~ 3,5) niedriger sein als in macOS / Linux ( apktool dauert länger, um die APK zu dekodieren).
Es:
java ).bundletool (falls die AAB -Datei angegeben) zu APK -Datei oder entlassung die XAPK -Datei (im Fall von XAPK).apktool ;network_security_config.xml der App, um die Benutzeranmeldeinformation wie vertrauenswürdig zu machen.apktool ;uber-apk-signer .Optional das Skript erlaubt:
adb am Gerät.Root -Zugriff ist nicht erforderlich.
Installieren Sie die Tools aus der folgenden Liste:
adb -Variablen der Pfadumgebung hinzuzufügen)Die folgenden Tools werden vom Skript heruntergeladen, falls es fehlt:
Voraussetzungen:
pip3 install -r requirements.txt aus, um die erforderlichen Python -Module zu installierenDas Skript kann wie gestartet werden wie
python3 /path/to/the/script/apk-rebuild.py
Führen Sie python3 apk-rebuild.py -h (oder python3 apk-rebuild.py --help ) aus, um das Verwendungshandbuch zu drucken.
usage: apk-rebuild.py [-h] [-v] [-i] [--pause] [-p] [-r] [-o OUTPUT] [--no-src] [--only-main-classes] [--ks KS]
[--ks-pass KS_PASS] [--ks-alias KS_ALIAS] [--ks-alias-pass KS_ALIAS_PASS]
file
The script allows to bypass SSL pinning on Android >= 7 via rebuilding the APK file
and making the user credential storage trusted. After processing the output APK file
is ready for HTTPS traffic inspection.
positional arguments:
file path to .apk, .aab or .xapk file for rebuilding
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-i, --install install the rebuilded .apk file(s) via adb
--pause pause the script execution before the building the output .apk
-p, --preserve preserve the unpacked content of the .apk file(s)
-r, --remove remove the source file (.apk, .aab or .xapk) after the rebuilding
-o OUTPUT, --output OUTPUT
output .apk file name or output directory path (for .xapk source file)
--no-src use --no-src option when decompiling via apktool
--only-main-classes use --only-main-classes option when decompiling via apktool
--ks KS use custom .keystore file for .aab decoding and .apk signing
--ks-pass KS_PASS password of the custom keystore
--ks-alias KS_ALIAS key (alias) in the custom keystore
--ks-alias-pass KS_ALIAS_PASS
password for key (alias) in the custom keystore
Verwenden Sie zum Wiederaufbau der APK -Datei das Skript mit Argument (en). Die Beispiele finden Sie unten:
Patch die AAB -Datei und löschen Sie den ausgepackten APK -Dateiinhalt nicht
python3 apk-rebuild.py input.aab --preserve
Patch die APK-Datei, entfernen Sie die Quell-APK
python3 apk-rebuild.py input.apk -r -i
Der Pfad zur Quelldatei muss als erstes Argument angegeben werden.
<debug-overrides> zum the network_security_config.xml hinzuzufügen (und das android:networkSecurityConfig Eigenschaft zum application im AndroidManifest.xml natürlich): https://developer.android.com/training/articles/security-config#debug-overrides.Für Fehlerberichte, Feature -Anfragen oder die Erörterung einer Idee öffnen Sie hier ein Problem.
Vielen Dank an: