Update core

This commit is contained in:
problematicconsumer
2023-10-13 15:07:36 +03:30
parent ac55b28d74
commit 505e05061a
5 changed files with 15 additions and 5 deletions

View File

@@ -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

View File

@@ -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)
}
}

View File

@@ -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

View File

@@ -1 +1 @@
core.version=0.5.3
core.version=0.6.1

Submodule libcore updated: b36fab34ec...ac0eddc583