[2.15.0] 修正是否走patch升级的逻辑

This commit is contained in:
renwj
2023-03-23 16:15:35 +08:00
parent 5b51275ed7
commit 25c6651d08

View File

@@ -163,8 +163,14 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
val record = UpgradeDbHelper.getUpgradeRecordFull(currentVersion) ?: return true
val installs = record.installs ?: return true
return installs.find {
it.version == currentVersion && it.status != SourceMd5CheckFailed && it.status != ApplyPatchFailed && it.status != TargetMd5CheckFailed && it.status == InstallFailed && it.code != PackageInstaller.STATUS_FAILURE_INVALID && it.code != PackageInstaller.STATUS_FAILURE_CONFLICT && it.code != PackageInstaller.STATUS_FAILURE && it.code != PackageInstaller.STATUS_FAILURE_STORAGE
} != null
it.version == currentVersion &&
((it.status == SourceMd5CheckFailed || it.status == ApplyPatchFailed || it.status == TargetMd5CheckFailed) ||
(it.status == InstallFailed &&
(it.code == PackageInstaller.STATUS_FAILURE_INVALID ||
it.code == PackageInstaller.STATUS_FAILURE_CONFLICT ||
it.code == PackageInstaller.STATUS_FAILURE ||
it.code == PackageInstaller.STATUS_FAILURE_STORAGE)))
} == null
}
private fun getType(type: Int): Type = if (type == 0) FULL else PATCH