Monday, December 17, 2012

Displaying the SHA1 certificate fingerprint

There are two type of certificate fingerprint, debug and release.

To display debug certificate fingerprint in Linus, simple open Terminal and type the command:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android


display debug certificate fingerprint


To display release certificate fingerprint, you need to create the release keystore and and sign the .APK once.

- Right click your project and select Android Tools -> Export Signed Application Package...


- Accept the selected project and click Next.


- Select Create new keystore, browse to select Location and enter Password, and click Next.


- Enter Alias, Password, Validity and at least one Certificate issue field, and click Next.


- Select destination APK, and click Finish.


After created the release keystore and and signed the .APK. you can display the release certificate fingerprint.

- open Terminal and type the command:
keytool -list -v -keystore <your_keystore_name> -alias <your_alias_name>

where:
<your_keystore_name> is the path and name of the keystore, including the .keystore extension.
<your_alias_name> is alias that you assigned to the certificate when you created it.



If you get error of "keytool error: java.lang.Exception: Keystore file does not exist", read HERE.

The series:
A simple example using Google Maps Android API v2, step by step.

6 comments:

  1. How am I supposed to write the key in the manifest before exporting the apk?!

    ReplyDelete
  2. What I did was to update the manifest with release key and export again, this time choosing the existing key instead of creating new key. It seems to work.

    ReplyDelete
  3. Merci beaucoup pour ces détails. J'ai cherché longtemps les bonnes explications.
    Laurent

    ReplyDelete