mirror of
https://github.com/SagerNet/sing-box-for-android.git
synced 2025-04-04 20:37:40 +03:00
Update local DNS transport registration
This commit is contained in:
parent
3a2fc9c880
commit
04a648ec03
2 changed files with 5 additions and 2 deletions
|
@ -150,7 +150,6 @@ class BoxService(
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultNetworkMonitor.start()
|
DefaultNetworkMonitor.start()
|
||||||
Libbox.registerLocalDNSTransport(LocalResolver)
|
|
||||||
Libbox.setMemoryLimit(!Settings.disableMemoryLimit)
|
Libbox.setMemoryLimit(!Settings.disableMemoryLimit)
|
||||||
|
|
||||||
val newService = try {
|
val newService = try {
|
||||||
|
@ -263,7 +262,6 @@ class BoxService(
|
||||||
}
|
}
|
||||||
commandServer?.setService(null)
|
commandServer?.setService(null)
|
||||||
boxService = null
|
boxService = null
|
||||||
Libbox.registerLocalDNSTransport(null)
|
|
||||||
DefaultNetworkMonitor.stop()
|
DefaultNetworkMonitor.stop()
|
||||||
|
|
||||||
commandServer?.apply {
|
commandServer?.apply {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import android.util.Log
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import io.nekohasekai.libbox.InterfaceUpdateListener
|
import io.nekohasekai.libbox.InterfaceUpdateListener
|
||||||
import io.nekohasekai.libbox.Libbox
|
import io.nekohasekai.libbox.Libbox
|
||||||
|
import io.nekohasekai.libbox.LocalDNSTransport
|
||||||
import io.nekohasekai.libbox.NetworkInterfaceIterator
|
import io.nekohasekai.libbox.NetworkInterfaceIterator
|
||||||
import io.nekohasekai.libbox.PlatformInterface
|
import io.nekohasekai.libbox.PlatformInterface
|
||||||
import io.nekohasekai.libbox.StringIterator
|
import io.nekohasekai.libbox.StringIterator
|
||||||
|
@ -169,6 +170,10 @@ interface PlatformInterfaceWrapper : PlatformInterface {
|
||||||
return WIFIState(ssid, wifiInfo.bssid)
|
return WIFIState(ssid, wifiInfo.bssid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun localDNSTransport(): LocalDNSTransport? {
|
||||||
|
return LocalResolver
|
||||||
|
}
|
||||||
|
|
||||||
private class InterfaceArray(private val iterator: Iterator<LibboxNetworkInterface>) :
|
private class InterfaceArray(private val iterator: Iterator<LibboxNetworkInterface>) :
|
||||||
NetworkInterfaceIterator {
|
NetworkInterfaceIterator {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue