On linux, I used this command to get the key hash from an apk:
keytool -list -printcert -jarfile [path_to_your_apk] | grep -Po "(?<=SHA1:) .*" | xxd -r -p | openssl base64
For Mac Users (OS X) as there is no grep -P support
keytool -list -printcert -jarfile ~/Downloads/YOURAPKFILE.apk | grep "SHA1: " | cut -d " " -f 3 | xxd -r -p | openssl base64
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…