获取发布密钥散列 [英] Get key hash for release
问题描述
我一直在试图让我的密钥散列为我释放了几个小时现在的工作,因为我已经搜索并尝试这么多不同的事情,我一定是做错了什么,
I have been trying to get my key hash for my release to work for hours now, and I must be doing something wrong because I have searched and tried so many different things,
现在可以说我的别名是john_doe_key,我的keysotre位于 /Users/loaner/Downloads/UEat/app/app-release.apk
Now lets say my alias is john_doe_key, and my keysotre is located at /Users/loaner/Downloads/UEat/app/app-release.apk
我会在我的终端看起来像这样有我的命令是否正确?
I would have my command in my terminal look like this correct?
keytool -exportcert -alias john_doe_key -keystore ~/Users/loaner/Downloads/UEat/app/app-release.apk | openssl sha1 -binary | openssl base64
或者是不正确的?
or is that not right?
我已经尝试这样做,登录般的脸书关键的指南中说。
I have tried this and logging the key like face books says in the guide.
感谢您的帮助提前
推荐答案
从阅读您的意见,看你有什么到目前为止,你想拿到钥匙哈希Facebook的,对吧?
From reading your comment and seeing what you have so far, you're trying to get the key hash for Facebook, right?
首先,确保你已经签署您的APK(这是你的应用程序)。您可以通过构建登录Android Studio中apk文件 - >生成签名APK ......。当您注册您的APK,您创建密钥库和该密钥库的别名。我觉得你是混乱的密钥库与APK。
First, make sure that you have signed your apk (which is your app). You can sign your apk in Android Studio by Build -> "Generate Signed APK...". When you sign your apk, you create your keystore and an alias for that keystore. I think your are confusing "keystore" with the "apk".
此外,你必须包括在命令您的别名和密钥存储的密码。
Also, you have to include your alias and keystore passwords in your command.
这应该是这样的:
keytool -exportcert -keystore keystore_file -alias alias_name -storepass keystorepassword -keypass aliaspassword | openssl sha1 -binary | openssl base64
此外,请确保您创建一个发布版本,可以从Build选择异体菜单。
Also, make sure that you are creating a "Release Build", which can be selected from the Build Variants menu.
这篇关于获取发布密钥散列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!