Skip to content

Instantly share code, notes, and snippets.

@coffeemakr
Last active December 11, 2017 11:39
Show Gist options
  • Save coffeemakr/e59bf60e7f524dbcd84c08f1dde0d038 to your computer and use it in GitHub Desktop.
Save coffeemakr/e59bf60e7f524dbcd84c08f1dde0d038 to your computer and use it in GitHub Desktop.
#!/bin/bash
mitmfiles="$HOME/.mitmproxy/mitmproxy-ca.pem"
for f in $mitmfiles; do
name="$(openssl x509 -inform PEM -subject_hash_old -in $f | head -1).0"
echo Filename: $f
cp "$f" "$name"
android_file="/system/etc/security/cacerts/$name"
adb push "$name" "$android_file"
adb shell "su -c chmod 644 $android_file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment