交换现有的本机应用程序与科尔多瓦/ PhoneGap的基于一个没有用户知道本机、科尔、应用程序、多瓦

由网友(失我者永失)分享简介:我即将部署混合使用PhoneGap的应用程序(用于Android和放大器; IOS)。我们想交换它没有用户知道,所以我想我就可以使用相同的设备ID(如de.company.myapp) - 下一个应用程序商店之后,因此这种方式更新的用户将安装新的应用程序I'm about to deploy a hybrid app...

我即将部署混合使用PhoneGap的应用程序(用于Android和放大器; IOS)。我们想交换它没有用户知道,所以我想我就可以使用相同的设备ID(如de.company.myapp) - 下一个应用程序商店之后,因此这种方式更新的用户将安装新的应用程序

I'm about to deploy a hybrid app using phonegap (for android & ios). We want to swap it without the users knowing, so I thought I can just use the same device id (eg "de.company.myapp") - and so this way after the next app store update the users will have the new app installed.

请注意iOS上这似乎不是一个问题。

Note that on iOS this doesn't seem to be a problem.

科尔多瓦 config.xml中

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns     = "http://www.w3.org/ns/widgets"
    xmlns:gap = "http://phonegap.com/ns/1.0"
    id        = "de.company.myapp"
    version   = "1.0.0">
...

虽然与Android,我得到这个错误该测试(注:旧的原始的应用程序已经安装在设备上)

While testing this with android I'm getting this error: (note that the old native app is already installed on the device)

...
Installing app on device...
>> 
>> /path/to/cordova/platforms/android/cordova/node_modules/q/q.js:126
>>                     throw e;
>>                           ^
>> ERROR: Failed to launch application on device: ERROR: Failed to install apk to device:   pkg: /data/local/tmp/Fahrschulcard-debug-unaligned.apk
>> Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

因此​​,这意味着在APK签名不匹配。删除旧的应用程序后,我当然可以只安装新的,但也有很多使用旧的应用程序的Andr​​oid用户,所以告诉他们所有先删除旧的将是可怕的。

So this means the apk signatures don't match. After deleting the old app I can of course just install the new one, but there are a lot of android users using the old app, so telling them all to first delete the old one would be terrible.

问题:

因此​​,可以使用相同的证书/签名用于构建本机应用程序的人?

So it is possible to use the same cert/signature as the one used to build the native app?

有没有人有这种要求的经验,这可能呢?

Does anyone have experience with this kind of requirement, is this possible at all?

推荐答案

要回答我的问题,需要有两件事情来解决这个问题:

To answer my own question, 2 things were needed to fix this problem:

您将需要原始的 *密钥库文件与旧的本机应用程序签署(连同密码)确保在你的Andr​​oid清单禁用调试选项 you will need the original *.keystore file with which the old native app was signed (together with the password) Make sure to disable debug option in your android manifest

有关科尔多瓦版本,你必须创建一个名为 ant.properties 像的这个帖子。

For cordova builds, you will have to create a file called ant.properties like described in this post.

一旦你创建了 ant.properties 文件,你只需要运行下面的命令来创建签名的发布版APK文件平台/android/ant-build/appname-release.apk

As soon as you created the ant.properties file you just need to run the following command to create the signed release-ready apk file platforms/android/ant-build/appname-release.apk:

$ cordova build android --release 
阅读全文

相关推荐

最新文章