ios works, but icon wierd
This commit is contained in:
parent
f29115c024
commit
7b89016c25
@ -49,6 +49,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
() async {
|
() async {
|
||||||
await FFI.init();
|
await FFI.init();
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
|
print("FFI initialized");
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}();
|
}();
|
||||||
}
|
}
|
||||||
@ -628,6 +629,7 @@ class FFI {
|
|||||||
final dylib = Platform.isAndroid
|
final dylib = Platform.isAndroid
|
||||||
? DynamicLibrary.open('librustdesk.so')
|
? DynamicLibrary.open('librustdesk.so')
|
||||||
: DynamicLibrary.process();
|
: DynamicLibrary.process();
|
||||||
|
print('initializing FFI');
|
||||||
_getByName = dylib.lookupFunction<F2, F2>('get_by_name');
|
_getByName = dylib.lookupFunction<F2, F2>('get_by_name');
|
||||||
_setByName =
|
_setByName =
|
||||||
dylib.lookupFunction<Void Function(Pointer<Utf8>, Pointer<Utf8>), F3>(
|
dylib.lookupFunction<Void Function(Pointer<Utf8>, Pointer<Utf8>), F3>(
|
||||||
@ -636,10 +638,22 @@ class FFI {
|
|||||||
.lookupFunction<Void Function(Pointer<RgbaFrame>), F4>('free_rgba');
|
.lookupFunction<Void Function(Pointer<RgbaFrame>), F4>('free_rgba');
|
||||||
_getRgba = dylib.lookupFunction<F5, F5>('get_rgba');
|
_getRgba = dylib.lookupFunction<F5, F5>('get_rgba');
|
||||||
_dir = (await getApplicationDocumentsDirectory()).path;
|
_dir = (await getApplicationDocumentsDirectory()).path;
|
||||||
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
String id = 'NA';
|
||||||
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
String name = 'Flutter';
|
||||||
final name = '${androidInfo.brand}-${androidInfo.model}';
|
try {
|
||||||
final id = androidInfo.id;
|
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
||||||
|
name = '${androidInfo.brand}-${androidInfo.model}';
|
||||||
|
id = androidInfo.id.hashCode.toString();
|
||||||
|
} else {
|
||||||
|
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
||||||
|
name = iosInfo.utsname.machine;
|
||||||
|
id = iosInfo.identifierForVendor.hashCode.toString();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
setByName('info1', id);
|
setByName('info1', id);
|
||||||
setByName('info2', name);
|
setByName('info2', name);
|
||||||
setByName('init', _dir);
|
setByName('init', _dir);
|
||||||
@ -730,7 +744,9 @@ void initializeCursorAndCanvas() async {
|
|||||||
FFI.canvasModel.update(xCanvas, yCanvas, scale);
|
FFI.canvasModel.update(xCanvas, yCanvas, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
final bool isCn = Platform.localeName.endsWith('CN');
|
final locale = Platform.localeName;
|
||||||
|
final bool isCn =
|
||||||
|
locale.startsWith('zh') && (locale.endsWith('CN') || locale.endsWith('SG'));
|
||||||
|
|
||||||
final langs = <String, Map<String, String>>{
|
final langs = <String, Map<String, String>>{
|
||||||
'cn': <String, String>{
|
'cn': <String, String>{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user