1.签名文件简介
签名文件说明出处,标准的测试秘钥包含四个部分:testkey、platform、shared和media。
The following standard test keys are currently included:
testkey -- a generic key for packages that do not otherwise specify a key.
platform -- a test key for packages that are part of the core platform.
shared -- a test key for things that are shared in the home/contacts process.
media -- a test key for packages that are part of the media/download system.
testkey是没有指定特定秘钥的通用秘钥,可以用于开发阶段的普通apk签名(没有签名系统可能会在安装的时候就报错,不让安装)
platform主要用于平台app做签名,例如某个平台app需要访问到@SystemApi或者@hide注解的方法,就需要使用platform文件来签名应用。
shared 用于一些要共享数据应用数据的应用签名
media 用于媒体和系统下载应用签名
2.签名文件的生成
2.1命令行生成方式
生成秘钥对:openssl genrsa -3 -out testkey.pem 2048
生成pem格式的证书:openssl req -new -x509 -key testkey.pem -out testkey.x509.pem -days 10000 -subj '