Here I use the cert issued by charles proxy as example
openssl x509 -inform PEM -subject_hash_old -in ~/.charlesproxy/charles.pem | head -1
cat ~/.charlesproxy/charles.pem > 38fd165b.0
openssl x509 -inform PEM -text -in ~/.charlesproxy/charles.pem -out /dev/null >> 38fd165b.0
openssl x509 -inform PEM -text -in ~/.mitmproxy/mitmproxy-ca.pem -out /dev/null >> c8750f0d.0
./adb root
./adb push 38fd165b.0 /storage/emulated/0/Download
./adb shell
mount -o rw,remount /system
cp /storage/emulated/0/Download/38fd165b.0 /system/etc/security/cacerts/
chmod 644 /system/etc/security/cacerts/38fd165b.0
reboot