Skip to content

Instantly share code, notes, and snippets.

@esabook
Last active January 9, 2020 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esabook/1b5e8ae79f07fe4713042dd698c38ea2 to your computer and use it in GitHub Desktop.
Save esabook/1b5e8ae79f07fe4713042dd698c38ea2 to your computer and use it in GitHub Desktop.
I want to always able to tracing android https call in AVD (tested in API <29) with MitmProxy and Fiddler, without setup PIN
#Installing CA Cert to android system
1. get cert file
cd ~/.mitmproxy
2. get cert hash
// convert cer to pem
openssl x509 -inform der -in certificate.cer -out certificate.pem
// cert hash for android
openssl x509 -inform PEM -subject_hash_old -in mitmproxy-ca.pem | head -1
3. rename cert to hash with *.0 extension
nm=c8750f0d.0
cp mitmproxy-ca.pem $nm
4. start AVD in writable-system mode
emulator -list-avds
emulator @Nexus_5X_API_29_x86 -writable-system
adb root
adb shell "mount -o remount,rw /"
5. push cert file
adb push $nm /system/etc/security/cacerts
6. change file permission
adb shell chmod 664 /system/etc/security/cacerts/$nm
7. reboot android system
adb reboot
8. chenk availability after reboot
adb shell ls /system/etc/security/cacerts/$nm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment