diff --git a/assets/binary/unp4kc.zip b/assets/binary/unp4kc.zip index 793fc02..4069956 100644 Binary files a/assets/binary/unp4kc.zip and b/assets/binary/unp4kc.zip differ diff --git a/lib/provider/unp4kc.dart b/lib/provider/unp4kc.dart index 0f6d36b..10ccfb3 100644 --- a/lib/provider/unp4kc.dart +++ b/lib/provider/unp4kc.dart @@ -223,4 +223,23 @@ class Unp4kCModel extends _$Unp4kCModel { rsPid: _rsPid!, data: "$mode<:,:>$filePath<:,:>$outputPath\n"); } } + + static Future unp4kTools( + String applicationBinaryModuleDir, List args) async { + await BinaryModuleConf.extractModule( + ["unp4kc"], applicationBinaryModuleDir); + final execDir = "$applicationBinaryModuleDir\\unp4kc"; + final exec = "$execDir\\unp4kc.exe"; + final r = await Process.run(exec, args); + if (r.exitCode != 0) { + throw Exception( + "error: ${r.exitCode} , info= ${r.stdout} , err= ${r.stderr}"); + } + final eventJson = await compute(json.decode, r.stdout.toString()); + if (eventJson["action"] == "data: Uint8List") { + final data = eventJson["data"]; + return Uint8List.fromList((data as List).cast()); + } + throw Exception("error: data error"); + } } diff --git a/lib/provider/unp4kc.g.dart b/lib/provider/unp4kc.g.dart index dd4a3bf..e643e32 100644 --- a/lib/provider/unp4kc.g.dart +++ b/lib/provider/unp4kc.g.dart @@ -6,7 +6,7 @@ part of 'unp4kc.dart'; // RiverpodGenerator // ************************************************************************** -String _$unp4kCModelHash() => r'0f1bff187bbc4e043405f60e95c08af6e1159b57'; +String _$unp4kCModelHash() => r'69117c5857797683e2d080da9238bfecc5948898'; /// See also [Unp4kCModel]. @ProviderFor(Unp4kCModel) diff --git a/lib/ui/home/dialogs/home_game_login_dialog_ui_model.g.dart b/lib/ui/home/dialogs/home_game_login_dialog_ui_model.g.dart index 1171839..5e4d4b3 100644 --- a/lib/ui/home/dialogs/home_game_login_dialog_ui_model.g.dart +++ b/lib/ui/home/dialogs/home_game_login_dialog_ui_model.g.dart @@ -7,7 +7,7 @@ part of 'home_game_login_dialog_ui_model.dart'; // ************************************************************************** String _$homeGameLoginUIModelHash() => - r'862fac9e29e55937e1246542feac75cf55062182'; + r'e8afccb7bba7c79e766e30a27f64128918a63dd7'; /// See also [HomeGameLoginUIModel]. @ProviderFor(HomeGameLoginUIModel) diff --git a/lib/ui/home/home_ui_model.g.dart b/lib/ui/home/home_ui_model.g.dart index b91874d..4e893a6 100644 --- a/lib/ui/home/home_ui_model.g.dart +++ b/lib/ui/home/home_ui_model.g.dart @@ -6,7 +6,7 @@ part of 'home_ui_model.dart'; // RiverpodGenerator // ************************************************************************** -String _$homeUIModelHash() => r'415891e3528a681a9c11eed5bb78070a2a08da86'; +String _$homeUIModelHash() => r'8308b6e327b7eeda64c39bcd73e9f2d9e6470437'; /// See also [HomeUIModel]. @ProviderFor(HomeUIModel) diff --git a/lib/ui/home/localization/localization_ui_model.dart b/lib/ui/home/localization/localization_ui_model.dart index fff9940..10b55e0 100644 --- a/lib/ui/home/localization/localization_ui_model.dart +++ b/lib/ui/home/localization/localization_ui_model.dart @@ -18,6 +18,7 @@ import 'package:starcitizen_doctor/common/utils/log.dart'; import 'package:starcitizen_doctor/common/utils/provider.dart'; import 'package:starcitizen_doctor/data/sc_localization_data.dart'; import 'package:starcitizen_doctor/generated/no_l10n_strings.dart'; +import 'package:starcitizen_doctor/provider/unp4kc.dart'; import 'package:starcitizen_doctor/ui/home/home_ui_model.dart'; import 'package:starcitizen_doctor/widgets/widgets.dart'; import 'package:url_launcher/url_launcher_string.dart'; @@ -88,6 +89,17 @@ class LocalizationUIModel extends _$LocalizationUIModel { await _loadData(); } + readEnglishInI() async { + final data = await Unp4kCModel.unp4kTools( + appGlobalState.applicationBinaryModuleDir!, [ + "extract_memory", + "$_scInstallPath\\Data.p4k", + "Data\\Localization\\english\\global.ini" + ]); + final iniData = String.fromCharCodes(data); + dPrint("read english ini => ${iniData.length}"); + } + final Map> _allVersionLocalizationData = {}; diff --git a/lib/ui/home/localization/localization_ui_model.g.dart b/lib/ui/home/localization/localization_ui_model.g.dart index dddaaff..4cf6163 100644 --- a/lib/ui/home/localization/localization_ui_model.g.dart +++ b/lib/ui/home/localization/localization_ui_model.g.dart @@ -7,7 +7,7 @@ part of 'localization_ui_model.dart'; // ************************************************************************** String _$localizationUIModelHash() => - r'da9d0a3ae28825fd9331dd2b6db3d094cf3c0eb9'; + r'a4e33b337db587ad3e766450d9bd8ac4aa7b4c49'; /// See also [LocalizationUIModel]. @ProviderFor(LocalizationUIModel) diff --git a/lib/ui/settings/settings_ui_model.freezed.dart b/lib/ui/settings/settings_ui_model.freezed.dart index 18389e2..c74576e 100644 --- a/lib/ui/settings/settings_ui_model.freezed.dart +++ b/lib/ui/settings/settings_ui_model.freezed.dart @@ -16,7 +16,6 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$SettingsUIState { - dynamic get isDeviceSupportWinHello => throw _privateConstructorUsedError; bool get isEnableToolSiteMirrors => throw _privateConstructorUsedError; String get inputGameLaunchECore => throw _privateConstructorUsedError; String? get customLauncherPath => throw _privateConstructorUsedError; @@ -35,8 +34,7 @@ abstract class $SettingsUIStateCopyWith<$Res> { _$SettingsUIStateCopyWithImpl<$Res, SettingsUIState>; @useResult $Res call( - {dynamic isDeviceSupportWinHello, - bool isEnableToolSiteMirrors, + {bool isEnableToolSiteMirrors, String inputGameLaunchECore, String? customLauncherPath, String? customGamePath, @@ -56,7 +54,6 @@ class _$SettingsUIStateCopyWithImpl<$Res, $Val extends SettingsUIState> @pragma('vm:prefer-inline') @override $Res call({ - Object? isDeviceSupportWinHello = freezed, Object? isEnableToolSiteMirrors = null, Object? inputGameLaunchECore = null, Object? customLauncherPath = freezed, @@ -64,10 +61,6 @@ class _$SettingsUIStateCopyWithImpl<$Res, $Val extends SettingsUIState> Object? locationCacheSize = null, }) { return _then(_value.copyWith( - isDeviceSupportWinHello: freezed == isDeviceSupportWinHello - ? _value.isDeviceSupportWinHello - : isDeviceSupportWinHello // ignore: cast_nullable_to_non_nullable - as dynamic, isEnableToolSiteMirrors: null == isEnableToolSiteMirrors ? _value.isEnableToolSiteMirrors : isEnableToolSiteMirrors // ignore: cast_nullable_to_non_nullable @@ -101,8 +94,7 @@ abstract class _$$SettingsUIStateImplCopyWith<$Res> @override @useResult $Res call( - {dynamic isDeviceSupportWinHello, - bool isEnableToolSiteMirrors, + {bool isEnableToolSiteMirrors, String inputGameLaunchECore, String? customLauncherPath, String? customGamePath, @@ -120,7 +112,6 @@ class __$$SettingsUIStateImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? isDeviceSupportWinHello = freezed, Object? isEnableToolSiteMirrors = null, Object? inputGameLaunchECore = null, Object? customLauncherPath = freezed, @@ -128,9 +119,6 @@ class __$$SettingsUIStateImplCopyWithImpl<$Res> Object? locationCacheSize = null, }) { return _then(_$SettingsUIStateImpl( - isDeviceSupportWinHello: freezed == isDeviceSupportWinHello - ? _value.isDeviceSupportWinHello! - : isDeviceSupportWinHello, isEnableToolSiteMirrors: null == isEnableToolSiteMirrors ? _value.isEnableToolSiteMirrors : isEnableToolSiteMirrors // ignore: cast_nullable_to_non_nullable @@ -159,16 +147,12 @@ class __$$SettingsUIStateImplCopyWithImpl<$Res> class _$SettingsUIStateImpl implements _SettingsUIState { _$SettingsUIStateImpl( - {this.isDeviceSupportWinHello = false, - this.isEnableToolSiteMirrors = false, + {this.isEnableToolSiteMirrors = false, this.inputGameLaunchECore = "0", this.customLauncherPath, this.customGamePath, this.locationCacheSize = 0}); - @override - @JsonKey() - final dynamic isDeviceSupportWinHello; @override @JsonKey() final bool isEnableToolSiteMirrors; @@ -185,7 +169,7 @@ class _$SettingsUIStateImpl implements _SettingsUIState { @override String toString() { - return 'SettingsUIState(isDeviceSupportWinHello: $isDeviceSupportWinHello, isEnableToolSiteMirrors: $isEnableToolSiteMirrors, inputGameLaunchECore: $inputGameLaunchECore, customLauncherPath: $customLauncherPath, customGamePath: $customGamePath, locationCacheSize: $locationCacheSize)'; + return 'SettingsUIState(isEnableToolSiteMirrors: $isEnableToolSiteMirrors, inputGameLaunchECore: $inputGameLaunchECore, customLauncherPath: $customLauncherPath, customGamePath: $customGamePath, locationCacheSize: $locationCacheSize)'; } @override @@ -193,8 +177,6 @@ class _$SettingsUIStateImpl implements _SettingsUIState { return identical(this, other) || (other.runtimeType == runtimeType && other is _$SettingsUIStateImpl && - const DeepCollectionEquality().equals( - other.isDeviceSupportWinHello, isDeviceSupportWinHello) && (identical( other.isEnableToolSiteMirrors, isEnableToolSiteMirrors) || other.isEnableToolSiteMirrors == isEnableToolSiteMirrors) && @@ -211,7 +193,6 @@ class _$SettingsUIStateImpl implements _SettingsUIState { @override int get hashCode => Object.hash( runtimeType, - const DeepCollectionEquality().hash(isDeviceSupportWinHello), isEnableToolSiteMirrors, inputGameLaunchECore, customLauncherPath, @@ -228,15 +209,12 @@ class _$SettingsUIStateImpl implements _SettingsUIState { abstract class _SettingsUIState implements SettingsUIState { factory _SettingsUIState( - {final dynamic isDeviceSupportWinHello, - final bool isEnableToolSiteMirrors, + {final bool isEnableToolSiteMirrors, final String inputGameLaunchECore, final String? customLauncherPath, final String? customGamePath, final int locationCacheSize}) = _$SettingsUIStateImpl; - @override - dynamic get isDeviceSupportWinHello; @override bool get isEnableToolSiteMirrors; @override diff --git a/lib/ui/settings/settings_ui_model.g.dart b/lib/ui/settings/settings_ui_model.g.dart index 68348b3..e315053 100644 --- a/lib/ui/settings/settings_ui_model.g.dart +++ b/lib/ui/settings/settings_ui_model.g.dart @@ -6,7 +6,7 @@ part of 'settings_ui_model.dart'; // RiverpodGenerator // ************************************************************************** -String _$settingsUIModelHash() => r'897176bc24ec5397cce0dd1ceea58338ac7841e0'; +String _$settingsUIModelHash() => r'2be0fe230d23f84796e0a3a39dd3248c2aa90f23'; /// See also [SettingsUIModel]. @ProviderFor(SettingsUIModel)