给未签名apk加签

1.根据keystore获得证书:app

sudo keytool -export -alias alianame -keystore 'keystore file' -file app.cercode

2.查看证书信息:it

keytool -printcert -file app.cerjdk

3.给未签名apk加签file

jarsigner -tsa http://timestamp.digicert.com -verboserust

-sigalg SHA1withRSA -digestalg SHA1

 -keystore keystore_file -signedjar signed.apk unsigned.apk signaliasim

4.查看加签后的apkdi

jarsigner -certs -verbose  -verify signed.apk证书

其中keytool和jarsigner为jdk本身提供。co

有个问题就是加签后的apk,在第4部可能包如下信息:

sm

  ...

 [CertPath 未验证: Path does not chain with any of the trust anchors] 这样的话生成的apk将在某些手机上没法安装。这一问题还没有解决。

相关文章
相关标签/搜索