本文翻译自:SHA-1 fingerprint of keystore certificate
Is the method for getting a SHA-1 fingerprint the same as the method of getting the a fingerprint? 获取SHA-1指纹的方法是否与获取指纹的方法相同? Previously, I was running this command: 以前,我运行以下命令:
It's not clear to me if the result I'm getting is the SHA-1 fingerprint. 我不清楚我得到的结果是否为SHA-1指纹。 Can somebody clarify this? 有人可以澄清吗?
#1楼
参考:https://stackoom.com/question/13zY0/密钥库证书的SHA-指纹
#2楼
Follow this tutorial for creating SHA1 fingerprint for Google Map v2 请按照本教程为Google Map v2创建SHA1指纹
For Debug mode: 对于调试模式:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
for Release mode: 对于发布模式:
keytool -list -v -keystore {keystore_name} -alias {alias_name}
example: 例:
keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test
#3楼
Run the following command to get your sha1: keytool -v -list -keystore "< debug.keystore path >"
运行以下命令以获取您的sha1: keytool -v -list -keystore "< debug.keystore path >"
If you do not know the path of debug.keystore
, you may find your debug.keystore
path by checking windows-->preferences-->android-->build
如果您不知道debug.keystore
的路径,则可以通过检查debug.keystore
windows-->preferences-->android-->build
来找到debug.keystore
路径。
I prepared step by step tutorial to show how you can use google map android v2 on emulator(android 4.2.2) 我准备了分步教程来展示如何在模拟器上使用google map android v2(android 4.2.2)
have a look at to my blog: http://umut.tekguc.info/en/content/google-android-map-v2-step-step 看看我的博客: http : //umut.tekguc.info/en/content/google-android-map-v2-step-step
#4楼
If you are using eclipse, go to: Window->Preferences->Android->Build You will find what you are looking there. 如果您使用的是eclipse,请转到: 窗口->首选项->安卓->构建您将在其中找到所需的内容。
#5楼
First there is same .jar
file that in fb-sdk android-support-v4.jar
. 首先,在fb-sdk android-support-v4.jar
存在相同的.jar
文件。
Then generate SHA1
key using: 然后使用以下命令生成SHA1
密钥:
PackageInfo info;
try {
info = getPackageManager().getPackageInfo(
"com.example.worldmission", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(), 0));
Log.e("Hash key", something);
System.out.println("Hash key" + something);
}
} catch (NameNotFoundException e1) {
Log.e("name not found", e1.toString());
} catch (NoSuchAlgorithmException e) {
Log.e("no such an algorithm", e.toString());
} catch (Exception e) {
Log.e("exception", e.toString());
}
#6楼
Go to your java bin directory via the cmd: 通过cmd转到Java bin目录:
C:\\Program Files\\Java\\jdk1.7.0_25\\bin> C:\\ Program Files \\ Java \\ jdk1.7.0_25 \\ bin>
Now type in the below comand in your cmd: 现在,在您的cmd中键入以下命令:
keytool -list -v -keystore "c:\users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android