如何通过Android CTS测试—testPackageSignatures

1、android key
android源码编译使用的默认key:
android\build\target\product\security\ .pk8 .pem 文件
要对Android系统进行签名,需要生成四种类型的key文件。 (build\target\product\security\ 下的README 文件有说明)
1)testkey
2)media
3)shared
4)platform
2、编译生成key
2.1进入android_src/development/tools目录,依次执行以下四个命令:

(1)                                     #  ./make_key platform   '/C=CN/ST=BeiJing/L=BeiJing/O=ingenic/OU=software/CN=snmu/emailAddress=xxxxxx@qq.com'

(接着会打印如下信息:)
Enter password for ‘platform’ (blank for none; password will be visible): <——- 设置你的密码(设置为空,也就是直接按回车键)
creating platform.pk8 with no password
Generating RSA private key, 2048 bit long modulus
.+++
…….+++
e is 65537 (0x10001)

(2) # ./make_key media ‘/C=CN/ST=BeiJing/L=BeiJing/O=ingenic/OU=software/CN=snmu/emailAddress=xxxxxxx@qq.com’
(接着会打印如下信息)
Enter password for ‘media’ (blank for none; password will be visible):<——- 设置你的密码(设置为空也就是直接按回车键)
creating media.pk8 with no password
Generating RSA private key, 2048 bit long modulus
…………..+++
……..+++
e is 65537 (0x10001)

(3) # ./make_key shared
‘/C=CN/ST=BeiJing/L=BeiJing/O=ingenic/OU=software/CN=snmu/emailAddress=xxxxxxx@qq.com’
(接着会打印如下信息)
Enter password for ‘shared’ (blank for none; password will be visible):<——- 设置你的密码(设置为空也就是直接按回车键)
creating shared.pk8 with no password
Generating RSA private key, 2048 bit long modulus
……………+++
..+++
e is 65537 (0x10001)

(4) # ./make_key testkey
‘/C=CN/ST=BeiJing/L=BeiJing/O=ingenic/OU=software/CN=snmu/emailAddress=xxxxxxx@qq.com’
(会打印如下信息)
Enter password for ‘testkey’ (blank for none; password will be visible):<——- 设置你的密码(设置为空也就是直接按回车键)
creating testkey.pk8 with no password
Generating RSA private key, 2048 bit long modulus
………+++
…………………………………+++
e is 65537 (0x10001)

提示:make_key的参数。第一个参数是要生成key的名字,第二个参数是关于你公司的信息。key的名字就是前面提到的4中类型的key,公司信息的参数比较多,它们的含义如下:
  C   --->  Country Name (2 letter code)
  ST  --->  State or Province Name (full name)
  L   --->  Locality Name (eg, city)
  O   --->  Organization Name (eg, company)
  OU  --->  Organizational Unit Name (eg, section)
  CN  --->  Common Name (eg, your name or your server’s hostname)
  emailAddress --->  Contact email address   

2.2 进入android_5.1/build/target/product/security/ 目录,执行以下两个命令:
#cp ../../../../development/tools/*.pk8 ./
#cp ../../../../development/tools/*.pem ./
3、重新编译android源码,生成boo.img system.img 烧录即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值