diff --git a/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt b/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt index 36264e8..fadfad6 100644 --- a/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt +++ b/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt @@ -150,7 +150,6 @@ class BoxService( } DefaultNetworkMonitor.start() - Libbox.registerLocalDNSTransport(LocalResolver) Libbox.setMemoryLimit(!Settings.disableMemoryLimit) val newService = try { @@ -263,7 +262,6 @@ class BoxService( } commandServer?.setService(null) boxService = null - Libbox.registerLocalDNSTransport(null) DefaultNetworkMonitor.stop() commandServer?.apply { diff --git a/app/src/main/java/io/nekohasekai/sfa/bg/PlatformInterfaceWrapper.kt b/app/src/main/java/io/nekohasekai/sfa/bg/PlatformInterfaceWrapper.kt index a6c6fe0..381fb87 100644 --- a/app/src/main/java/io/nekohasekai/sfa/bg/PlatformInterfaceWrapper.kt +++ b/app/src/main/java/io/nekohasekai/sfa/bg/PlatformInterfaceWrapper.kt @@ -10,6 +10,7 @@ import android.util.Log import androidx.annotation.RequiresApi import io.nekohasekai.libbox.InterfaceUpdateListener import io.nekohasekai.libbox.Libbox +import io.nekohasekai.libbox.LocalDNSTransport import io.nekohasekai.libbox.NetworkInterfaceIterator import io.nekohasekai.libbox.PlatformInterface import io.nekohasekai.libbox.StringIterator @@ -169,6 +170,10 @@ interface PlatformInterfaceWrapper : PlatformInterface { return WIFIState(ssid, wifiInfo.bssid) } + override fun localDNSTransport(): LocalDNSTransport? { + return LocalResolver + } + private class InterfaceArray(private val iterator: Iterator) : NetworkInterfaceIterator {