需要root
1.從Charles導出證書
help-->SSL...-->Save Charles...
2.獲取證書hash,並修改證書文件名為hash+后綴''.0'' 。本例為fc0dd2c8.0
安裝open ssl(http://slproweb.com/products/Win32OpenSSL.html),然后配置環境變量
在cmd中---> openssl x509 -subject_hash_old -in <Certificate_File> #文件路徑為絕對路徑
執行結果:fc0dd2c8
3.連接測試機,adb shell 修改 /system權限,
adb push fc0dd2c8.0 /system/etc/security/cacerts/
如果remount或push失敗,需要執行以下命令
adb disable-verity
adb reboot
mount -o rw,remount /system
4.修改證書權限為664,重啟設備
cd /system/etc/security/cacerts/
chmod 664 ./fc0dd2c8.0
reboot