Commit 8077208f by amateur

1

1 parent b155ac9e
...@@ -21,7 +21,7 @@ public class UpdateUtils { ...@@ -21,7 +21,7 @@ public class UpdateUtils {
@Override @Override
protected void onResponse(StateEnum state, UpdateVersion data, String message) { protected void onResponse(StateEnum state, UpdateVersion data, String message) {
// 非强制更新是,需要同时进行h5版本更新 // 非强制更新是,需要同时进行h5版本更新
if (state != StateEnum.OK || null == data || !"0".equals(data.getIsForce())) { if (state != StateEnum.OK || null == data || !isMustUpdate(data) || !isUpdateApp(data)) {
if (!TextUtils.isEmpty(h5Version)) { if (!TextUtils.isEmpty(h5Version)) {
checkH5Version(h5Version); checkH5Version(h5Version);
} }
...@@ -38,7 +38,7 @@ public class UpdateUtils { ...@@ -38,7 +38,7 @@ public class UpdateUtils {
if ("1".equals(upgradeType)) { // h5 if ("1".equals(upgradeType)) { // h5
downH5Version(update); downH5Version(update);
return ""; return "";
} else if ("2".equals(upgradeType)) { } else if ("2".equals(upgradeType) && isUpdateApp(update)) {
ExecutorUtils.main(() -> UpdateDialog.show(manager, update)); ExecutorUtils.main(() -> UpdateDialog.show(manager, update));
return ""; return "";
} }
...@@ -94,4 +94,12 @@ public class UpdateUtils { ...@@ -94,4 +94,12 @@ public class UpdateUtils {
} }
private static boolean isUpdateApp(UpdateVersion update) {
return !CtxUtils.getPackageInfo().versionName.equals(update.getvNumber());
}
private static boolean isMustUpdate(UpdateVersion update) {
return "0".equals(update.getIsForce());
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!