feat(client/macos): 主 app VPN 接线编译通过 — VpnChannel 入 Runner target
- VpnChannel.swift 加入 Runner target(Compile Sources) - Logger→NSLog(Runner 部署目标 10.15,os.Logger 需 11)+ 去掉未用的 SystemExtensions import - 至此原生 VPN 控制链路全编译通过:主 app(NETunnelProviderManager 启停/ 状态)+ 扩展(libbox)。kUseNativeVpnMacOS 仍 false(待隧道能跑切换)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -12,10 +12,9 @@
|
||||
|
||||
import FlutterMacOS
|
||||
import NetworkExtension
|
||||
import SystemExtensions
|
||||
import os
|
||||
|
||||
private let log = Logger(subsystem: "com.pangolin.pangolin", category: "vpn")
|
||||
// NSLog 兼容老部署目标(Runner < macOS 11,os.Logger 不可用)。
|
||||
private func vpnLog(_ message: String) { NSLog("[pangolin/vpn] %@", message) }
|
||||
|
||||
final class VpnChannel: NSObject {
|
||||
private static let tunnelBundleId = "com.pangolin.pangolin.PacketTunnel"
|
||||
@@ -76,7 +75,7 @@ final class VpnChannel: NSObject {
|
||||
])
|
||||
result(nil)
|
||||
} catch {
|
||||
log.error("start failed: \(error.localizedDescription)")
|
||||
vpnLog("start failed: \(error.localizedDescription)")
|
||||
result(FlutterError(code: "start_failed", message: error.localizedDescription, details: nil))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user