Android SHA1证书指纹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20073940/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SHA1 certificate fingerprint
提问by Marshall
I am trying to make an app that can communicate with Google Cloud Messaging. I have looked at some tutorials and read a lot of stuff, but it all skips one point. When configuring an Android Key for API Project it asks for a SHA1 certificate fingerprint.
我正在尝试制作一个可以与 Google Cloud Messaging 通信的应用程序。我看过一些教程并阅读了很多东西,但都跳过了一点。为 API 项目配置 Android 密钥时,它会要求提供 SHA1 证书指纹。
How do I find this (I have eclipse and windows 7)?
我如何找到这个(我有 eclipse 和 windows 7)?
Any help would be appreciated.
任何帮助,将不胜感激。
回答by Rishabh Srivastava
Here is how to get it :
In Eclipse, if you go to Windows ->Preferences -> Android -> Build.
以下是获取它的方法:
在 Eclipse 中,如果您转到 Windows -> Preferences -> Android -> Build。
回答by Ravneet Singh
You can get SHA1 from here using the steps and Keystore Password with be "android".
您可以使用“android”的步骤和密钥库密码从此处获取 SHA1。
回答by Pir Fahim Shah
if you are working in android (Google drive apps, Google Map apps), and you need SHA1 or MD5 then follow this step to get your SHA1 and MD5.
如果您使用的是 android(Google Drive 应用程序、Google Map 应用程序),并且需要 SHA1 或 MD5,请按照此步骤获取 SHA1 和 MD5。
- Open Eclipse
- Windows-->Preferences-->Android-->Build (Here you will got a path to your "debug.keystore" Copy this path.
- Find out where is your jdk (like in my system "C:\Program Files\java\jdk1.6\bin " Now open TERMINA(cmd) and change the directory to the bin , like c:\ cd "C:\Program Files\java\jdk1.6\bin"
- Now after that copy-paste this code in your terminal
- 打开日食
- Windows-->Preferences-->Android-->Build(在这里你会得到“debug.keystore”的路径复制这个路径。
- 找出你的 jdk 在哪里(就像在我的系统中“C:\Program Files\java\jdk1.6\bin”现在打开 TERMINA(cmd) 并将目录更改为 bin ,例如c:\ cd "C:\Program文件\java\jdk1.6\bin"
- 现在,在您的终端中复制粘贴此代码
keytool -list -v -keystore "C:\Users\pir fahim shah.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
keytool -list -v -keystore "C:\Users\pir fahim shah.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
you can change your "debug.keystore" file address here.
您可以在此处更改“debug.keystore”文件地址。
Some snapshot which will show my process
一些快照将显示我的过程
回答by Prakash
Found debug keystore file on Mac with Android Studio at ~/.android/debug.keystore
使用 Android Studio 在 Mac 上找到调试密钥库文件 ~/.android/debug.keystore
keytool -list -v -keystore ~/.android/debug.keystore
回答by Jayaprakash G
- Open Android Studio
- Open Your Project
- Click on Gradle (From Right Side Panel, you will see Gradle Bar)
- Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
- Click on Your Project (Your Project Name form List (root))
- Click on Tasks
- Click on android
- Double Click on signingReport (You will get SHA1 and MD5 in Run Bar)
- Check app run console bar
- 打开安卓工作室
- 打开你的项目
- 单击 Gradle(从右侧面板,您将看到 Gradle Bar)
- 单击刷新(单击 Gradle Bar 中的 Refresh,您将看到列出项目的 Gradle 脚本)
- 单击您的项目(您的项目名称表单列表(根))
- 点击任务
- 点击安卓
- 双击signatureReport(您将在运行栏中获得SHA1和MD5)
- 检查应用程序运行控制台栏
回答by Rahul Sharma
For Debug Versionof SHA1 key open terminal and enter the following command.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
对于SHA1 密钥的调试版本,打开终端并输入以下命令。
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Note: If you find any error you may need to change path of your debug.keystore file(In my case it is "/.android/debug.keystore").
注意:如果您发现任何错误,您可能需要更改 debug.keystore 文件的路径(在我的情况下它是“/.android/debug.keystore”)。
For Release Versionof SHA1 key, first you need to generate signed apk. After that you will get .jks file. Then apply the following command in terminal.
keytool -list -v -keystore ~/.android/release.jks -alias ProjectName
对于发布版本的 SHA1 密钥,首先您需要生成签名的 apk。之后,您将获得 .jks 文件。然后在终端中应用以下命令。
keytool -list -v -keystore ~/.android/release.jks -alias ProjectName
Note: If you find any error you may need to change path of your release.keystore file(In my case it is "/.android/release.keystore").
注意:如果您发现任何错误,您可能需要更改 release.keystore 文件的路径(在我的情况下它是“/.android/release.keystore”)。
回答by Md Sufi Khan
I found a very easy process to find you MD5, SHA-1 fingerprint using Android Studio.
我找到了一个使用 Android Studio 找到 MD5、SHA-1 指纹的非常简单的过程。
- Run your project
- Go to Gradle Menu (Menu: View -> Tool Windows -> Gradle)
- Go to 'signingReport' in Gradle window. (Your project -> Tasks -> android -> signingReport)
- Run it. (Using double-click or Ctrl + Shift + F10)
- In Run window you will find all info.
- 运行你的项目
- 转到 Gradle 菜单(菜单:查看 -> 工具窗口 -> Gradle)
- 转到 Gradle 窗口中的“signingReport”。(您的项目 -> 任务 -> android -> 签名报告)
- 运行。(使用双击或 Ctrl + Shift + F10)
- 在运行窗口中,您将找到所有信息。
回答by Ismaran Duwadi
The best solution for generating SHA1 key for android is from android studio.
为 android 生成 SHA1 密钥的最佳解决方案来自 android studio。
Click on Gradle on far right side
单击最右侧的 Gradle
Click on refresh icon and you will see the name of the app
单击刷新图标,您将看到应用程序的名称
Click on the Tasks -> Report -> Signing Report
点击任务 -> 报告 -> 签名报告
Find the SHA1 Key on bottom part in console
在控制台底部找到 SHA1 密钥