diff --git a/android/app/build.gradle b/android/app/build.gradle index 4b82a04f..8704ad31 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -53,6 +53,10 @@ android { targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName + + ndk { + abiFilters 'arm64-v8a' + } } signingConfigs { diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index b91f8b01..7a7173cf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -586,7 +586,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -596,7 +596,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -720,7 +720,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -730,7 +730,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -748,7 +748,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -758,7 +758,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -779,7 +779,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -792,7 +792,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -818,7 +818,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -831,7 +831,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -854,7 +854,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -867,7 +867,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -890,7 +890,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -902,7 +902,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -931,7 +931,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -943,7 +943,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -969,7 +969,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 649; + CURRENT_PROJECT_VERSION = 653; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -981,7 +981,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.649; + MARKETING_VERSION = 1.0.653; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/core/extension/listx.dart b/lib/core/extension/listx.dart new file mode 100644 index 00000000..c2a1401c --- /dev/null +++ b/lib/core/extension/listx.dart @@ -0,0 +1,9 @@ +extension ListX on List { + List joinWith(T item, [bool self = true]) { + final list = self ? this : List.from(this); + for (var i = length - 1; i > 0; i--) { + list.insert(i, item); + } + return list; + } +} \ No newline at end of file diff --git a/lib/core/extension/sftpfile.dart b/lib/core/extension/sftpfile.dart index 9eb17171..3e1f867d 100644 --- a/lib/core/extension/sftpfile.dart +++ b/lib/core/extension/sftpfile.dart @@ -2,14 +2,14 @@ import 'package:dartssh2/dartssh2.dart'; extension SftpFile on SftpFileMode { String get str { - final user = getRoleMode(userRead, userWrite, userExecute); - final group = getRoleMode(groupRead, groupWrite, groupExecute); - final other = getRoleMode(otherRead, otherWrite, otherExecute); + final user = _getRoleMode(userRead, userWrite, userExecute); + final group = _getRoleMode(groupRead, groupWrite, groupExecute); + final other = _getRoleMode(otherRead, otherWrite, otherExecute); return '$user$group$other'; } } -String getRoleMode(bool r, bool w, bool x) { +String _getRoleMode(bool r, bool w, bool x) { return '${r ? 'r' : '-'}${w ? 'w' : '-'}${x ? 'x' : '-'}'; } diff --git a/lib/core/utils/ui.dart b/lib/core/utils/ui.dart index 7af992d4..c52f582b 100644 --- a/lib/core/utils/ui.dart +++ b/lib/core/utils/ui.dart @@ -37,10 +37,14 @@ Future loadFontFile(String localPath) async { void switchStatusBar({required bool hide}) { if (hide) { - SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky, - overlays: []); + SystemChrome.setEnabledSystemUIMode( + SystemUiMode.immersiveSticky, + overlays: [], + ); } else { - SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, - overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom]); + SystemChrome.setEnabledSystemUIMode( + SystemUiMode.edgeToEdge, + overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom], + ); } } diff --git a/lib/data/model/app/shell_func.dart b/lib/data/model/app/shell_func.dart index 1fcf383b..4405ce23 100644 --- a/lib/data/model/app/shell_func.dart +++ b/lib/data/model/app/shell_func.dart @@ -33,8 +33,7 @@ enum ShellFunc { /// Issue #168 /// Use `sh` for compatibility - static final installShellCmd = - """ + static final installShellCmd = """ mkdir -p $_homeVar/$_srvBoxDir cat << 'EOF' > $_installShellPath ${ShellFunc.allScript} @@ -135,8 +134,7 @@ fi'''; static final String allScript = () { final sb = StringBuffer(); - sb.write( - ''' + sb.write(''' #!/bin/sh # Script for ServerBox app v1.0.${BuildData.build} # DO NOT delete this file while app is running @@ -155,8 +153,7 @@ userId=\$(id -u) '''); // Write each func for (final func in values) { - sb.write( - ''' + sb.write(''' ${func.name}() { ${func._cmd.split('\n').map((e) => '\t$e').join('\n')} } diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 8c73773f..276e6e83 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,9 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 649; + static const int build = 653; static const String engine = "3.16.0"; - static const String buildAt = "2023-11-23 22:29:30"; - static const int modifications = 11; - static const int script = 29; + static const String buildAt = "2023-11-27 19:18:56"; + static const int modifications = 3; + static const int script = 30; } diff --git a/lib/data/store/setting.dart b/lib/data/store/setting.dart index 2628b7ad..fb9c3935 100644 --- a/lib/data/store/setting.dart +++ b/lib/data/store/setting.dart @@ -226,7 +226,7 @@ class SettingStore extends PersistentStore { /// Server func btns display name late final serverFuncBtnsDisplayName = - StoreProperty(box, 'serverFuncBtnsDisplayName', true); + StoreProperty(box, 'serverFuncBtnsDisplayName', false); // Never show these settings for users // diff --git a/lib/view/page/server/tab.dart b/lib/view/page/server/tab.dart index 078afbfe..ab9a82bc 100644 --- a/lib/view/page/server/tab.dart +++ b/lib/view/page/server/tab.dart @@ -581,9 +581,6 @@ class _ServerPageState extends State if (failedInfo == null) { return l10n.serverTabFailed; } - if (failedInfo.contains('encypted')) { - return l10n.serverTabPlzSave; - } return failedInfo; } } diff --git a/lib/view/page/setting/srv_detail_seq.dart b/lib/view/page/setting/srv_detail_seq.dart index 2331b7a6..ae0e4d9d 100644 --- a/lib/view/page/setting/srv_detail_seq.dart +++ b/lib/view/page/setting/srv_detail_seq.dart @@ -26,7 +26,7 @@ class _ServerDetailOrderPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: CustomAppBar( - title: Text(l10n.serverOrder), + title: Text(l10n.serverDetailOrder), ), body: _buildBody(), ); diff --git a/lib/view/page/setting/srv_seq.dart b/lib/view/page/setting/srv_seq.dart index b9f24fc7..0c9f324b 100644 --- a/lib/view/page/setting/srv_seq.dart +++ b/lib/view/page/setting/srv_seq.dart @@ -41,8 +41,7 @@ class _ServerOrderPageState extends State { }), padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 3), buildDefaultDragHandles: false, - itemBuilder: (_, index) => - _buildItem(index, Pros.server.serverOrder[index]), + itemBuilder: (_, idx) => _buildItem(idx, Pros.server.serverOrder[idx]), itemCount: Pros.server.serverOrder.length, ); } diff --git a/lib/view/page/ssh/tab.dart b/lib/view/page/ssh/tab.dart index b289b787..717466c7 100644 --- a/lib/view/page/ssh/tab.dart +++ b/lib/view/page/ssh/tab.dart @@ -20,7 +20,6 @@ class _SSHTabPageState extends State late final _tabIds = { l10n.add: _buildAddPage(), }; - final _tabKeys = {}; late var _tabController = TabController( length: _tabIds.length, vsync: this, @@ -34,6 +33,7 @@ class _SSHTabPageState extends State controller: _tabController, tabs: _tabIds.keys.map(_buildTabItem).toList(), isScrollable: true, + tabAlignment: TabAlignment.start, dividerColor: Colors.transparent, ), body: _buildBody(), @@ -75,7 +75,6 @@ class _SSHTabPageState extends State } _tabIds.remove(e); _refreshTabs(); - //_tabKeys[e]?.currentState?.dispose(); }, ), ], @@ -107,7 +106,6 @@ class _SSHTabPageState extends State spi: spi, pop: false, ); - _tabKeys[name] = key; _refreshTabs(); _tabController.animateTo(_tabIds.length - 1); }, diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 0a896ba7..d9d0c1ad 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,8 +1,6 @@ PODS: - dynamic_color (0.0.2): - FlutterMacOS - - flutter_secure_storage_macos (6.1.1): - - FlutterMacOS - FlutterMacOS (1.0.0) - icloud_storage (0.0.1): - FlutterMacOS @@ -21,7 +19,6 @@ PODS: DEPENDENCIES: - dynamic_color (from `Flutter/ephemeral/.symlinks/plugins/dynamic_color/macos`) - - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - icloud_storage (from `Flutter/ephemeral/.symlinks/plugins/icloud_storage/macos`) - macos_window_utils (from `Flutter/ephemeral/.symlinks/plugins/macos_window_utils/macos`) @@ -33,8 +30,6 @@ DEPENDENCIES: EXTERNAL SOURCES: dynamic_color: :path: Flutter/ephemeral/.symlinks/plugins/dynamic_color/macos - flutter_secure_storage_macos: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos FlutterMacOS: :path: Flutter/ephemeral icloud_storage: @@ -52,7 +47,6 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: dynamic_color: 2eaa27267de1ca20d879fbd6e01259773fb1670f - flutter_secure_storage_macos: d56e2d218c1130b262bef8b4a7d64f88d7f9c9ea FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 icloud_storage: 33b05299e26d1391d724da8d62860e702380a1cd macos_window_utils: 933f91f64805e2eb91a5bd057cf97cd097276663 diff --git a/test/nvdia_test.dart b/test/nvdia_test.dart index ef9a06a8..23e10096 100644 --- a/test/nvdia_test.dart +++ b/test/nvdia_test.dart @@ -2,8 +2,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:toolbox/data/model/server/nvdia.dart'; -const _raw = - ''' +const _raw = '''