Skip to content

Network extension#4

Open
AlickH wants to merge 30 commits intomainfrom
network-extension
Open

Network extension#4
AlickH wants to merge 30 commits intomainfrom
network-extension

Conversation

@AlickH
Copy link
Copy Markdown
Owner

@AlickH AlickH commented Feb 12, 2026

No description provided.

- VPNManager.loadPreferences: 将 @published 属性更新统一到主线程,确保 isReady 在 status 同步完成后才设置
- VPNManager.updateStatus -> updateStatusSync: 去掉二次 DispatchQueue.main.async 派发,避免状态延迟
- AppDelegate.performAutoConnect: 增加 connecting 状态处理和调试日志
- SwiftierRunner.syncWithVPNState: 简化逻辑,移除冗余代码
- VPNManager: 新增 applyOnDemandRules/updateOnDemand,WiFi/Ethernet 可用时系统自动启动 NE
- VPNManager: 已有 Profile 加载时也同步 On Demand 规则
- AppDelegate: 简化为状态同步 + 首次兜底连接,不再手动管理自动连接
- ContentView: 退出按钮不再停 VPN,NE 由系统管理生命周期
- SettingsView: 移除 exitBehavior 设置,connectOnStart 联动 On Demand 开关
- VPNManager: 暴露 connectedDate 属性
- SwiftierRunner: startedAt 从 connectedDate 获取,App 重启后计时连续
- loadPreferences: 仅在 On Demand 设置不一致时才 saveToPreferences
- syncStateOnLaunch: NE 已运行时跳过所有 save 操作
- 避免 saveToPreferences 触发系统重启隧道
- 手动关闭时先禁用 On Demand 再 stop
- 手动启动时恢复 On Demand 设置
- disableOnDemandAndStop: load → disable → save → stop
- updateOnDemand: load → modify → save
1. ContentView stop 按钮改用 disableOnDemandAndStop 防止 On Demand 自动重连
2. openiCloudFolder 改用 selectFile+inFileViewerRootedAtPath 避免沙盒权限错误
- migrateToiCloud 完成后清除旧的 customPathBookmark
- 书签优先级最高,不清除的话 currentDirectory 和 openiCloudFolder 都会指向旧书签路径
- 同时将 Finder 打开方式统一为 selectFile(inFileViewerRootedAtPath:)
修复已迁移到 iCloud 但旧桌面书签仍残留在 UserDefaults 中,
导致 currentDirectory 和 openiCloudFolder 始终指向桌面的问题
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant