签约安卓apk:INSTALL_PARSE_FAILED_NO_CERTIFICATES

时间:2015-04-23 22:18:56

标签: java android processing

我正在尝试签署使用Processing创建的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.

关于什么是错的任何想法?那些警告有什么关系?

1 个答案:

答案 0 :(得分:2)

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

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

让我意识到这些不是可选的...... Doc肯定不清楚那个。

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