我正在尝试签署使用处理创建的Android apk。

这就是我所做的(基于此:http://www.akeric.com/blog/?p=1352):

keytool -genkey -v -keystore myapp-release-key.keystore -alias myname -keyalg RSA -keysize 2048 -validity 10000

ant release

jarsigner -verbose -keystore myapp-release-key.keystore <PATH>/android/bin/<APPNAME>-release-unsigned.apk myname

jarsigner -verify <PATH>/android/bin/<APPNAME>-release-unsigned.apk

zipalign -v 4 bin/<APPNAME>-release-unsigned.apk bin/<APPNAME>-release.apk

adb install bin/<APPNAME>-release.apk


但是我得到一个错误:

INSTALL_PARSE_FAILED_NO_CERTIFICATES


jarsigner验证已终止:

s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope

jar verified.

Warning:
    This jar contains entries whose certificate chain is not validated.
    This jar contains signatures that does not include a timestamp. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2042-09-08) or after any future revocation date.


有什么问题的想法吗?与这些警告有关?

最佳答案

确保已添加以下2个选项:-sigalg SHA1withRSA -digestalg SHA1到jarsigner命令中,即使在生成密钥时已经指定了类似的内容。像那样:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myapp-release-key.keystore <PATH>/android/bin/<APPNAME>-release-unsigned.apk myname


让我认识到年龄不是必须的.​​.. Doc在那上面肯定是不清楚的。

希望能有所帮助。祝好运。

08-06 21:11