This commit is contained in:
anlicheng 2026-04-15 11:36:07 +08:00
parent 739acd3938
commit 23d15e3d17
3 changed files with 1 additions and 8 deletions

View File

@ -17,14 +17,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
private var rootTask: Task<Void, Error>? private var rootTask: Task<Void, Error>?
override func startTunnel(options: [String: NSObject]?, completionHandler: @escaping (Error?) -> Void) { override func startTunnel(options: [String: NSObject]?, completionHandler: @escaping (Error?) -> Void) {
let shared = UserDefaults(suiteName: "group.com.jihe.punchnetmac")
let msg = shared?.string(forKey: "test_msg")
SDLLogger.log("NE read message: \(msg ?? "failed")", for: .debug)
SDLTunnelAppNotifier.shared.clear() SDLTunnelAppNotifier.shared.clear()
SDLNotificationCenter.shared.post(.vpnStatusChanged)
// //
guard self.contextActor == nil else { guard self.contextActor == nil else {
completionHandler(TunnelError.invalidContext) completionHandler(TunnelError.invalidContext)

View File

@ -17,7 +17,6 @@ public struct DarwinNotificationName: RawRepresentable, Hashable {
// //
extension DarwinNotificationName { extension DarwinNotificationName {
static let vpnStatusChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.vpnStatusChanged")
static let tunnelEventChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.tunnelEventChanged") static let tunnelEventChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.tunnelEventChanged")
} }