我已经签署了 apk,但是当我尝试使用 jarsigner 进行验证时:
jarsigner -verify -verbose -certs sample.signed.apk
但我收到一条错误消息:
jarsigner: Signature Block missing for ANDROIDS
我不知道我应该在哪里研究这个问题。有人可以给我一个提示吗?
How did you sign the jar file ?
From the Java docs here looks like
-verify
If this appears on the command line, the specified JAR file will
be verified,not signed. If the verification is successful,
"jar verified" will be displayed. If you try to verify an unsigned
JAR file, or a JAR file signed with an unsupported algorithm
(e.g., RSA when you don't have an RSA provider installed),
the following is displayed: "jar is unsigned. (signatures
missing or not parsable)" It is possible to verify JAR files
signed using either jarsigner or the JDK 1.1 javakey tool, or both.
原来我使用的 jarsigner 版本是在 JDK1.6 上的。在我升级到 1.7 之后。问题解决了。