且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将AIR Android p12密钥库文件迁移到Cordova

更新时间:2023-09-13 17:43:04

如果有人遇到同样的问题,这就是我的解决方法.

If anyone lands here facing the same issue, this is how I solved it.

本质上的问题是,原始.p12文件非常旧(对我而言是2012年),是使用jdk1.7和Adobe Air创建的.使用更高版本的jdk似乎会弄乱指纹.

The issue at heart is that the original .p12 file is super old (2012 for me) and was created with jdk1.7 and adobe air. Using later versions of jdk seem to mess with the fingerprint.

但是我发现您实际上不需要使用现有的.p12做任何事情,但是您确实需要使用jdk1.7来对应用程序进行签名.使用Cordova对应用程序进行签名无法正常工作,并且会抱怨.p12

However I discovered you don't actually need to do anything with your existing .p12 but you do need to use jdk1.7 to sign the app. Using Cordova to sign the app won't work and will complain about the .p12

以下步骤允许我签署我的Cordova Android应用程序,并使用adobe air创建的现有.p12证书成功将其提交为Google Play上的更新.

The below steps allowed me to sign my Cordova Android app and successfully submit it as an update on google play with an existing .p12 cert created with adobe air.

首先使用最新的Cordova和依赖项等为您的android应用构建未签名的发行版.

First build an unsigned release version of your android app using latest Cordova and dependencies etc.

cordova build android --release

导航到jdk1.7 bin目录,在我的Windows上是:C:\ Program Files \ Java \ jdk1.7.0_03 \ bin,现在使用jdk1.7 jarsigner签名您的应用.

Navigate to a jdk1.7 bin directory, in my case on windows it was: C:\Program Files\Java\jdk1.7.0_03\bin and now sign your app with jdk1.7 jarsigner.

jarsigner -keystore PATH_TO/your_original.p12 -storetype pkcs12 PATH_TO/app-unsigned.apk 1

现在,您只需要在此命令中使用zipalign.在Android \ Sdk \ build-tools中使用最新的zipalign可以正常工作.

Now you just need to use zipalign with this command. Using latest zipalign in Android\Sdk\build-tools works OK.

zipalign -f -v 4 app-unsigned.apk app-signed.apk

现在,您可以将.apk上传到Google Play商店.

Now you can upload your .apk to google play store.

相关(但对我来说仍然以错误的指纹结尾):签名带有Adobe Air证书的Android Native apk

Related (but still ended in wrong fingerprint for me): Sign Android Native apk with Adobe Air certificate