使用 cordova cli 创建发布 apk 时解决证书过期警告

Resolve warning of expiration of certificate while creating release apk using cordova cli

我已经使用命令 keytool -genkey -v -keystore <KeystoreName.keystore> -alias <aliasname> -keyalg RSA -keysize 2048 -validity 10000

创建了一个密钥库

我用 10000 设置了有效性,一旦我用它创建了发布 apk,它工作正常但 3 个月后现在我想创建它的新版本并且它向我显示警告

Warning: No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2043-07-12) or after any future revocation date.

并且无法生成新版本的 apk,现在请告诉我如何跳过此警告并创建更新的版本 apk。

我发现一个解决方案是添加

//Certificate for -tsa into jarsigner command 
-tsa http://timestamp.digicert.com 

jarsigner -tsa http://timestamp.digicert.com -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <keystorename> <apkname.apk> <aliasname>

我的问题解决了!!! 可能这也会帮助其他人!所以我在这里回答我自己的问题。 谢谢