Refact. Qs, do not check qs on startup. (#7272)

Process will not exit if early return on the flutter side.

core_main.rs has checked qs already.

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2024-02-27 17:29:12 +08:00
committed by GitHub
parent e6953c8883
commit 96792bec78
2 changed files with 8 additions and 25 deletions

View File

@@ -109,7 +109,7 @@ class PlatformFFI {
sessionId: sessionId, display: display, ptr: ptr);
/// Init the FFI class, loads the native Rust core library.
Future<bool> init(String appType) async {
Future<void> init(String appType) async {
_appType = appType;
final dylib = Platform.isAndroid
? DynamicLibrary.open('librustdesk.so')
@@ -130,9 +130,6 @@ class PlatformFFI {
debugPrint('Failed to get documents directory: $e');
}
_ffiBind = RustdeskImpl(dylib);
if (_ffiBind.isQs() && (_appType != kAppTypeMain && _appType != kAppTypeConnectionManager)) {
return false;
}
if (Platform.isLinux) {
// Start a dbus service, no need to await
@@ -206,7 +203,6 @@ class PlatformFFI {
debugPrintStack(label: 'initialize failed: $e');
}
version = await getVersion();
return true;
}
Future<bool> tryHandle(Map<String, dynamic> evt) async {