fix: exception
This commit is contained in:
@@ -25,7 +25,7 @@ class MethodHandler(private val scope: CoroutineScope) : FlutterPlugin,
|
|||||||
enum class Trigger(val method: String) {
|
enum class Trigger(val method: String) {
|
||||||
Setup("setup"),
|
Setup("setup"),
|
||||||
ParseConfig("parse_config"),
|
ParseConfig("parse_config"),
|
||||||
ChangeConfigOptions("change_config_options"),
|
changeHiddifyOptions("change_hiddify_options"),
|
||||||
GenerateConfig("generate_config"),
|
GenerateConfig("generate_config"),
|
||||||
Start("start"),
|
Start("start"),
|
||||||
Stop("stop"),
|
Stop("stop"),
|
||||||
@@ -73,7 +73,7 @@ class MethodHandler(private val scope: CoroutineScope) : FlutterPlugin,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Trigger.ChangeConfigOptions.method -> {
|
Trigger.ChangeHiddifyOptions.method -> {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
result.runCatching {
|
result.runCatching {
|
||||||
val args = call.arguments as String
|
val args = call.arguments as String
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -119,7 +119,7 @@ class FFISingboxService with InfraLogger implements SingboxService {
|
|||||||
() => CombineWorker().execute(
|
() => CombineWorker().execute(
|
||||||
() {
|
() {
|
||||||
final json = jsonEncode(options.toJson());
|
final json = jsonEncode(options.toJson());
|
||||||
final err = _box.changeConfigOptions(json.toNativeUtf8().cast()).cast<Utf8>().toDartString();
|
final err = _box.changeHiddifyOptions(json.toNativeUtf8().cast()).cast<Utf8>().toDartString();
|
||||||
if (err.isNotEmpty) {
|
if (err.isNotEmpty) {
|
||||||
return left(err);
|
return left(err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user