Skip to content

Instantly share code, notes, and snippets.

@interference-security
Last active September 27, 2024 16:45
Show Gist options
  • Save interference-security/15b89a82fe20ded05c27c561607bd4e5 to your computer and use it in GitHub Desktop.
Save interference-security/15b89a82fe20ded05c27c561607bd4e5 to your computer and use it in GitHub Desktop.
Android SSL Certificate Installation
openssl x509 -inform DER -in cacert.der -out cacert.pem
openssl x509 -inform PEM -subject_hash_old -in cacert.pem | head -1
mv cacert.pem <hash>.0  
adb push <hash>.0 /sdcard/Download/
adb shell
su
mkdir -m 700 /sdcard/cert/
cp /system/etc/security/cacerts/* /sdcard/cert/
mount -t tmpfs tmpfs /system/etc/security/cacerts
mv /sdcard/cert/* /system/etc/security/cacerts/
cp /sdcard/Download/<hash>.0 /system/etc/security/cacerts/
chown root:root /system/etc/security/cacerts/*
chmod 644 /system/etc/security/cacerts/*
chcon u:object_r:system_file:s0 /system/etc/security/cacerts/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment