1.android 源码目录build argetproductsecurity 取platform.pk8 platform.x509.pem放到一个目录下
E:signconvert_keystore>ls
platform.pk8 platform.x509.pem
2.把pkcs8格式的私钥转换成pkcs12格式:
E:signconvert_keystore>openssl pkcs8 -in platform.pk8 -inform DER -outform PEM -out shared.priv.pem -nocrypt
E:signconvert_keystore>ls
shared.priv.pem platform.pk8 platform.x509.pem
3.把x509.pem公钥转换成pkcs12格式:
E:signconvert_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:signconvert_keystore>ls
shared.priv.pem platform.pk8 platform.x509.pem shared.pk12
4.生成debug.keystore
E:signconvert_keystore>keytool -importkeystore -deststorepass android -destkeypass android -destkeystore debug.keystore -srckeystore shared.pk12
-srcstoretype PKCS12 -srcstorepass android -alias androiddebugkey
E:signconvert_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即可