Command line jarsigner sign and resolve certificate chain not found error

Command line jarsigner sign and resolve certificate chain not found error

question:

I'm learning Ionic3 recently, and then I made a page, and I want to test it on my Android phone. As a result, an error is reported when the jarsignersignature .

Error picture:

screenshot of error

Solution

Explanation of the command line

jarsigner -verbose -keystore [your private key storage path] -signedjar [signed file storage path] [unsigned file path] [your certificate alias]
Please see the last parameter: [您的证书的别名], not our keystore 文件名is because this problem

The correct command line to use is

jarsigner -verbose -keystore my-release-key.keystore -signedjar complete.apk app-release-unsigned.apk alias_name

How to check file aliases

You need to keytoolsee keystorethe command used when using the make file:

keytool -genkey -v -keystore [keystore的文件名] -alias [别名] -keyalg RSA -keysize 2048 -validity 10000

Parameter Description:

-keyalg RSA    --产生键的加密算法
-validity 40000 --有效期限4000天

The command I use is:

 keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

So my alias is: alias_name.

correctly displayed figure

normal display

Note

  1. When using the jarsignersignature , pay special attention to whether the last parameter is 别名or not 文件名.
  2. Attach the picture I show on the simulator
    Program display diagram

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325684199&siteId=291194637