Android:构建平台源后,如何使用平台密钥签署任意APK? [英] Android: After building platform source, how to sign arbitrary APK with platform key?

查看:16
本文介绍了Android:构建平台源后,如何使用平台密钥签署任意APK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为实验,我想使用我自定义构建的 Android 平台的平台密钥来签署通过 NDK 构建的任意 APK.这样做的过程是什么?

As an experiment, I would like to use the platform key of my custom built Android platform to sign an arbitrary APK, that is built via the NDK. What is the process to go about doing this?

推荐答案

如果您有平台密钥/证书对 (.pk8 + x509.pem).可以在公共 sdk 的 build/target/product/security 下找到.

If you have your platform key/certificate pair (.pk8 + x509.pem). Which can be found under build/target/product/security in the pulbic sdk.

您可以从命令行使用 SignApk.jar

You can use the SignApk.jar from the command line

java -jar SignApk.jar平台.x509.pem 平台.pk8Application.apk Application_signed.apk

java -jar SignApk.jar platform.x509.pem platform.pk8 Application.apk Application_signed.apk

或者为了使自动化更容易,您可以使用 keytool-importkeypair,并使用 ant makefile 或 eclipse 进行签名.

Or to make automation easier, you can import the key/cert pair into your java keystore file, with the keytool-importkeypair, and use an ant makefile or eclipse for signing.

keytool-importkeypair -k~/.android/debug.keystore -p 安卓-pk8 platform.pk8 -cert platform.x509.pem -alias platform

keytool-importkeypair -k ~/.android/debug.keystore -p android -pk8 platform.pk8 -cert platform.x509.pem -alias platform

这篇关于Android:构建平台源后,如何使用平台密钥签署任意APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆