mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
fix
This commit is contained in:
parent
060853a204
commit
9454d074ce
@ -22,7 +22,6 @@ import io.nekohasekai.sagernet.plugin.PluginManager
|
||||
import kotlinx.coroutines.*
|
||||
import libcore.BoxInstance
|
||||
import libcore.Libcore
|
||||
import moe.matsuri.nb4a.net.LocalResolverImpl
|
||||
import moe.matsuri.nb4a.plugin.NekoPluginManager
|
||||
import moe.matsuri.nb4a.proxy.neko.NekoBean
|
||||
import moe.matsuri.nb4a.proxy.neko.NekoJSInterface
|
||||
@ -112,7 +111,6 @@ abstract class BoxInstance(
|
||||
}
|
||||
}
|
||||
}
|
||||
Libcore.registerLocalDNSTransport(LocalResolverImpl)
|
||||
loadConfig()
|
||||
}
|
||||
|
||||
@ -279,8 +277,6 @@ abstract class BoxInstance(
|
||||
if (::box.isInitialized) {
|
||||
box.close()
|
||||
}
|
||||
|
||||
Libcore.registerLocalDNSTransport(null)
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,6 +7,8 @@ import io.nekohasekai.sagernet.database.ProxyEntity
|
||||
import io.nekohasekai.sagernet.ktx.Logs
|
||||
import io.nekohasekai.sagernet.ktx.runOnDefaultDispatcher
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import libcore.Libcore
|
||||
import moe.matsuri.nb4a.net.LocalResolverImpl
|
||||
import moe.matsuri.nb4a.utils.JavaUtil
|
||||
|
||||
class ProxyInstance(profile: ProxyEntity, var service: BaseService.Interface? = null) :
|
||||
@ -42,6 +44,11 @@ class ProxyInstance(profile: ProxyEntity, var service: BaseService.Interface? =
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun loadConfig() {
|
||||
Libcore.registerLocalDNSTransport(LocalResolverImpl)
|
||||
super.loadConfig()
|
||||
}
|
||||
|
||||
override fun launch() {
|
||||
box.setAsMain()
|
||||
super.launch() // start box
|
||||
@ -52,6 +59,7 @@ class ProxyInstance(profile: ProxyEntity, var service: BaseService.Interface? =
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
Libcore.registerLocalDNSTransport(null)
|
||||
super.close()
|
||||
runBlocking {
|
||||
looper?.stop()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user