mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 02:57:22 +00:00
@@ -29,6 +29,7 @@ typedef HandleEvent = Future<void> Function(Map<String, dynamic> evt);
|
||||
/// Hides the platform differences.
|
||||
class PlatformFFI {
|
||||
String _dir = '';
|
||||
// _homeDir is only needed for Android and IOS.
|
||||
String _homeDir = '';
|
||||
F2? _translate;
|
||||
final _eventHandlers = <String, Map<String, HandleEvent>>{};
|
||||
@@ -119,8 +120,10 @@ class PlatformFFI {
|
||||
if (isAndroid) {
|
||||
// only support for android
|
||||
_homeDir = (await ExternalPath.getExternalStorageDirectories())[0];
|
||||
} else if (isIOS) {
|
||||
_homeDir = _ffiBind.mainGetDataDirIos();
|
||||
} else {
|
||||
_homeDir = (await getDownloadsDirectory())?.path ?? '';
|
||||
// no need to set home dir
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint('initialize failed: $e');
|
||||
@@ -159,8 +162,13 @@ class PlatformFFI {
|
||||
name = macOsInfo.computerName;
|
||||
id = macOsInfo.systemGUID ?? '';
|
||||
}
|
||||
debugPrint(
|
||||
'_appType:$_appType,info1-id:$id,info2-name:$name,dir:$_dir,homeDir:$_homeDir');
|
||||
if (isAndroid || isIOS) {
|
||||
debugPrint(
|
||||
'_appType:$_appType,info1-id:$id,info2-name:$name,dir:$_dir,homeDir:$_homeDir');
|
||||
} else {
|
||||
debugPrint(
|
||||
'_appType:$_appType,info1-id:$id,info2-name:$name,dir:$_dir');
|
||||
}
|
||||
await _ffiBind.mainDeviceId(id: id);
|
||||
await _ffiBind.mainDeviceName(name: name);
|
||||
await _ffiBind.mainSetHomeDir(home: _homeDir);
|
||||
|
||||
Reference in New Issue
Block a user