HOW TO GET YOUR SHA-1 KEY DIRECTLY FROM ANDROID STUDIO.
Recently, I tried implementing both sign in and sign up authentication with Firebase UI (which is the easiest when using firebase in your application) and Firebase authentication. For some weird reasons, I actually prefer using Firebase authentication instead of the UI , probably because it involves reasoning and writing few lines of code so it is the better option for me.
SHA is an acronym for SECURE HASHING ALGORITHM. The SHA-1 key is needed in your android application in order for the developer to have access to Firebase features and Google API features like map, google sign-in, etc. You can learn more about hashing algorithms through here: https://www.thesslstore.com/blog/difference-sha-1-sha-2-sha-256-hash-algorithms/
While connecting my application to firebase, I was asked to provide the SHA certificate fingerprints for my application. There are two ways to generate the SHA fingerprints of your application: (i) From the command line (ii) Directly from android studio.
To generate the SHA fingerprints of your android application, which is definitely the easiest way in contrast to that long command line command, just carry out the following steps:
- Open your application in android studio.
- Click on the gradle tab at the top right corner of your application window shown in the screenshot below with my cursor pointing at the tab:

3. Then click on the ‘:app’ option, followed by the ‘Tasks’ option, which is followed by the ‘android’ option then finially the ‘signingReport’ option as shown in the screenshot below:

Then you are done! It’s so easy and definitely better than storing all those commands in your head just to access the SHA fingerprints of your application. A window should pop up after you click on the ‘signingReport’ option and should contain the values for SHA-1, SHA-256 and MD5. The window should look like this:

If you have any questions please let me know in the comment section. Thank you for your time and I hope this article helps you greatly.