问题描述
如何使用多个证书签署一个 APK,以便在我发布到 Android Market 时执行此操作:
1.0 版 => 使用证书 A 签名
版本 2.0 => 使用证书 A 签名 &乙
版本 3.0 => 使用证书 B 签名
Version 1.0 => Signed with Certificate A
Version 2.0 => Signed with Certificate A & B
Version 3.0 => Signed with Certificate B
Android Market 确实给了我一些希望,但我不知道该怎么做,当我使用不同的签名证书上传时,它给了我这样的信息:
The Android Market does give me some hope but I am not sure what to make of it, when I upload with a different sign certificate it gives me this message:
apk 必须使用至少一个与之前版本相同的证书进行签名."
动机:
我已经使用 Android 签名工具作为 MotoDev Studio for android 的一部分在市场上发布了一个应用程序.问题是它自己处理密钥并且没有办法(记录)来获取它们.我想将其更改为使用我可以更好地控制并且即使我不再使用 MotoDev Studio 也可以使用的密钥库和证书.此外,MotoDev Studio 似乎会将您锁定在共享库等新功能之外.
Motive:
I have published an app on the market using the Android Signing Tool as part of MotoDev Studio for android. The problem is that it handles the keys itself and there is no way (documented) to get them. I want to change it to use a keystore and certificate that I have more control of and can use even if I don't use MotoDev Studio anymore. Also it seems that MotoDev Studio will lock you out of new features such as shared libraries.
2011 年 5 月 3 日更新:
实际上,他们在更新 MotoDev Studio 时非常迅速和迅速,但我似乎认为 Google 仍然应该为那些想要更改其应用程序的证书.更新应用程序以使所有应用程序都使用相同的证书,随着时间的推移创建新的,并可能创建一个新的,以便您可以将您的应用程序的支持和分发交给其他人.
UPDATE 5/3/2011:
They have been actually really quick and prompt at updating MotoDev Studio but it seems like I believe that Google should still provide a work around for those that want to change the certificates of their applications. Updating application to all use the same certificate, creating new ones over time, and possibly creating a new one so that you may hand of the support and distribution of your application to others.
推荐答案
如果您想多次签署一个 APK,就这样做.
但请注意,Google Play 不接受具有多个签名的 APK.
If you want to sign an APK more than once, just do so.
But note that Google Play does not accept APKs with multiple signatures.
例如.您可以在命令行中使用 签署一个 APK>jarsigner 像这样:jarsigner -keystore original-keystore my-app-unsigned.apk key-alias
别名
eg. You can sign an APK from the command line using jarsigner
like so:jarsigner -keystore original-keystore my-app-unsigned.apk key-alias
alias
然后用第二个键重复此操作:jarsigner -keystore new-signing-keystore my-app-unsigned.apk key-alias
Then just repeat this with the second key:jarsigner -keystore new-signing-keystore my-app-unsigned.apk key-alias
之后不要忘记运行 zipalign:zipalign -v 4 my-app-unsigned.apk my-app.apk
我刚刚重新阅读了有关 MotoDev 工作室的部分.在这种情况下,您可以像往常一样首先使用 MotoDev 对 APK 进行签名,然后在命令行上使用您的新密钥进行签名.
I just re-read the part about MotoDev studio. In that case you can just sign the APK first using MotoDev as usual, then sign with your new key on the command line as above.
这篇关于如何使用多个证书签署 APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!