Apk签名本质上是jar签名,用到jre提供的两个工具(在jre和jdk的bin目录):
keytool -genkey -keystore baijifeilong-keystore -alias baijifeilong
在baijifeilong-keystore这个密钥仓库新建一个baijifeilong密钥。如果仓库不存在,则在当前目录生成,生成的文件名是baijifeilong-keystorejarsigner -keystore baijifeilong-keystore foo.apk baijifeilong
用baijifielong-keystore密钥仓库的baijifielong密钥对foo.apk进行签名keytool -genkey -alias baijifeilong
jarsigner foo.apk baijifeilong
keytool -genkey
jarsigner foo.apk mykey
jar -jar sign.jar foo.apk
签名后的apk为foo.s.apk
jarsigner -verify foo.jar