Android查看签名证书Hash指纹和应用签名

前提

安装Java JDK并配置好Java环境变量,执行如下命令:

*******$ keytool

如果输出如下内容,则说明Java环境变量配置成功。

Commands:

 -certreq            Generates a certificate request
 -changealias        Changes an entry's alias
 -delete             Deletes an entry
 -exportcert         Exports certificate
 -genkeypair         Generates a key pair
 -genseckey          Generates a secret key
 -gencert            Generates certificate from a certificate request
 -importcert         Imports a certificate or a certificate chain
 -importpass         Imports a password
 -importkeystore     Imports one or all entries from another keystore
 -keypasswd          Changes the key password of an entry
 -list               Lists entries in a keystore
 -printcert          Prints the content of a certificate
 -printcertreq       Prints the content of a certificate request
 -printcrl           Prints the content of a CRL file
 -storepasswd        Changes the store password of a keystore

查看签名证书指纹

执行如下命令查看签名证书的各种指纹,将keystore替换为自己的签名证书:

******$ keytool -list -v -keystore ~/Downloads/{keystore}

会输出如下信息:
在这里插入图片描述
注意:一定要到-v,否则只显示SHA1的指纹信息

查看应用的签名信息

Android应用默认采用MD5码作为应用的签名信息,按如下步骤查看应用的签名信息:

  • 查找应用中存储签名文件的路径
******$ tar -tf ./app/dev/debug/my.apk | grep RS

输出如下信息
在这里插入图片描述

  • 从应用中解压出签名文件
******$ tar -xf ./app/dev/debug/my.apk META-INF/CERT.RSA
  • 获取应用的签名信息
******$ keytool -printcert -file META-INF/CERT.RSA

输出如下信息:
在这里插入图片描述
其中的MD5码就是应用的签名。
也可以使用openssl查看证书更详细的信息,命令如下:

openssl pkcs7 -inform DER -in CERT.RSA -print_certs -noout -text
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值