简体   繁体   English

Android:Google Play是否检查已安装的APK的versionCode?

[英]Android: Does Google Play check versionCodes of installed apks?

Google Play has an automatic update system for apps. Google Play拥有适用于应用程序的自动更新系统。 When a new version is uploaded to the Developer Console the app is updated on user devices because the new versionCode is greater than the one that is already installed. 当将新版本上传到开发者控制台时,该应用将在用户设备上更新,因为新versionCode大于已安装的versionCode。 But users could get a newer apk from other sources. 但是用户可以从其他来源获得更新的apk。

I would like to know some details about this automatic process, I mean: 我想了解有关此自动过程的一些细节,我的意思是:

A-Does Google Play keeps a value inside so it remembers what versionCode of an app it has officially installed? 答:Google Play会保留内部价值吗,因此它会记住它正式安装的应用程序的哪个versionCode吗?

or 要么

B-Does Google Play inspects all installed apks so it can compare the version codes to the current versions officially provided by the developers on Google Play? B-Google Play是否检查所有已安装的APK,以便可以将版本代码与开发人员在Google Play上正式提供的当前版本进行比较?

Note the difference: 注意区别:

-in the A case, it just remember what it officially installed but is not informed about the real versionCode the user has on the device; -在A情况下,它只记得它正式安装了什么,而没有获悉用户在设备上拥有的真实版本代码; so it could try to update even when the user already got a newer apk from outside Google Play (fail); 因此即使用户已经从Google Play外部获得了更新的APK(失败),它也可以尝试更新;

-in the B case, the update system can understand what version in installed because it checks it; -在B情况下,更新系统可以检查已安装的版本,因为它会对其进行检查; so the update doesn't even start if the user upgraded an app from outside the Google Play. 因此,如果用户从Google Play外部升级了应用,则更新甚至不会开始。

Which is the real case? 真实情况是什么?

It is case A - Google remembers which version of the app was last installed. 情况A -Google会记住该应用程序的最新版本。

It does not check the device every time for the latest installed version. 它不会每次都检查设备的最新安装版本。

How to verify this? 如何验证呢?

If you ever factory reset your phone or flash a ROM, go to play store from your browser and open an app page which you'd installed before you flashed the ROM or did a factory reset. 如果您曾经将手机恢复出厂设置或刷新了ROM,请先从浏览器访问商店,然后打开您已安装的应用程序页面,然后再刷新ROM或恢复出厂设置。 It will still show as installed, although you wiped your device clean and it is not installed anymore. 尽管已将设备擦拭干净并且不再安装,但它仍将显示为已安装。

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

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