release: version 2.5.2

This commit is contained in:
hiddify
2024-09-29 20:27:07 +02:00
parent bafabd9606
commit 3de6808a81
7 changed files with 65 additions and 40 deletions

View File

@@ -13,6 +13,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.io.File
class MethodHandler(private val scope: CoroutineScope) : FlutterPlugin,
MethodChannel.MethodCallHandler {
@@ -54,8 +55,20 @@ class MethodHandler(private val scope: CoroutineScope) : FlutterPlugin,
Trigger.Setup.method -> {
GlobalScope.launch {
result.runCatching {
Mobile.setup()
success("")
val baseDir = Application.application.filesDir
baseDir.mkdirs()
val workingDir = Application.application.getExternalFilesDir(null)
workingDir?.mkdirs()
val tempDir = Application.application.cacheDir
tempDir.mkdirs()
Log.d(TAG, "base dir: ${baseDir.path}")
Log.d(TAG, "working dir: ${workingDir?.path}")
Log.d(TAG, "temp dir: ${tempDir.path}")
Mobile.setup(baseDir.path, workingDir?.path, tempDir.path, false)
Libbox.redirectStderr(File(workingDir, "stderr2.log").path)
success("")
}
}
}

View File

@@ -48,6 +48,7 @@ class BoxService(
private fun initialize() {
if (initializeOnce) return
val baseDir = Application.application.filesDir
baseDir.mkdirs()
workingDir = Application.application.getExternalFilesDir(null) ?: return
workingDir.mkdirs()
@@ -56,7 +57,8 @@ class BoxService(
Log.d(TAG, "base dir: ${baseDir.path}")
Log.d(TAG, "working dir: ${workingDir.path}")
Log.d(TAG, "temp dir: ${tempDir.path}")
Libbox.setup(baseDir.path, workingDir.path, tempDir.path, false)
Mobile.setup(baseDir.path, workingDir.path, tempDir.path, false)
Libbox.redirectStderr(File(workingDir, "stderr.log").path)
initializeOnce = true
return