Merge remote-tracking branch 'origin/dev' into fix/combined-signup-verification-profile

This commit is contained in:
QLHazycoder
2026-05-03 03:37:50 +08:00
38 changed files with 12436 additions and 952 deletions
+34 -1
View File
@@ -61,6 +61,9 @@
isStopError,
isTabAlive,
launchAutoRunTimerPlan,
ensureIpProxyAutoSyncAlarm,
clearIpProxyAutoSyncAlarm,
runIpProxyAutoSync,
listIcloudAliases,
listLuckmailPurchasesForManagement,
refreshIpProxyPool,
@@ -720,6 +723,12 @@
oauthFlowDeadlineSourceUrl: null,
} : {}),
};
if (Object.prototype.hasOwnProperty.call(updates, 'icloudHostPreference')) {
const nextHostPreference = String(updates.icloudHostPreference || '').trim().toLowerCase();
stateUpdates.preferredIcloudHost = nextHostPreference === 'icloud.com' || nextHostPreference === 'icloud.com.cn'
? nextHostPreference
: '';
}
if (stepModeChanged && typeof getStepIdsForState === 'function') {
const nextStateForSteps = { ...currentState, ...stateUpdates };
stateUpdates.stepStatuses = Object.fromEntries(
@@ -729,6 +738,19 @@
}
await setState(stateUpdates);
const mergedState = await getState();
const hasIpProxyAutoSyncSettingChanged = (
Object.prototype.hasOwnProperty.call(updates, 'ipProxyAutoSyncEnabled')
|| Object.prototype.hasOwnProperty.call(updates, 'ipProxyAutoSyncIntervalMinutes')
);
if (hasIpProxyAutoSyncSettingChanged) {
if (Boolean(mergedState?.ipProxyAutoSyncEnabled)) {
if (typeof ensureIpProxyAutoSyncAlarm === 'function') {
await ensureIpProxyAutoSyncAlarm(mergedState);
}
} else if (typeof clearIpProxyAutoSyncAlarm === 'function') {
await clearIpProxyAutoSyncAlarm();
}
}
const hasIpProxyUpdates = Object.keys(updates).some((key) => key.startsWith('ipProxy'));
const hasIpProxyEnabledUpdate = Object.prototype.hasOwnProperty.call(updates, 'ipProxyEnabled');
const previousIpProxyEnabled = Boolean(currentState?.ipProxyEnabled);
@@ -782,6 +804,14 @@
return { ok: true, state: await getState(), proxyRouting };
}
case 'RUN_IP_PROXY_AUTO_SYNC_NOW': {
if (typeof runIpProxyAutoSync !== 'function') {
throw new Error('IP 代理自动同步能力尚未接入。');
}
const result = await runIpProxyAutoSync('manual');
return { ok: true, ...result };
}
case 'REFRESH_IP_PROXY_POOL': {
if (typeof refreshIpProxyPool !== 'function') {
throw new Error('IP 代理池能力尚未接入。');
@@ -789,6 +819,7 @@
const result = await refreshIpProxyPool({
maxItems: message.payload?.maxItems,
mode: message.payload?.mode,
skipExitProbe: message.payload?.skipExitProbe,
});
return { ok: true, ...result };
}
@@ -801,6 +832,7 @@
maxItems: message.payload?.maxItems,
mode: message.payload?.mode,
forceRefresh: message.payload?.forceRefresh,
skipExitProbe: message.payload?.skipExitProbe,
});
return { ok: true, ...result };
}
@@ -811,6 +843,7 @@
}
const result = await changeIpProxyExit({
mode: message.payload?.mode,
skipExitProbe: message.payload?.skipExitProbe,
});
return { ok: true, ...result };
}
@@ -837,7 +870,7 @@
);
const timeoutMs = Number(message.payload?.timeoutMs) > 0
? Number(message.payload.timeoutMs)
: (is711AccountMode ? (shouldPreRebindBeforeProbe ? 8000 : 6000) : undefined);
: (is711AccountMode ? (shouldPreRebindBeforeProbe ? 15000 : 12000) : undefined);
// 手动“检测出口”前先轻量应用当前配置,避免读取到旧代理链路状态。
if (probeState?.ipProxyEnabled && typeof applyIpProxySettingsFromState === 'function') {