1. Generate a packet capture tool certificate

Fiddler

Output the CER certificate hash

$ openssl x509 -inform DER -subject_hash_old -in FiddlerRoot.cer
Copy the code

The output 269953FB +.0 is the file name of the Android certificate, for example, 269953fb.0

Convert fiddler certificate to Base64 plain text format (PEM)

$ openssl x509 -inform DER -in FiddlerRoot.cer -text > 269953fb.0
Copy the code

The editor269953fb.0

Move “—–BEGINCERTIFICATE—–” to the end of the file to the top of the file

Import the mobile phone

$ adb root
$ adb remount 
$ adb push 269953fb.0 /system/etc/security/cacerts/269953fb.0
Copy the code

Charles

Exporting the Charles Certificate

Charles->Help->SSL Proxying->Save Charles Root Certificates… The exported certificate is in PEM format and does not need to be converted

Calculates the Hash of the Charles certificate

$ openssl x509 -subject_hash_old -in charles.pem
Copy the code

Output a hash value similar to 3abb2d3f

Import the mobile phone

$ adb root
$ adb remount 
$ adb push charles.pem /system/etc/security/cacerts/3abb2d3f.0
Copy the code

Problem 2.

Re-mount system in shell

mount -o rw,remount /system
Copy the code

Remount error or push has no permission

$adb root $adb disable-verity $adb reboot Restart device $adb root $adb remountCopy the code