Android/ target=_blank class=infotextkey>安卓 root 手機
1、準備 root 過的 android 手機,關于自己手機root方法,自行查找解決。
adb root
adb disable-verity
2、并重新掛載分區,使系統根目錄可寫入
adb shell "mount -o rw,remount /system"
制作并上傳證書

根據圖示菜單選擇導出,證書密碼通過后面的 View Generated SSL Certificates Keystore Password 查看。
2、查看證書的 hash 值
$ openssl x509 -inform PEM -subject_hash_old -in ~/Downloads/charles-proxy-ssl-proxying-certificate.pem |head -1
26f93358
3、證書重命名為 {hash}.0
mv ~/Downloads/charles-proxy-ssl-proxying-certificate.pem 26f93358.0
4、上傳證書到手機里的 /system/etc/security/cacerts 目錄下
adb push 26f93358.0 /system/etc/security/cacerts
adb shell "chmod 664 /system/etc/security/cacerts/26f93358.0"
5、重啟手機
charles 左側選中域名,開啟 SSL代理(Enable SSL Proxying)

最后說明
IOS 只需要手動安裝證書,并授權即可,比 Android 要簡單。
從 android 10 開始,針對 /system 分區多了一層保護,不能直接寫入,暫時還沒有找到解決方案,如果有知情的大牛歡迎給出解決方案。