- fix: `ping`
- new: support busybox `ping`
- new: flutter 3.10.0
This commit is contained in:
lollipopkit
2023-05-11 12:06:30 +08:00
parent 4f82eb09d8
commit 91f97e52b0
9 changed files with 55 additions and 50 deletions

View File

@@ -23,7 +23,7 @@ DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- plain_notification_token (from `.symlinks/plugins/plain_notification_token/ios`) - plain_notification_token (from `.symlinks/plugins/plain_notification_token/ios`)
- r_upgrade (from `.symlinks/plugins/r_upgrade/ios`) - r_upgrade (from `.symlinks/plugins/r_upgrade/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`)
@@ -39,7 +39,7 @@ EXTERNAL SOURCES:
flutter_native_splash: flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios" :path: ".symlinks/plugins/flutter_native_splash/ios"
path_provider_foundation: path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/ios" :path: ".symlinks/plugins/path_provider_foundation/darwin"
plain_notification_token: plain_notification_token:
:path: ".symlinks/plugins/plain_notification_token/ios" :path: ".symlinks/plugins/plain_notification_token/ios"
r_upgrade: r_upgrade:

View File

@@ -206,6 +206,7 @@
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
); );
name = "Thin Binary"; name = "Thin Binary";
outputPaths = ( outputPaths = (
@@ -359,7 +360,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 293; CURRENT_PROJECT_VERSION = 294;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -367,7 +368,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.293; MARKETING_VERSION = 1.0.294;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -490,7 +491,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 293; CURRENT_PROJECT_VERSION = 294;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -498,7 +499,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.293; MARKETING_VERSION = 1.0.294;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -515,7 +516,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 293; CURRENT_PROJECT_VERSION = 294;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -523,7 +524,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.293; MARKETING_VERSION = 1.0.294;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

View File

@@ -1,8 +1,9 @@
final parseFailed = Exception('Parse failed'); final parseFailed = Exception('Parse failed');
final seqReg = RegExp(r'icmp_seq=(.+) ttl=(.+) time=(.+) ms'); final seqReg = RegExp(r'seq=(.+) ttl=(.+) time=(.+) ms');
final packetReg = final packetReg =
RegExp(r'(.+) packets transmitted, (.+) received, (.+)% packet loss'); RegExp(r'(.+) packets transmitted, (.+) received, (.+)% packet loss');
final timeReg = RegExp(r'min/avg/max/mdev = (.+)/(.+)/(.+)/(.+) ms'); final timeReg = RegExp(r'min/avg/max/mdev = (.+)/(.+)/(.+)/(.+) ms');
final timeAlpineReg = RegExp(r'round-trip min/avg/max = (.+)/(.+)/(.+) ms');
final ipReg = RegExp(r' \((\S+)\)'); final ipReg = RegExp(r' \((\S+)\)');
class PingResult { class PingResult {
@@ -65,15 +66,22 @@ class PingStatistics {
} }
final packetMatched = packetReg.firstMatch(lines[0]); final packetMatched = packetReg.firstMatch(lines[0]);
final timeMatched = timeReg.firstMatch(lines[1]); final timeMatched = timeReg.firstMatch(lines[1]);
if (packetMatched == null || timeMatched == null) { final timeAlpineMatched = timeAlpineReg.firstMatch(lines[1]);
if (packetMatched == null) {
return; return;
} }
total = int.tryParse(packetMatched.group(1)!); total = int.tryParse(packetMatched.group(1)!);
received = int.tryParse(packetMatched.group(2)!); received = int.tryParse(packetMatched.group(2)!);
loss = double.tryParse(packetMatched.group(3)!); loss = double.tryParse(packetMatched.group(3)!);
if (timeMatched != null) {
min = double.tryParse(timeMatched.group(1)!); min = double.tryParse(timeMatched.group(1)!);
avg = double.tryParse(timeMatched.group(2)!); avg = double.tryParse(timeMatched.group(2)!);
max = double.tryParse(timeMatched.group(3)!); max = double.tryParse(timeMatched.group(3)!);
stddev = double.tryParse(timeMatched.group(4)!); stddev = double.tryParse(timeMatched.group(4)!);
} else if (timeAlpineMatched != null) {
min = double.tryParse(timeAlpineMatched.group(1)!);
avg = double.tryParse(timeAlpineMatched.group(2)!);
max = double.tryParse(timeAlpineMatched.group(3)!);
}
} }
} }

View File

@@ -2,8 +2,8 @@
class BuildData { class BuildData {
static const String name = "ServerBox"; static const String name = "ServerBox";
static const int build = 293; static const int build = 294;
static const String engine = "3.7.11"; static const String engine = "3.7.11";
static const String buildAt = "2023-05-10 12:26:52.686"; static const String buildAt = "2023-05-10 13:26:09.654757";
static const int modifications = 11; static const int modifications = 1;
} }

View File

@@ -14,11 +14,8 @@ import '../../locator.dart';
import '../widget/input_field.dart'; import '../widget/input_field.dart';
import '../widget/round_rect_card.dart'; import '../widget/round_rect_card.dart';
final doaminReg = /// Only permit ipv4 / ipv6 / domain chars
RegExp(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$'); final targetReg = RegExp(r'[a-zA-Z0-9\.-_:]+');
final ipv4Reg =
RegExp(r'^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\.(?!$)|$)){4}$');
final ipv6Reg = RegExp(r'^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$');
class PingPage extends StatefulWidget { class PingPage extends StatefulWidget {
const PingPage({Key? key}) : super(key: key); const PingPage({Key? key}) : super(key: key);
@@ -148,9 +145,8 @@ class _PingPageState extends State<PingPage>
return; return;
} }
if (!doaminReg.hasMatch(target) && /// avoid ping command injection
!ipv4Reg.hasMatch(target) && if (!targetReg.hasMatch(target)) {
!ipv6Reg.hasMatch(target)) {
showSnackBar(context, Text(s.pingInputIP)); showSnackBar(context, Text(s.pingInputIP));
return; return;
} }

View File

@@ -152,7 +152,7 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage>
onPressed: () async { onPressed: () async {
final path = await pickOneFile(); final path = await pickOneFile();
if (path == null) { if (path == null) {
showSnackBar(context, const Text('path is null')); showSnackBar(context, Text(_s.fieldMustNotEmpty));
return; return;
} }

View File

@@ -345,11 +345,11 @@ class _ServerDetailPageState extends State<ServerDetailPage>
} }
Widget _buildNetSpeedTop() { Widget _buildNetSpeedTop() {
return Padding( return const Padding(
padding: const EdgeInsets.only(bottom: 3), padding: EdgeInsets.only(bottom: 3),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [ children: [
Icon(Icons.device_hub, size: 17), Icon(Icons.device_hub, size: 17),
Icon(Icons.arrow_downward, size: 17), Icon(Icons.arrow_downward, size: 17),
Icon(Icons.arrow_upward, size: 17), Icon(Icons.arrow_upward, size: 17),

View File

@@ -53,10 +53,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.10.0" version: "2.11.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@@ -133,10 +133,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.1" version: "1.3.0"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@@ -174,10 +174,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.0" version: "1.17.1"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@@ -474,10 +474,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: intl name: intl
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.17.0" version: "0.18.0"
io: io:
dependency: transitive dependency: transitive
description: description:
@@ -490,10 +490,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: js name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.5" version: "0.6.7"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:
@@ -522,10 +522,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.13" version: "0.12.15"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
@@ -538,10 +538,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.0" version: "1.9.1"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@@ -570,10 +570,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.2" version: "1.8.3"
path_provider: path_provider:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -855,10 +855,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.4.16" version: "0.5.1"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@@ -1029,5 +1029,5 @@ packages:
source: hosted source: hosted
version: "0.0.6" version: "0.0.6"
sdks: sdks:
dart: ">=2.19.0 <3.0.0" dart: ">=3.0.0-0 <4.0.0"
flutter: ">=3.3.0" flutter: ">=3.3.0"

View File

@@ -53,7 +53,7 @@ dependencies:
path_provider: ^2.0.9 path_provider: ^2.0.9
easy_isolate: ^1.3.0 easy_isolate: ^1.3.0
share_plus: 6.3.2 share_plus: 6.3.2
intl: ^0.17.0 intl: ^0.18.0
share_plus_web: ^3.1.0 share_plus_web: ^3.1.0
# xterm: ^3.4.1 # xterm: ^3.4.1
xterm: xterm: