3

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?

Community
  • 1
  • 1
fenomas
  • 11,128
  • 1
  • 30
  • 53

3 Answers3

3

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.

Nikolay Elenkov
  • 51,084
  • 9
  • 81
  • 82
  • I was using JDK1.7.0_01, I'm trying 1.6 now. (I'm not a Java guy, I just grabbed what appeared to be the recommended release from Sun.) – fenomas Dec 07 '11 at 04:09
2

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'
Giorgio
  • 11,673
  • 12
  • 42
  • 72
1

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.

Osman Yalın
  • 420
  • 5
  • 6