For our automated testing platform for Android emulator, we are able to push a Proxyman certificate to a /system/etc/security/cacerts with the tried and tested commands:
Start emulator with
-writable-systemflag:emulator -avd emulator_name -writable-systemPrepare Proxyman certificate:
openssl x509 -inform PEM -subject_hash_old -in proxyman-ssl-proxying-certificate.pem | head -1- it returns a hash for the cert, eg. 30eb732csave that to a file:
cat proxyman-ssl-proxying-certificate.pem > 30eb732c.0openssl x509 -inform PEM -text -in proxyman-ssl-proxying-certificate.pem -out /dev/null >> 30eb732c.0
Push the created
30eb732c.0to emulator:adb rootadb remountadb rootadb shell avbctl disable-verificationadb rebootadb rootadb remountadb push 30eb732c.0 /system/etc/security/cacerts
I can verify that the file is there by listing all certs with
adb shell ls /system/etc/security/cacertand seeing mine on the list.
With these, we are able to see the traffic in Proxyman on release builds of our apps, up to API 33, and I can see the certificate installed on system partition in the Emulator Settings/Security/Encryption & credentials/Trusted credentials.
With the same steps for Android Emulator UpsideDownCake, I can see that the cert file is indeed in /system/etc/security/cacert, but the UI doesn't show it, and the traffic also fails to be captured by Proxyman (getting SSL Handshake Failed).
The method for installing cert has been informed by many of these:
- Is adb remount broken on android api 29?
- https://issuetracker.google.com/issues/144891973?pli=1
- https://gist.github.com/pwlin/8a0d01e6428b7a96e2eb
- https://blog.ropnop.com/configuring-burp-suite-with-android-nougat
I feel like I might be missing something here, but also wondering what's the difference between API 33 and UpsideDownCake emulators. Has anyone been successful in installing a certificate in /system/etc/security/cacert on Android 14 (UpsideDownCake) emulator?
