When developing mobile applications you would sometimes need the SHA-1 or SHA-256 signing certificate fingerprints. These are required for security reasons and are usually used when dealing with Android apps. There are a lot of articles and different tools available online for obtaining these values but today I am going to share with you an easy way to get these Strings from any of your Adobe AIR apps.
The approach we go with is to use windows command line, CMD, and have an executable .bat file next to our projects which allows us to easily run the .bat file and the command line window will print the SHA-1 and SHA-256 values which we can easily copy.
FYI: Two of the common Air Native Extensions which requires you to generate these fingerprints are the Firebase DynamicLinks and Firebase AppInvite ANEs.
Something you should always remember is that these signing fingerprints, as their name suggests, are highly dependent on your app .p12 certificate files. That means if you ever happen to compile your app with a renewed signing certificate, you also need to run the .bat file again to regenerate the SHA values. It’s obvious that you normally wouldn’t change your .p12 file when you submitted your app to the play Store. Because if you do so, you will not be able to submitted newer versions for your app.
Anyway, let’s get to the point. Create a .txt file in your project folder and rename it to SHA.bat (Make sure you are changing the .txt to .bat so the file will be executable in your windows)
set JAVA_SDK=C:\Program Files (x86)\Java\jdk1.7.0_04
echo retrive the certificate fingerprints:
call keytool -v -list -keystore "%AND_CERT_FILE%" -storepass %AND_CERT_PASS% -storetype pkcs12
Clearly you need to change the certificate path, its password and the JAVA SDK path according to your own setup.
After you saved the file, simply double click on it to run the file. Read the information being printed in your cmd window. You now have SHA-1 and SHA-256 which you can use in your setup whenever required.
Enjoy building AIR Apps.