Questions on developing and releasing key hashes for the Facebook SDK for Android

I read the manuals on the FB developer website.

Creating development key hashes

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

And to create Release key hashes

 keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64 

I have 6 questions:

  • What do these hash keys do?

  • Why is there a need to create different key hashes for Release and Development ?

  • If I have not published my application on the PlayStore. Can I use Release Key instead of using Development key ?

  • If I use the application in the PlayStore, can I use the Development key?

  • What should I put in YOUR_RELEASE_KEY_ALIAS and YOUR_RELEASE_KEY_PATH ? Can someone provide samples please?

  • Why does this happen when we develop for iOS, these key hashes were not required?

Additional question that is not related

What does this Single Sign On button do? enter image description here

+6
source share
4 answers

Q: What do these key hashes do?

  • They uniquely identify your keystore and application. This is a unique fingerprint for your application:

Signing your applications

  • Android requires all applications to be digitally signed with a certificate before they can be installed. Android uses this certificate to determine the author of the application, and the certificate does not need to be signed by a certification authority. Android applications often use self-signed certificates. The application developer has a private key certificate.

Signature Overview

  • You can sign the application in debug or release mode. You sign your application in debug mode during development and in release mode when you are ready to distribute your application. The Android SDK generates a certificate for signing applications in debug mode. To sign applications in release mode, you need to generate your own certificate. For more information, you can see which keys are in

http://developer.android.com/tools/publishing/app-signing.html

https://developers.facebook.com/docs/facebook-login/android

Q: Why is there a need to create different key hashes for Release and Development?

As you know, the android uses different Keystores for both development and release, since the two keystores are different in all aspects, they both have different fingerprints and SHA-1 hashes, so they are treated completely differently.

Q: If I have not published my application on the PlayStore yet. Can I use the Release key instead of using the development key?

Yes, you can use the release key for generating APKs, but if you are in debug mode, this key does not work at all.

Q: If I use my application on the PlayStore, can I continue to use the development key?

Yes, you can continue to use the development key, but you cannot use the debug key.

Q: What should I put in YOUR_RELEASE_KEY_ALIAS and YOUR_RELEASE_KEY_PATH? Can someone provide samples please?

attached image if you are concerned about facebook keys enter image description here

Q: Why does this happen when we develop for iOS, these key hashes were not required?

This is due to platform requirements. It is not necessary that another platform be required on one platform.

Single sign-on

Single sign-on is an extension (and replacement) of services such as Facebook Connect, connection to third-party social applications and services. If you are already logged in to Facebook on your mobile phone, you can log in to other applications using your Facebook credentials.

Here is the code for generating the fb fingerprint.

 public void generateFbFingerPrint() { try { PackageInfo info = getPackageManager().getPackageInfo( "com.group3amd.gc.activity", PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); String sign = Base64 .encodeToString(md.digest(), Base64.DEFAULT); Log.e("KEYHASH:", sign); Toast.makeText(getApplicationContext(), sign, Toast.LENGTH_LONG) .show(); } } catch (NameNotFoundException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } } 
+7
source

What do these key hashes do?

  • Android requires all applications to be digitally signed with a certificate before they are installed. Android uses this certificate to identify the author of the application, and the certificate does not need to be signed by a certification authority. therefore, both keys were used to digitally subscribe your application.

Why is there a need to create different key hashes for both Release and development?

  • You sign your application in Development key debugging mode during development and release key when you are ready to distribute your application on Google Play.

If I have not published my application on the PlayStore. Can I use the Release key instead of using the development key?

  • you need to use release key at this moment

If I use my application on the PlayStore, can I continue to use the development key?

  • Google Play doesn’t allow you to download APKs using a debug key, so you need to use release key

What needs to be placed in YOUR_RELEASE_KEY_ALIAS and YOUR_RELEASE_KEY_PATH? Can someone provide samples please?

  • YOUR_RELEASE_KEY_ALIAS: use whatever name you like (just to remember the name of the keystore)
  • YOUR_RELEASE_KEY_PATH: path where you want to save the keystore file (for future use)

A warning. Keep the keystore and private key in a safe and secure place and make sure you have a secure backup. If you publish the application on Google Play and then lose the key with which you signed the application, you will not be able to publish any updates for your application, since you must always sign all versions of your application with the same key.


Why is this, when we are developing for iOS, these key hashes not required?

  • The ios developer also requires that these keys from the Apple development team generate a certificate for development and release. which we must use in the development and release process

this is, first of all, about the android and Google play application for FACEBOOK , you need to create different key hash for development and updating

how to create keyhash for facebook

+3
source

This is your answer.

  • Hashes of development keys . This is only for testing, until you publish the game store. Release Key hashes are an original hash key without this key hash. Facebook does not work in the play store.

  • There is no need to create 2 haseh keys if you create Key Key Storage and then you do not need to create Development Key Hashes

  • yes without a key release Facebook hashes do not work in the playback store.
  • No Hashes of development keys are intended only for hash key verification.
  • Yes, they can do it.
+2
source

Facebook uses a key hash to authenticate the interaction between your application and the Facebook application.

If you run applications that use Facebook Login, you need to add your hash code for Android development to your Facebook developer profile. For the version of your application that you release for you, you also need to generate and set Release key hashing.

On any OS X or Windows, you can get the key by creating it or using the value returned by the Settings.getApplicationSignature (Context) parameter.

For more information, see the link below.

https://developers.facebook.com/docs/android/getting-started

0
source

All Articles