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