fix: 修复更新判断异常和首页最近在玩的排序问题
This commit is contained in:
@ -120,6 +120,11 @@ public class PackageUtils {
|
||||
// 根据版本判断是否需要更新
|
||||
shouldShowUpdate = new Version(versionFromRequest).isHigherThan(versionFromInstalledApp);
|
||||
|
||||
// versionName 没法判定的时候尝试使用 versionCode 去判断
|
||||
if (!shouldShowUpdate && versionCodeFromRequest != 0) {
|
||||
shouldShowUpdate = versionCodeFromRequest > versionCodeFromInstalledApp;
|
||||
}
|
||||
|
||||
// 畅玩游戏根据 md5 是否一致确定是否需要更新
|
||||
if (gameEntity.isVGame()) {
|
||||
DownloadEntity entity = DownloadManager.getInstance().getDownloadEntitySnapshotByPackageName(apkEntity.getPackageName());
|
||||
@ -127,17 +132,10 @@ public class PackageUtils {
|
||||
String md5FromInstalledVGame = ExtensionsKt.getMetaExtra(entity, Constants.APK_MD5);
|
||||
String md5FromRequest = apkEntity.getMd5();
|
||||
|
||||
if (md5FromRequest != null && !md5FromRequest.equals(md5FromInstalledVGame)) {
|
||||
shouldShowUpdate = true;
|
||||
}
|
||||
shouldShowUpdate = md5FromRequest != null && !md5FromRequest.equals(md5FromInstalledVGame);
|
||||
}
|
||||
}
|
||||
|
||||
// versionName 没法判定的时候尝试使用 versionCode 去判断
|
||||
if (!shouldShowUpdate && versionCodeFromRequest != 0) {
|
||||
shouldShowUpdate = versionCodeFromRequest > versionCodeFromInstalledApp;
|
||||
}
|
||||
|
||||
if (shouldShowUpdate) {
|
||||
GameUpdateEntity updateEntity = new GameUpdateEntity();
|
||||
updateEntity.setId(gameEntity.getId());
|
||||
|
||||
Reference in New Issue
Block a user