diff --git a/android/build.gradle b/android/build.gradle index d8cdb79..c311428 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle.properties b/android/gradle.properties index 94adc3a..b9a9a24 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..8bc9958 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip diff --git a/lib/network/bin/configuration.dart b/lib/network/bin/configuration.dart index 8f4aba8..fe1022b 100644 --- a/lib/network/bin/configuration.dart +++ b/lib/network/bin/configuration.dart @@ -37,7 +37,7 @@ class Configuration { String proxyPassDomains = SystemProxy.proxyPassDomains; //是否显示更新内容公告 - bool upgradeNoticeV4 = true; + bool upgradeNoticeV5 = true; //外部代理 ProxyInfo? externalProxy; @@ -72,7 +72,7 @@ class Configuration { enableSsl = config['enableSsl'] == true; enableSystemProxy = config['enableSystemProxy'] ?? (config['enableDesktop'] ?? true); proxyPassDomains = config['proxyPassDomains'] ?? SystemProxy.proxyPassDomains; - upgradeNoticeV4 = config['upgradeNoticeV4'] ?? true; + upgradeNoticeV5 = config['upgradeNoticeV5'] ?? true; if (config['externalProxy'] != null) { externalProxy = ProxyInfo.fromJson(config['externalProxy']); } @@ -117,7 +117,7 @@ class Configuration { Map toJson() { return { - 'upgradeNoticeV4': upgradeNoticeV4, + 'upgradeNoticeV5': upgradeNoticeV5, 'port': port, 'enableSsl': enableSsl, 'enableSystemProxy': enableSystemProxy, diff --git a/lib/network/util/request_rewrite.dart b/lib/network/util/request_rewrite.dart index fc52d65..91c4293 100644 --- a/lib/network/util/request_rewrite.dart +++ b/lib/network/util/request_rewrite.dart @@ -109,7 +109,7 @@ class RequestRewrites { } /// 保存请求重写配置文件 - flushRequestRewriteConfig() async { + Future flushRequestRewriteConfig() async { var home = await FileRead.homeDir(); var file = File('${home.path}${Platform.pathSeparator}request_rewrite.json'); bool exists = await file.exists(); @@ -118,7 +118,7 @@ class RequestRewrites { } var json = jsonEncode(toJson()); logger.i('刷新请求重写配置文件 ${file.path}'); - file.writeAsString(json); + await file.writeAsString(json); } } @@ -165,7 +165,7 @@ class RequestRewriteRule { : urlReg = RegExp(url.replaceAll("*", ".*")); /// 从json中创建 - factory RequestRewriteRule.formJson(Map map) { + factory RequestRewriteRule.formJson(Map map) { return RequestRewriteRule(map['enabled'] == true, name: map['name'], url: map['url'] ?? map['domain'] + map['path'], diff --git a/lib/ui/component/multi_window.dart b/lib/ui/component/multi_window.dart index 8b2ad09..59848ee 100644 --- a/lib/ui/component/multi_window.dart +++ b/lib/ui/component/multi_window.dart @@ -57,25 +57,43 @@ Widget multiWindow(int windowId, Map argument) { return const SizedBox(); } -//打开编码窗口 -encodeWindow(EncoderType type, BuildContext context, [String? text]) async { - if (Platforms.isMobile()) { - Navigator.of(context).push(MaterialPageRoute(builder: (context) => EncoderWidget(type: type, text: text))); - return; +enum Operation { + add, + update, + delete, + refresh; + + static Operation of(String name) { + return values.firstWhere((element) => element.name == name); + } +} + +class MultiWindow { + /// 刷新请求重写 + static Future invokeRefreshRewrite(Operation operation, {int? index, RequestRewriteRule? rule}) async { + await DesktopMultiWindow.invokeMethod( + 0, "refreshRequestRewrite", {"operation": operation.name, 'index': index, 'rule': rule?.toJson()}); } - var ratio = 1.0; - if (Platform.isWindows) { - ratio = WindowManager.instance.getDevicePixelRatio(); + static bool _refreshRewrite = false; + + static void _handleRefreshRewrite(Operation operation, Map arguments) { + if (Operation.add == operation) { + RequestRewrites.instance.then((it) => it.addRule(RequestRewriteRule.formJson(arguments['rule']))); + } else if (Operation.update == operation) { + RequestRewrites.instance + .then((it) => it.rules[arguments['index']] = RequestRewriteRule.formJson(arguments['rule'])); + } else if (Operation.delete == operation) { + RequestRewrites.instance.then((it) => it.removeIndex([arguments['index']])); + } + + if (_refreshRewrite) return; + _refreshRewrite = true; + Future.delayed(const Duration(milliseconds: 1000), () async { + _refreshRewrite = false; + (await RequestRewrites.instance).flushRequestRewriteConfig(); + }); } - final window = await DesktopMultiWindow.createWindow(jsonEncode( - {'name': 'EncoderWidget', 'type': type.name, 'text': text}, - )); - window.setTitle('编码'); - window - ..setFrame(const Offset(80, 80) & Size(900 * ratio, 600 * ratio)) - ..center() - ..show(); } bool _registerHandler = false; @@ -93,12 +111,12 @@ void registerMethodHandler() { await ScriptManager.instance.then((value) { return value.reloadScript(); }); + return 'done'; } - if (call.method == 'refreshRequestRewrite') { - await RequestRewrites.instance.then((value) { - return value.reloadRequestRewrite(); - }); + if (call.method == 'refreshRequestRewrite' && fromWindowId != 0) { + MultiWindow._handleRefreshRewrite(Operation.of(call.arguments['operation']), call.arguments); + return 'done'; } if (call.method == 'getApplicationSupportDirectory') { @@ -126,6 +144,27 @@ void registerMethodHandler() { }); } +///打开编码窗口 +encodeWindow(EncoderType type, BuildContext context, [String? text]) async { + if (Platforms.isMobile()) { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => EncoderWidget(type: type, text: text))); + return; + } + + var ratio = 1.0; + if (Platform.isWindows) { + ratio = WindowManager.instance.getDevicePixelRatio(); + } + final window = await DesktopMultiWindow.createWindow(jsonEncode( + {'name': 'EncoderWidget', 'type': type.name, 'text': text}, + )); + window.setTitle('编码'); + window + ..setFrame(const Offset(80, 80) & Size(900 * ratio, 600 * ratio)) + ..center() + ..show(); +} + ///打开脚本窗口 openScriptWindow() async { var ratio = 1.0; @@ -155,7 +194,7 @@ openRequestRewriteWindow() async { )); window.setTitle('请求重写'); window - ..setFrame(const Offset(50, 0) & Size(800 * ratio, 660 * ratio)) + ..setFrame(const Offset(50, 0) & Size(800 * ratio, 650 * ratio)) ..center() ..show(); } diff --git a/lib/ui/content/body.dart b/lib/ui/content/body.dart index 4d61231..609ef27 100644 --- a/lib/ui/content/body.dart +++ b/lib/ui/content/body.dart @@ -162,7 +162,12 @@ class HttpBodyState extends State { barrierDismissible: false, builder: (BuildContext context) => RuleAddDialog(rule: rule)).then((value) { if (value != null) { - RequestRewrites.instance.then((it) => it.flushRequestRewriteConfig()); + DesktopMultiWindow.getAllSubWindowIds().then((windowIds) async { + await (await RequestRewrites.instance).flushRequestRewriteConfig(); + for (var windowId in windowIds) { + DesktopMultiWindow.invokeMethod(windowId, "reloadRequestRewrite"); + } + }); FlutterToastr.show("保存请求重写规则成功", context); } }); diff --git a/lib/ui/desktop/desktop.dart b/lib/ui/desktop/desktop.dart index db9e604..6b8ccf4 100644 --- a/lib/ui/desktop/desktop.dart +++ b/lib/ui/desktop/desktop.dart @@ -54,7 +54,7 @@ class _DesktopHomePagePageState extends State implements EventL proxyServer.addListener(this); panel = NetworkTabController(tabStyle: const TextStyle(fontSize: 16), proxyServer: proxyServer); - if (widget.configuration.upgradeNoticeV4) { + if (widget.configuration.upgradeNoticeV5) { WidgetsBinding.instance.addPostFrameCallback((_) { showUpgradeNotice(); }); @@ -126,23 +126,22 @@ class _DesktopHomePagePageState extends State implements EventL actions: [ TextButton( onPressed: () { - widget.configuration.upgradeNoticeV4 = false; + widget.configuration.upgradeNoticeV5 = false; widget.configuration.flushConfig(); Navigator.pop(context); }, child: const Text('关闭')) ], - title: const Text('更新内容V1.0.4', style: TextStyle(fontSize: 18)), + title: const Text('更新内容V1.0.5', style: TextStyle(fontSize: 18)), content: const Text( '提示:默认不会开启HTTPS抓包,请安装证书后再开启HTTPS抓包。\n' '点击的HTTPS抓包(加锁图标),选择安装根证书,按照提示操作即可。\n\n' - '新增更新:\n' - '1. 增加JS脚本,可修改请求和影响,脚本支持fetch API请求接口;\n' - '2. 扫码配置同步增加脚本配置;\n' - '3. 桌面端增加系统代理忽略域名设置,忽略的域名不会进行代理;\n' - '4. 收藏增加重命名;\n' - '5. 手机端认启动监听端口,无需开启抓包可直接下载证书;\n' - '6. 修复安卓白名单已经删除应用展示异常问题;', + '安卓重大更新!:\n' + '1. 安卓支持抓Flutter请求;\n' + '2. 安卓支持10以下版本;\n' + '3. 修复脚本导入中文乱码;\n' + '4. 手机端外部代理配置是否展示抓包;\n' + '5. 桌面端请求重写新窗口打开;', style: TextStyle(fontSize: 14))); }); } diff --git a/lib/ui/desktop/toolbar/setting/request_rewrite.dart b/lib/ui/desktop/toolbar/setting/request_rewrite.dart index 620da85..936d8de 100644 --- a/lib/ui/desktop/toolbar/setting/request_rewrite.dart +++ b/lib/ui/desktop/toolbar/setting/request_rewrite.dart @@ -3,22 +3,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_toastr/flutter_toastr.dart'; import 'package:network_proxy/network/util/request_rewrite.dart'; +import 'package:network_proxy/ui/component/multi_window.dart'; import 'package:network_proxy/ui/component/utils.dart'; import 'package:network_proxy/ui/component/widgets.dart'; -bool _refresh = false; - -/// 刷新请求重写 -void _refreshConfig() async { - if (_refresh) return; - _refresh = true; - Future.delayed(const Duration(milliseconds: 1000), () async { - _refresh = false; - (await RequestRewrites.instance).flushRequestRewriteConfig(); - await DesktopMultiWindow.invokeMethod(0, "refreshRequestRewrite"); - }); -} - class RequestRewriteWidget extends StatefulWidget { final int windowId; final RequestRewrites requestRewrites; @@ -39,6 +27,13 @@ class RequestRewriteState extends State { super.initState(); RawKeyboard.instance.addListener(onKeyEvent); enableNotifier = ValueNotifier(widget.requestRewrites.enabled == true); + DesktopMultiWindow.setMethodHandler((call, fromWindowId) async { + print("call.method: ${call.method}"); + if (call.method == 'reloadRequestRewrite') { + await widget.requestRewrites.reloadRequestRewrite(); + setState(() {}); + } + }); } @override @@ -48,6 +43,11 @@ class RequestRewriteState extends State { } void onKeyEvent(RawKeyEvent event) async { + if (event.isKeyPressed(LogicalKeyboardKey.exit) && Navigator.canPop(context)) { + Navigator.pop(context); + return; + } + if ((event.isKeyPressed(LogicalKeyboardKey.metaLeft) || event.isControlPressed) && event.isKeyPressed(LogicalKeyboardKey.keyW)) { if (Navigator.canPop(context)) { @@ -84,7 +84,7 @@ class RequestRewriteState extends State { value: enableNotifier.value, onChanged: (value) { enableNotifier.value = value; - _refreshConfig(); + MultiWindow.invokeRefreshRewrite(Operation.refresh); }); })), Expanded( @@ -220,10 +220,11 @@ class _RuleAddDialogState extends State { rule.enabled = enableNotifier.value; if (widget.currentIndex >= 0) { (await RequestRewrites.instance).rules[widget.currentIndex] = rule; + MultiWindow.invokeRefreshRewrite(Operation.update, index: widget.currentIndex, rule: rule); } else { (await RequestRewrites.instance).addRule(rule); + MultiWindow.invokeRefreshRewrite(Operation.add, rule: rule); } - _refreshConfig(); if (mounted) { Navigator.of(context).pop(rule); } @@ -335,10 +336,6 @@ class _RequestRuleListState extends State { rules = widget.requestRewrites.rules; } - changeState() { - setState(() {}); - } - @override Widget build(BuildContext context) { return Container( @@ -405,7 +402,7 @@ class _RequestRuleListState extends State { value: list[index].enabled, onChanged: (val) { list[index].enabled = val; - _refreshConfig(); + MultiWindow.invokeRefreshRewrite(Operation.update, index: index, rule: list[index]); }))), const SizedBox(width: 20), Expanded( @@ -447,7 +444,7 @@ class _RequestRuleListState extends State { child: rules[index].enabled ? const Text("禁用") : const Text("启用"), onTap: () { rules[index].enabled = !rules[index].enabled; - _refreshConfig(); + MultiWindow.invokeRefreshRewrite(Operation.update, index: index, rule: rules[index]); }), const PopupMenuDivider(), PopupMenuItem( @@ -455,7 +452,7 @@ class _RequestRuleListState extends State { child: const Text("删除"), onTap: () async { widget.requestRewrites.removeIndex([index]); - _refreshConfig(); + MultiWindow.invokeRefreshRewrite(Operation.delete, index: index); if (context.mounted) FlutterToastr.show('删除成功', context); }), ]).then((value) { diff --git a/lib/ui/mobile/menu.dart b/lib/ui/mobile/menu.dart index 388a642..445d5f7 100644 --- a/lib/ui/mobile/menu.dart +++ b/lib/ui/mobile/menu.dart @@ -37,73 +37,72 @@ class DrawerWidget extends StatelessWidget { Widget build(BuildContext context) { return Drawer( child: ListView( - padding: EdgeInsets.zero, - children: [ - DrawerHeader( - decoration: BoxDecoration(color: Theme.of(context).colorScheme.primaryContainer), - child: const Text(''), - ), - ListTile( - leading: const Icon(Icons.favorite), - title: const Text("收藏"), - trailing: const Icon(Icons.arrow_right), - onTap: () => navigator(context, MobileFavorites(proxyServer: proxyServer))), - ListTile( - leading: const Icon(Icons.history), - title: const Text("历史"), - trailing: const Icon(Icons.arrow_right), - onTap: () => navigator(context, MobileHistory(proxyServer: proxyServer, requestStateKey: requestStateKey)), - ), - const Divider(thickness: 0.3), - ListTile( - title: const Text("代理"), - trailing: const Icon(Icons.arrow_right), - onTap: () => navigator(context, ProxySetting(proxyServer: proxyServer))), - ListTile( - title: const Text("HTTPS抓包"), - trailing: const Icon(Icons.arrow_right), - onTap: () => navigator(context, MobileSslWidget(proxyServer: proxyServer))), - const MobileThemeSetting(), - Platform.isIOS - ? const SizedBox() - : ListTile( + padding: EdgeInsets.zero, + children: [ + DrawerHeader( + decoration: BoxDecoration(color: Theme + .of(context) + .colorScheme + .primaryContainer), + child: const Text(''), + ), + ListTile( + leading: const Icon(Icons.favorite), + title: const Text("收藏"), + trailing: const Icon(Icons.arrow_right), + onTap: () => navigator(context, MobileFavorites(proxyServer: proxyServer))), + ListTile( + leading: const Icon(Icons.history), + title: const Text("历史"), + trailing: const Icon(Icons.arrow_right), + onTap: () => + navigator(context, MobileHistory(proxyServer: proxyServer, requestStateKey: requestStateKey)), + ), + const Divider(thickness: 0.3), + ListTile( + title: const Text("代理"), + trailing: const Icon(Icons.arrow_right), + onTap: () => navigator(context, ProxySetting(proxyServer: proxyServer))), + ListTile( + title: const Text("HTTPS抓包"), + trailing: const Icon(Icons.arrow_right), + onTap: () => navigator(context, MobileSslWidget(proxyServer: proxyServer))), + const MobileThemeSetting(), + Platform.isIOS + ? const SizedBox() + : ListTile( title: const Text("应用白名单"), trailing: const Icon(Icons.arrow_right), onTap: () => navigator(context, AppWhitelist(proxyServer: proxyServer))), - ListTile( - title: const Text("域名白名单"), - trailing: const Icon(Icons.arrow_right), - onTap: () => navigator( - context, MobileFilterWidget(configuration: proxyServer.configuration, hostList: HostFilter.whitelist))), - ListTile( - title: const Text("域名黑名单"), - trailing: const Icon(Icons.arrow_right), - onTap: () => navigator( - context, MobileFilterWidget(configuration: proxyServer.configuration, hostList: HostFilter.blacklist))), - ListTile( - title: const Text("请求重写"), - trailing: const Icon(Icons.arrow_right), - onTap: () async => navigator(context, MobileRequestRewrite(requestRewrites: (await RequestRewrites.instance)))), - ListTile( - title: const Text("脚本"), - trailing: const Icon(Icons.arrow_right), - onTap: () => navigator(context, const MobileScript())), - ListTile( - title: const Text("Github"), - trailing: const Icon(Icons.arrow_right), - onTap: () { - launchUrl(Uri.parse("https://github.com/wanghongenpin/network_proxy_flutter"), - mode: LaunchMode.externalApplication); - }), - ListTile( - title: const Text("下载地址"), - trailing: const Icon(Icons.arrow_right), - onTap: () { - launchUrl(Uri.parse("https://gitee.com/wanghongenpin/network-proxy-flutter/releases"), - mode: LaunchMode.externalApplication); - }) - ], - )); + ListTile( + title: const Text("域名白名单"), + trailing: const Icon(Icons.arrow_right), + onTap: () => + navigator( + context, + MobileFilterWidget(configuration: proxyServer.configuration, hostList: HostFilter.whitelist))), + ListTile( + title: const Text("域名黑名单"), + trailing: const Icon(Icons.arrow_right), + onTap: () => + navigator( + context, + MobileFilterWidget(configuration: proxyServer.configuration, hostList: HostFilter.blacklist))), + ListTile( + title: const Text("请求重写"), + trailing: const Icon(Icons.arrow_right), + onTap: () async => + navigator(context, MobileRequestRewrite(requestRewrites: (await RequestRewrites.instance)))), + ListTile( + title: const Text("脚本"), + trailing: const Icon(Icons.arrow_right), + onTap: () => navigator(context, const MobileScript())), + ListTile( + title: const Text("关于"), + trailing: const Icon(Icons.arrow_right), + onTap: () => navigator(context, const About())), + ], + )); } ///跳转页面 @@ -145,35 +144,36 @@ class MoreEnum extends StatelessWidget { })), PopupMenuItem( child: ListTile( - dense: true, - leading: const Icon(Icons.qr_code_scanner_outlined), - title: const Text("连接终端"), - onTap: () { - connectRemote(context); - }, - )), + dense: true, + leading: const Icon(Icons.qr_code_scanner_outlined), + title: const Text("连接终端"), + onTap: () { + connectRemote(context); + }, + )), PopupMenuItem( child: ListTile( - dense: true, - leading: const Icon(Icons.phone_iphone), - title: const Text("我的二维码"), - onTap: () async { - var ip = await localIp(); - if (context.mounted) { - connectQrCode(context, ip, proxyServer.port); - } - }, - )), + dense: true, + leading: const Icon(Icons.phone_iphone), + title: const Text("我的二维码"), + onTap: () async { + var ip = await localIp(); + if (context.mounted) { + connectQrCode(context, ip, proxyServer.port); + } + }, + )), PopupMenuItem( child: ListTile( dense: true, leading: const Icon(Icons.construction), title: const Text("工具箱"), - onTap: () => Navigator.of(context).push( + onTap: () => + Navigator.of(context).push( MaterialPageRoute(builder: (BuildContext context) { return Scaffold( appBar: - AppBar(title: const Text("工具箱", style: TextStyle(fontSize: 16)), centerTitle: true), + AppBar(title: const Text("工具箱", style: TextStyle(fontSize: 16)), centerTitle: true), body: const Toolbox()); }), ))), @@ -213,7 +213,8 @@ class MoreEnum extends StatelessWidget { hostname: response.headers.get("hostname")); if (context.mounted && Navigator.canPop(context)) { - FlutterToastr.show("连接成功${Vpn.isVpnStarted ? '' : ',手机需要开启抓包才可以抓取请求哦'}", context, duration: 3); + FlutterToastr.show( + "连接成功${Vpn.isVpnStarted ? '' : ',手机需要开启抓包才可以抓取请求哦'}", context, duration: 3); Navigator.pop(context); } } @@ -270,3 +271,40 @@ class MoreEnum extends StatelessWidget { }); } } +/** + * 关于 + */ +class About extends StatelessWidget { + const About({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text("关于", style: TextStyle(fontSize: 16)), centerTitle: true), + body: Column( + children: [ + const SizedBox(height: 10), + const Text("ProxyPin", style: TextStyle(fontSize: 20)), + const SizedBox(height: 20), + const Text("全平台开源免费抓包软件"), + const SizedBox(height: 10), + const Text("V1.0.5"), + ListTile( + title: const Text("Github"), + trailing: const Icon(Icons.arrow_right), + onTap: () { + launchUrl(Uri.parse("https://github.com/wanghongenpin/network_proxy_flutter"), + mode: LaunchMode.externalApplication); + }), + ListTile( + title: const Text("下载地址"), + trailing: const Icon(Icons.arrow_right), + onTap: () { + launchUrl( + Uri.parse("https://gitee.com/wanghongenpin/network-proxy-flutter/releases"), + mode: LaunchMode.externalApplication); + }) + ], + )); + } +} \ No newline at end of file diff --git a/lib/ui/mobile/mobile.dart b/lib/ui/mobile/mobile.dart index 060f908..2165232 100644 --- a/lib/ui/mobile/mobile.dart +++ b/lib/ui/mobile/mobile.dart @@ -61,7 +61,7 @@ class MobileHomeState extends State implements EventListener { }); super.initState(); - if (widget.configuration.upgradeNoticeV4) { + if (widget.configuration.upgradeNoticeV5) { WidgetsBinding.instance.addPostFrameCallback((_) { showUpgradeNotice(); }); @@ -118,15 +118,14 @@ class MobileHomeState extends State implements EventListener { showUpgradeNotice() { String content = '提示:默认不会开启HTTPS抓包,请安装证书后再开启HTTPS抓包。\n\n' - '新增更新:\n' - '1. 增加JS脚本,可修改请求和影响,脚本支持fetch API请求接口;\n' - '2. 扫码配置同步增加脚本配置;\n' - '3. 桌面端增加系统代理忽略域名设置,忽略的域名不会进行代理;\n' - '4. 收藏增加重命名;\n' - '5. 手机端认启动监听端口,无需开启抓包可直接下载证书;\n' - '6. 修复安卓白名单已经删除应用展示异常问题;'; - showAlertDialog('更新内容V1.0.4', content, () { - widget.configuration.upgradeNoticeV4 = false; + '安卓重大更新!:\n' + '1. 安卓支持抓Flutter请求;\n' + '2. 安卓支持10以下版本;\n' + '3. 修复脚本导入中文乱码;\n' + '4. 手机端外部代理配置是否展示抓包;\n' + '5. 桌面端请求重写新窗口打开;'; + showAlertDialog('更新内容V1.0.5', content, () { + widget.configuration.upgradeNoticeV5 = false; widget.configuration.flushConfig(); }); } diff --git a/lib/ui/mobile/request/favorite.dart b/lib/ui/mobile/request/favorite.dart index 4356daa..ad9dca5 100644 --- a/lib/ui/mobile/request/favorite.dart +++ b/lib/ui/mobile/request/favorite.dart @@ -17,7 +17,7 @@ import 'package:network_proxy/utils/curl.dart'; class MobileFavorites extends StatefulWidget { final ProxyServer proxyServer; - const MobileFavorites({Key? key, required this.proxyServer}) : super(key: key); + const MobileFavorites({super.key, required this.proxyServer}); @override State createState() { diff --git a/pubspec.lock b/pubspec.lock index fb9530a..18c9706 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: cross_file - sha256: "445db18de832dba8d851e287aff8ccf169bed30d2e94243cb54c7d2f1ed2142c" + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.3+6" + version: "0.3.3+7" crypto: dependency: "direct main" description: @@ -214,10 +214,10 @@ packages: dependency: transitive description: name: file_selector_web - sha256: dc6622c4d66cb1bee623ddcc029036603c6cc45c85e4a775bb06008d61c809c1 + sha256: c0f025d460de3301b7bbbf837fc8d0759df85f182c635f1dd94934b4cdc92352 url: "https://pub.flutter-io.cn" source: hosted - version: "0.9.2+1" + version: "0.9.3" file_selector_windows: dependency: transitive description: @@ -517,10 +517,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.6" + version: "2.1.7" pointycastle: dependency: transitive description: @@ -698,10 +698,10 @@ packages: dependency: transitive description: name: url_launcher_ios - sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a" + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 url: "https://pub.flutter-io.cn" source: hosted - version: "6.2.0" + version: "6.2.1" url_launcher_linux: dependency: transitive description: @@ -730,10 +730,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2" + sha256: "138bd45b3a456dcfafc46d1a146787424f8d2edfbf2809c9324361e58f851cf7" url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.0" + version: "2.2.1" url_launcher_windows: dependency: transitive description: @@ -746,10 +746,10 @@ packages: dependency: transitive description: name: uuid - sha256: b715b8d3858b6fa9f68f87d20d98830283628014750c2b09b6f516c1da4af2a7 + sha256: df5a4d8f22ee4ccd77f8839ac7cb274ebc11ef9adcce8b92be14b797fe889921 url: "https://pub.flutter-io.cn" source: hosted - version: "4.1.0" + version: "4.2.1" vector_math: dependency: transitive description: @@ -786,10 +786,10 @@ packages: dependency: transitive description: name: win32 - sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" + sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f" url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.9" + version: "5.1.0" window_manager: dependency: "direct main" description: @@ -807,5 +807,5 @@ packages: source: hosted version: "1.0.3" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" - flutter: ">=3.13.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0"