Files
pangolin/client/macos/Runner/MainFlutterWindow.swift
T
wangjia c8df031741
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
feat(client/macos): 解开 VpnChannel 注册(主 app 接 NETunnelProviderManager)
MainFlutterWindow 启用 VpnChannel.register —— Flutter 经 pangolin/vpn 通道
启停 PacketTunnel(NETunnelProviderManager)。需 VpnChannel.swift 已入 Runner
target 的 Compile Sources。kUseNativeVpnMacOS 仍为 false(待隧道能跑再切)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 15:36:38 +08:00

24 lines
823 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Cocoa
import FlutterMacOS
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
let flutterViewController = FlutterViewController()
self.contentViewController = flutterViewController
// 920×600稿 ui_kits/desktop 720×560
let defaultSize = NSSize(width: 920, height: 600)
self.setContentSize(defaultSize)
self.contentMinSize = NSSize(width: 720, height: 560)
self.center()
RegisterGeneratedPlugins(registry: flutterViewController)
// P1 B:VPN (NETunnelProviderManager PacketTunnel)
// VpnChannel.swift Runner target Compile Sources
VpnChannel.register(with: flutterViewController.registrar(forPlugin: "VpnChannel"))
super.awakeFromNib()
}
}