Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Sep 30, 2017 at 02:06 PM by Bunny83 for the following reason:

The question is answered, right answer was accepted

avatar image
4
Question by aksh2143 · Oct 24, 2015 at 11:44 AM · facebookunity 4keyhashkeyhash

How to generate Key Hash for facebook?

I am trying to generate Key Hash for my Unity game.For that i am using below command but it is showing result as the image shown. Even i enter any password or not, its not working. Now what should i do to get key hash? The commad is: keytool -exportcert -alias androiddebugkey -keystore "C:\Users\8000402143.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base32

[1]: /storage/temp/56852-1.jpg

1.jpg (155.6 kB)
Comment
Comments Locked
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
25
Best Answer

Answer by Niks4Linux · Oct 28, 2015 at 01:05 PM

Following are 2 solutions which worked for me.You can try any of them.

Solution 1:

In order to generate key hash you need to follow some easy steps.

1) Download Openssl from:

http://code.google.com/p/openssl-for-windows/downloads/list

2) Make a openssl folder in C drive

3) Extract Zip files into this openssl folder created in C Drive.

4) Copy the File debug.keystore from .android folder in my case (C:\Users\SYSTEM.android) and paste into JDK bin Folder in my case (C:\Program Files\Java\jdk1.6.0_05\bin)

5) Open command prompt and give the path of JDK Bin folder in my case (C:\Program Files\Java\jdk1.6.0_05\bin).

6) Copy the following code and hit enter

 keytool -exportcert -alias androiddebugkey -keystore debug.keystore > c:\openssl\bin\debug.txt

7) Now you need to enter password, Password = android.

8) If you see in openssl Bin folder, you will get a file with the name of debug.txt

9) Now either you can restart command prompt or work with existing command prompt

10) get back to C drive and give the path of openssl Bin folder

11) copy the following code and paste

 openssl sha1 -binary debug.txt > debug_sha.txt

12) you will get debug_sha.txt in openssl bin folder

13) Again copy following code and paste

 openssl base64 -in debug_sha.txt > debug_base64.txt

14) you will get debug_base64.txt in openssl bin folder

15) open debug_base64.txt file Here is your Key hash.

Solution 2:

1) Copy all files from openssl/bin folder that is libeay32.dll,openssl.exe,ssleay32.dll to JDK bin folder. In my case it is "c:\program files\java\jdk1.7\bin"

2) If You'll already having Facebook SDK installed in Unity.So,restart Unity.

3)Go to Facebook->Edit Settings.And in the Inspector View you can see your Android Hash key for facebook.

alt text


facebookeditsetting.png (131.6 kB)
Comment
Comments Locked · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ronbonomo · Feb 15, 2017 at 07:37 AM 0
Share

This didn't work. Is there an updated method to accomplish getting key hash for facebook sdk?

avatar image StartStart · May 17, 2017 at 08:15 AM 0
Share

Solution 2 is worked for me thanks!

avatar image JachinWu · Jun 07, 2017 at 02:27 AM 1
Share

It works for me. Thanks!
If I follow facebook's guide as below command line, I got different hash key and doesn't work in game (hash key not matched). That's weired.
keytool -exportcert -alias androiddebugkey -keystore %HO$$anonymous$$EPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64

avatar image EllisonLee JachinWu · Jun 27, 2017 at 07:09 AM 0
Share

I think it's depend on how you build your android apk. Do you use the keystore file to build your apk?

AnyWay. I put both the two hashkey in my facebook setting panel.

avatar image VIVEK232 · Jul 19, 2017 at 06:16 AM 0
Share

Solution 2 Work for me....Thanks!.

avatar image mmc_unity · Aug 13, 2017 at 10:39 AM 0
Share

it works. thx a lot

Show more comments

Follow this Question

Answers Answers and Comments

38 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Facebook Hash key error 0 Answers

Which android debug hash key to add in Facebook Application ? 0 Answers

Getting android key hash for facebook 5 Answers

Facebook Invalid key hash on public app 0 Answers

How to Setup Openssl & Facebook SDK With Android key HASH on mac OS 10.11.6 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges