diff --git a/Tun/PacketTunnelProvider.swift b/Tun/PacketTunnelProvider.swift index 9960772..0cf719a 100644 --- a/Tun/PacketTunnelProvider.swift +++ b/Tun/PacketTunnelProvider.swift @@ -17,14 +17,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider { private var rootTask: Task? 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() - SDLNotificationCenter.shared.post(.vpnStatusChanged) - // 如果当前在运行状态,不允许重复请求 guard self.contextActor == nil else { completionHandler(TunnelError.invalidContext) @@ -75,7 +69,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider { reply.code = 0 reply.message = "操作成功" completionHandler?(try reply.serializedData()) - + } catch let err { var reply = NEReply() reply.code = 1 diff --git a/punchnet/Core/SDLNotificationCenter.swift b/punchnet/AppEventCenter/SDLNotificationCenter.swift similarity index 96% rename from punchnet/Core/SDLNotificationCenter.swift rename to punchnet/AppEventCenter/SDLNotificationCenter.swift index a94cda7..46c412d 100644 --- a/punchnet/Core/SDLNotificationCenter.swift +++ b/punchnet/AppEventCenter/SDLNotificationCenter.swift @@ -17,7 +17,6 @@ public struct DarwinNotificationName: RawRepresentable, Hashable { // 预定义名称 extension DarwinNotificationName { - static let vpnStatusChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.vpnStatusChanged") static let tunnelEventChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.tunnelEventChanged") } diff --git a/punchnet/Core/SDLTunnelAppEventStore.swift b/punchnet/AppEventCenter/SDLTunnelAppEventStore.swift similarity index 100% rename from punchnet/Core/SDLTunnelAppEventStore.swift rename to punchnet/AppEventCenter/SDLTunnelAppEventStore.swift