From 035ec9343dbdadd511d6f6762f24bdab86bd716a Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 16 Jul 2025 17:47:54 +0800 Subject: [PATCH] fix open method --- Sources/Punchnet/SDLContext.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Punchnet/SDLContext.swift b/Sources/Punchnet/SDLContext.swift index 91994f5..ea9384e 100644 --- a/Sources/Punchnet/SDLContext.swift +++ b/Sources/Punchnet/SDLContext.swift @@ -79,7 +79,7 @@ public class SDLContext: @unchecked Sendable { private var flowTracer = SDLFlowTracerActor() private var flowTracerCancel: AnyCancellable? - init(provider: NEPacketTunnelProvider, config: SDLConfiguration, rsaCipher: RSACipher, aesCipher: AESCipher) throws { + public init(provider: NEPacketTunnelProvider, config: SDLConfiguration, rsaCipher: RSACipher, aesCipher: AESCipher) throws { self.config = config self.rsaCipher = rsaCipher self.aesCipher = aesCipher @@ -96,7 +96,7 @@ public class SDLContext: @unchecked Sendable { self.noticeClient = SDLNoticeClient() } - func start() async throws { + public func start() async throws { try await self.startSuperClient() try await self.startUDPHole() self.noticeClient.start() @@ -350,7 +350,7 @@ public class SDLContext: @unchecked Sendable { } // 流量统计 - func flowReportTask() { + public func flowReportTask() { Task { // 每分钟汇报一次 self.flowTracerCancel = Timer.publish(every: 60.0, on: .main, in: .common).autoconnect() @@ -506,7 +506,7 @@ public class SDLContext: @unchecked Sendable { extension SDLContext { - static func getUUID() -> String { + public static func getUUID() -> String { let userDefaults = UserDefaults.standard if let uuid = userDefaults.value(forKey: "gClientId") as? String { return uuid @@ -519,7 +519,7 @@ extension SDLContext { } // 获取mac地址 - static func getMacAddress() -> Data { + public static func getMacAddress() -> Data { let key = "gMacAddress2" let userDefaults = UserDefaults.standard