将系统签名platform.x509.pem、platform.pk8转为android studio可以直接使用的签名文件platform.keystore,发生错误:
./keytool-importkeypair: Permission denied
keytool下载地址:
https://github.com/getfatday/keytool-importkeypair
工具不能在Windows环境下使用,我是在centos中执行,需要给keytool-importkeypair文件权限:
[root@localhost soft]# chmod 7777 keytool-importkeypair
再次执行生成即可:(-p 后面的android是密码,-alias后面的是别名)
[root@localhost soft]# ./keytool-importkeypair -k ./platform.keystore -p android -pk8 platform.pk8 -cert platform.x509.pem -alias platform
Importing "platform" with SHA1 Fingerprint=AC:D4:A9:E4:01:8E:A1:F1:55:4B:D2:60:5A:E4:55:F6:DF:0F:2A:F2
Importing keystore /tmp/keytool-importkeypair.pFOG/p12 to ./platform.keystore...
Entry for alias platform successfully imported.
Import command completed: 1 entries successfully imported, 0 entries failed or cancelled
Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore ./platform.keystore -destkeystore ./platform.keystore -deststoretype pkcs12".