安卓系统应用比data分区应用版本号新怎么办

本文最后更新于:2021年3月13日 凌晨

安卓9代码:

PackageManagerService

1
2
3
4
5
6
7
8
9
10
11
12
13
/**
* Adds a new package to the internal data structures during platform initialization.
* <p>After adding, the package is known to the system and available for querying.
* <p>For packages located on the device ROM [eg. packages located in /system, /vendor,
* etc...], additional checks are performed. Basic verification [such as ensuring
* matching signatures, checking version codes, etc...] occurs if the package is
* identical to a previously known package. If the package fails a signature check,
* the version installed on /data will be removed. If the version of the new package
* is less than or equal than the version on /data, it will be ignored.
* <p>Regardless of the package location, the results are applied to the internal
* structures and the package is made available to the rest of the system.
* <p>NOTE: The return value should be removed. It's the passed in package object.
*/

If the package fails a signature check,the version installed on /data will be removed. If the version of the new package is less than or equal than the version on /data, it will be ignored.

意味着系统分区应用版本号小于或者等于data分区的应用,则data应用会被保留。(这里是指那些系统应用通过更新方式安装到data分区的)


安卓系统应用比data分区应用版本号新怎么办
https://iwesley.top/article/feebec60/
作者
Wesley
发布于
2021年3月7日
许可协议