Search code examples
androidfirebasesha1keytool

SHA-1 Android Firebase keytool


I'm trying to get my SHA-1 certificate but I keep getting this:

Screenshot


Solution

  • I just did this for Branch.io and Firebase. This is exactly what gave me my MD5, SHA1 and SHA256:

    If on Windows, navigate to the folder where your keystore is. Hold down shift then right click. You should see "Open Command Prompt Here" in the list of options.

    When command prompt opens, type the following and you will get everything you need:

    keytool -list -v -keystore {yourkeystore}

    Then it will ask for the password. Enter your password and hit enter. Then you will have all of your needed info.

    SIDE NOTE

    If you want to save the information for future use, right click and choose select all. Hit enter and then paste in your favorite text editor. Save it with your keystore so that you always have the reference in case you need it for other sdk's/api's. Hope that helps.

    If on Windows

    Hold down Windows Home key and hit "X". Select "System" Then select "Advanced System Settings" on the left hand side. In the popup, click environment variables. Under the System Variables section look for "JAVA HOME" if not there, click new. Type JAVA_HOME for variable name. Enter the following for the variable value:

    C:\Program Files\Java\jdk1.8.0_66

    Make sure that matches the JDK version you have

    Then look for the "Path" variable and add:

    C:\Program Files\Java\jre7\bin

    Make sure those match the locations for your Java SDK and Runtime environments. Then you will be able to access keytool from anywhere via the command prompt.