android SHA1 how to obtain a security code

1, the test version of the SHA1 how to obtain?
Open the terminal, the user switch to the root directory, directory into the .android, LS can see the file debug.keystore


lishuaikangdeMacBook-Pro:~ lishuaikang$ cd .android/
lishuaikangdeMacBook-Pro:.android lishuaikang$ ls
adb_usb.ini analytics.settings build-cache debug.keystore emu-update-last-check.ini
adbkey avd build-cache.lock debug.keystore.lock modem-nv-ram-5554
adbkey.pub breakpad cache emu-last-feature-flags.protobuf
lishuaikangdeMacBook-Pro:.android lishuaikang$ keytool -list -v -keystore debug.keystore
输入密钥库口令: 
密钥库类型: jks
密钥库提供方: SUN

您的密钥库包含 1 个条目

别名: androiddebugkey
创建日期: 2019-5-27
条目类型: PrivateKeyEntry
证书链长度: 1
证书[1]:
所有者: C=US, O=Android, CN=Android Debug
发布者: C=US, O=Android, CN=Android Debug
序列号: 1
有效期为 Mon May 27 23:02:05 CST 2019 至 Wed May 19 23:02:05 CST 2049
证书指纹:
MD5: 4D:47:B8:46:35:D5:0C:C5:D6:DA:45:24:C4:40:82:40
SHA1: 01:82:50:BC:EA:28:48:EF:E8:F2:6D:AF:87:90:26:9D:54:78:85:75
SHA256: 27:24:43:1B:69:A2:0B:7E:78:30:13:1D:39:1D:87:88:FE:1C:10:83:C2:DB:1A:EE:59:C5:99:63:03:C2:1A:19
签名算法名称: SHA1withRSA
主体公共密钥算法: 1024 位 RSA 密钥
版本: 1


*******************************************
*******************************************



Warning:
JKS 密钥库使用专用格式。建议使用 "keytool -importkeystore -srckeystore debug.keystore -destkeystore debug.keystore -deststoretype pkcs12" 迁移到行业标准格式 PKCS12。
lishuaikangdeMacBook-Pro:.android lishuaikang$ 

SHA1 value of what we need.

2, release version of the SHA1 how to obtain?
First, we must first generate a keystore file
to switch to a directory, execute the command:

keytool -genkey -v -keystore release.keystore -alias releasekey

release.keystore is to be generated keystore file

Then in the ensuing prompted for a password, use a password are good. android can be.
When prompted, enter, do not enter directly Enter:

您的名字与姓氏是什么?
  [lishuaikang]:  lishuaikang
您的组织单位名称是什么?
  [Unknown]:  
您的组织名称是什么?
  [Unknown]:  
您所在的城市或区域名称是什么?
  [Unknown]:  
您所在的省/市/自治区名称是什么?
  [Unknown]:  
该单位的双字母国家/地区代码是什么?
  [CN]:  CN
CN=lishuaikang, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=CN是否正确?
  [否]:  yes

正在为以下对象生成 2,048 位DSA密钥对和自签名证书 (SHA256withDSA) (有效期为 90 天):
	 CN=lishuaikang, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=CN
输入 <releasekey> 的密钥口令
	(如果和密钥库口令相同, 按回车):  
再次输入新口令: 
[正在存储test.keystore]

Warning:
JKS 密钥库使用专用格式。建议使用 "keytool -importkeystore -srckeystore test.keystore -destkeystore test.keystore -deststoretype pkcs12" 迁移到行业标准格式 PKCS12。
lishuaikangdeMacBook-Pro:Documents lishuaikang$ ls
apache-maven-3.6.0	gradle-5.5.1		zookeeper-3.4.12
gradle-4.5.1		test.keystore
lishuaikangdeMacBook-Pro:Documents lishuaikang$ 

test.keystore is my generation.
Then run the test version of the SHA1 acquisition method can get the release version of the SHA1.

Published 139 original articles · won praise 35 · views 180 000 +

Guess you like

Origin blog.csdn.net/kanglovejava/article/details/101025465