fenomas
fenomas

Reputation: 11139

Using jarsigner -verify on an APK asks me to specify an alias?

I'm trying to check the signature information on an APK. The docs say to use

jarsigner -verify -verbose -certs app.apk

and various SO questions agree. But if I grab JDK 1.7 and do that, I get the error:

Please specify alias name

Which is hard to work with, considering that googling the error message returns nothing but links to the jarsigner source.

What's going on?

Upvotes: 3

Views: 6875

Answers (3)

Osman Yalın
Osman Yalın

Reputation: 630

use:
$ jarsigner -verify -verbose -certs app.apk

on app > build > ouputs > apk path

if you see CN phrase then your .apk is "debug",

else congrats! you signed your .apk, its "release" now.

Upvotes: 1

Giorgio
Giorgio

Reputation: 13529

I found the same error could be happening if the alias contains spaces:

ALIAS WITH SPACES
I managed to overcome this by specifying the alias with quotes. This works even within properties of Maven files:
'ALIAS WITH SPACES'

Upvotes: 2

Nikolay Elenkov
Nikolay Elenkov

Reputation: 52936

An alias should only be required if you are signing an APK. What version of the JDK are you using? Is it the Sun/Oracle JDK?

BTW, you shouldn't use Java 7 for android development, it is not officially supported. Also note that the jarsigner default digest algorithm has been changed, so signing with Java 6 and Java 7 will produce different results if you don't explicitly specify the digest algorithm.

Upvotes: 3

Related Questions