Skip to content

Instantly share code, notes, and snippets.

@pjnovas
Last active July 18, 2017 06:03
Show Gist options
  • Save pjnovas/d1b9e141b2b4876f2f1b to your computer and use it in GitHub Desktop.
Save pjnovas/d1b9e141b2b4876f2f1b to your computer and use it in GitHub Desktop.
Generate HasKeys for a Phonegap app with Android - Debug and Release

Download and install:

Only versions e or d DO NOT USE k


  1. Navigate to C:\Program Files (x86)\Java\jre7\bin
  2. Generate the hash
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\openssl.exe" base64

password: android (default if you didn't change it in the past)

Then copy the key printed at terminal and past it on Facebook APP config section

More Info

PhoneGap Build

  1. Go to PhoneGap Build
  2. Click on your profile photo > Edit Account > Signing Keys
  3. Under Android > add key
  4. Choose the debug.keystroke at %HOMEPATH%\.android\debug.keystore
  5. Put the pasword you used before (i.e. android)
  6. Compile [In Debug mode] your app selecting the key you've just added

Download and install:

Only versions e or d DO NOT USE k


  • Navigate to C:\Program Files (x86)\Java\jre7\bin
  • Create a Private key
keytool -genkey -v -keystore my-private-key.keystore -alias myalias -keyalg RSA -keysize 2048 -validity 10000

-validity 10000 means this keys is valid for 10000 days which is 27 years. Google Play requires a validity time greater than 25 Years.

  • Fill the information asked and set a password (i.e. mypass)
  • This will generate a my-private-key.keystroke file
  • Generate the Hash for that keystroke:
keytool -exportcert -alias myaliase -keystore my-private-key.keystore | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\openssl.exe" base64

Then copy the key printed at terminal and past it on Facebook APP config section (Android > Key Hashes)

More Info

PhoneGap Build

  1. Go to PhoneGap Build
  2. Click on your profile photo > Edit Account > Signing Keys
  3. Under Android > add key > Title: "release", Alias: "myalias"
  4. Choose the organizador.keystroke at C:\Program Files (x86)\Java\jre7\bin
  5. Click on the PadLock button and put the pasword you used before both times (i.e. mypass)
  6. Compile [In Release mode] your app selecting the key you've just added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment