mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 22:50: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 kotlinx.coroutines.*
|
||||||
import libcore.BoxInstance
|
import libcore.BoxInstance
|
||||||
import libcore.Libcore
|
import libcore.Libcore
|
||||||
import moe.matsuri.nb4a.net.LocalResolverImpl
|
|
||||||
import moe.matsuri.nb4a.plugin.NekoPluginManager
|
import moe.matsuri.nb4a.plugin.NekoPluginManager
|
||||||
import moe.matsuri.nb4a.proxy.neko.NekoBean
|
import moe.matsuri.nb4a.proxy.neko.NekoBean
|
||||||
import moe.matsuri.nb4a.proxy.neko.NekoJSInterface
|
import moe.matsuri.nb4a.proxy.neko.NekoJSInterface
|
||||||
@ -112,7 +111,6 @@ abstract class BoxInstance(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Libcore.registerLocalDNSTransport(LocalResolverImpl)
|
|
||||||
loadConfig()
|
loadConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,8 +277,6 @@ abstract class BoxInstance(
|
|||||||
if (::box.isInitialized) {
|
if (::box.isInitialized) {
|
||||||
box.close()
|
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.Logs
|
||||||
import io.nekohasekai.sagernet.ktx.runOnDefaultDispatcher
|
import io.nekohasekai.sagernet.ktx.runOnDefaultDispatcher
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
import libcore.Libcore
|
||||||
|
import moe.matsuri.nb4a.net.LocalResolverImpl
|
||||||
import moe.matsuri.nb4a.utils.JavaUtil
|
import moe.matsuri.nb4a.utils.JavaUtil
|
||||||
|
|
||||||
class ProxyInstance(profile: ProxyEntity, var service: BaseService.Interface? = null) :
|
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() {
|
override fun launch() {
|
||||||
box.setAsMain()
|
box.setAsMain()
|
||||||
super.launch() // start box
|
super.launch() // start box
|
||||||
@ -52,6 +59,7 @@ class ProxyInstance(profile: ProxyEntity, var service: BaseService.Interface? =
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
|
Libcore.registerLocalDNSTransport(null)
|
||||||
super.close()
|
super.close()
|
||||||
runBlocking {
|
runBlocking {
|
||||||
looper?.stop()
|
looper?.stop()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user