通过AndroidStudio生成签名文件
-
在 Build 菜单中选择 Generate Signed Bundle / APK
-
选择 APK,点击 Next 下一步
![](https://img.haomeiwen.com/i5540252/959cf575770d6ed6.png)
- 点击 Create new... 创建密钥库
![](https://img.haomeiwen.com/i5540252/415ed39c3cb4ac0e.png)
- 点击 Key store path 创建密钥库文件地址
![](https://img.haomeiwen.com/i5540252/433dc4e2c3aec6f8.png)
- 填写相关内容,点击ok
Key store path:密钥库文件的地址;
Password:密钥库密码; Confirm:确认密钥库密码;
Key:
Alias:密钥别称;
Password:密钥密码;Confirm:确认密钥密码;
Validity(years):密钥有效期;
Certificate:
First and Last Name:密钥颁发者姓名;
Organizational Unit:密钥颁发组织单位;
Organization:密钥颁发组织;
City or Locality:所在城市;
State or Province:所在州省;
Country Code:国家编码;
![](https://img.haomeiwen.com/i5540252/c1a275eaf3a01e50.png)
- 需要把 AS刚创建的JKS密钥库迁移到行业标准格式PKCS12
![](https://img.haomeiwen.com/i5540252/a845186a0d0763b6.png)
- 解决办法,输入指令创建成功
keytool -importkeystore -srckeystore /Users/joyrun/Documents/runner/runner.jks -destkeystore /Users/joyrun/Documents/runner/runnerkey.jks -deststoretype pkcs12
通过Terminal获取SHA1和MD5值
- 输入命令keytool -v -list -keystore keystore文件路径
- 输入Keystore密码[图片上传中...(image.png-dcffb3-1636340422932-0)]
![](https://img.haomeiwen.com/i5540252/033d96e60f5d4f4e.png)
Gen_Signature_Android签名获取工具
https://developers.weixin.qq.com/doc/oplatform/Downloads/Android_Resource.html
![](https://img.haomeiwen.com/i5540252/51606f9fbe8c2c86.png)
散列秘钥获取
keytool -exportcert -alias yoursAlisa -keystore Yours.jks | openssl sha1 -binary | openssl base64
在Android Studio的Terminal里输入上述命令: 其中yoursAlisa为你的签名alias; Yours.jks为你的签名。
网友评论