How can I generate an Android Keystore from a key.pk8 and certificate.pem?

荒凉一梦 提交于 2020-02-17 07:26:18

问题


So today I finally update my SDK to 22.0.0 however this creates an error in the AndroidManifest.xml for android:debuggable="false" which means I can no longer externally sign and zipalign my own apks.

I have been signing using my own key.pk8 and certificate.pem, however eclipse ADT requires a keystore.

Does anyone know a way to either build a keystore using my already generated key or find some way around this?


回答1:


Ok, So I eventually managed to solve the problem.

I downloaded openssl for windows from here

Keytool can be found at E:\Program Files\Java\jdk1.7.0_17\bin

Then using keytool and openssl managed to build the key.pk8 and certificate.pem into a keystore entry

openssl pkcs8 -inform DER -nocrypt -in key.pk8 -out key.pem

openssl pkcs12 -export -in certificate.pem -inkey key.pem -out platform.p12 -password pass:android -name mykey

keytool -importkeystore -deststorepass password -destkeystore .keystore -srckeystore platform.p12 -srcstoretype PKCS12 -srcstorepass android

keytool -list -v -keystore .keystore

The last step is just to verify that the key has been added to the keystore.



来源:https://stackoverflow.com/questions/22212869/how-can-i-generate-an-android-keystore-from-a-key-pk8-and-certificate-pem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!