2

How do I find the certificates used to sign my APK file?

This was discussed in SO question 7104624, apksigner doc on developer.android.com, and other places. They all say to use the option "--print-certs" on the apksigner verify command line. But I always get the error message unsupported option: --print-certs.

I have tried apksigner.bat for versions 26.0.2, 27.0.2 and 26.0.3 all with the same result.

I'm probably doing something dumb but I can't figure out what that is. Does anybody have a similar experience?

Rohit Singh
  • 16,950
  • 7
  • 90
  • 88
DontPanic
  • 2,164
  • 5
  • 29
  • 56
  • So did you find this: [How do I find out which keystore was used to sign an app?](https://stackoverflow.com/q/11331469/295004) Reminder APKs are just JARs with extra files. – Morrison Chang Nov 19 '18 at 19:29
  • Can you paste the whole command you're using? – Pierre Nov 19 '18 at 21:50
  • I used: "apksigner verify MYAPP.APK --print-certs". Just now I tried "apksigner verify --print-certs MYAPP.APK" and that worked. I guess the options must come *before* the APK. My Bad. I knew it was something dumb. – DontPanic Nov 20 '18 at 20:13

1 Answers1

7

I used apksigner verify myapp.apk --print-certs.
I just tried apksigner verify --print-certs myapp.apk and it worked. I guess the options must come before the APK. My Bad. I knew it was something dumb I did.

Rohit Singh
  • 16,950
  • 7
  • 90
  • 88
DontPanic
  • 2,164
  • 5
  • 29
  • 56