修复:加固 Windows 更新预检、提交点和可恢复的数据库回退流程
This commit is contained in:
@@ -55,9 +55,13 @@ public class SystemUpdateService {
|
||||
if (!enabled) return false;
|
||||
try {
|
||||
Map<?, ?> state = readMetadata("status.json");
|
||||
Map<?, ?> journal = readMetadata("journal.json");
|
||||
// 同一任务的持久提交记录优先于尚未成功刷新的进度提示。
|
||||
if (journal.get("operationId") instanceof String operationId && !operationId.isBlank()
|
||||
&& operationId.equals(state.get("operationId"))
|
||||
&& Set.of("complete", "rolledBack").contains(journal.get("phase"))) return false;
|
||||
if (state.get("state") instanceof String phase
|
||||
&& Set.of("backingUp", "installing", "restarting", "rollingBack").contains(phase)) return true;
|
||||
Map<?, ?> journal = readMetadata("journal.json");
|
||||
return journal.get("phase") instanceof String phase && Set.of("stopping", "installing").contains(phase);
|
||||
} catch (Exception failure) {
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"protocol":2}
|
||||
Reference in New Issue
Block a user