Update usages of libbox

This commit is contained in:
世界
2025-11-26 22:25:47 +08:00
parent 532c140f05
commit f4b284acd8
6 changed files with 64 additions and 79 deletions
@@ -356,18 +356,17 @@ public class ExtensionPlatformInterface: NSObject, LibboxPlatformInterfaceProtoc
#endif
}
public func serviceStop() throws {
reset()
}
public func serviceReload() throws {
runBlocking { [self] in
await tunnel.reloadService()
}
}
public func postServiceClose() {
reset()
tunnel.postServiceClose()
}
public func getSystemProxyStatus() -> LibboxSystemProxyStatus? {
public func getSystemProxyStatus() throws -> LibboxSystemProxyStatus {
let status = LibboxSystemProxyStatus()
guard let networkSettings else {
return status
@@ -404,6 +403,13 @@ public class ExtensionPlatformInterface: NSObject, LibboxPlatformInterfaceProtoc
}
}
public func writeDebugMessage(_ message: String?) {
guard let message else {
return
}
tunnel.writeMessage(message)
}
func reset() {
networkSettings = nil
}