1.android 源码目录build\target\product\security 取platform.pk8 platform.x509.pem放到一个目录下
E:\sign\convert_keystore>ls
platform.pk8 platform.x509.pem
2.把pkcs8格式的私钥转换成pkcs12格式:
E:\sign\convert_keystore>openssl pkcs8 -in platform.pk8 -inform DER -outform PEM -out shared.priv.pem -nocrypt
E:\sign\convert_keystore>ls
shared.priv.pem platform.pk8 platform.x509.pem
3.把x509.pem公钥转换成pkcs12格式:
E:\sign\convert_keystore> openssl pkcs12 -export -in platform.x509.pem -inkey shared.priv.pem -out shared.pk12 -name androiddebugkey
Enter Export Password: (密码android)
Verifying - Enter Export Password:(密码android)
E:\sign\convert_keystore>ls
shared.priv.pem platform.pk8 platform.x509.pem shared.pk12
4.生成debug.keystore
E:\sign\convert_keystore>keytool -importkeystore -deststorepass android -destkeypass android -destkeystore debug.keystore -srckeystore shared.pk12
-srcstoretype PKCS12 -srcstorepass android -alias androiddebugkey
E:\sign\convert_keystore>ls
convert debug.keystore platform.pk8 platform.x509.pem shared.pk12 shared.priv.pem
5.eclipse 的Windows/Preferences/Android/Build中设置"Custom debug keystore"为刚才生成的keystore即可