Fix profile update bug

This commit is contained in:
problematicconsumer
2023-09-22 23:52:20 +03:30
parent 9cd4fe48bd
commit 92538d137b
11 changed files with 73 additions and 32 deletions

View File

@@ -50,8 +50,10 @@ class MethodHandler : FlutterPlugin, MethodChannel.MethodCallHandler {
GlobalScope.launch {
result.runCatching {
val args = call.arguments as Map<*, *>
val path = args["path"] as String? ?: ""
val msg = BoxService.parseConfig(path)
val path = args["path"] as String
val tempPath = args["tempPath"] as String
val debug = args["debug"] as Boolean
val msg = BoxService.parseConfig(path, tempPath, debug)
success(msg)
}
}

View File

@@ -61,9 +61,9 @@ class BoxService(
return
}
fun parseConfig(path: String): String {
fun parseConfig(path: String, tempPath: String, debug: Boolean): String {
return try {
Mobile.parse(path)
Mobile.parse(path, tempPath, debug)
""
} catch (e: Exception) {
Log.w(TAG, e)
@@ -157,7 +157,7 @@ class BoxService(
return
}
if(Settings.debugMode) {
if (Settings.debugMode) {
File(workingDir, "current-config.json").writeText(content)
}