초코비니

안드로이드 릴리즈 키해시 얻기 본문

안드로이드

안드로이드 릴리즈 키해시 얻기

초코비니 2015. 8. 28. 15:43
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


  1. First open a terminal (open a command prompt in windows).
  2. Navigate in the terminal to the directory where your Android debug.keystore is stored.
  3. Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and Settings\.android).
  4. Once you are in the “.android” directory, run the following command.

    keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64

  5. When it prompts you for a password, type android and hit Enter

  6. 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


Comments