Windows is always a little hairy and complicated to get keytool, I offer an alternative. Run the following code in the onCreate method of your application:
try { PackageInfo info = getPackageManager().getPackageInfo( "COM.YOUR.PACKAGE.NAME", PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); Log.d("My Keyhash", Base64.encodeToString(md.digest(), Base64.DEFAULT)); } } catch (Exception e) { Log.e("My Keyhash", e.toString()); }
and watch log output in logcat to get your keyhash. Be sure to replace the package name above.
EDIT:
the key hash is loaded correctly, but the session still does not open ... when logging into facebook, it first asks for my permission, and the application receives the message "com.facebook.facebookexception: Session Provided for the request in an unopened state"
Make sure you have this code in the "Snippet / Activity" section:
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); uiHelper.onActivityResult(requestCode, resultCode, data); }
source share