Update core
This commit is contained in:
@@ -91,7 +91,7 @@ class MethodHandler : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
if (restart) {
|
||||
mainActivity.reconnect()
|
||||
BoxService.stop()
|
||||
delay(200)
|
||||
delay(200L)
|
||||
mainActivity.startService()
|
||||
success(true)
|
||||
return@launch
|
||||
|
||||
@@ -29,6 +29,7 @@ import io.nekohasekai.libbox.SystemProxyStatus
|
||||
import io.nekohasekai.mobile.Mobile
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withContext
|
||||
@@ -133,7 +134,7 @@ class BoxService(
|
||||
this.commandServer = commandServer
|
||||
}
|
||||
|
||||
private suspend fun startService() {
|
||||
private suspend fun startService(delayStart: Boolean = false) {
|
||||
try {
|
||||
Log.d(TAG, "starting service")
|
||||
|
||||
@@ -178,6 +179,10 @@ class BoxService(
|
||||
return
|
||||
}
|
||||
|
||||
if (delayStart) {
|
||||
delay(200L)
|
||||
}
|
||||
|
||||
newService.start()
|
||||
boxService = newService
|
||||
commandServer?.setService(boxService)
|
||||
@@ -206,7 +211,7 @@ class BoxService(
|
||||
Seq.destroyRef(refnum)
|
||||
}
|
||||
boxService = null
|
||||
startService()
|
||||
startService(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ open class CommandClient(
|
||||
fun onDisconnected() {}
|
||||
fun updateStatus(status: StatusMessage) {}
|
||||
fun updateGroups(groups: List<OutboundGroup>) {}
|
||||
fun clearLog() {}
|
||||
fun appendLog(message: String) {}
|
||||
fun initializeClashMode(modeList: List<String>, currentMode: String) {}
|
||||
fun updateClashMode(newMode: String) {}
|
||||
@@ -106,6 +107,10 @@ open class CommandClient(
|
||||
handler.updateGroups(groups)
|
||||
}
|
||||
|
||||
override fun clearLog() {
|
||||
handler.clearLog()
|
||||
}
|
||||
|
||||
override fun writeLog(message: String?) {
|
||||
if (message == null) {
|
||||
return
|
||||
|
||||
@@ -1 +1 @@
|
||||
core.version=0.5.3
|
||||
core.version=0.6.1
|
||||
2
libcore
2
libcore
Submodule libcore updated: b36fab34ec...ac0eddc583
Reference in New Issue
Block a user