I\'m building an app in which users can log in with Facebook.
I\'ve created the hash keys like following:
try {
PackageInfo info = getPackag
keytool -exportcert -alias aliasName -keystore C:\my_release_keystroke_info.jks | openssl sha1 -binary | openssl base64
I find a solution. for MAC
Use this one to get YOUR_RELEASE_KEY_ALIAS:
keytool -list -keystore /Users/***/Documents/keystore/***.jks
and this one to get your release keyhash:
keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore /Users/***/Documents/keystore/***.jks | openssl sha1 -binary | openssl base64
It works for me.
We need to replace the word "openssl" by the path of one file inside the openssl structure.
So, My CMD command is:
C:\Program Files\Java\jre1.8.0_45\bin>keytool -exportcert -alias Informatheus -keystore C:\Users\Atendimento\Dropbox\AndroidKeystore\Keystore | C:\Users\Atendimento\Desktop\openssl\bin\openssl sha1 -binary | C:\Users\Atendimento\Desktop\openssl\bin\openssl base64
It worked.
The simplest way to get hash key released apk is : Get SHA1 key of released apk using following command:
keytool -list -v -keystore keystore_path.jks -alias keystoreAlias
Thn you will get SHA1 key. Copy that key and generate hash key using following site:
Link to get hash key
You will get Output (base64): copy it and use where you want..
This one is the easiest way i found so far for generating key hash!
try
{
PackageInfo info = getPackageManager().getPackageInfo(
"Your Package Name",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash:",Base64.encodeToString(md.digest(),Base64.DEFAULT));
}
} catch (PackageManager.NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}