简体   繁体   English

通过Google Play更新应用,该应用由APK文件安装

[英]Update app via Google play, which is installed by APK file

I have an app that is not deployed via Google play store. 我有一个未通过Google Play商店部署的应用。

It has it's own APK file server, and previously, it doesn't have "update" functionality. 它具有自己的APK文件服务器,并且以前没有“更新”功能。 Because of it is special purpose app, so a user who need to update app, he need to just uninstall current app and install new app. 由于它是专用的应用程序,因此需要更新应用程序的用户只需要卸载当前应用程序并安装新应用程序即可。

Now I need to update these already installed app via google play. 现在,我需要通过Google Play更新这些已安装的应用程序。

Question is: Can I update app via Google play store, that is installed via APK file? 问题是:我可以通过Google Play商店更新通过APK文件安装的应用吗?

Tested environment: 测试环境:

  • Google play service 11.7.46 Google Play服务11.7.46
  • Play store 8.4.19 Play商店8.4.19
  • Galaxy S7 银河S7
  • Released Koeran market only. 仅发布了Koeran市场。


I tried: 我试过了:

1) Build three test APK Versions 1, 2, 3. 1)建立三个测试APK版本1、2、3。

2) Deploy Version 2 and update Version 3 via Google play store. 2)部署版本2并通过Google Play商店更新版本3

3) [FAILED] Install APK Version 1 via ADB, and cannot update via Google play store. 3) [FAILED]通过ADB安装APK 版本1 ,并且无法通过Google Play商店更新。 (In google play page of my test app, I can see buttons "UNINSTALL / OPEN" (在我的测试应用的Google Play页面中,我可以看到“取消安装/打开”按钮

This is exactly what I want to do. 这正是我想要做的。

4) [FAILED] Install APK Version 2 via ADB, and cannot update via Google play store. 4) [FAILED]通过ADB安装APK 版本2 ,无法通过Google Play商店更新。 (In google play page of my test app, I can see buttons "UNINSTALL / OPEN" (在我的测试应用的Google Play页面中,我可以看到“取消安装/打开”按钮

Some of my colleague said this case is possible, but I couldn't achieved. 我的一些同事说这种情况是可能的,但我没有做到。


I found difference between signed APK and Google play extracted APK. 我发现签名的APK与Google Play提取的APK之间的区别。 By binary compare , many file was different. 通过二进制比较 ,许多文件是不同的。

比较图像

Especially AndroidManifest.xml, this information was added in Google play-extracted apk. 特别是AndroidManifest.xml,此信息已添加到Google Play提取的apk中。

<meta-data
    android:name="com.android.vending.derived.apk.id"
    android:value="1" />

It was possible to update old version apk that was downloaded from google play publish page. 可以更新从Google Play发行页面下载的旧版本apk。


I found below answer, but it seems not working in my case. 我在下面找到了答案,但是对于我来说似乎不起作用。

Will apk installed manually (not from play store) receive notification when update becomes available? 当更新可用时,手动安装的apk(不是从Play商店)会收到通知吗?

you will receive updates / see the app in the Google Play "installed apps" tab only if the two conditions will take place: 仅在满足以下两个条件的情况下,您才会收到更新/在Google Play“已安装的应用”标签中查看该应用:

the APK package name is the same as the one uploaded to Google Play APK套件名称与上传到Google Play的名称相同

the keystore used to sign the app in the play store is the same keystore used to release the apk you install manually. 用于在Play商店中对应用进行签名的密钥库与用于释放您手动安装的APK的密钥库相同。

In order to be updated by Play, the app has to be in the "User's library". 为了通过Play进行更新,该应用必须位于“用户库”中。 This is a hard concept, but basically comes down to "has the user ever installed it from Play on any device". 这是一个很难的概念,但基本上可以归结为“用户是否曾在任何设备上通过Play安装它”。 If the user has it in their user library, and the signature is the same as the signature on the Play store then the app will update. 如果用户将其存储在用户库中,并且签名与Play商店中的签名相同,则该应用将更新。

If the user has never installed it from Play, then Play won't update it. 如果用户从未从Play安装它,则Play不会更新它。

So what you want to happen won't happen, unless the user has previously installed it from Play on any device. 因此,除非用户先前已在任何设备上通过Play安装了它,否则您不会发生想要的事情。

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

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