diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6f91573..2f70326 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,8 +6,7 @@ - - + @@ -20,11 +19,10 @@ android:icon="@mipmap/ic_launcher" android:label="pikapika" android:requestLegacyExternalStorage="true"> - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + android:name="com.yalantis.ucrop.UCropActivity" + android:screenOrientation="portrait" + android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> diff --git a/ci/version.code.txt b/ci/version.code.txt index 96e57bd..1a6afed 100644 --- a/ci/version.code.txt +++ b/ci/version.code.txt @@ -1 +1 @@ -v1.6.7 \ No newline at end of file +v1.6.8 \ No newline at end of file diff --git a/ci/version.info.txt b/ci/version.info.txt index 3106a59..cd43a18 100644 --- a/ci/version.info.txt +++ b/ci/version.info.txt @@ -1,11 +1,5 @@ -v1.6.7 - -- [x] ✨找回密码 -- [x] ✨webDav -- [x] ✨自动同步历史记录(发电) -- [x] ♻️注册登录更友善的提示(有些人看不懂英文) -- [x] ✨快速切换封印模式菜单 -- [x] ✨阉割掉注册 -- [x] ✨快速切换分流 -- [x] ✨导出图片zip +v1.6.8 +- [x] ✨测速(界面还未实现) +- [x] ♻️优化安卓文件关联 +- [x] ♻️优化安卓URL匹配 diff --git a/lib/basic/Common.dart b/lib/basic/Common.dart index 15e4515..f8183bc 100644 --- a/lib/basic/Common.dart +++ b/lib/basic/Common.dart @@ -299,6 +299,7 @@ Future inputString(BuildContext context, String title, StreamSubscription linkSubscript(BuildContext context) { return linkStream.listen((uri) async { if (uri == null) return; + var parsed = Uri.parse(uri); if (RegExp(r"^pika://comic/([0-9A-z]+)/$").allMatches(uri).isNotEmpty) { String comicId = RegExp(r"^pika://comic/([0-9A-z]+)/$") .allMatches(uri) @@ -309,7 +310,17 @@ StreamSubscription linkSubscript(BuildContext context) { builder: (BuildContext context) => ComicInfoScreen(comicId: comicId), ), ); - } else if (RegExp(r"^.*\.pkz$").allMatches(uri).isNotEmpty) { + } else if (RegExp(r"^https?://pika/comic/([0-9A-z]+)/$").allMatches(uri).isNotEmpty) { + String comicId = RegExp(r"^https?://pika/comic/([0-9A-z]+)/$") + .allMatches(uri) + .first + .group(1)!; + Navigator.of(context).push( + mixRoute( + builder: (BuildContext context) => ComicInfoScreen(comicId: comicId), + ), + ); + } else if (RegExp(r"^.*\.pkz$").allMatches(parsed.path).isNotEmpty) { File file = await toFile(uri); Navigator.of(context).push( mixRoute( @@ -317,7 +328,7 @@ StreamSubscription linkSubscript(BuildContext context) { PkzArchiveScreen(pkzPath: file.path), ), ); - } else if (RegExp(r"^.*\.((pki)|(zip))$").allMatches(uri).isNotEmpty) { + } else if (RegExp(r"^.*\.((pki)|(zip))$").allMatches(parsed.path).isNotEmpty) { File file = await toFile(uri); Navigator.of(context).push( mixRoute( diff --git a/lib/basic/Method.dart b/lib/basic/Method.dart index 8c82203..e7b1278 100644 --- a/lib/basic/Method.dart +++ b/lib/basic/Method.dart @@ -582,10 +582,10 @@ class Method { /// 导出下载的图片到HTML+JPG Future exportComicDownloadToJPG( - String comicId, - String dir, - String name, - ) { + String comicId, + String dir, + String name, + ) { return _flatInvoke("exportComicDownloadToJPG", { "comicId": comicId, "dir": dir, @@ -595,10 +595,10 @@ class Method { /// 导出下载的图片到HTML+JPG Future exportComicDownloadJpegZip( - String comicId, - String dir, - String name, - ) { + String comicId, + String dir, + String name, + ) { return _flatInvoke("exportComicDownloadJpegZip", { "comicId": comicId, "dir": dir, @@ -967,4 +967,9 @@ class Method { "file": file, }); } + + Future ping(String idx) async { + String ms = await _flatInvoke("ping", idx); + return int.parse(ms); + } } diff --git a/lib/screens/AccountScreen.dart b/lib/screens/AccountScreen.dart index 4ef6571..3734998 100644 --- a/lib/screens/AccountScreen.dart +++ b/lib/screens/AccountScreen.dart @@ -81,38 +81,17 @@ class _AccountScreenState extends State { appBar: AppBar( title: const Text('配置'), actions: [ - IconButton( - onPressed: () { - setState(() { - _versionClick++; - }); - }, - icon: Text(currentVersion()), + SizedBox( + width: 80, + child: IconButton( + onPressed: () { + setState(() { + _versionClick++; + }); + }, + icon: Text(currentVersion()), + ), ), - // IconButton( - // onPressed: () { - // Navigator.push( - // context, - // mixRoute( - // builder: (context) => const SettingsScreen( - // hiddenAccountInfo: true, - // ), - // ), - // ); - // }, - // icon: const Text('设置'), - // ), - // IconButton( - // onPressed: () { - // Navigator.push( - // context, - // mixRoute( - // builder: (context) => const AboutScreen(), - // ), - // ); - // }, - // icon: const Text('关于'), - // ), IconButton( onPressed: _toDownloadList, icon: const Icon(Icons.download_rounded), diff --git a/lib/screens/InitScreen.dart b/lib/screens/InitScreen.dart index 8b1c525..4556131 100644 --- a/lib/screens/InitScreen.dart +++ b/lib/screens/InitScreen.dart @@ -124,6 +124,7 @@ class _InitScreenState extends State { } } if (initUrl != null) { + var parsed = Uri.parse(initUrl!); if (RegExp(r"^pika://comic/([0-9A-z]+)/$").allMatches(initUrl!).isNotEmpty) { String comicId = RegExp(r"^pika://comic/([0-9A-z]+)/$").allMatches(initUrl!).first.group(1)!; Navigator.of(context).pushReplacement(mixRoute( @@ -131,14 +132,21 @@ class _InitScreenState extends State { ComicInfoScreen(comicId: comicId, holdPkz: true), )); return; - } else if (RegExp(r"^.*\.pkz$").allMatches(initUrl!).isNotEmpty) { + } if (RegExp(r"^https?://pika/comic/([0-9A-z]+)/$").allMatches(initUrl!).isNotEmpty) { + String comicId = RegExp(r"^https?://pika/comic/([0-9A-z]+)/$").allMatches(initUrl!).first.group(1)!; + Navigator.of(context).pushReplacement(mixRoute( + builder: (BuildContext context) => + ComicInfoScreen(comicId: comicId, holdPkz: true), + )); + return; + } else if (RegExp(r"^.*\.pkz$").allMatches(parsed.path).isNotEmpty) { File file = await toFile(initUrl!); Navigator.of(context).pushReplacement(mixRoute( builder: (BuildContext context) => PkzArchiveScreen(pkzPath: file.path, holdPkz: true), )); return; - } else if (RegExp(r"^.*\.((pki)|(zip))$").allMatches(initUrl!).isNotEmpty) { + } else if (RegExp(r"^.*\.((pki)|(zip))$").allMatches(parsed.path).isNotEmpty) { File file = await toFile(initUrl!); Navigator.of(context).pushReplacement( mixRoute( diff --git a/pubspec.lock b/pubspec.lock index 06035e3..ef6a559 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,10 +77,10 @@ packages: dependency: "direct main" description: name: crop_image - sha256: "78715179b0d3cd1e9e0a5c4a7846851acf33db346c657674b9abc358e84a511d" + sha256: b2db908b9d5cba7861d4b1337b9ea7b76309b55d38fd1c9ffea3308764b5990d url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" cross_file: dependency: transitive description: @@ -133,10 +133,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: d090ae03df98b0247b82e5928f44d1b959867049d18d73635e2e0bc3f49542b9 + sha256: d8e9ca7e5d1983365c277f12c21b4362df6cf659c99af146ad4d04eb33033013 url: "https://pub.dev" source: hosted - version: "5.2.5" + version: "5.2.6" filesystem_picker: dependency: "direct main" description: @@ -175,10 +175,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "4bef634684b2c7f3468c77c766c831229af829a0cd2d4ee6c1b99558bd14e5d2" + sha256: c224ac897bed083dabf11f238dd11a239809b446740be0c2044608c50029ffdf url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.0.9" flutter_search_bar: dependency: "direct main" description: @@ -249,34 +249,34 @@ packages: dependency: "direct main" description: name: image_picker - sha256: "22207768556b82d55ec70166824350fee32298732d5efa4d6e756f848f51f66a" + sha256: "64b21d9f0e065f9ab0e4dde458076226c97382cc0c6949144cb874c62bf8e9f8" url: "https://pub.dev" source: hosted - version: "0.8.6+3" + version: "0.8.7" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: "68d067baf7f6e401b1124ee83dd6967e67847314250fd68012aab34a69beb344" + sha256: b81db5f5ed8a69d54d5f0932c2af8120e8c0518a037d8beee494eec671da4d4c url: "https://pub.dev" source: hosted - version: "0.8.5+7" + version: "0.8.6+5" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "66fc6e3877bbde82c33d122f3588777c3784ac5bd7d1cdd79213ef7aecb85b34" + sha256: "98f50d6b9f294c8ba35e25cc0d13b04bfddd25dbc8d32fa9d566a6572f2c081c" url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.1.12" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: "39aa70b5f1e5e7c94585b9738632d5fdb764a5655e40cd9e7b95fbd2fc50c519" + sha256: "50e882fe0a06bf0c8f7f5bce78d30975f279213293afc9471dc35f05617c50ff" url: "https://pub.dev" source: hosted - version: "0.8.6+9" + version: "0.8.7+1" image_picker_platform_interface: dependency: transitive description: @@ -449,10 +449,10 @@ packages: dependency: transitive description: name: pointycastle - sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + sha256: "57b6b78df14175658f09c5dfcfc51a46ad9561a3504fe679913dab404d0cc0f2" url: "https://pub.dev" source: hosted - version: "3.6.2" + version: "3.7.0" scrollable_positioned_list: dependency: "direct main" description: @@ -566,34 +566,34 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "1f4d9ebe86f333c15d318f81dcdc08b01d45da44af74552608455ebdc08d9732" + sha256: "845530e5e05db5500c1a4c1446785d60cbd8f9bd45e21e7dd643a3273bb4bbd1" url: "https://pub.dev" source: hosted - version: "6.0.24" + version: "6.0.25" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: c9cd648d2f7ab56968e049d4e9116f96a85517f1dd806b96a86ea1018a3a82e5 + sha256: "3dedc66ca3c0bef9e6a93c0999aee102556a450afcc1b7bcfeace7a424927d92" url: "https://pub.dev" source: hosted - version: "6.1.1" + version: "6.1.3" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: e29039160ab3730e42f3d811dc2a6d5f2864b90a70fb765ea60144b03307f682 + sha256: "206fb8334a700ef7754d6a9ed119e7349bc830448098f21a69bf1b4ed038cabc" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.4" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "2dddb3291a57b074dade66b5e07e64401dd2487caefd4e9e2f467138d8c7eb06" + sha256: "0ef2b4f97942a16523e51256b799e9aa1843da6c60c55eefbfa9dbc2dcb8331a" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.4" url_launcher_platform_interface: dependency: transitive description: @@ -606,18 +606,18 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "574cfbe2390666003c3a1d129bdc4574aaa6728f0c00a4829a81c316de69dd9b" + sha256: "81fe91b6c4f84f222d186a9d23c73157dc4c8e1c71489c4d08be1ad3b228f1aa" url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.0.16" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "97c9067950a0d09cbd93e2e3f0383d1403989362b97102fbf446473a48079a4b" + sha256: a83ba3607a507758669cfafb03f9de09bf6e6280c14d9b9cb18f013e406dcacd url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "3.0.5" vector_math: dependency: transitive description: