Signing Builds(系统签名文件的生成)

15 篇文章 1 订阅

1.shell脚本的编写(mkkey.sh):

#!/bin/bash

country=China
province=Guangdong
city=Shenzhen
company=ELINK
section=Android
name=weicaihui2008
email=weicaihui2008@163.com

AUTH='/C=$country/ST=$province/L=$city View/O=$company/OU=$section/CN=$name/emailAddress=$email'

if [[ $# -lt 1 ]]; then
	echo "Create a test certificate key."
	echo "Usage: $0 NAME"
	echo "Will generate NAME.pk8 and NAME.x509.pem"
	echo "eg: $AUTH"
	echo "Note:"
	echo "      C ---> Country Name (2 letter code)"
	echo "      ST ---> State or Province Name (full name)"
	echo "      L ---> Locality Name (eg, city)"
	echo "      O ---> Organization Name (eg, company)"
	echo "      OU ---> Organizational Unit Name (eg, section)"
	echo "      CN ---> Common Name (eg, your name or your server’s hostname)"
	echo "      emailAddress ---> Contact email address"
	exit
elif [[ $# -gt 1 ]]; then
	AUTH=$2
fi

openssl genrsa -3 -out $1.pem 2048

openssl req -new -x509 -key $1.pem -out $1.x509.pem -days 10000 \
    -subj "$AUTH"

echo "Please enter the password for this key:"
openssl pkcs8 -in $1.pem -topk8 -outform DER -out $1.pk8 -passout stdin

2.要生成签名文件:

platform. Key for packages that are part of the core platform.
shared. Key for things that are shared in the home/contacts process.* 
media. Key for packages that are part of the media/download system.
releasekey. Default key to sign with if not otherwise specified

3.如何生成:
./mkkey.sh 参数1 参数2
参数1: 生成的签名文件名称
参数2:证书配置信息,可以不要这个参数,使用默认,帮助直接运行脚本

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值