안드로이드
안드로이드 릴리즈 키해시 얻기
초코비니
2015. 8. 28. 15:43
- First open a terminal (open a command prompt in windows).
- Navigate in the terminal to the directory where your Android debug.keystore is stored.
- Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and Settings\.android).
Once you are in the “.android” directory, run the following command.
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
When it prompts you for a password, type android and hit Enter
Copy the value printed in the terminal that ends with an “=” and paste it in the Key Hash field in Facebook. Then click the Save Changes button.
private void getAppKeyHash() {
try {
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(), 0));
Log.d("Hash key", something);
}
} catch (Exception e) {
// TODO Auto-generated catch block
Log.e("name not found", e.toString());
}
}
출처 : http://stackoverflow.com/questions/6661993/how-to-generate-key-hash-for-facebook-sdk-in-mac