From 42d81fa6027b0b41945b1535857aa072d75a12f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 17 Aug 2024 20:08:47 +0800 Subject: [PATCH 01/15] Support frpc download for cli --- RELEASE_CHANGELOG.md | 13 +- nyalcf_cli/bin/nyalcf_cli.dart | 6 + nyalcf_cli/lib/arguments.dart | 6 + nyalcf_cli/lib/commands/download.dart | 95 ++++++++++++- nyalcf_core/lib/network/dio/basic_config.dart | 3 + .../lib/network/dio/frpc/download_frpc.dart | 83 ++++++++--- nyalcf_core/lib/utils/frpc/arch.dart | 22 +++ nyalcf_gui/nyalcf_core_extend/pubspec.lock | 120 ++++++++-------- .../controllers/frpc_setting_controller.dart | 28 +--- .../lib/controllers/user_controller.dart | 50 +++++-- .../lib/models/frpc_download_dialog.dart | 1 + .../nyalcf_ui/lib/views/panel/home.dart | 2 +- .../lib/views/setting/frpc_setting.dart | 22 ++- nyalcf_gui/pubspec.lock | 130 +++++++++--------- 14 files changed, 394 insertions(+), 187 deletions(-) create mode 100644 nyalcf_core/lib/utils/frpc/arch.dart diff --git a/RELEASE_CHANGELOG.md b/RELEASE_CHANGELOG.md index 7b4f3618..e4f12d1e 100644 --- a/RELEASE_CHANGELOG.md +++ b/RELEASE_CHANGELOG.md @@ -4,11 +4,18 @@ ## 更新日志 -# GUI +### GUI -- 修复由于上游API修改导致的数值溢出 +- 更新 Flutter +- 添加 LCM Frpc 下载镜像 -# CLI +### CLI + +- 添加 Frpc 下载功能 + +### 其他 + +- 重写了一些 Frpc 下载核心逻辑 -/- diff --git a/nyalcf_cli/bin/nyalcf_cli.dart b/nyalcf_cli/bin/nyalcf_cli.dart index 74640ab1..977e4e8a 100644 --- a/nyalcf_cli/bin/nyalcf_cli.dart +++ b/nyalcf_cli/bin/nyalcf_cli.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:nyalcf/commands/config.dart'; +import 'package:nyalcf/commands/download.dart'; import 'package:nyalcf/commands/login.dart'; import 'package:nyalcf/arguments.dart'; import 'package:nyalcf/commands/start.dart'; @@ -71,6 +72,11 @@ void main(List arguments) async { return; } + // 下载 Frpc + if (results.wasParsed('download')) { + Download().main(results.rest); + } + // 配置修改 if (results.wasParsed('config')) { Config().main(results.rest); diff --git a/nyalcf_cli/lib/arguments.dart b/nyalcf_cli/lib/arguments.dart index 18026de6..e3c2d3ad 100644 --- a/nyalcf_cli/lib/arguments.dart +++ b/nyalcf_cli/lib/arguments.dart @@ -25,6 +25,12 @@ class Arguments { negatable: false, help: 'Start frpc. usage: ..', ) + ..addFlag( + 'download', + abbr: 'd', + negatable: false, + help: 'Download frpc. usage: [ []]', + ) ..addFlag( 'config', abbr: 'c', diff --git a/nyalcf_cli/lib/commands/download.dart b/nyalcf_cli/lib/commands/download.dart index 2c4c677d..4e349e26 100644 --- a/nyalcf_cli/lib/commands/download.dart +++ b/nyalcf_cli/lib/commands/download.dart @@ -1,10 +1,99 @@ +import 'dart:io'; + +import 'package:dio/dio.dart'; + +import 'package:nyalcf/utils/state.dart'; import 'package:nyalcf/templates/command_implement.dart'; +import 'package:nyalcf_core/network/dio/frpc/download_frpc.dart'; +import 'package:nyalcf_core/utils/cpu_arch.dart'; +import 'package:nyalcf_core/utils/frpc/arch.dart'; +import 'package:nyalcf_core/utils/frpc/archive.dart'; +import 'package:nyalcf_core/utils/logger.dart'; class Download implements CommandImplement { + List> arch = []; + late String platform; + + String _selectedArch = ''; + String? _provideArch; + String? _providePlatform; + bool _provide = false; + + late CancelToken _cancelToken; @override - void main(List args) { - + void main(List args) async { + switch (args.length) { + case 0: + case 2: + if (args.length == 2) { + _provideArch = args[0]; + _providePlatform = args[1]; + _provide = true; + } + Logger.verbose('Provide info: ${_provideArch}, ${_providePlatform}'); + final systemArch = await CPUArch.getCPUArchitecture(); + Logger.verbose('CPU arch: ${systemArch}'); + + bool supportedSystem = false; + + if (!_provide) { + getPlatformFrpcArchList(); + for (var val in arch) { + Logger.debug(val['arch']); + if (val['name']!.contains(systemArch!)) { + supportedSystem = true; + _selectedArch = val['arch']!; + } + } + Logger.info('Automatic selected arch: ${_selectedArch}'); + } else { + _selectedArch = _provideArch!; + platform = _providePlatform!; + Logger.info('Selected: ${_selectedArch} ${_providePlatform}'); + } + + if (supportedSystem || _provide) { + _cancelToken = CancelToken(); + Logger.info('Starting frpc download...'); + + await DownloadFrpc().download( + arch: _selectedArch, + platform: platform, + version: '0.51.3-3', + releaseName: 'LoCyanFrp-0.51.3-3 #2024050701', + progressCallback: callback, + cancelToken: _cancelToken, + useMirror: false, + ); + stdout.write('\rPlease wait, extracting frpc...\n'); + await FrpcArchive.unarchive(platform: platform, arch: _selectedArch, version: '0.51.3-3'); + } else { + Logger.error( + 'Unsupported system! If you believe this is wrong, please provide arch manually in command.'); + } + default: + Logger.error('No valid arguments provided.'); + } } -} \ No newline at end of file + void getPlatformFrpcArchList() { + if (Platform.isWindows) { + platform = 'windows'; + this.arch = Arch.windows; + } + if (Platform.isLinux) { + platform = 'linux'; + this.arch = Arch.linux; + } + if (Platform.isMacOS) { + platform = 'darwin'; + this.arch = Arch.macos; + } + } + + void callback(downloaded, all) { + stdout.write('\r' + ' ' * 30); + stdout.write('\rProgress: ${(downloaded / all * 100).toStringAsFixed(2)}%'); + } +} diff --git a/nyalcf_core/lib/network/dio/basic_config.dart b/nyalcf_core/lib/network/dio/basic_config.dart index f118be3f..684e44f3 100644 --- a/nyalcf_core/lib/network/dio/basic_config.dart +++ b/nyalcf_core/lib/network/dio/basic_config.dart @@ -15,3 +15,6 @@ const frpcConfigUrl = 'https://lcf-frps-api.locyanfrp.cn/api'; const githubApiUrl = 'https://api-gh.1l1.icu'; const githubMainUrl = 'https://github.com'; const githubMirrorsUrl = 'https://proxy-gh.1l1.icu/https://github.com'; +const locyanMirrorsFrpcFormat = 'https://mirrors.locyan.cn/github-releases/' + + '{owner}/{repo}/{release_name}/frp_LoCyanFrp-{version_pure}_{platform}' + + '_{architecture}.{suffix}'; diff --git a/nyalcf_core/lib/network/dio/frpc/download_frpc.dart b/nyalcf_core/lib/network/dio/frpc/download_frpc.dart index a0d6d44d..984e9ba6 100644 --- a/nyalcf_core/lib/network/dio/frpc/download_frpc.dart +++ b/nyalcf_core/lib/network/dio/frpc/download_frpc.dart @@ -10,40 +10,75 @@ class DownloadFrpc { final dio = Dio(options); final _cachePath = appCachePath; + late final _version; + late final _platform; + late final _architecture; + late final _owner; + late final _repo; + late final _releaseName; + late final _suffix; + /// 下载Frpc Future download({ required String arch, required String platform, required String version, + required String releaseName, required ProgressCallback progressCallback, required CancelToken cancelToken, required bool useMirror, + String? mirrorFormat = null, + // version 版本 | owner 仓库所有者 | release_name 发行版本名称 | repo 仓库名 | arch 架构 | suffix 后缀名 | platform 平台 }) async { Logger.info('Start download: $platform | $version | $arch'); + + // 变量处理部分 + _version = version; + _platform = platform; + _architecture = arch; + _owner = 'LoCyan-Team'; + _repo = 'LoCyanFrpPureApp'; + _releaseName = releaseName; + _suffix = platform == 'windows' ? 'zip' : 'tar.gz'; + try { - final String downloadBasicUrl; - if (useMirror) { - final envUrl = Platform.environment['NYA_LCF_FRPC_DOWNLOAD_MIRROR_URL']; - downloadBasicUrl = - (envUrl?.substring(envUrl.length - 1, envUrl.length) == '/' - ? envUrl?.substring(envUrl.length - 2, envUrl.length - 1) - : envUrl) ?? - githubMirrorsUrl; - } else { - downloadBasicUrl = githubMainUrl; - } + // final String downloadBasicUrl; - Logger.info('Download frpc using: $downloadBasicUrl'); + final envUrl = Platform.environment['NYA_LCF_FRPC_DOWNLOAD_MIRROR_URL']; + final downloadUrl; + // '$downloadBasicUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download/v$version/frp_LoCyanFrp-${version.toString().split('-')[0]}_${platform}_$arch.$suffix'; - final String suffix; - if (platform == 'windows') { - suffix = 'zip'; + // if (useMirror) { + // final envUrl = Platform.environment['NYA_LCF_FRPC_DOWNLOAD_MIRROR_URL']; + // downloadBasicUrl = + // (envUrl?.substring(envUrl.length - 1, envUrl.length) == '/' + // ? envUrl?.substring(envUrl.length - 2, envUrl.length - 1) + // : envUrl) ?? + // githubMirrorsUrl; + // } else { + // downloadBasicUrl = githubMainUrl; + // } + + // Logger.info('Download frpc using: $downloadBasicUrl'); + + if (envUrl != null) { + downloadUrl = _replacePlaceholder(envUrl); + } else if (useMirror) { + downloadUrl = mirrorFormat != null + ? _replacePlaceholder(mirrorFormat) + : '$githubMirrorsUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download' + + '/v$_version/frp_LoCyanFrp-${_version.split('-')[0]}_' + + '${_platform}_$_architecture.$_suffix'; } else { - suffix = 'tar.gz'; + downloadUrl = + '$githubMainUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download' + + '/v$_version/frp_LoCyanFrp-${_version.split('-')[0]}_' + + '${_platform}_$_architecture.$_suffix'; } + return await dio.download( - '$downloadBasicUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download/v$version/frp_LoCyanFrp-${version.toString().split('-')[0]}_${platform}_$arch.$suffix', - '$_cachePath/frpc.$suffix', + downloadUrl, + '$_cachePath/frpc.$_suffix', cancelToken: cancelToken, onReceiveProgress: progressCallback, ); @@ -57,4 +92,16 @@ class DownloadFrpc { return e; } } + + _replacePlaceholder(String str) { + return str + .replaceAll('{version}', _version) + .replaceAll('{version_pure}', _version.split('-')[0]) + .replaceAll('{arch}', _architecture) + .replaceAll('{owner}', _owner) + .replaceAll('{repo}', _repo) + .replaceAll('{release_name}', _releaseName) + .replaceAll('{suffix}', _suffix) + .replaceAll('{platform}', _platform); + } } diff --git a/nyalcf_core/lib/utils/frpc/arch.dart b/nyalcf_core/lib/utils/frpc/arch.dart new file mode 100644 index 00000000..0695aed9 --- /dev/null +++ b/nyalcf_core/lib/utils/frpc/arch.dart @@ -0,0 +1,22 @@ +class Arch { + static List> windows = [ + {'arch': 'amd64', 'name': 'x86_64/amd64'}, + {'arch': '386', 'name': 'x86/i386/amd32'}, + {'arch': 'arm64', 'name': 'arm64/armv8'}, + ]; + static List> linux = [ + {'arch': 'amd64', 'name': 'x86_64/amd64'}, + {'arch': '386', 'name': 'x86/i386/amd32'}, + {'arch': 'arm64', 'name': 'arm64/armv8'}, + {'arch': 'arm', 'name': 'arm/armv7/armv6/armv5'}, + {'arch': 'mips64', 'name': 'mips64'}, + {'arch': 'mips', 'name': 'mips'}, + {'arch': 'mips64le', 'name': 'mips64le'}, + {'arch': 'mipsle', 'name': 'mipsle'}, + {'arch': 'riscv64', 'name': 'riscv64'}, + ]; + static List> macos = [ + {'arch': 'amd64', 'name': 'x86_64/amd64'}, + {'arch': 'arm64', 'name': 'arm64/armv8'}, + ]; +} \ No newline at end of file diff --git a/nyalcf_gui/nyalcf_core_extend/pubspec.lock b/nyalcf_gui/nyalcf_core_extend/pubspec.lock index cdef9486..2f1d5c33 100644 --- a/nyalcf_gui/nyalcf_core_extend/pubspec.lock +++ b/nyalcf_gui/nyalcf_core_extend/pubspec.lock @@ -133,26 +133,26 @@ packages: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" dio: dependency: "direct main" description: name: dio - sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714 + sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0" url: "https://pub.dev" source: hosted - version: "5.5.0+1" + version: "5.6.0" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac" + sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" equatable: dependency: transitive description: @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" file: dependency: transitive description: @@ -226,10 +226,10 @@ packages: dependency: transitive description: name: flutter_markdown - sha256: "2e8a801b1ded5ea001a4529c97b1f213dcb11c6b20668e081cafb23468593514" + sha256: a23c41ee57573e62fc2190a1f36a0480c4d90bde3a8a8d7126e5d5992fb53fb7 url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.3+1" flutter_test: dependency: "direct dev" description: flutter @@ -300,18 +300,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -364,10 +364,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" menu_base: dependency: transitive description: @@ -380,10 +380,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mocktail: dependency: transitive description: @@ -398,36 +398,36 @@ packages: path: "../../nyalcf_core" relative: true source: path - version: "1.0.3" + version: "1.0.5" nyalcf_inject: dependency: "direct main" description: path: "../../nyalcf_inject" relative: true source: path - version: "0.1.3" + version: "0.1.5" nyalcf_inject_extend: dependency: "direct main" description: path: "../nyalcf_inject_extend" relative: true source: path - version: "1.0.3" + version: "1.0.5" nyalcf_ui: dependency: "direct main" description: path: "../nyalcf_ui" relative: true source: path - version: "1.0.3" + version: "1.0.5" open_filex: dependency: transitive description: name: open_filex - sha256: "74e2280754cf8161e860746c3181db2c996d6c1909c7057b738ede4a469816b8" + sha256: ba425ea49affd0a98a234aa9344b9ea5d4c4f7625a1377961eae9fe194c3d523 url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.5.0" package_info_plus: dependency: "direct main" description: @@ -440,10 +440,10 @@ packages: dependency: transitive description: name: package_info_plus_platform_interface - sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e + sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" path: dependency: transitive description: @@ -456,18 +456,18 @@ packages: dependency: "direct main" description: name: path_provider - sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "30c5aa827a6ae95ce2853cdc5fe3971daaac00f6f081c419c013f7f57bff2f5e" + sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" url: "https://pub.dev" source: hosted - version: "2.2.7" + version: "2.2.10" path_provider_foundation: dependency: transitive description: @@ -544,58 +544,58 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 + sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "93d0ec9dd902d85f326068e6a899487d1f65ffcd5798721a95330b26c8131577" + sha256: a7e8467e9181cef109f601e3f65765685786c1a738a83d7fbbde377589c0d974 url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.1" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7" + sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.5.2" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "034650b71e73629ca08a0bd789fd1d83cc63c2d1e405946f7cef7bc37432f93a" + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a" + sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" shortid: dependency: transitive description: @@ -653,10 +653,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" tray_manager: dependency: transitive description: @@ -693,10 +693,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac" + sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 url: "https://pub.dev" source: hosted - version: "6.3.5" + version: "6.3.9" url_launcher_ios: dependency: transitive description: @@ -709,10 +709,10 @@ packages: dependency: transitive description: name: url_launcher_linux - sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.2.0" url_launcher_macos: dependency: transitive description: @@ -733,18 +733,18 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" vector_math: dependency: transitive description: @@ -757,10 +757,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: @@ -773,18 +773,18 @@ packages: dependency: transitive description: name: win32 - sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" url: "https://pub.dev" source: hosted - version: "5.5.1" + version: "5.5.4" win32_registry: dependency: transitive description: name: win32_registry - sha256: "10589e0d7f4e053f2c61023a31c9ce01146656a70b7b7f0828c0b46d7da2a9bb" + sha256: "723b7f851e5724c55409bb3d5a32b203b3afe8587eaf5dafb93a5fed8ecda0d6" url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "1.1.4" window_manager: dependency: transitive description: diff --git a/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart b/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart index c3e31494..e5b071e8 100644 --- a/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart +++ b/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart @@ -9,6 +9,7 @@ import 'package:nyalcf_core/utils/cpu_arch.dart'; import 'package:nyalcf_core/utils/frpc/archive.dart'; import 'package:nyalcf_core/utils/frpc/path_provider.dart'; import 'package:nyalcf_core/utils/logger.dart'; +import 'package:nyalcf_core/utils/frpc/arch.dart'; import 'package:nyalcf_ui/models/frpc_download_dialog.dart'; import 'package:nyalcf_ui/models/frpc_download_tip.dart'; @@ -155,47 +156,30 @@ class FrpcSettingController extends GetxController { /// 构建Arch列表 List> _buildArchDMIWidgetList() { - dynamic arch = >{}; + List> arch = []; final List> dmil = >[]; /// Platform = Windows if (Platform.isWindows) { platform = 'windows'; Logger.info('Build windows platform arch list'); - arch.addAll([ - {'arch': 'amd64', 'name': 'x86_64/amd64'}, - {'arch': '386', 'name': 'x86/i386/amd32'}, - {'arch': 'arm64', 'name': 'arm64/armv8'}, - ]); + arch.addAll(Arch.windows); } /// Platform = Linux if (Platform.isLinux) { platform = 'linux'; Logger.info('Build linux platform arch list'); - arch.addAll([ - {'arch': 'amd64', 'name': 'x86_64/amd64'}, - {'arch': '386', 'name': 'x86/i386/amd32'}, - {'arch': 'arm64', 'name': 'arm64/armv8'}, - {'arch': 'arm', 'name': 'arm/armv7/armv6/armv5'}, - {'arch': 'mips64', 'name': 'mips64'}, - {'arch': 'mips', 'name': 'mips'}, - {'arch': 'mips64le', 'name': 'mips64le'}, - {'arch': 'mipsle', 'name': 'mipsle'}, - {'arch': 'riscv64', 'name': 'riscv64'}, - ]); + arch.addAll(Arch.linux); } /// Platform = MacOS if (Platform.isMacOS) { platform = 'darwin'; Logger.info('Build macos platform arch list'); - arch.addAll([ - {'arch': 'amd64', 'name': 'x86_64/amd64'}, - {'arch': 'arm64', 'name': 'arm64/armv8'}, - ]); + arch.addAll(Arch.macos); } - this.arch = arch.toList(); + this.arch = arch; /// 遍历构建 for (var i = 0; i <= this.arch.length - 1; i++) { diff --git a/nyalcf_gui/nyalcf_ui/lib/controllers/user_controller.dart b/nyalcf_gui/nyalcf_ui/lib/controllers/user_controller.dart index 912ba916..3fd1e1db 100644 --- a/nyalcf_gui/nyalcf_ui/lib/controllers/user_controller.dart +++ b/nyalcf_gui/nyalcf_ui/lib/controllers/user_controller.dart @@ -27,7 +27,8 @@ class UserController extends GetxController { var frpToken = ''.obs; /// 总流量 - Rx traffic = 0.obs; + num traffic = 0; + var trafficRx = '0'.obs; /// 欢迎文字 var welcomeText = '好'.obs; @@ -43,17 +44,50 @@ class UserController extends GetxController { inbound.value = userinfo.inbound; outbound.value = userinfo.outbound; frpToken.value = userinfo.frpToken; - traffic.value = userinfo.traffic; + traffic = userinfo.traffic; + trafficRx.value = (traffic / 1024).toString(); + welcomeText.value = _welcomeMessage; + } + + String get _welcomeMessage { int hour = DateTime.now().hour; /// 根据小时确定欢迎文字 - if (hour <= 8) { - welcomeText.value = '凌晨好'; - } else if (hour <= 12) { - welcomeText.value = '上午好'; - } else { - welcomeText.value = '下午好'; + switch (hour) { + case 4: + case 5: + return '清晨好'; + case 6: + case 7: + case 8: + case 9: + return '早上好'; + case 10: + case 11: + case 12: + return '中午好'; + case 13: + case 14: + case 15: + return '下午好'; + case 16: + case 17: + case 18: + return '傍晚好'; + case 19: + case 20: + case 21: + case 22: + case 23: + return '晚上好'; + case 0: + case 1: + case 2: + case 3: + return '凌晨好'; + default: + return '你好不好嘛'; } } } diff --git a/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart b/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart index 893e1b60..212ff9cd 100644 --- a/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart +++ b/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart @@ -44,6 +44,7 @@ class FrpcDownloadDialogX { arch: _dsCtr.arch[_dsCtr.frpcDownloadArch.value]['arch'], platform: _dsCtr.platform, version: '0.51.3-3', + releaseName: 'LoCyanFrp-0.51.3-3 #2024050701', progressCallback: _dsCtr.downloadFrpcCallback, cancelToken: _dsCtr.downloadCancelToken, useMirror: _fcs.getSettingsGitHubMirror(), diff --git a/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart b/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart index fd0e62ef..403751e0 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart @@ -84,7 +84,7 @@ class PanelHome extends StatelessWidget { Obx(() => Text( '限制速率:${_uCtr.inbound / 1024 * 8}Mbps/${_uCtr.outbound / 1024 * 8}Mbps')), Obx(() => - Text('剩余流量:${_uCtr.traffic / 1024}GiB')) + Text('剩余流量:${_uCtr.trafficRx} GiB')) ], ), ), diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart index 1712f002..e6bda436 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart @@ -50,16 +50,24 @@ class FrpcSetting { ), ], ), - /*/// TODO: 镜像选择 - /// 纵向 - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( + Row( children: [ - /// 横向Container#1 + const Expanded( + child: ListTile( + leading: Icon(Icons.auto_awesome), + title: Text('启用下载镜像源'), + ), + ), + Switch( + value: _dsCtr.frpcDownloadUseMirror.value, + onChanged: (value) async { + _fcs.setSettingsGitHubMirror(value); + _dsCtr.frpcDownloadUseMirror.value = value; + }, + ), ], ), - ),*/ + /// TODO: 镜像选择 ], ), ), diff --git a/nyalcf_gui/pubspec.lock b/nyalcf_gui/pubspec.lock index d090b194..ae5fc884 100644 --- a/nyalcf_gui/pubspec.lock +++ b/nyalcf_gui/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: "direct main" description: name: app_links - sha256: ae5f9a1b7d40d26178f605414be81ed4260350b4fae8259fe5ca4f89fe70c4af + sha256: "4acba851087b25136e8f6e32a53bd4536eb3bec69947ddb66e7b9a5792ceb0c7" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "6.2.0" app_links_linux: dependency: transitive description: @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: app_links_web - sha256: "74586ed5f3c4786341e82a0fa43c39ec3f13108a550f74e80d8bf68aa11349d1" + sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555 url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" archive: dependency: transitive description: @@ -165,26 +165,26 @@ packages: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" dio: dependency: transitive description: name: dio - sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714 + sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0" url: "https://pub.dev" source: hosted - version: "5.5.0+1" + version: "5.6.0" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac" + sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" equatable: dependency: transitive description: @@ -205,10 +205,10 @@ packages: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" file: dependency: transitive description: @@ -258,10 +258,10 @@ packages: dependency: transitive description: name: flutter_markdown - sha256: "2e8a801b1ded5ea001a4529c97b1f213dcb11c6b20668e081cafb23468593514" + sha256: a23c41ee57573e62fc2190a1f36a0480c4d90bde3a8a8d7126e5d5992fb53fb7 url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.3+1" flutter_test: dependency: "direct dev" description: flutter @@ -340,18 +340,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -404,10 +404,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" menu_base: dependency: transitive description: @@ -420,10 +420,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mocktail: dependency: transitive description: @@ -438,43 +438,43 @@ packages: path: "../nyalcf_core" relative: true source: path - version: "1.0.4" + version: "1.0.5" nyalcf_core_extend: dependency: "direct main" description: path: nyalcf_core_extend relative: true source: path - version: "1.0.4" + version: "1.0.5" nyalcf_inject: dependency: "direct main" description: path: "../nyalcf_inject" relative: true source: path - version: "0.1.3" + version: "0.1.5" nyalcf_inject_extend: dependency: transitive description: path: nyalcf_inject_extend relative: true source: path - version: "1.0.4" + version: "1.0.5" nyalcf_ui: dependency: "direct main" description: path: nyalcf_ui relative: true source: path - version: "1.0.4" + version: "1.0.5" open_filex: dependency: transitive description: name: open_filex - sha256: "74e2280754cf8161e860746c3181db2c996d6c1909c7057b738ede4a469816b8" + sha256: ba425ea49affd0a98a234aa9344b9ea5d4c4f7625a1377961eae9fe194c3d523 url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.5.0" package_info_plus: dependency: transitive description: @@ -487,10 +487,10 @@ packages: dependency: transitive description: name: package_info_plus_platform_interface - sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e + sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" path: dependency: transitive description: @@ -503,18 +503,18 @@ packages: dependency: transitive description: name: path_provider - sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "30c5aa827a6ae95ce2853cdc5fe3971daaac00f6f081c419c013f7f57bff2f5e" + sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" url: "https://pub.dev" source: hosted - version: "2.2.7" + version: "2.2.10" path_provider_foundation: dependency: transitive description: @@ -591,58 +591,58 @@ packages: dependency: transitive description: name: shared_preferences - sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 + sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "93d0ec9dd902d85f326068e6a899487d1f65ffcd5798721a95330b26c8131577" + sha256: a7e8467e9181cef109f601e3f65765685786c1a738a83d7fbbde377589c0d974 url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.1" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7" + sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.5.2" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "034650b71e73629ca08a0bd789fd1d83cc63c2d1e405946f7cef7bc37432f93a" + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a" + sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" shortid: dependency: transitive description: @@ -700,10 +700,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" tray_manager: dependency: "direct main" description: @@ -740,10 +740,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac" + sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 url: "https://pub.dev" source: hosted - version: "6.3.5" + version: "6.3.9" url_launcher_ios: dependency: transitive description: @@ -756,10 +756,10 @@ packages: dependency: transitive description: name: url_launcher_linux - sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.2.0" url_launcher_macos: dependency: transitive description: @@ -780,18 +780,18 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" vector_math: dependency: transitive description: @@ -804,10 +804,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: @@ -820,18 +820,18 @@ packages: dependency: transitive description: name: win32 - sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" url: "https://pub.dev" source: hosted - version: "5.5.1" + version: "5.5.4" win32_registry: dependency: transitive description: name: win32_registry - sha256: "10589e0d7f4e053f2c61023a31c9ce01146656a70b7b7f0828c0b46d7da2a9bb" + sha256: "723b7f851e5724c55409bb3d5a32b203b3afe8587eaf5dafb93a5fed8ecda0d6" url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "1.1.4" window_manager: dependency: "direct main" description: From a56b1d8b53eed946fc3ce025b6ea4c9a647a3e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 17 Aug 2024 20:18:23 +0800 Subject: [PATCH 02/15] Upgrade to Flutter 3.24.0 --- .github/workflows/build-gui.yml | 6 +++--- .github/workflows/pr-check.yml | 6 +++--- .github/workflows/publish.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 83eab137..e30059a3 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -23,7 +23,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Install Dependencies @@ -70,7 +70,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Install Dependencies @@ -113,7 +113,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Setup Node.js diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index c1723e47..9225923f 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -21,7 +21,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Install Dependencies @@ -59,7 +59,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Install Dependencies @@ -96,7 +96,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Install Dependencies diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8de1c04d..e9ce8000 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Install Dependencies @@ -80,7 +80,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Install Dependencies @@ -136,7 +136,7 @@ jobs: uses: flutter-actions/setup-flutter@v3 with: channel: 'stable' - version: 3.22.3 + version: 3.24.0 cache-sdk: true - name: Setup Node.js From d1403a9464bb372140b8774ebe62525f2e312ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 17 Aug 2024 20:47:03 +0800 Subject: [PATCH 03/15] push --- .../lib/controllers/frpc_setting_controller.dart | 3 +-- .../lib/views/setting/frpc_setting.dart | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart b/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart index e5b071e8..b660a702 100644 --- a/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart +++ b/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart @@ -33,11 +33,10 @@ class FrpcSettingController extends GetxController { var frpcDownloadShow = [].obs; dynamic frpcDownloadCancel = false; var frpcDownloadUseMirror = false.obs; + var frpcDownloadMirror = ''.obs; var frpcVersion = ''.obs; - var githubProxy = ''.obs; - var cpuArch = ''.obs; load() async { diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart index e6bda436..a467b998 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart @@ -55,16 +55,16 @@ class FrpcSetting { const Expanded( child: ListTile( leading: Icon(Icons.auto_awesome), - title: Text('启用下载镜像源'), + title: Text('选择镜像源'), ), ), - Switch( - value: _dsCtr.frpcDownloadUseMirror.value, - onChanged: (value) async { - _fcs.setSettingsGitHubMirror(value); - _dsCtr.frpcDownloadUseMirror.value = value; - }, - ), + // Switch( + // value: _dsCtr.frpcDownloadUseMirror.value, + // onChanged: (value) async { + // _fcs.setSettingsGitHubMirror(value); + // _dsCtr.frpcDownloadUseMirror.value = value; + // }, + // ), ], ), /// TODO: 镜像选择 From ab4f37f76a101aa40ccbbd0cb67b14fc68aa10da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 17 Aug 2024 21:25:07 +0800 Subject: [PATCH 04/15] Upgrade dependencies --- nyalcf_cli/pubspec.lock | 105 +++++++++++++++++++++++---------------- nyalcf_core/pubspec.yaml | 2 +- 2 files changed, 64 insertions(+), 43 deletions(-) diff --git a/nyalcf_cli/pubspec.lock b/nyalcf_cli/pubspec.lock index 602d7d72..7405fbca 100644 --- a/nyalcf_cli/pubspec.lock +++ b/nyalcf_cli/pubspec.lock @@ -5,18 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77" url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "73.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a" url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.8.0" archive: dependency: transitive description: @@ -53,10 +58,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" convert: dependency: transitive description: @@ -69,42 +74,42 @@ packages: dependency: transitive description: name: coverage - sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e" + sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.0" crypto: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" dio: dependency: transitive description: name: dio - sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714 + sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0" url: "https://pub.dev" source: hosted - version: "5.5.0+1" + version: "5.6.0" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac" + sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" ffi: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" file: dependency: transitive description: @@ -141,10 +146,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.0" io: dependency: transitive description: @@ -185,6 +190,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" matcher: dependency: transitive description: @@ -197,10 +210,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -223,14 +236,14 @@ packages: path: "../nyalcf_core" relative: true source: path - version: "1.0.3" + version: "1.0.5" nyalcf_inject: dependency: "direct main" description: path: "../nyalcf_inject" relative: true source: path - version: "0.1.3" + version: "0.1.5" package_config: dependency: transitive description: @@ -267,10 +280,10 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_packages_handler: dependency: transitive description: @@ -291,10 +304,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.0" source_map_stack_trace: dependency: transitive description: @@ -355,26 +368,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" url: "https://pub.dev" source: hosted - version: "1.25.2" + version: "1.25.8" test_api: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.3" test_core: dependency: transitive description: name: test_core - sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.5" typed_data: dependency: transitive description: @@ -387,10 +400,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.2.5" watcher: dependency: transitive description: @@ -403,18 +416,26 @@ packages: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.1.6" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "3.0.1" webkit_inspection_protocol: dependency: transitive description: @@ -427,18 +448,18 @@ packages: dependency: transitive description: name: win32 - sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" url: "https://pub.dev" source: hosted - version: "5.5.1" + version: "5.5.4" win32_registry: dependency: transitive description: name: win32_registry - sha256: "10589e0d7f4e053f2c61023a31c9ce01146656a70b7b7f0828c0b46d7da2a9bb" + sha256: "723b7f851e5724c55409bb3d5a32b203b3afe8587eaf5dafb93a5fed8ecda0d6" url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "1.1.4" yaml: dependency: transitive description: diff --git a/nyalcf_core/pubspec.yaml b/nyalcf_core/pubspec.yaml index a5618584..ad325138 100644 --- a/nyalcf_core/pubspec.yaml +++ b/nyalcf_core/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: nyalcf_inject: path: ../nyalcf_inject dio: ^5.4.1 - archive: ^3.4.9 + archive: ^3.6.1 logger: ^2.1.0 crypto: ^3.0.3 win32_registry: ^1.1.3 From 60263572403d056bf5551f6c3ccca1b330051933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 17 Aug 2024 21:52:03 +0800 Subject: [PATCH 05/15] Upgrade dependencies --- tools/flutter_distributor | 1 - 1 file changed, 1 deletion(-) delete mode 160000 tools/flutter_distributor diff --git a/tools/flutter_distributor b/tools/flutter_distributor deleted file mode 160000 index 4e3f2fe0..00000000 --- a/tools/flutter_distributor +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4e3f2fe0d152866732b20a2a29e2250b88401980 From ed077595e055956e9ba9752b7bea254dd0d0eed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 17 Aug 2024 21:53:03 +0800 Subject: [PATCH 06/15] Upgrade dependencies --- tools/flutter_distributor | 1 + 1 file changed, 1 insertion(+) create mode 160000 tools/flutter_distributor diff --git a/tools/flutter_distributor b/tools/flutter_distributor new file mode 160000 index 00000000..f0bbae33 --- /dev/null +++ b/tools/flutter_distributor @@ -0,0 +1 @@ +Subproject commit f0bbae334b063bd76a92abfe013f0abbc3984f62 From 86350a717e02ee4a7c2dff09834dff8031cff2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 17 Aug 2024 21:58:30 +0800 Subject: [PATCH 07/15] [ci skip] Update README --- README.md | 5 +---- nyalcf_cli/README.md | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0f40d0e9..5ccc4a75 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,7 @@ The next generation of LoCyanFrp launcher. - [x] GUI 版本 - [GUI Features Design](./nyalcf_gui/README.md#设计功能) - [ ] CLI 版本 - - [x] 登录 - - [x] 隧道启动 - [ ] 进程管理 - - [ ] 用户信息展示 - [CLI Features Design](./nyalcf_cli/README.md#设计功能) - CI/CD - GUI 版本 @@ -43,7 +40,7 @@ The next generation of LoCyanFrp launcher. - [x] 自动发布 - CLI 版本 - [x] 自动构建 - - [ ] 自动发布 + - [x] 自动发布 - [x] Pull Request 自动检查 - [x] 开源协议/许可证兼容性检查 - [x] 代码质量检查 diff --git a/nyalcf_cli/README.md b/nyalcf_cli/README.md index 999cd59a..6550fd49 100644 --- a/nyalcf_cli/README.md +++ b/nyalcf_cli/README.md @@ -7,7 +7,9 @@ - [x] 登录 - [x] 隧道启动 - [ ] 进程管理 -- [ ] Frpc 下载 +- [x] Frpc 下载 +- [x] 隧道启动 +- [x] 用户信息展示 ## 运行测试 From ab8e7eeb3009fd338c36e2ed14aceb2a23a96ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Mon, 19 Aug 2024 21:51:44 +0800 Subject: [PATCH 08/15] Update version number, and add WIP option. --- RELEASE_CHANGELOG.md | 12 ++++++++++-- nyalcf_core/pubspec.yaml | 2 +- nyalcf_gui/nyalcf_core_extend/pubspec.yaml | 2 +- nyalcf_gui/nyalcf_inject_extend/pubspec.yaml | 2 +- .../nyalcf_ui/lib/views/setting/frpc_setting.dart | 4 +++- .../lib/views/setting/launcher_setting.dart | 2 +- nyalcf_gui/nyalcf_ui/pubspec.yaml | 2 +- nyalcf_gui/pubspec.yaml | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/RELEASE_CHANGELOG.md b/RELEASE_CHANGELOG.md index e4f12d1e..3760e470 100644 --- a/RELEASE_CHANGELOG.md +++ b/RELEASE_CHANGELOG.md @@ -7,7 +7,9 @@ ### GUI - 更新 Flutter -- 添加 LCM Frpc 下载镜像 +- 修改了欢迎语判定 + +[//]: # (- 添加 LCM Frpc 下载镜像) ### CLI @@ -15,7 +17,13 @@ ### 其他 -- 重写了一些 Frpc 下载核心逻辑 +- 重写了下载 Frpc 核心逻辑 + +## 版本信息 + +- nyalcf_gui: 0.2.1 +- nyalcf_cli: 0.0.1 +- nyalcf_core,nyalcf_inject: 0.1.6 -/- diff --git a/nyalcf_core/pubspec.yaml b/nyalcf_core/pubspec.yaml index ad325138..7774b692 100644 --- a/nyalcf_core/pubspec.yaml +++ b/nyalcf_core/pubspec.yaml @@ -1,6 +1,6 @@ name: nyalcf_core description: 'Nya LoCyanFrp! core module.' -version: 1.0.5 +version: 1.0.6 homepage: https://nyalcf.1l1.icu publish_to: none # repository: https://github.com/my_org/my_repo diff --git a/nyalcf_gui/nyalcf_core_extend/pubspec.yaml b/nyalcf_gui/nyalcf_core_extend/pubspec.yaml index ee6c7d1e..72993825 100644 --- a/nyalcf_gui/nyalcf_core_extend/pubspec.yaml +++ b/nyalcf_gui/nyalcf_core_extend/pubspec.yaml @@ -1,6 +1,6 @@ name: nyalcf_core_extend description: "Nya LoCyanFrp! core extend module." -version: 1.0.5 +version: 1.0.6 homepage: https://nyalcf.1l1.icu publish_to: none diff --git a/nyalcf_gui/nyalcf_inject_extend/pubspec.yaml b/nyalcf_gui/nyalcf_inject_extend/pubspec.yaml index 13c7c186..8b1b1d1b 100644 --- a/nyalcf_gui/nyalcf_inject_extend/pubspec.yaml +++ b/nyalcf_gui/nyalcf_inject_extend/pubspec.yaml @@ -1,6 +1,6 @@ name: nyalcf_inject_extend description: "Nya LoCyanFrp! communication injector extend module." -version: 1.0.5 +version: 1.0.6 homepage: https://nyalcf.1l1.icu publish_to: none diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart index a467b998..edf53c51 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart @@ -29,6 +29,7 @@ class FrpcSetting { Container( margin: const EdgeInsets.only( left: 20.0, right: 20.0, bottom: 20.0), + padding: const EdgeInsets.only(left: 30.0, right: 50.0), child: Obx( () => Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -54,10 +55,11 @@ class FrpcSetting { children: [ const Expanded( child: ListTile( - leading: Icon(Icons.auto_awesome), + leading: Icon(Icons.pie_chart), title: Text('选择镜像源'), ), ), + Text('🔧WIP'), // Switch( // value: _dsCtr.frpcDownloadUseMirror.value, // onChanged: (value) async { diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart index 200a5741..f41cb67a 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart @@ -382,7 +382,7 @@ class LauncherSetting { SelectableText('内部软件包名:${Universe.appPackageName}'), SelectableText( '软件版本:${Universe.appVersion} (+${Universe.appBuildNumber})'), - const SelectableText('著作权信息:登记中'), + const SelectableText('Copyright 2023 © 夏沫花火zzz🌙,以及感谢社区贡献者的无私奉献。'), ], ), ), diff --git a/nyalcf_gui/nyalcf_ui/pubspec.yaml b/nyalcf_gui/nyalcf_ui/pubspec.yaml index 72f2586a..7f92559a 100644 --- a/nyalcf_gui/nyalcf_ui/pubspec.yaml +++ b/nyalcf_gui/nyalcf_ui/pubspec.yaml @@ -1,6 +1,6 @@ name: nyalcf_ui description: "Nya LoCyanFrp! user interface module." -version: 1.0.5 +version: 1.0.6 homepage: https://nyalcf.1l1.icu publish_to: none diff --git a/nyalcf_gui/pubspec.yaml b/nyalcf_gui/pubspec.yaml index b2f06de0..c13be121 100644 --- a/nyalcf_gui/pubspec.yaml +++ b/nyalcf_gui/pubspec.yaml @@ -1,6 +1,6 @@ name: nyalcf description: "[GUI]The next generation of LoCyanFrp launcher." -version: 0.2.0+2 +version: 0.2.1 homepage: https://nyalcf.1l1.icu publish_to: 'none' From d36750de7570c6f2890354ab4e3b7c81b43f9f0c Mon Sep 17 00:00:00 2001 From: YanMo Date: Mon, 19 Aug 2024 23:03:39 +0800 Subject: [PATCH 09/15] =?UTF-8?q?feat(frpc=5Fsetting.dart):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=A4=9A=E4=B8=AA=E4=B8=8B=E8=BD=BD=E6=BA=90=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 实在不会写了(摊手) --- nyalcf_cli/pubspec.lock | 105 ++++------ nyalcf_core/lib/utils/deep_link_register.dart | 2 +- nyalcf_gui/nyalcf_core_extend/pubspec.lock | 192 +++++++++--------- .../lib/views/setting/frpc_setting.dart | 39 ++-- nyalcf_gui/pubspec.lock | 8 +- 5 files changed, 170 insertions(+), 176 deletions(-) diff --git a/nyalcf_cli/pubspec.lock b/nyalcf_cli/pubspec.lock index 7405fbca..602d7d72 100644 --- a/nyalcf_cli/pubspec.lock +++ b/nyalcf_cli/pubspec.lock @@ -5,23 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77" + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" url: "https://pub.dev" source: hosted - version: "73.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.2" + version: "67.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a" + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" url: "https://pub.dev" source: hosted - version: "6.8.0" + version: "6.4.1" archive: dependency: transitive description: @@ -58,10 +53,10 @@ packages: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.18.0" convert: dependency: transitive description: @@ -74,42 +69,42 @@ packages: dependency: transitive description: name: coverage - sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db" + sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.0" crypto: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.3" dio: dependency: transitive description: name: dio - sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0" + sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714 url: "https://pub.dev" source: hosted - version: "5.6.0" + version: "5.5.0+1" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" + sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "1.0.1" ffi: dependency: transitive description: name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.2" file: dependency: transitive description: @@ -146,10 +141,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.0.2" io: dependency: transitive description: @@ -190,14 +185,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" - macros: - dependency: transitive - description: - name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" - url: "https://pub.dev" - source: hosted - version: "0.1.2-main.4" matcher: dependency: transitive description: @@ -210,10 +197,10 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.12.0" mime: dependency: transitive description: @@ -236,14 +223,14 @@ packages: path: "../nyalcf_core" relative: true source: path - version: "1.0.5" + version: "1.0.3" nyalcf_inject: dependency: "direct main" description: path: "../nyalcf_inject" relative: true source: path - version: "0.1.5" + version: "0.1.3" package_config: dependency: transitive description: @@ -280,10 +267,10 @@ packages: dependency: transitive description: name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.2" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: @@ -304,10 +291,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "1.0.4" source_map_stack_trace: dependency: transitive description: @@ -368,26 +355,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" + sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" url: "https://pub.dev" source: hosted - version: "1.25.8" + version: "1.25.2" test_api: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.0" test_core: dependency: transitive description: name: test_core - sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" + sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.0" typed_data: dependency: transitive description: @@ -400,10 +387,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.2.4" watcher: dependency: transitive description: @@ -416,26 +403,18 @@ packages: dependency: transitive description: name: web - sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 - url: "https://pub.dev" - source: hosted - version: "1.0.0" - web_socket: - dependency: transitive - description: - name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "0.5.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" + sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "2.4.5" webkit_inspection_protocol: dependency: transitive description: @@ -448,18 +427,18 @@ packages: dependency: transitive description: name: win32 - sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 url: "https://pub.dev" source: hosted - version: "5.5.4" + version: "5.5.1" win32_registry: dependency: transitive description: name: win32_registry - sha256: "723b7f851e5724c55409bb3d5a32b203b3afe8587eaf5dafb93a5fed8ecda0d6" + sha256: "10589e0d7f4e053f2c61023a31c9ce01146656a70b7b7f0828c0b46d7da2a9bb" url: "https://pub.dev" source: hosted - version: "1.1.4" + version: "1.1.3" yaml: dependency: transitive description: diff --git a/nyalcf_core/lib/utils/deep_link_register.dart b/nyalcf_core/lib/utils/deep_link_register.dart index aab7be8a..4d18ef12 100644 --- a/nyalcf_core/lib/utils/deep_link_register.dart +++ b/nyalcf_core/lib/utils/deep_link_register.dart @@ -23,4 +23,4 @@ class DeepLinkRegister { regKey.createValue(protocolRegValue); regKey.createKey(protocolCmdRegKey).createValue(protocolCmdRegValue); } -} \ No newline at end of file +} diff --git a/nyalcf_gui/nyalcf_core_extend/pubspec.lock b/nyalcf_gui/nyalcf_core_extend/pubspec.lock index 2f1d5c33..e2fb46e8 100644 --- a/nyalcf_gui/nyalcf_core_extend/pubspec.lock +++ b/nyalcf_gui/nyalcf_core_extend/pubspec.lock @@ -6,7 +6,7 @@ packages: description: name: archive sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.6.1" args: @@ -14,7 +14,7 @@ packages: description: name: args sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.5.0" async: @@ -22,7 +22,7 @@ packages: description: name: async sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.11.0" autotrie: @@ -30,7 +30,7 @@ packages: description: name: autotrie sha256: "55da6faefb53cfcb0abb2f2ca8636123fb40e35286bb57440d2cf467568188f8" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.0" bitsdojo_window: @@ -38,7 +38,7 @@ packages: description: name: bitsdojo_window sha256: "88ef7765dafe52d97d7a3684960fb5d003e3151e662c18645c1641c22b873195" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.6" bitsdojo_window_linux: @@ -46,7 +46,7 @@ packages: description: name: bitsdojo_window_linux sha256: "9519c0614f98be733e0b1b7cb15b827007886f6fe36a4fb62cf3d35b9dd578ab" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.4" bitsdojo_window_macos: @@ -54,7 +54,7 @@ packages: description: name: bitsdojo_window_macos sha256: f7c5be82e74568c68c5b8449e2c5d8fd12ec195ecd70745a7b9c0f802bb0268f - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.4" bitsdojo_window_platform_interface: @@ -62,7 +62,7 @@ packages: description: name: bitsdojo_window_platform_interface sha256: "65daa015a0c6dba749bdd35a0f092e7a8ba8b0766aa0480eb3ef808086f6e27c" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.2" bitsdojo_window_windows: @@ -70,7 +70,7 @@ packages: description: name: bitsdojo_window_windows sha256: fa982cf61ede53f483e50b257344a1c250af231a3cdc93a7064dd6dc0d720b68 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.6" boolean_selector: @@ -78,7 +78,7 @@ packages: description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.1" characters: @@ -86,7 +86,7 @@ packages: description: name: characters sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.3.0" charcode: @@ -94,7 +94,7 @@ packages: description: name: charcode sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.3.1" checked_yaml: @@ -102,7 +102,7 @@ packages: description: name: checked_yaml sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.3" cli_util: @@ -110,7 +110,7 @@ packages: description: name: cli_util sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.4.1" clock: @@ -118,7 +118,7 @@ packages: description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.1.1" collection: @@ -126,7 +126,7 @@ packages: description: name: collection sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.18.0" crypto: @@ -134,7 +134,7 @@ packages: description: name: crypto sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.5" dio: @@ -142,7 +142,7 @@ packages: description: name: dio sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "5.6.0" dio_web_adapter: @@ -150,7 +150,7 @@ packages: description: name: dio_web_adapter sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.0" equatable: @@ -158,7 +158,7 @@ packages: description: name: equatable sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.5" fake_async: @@ -166,7 +166,7 @@ packages: description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.3.1" ffi: @@ -174,7 +174,7 @@ packages: description: name: ffi sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.3" file: @@ -182,7 +182,7 @@ packages: description: name: file sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "7.0.0" flutter: @@ -195,7 +195,7 @@ packages: description: name: flutter_code_editor sha256: "505ad56dcc8a7be4b782c8113574571bc4b9723499b0c1f385b3e2c3fae11f5d" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.3.2" flutter_highlight: @@ -203,7 +203,7 @@ packages: description: name: flutter_highlight sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.7.0" flutter_launcher_icons: @@ -211,7 +211,7 @@ packages: description: name: flutter_launcher_icons sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.13.1" flutter_lints: @@ -219,7 +219,7 @@ packages: description: name: flutter_lints sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.2" flutter_markdown: @@ -227,7 +227,7 @@ packages: description: name: flutter_markdown sha256: a23c41ee57573e62fc2190a1f36a0480c4d90bde3a8a8d7126e5d5992fb53fb7 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.7.3+1" flutter_test: @@ -245,7 +245,7 @@ packages: description: name: get sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "4.6.6" highlight: @@ -253,7 +253,7 @@ packages: description: name: highlight sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.7.0" hive: @@ -261,7 +261,7 @@ packages: description: name: hive sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.2.3" http: @@ -269,7 +269,7 @@ packages: description: name: http sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.2.2" http_parser: @@ -277,7 +277,7 @@ packages: description: name: http_parser sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "4.0.2" image: @@ -285,7 +285,7 @@ packages: description: name: image sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "4.2.0" json_annotation: @@ -293,7 +293,7 @@ packages: description: name: json_annotation sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "4.9.0" leak_tracker: @@ -301,7 +301,7 @@ packages: description: name: leak_tracker sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "10.0.5" leak_tracker_flutter_testing: @@ -309,7 +309,7 @@ packages: description: name: leak_tracker_flutter_testing sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.5" leak_tracker_testing: @@ -317,7 +317,7 @@ packages: description: name: leak_tracker_testing sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.1" linked_scroll_controller: @@ -325,7 +325,7 @@ packages: description: name: linked_scroll_controller sha256: e6020062bcf4ffc907ee7fd090fa971e65d8dfaac3c62baf601a3ced0b37986a - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.2.0" lints: @@ -333,7 +333,7 @@ packages: description: name: lints sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.0" logger: @@ -341,7 +341,7 @@ packages: description: name: logger sha256: "697d067c60c20999686a0add96cf6aba723b3aa1f83ecf806a8097231529ec32" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.0" markdown: @@ -349,7 +349,7 @@ packages: description: name: markdown sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "7.2.2" matcher: @@ -357,7 +357,7 @@ packages: description: name: matcher sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.12.16+1" material_color_utilities: @@ -365,7 +365,7 @@ packages: description: name: material_color_utilities sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.11.1" menu_base: @@ -373,7 +373,7 @@ packages: description: name: menu_base sha256: "820368014a171bd1241030278e6c2617354f492f5c703d7b7d4570a6b8b84405" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.1" meta: @@ -381,7 +381,7 @@ packages: description: name: meta sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.15.0" mocktail: @@ -389,7 +389,7 @@ packages: description: name: mocktail sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.0.4" nyalcf_core: @@ -425,7 +425,7 @@ packages: description: name: open_filex sha256: ba425ea49affd0a98a234aa9344b9ea5d4c4f7625a1377961eae9fe194c3d523 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "4.5.0" package_info_plus: @@ -433,7 +433,7 @@ packages: description: name: package_info_plus sha256: "2c582551839386fa7ddbc7770658be7c0f87f388a4bff72066478f597c34d17f" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "7.0.0" package_info_plus_platform_interface: @@ -441,7 +441,7 @@ packages: description: name: package_info_plus_platform_interface sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.1" path: @@ -449,7 +449,7 @@ packages: description: name: path sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.9.0" path_provider: @@ -457,7 +457,7 @@ packages: description: name: path_provider sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.4" path_provider_android: @@ -465,7 +465,7 @@ packages: description: name: path_provider_android sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.2.10" path_provider_foundation: @@ -473,7 +473,7 @@ packages: description: name: path_provider_foundation sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.0" path_provider_linux: @@ -481,7 +481,7 @@ packages: description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -489,7 +489,7 @@ packages: description: name: path_provider_platform_interface sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.2" path_provider_windows: @@ -497,7 +497,7 @@ packages: description: name: path_provider_windows sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.3.0" petitparser: @@ -505,7 +505,7 @@ packages: description: name: petitparser sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.0.2" platform: @@ -513,7 +513,7 @@ packages: description: name: platform sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.1.5" plugin_platform_interface: @@ -521,7 +521,7 @@ packages: description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.8" screen_retriever: @@ -529,7 +529,7 @@ packages: description: name: screen_retriever sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.9" scrollable_positioned_list: @@ -537,7 +537,7 @@ packages: description: name: scrollable_positioned_list sha256: "1b54d5f1329a1e263269abc9e2543d90806131aa14fe7c6062a8054d57249287" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.3.8" shared_preferences: @@ -545,7 +545,7 @@ packages: description: name: shared_preferences sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.3.2" shared_preferences_android: @@ -553,7 +553,7 @@ packages: description: name: shared_preferences_android sha256: a7e8467e9181cef109f601e3f65765685786c1a738a83d7fbbde377589c0d974 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.3.1" shared_preferences_foundation: @@ -561,7 +561,7 @@ packages: description: name: shared_preferences_foundation sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.5.2" shared_preferences_linux: @@ -569,7 +569,7 @@ packages: description: name: shared_preferences_linux sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.1" shared_preferences_platform_interface: @@ -577,7 +577,7 @@ packages: description: name: shared_preferences_platform_interface sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.1" shared_preferences_web: @@ -585,7 +585,7 @@ packages: description: name: shared_preferences_web sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.2" shared_preferences_windows: @@ -593,7 +593,7 @@ packages: description: name: shared_preferences_windows sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.1" shortid: @@ -601,7 +601,7 @@ packages: description: name: shortid sha256: d0b40e3dbb50497dad107e19c54ca7de0d1a274eb9b4404991e443dadb9ebedb - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.2" sky_engine: @@ -614,7 +614,7 @@ packages: description: name: source_span sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.10.0" stack_trace: @@ -622,7 +622,7 @@ packages: description: name: stack_trace sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.11.1" stream_channel: @@ -630,7 +630,7 @@ packages: description: name: stream_channel sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.2" string_scanner: @@ -638,7 +638,7 @@ packages: description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.2.0" term_glyph: @@ -646,7 +646,7 @@ packages: description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.2.1" test_api: @@ -654,7 +654,7 @@ packages: description: name: test_api sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.7.2" tray_manager: @@ -662,7 +662,7 @@ packages: description: name: tray_manager sha256: c9a63fd88bd3546287a7eb8ccc978d707eef82c775397af17dda3a4f4c039e64 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.2.3" tuple: @@ -670,7 +670,7 @@ packages: description: name: tuple sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.2" typed_data: @@ -678,7 +678,7 @@ packages: description: name: typed_data sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.3.2" url_launcher: @@ -686,7 +686,7 @@ packages: description: name: url_launcher sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.3.0" url_launcher_android: @@ -694,7 +694,7 @@ packages: description: name: url_launcher_android sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.3.9" url_launcher_ios: @@ -702,7 +702,7 @@ packages: description: name: url_launcher_ios sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.3.1" url_launcher_linux: @@ -710,7 +710,7 @@ packages: description: name: url_launcher_linux sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.2.0" url_launcher_macos: @@ -718,7 +718,7 @@ packages: description: name: url_launcher_macos sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.2.0" url_launcher_platform_interface: @@ -726,7 +726,7 @@ packages: description: name: url_launcher_platform_interface sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.3.2" url_launcher_web: @@ -734,7 +734,7 @@ packages: description: name: url_launcher_web sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.3.3" url_launcher_windows: @@ -742,7 +742,7 @@ packages: description: name: url_launcher_windows sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.1.2" vector_math: @@ -750,7 +750,7 @@ packages: description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.4" vm_service: @@ -758,7 +758,7 @@ packages: description: name: vm_service sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "14.2.4" web: @@ -766,7 +766,7 @@ packages: description: name: web sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.5.1" win32: @@ -774,7 +774,7 @@ packages: description: name: win32 sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "5.5.4" win32_registry: @@ -782,7 +782,7 @@ packages: description: name: win32_registry sha256: "723b7f851e5724c55409bb3d5a32b203b3afe8587eaf5dafb93a5fed8ecda0d6" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.1.4" window_manager: @@ -790,7 +790,7 @@ packages: description: name: window_manager sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.3.9" xdg_directories: @@ -798,7 +798,7 @@ packages: description: name: xdg_directories sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.0.4" xml: @@ -806,7 +806,7 @@ packages: description: name: xml sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.5.0" yaml: @@ -814,7 +814,7 @@ packages: description: name: yaml sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.1.2" sdks: diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart index edf53c51..4242b059 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart @@ -3,6 +3,7 @@ import 'package:get/get.dart'; import 'package:nyalcf_ui/controllers/frpc_setting_controller.dart'; import 'package:nyalcf_core/storages/configurations/frpc_configuration_storage.dart'; +import 'package:nyalcf_core/network/dio/basic_config.dart'; class FrpcSetting { FrpcSetting({required this.context}); @@ -11,6 +12,10 @@ class FrpcSetting { final _fcs = FrpcConfigurationStorage(); final FrpcSettingController _dsCtr = Get.find(); + final List mirrorOptions = ['GitHub代理', 'LoCyan Mirror']; + final RxString selectedMirror = 'GitHub代理'.obs; + + @override Widget widget() { _dsCtr.context = context; return Container( @@ -31,7 +36,7 @@ class FrpcSetting { left: 20.0, right: 20.0, bottom: 20.0), padding: const EdgeInsets.only(left: 30.0, right: 50.0), child: Obx( - () => Column( + () => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( @@ -59,21 +64,31 @@ class FrpcSetting { title: Text('选择镜像源'), ), ), - Text('🔧WIP'), - // Switch( - // value: _dsCtr.frpcDownloadUseMirror.value, - // onChanged: (value) async { - // _fcs.setSettingsGitHubMirror(value); - // _dsCtr.frpcDownloadUseMirror.value = value; - // }, - // ), + Obx( + () => DropdownButton( + value: selectedMirror.value, + onChanged: (String? newValue) { + if (newValue != null) { + selectedMirror.value = newValue; + /// TODO: 下载选择 + } + }, + items: mirrorOptions + .map>( + (String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), ], ), - /// TODO: 镜像选择 ], ), ), - ) + ), ], ), ), @@ -81,4 +96,4 @@ class FrpcSetting { ), ); } -} +} \ No newline at end of file diff --git a/nyalcf_gui/pubspec.lock b/nyalcf_gui/pubspec.lock index ae5fc884..03e87c99 100644 --- a/nyalcf_gui/pubspec.lock +++ b/nyalcf_gui/pubspec.lock @@ -438,14 +438,14 @@ packages: path: "../nyalcf_core" relative: true source: path - version: "1.0.5" + version: "1.0.6" nyalcf_core_extend: dependency: "direct main" description: path: nyalcf_core_extend relative: true source: path - version: "1.0.5" + version: "1.0.6" nyalcf_inject: dependency: "direct main" description: @@ -459,14 +459,14 @@ packages: path: nyalcf_inject_extend relative: true source: path - version: "1.0.5" + version: "1.0.6" nyalcf_ui: dependency: "direct main" description: path: nyalcf_ui relative: true source: path - version: "1.0.5" + version: "1.0.6" open_filex: dependency: transitive description: From 72247d1a458a5cdec990e51657ea1c8af7d616eb Mon Sep 17 00:00:00 2001 From: YanMo Date: Tue, 20 Aug 2024 00:59:09 +0800 Subject: [PATCH 10/15] feat(frpc_setting.dart): GitHub proxy Add --- .../lib/views/setting/frpc_setting.dart | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart index 4242b059..f97edf25 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart @@ -3,7 +3,6 @@ import 'package:get/get.dart'; import 'package:nyalcf_ui/controllers/frpc_setting_controller.dart'; import 'package:nyalcf_core/storages/configurations/frpc_configuration_storage.dart'; -import 'package:nyalcf_core/network/dio/basic_config.dart'; class FrpcSetting { FrpcSetting({required this.context}); @@ -36,7 +35,7 @@ class FrpcSetting { left: 20.0, right: 20.0, bottom: 20.0), padding: const EdgeInsets.only(left: 30.0, right: 50.0), child: Obx( - () => Column( + () => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( @@ -65,22 +64,31 @@ class FrpcSetting { ), ), Obx( - () => DropdownButton( + () => DropdownButton( value: selectedMirror.value, onChanged: (String? newValue) { if (newValue != null) { selectedMirror.value = newValue; - /// TODO: 下载选择 + if (mirrorOptions == 'GitHub代理') { + onChanged: + (value) async { + _fcs.setSettingsGitHubMirror(value); + _dsCtr.frpcDownloadUseMirror.value = + value; + }; + }else { + /// TODO: LoCyanMirror下载选择 + } } }, items: mirrorOptions .map>( (String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), ), ), ], @@ -96,4 +104,4 @@ class FrpcSetting { ), ); } -} \ No newline at end of file +} From c0e40795d38cdd7242cba28af739d57d2f33df04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Tue, 20 Aug 2024 03:00:11 +0800 Subject: [PATCH 11/15] Frpc download mirror selector, request API to cancel token now when logout --- README.md | 2 +- install-dependecy.sh => install-dependency.sh | 0 nyalcf_cli/bin/nyalcf_cli.dart | 5 +- nyalcf_cli/lib/commands/config.dart | 1 - nyalcf_cli/lib/commands/download.dart | 6 +- nyalcf_cli/lib/commands/login.dart | 7 +- nyalcf_cli/lib/commands/logout.dart | 14 ++ nyalcf_cli/lib/commands/start.dart | 4 +- .../lib/templates/command_implement.dart | 2 +- nyalcf_cli/lib/utils/path_provider.dart | 5 +- nyalcf_cli/pubspec.lock | 4 +- nyalcf_core/lib/models/process_model.dart | 2 +- nyalcf_core/lib/models/user_info_model.dart | 4 +- nyalcf_core/lib/network/dio/auth/auth.dart | 1 + .../lib/network/dio/auth/login_auth.dart | 4 +- .../lib/network/dio/auth/logout_auth.dart | 54 +++++ .../lib/network/dio/auth/register_auth.dart | 4 +- .../lib/network/dio/auth/user_auth.dart | 4 +- nyalcf_core/lib/network/dio/basic_config.dart | 8 +- .../lib/network/dio/frpc/download_frpc.dart | 68 +++--- .../lib/network/dio/frpc/version_frpc.dart | 4 +- .../network/dio/launcher/update_launcher.dart | 4 +- .../network/dio/other/announcement_other.dart | 4 +- .../lib/network/dio/other/sign_other.dart | 4 +- .../dio/proxies/configuration_proxies.dart | 4 +- .../lib/network/dio/proxies/get_proxies.dart | 4 +- .../network/dio/proxies/status_proxies.dart | 5 +- .../frpc_configuration_storage.dart | 47 ++++- .../storages/stores/user_info_storage.dart | 11 +- nyalcf_core/lib/utils/frpc/arch.dart | 2 +- nyalcf_core/test/get_frpc_version_test.dart | 2 +- nyalcf_core/test/logout.dart | 3 + nyalcf_gui/lib/main.dart | 3 +- .../lib/tasks/auto_sign.dart | 2 +- .../nyalcf_core_extend/lib/tasks/updater.dart | 2 +- .../lib/utils/deep_link_executor.dart | 3 +- .../lib/utils/proxies_getter.dart | 2 +- nyalcf_gui/nyalcf_core_extend/pubspec.lock | 198 +++++++++--------- .../controllers/frpc_setting_controller.dart | 7 +- .../lib/controllers/panel_controller.dart | 2 +- .../lib/controllers/proxies_controller.dart | 6 +- .../nyalcf_ui/lib/models/account_dialog.dart | 62 ++++-- .../lib/models/frpc_download_dialog.dart | 7 +- .../nyalcf_ui/lib/views/auth/login.dart | 4 +- .../nyalcf_ui/lib/views/auth/register.dart | 4 +- nyalcf_gui/nyalcf_ui/lib/views/home.dart | 2 +- .../nyalcf_ui/lib/views/panel/home.dart | 8 +- .../lib/views/setting/frpc_setting.dart | 44 ++-- .../lib/views/setting/launcher_setting.dart | 5 +- .../nyalcf_ui/lib/views/tokenmode/panel.dart | 2 +- 50 files changed, 402 insertions(+), 254 deletions(-) rename install-dependecy.sh => install-dependency.sh (100%) create mode 100644 nyalcf_cli/lib/commands/logout.dart create mode 100644 nyalcf_core/lib/network/dio/auth/logout_auth.dart create mode 100644 nyalcf_core/test/logout.dart diff --git a/README.md b/README.md index 5ccc4a75..9a21dec9 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ The next generation of LoCyanFrp launcher. #### 安装依赖 ```shell -bash install-dependecy.sh +bash install-dependency.sh ``` ### 感谢我们的开发者!是他们使NyaLCF变的更好! diff --git a/install-dependecy.sh b/install-dependency.sh similarity index 100% rename from install-dependecy.sh rename to install-dependency.sh diff --git a/nyalcf_cli/bin/nyalcf_cli.dart b/nyalcf_cli/bin/nyalcf_cli.dart index 977e4e8a..4ab912b9 100644 --- a/nyalcf_cli/bin/nyalcf_cli.dart +++ b/nyalcf_cli/bin/nyalcf_cli.dart @@ -5,12 +5,12 @@ import 'package:nyalcf/commands/config.dart'; import 'package:nyalcf/commands/download.dart'; import 'package:nyalcf/commands/login.dart'; import 'package:nyalcf/arguments.dart'; +import 'package:nyalcf/commands/logout.dart'; import 'package:nyalcf/commands/start.dart'; import 'package:nyalcf/utils/path_provider.dart'; import 'package:nyalcf/utils/state.dart'; import 'package:nyalcf_core/storages/configurations/launcher_configuration_storage.dart'; import 'package:nyalcf_core/storages/injector.dart'; -import 'package:nyalcf_core/storages/stores/user_info_storage.dart'; import 'package:nyalcf_core/utils/logger.dart'; import 'package:nyalcf_inject/nyalcf_inject.dart'; @@ -57,8 +57,7 @@ void main(List arguments) async { await Login().main(results.rest); } if (results.wasParsed('logout')) { - await UserInfoStorage.sigo(); - Logger.info('Session data removed.'); + await Logout().main(results.rest); } // 启动 Frpc diff --git a/nyalcf_cli/lib/commands/config.dart b/nyalcf_cli/lib/commands/config.dart index fa9b09ae..9c53df9d 100644 --- a/nyalcf_cli/lib/commands/config.dart +++ b/nyalcf_cli/lib/commands/config.dart @@ -48,5 +48,4 @@ class Config implements CommandImplement { return null; } } - } diff --git a/nyalcf_cli/lib/commands/download.dart b/nyalcf_cli/lib/commands/download.dart index 4e349e26..8f572a4f 100644 --- a/nyalcf_cli/lib/commands/download.dart +++ b/nyalcf_cli/lib/commands/download.dart @@ -2,7 +2,6 @@ import 'dart:io'; import 'package:dio/dio.dart'; -import 'package:nyalcf/utils/state.dart'; import 'package:nyalcf/templates/command_implement.dart'; import 'package:nyalcf_core/network/dio/frpc/download_frpc.dart'; import 'package:nyalcf_core/utils/cpu_arch.dart'; @@ -57,7 +56,7 @@ class Download implements CommandImplement { _cancelToken = CancelToken(); Logger.info('Starting frpc download...'); - await DownloadFrpc().download( + await DownloadFrpc.download( arch: _selectedArch, platform: platform, version: '0.51.3-3', @@ -67,7 +66,8 @@ class Download implements CommandImplement { useMirror: false, ); stdout.write('\rPlease wait, extracting frpc...\n'); - await FrpcArchive.unarchive(platform: platform, arch: _selectedArch, version: '0.51.3-3'); + await FrpcArchive.unarchive( + platform: platform, arch: _selectedArch, version: '0.51.3-3'); } else { Logger.error( 'Unsupported system! If you believe this is wrong, please provide arch manually in command.'); diff --git a/nyalcf_cli/lib/commands/login.dart b/nyalcf_cli/lib/commands/login.dart index 7ea5ea28..4fca5f50 100644 --- a/nyalcf_cli/lib/commands/login.dart +++ b/nyalcf_cli/lib/commands/login.dart @@ -6,11 +6,10 @@ import 'package:nyalcf_core/storages/stores/user_info_storage.dart'; import 'package:nyalcf_core/utils/logger.dart'; class Login implements CommandImplement { - @override Future main(List args) async { if (args.length == 2) { - final res = await LoginAuth().requestLogin(args[0], args[1]); + final res = await LoginAuth.requestLogin(args[0], args[1]); if (res.status) { final UserInfoModel userInfo = res.data['user_info']; Logger.info('Login successfully.'); @@ -19,7 +18,8 @@ class Login implements CommandImplement { Logger.info('- email: ${userInfo.email}'); Logger.info('- login token: ${TextEncrypt.obscure(userInfo.token)}'); Logger.info('- frp token: ${TextEncrypt.obscure(userInfo.frpToken)}'); - Logger.info('- speed limit: ${userInfo.inbound / 1024 * 8}Mbps/${userInfo.outbound / 1024 * 8}Mbps'); + Logger.info( + '- speed limit: ${userInfo.inbound / 1024 * 8}Mbps/${userInfo.outbound / 1024 * 8}Mbps'); Logger.info('- traffic left: ${userInfo.traffic / 1024}GiB'); await UserInfoStorage.save(userInfo); Logger.info('Session saved.'); @@ -28,5 +28,4 @@ class Login implements CommandImplement { Logger.error('No valid arguments provided.'); } } - } diff --git a/nyalcf_cli/lib/commands/logout.dart b/nyalcf_cli/lib/commands/logout.dart new file mode 100644 index 00000000..4168fd18 --- /dev/null +++ b/nyalcf_cli/lib/commands/logout.dart @@ -0,0 +1,14 @@ +import 'package:nyalcf/templates/command_implement.dart'; +import 'package:nyalcf_core/storages/stores/user_info_storage.dart'; +import 'package:nyalcf_core/utils/logger.dart'; + +class Logout implements CommandImplement { + @override + Future main(List args) async { + final userInfo = await UserInfoStorage.read(); + await UserInfoStorage.sigo(userInfo?.user, userInfo?.token); + + Logger.info('Session data removed.'); + } + +} \ No newline at end of file diff --git a/nyalcf_cli/lib/commands/start.dart b/nyalcf_cli/lib/commands/start.dart index 23ccf033..2ad0dd49 100644 --- a/nyalcf_cli/lib/commands/start.dart +++ b/nyalcf_cli/lib/commands/start.dart @@ -17,7 +17,7 @@ class Start implements CommandImplement { final runPath = await FrpcStorage().getRunPath(); if (frpcPath != null) { - final process =await ProcessManager.newProcess( + final process = await ProcessManager.newProcess( frpcPath: frpcPath, runPath: runPath, frpToken: user.frpToken, @@ -39,7 +39,7 @@ class Start implements CommandImplement { if (n == 2) { for (var process in ProcessManager.processList) { - process.process.kill(); + process.process.kill(); } exit(0); } diff --git a/nyalcf_cli/lib/templates/command_implement.dart b/nyalcf_cli/lib/templates/command_implement.dart index e696a4e1..cead12ff 100644 --- a/nyalcf_cli/lib/templates/command_implement.dart +++ b/nyalcf_cli/lib/templates/command_implement.dart @@ -1,4 +1,4 @@ abstract class CommandImplement { /// 入口函数 void main(List args); -} \ No newline at end of file +} diff --git a/nyalcf_cli/lib/utils/path_provider.dart b/nyalcf_cli/lib/utils/path_provider.dart index 0909b751..fda41df8 100644 --- a/nyalcf_cli/lib/utils/path_provider.dart +++ b/nyalcf_cli/lib/utils/path_provider.dart @@ -3,7 +3,8 @@ import 'dart:io'; import 'package:nyalcf_inject/nyalcf_inject.dart'; class PathProvider { - static final basicPath = '${Directory(Platform.resolvedExecutable).parent.path}/.nyalcf'; + static final basicPath = + '${Directory(Platform.resolvedExecutable).parent.path}/.nyalcf'; static Future loadPath() async { final cachePath = '$basicPath/cache'; @@ -20,4 +21,4 @@ class PathProvider { setAppCachePath(cachePath); setAppSupportPath(supportPath); } -} \ No newline at end of file +} diff --git a/nyalcf_cli/pubspec.lock b/nyalcf_cli/pubspec.lock index 602d7d72..56abd5f1 100644 --- a/nyalcf_cli/pubspec.lock +++ b/nyalcf_cli/pubspec.lock @@ -223,14 +223,14 @@ packages: path: "../nyalcf_core" relative: true source: path - version: "1.0.3" + version: "1.0.6" nyalcf_inject: dependency: "direct main" description: path: "../nyalcf_inject" relative: true source: path - version: "0.1.3" + version: "0.1.5" package_config: dependency: transitive description: diff --git a/nyalcf_core/lib/models/process_model.dart b/nyalcf_core/lib/models/process_model.dart index 3fb50585..535fcfaa 100644 --- a/nyalcf_core/lib/models/process_model.dart +++ b/nyalcf_core/lib/models/process_model.dart @@ -12,4 +12,4 @@ class ProcessModel { String toString() { return '[$proxyId] PID: ${process.pid}'; } -} \ No newline at end of file +} diff --git a/nyalcf_core/lib/models/user_info_model.dart b/nyalcf_core/lib/models/user_info_model.dart index ec84b8dc..c3f05911 100644 --- a/nyalcf_core/lib/models/user_info_model.dart +++ b/nyalcf_core/lib/models/user_info_model.dart @@ -27,7 +27,7 @@ class UserInfoModel { inbound = json['inbound'], outbound = json['outbound'], frpToken = json['frp_token'], - traffic = json['traffic']; + traffic = num.parse(json['traffic']); Map toJson() => { 'username': user, @@ -37,6 +37,6 @@ class UserInfoModel { 'inbound': inbound, 'outbound': outbound, 'frp_token': frpToken, - 'traffic': traffic + 'traffic': traffic.toString() }; } diff --git a/nyalcf_core/lib/network/dio/auth/auth.dart b/nyalcf_core/lib/network/dio/auth/auth.dart index a3f25caa..bcb3c1d7 100644 --- a/nyalcf_core/lib/network/dio/auth/auth.dart +++ b/nyalcf_core/lib/network/dio/auth/auth.dart @@ -1,5 +1,6 @@ library auth; export 'login_auth.dart'; +export 'logout_auth.dart'; export 'register_auth.dart'; export 'user_auth.dart'; diff --git a/nyalcf_core/lib/network/dio/auth/login_auth.dart b/nyalcf_core/lib/network/dio/auth/login_auth.dart index 846ca5d8..9c3ebdb3 100644 --- a/nyalcf_core/lib/network/dio/auth/login_auth.dart +++ b/nyalcf_core/lib/network/dio/auth/login_auth.dart @@ -6,9 +6,9 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class LoginAuth { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); - Future requestLogin(user, password) async { + static Future requestLogin(user, password) async { dio.FormData data = dio.FormData.fromMap({'username': user, 'password': password}); try { diff --git a/nyalcf_core/lib/network/dio/auth/logout_auth.dart b/nyalcf_core/lib/network/dio/auth/logout_auth.dart new file mode 100644 index 00000000..6d8dc163 --- /dev/null +++ b/nyalcf_core/lib/network/dio/auth/logout_auth.dart @@ -0,0 +1,54 @@ +import 'package:dio/dio.dart' as dio; + +import 'package:nyalcf_core/network/dio/basic_config.dart'; +import 'package:nyalcf_core/network/response_type.dart'; +import 'package:nyalcf_core/utils/logger.dart'; + +class LogoutAuth { + static final instance = dio.Dio(options); + + static Future requestLogout(user, token) async { + Map paramsMap = {}; + paramsMap['username'] = user; + + Map optionsMap = {}; + optionsMap['Content-Type'] = + 'application/x-www-form-urlencoded;charset=UTF-8'; + optionsMap['Authorization'] = 'Bearer $token'; + options = options.copyWith(headers: optionsMap); + + try { + Logger.debug('Logout: $user / $token'); + final response = await instance.delete('$apiV2Url/users/reset/token/single', queryParameters: paramsMap); + Map responseJson = response.data; + Logger.debug(responseJson); + final resData = responseJson['data']; + if (responseJson['status'] == 200) { + return Response( + status: true, + message: 'OK', + data: { + 'origin_response': resData, + }, + ); + } else { + return Response( + status: false, + message: resData['msg'] ?? responseJson['status'], + data: { + 'origin_response': resData, + }, + ); + } + } catch (ex, st) { + Logger.error(ex, t: st); + return Response( + status: false, + message: ex.toString(), + data: { + 'error': ex, + }, + ); + } + } +} \ No newline at end of file diff --git a/nyalcf_core/lib/network/dio/auth/register_auth.dart b/nyalcf_core/lib/network/dio/auth/register_auth.dart index 7581a348..8ea25778 100644 --- a/nyalcf_core/lib/network/dio/auth/register_auth.dart +++ b/nyalcf_core/lib/network/dio/auth/register_auth.dart @@ -5,9 +5,9 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class RegisterAuth { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); - Future requestRegister( + static Future requestRegister( user, password, confirmPassword, email, verify, qq) async { dio.FormData data = dio.FormData.fromMap({ 'username': user, diff --git a/nyalcf_core/lib/network/dio/auth/user_auth.dart b/nyalcf_core/lib/network/dio/auth/user_auth.dart index 721025cd..3b258c68 100644 --- a/nyalcf_core/lib/network/dio/auth/user_auth.dart +++ b/nyalcf_core/lib/network/dio/auth/user_auth.dart @@ -5,9 +5,9 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class UserAuth { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); - Future checkToken(token) async { + static Future checkToken(token) async { try { Logger.info('Check token if is valid'); Map paramsMap = {}; diff --git a/nyalcf_core/lib/network/dio/basic_config.dart b/nyalcf_core/lib/network/dio/basic_config.dart index 684e44f3..0c2fdd0a 100644 --- a/nyalcf_core/lib/network/dio/basic_config.dart +++ b/nyalcf_core/lib/network/dio/basic_config.dart @@ -14,7 +14,7 @@ const apiV2Url = 'https://api-v2.locyanfrp.cn/api/v2'; const frpcConfigUrl = 'https://lcf-frps-api.locyanfrp.cn/api'; const githubApiUrl = 'https://api-gh.1l1.icu'; const githubMainUrl = 'https://github.com'; -const githubMirrorsUrl = 'https://proxy-gh.1l1.icu/https://github.com'; -const locyanMirrorsFrpcFormat = 'https://mirrors.locyan.cn/github-releases/' + - '{owner}/{repo}/{release_name}/frp_LoCyanFrp-{version_pure}_{platform}' + - '_{architecture}.{suffix}'; +// const githubMirrorsUrl = 'https://proxy-gh.1l1.icu/https://github.com'; +// const locyanMirrorsFrpcFormat = 'https://mirrors.locyan.cn/github-releases/' + +// '{owner}/{repo}/{release_name}/frp_LoCyanFrp-{version_pure}_{platform}' + +// '_{architecture}.{suffix}'; diff --git a/nyalcf_core/lib/network/dio/frpc/download_frpc.dart b/nyalcf_core/lib/network/dio/frpc/download_frpc.dart index 984e9ba6..8c8de882 100644 --- a/nyalcf_core/lib/network/dio/frpc/download_frpc.dart +++ b/nyalcf_core/lib/network/dio/frpc/download_frpc.dart @@ -1,25 +1,28 @@ import 'dart:io'; import 'package:dio/dio.dart'; +import 'package:nyalcf_core/storages/configurations/frpc_configuration_storage.dart'; import 'package:nyalcf_core/utils/logger.dart'; import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_inject/nyalcf_inject.dart'; class DownloadFrpc { - final dio = Dio(options); - final _cachePath = appCachePath; + static final dio = Dio(options); + static final _cachePath = appCachePath; - late final _version; - late final _platform; - late final _architecture; - late final _owner; - late final _repo; - late final _releaseName; - late final _suffix; + static late final _version; + static late final _platform; + static late final _architecture; + static late final _owner; + static late final _repo; + static late final _releaseName; + static late final _suffix; + + static final _fcs = FrpcConfigurationStorage(); /// 下载Frpc - Future download({ + static Future download({ required String arch, required String platform, required String version, @@ -27,7 +30,7 @@ class DownloadFrpc { required ProgressCallback progressCallback, required CancelToken cancelToken, required bool useMirror, - String? mirrorFormat = null, + String? mirrorId = null, // version 版本 | owner 仓库所有者 | release_name 发行版本名称 | repo 仓库名 | arch 架构 | suffix 后缀名 | platform 平台 }) async { Logger.info('Start download: $platform | $version | $arch'); @@ -45,7 +48,7 @@ class DownloadFrpc { // final String downloadBasicUrl; final envUrl = Platform.environment['NYA_LCF_FRPC_DOWNLOAD_MIRROR_URL']; - final downloadUrl; + String downloadUrl = ''; // '$downloadBasicUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download/v$version/frp_LoCyanFrp-${version.toString().split('-')[0]}_${platform}_$arch.$suffix'; // if (useMirror) { @@ -64,11 +67,21 @@ class DownloadFrpc { if (envUrl != null) { downloadUrl = _replacePlaceholder(envUrl); } else if (useMirror) { - downloadUrl = mirrorFormat != null - ? _replacePlaceholder(mirrorFormat) - : '$githubMirrorsUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download' + - '/v$_version/frp_LoCyanFrp-${_version.split('-')[0]}_' + - '${_platform}_$_architecture.$_suffix'; + if (mirrorId == null) + throw UnimplementedError( + 'No mirrors format input! Please check your arguments.'); + + final mirrorList = _fcs.getDownloadMirrors(); + for (var mirror in mirrorList) { + if (mirror['id'] == mirrorId) + downloadUrl = _replacePlaceholder(mirror['format']); + } + if (downloadUrl.isEmpty) + throw UnimplementedError( + 'No valid mirror found. Please check your input.'); + // : '$githubMirrorsUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download' + + // '/v$_version/frp_LoCyanFrp-${_version.split('-')[0]}_' + + // '${_platform}_$_architecture.$_suffix'; } else { downloadUrl = '$githubMainUrl/LoCyan-Team/LoCyanFrpPureApp/releases/download' + @@ -76,6 +89,8 @@ class DownloadFrpc { '${_platform}_$_architecture.$_suffix'; } + Logger.debug('Downloading file: $downloadUrl'); + return await dio.download( downloadUrl, '$_cachePath/frpc.$_suffix', @@ -93,15 +108,16 @@ class DownloadFrpc { } } - _replacePlaceholder(String str) { + static _replacePlaceholder(String str) { return str - .replaceAll('{version}', _version) - .replaceAll('{version_pure}', _version.split('-')[0]) - .replaceAll('{arch}', _architecture) - .replaceAll('{owner}', _owner) - .replaceAll('{repo}', _repo) - .replaceAll('{release_name}', _releaseName) - .replaceAll('{suffix}', _suffix) - .replaceAll('{platform}', _platform); + .replaceAll('{version}', Uri.encodeComponent(_version)) + .replaceAll( + '{version_pure}', Uri.encodeComponent(_version.split('-')[0])) + .replaceAll('{arch}', Uri.encodeComponent(_architecture)) + .replaceAll('{owner}', Uri.encodeComponent(_owner)) + .replaceAll('{repo}', Uri.encodeComponent(_repo)) + .replaceAll('{release_name}', Uri.encodeComponent(_releaseName)) + .replaceAll('{suffix}', Uri.encodeComponent(_suffix)) + .replaceAll('{platform}', Uri.encodeComponent(_platform)); } } diff --git a/nyalcf_core/lib/network/dio/frpc/version_frpc.dart b/nyalcf_core/lib/network/dio/frpc/version_frpc.dart index d61ec476..3e723893 100644 --- a/nyalcf_core/lib/network/dio/frpc/version_frpc.dart +++ b/nyalcf_core/lib/network/dio/frpc/version_frpc.dart @@ -5,9 +5,9 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class VersionFrpc { - final instance = dio.Dio(); + static final instance = dio.Dio(); - Future getLatestVersion() async { + static Future getLatestVersion() async { try { final resData = await instance.get( '$githubApiUrl/repos/LoCyan-Team/LoCyanFrpPureApp/releases/latest'); diff --git a/nyalcf_core/lib/network/dio/launcher/update_launcher.dart b/nyalcf_core/lib/network/dio/launcher/update_launcher.dart index 365200e0..c9e439c5 100644 --- a/nyalcf_core/lib/network/dio/launcher/update_launcher.dart +++ b/nyalcf_core/lib/network/dio/launcher/update_launcher.dart @@ -6,9 +6,9 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class UpdateLauncher { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); - Future getUpdate() async { + static Future getUpdate() async { try { final res = await instance .get('$githubApiUrl/repos/Muska-Ami/NyaLCF/releases/latest'); diff --git a/nyalcf_core/lib/network/dio/other/announcement_other.dart b/nyalcf_core/lib/network/dio/other/announcement_other.dart index 1a8fbb2d..986a0e88 100644 --- a/nyalcf_core/lib/network/dio/other/announcement_other.dart +++ b/nyalcf_core/lib/network/dio/other/announcement_other.dart @@ -5,9 +5,9 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class OtherAnnouncement { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); - Future getBroadcast() async { + static Future getBroadcast() async { try { Logger.info('Get broadcast announcement'); final response = await instance.get('$apiV1Url/App/GetBroadCast'); diff --git a/nyalcf_core/lib/network/dio/other/sign_other.dart b/nyalcf_core/lib/network/dio/other/sign_other.dart index 2b24504d..23d9ade3 100644 --- a/nyalcf_core/lib/network/dio/other/sign_other.dart +++ b/nyalcf_core/lib/network/dio/other/sign_other.dart @@ -5,10 +5,10 @@ import 'package:nyalcf_core/network/response_type.dart'; import 'package:nyalcf_core/network/dio/basic_config.dart'; class OtherSign { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); /// 检查签到状态 - Future checkSign(String username, String token) async { + static Future checkSign(String username, String token) async { // Logger.debug(token); try { // dio.FormData data = dio.FormData.fromMap({ diff --git a/nyalcf_core/lib/network/dio/proxies/configuration_proxies.dart b/nyalcf_core/lib/network/dio/proxies/configuration_proxies.dart index 7e638a20..69070f9a 100644 --- a/nyalcf_core/lib/network/dio/proxies/configuration_proxies.dart +++ b/nyalcf_core/lib/network/dio/proxies/configuration_proxies.dart @@ -6,9 +6,9 @@ import 'package:nyalcf_core/utils/logger.dart'; import 'package:nyalcf_core/network/dio/basic_config.dart'; class ProxiesConfiguration { - final dio = Dio(options); + static final dio = Dio(options); - Future get(String frpToken, int proxyId) async { + static Future get(String frpToken, int proxyId) async { try { Map paramsMap = {}; paramsMap['action'] = 'getcfg'; diff --git a/nyalcf_core/lib/network/dio/proxies/get_proxies.dart b/nyalcf_core/lib/network/dio/proxies/get_proxies.dart index 1d3cc9a7..216c8af2 100644 --- a/nyalcf_core/lib/network/dio/proxies/get_proxies.dart +++ b/nyalcf_core/lib/network/dio/proxies/get_proxies.dart @@ -6,9 +6,9 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class ProxiesGet { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); - Future get(username, token) async { + static Future get(username, token) async { try { Map paramsMap = {}; paramsMap['username'] = username; diff --git a/nyalcf_core/lib/network/dio/proxies/status_proxies.dart b/nyalcf_core/lib/network/dio/proxies/status_proxies.dart index f0ec78c1..9c37bbbf 100644 --- a/nyalcf_core/lib/network/dio/proxies/status_proxies.dart +++ b/nyalcf_core/lib/network/dio/proxies/status_proxies.dart @@ -6,9 +6,10 @@ import 'package:nyalcf_core/network/dio/basic_config.dart'; import 'package:nyalcf_core/network/response_type.dart'; class ProxiesStatus { - final instance = dio.Dio(options); + static final instance = dio.Dio(options); - Future getProxyStatus(ProxyInfoModel proxy, String token) async { + static Future getProxyStatus( + ProxyInfoModel proxy, String token) async { Map paramsMap = {}; paramsMap['token'] = token; paramsMap['proxy_name'] = proxy.proxyName; diff --git a/nyalcf_core/lib/storages/configurations/frpc_configuration_storage.dart b/nyalcf_core/lib/storages/configurations/frpc_configuration_storage.dart index 0fbf714c..d9e9447f 100644 --- a/nyalcf_core/lib/storages/configurations/frpc_configuration_storage.dart +++ b/nyalcf_core/lib/storages/configurations/frpc_configuration_storage.dart @@ -13,10 +13,25 @@ class FrpcConfigurationStorage extends JsonConfiguration { Future> get defConfig async => { 'settings': { 'frpc_version': '0.51.3-3', - 'github_mirror': true, + 'frpc_download_mirror': true, + 'frpc_download_mirror_id': 'muska-github-mirror', }, 'lists': { 'frpc_installed_versions': [], + 'frpc_download_mirrors': >[ + { + 'name': 'Muska Network GitHub Object Mirror', + 'id': 'muska-github-mirror', + 'format': + 'https://proxy-gh.1l1.icu/github.com/{owner}/{repo}/releases/download/v{version}/frp_LoCyanFrp-{version_pure}_{platform}_{arch}.{suffix}', + }, + { + 'name': 'LoCyan Mirrors', + 'id': 'locyan-mirror', + 'format': + 'https://mirrors.locyan.cn/github-releases/{owner}/{repo}/{release_name}/frp_LoCyanFrp-{version_pure}_{platform}_{arch}.{suffix}', + }, + ], }, }; @@ -27,10 +42,18 @@ class FrpcConfigurationStorage extends JsonConfiguration { cfg.setString('settings.frpc_version', value); /// 使用镜像源 - bool getSettingsGitHubMirror() => cfg.getBool('settings.github_mirror'); + bool getSettingsFrpcDownloadMirror() => + cfg.getBool('settings.frpc_download_mirror'); - void setSettingsGitHubMirror(bool value) => - cfg.setBool('settings.github_mirror', value); + void setSettingsFrpcDownloadMirror(bool value) => + cfg.setBool('settings.frpc_download_mirror', value); + + /// 镜像源格式 + String getSettingsFrpcDownloadMirrorId() => + cfg.getString('settings.frpc_download_mirror_id'); + + void setSettingsFrpcDownloadMirrorId(String value) => + cfg.setString('settings.frpc_download_mirror_id', value); /// 已安装的 Frpc 版本 List getInstalledVersions() => @@ -41,4 +64,20 @@ class FrpcConfigurationStorage extends JsonConfiguration { list.add(value); cfg.setStringList('lists.frpc_installed_versions', list.toSet().toList()); } + + /// Frpc 下载镜像列表 + List> getDownloadMirrors() { + // 无法 cast,使用 for 转换一下类型 + final list = >[]; + for (var single in cfg.getList('lists.frpc_download_mirrors')) { + list.add(single); + } + return list; + } + + void addDownloadMirror(Map value) { + final List> list = getDownloadMirrors(); + list.add(value); + cfg.setList('lists.frpc_download_mirrors', list.toSet().toList()); + } } diff --git a/nyalcf_core/lib/storages/stores/user_info_storage.dart b/nyalcf_core/lib/storages/stores/user_info_storage.dart index d2b9e819..16bcc201 100644 --- a/nyalcf_core/lib/storages/stores/user_info_storage.dart +++ b/nyalcf_core/lib/storages/stores/user_info_storage.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:nyalcf_core/models/user_info_model.dart'; +import 'package:nyalcf_core/network/dio/auth/auth.dart'; import 'package:nyalcf_inject/nyalcf_inject.dart'; class UserInfoStorage { @@ -25,8 +26,12 @@ class UserInfoStorage { } /// 退出登录 - /// 只是删除session.json - static sigo() async { - await File('$_path/session.json').delete(); + static sigo(user, token) async { + final res = await LogoutAuth.requestLogout(user, token); + if (res.status) { + await File('$_path/session.json').delete(); + return true; + } else + return false; } } diff --git a/nyalcf_core/lib/utils/frpc/arch.dart b/nyalcf_core/lib/utils/frpc/arch.dart index 0695aed9..6739c0c3 100644 --- a/nyalcf_core/lib/utils/frpc/arch.dart +++ b/nyalcf_core/lib/utils/frpc/arch.dart @@ -19,4 +19,4 @@ class Arch { {'arch': 'amd64', 'name': 'x86_64/amd64'}, {'arch': 'arm64', 'name': 'arm64/armv8'}, ]; -} \ No newline at end of file +} diff --git a/nyalcf_core/test/get_frpc_version_test.dart b/nyalcf_core/test/get_frpc_version_test.dart index 7126ee3a..12d2d3c0 100644 --- a/nyalcf_core/test/get_frpc_version_test.dart +++ b/nyalcf_core/test/get_frpc_version_test.dart @@ -1,7 +1,7 @@ import 'package:nyalcf_core/network/dio/frpc/frpc.dart'; void main() async { - final res = await VersionFrpc().getLatestVersion(); + final res = await VersionFrpc.getLatestVersion(); if (res.status) { print(res.data['latest_version']); } else { diff --git a/nyalcf_core/test/logout.dart b/nyalcf_core/test/logout.dart new file mode 100644 index 00000000..d6ca84a5 --- /dev/null +++ b/nyalcf_core/test/logout.dart @@ -0,0 +1,3 @@ +import 'package:nyalcf_core/network/dio/auth/auth.dart'; + +void main() async => print(await LogoutAuth.requestLogout('Muska_Ami', 'bd8f56ea-e2f3-4af4-8250-d958935d9b42')); \ No newline at end of file diff --git a/nyalcf_gui/lib/main.dart b/nyalcf_gui/lib/main.dart index 4b7d5ba8..a0800b3f 100644 --- a/nyalcf_gui/lib/main.dart +++ b/nyalcf_gui/lib/main.dart @@ -37,7 +37,8 @@ void main() async { await windowManager.ensureInitialized(); await Universe.loadUniverse(); - setAppendInfo('v${Universe.appVersion}(+${Universe.appBuildNumber}) an=${Universe.appName}'); + setAppendInfo( + 'v${Universe.appVersion}(+${Universe.appBuildNumber}) an=${Universe.appName}'); /// 初始化配置文件等 await PathProvider.loadSyncPath(); diff --git a/nyalcf_gui/nyalcf_core_extend/lib/tasks/auto_sign.dart b/nyalcf_gui/nyalcf_core_extend/lib/tasks/auto_sign.dart index 96e82f0d..9c145c8e 100644 --- a/nyalcf_gui/nyalcf_core_extend/lib/tasks/auto_sign.dart +++ b/nyalcf_gui/nyalcf_core_extend/lib/tasks/auto_sign.dart @@ -14,7 +14,7 @@ class TaskAutoSign extends TaskBasic { if (userinfo != null) { String user = userinfo.user; String token = userinfo.token; - final checkSignRes = await OtherSign().checkSign(user, token); + final checkSignRes = await OtherSign.checkSign(user, token); if (checkSignRes.status) { if (!checkSignRes.data['signed']) { // 执行签到 diff --git a/nyalcf_gui/nyalcf_core_extend/lib/tasks/updater.dart b/nyalcf_gui/nyalcf_core_extend/lib/tasks/updater.dart index 96fd26d2..de0d54e7 100644 --- a/nyalcf_gui/nyalcf_core_extend/lib/tasks/updater.dart +++ b/nyalcf_gui/nyalcf_core_extend/lib/tasks/updater.dart @@ -24,7 +24,7 @@ class TaskUpdater extends TaskBasic { Logger.info('Checking update...'); // 获取远程源版本 - final remote = await UpdateLauncher().getUpdate(); + final remote = await UpdateLauncher.getUpdate(); if (remote.status) { // 远程源版本获取到的时候才检测 uIf = remote.data['update_info']; diff --git a/nyalcf_gui/nyalcf_core_extend/lib/utils/deep_link_executor.dart b/nyalcf_gui/nyalcf_core_extend/lib/utils/deep_link_executor.dart index 3ad2f8dc..0d60512d 100644 --- a/nyalcf_gui/nyalcf_core_extend/lib/utils/deep_link_executor.dart +++ b/nyalcf_gui/nyalcf_core_extend/lib/utils/deep_link_executor.dart @@ -21,7 +21,8 @@ class DeepLinkExecutor { frpcPath: frpcPath, ); } else { - Logger.error('Could not implement proxy fast startup, no frpc has installed!'); + Logger.error( + 'Could not implement proxy fast startup, no frpc has installed!'); } } } diff --git a/nyalcf_gui/nyalcf_core_extend/lib/utils/proxies_getter.dart b/nyalcf_gui/nyalcf_core_extend/lib/utils/proxies_getter.dart index 0dfca0ef..2cbf75da 100644 --- a/nyalcf_gui/nyalcf_core_extend/lib/utils/proxies_getter.dart +++ b/nyalcf_gui/nyalcf_core_extend/lib/utils/proxies_getter.dart @@ -13,7 +13,7 @@ class ProxiesGetter { loading.value = true; Logger.info('Auto updating proxies list...'); final UserInfoModel user = await UserInfoPrefs.getInfo(); - final result = await ProxiesGet().get(user.user, user.token); + final result = await ProxiesGet.get(user.user, user.token); if (result.status) { ProxiesStorage.clear(); diff --git a/nyalcf_gui/nyalcf_core_extend/pubspec.lock b/nyalcf_gui/nyalcf_core_extend/pubspec.lock index e2fb46e8..2a261146 100644 --- a/nyalcf_gui/nyalcf_core_extend/pubspec.lock +++ b/nyalcf_gui/nyalcf_core_extend/pubspec.lock @@ -6,7 +6,7 @@ packages: description: name: archive sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.6.1" args: @@ -14,7 +14,7 @@ packages: description: name: args sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.5.0" async: @@ -22,7 +22,7 @@ packages: description: name: async sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.11.0" autotrie: @@ -30,7 +30,7 @@ packages: description: name: autotrie sha256: "55da6faefb53cfcb0abb2f2ca8636123fb40e35286bb57440d2cf467568188f8" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.0.0" bitsdojo_window: @@ -38,7 +38,7 @@ packages: description: name: bitsdojo_window sha256: "88ef7765dafe52d97d7a3684960fb5d003e3151e662c18645c1641c22b873195" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.6" bitsdojo_window_linux: @@ -46,7 +46,7 @@ packages: description: name: bitsdojo_window_linux sha256: "9519c0614f98be733e0b1b7cb15b827007886f6fe36a4fb62cf3d35b9dd578ab" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.4" bitsdojo_window_macos: @@ -54,7 +54,7 @@ packages: description: name: bitsdojo_window_macos sha256: f7c5be82e74568c68c5b8449e2c5d8fd12ec195ecd70745a7b9c0f802bb0268f - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.4" bitsdojo_window_platform_interface: @@ -62,7 +62,7 @@ packages: description: name: bitsdojo_window_platform_interface sha256: "65daa015a0c6dba749bdd35a0f092e7a8ba8b0766aa0480eb3ef808086f6e27c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.2" bitsdojo_window_windows: @@ -70,7 +70,7 @@ packages: description: name: bitsdojo_window_windows sha256: fa982cf61ede53f483e50b257344a1c250af231a3cdc93a7064dd6dc0d720b68 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.6" boolean_selector: @@ -78,7 +78,7 @@ packages: description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.1.1" characters: @@ -86,7 +86,7 @@ packages: description: name: characters sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.3.0" charcode: @@ -94,7 +94,7 @@ packages: description: name: charcode sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.3.1" checked_yaml: @@ -102,7 +102,7 @@ packages: description: name: checked_yaml sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.0.3" cli_util: @@ -110,7 +110,7 @@ packages: description: name: cli_util sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.4.1" clock: @@ -118,7 +118,7 @@ packages: description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.1.1" collection: @@ -126,7 +126,7 @@ packages: description: name: collection sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.18.0" crypto: @@ -134,7 +134,7 @@ packages: description: name: crypto sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.0.5" dio: @@ -142,7 +142,7 @@ packages: description: name: dio sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "5.6.0" dio_web_adapter: @@ -150,7 +150,7 @@ packages: description: name: dio_web_adapter sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.0.0" equatable: @@ -158,7 +158,7 @@ packages: description: name: equatable sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.0.5" fake_async: @@ -166,7 +166,7 @@ packages: description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: @@ -174,7 +174,7 @@ packages: description: name: ffi sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.1.3" file: @@ -182,7 +182,7 @@ packages: description: name: file sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "7.0.0" flutter: @@ -195,7 +195,7 @@ packages: description: name: flutter_code_editor sha256: "505ad56dcc8a7be4b782c8113574571bc4b9723499b0c1f385b3e2c3fae11f5d" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.3.2" flutter_highlight: @@ -203,7 +203,7 @@ packages: description: name: flutter_highlight sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.7.0" flutter_launcher_icons: @@ -211,7 +211,7 @@ packages: description: name: flutter_launcher_icons sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.13.1" flutter_lints: @@ -219,7 +219,7 @@ packages: description: name: flutter_lints sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.0.2" flutter_markdown: @@ -227,7 +227,7 @@ packages: description: name: flutter_markdown sha256: a23c41ee57573e62fc2190a1f36a0480c4d90bde3a8a8d7126e5d5992fb53fb7 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.7.3+1" flutter_test: @@ -245,7 +245,7 @@ packages: description: name: get sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "4.6.6" highlight: @@ -253,7 +253,7 @@ packages: description: name: highlight sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.7.0" hive: @@ -261,7 +261,7 @@ packages: description: name: hive sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.2.3" http: @@ -269,7 +269,7 @@ packages: description: name: http sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.2.2" http_parser: @@ -277,7 +277,7 @@ packages: description: name: http_parser sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "4.0.2" image: @@ -285,7 +285,7 @@ packages: description: name: image sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "4.2.0" json_annotation: @@ -293,7 +293,7 @@ packages: description: name: json_annotation sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "4.9.0" leak_tracker: @@ -301,7 +301,7 @@ packages: description: name: leak_tracker sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "10.0.5" leak_tracker_flutter_testing: @@ -309,7 +309,7 @@ packages: description: name: leak_tracker_flutter_testing sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.0.5" leak_tracker_testing: @@ -317,7 +317,7 @@ packages: description: name: leak_tracker_testing sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.0.1" linked_scroll_controller: @@ -325,7 +325,7 @@ packages: description: name: linked_scroll_controller sha256: e6020062bcf4ffc907ee7fd090fa971e65d8dfaac3c62baf601a3ced0b37986a - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.2.0" lints: @@ -333,7 +333,7 @@ packages: description: name: lints sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.0.0" logger: @@ -341,7 +341,7 @@ packages: description: name: logger sha256: "697d067c60c20999686a0add96cf6aba723b3aa1f83ecf806a8097231529ec32" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.4.0" markdown: @@ -349,7 +349,7 @@ packages: description: name: markdown sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "7.2.2" matcher: @@ -357,7 +357,7 @@ packages: description: name: matcher sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.12.16+1" material_color_utilities: @@ -365,7 +365,7 @@ packages: description: name: material_color_utilities sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.11.1" menu_base: @@ -373,7 +373,7 @@ packages: description: name: menu_base sha256: "820368014a171bd1241030278e6c2617354f492f5c703d7b7d4570a6b8b84405" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.1" meta: @@ -381,7 +381,7 @@ packages: description: name: meta sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.15.0" mocktail: @@ -389,7 +389,7 @@ packages: description: name: mocktail sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.0.4" nyalcf_core: @@ -398,7 +398,7 @@ packages: path: "../../nyalcf_core" relative: true source: path - version: "1.0.5" + version: "1.0.6" nyalcf_inject: dependency: "direct main" description: @@ -412,20 +412,20 @@ packages: path: "../nyalcf_inject_extend" relative: true source: path - version: "1.0.5" + version: "1.0.6" nyalcf_ui: dependency: "direct main" description: path: "../nyalcf_ui" relative: true source: path - version: "1.0.5" + version: "1.0.6" open_filex: dependency: transitive description: name: open_filex sha256: ba425ea49affd0a98a234aa9344b9ea5d4c4f7625a1377961eae9fe194c3d523 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "4.5.0" package_info_plus: @@ -433,7 +433,7 @@ packages: description: name: package_info_plus sha256: "2c582551839386fa7ddbc7770658be7c0f87f388a4bff72066478f597c34d17f" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "7.0.0" package_info_plus_platform_interface: @@ -441,7 +441,7 @@ packages: description: name: package_info_plus_platform_interface sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.0.1" path: @@ -449,7 +449,7 @@ packages: description: name: path sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.9.0" path_provider: @@ -457,7 +457,7 @@ packages: description: name: path_provider sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.1.4" path_provider_android: @@ -465,7 +465,7 @@ packages: description: name: path_provider_android sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.2.10" path_provider_foundation: @@ -473,7 +473,7 @@ packages: description: name: path_provider_foundation sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.4.0" path_provider_linux: @@ -481,7 +481,7 @@ packages: description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -489,7 +489,7 @@ packages: description: name: path_provider_platform_interface sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.1.2" path_provider_windows: @@ -497,7 +497,7 @@ packages: description: name: path_provider_windows sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.3.0" petitparser: @@ -505,7 +505,7 @@ packages: description: name: petitparser sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "6.0.2" platform: @@ -513,7 +513,7 @@ packages: description: name: platform sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.1.5" plugin_platform_interface: @@ -521,7 +521,7 @@ packages: description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.1.8" screen_retriever: @@ -529,7 +529,7 @@ packages: description: name: screen_retriever sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.9" scrollable_positioned_list: @@ -537,7 +537,7 @@ packages: description: name: scrollable_positioned_list sha256: "1b54d5f1329a1e263269abc9e2543d90806131aa14fe7c6062a8054d57249287" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.3.8" shared_preferences: @@ -545,7 +545,7 @@ packages: description: name: shared_preferences sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.3.2" shared_preferences_android: @@ -553,7 +553,7 @@ packages: description: name: shared_preferences_android sha256: a7e8467e9181cef109f601e3f65765685786c1a738a83d7fbbde377589c0d974 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.3.1" shared_preferences_foundation: @@ -561,7 +561,7 @@ packages: description: name: shared_preferences_foundation sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.5.2" shared_preferences_linux: @@ -569,7 +569,7 @@ packages: description: name: shared_preferences_linux sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.4.1" shared_preferences_platform_interface: @@ -577,7 +577,7 @@ packages: description: name: shared_preferences_platform_interface sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.4.1" shared_preferences_web: @@ -585,7 +585,7 @@ packages: description: name: shared_preferences_web sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.4.2" shared_preferences_windows: @@ -593,7 +593,7 @@ packages: description: name: shared_preferences_windows sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.4.1" shortid: @@ -601,7 +601,7 @@ packages: description: name: shortid sha256: d0b40e3dbb50497dad107e19c54ca7de0d1a274eb9b4404991e443dadb9ebedb - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.1.2" sky_engine: @@ -614,7 +614,7 @@ packages: description: name: source_span sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.10.0" stack_trace: @@ -622,7 +622,7 @@ packages: description: name: stack_trace sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.11.1" stream_channel: @@ -630,7 +630,7 @@ packages: description: name: stream_channel sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.1.2" string_scanner: @@ -638,7 +638,7 @@ packages: description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.2.0" term_glyph: @@ -646,7 +646,7 @@ packages: description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: @@ -654,7 +654,7 @@ packages: description: name: test_api sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.7.2" tray_manager: @@ -662,7 +662,7 @@ packages: description: name: tray_manager sha256: c9a63fd88bd3546287a7eb8ccc978d707eef82c775397af17dda3a4f4c039e64 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.2.3" tuple: @@ -670,7 +670,7 @@ packages: description: name: tuple sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.0.2" typed_data: @@ -678,7 +678,7 @@ packages: description: name: typed_data sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.3.2" url_launcher: @@ -686,7 +686,7 @@ packages: description: name: url_launcher sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "6.3.0" url_launcher_android: @@ -694,7 +694,7 @@ packages: description: name: url_launcher_android sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "6.3.9" url_launcher_ios: @@ -702,7 +702,7 @@ packages: description: name: url_launcher_ios sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "6.3.1" url_launcher_linux: @@ -710,7 +710,7 @@ packages: description: name: url_launcher_linux sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.2.0" url_launcher_macos: @@ -718,7 +718,7 @@ packages: description: name: url_launcher_macos sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.2.0" url_launcher_platform_interface: @@ -726,7 +726,7 @@ packages: description: name: url_launcher_platform_interface sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.3.2" url_launcher_web: @@ -734,7 +734,7 @@ packages: description: name: url_launcher_web sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.3.3" url_launcher_windows: @@ -742,7 +742,7 @@ packages: description: name: url_launcher_windows sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.1.2" vector_math: @@ -750,7 +750,7 @@ packages: description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "2.1.4" vm_service: @@ -758,7 +758,7 @@ packages: description: name: vm_service sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "14.2.4" web: @@ -766,7 +766,7 @@ packages: description: name: web sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.5.1" win32: @@ -774,7 +774,7 @@ packages: description: name: win32 sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "5.5.4" win32_registry: @@ -782,7 +782,7 @@ packages: description: name: win32_registry sha256: "723b7f851e5724c55409bb3d5a32b203b3afe8587eaf5dafb93a5fed8ecda0d6" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.1.4" window_manager: @@ -790,7 +790,7 @@ packages: description: name: window_manager sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "0.3.9" xdg_directories: @@ -798,7 +798,7 @@ packages: description: name: xdg_directories sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "1.0.4" xml: @@ -806,7 +806,7 @@ packages: description: name: xml sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "6.5.0" yaml: @@ -814,7 +814,7 @@ packages: description: name: yaml sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.dev" source: hosted version: "3.1.2" sdks: diff --git a/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart b/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart index b660a702..ebc0da22 100644 --- a/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart +++ b/nyalcf_gui/nyalcf_ui/lib/controllers/frpc_setting_controller.dart @@ -39,14 +39,19 @@ class FrpcSettingController extends GetxController { var cpuArch = ''.obs; + var downloadMirrors = []; + var selectedMirror = 'muska-github-mirror'.obs; + load() async { // TODO: 需要修改 cpuArch.value = (await CPUArch.getCPUArchitecture())!; // await FrpcSettingPrefs.refresh(); // final frpcinfo = await FrpcSettingPrefs.getFrpcInfo(); - frpcDownloadUseMirror.value = _fcs.getSettingsGitHubMirror(); + frpcDownloadUseMirror.value = _fcs.getSettingsFrpcDownloadMirror(); frpcVersion.value = _fcs.getSettingsFrpcVersion(); + downloadMirrors = _fcs.getDownloadMirrors(); + selectedMirror.value = _fcs.getSettingsFrpcDownloadMirrorId(); _loadTip(); _loadFrpcDropdownItem(); } diff --git a/nyalcf_gui/nyalcf_ui/lib/controllers/panel_controller.dart b/nyalcf_gui/nyalcf_ui/lib/controllers/panel_controller.dart index 7b98abbc..83e3f918 100644 --- a/nyalcf_gui/nyalcf_ui/lib/controllers/panel_controller.dart +++ b/nyalcf_gui/nyalcf_ui/lib/controllers/panel_controller.dart @@ -8,7 +8,7 @@ class DPanelController extends GetxController { var announcementCommon = '喵喵喵?正在请求捏'.obs; load() async { - final broadcast = await OtherAnnouncement().getBroadcast(); + final broadcast = await OtherAnnouncement.getBroadcast(); final ads = await OtherAnnouncement().getAds(); if (broadcast.status) { announcement.value = broadcast.data['broadcast']; diff --git a/nyalcf_gui/nyalcf_ui/lib/controllers/proxies_controller.dart b/nyalcf_gui/nyalcf_ui/lib/controllers/proxies_controller.dart index 134afb3a..dd85e685 100644 --- a/nyalcf_gui/nyalcf_ui/lib/controllers/proxies_controller.dart +++ b/nyalcf_gui/nyalcf_ui/lib/controllers/proxies_controller.dart @@ -259,8 +259,8 @@ class ProxiesController extends GetxController { Logger.error( 'Context not mounted while executing a async function!'); } - final res = await ProxiesConfiguration() - .get(_uCtr.frpToken.value, element.id); + final res = await ProxiesConfiguration.get( + _uCtr.frpToken.value, element.id); if (res is String) { Logger.info('Successfully get config ini'); text = res; @@ -330,7 +330,7 @@ class ProxiesController extends GetxController { load(username, token, {bool request = false}) async { loading.value = true; if (request) { - final list = await ProxiesGet().get(username, token); + final list = await ProxiesGet.get(username, token); if (list.status) { ProxiesStorage.clear(); ProxiesStorage.addAll(list.data['proxies_list']); diff --git a/nyalcf_gui/nyalcf_ui/lib/models/account_dialog.dart b/nyalcf_gui/nyalcf_ui/lib/models/account_dialog.dart index 5f8243fa..c3d8aee5 100644 --- a/nyalcf_gui/nyalcf_ui/lib/models/account_dialog.dart +++ b/nyalcf_gui/nyalcf_ui/lib/models/account_dialog.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:nyalcf_inject_extend/nyalcf_inject_extend.dart'; +import 'package:nyalcf_ui/controllers/user_controller.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:nyalcf_ui/controllers/console_controller.dart'; @@ -15,6 +17,8 @@ class AccountDialogX { final BuildContext context; Widget build() { + final UserController uCtr = Get.find(); + return SimpleDialog( title: const Text('小可爱,喵呜?'), children: [ @@ -24,10 +28,41 @@ class AccountDialogX { title: Text('退出登录'), ), onPressed: () async { + loading.value = true; try { - await UserInfoStorage.sigo(); - final HC hc = Get.put(HC()); - hc.load(force: true); + final logout = + await UserInfoStorage.sigo(uCtr.user, uCtr.token); + if (logout) { + final HC hc = Get.put(HC()); + hc.load(force: true); + Get.toNamed('/'); + Logger.info('Dispose controllers'); + try { + final DPanelController dpctr = Get.find(); + dpctr.dispose(); + } catch (ignore) { + // + } + try { + final ProxiesController pctr = Get.find(); + pctr.dispose(); + } catch (ignore) { + // + } + try { + final ConsoleController cctr = Get.find(); + cctr.dispose(); + } catch (ignore) { + // + } + } else { + Get.snackbar( + '发生错误', + '请求登出失败,请重试 oxo', + snackPosition: SnackPosition.BOTTOM, + animationDuration: const Duration(milliseconds: 300), + ); + } } catch (e) { Get.snackbar( '发生错误', @@ -36,26 +71,7 @@ class AccountDialogX { animationDuration: const Duration(milliseconds: 300), ); } - Logger.info('Dispose controllers'); - try { - final DPanelController dpctr = Get.find(); - dpctr.dispose(); - } catch (ignore) { - // - } - try { - final ProxiesController pctr = Get.find(); - pctr.dispose(); - } catch (ignore) { - // - } - try { - final ConsoleController cctr = Get.find(); - cctr.dispose(); - } catch (ignore) { - // - } - Get.toNamed('/'); + loading.value = false; }), SimpleDialogOption( child: const ListTile( diff --git a/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart b/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart index 212ff9cd..8d978b79 100644 --- a/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart +++ b/nyalcf_gui/nyalcf_ui/lib/models/frpc_download_dialog.dart @@ -38,16 +38,19 @@ class FrpcDownloadDialogX { /// 刷新UI,下载frpc _dsCtr.refreshDownloadShow(); + final mirror = _fcs.getSettingsFrpcDownloadMirrorId(); + /// 开始下载 Get.dialog(_downloading(), barrierDismissible: false); - final res = await DownloadFrpc().download( + final res = await DownloadFrpc.download( arch: _dsCtr.arch[_dsCtr.frpcDownloadArch.value]['arch'], platform: _dsCtr.platform, version: '0.51.3-3', releaseName: 'LoCyanFrp-0.51.3-3 #2024050701', progressCallback: _dsCtr.downloadFrpcCallback, cancelToken: _dsCtr.downloadCancelToken, - useMirror: _fcs.getSettingsGitHubMirror(), + useMirror: _fcs.getSettingsFrpcDownloadMirror(), + mirrorId: mirror.isNotEmpty ? mirror : null, ); _dsCtr.frpcDownloadCancel = res; _dsCtr.refreshDownloadShow(); diff --git a/nyalcf_gui/nyalcf_ui/lib/views/auth/login.dart b/nyalcf_gui/nyalcf_ui/lib/views/auth/login.dart index 546e5f3b..2e8d396b 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/auth/login.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/auth/login.dart @@ -103,8 +103,8 @@ class _LoginState extends State { snackPosition: SnackPosition.BOTTOM, animationDuration: const Duration(milliseconds: 300), ); - final res = await LoginAuth() - .requestLogin(userController.text, passwordController.text); + final res = await LoginAuth.requestLogin( + userController.text, passwordController.text); if (res.status) { await UserInfoPrefs.setInfo(res.data['user_info']); UserInfoPrefs.saveToFile(); diff --git a/nyalcf_gui/nyalcf_ui/lib/views/auth/register.dart b/nyalcf_gui/nyalcf_ui/lib/views/auth/register.dart index 3fd5e8f0..8cf7379d 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/auth/register.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/auth/register.dart @@ -220,7 +220,7 @@ class _RegisterState extends State { snackPosition: SnackPosition.BOTTOM, animationDuration: const Duration(milliseconds: 300), ); - final res = await RegisterAuth().requestRegister( + final res = await RegisterAuth.requestRegister( userController.text, passwordController.text, confirmPasswordController.text, @@ -236,7 +236,7 @@ class _RegisterState extends State { snackPosition: SnackPosition.BOTTOM, animationDuration: const Duration(milliseconds: 300), ); - final resLogin = await LoginAuth().requestLogin( + final resLogin = await LoginAuth.requestLogin( userController.text, passwordController.text, ); diff --git a/nyalcf_gui/nyalcf_ui/lib/views/home.dart b/nyalcf_gui/nyalcf_ui/lib/views/home.dart index 347161f1..821daaa4 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/home.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/home.dart @@ -95,7 +95,7 @@ class HC extends GetxController { UserInfoModel? userinfo = await UserInfoStorage.read(); if (userinfo != null) { // 检查用户令牌是否有效 - final checkTokenRes = await UserAuth().checkToken(userinfo.token); + final checkTokenRes = await UserAuth.checkToken(userinfo.token); if (checkTokenRes.status) { // 刷新用户信息 await UserAuth().getInfo(userinfo.token, userinfo.user).then((value) { diff --git a/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart b/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart index 403751e0..648538fd 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/panel/home.dart @@ -83,8 +83,7 @@ class PanelHome extends StatelessWidget { Obx(() => Text('邮箱:${_uCtr.email}')), Obx(() => Text( '限制速率:${_uCtr.inbound / 1024 * 8}Mbps/${_uCtr.outbound / 1024 * 8}Mbps')), - Obx(() => - Text('剩余流量:${_uCtr.trafficRx} GiB')) + Obx(() => Text('剩余流量:${_uCtr.trafficRx} GiB')) ], ), ), @@ -94,9 +93,8 @@ class PanelHome extends StatelessWidget { child: ElevatedButton( onPressed: () async { loading.value = true; - final checkSignRes = await OtherSign() - .checkSign( - _uCtr.user.value, _uCtr.token.value); + final checkSignRes = await OtherSign.checkSign( + _uCtr.user.value, _uCtr.token.value); if (checkSignRes.status) { if (!checkSignRes.data['signed']) { final doSignRes = await OtherSign().doSign( diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart index f97edf25..92e8b9e7 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/frpc_setting.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:nyalcf_core/utils/logger.dart'; import 'package:nyalcf_ui/controllers/frpc_setting_controller.dart'; import 'package:nyalcf_core/storages/configurations/frpc_configuration_storage.dart'; @@ -11,10 +12,6 @@ class FrpcSetting { final _fcs = FrpcConfigurationStorage(); final FrpcSettingController _dsCtr = Get.find(); - final List mirrorOptions = ['GitHub代理', 'LoCyan Mirror']; - final RxString selectedMirror = 'GitHub代理'.obs; - - @override Widget widget() { _dsCtr.context = context; return Container( @@ -49,8 +46,9 @@ class FrpcSetting { Switch( value: _dsCtr.frpcDownloadUseMirror.value, onChanged: (value) async { - _fcs.setSettingsGitHubMirror(value); + _fcs.setSettingsFrpcDownloadMirror(value); _dsCtr.frpcDownloadUseMirror.value = value; + _fcs.save(); }, ), ], @@ -65,30 +63,24 @@ class FrpcSetting { ), Obx( () => DropdownButton( - value: selectedMirror.value, - onChanged: (String? newValue) { - if (newValue != null) { - selectedMirror.value = newValue; - if (mirrorOptions == 'GitHub代理') { - onChanged: - (value) async { - _fcs.setSettingsGitHubMirror(value); - _dsCtr.frpcDownloadUseMirror.value = - value; - }; - }else { - /// TODO: LoCyanMirror下载选择 - } + value: _dsCtr.selectedMirror.value, + onChanged: (value) { + Logger.debug('Selected mirror id: $value'); + if (value != null) { + _fcs.setSettingsFrpcDownloadMirrorId(value); + _dsCtr.selectedMirror.value = value; + _fcs.save(); } }, - items: mirrorOptions + items: _dsCtr.downloadMirrors .map>( - (String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), + (value) { + return DropdownMenuItem( + value: value['id'], + child: Text(value['name']), + ); + }, + ).toList(), ), ), ], diff --git a/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart b/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart index f41cb67a..22d3e369 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/setting/launcher_setting.dart @@ -382,7 +382,8 @@ class LauncherSetting { SelectableText('内部软件包名:${Universe.appPackageName}'), SelectableText( '软件版本:${Universe.appVersion} (+${Universe.appBuildNumber})'), - const SelectableText('Copyright 2023 © 夏沫花火zzz🌙,以及感谢社区贡献者的无私奉献。'), + const SelectableText( + 'Copyright 2023 © 夏沫花火zzz🌙,以及感谢社区贡献者的无私奉献。'), ], ), ), @@ -391,7 +392,7 @@ class LauncherSetting { child: ElevatedButton( onPressed: () async { loading.value = true; - final remote = await UpdateLauncher().getUpdate(); + final remote = await UpdateLauncher.getUpdate(); if (remote.status) { TaskUpdater.uIf = remote.data['update_info']; if (TaskUpdater.check()) TaskUpdater.showDialog(); diff --git a/nyalcf_gui/nyalcf_ui/lib/views/tokenmode/panel.dart b/nyalcf_gui/nyalcf_ui/lib/views/tokenmode/panel.dart index 56850859..816b9c06 100644 --- a/nyalcf_gui/nyalcf_ui/lib/views/tokenmode/panel.dart +++ b/nyalcf_gui/nyalcf_ui/lib/views/tokenmode/panel.dart @@ -90,7 +90,7 @@ class _TokenModePanelState extends State { '请填写隧道数字ID', snackPosition: SnackPosition.BOTTOM, animationDuration: - const Duration(milliseconds: 300), + const Duration(milliseconds: 300), ); return; } From e701b5b8e052ea3621ac3ec06ef3fa83f65561a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz?= Date: Tue, 20 Aug 2024 03:02:22 +0800 Subject: [PATCH 12/15] [ci skip]Update RELEASE_CHANGELOG.md --- RELEASE_CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE_CHANGELOG.md b/RELEASE_CHANGELOG.md index 3760e470..437a7a84 100644 --- a/RELEASE_CHANGELOG.md +++ b/RELEASE_CHANGELOG.md @@ -8,16 +8,18 @@ - 更新 Flutter - 修改了欢迎语判定 - -[//]: # (- 添加 LCM Frpc 下载镜像) +- 下载 Frpc 添加了镜像选择 +- 适配了核心登出会吊销 Token ### CLI - 添加 Frpc 下载功能 +- 适配了核心登出会吊销 Token ### 其他 - 重写了下载 Frpc 核心逻辑 +- 现在登出会调用请求吊销 Token ## 版本信息 From 80648befb4df9ff368828eb47e2955fe659a9878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz?= Date: Tue, 20 Aug 2024 03:04:20 +0800 Subject: [PATCH 13/15] Update logout.dart --- nyalcf_cli/lib/commands/logout.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nyalcf_cli/lib/commands/logout.dart b/nyalcf_cli/lib/commands/logout.dart index 4168fd18..41649556 100644 --- a/nyalcf_cli/lib/commands/logout.dart +++ b/nyalcf_cli/lib/commands/logout.dart @@ -6,9 +6,13 @@ class Logout implements CommandImplement { @override Future main(List args) async { final userInfo = await UserInfoStorage.read(); - await UserInfoStorage.sigo(userInfo?.user, userInfo?.token); + final res = await UserInfoStorage.sigo(userInfo?.user, userInfo?.token); - Logger.info('Session data removed.'); + if (res) { + Logger.info('Session data removed.'); + } else { + Logger.error('Logout failed, please check your network connection and retry.'); + } } -} \ No newline at end of file +} From f976bf36a53ae07844828c09a041397f66f38816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz?= Date: Tue, 20 Aug 2024 03:04:43 +0800 Subject: [PATCH 14/15] [ci skip] --- nyalcf_cli/lib/commands/logout.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nyalcf_cli/lib/commands/logout.dart b/nyalcf_cli/lib/commands/logout.dart index 41649556..3aa4e71c 100644 --- a/nyalcf_cli/lib/commands/logout.dart +++ b/nyalcf_cli/lib/commands/logout.dart @@ -9,9 +9,9 @@ class Logout implements CommandImplement { final res = await UserInfoStorage.sigo(userInfo?.user, userInfo?.token); if (res) { - Logger.info('Session data removed.'); + Logger.info('Session data removed.'); } else { - Logger.error('Logout failed, please check your network connection and retry.'); + Logger.error('Logout failed, please check your network connection and retry.'); } } From 04528d3194a68f9711cfae15208b33f4b8848fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz?= Date: Tue, 20 Aug 2024 03:08:36 +0800 Subject: [PATCH 15/15] RELEASE_CHANGELOG.md [ci skip] --- RELEASE_CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_CHANGELOG.md b/RELEASE_CHANGELOG.md index 437a7a84..ae11f55b 100644 --- a/RELEASE_CHANGELOG.md +++ b/RELEASE_CHANGELOG.md @@ -20,6 +20,8 @@ - 重写了下载 Frpc 核心逻辑 - 现在登出会调用请求吊销 Token +- 将网络请求方法改为静态方法 +- Typo `install-dependecy.sh` -> `install-dependency.sh` ## 版本信息