You might need to extract a Key Hash from an APK file for many reasons. In my case, I needed it so I can test Cordova LinkedIn Plugin on a debug APK (that I didn’t sign using one of my keys).
I found this solution here and I thought I’d share it on my blog as a quick tip (and for my own reference).
- Run this command
keytool -list -printcert -jarfile <Your APK File>.apk
- Copy the SHA1 value
- Go to http://tomeko.net/online_tools/hex_to_base64.php and convert your SHA1 value to Base64
- Copy the output and use it where needed!