Add core debug flag

This commit is contained in:
problematicconsumer
2023-10-27 17:45:38 +03:30
parent 7a87084b78
commit bf1be7159c
6 changed files with 32 additions and 11 deletions

View File

@@ -66,18 +66,26 @@ class FFISingboxService
String baseDir,
String workingDir,
String tempDir,
bool debug,
) {
final port = _connectionStatusReceiver.sendPort.nativePort;
return TaskEither(
() => CombineWorker().execute(
() {
_box.setupOnce(NativeApi.initializeApiDLData);
_box.setup(
baseDir.toNativeUtf8().cast(),
workingDir.toNativeUtf8().cast(),
tempDir.toNativeUtf8().cast(),
port,
);
final err = _box
.setup(
baseDir.toNativeUtf8().cast(),
workingDir.toNativeUtf8().cast(),
tempDir.toNativeUtf8().cast(),
port,
debug ? 1 : 0,
)
.cast<Utf8>()
.toDartString();
if (err.isNotEmpty) {
return left(err);
}
return right(unit);
},
),

View File

@@ -38,6 +38,7 @@ class MobileSingboxService
String baseDir,
String workingDir,
String tempDir,
bool debug,
) =>
TaskEither.of(unit);

View File

@@ -22,6 +22,7 @@ abstract interface class SingboxService {
String baseDir,
String workingDir,
String tempDir,
bool debug,
);
TaskEither<String, Unit> parseConfig(