本文共 2471 字,大约阅读时间需要 8 分钟。
只写实用性
文章末尾有对应资料下载,可以直接使用
参考:
此路坑:
报错:
Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
原因:as生成的jks有问题,换一台电脑,as生成
下载地址:
末文也会给出一个地址========= my key =====================================================================================================\development\tools\make_key2019-10-23 19:30 just for gzopenssl genrsa -3 -out testkey.pem 2048openssl genrsa -3 -out platform.pem 2048openssl genrsa -3 -out shared.pem 2048openssl genrsa -3 -out media.pem 2048openssl req -new -x509 -key testkey.pem -out testkey.x509.pem -days 10000 -subj '/C=CN/ST=Sicuan/L=Chengdu/O=Hsae/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱openssl req -new -x509 -key platform.pem -out platform.x509.pem -days 10000 -subj '/C=CN/ST=Sicuan/L=Chengdu/O=Hsae/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱openssl req -new -x509 -key shared.pem -out shared.x509.pem -days 10000 -subj '/C=CN/ST=Sicuan/L=Chengdu/O=Hsae/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱openssl req -new -x509 -key media.pem -out media.x509.pem -days 10000 -subj '/C=CN/ST=Sicuan/L=Chengdu/O=Hsae/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱openssl pkcs8 -in testkey.pem -topk8 -outform DER -out testkey.pk8 -nocryptopenssl pkcs8 -in platform.pem -topk8 -outform DER -out platform.pk8 -nocryptopenssl pkcs8 -in shared.pem -topk8 -outform DER -out shared.pk8 -nocryptopenssl pkcs8 -in media.pem -topk8 -outform DER -out media.pk8 -nocryptsh make_key testkey /C=CN/ST=Sicuan/L=Chengdu/O=My/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱sh make_key platform /C=CN/ST=Sicuan/L=Chengdu/O=My/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱sh make_key shared /C=CN/ST=Sicuan/L=Chengdu/O=My/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱sh make_key media /C=CN/ST=Sicuan/L=Chengdu/O=My/OU=MySoft/CN=这里填你的名字/emailAddress=这里填你的邮箱============================================================================================================================
执行命令生成导入签名的jks
代码模板:./keytool-importkeypair -k [jks文件名] -p [jks的密码(是key store path密码)] -pk8 platform.pk8 -cert platform.x509.pem -alias [jks的别名]
./keytool-importkeypair -k mySignSys.jks -p 123456 -pk8 platform.pk8 -cert platform.x509.pem -alias myhsaekey
新生成了mySignSys.jks,这个签名是注入了
在应用 build.gradle 下 配置debug签名
在 AndroidManifest.xml 中加上 sharedUserId项目地址:
另一种签名签名方式:
转载地址:http://vgyrf.baihongyu.com/