简体   繁体   English

Build.phonegap上传或转换p12证书文件

[英]Build.phonegap upload or convert a p12 certificate file

I have my phonegap project with DevExtreme tool. 我有一个带DevExtreme工具的phonegap项目。 It is with phonegap cli-7.1.0 and it works fine. 它与phonegap cli-7.1.0一起使用,并且工作正常。

Now I'd like to upgrade to cli-9.0.0. 现在,我想升级到cli-9.0.0。

I build the project with https://build.phonegap.com Usually, I build ipa file here and I use the apk as template to compile the apk to publish with DevExtreme tool. 我使用https://build.phonegap.com构建项目。通常,我在此处构建ipa文件,并使用apk作为模板来编译要使用DevExtreme工具发布的apk。

I created a template apk but when I try to use it in DevExtreme, I got error"error build android package Index was out of range. Must be non-negative and less than the size of the collection parameter name:index". 我创建了一个模板apk,但是当我尝试在DevExtreme中使用它时,出现错误“错误构建android程序包索引超出范围。必须为非负数,并且小于集合参数名称:index的大小”。

So, I'm trying to compile the apk directly with https://build.phonegap.com To do this, I need to import the same certificate I'm already using to publish the app in the store (right?). 因此,我试图直接使用https://build.phonegap.com编译apk。为此,我需要导入我已经用于在商店中发布应用程序的证书(对吗?)。 My certificate is a p12 file. 我的证书是p12文件。

I try to upload the p12 file, but I get the message "Error: extension .p12 did not match expected (keystore)". 我尝试上传p12文件,但收到消息“错误:扩展名.p12与预期的不匹配(密钥库)”。 Ok, so I googled to convert the p12 in "keystore". 好的,所以我用谷歌搜索了“密钥库”中的p12。 I found this command line: 我发现此命令行:

keytool -importkeystore -srckeystore android_certificate.p12 -srcstoretype pkcs12  -destkeystore C:\Program Files\Java\jre1.8.0_211\bin\xxx.jks -deststoretype jks -deststorepass xxx

This created a jks file, but when I try to upload it to build.phonegap I get a similar message: "Error: extension .p12 did not match expected (jks)". 这创建了一个jks文件,但是当我尝试将其上传到build.phonegap时,我收到类似的消息:“错误:扩展名.p12与预期的(jks)不匹配”。

So, how can I convert my p12 certificate to something accepted by build.phonegap and use it to create my apk file and publish it? 那么,如何将我的p12证书转换为build.phonegap接受的文件并使用它来创建我的apk文件并发布它?

My problem is the app is already published, so I have to use the same certificate and not a new one (right??) 我的问题是该应用已经发布,因此我必须使用相同的证书而不是新证书(对吗?)

It seems I found a solution. 看来我找到了解决方案。 Converting my p12 file with this command works: 使用以下命令转换我的p12文件:

keytool -v -importkeystore -srckeystore android_certificate.p12 -srcstoretype PKCS12 -destkeystore myKey.keystore -deststoretype JKS

Thanks to this question 由于这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM