You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
简介
我们在做系统级的app开发时, 肯定会遇到的问题就是给app签名了, 像这种系统级的app开发, android系统是没有直接给出keystore的签名文件的, 那么我们要怎么给自己的app签上系统级签名呢? 下面介绍两种方法。
前提
要做系统签名必须要拿到的两个文件platform.x509.pem,platform.pk8它们存放在系统的/build/target/product/security/目录下。拿到这两个文件后就可以做我们的app签名了。系统下的其他签名类似, 大家可以以此类推, 举一反三。
CMD命令方式
java -jar signapk.jar platform.x509.pem platform.pk8 XXX.apk XXXNew.apk
这样我们生成的app就是有系统签名的app了, 但是我们每次都要使用命令的方式来执行给我们开发调试的app签名是不是很烦, 有没有更好的方式呢? 下面就重点说下keysotre的方式。
keystore方式
最前面我们说了, 系统没有提供keystore的签名给我们, 那这个keystore是怎么来的? 看来只有自己动手生成这个文件了, 来看我们怎么制作这个keystore吧。
环境: Linux
文件: platform.x509.pem,platform.pk8
命令:
openssl pkcs8 -inform DER -nocrypt -in platform.pk8 -out platform.pem
openssl pkcs12 -export -in platform.x509.pem -out platform.p12 -inkey platform.pem -password pass:android -name androiddebugkey
keytool -importkeystore -deststorepass android -destkeystore ./platform.keystore -srckeystore platform.p12 -srcstoretype PKCS12 -srcstorepass android
依次执行完这3条命令后我们的签名文件platform.keystore就生成啦, 接下来要做的事情就是导出app的时候使用这个签名就好了。nice~~~
https://blog.csdn.net/QQxiaoqiang1573/article/details/52252843