From c879de5584966b78b90d41a91c9a2aef5f7d3c19 Mon Sep 17 00:00:00 2001 From: niuhuan Date: Sat, 15 Oct 2022 01:54:50 +0800 Subject: [PATCH] 1.5.13 --- android/app/build.gradle | 4 ++-- ci/version.code.txt | 2 +- ci/version.info.txt | 17 +++++++++++++++-- ios/Podfile.lock | 10 +++++----- ios/Runner/AppDelegate.swift | 11 ++++++++--- ios/Runner/Info.plist | 4 ++++ lib/basic/Method.dart | 3 +++ lib/screens/AccountScreen.dart | 6 ++++-- lib/screens/AppScreen.dart | 6 ++++-- lib/screens/CategoriesScreen.dart | 8 ++++---- lib/screens/DownloadExportToFileScreen.dart | 16 ++++++++++++---- lib/screens/DownloadExportingGroupScreen.dart | 14 +++++++++++--- lib/screens/DownloadInfoScreen.dart | 2 +- pubspec.yaml | 2 +- 14 files changed, 75 insertions(+), 30 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4c5767a..b71f21f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion flutter.compileSdkVersion + compileSdkVersion 33 // flutter.compileSdkVersion sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -36,7 +36,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "niuhuan.pikapika" minSdkVersion 19 // flutter.minSdkVersion - targetSdkVersion 33 // flutter.targetSdkVersion + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/ci/version.code.txt b/ci/version.code.txt index 3060b91..21163d3 100644 --- a/ci/version.code.txt +++ b/ci/version.code.txt @@ -1 +1 @@ -v1.5.12 \ No newline at end of file +v1.5.13 \ No newline at end of file diff --git a/ci/version.info.txt b/ci/version.info.txt index 57ef333..ee3c98c 100644 --- a/ci/version.info.txt +++ b/ci/version.info.txt @@ -1,3 +1,16 @@ -v1.5.12 +## !! WARNING !! + +IOS 用户请注意, 由于导出权限的问题, 本次升级后, 数据将会被移出数据库 并现显示到文件管理器, 您登录windows端后, 将文件复制到windows端的data目录并覆盖, 即可恢复数据继续阅读。 随后系统将会重新创建数据库, 您可将下载传输回手机。 + +其他平台用户不受影响。 + +## + +v1.5.13 + +- [x] ♻️升级flutter +- [x] 🚀IOS支持导出到文件 +- [x] ♻️消除WebToon横向阅读时的抖动 +- [x] 🐛修复一些布局问题 +- [x] ♻️反转下载章节的列表 -- [x] 修复手动修改列数频道没有生效的问题 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 713754d..8d5eee7 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -39,7 +39,7 @@ PODS: - TOCropViewController (~> 2.6.1) - image_picker_ios (0.0.1): - Flutter - - "permission_handler (5.1.0+2)": + - permission_handler_apple (9.0.4): - Flutter - SDWebImage (5.12.5): - SDWebImage/Core (= 5.12.5) @@ -58,7 +58,7 @@ DEPENDENCIES: - Flutter (from `Flutter`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) + - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - uni_links (from `.symlinks/plugins/uni_links/ios`) - uri_to_file (from `.symlinks/plugins/uri_to_file/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) @@ -80,8 +80,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/image_cropper/ios" image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" + permission_handler_apple: + :path: ".symlinks/plugins/permission_handler_apple/ios" uni_links: :path: ".symlinks/plugins/uni_links/ios" uri_to_file: @@ -96,7 +96,7 @@ SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 image_cropper: 60c2789d1f1a78c873235d4319ca0c34a69f2d98 image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 + permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce SDWebImage: 0905f1b7760fc8ac4198cae0036600d67478751e SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780 TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index b5944e9..c4da871 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -12,8 +12,11 @@ import LocalAuthentication ) -> Bool { let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] - - MobileInitApplication(documentsPath) + let applicationSupportsPath = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true)[0] + + MobileMigration(documentsPath, applicationSupportsPath) + MobileInitApplication(applicationSupportsPath) + let controller = self.window.rootViewController as! FlutterViewController let channel = FlutterMethodChannel.init(name: "method", binaryMessenger: controller as! FlutterBinaryMessenger) @@ -70,7 +73,9 @@ import LocalAuthentication result(FlutterError(code: "", message: "params error", details: "")) } } - else{ + else if call.method == "iosGetDocumentDir" { + result(documentsPath) + } else { result(FlutterMethodNotImplemented) } }.start() diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 6d271d5..970218e 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,6 +2,10 @@ + UIFileSharingEnabled + + LSSupportsOpeningDocumentsInPlace + CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion diff --git a/lib/basic/Method.dart b/lib/basic/Method.dart index f10b3da..a4afabe 100644 --- a/lib/basic/Method.dart +++ b/lib/basic/Method.dart @@ -884,4 +884,7 @@ class Method { return _flatInvoke("resetSwitchAddress", ""); } + Future iosGetDocumentDir() async { + return await _channel.invokeMethod('iosGetDocumentDir', ''); + } } diff --git a/lib/screens/AccountScreen.dart b/lib/screens/AccountScreen.dart index d8ec15d..7b845a3 100644 --- a/lib/screens/AccountScreen.dart +++ b/lib/screens/AccountScreen.dart @@ -36,10 +36,12 @@ class _AccountScreenState extends State { @override void initState() { _linkSubscription = linkSubscript(context); - versionEvent.subscribe(_versionSub); - versionPop(context); _loadProperties(); super.initState(); + Future.delayed(Duration.zero, () async { + versionPop(context); + versionEvent.subscribe(_versionSub); + }); } @override diff --git a/lib/screens/AppScreen.dart b/lib/screens/AppScreen.dart index eb8d4a5..51b646d 100644 --- a/lib/screens/AppScreen.dart +++ b/lib/screens/AppScreen.dart @@ -29,9 +29,11 @@ class _AppScreenState extends State { void initState() { versionEvent.subscribe(_onVersion); _linkSubscription = linkSubscript(context); - versionEvent.subscribe(_versionSub); - versionPop(context); super.initState(); + Future.delayed(Duration.zero, () async { + versionPop(context); + versionEvent.subscribe(_versionSub); + }); } @override diff --git a/lib/screens/CategoriesScreen.dart b/lib/screens/CategoriesScreen.dart index 082f5a1..9c74299 100644 --- a/lib/screens/CategoriesScreen.dart +++ b/lib/screens/CategoriesScreen.dart @@ -154,11 +154,11 @@ class _CategoriesScreenState extends State { if (categoriesColumnCount == 0) { var size = MediaQuery.of(context).size; var min = size.width < size.height ? size.width : size.height; - blockSize = min / 3; + blockSize = (min ~/ 3).floorToDouble(); } else { var size = MediaQuery.of(context).size; var min = size.width; - blockSize = min / categoriesColumnCount; + blockSize = (min ~/ categoriesColumnCount).floorToDouble(); } imageSize = blockSize - 15; @@ -252,11 +252,11 @@ class _CategoriesScreenState extends State { if (categoriesColumnCount == 0) { var size = MediaQuery.of(context).size; var min = size.width < size.height ? size.width : size.height; - blockSize = min / 3; + blockSize = (min ~/ 3).floorToDouble(); } else { var size = MediaQuery.of(context).size; var min = size.width; - blockSize = min / categoriesColumnCount; + blockSize = (min ~/ categoriesColumnCount).floorToDouble(); } imageSize = blockSize - 15; diff --git a/lib/screens/DownloadExportToFileScreen.dart b/lib/screens/DownloadExportToFileScreen.dart index 0dfcba8..644d690 100644 --- a/lib/screens/DownloadExportToFileScreen.dart +++ b/lib/screens/DownloadExportToFileScreen.dart @@ -140,7 +140,9 @@ class _DownloadExportToFileScreenState onPressed: () async { late String? path; try { - path = await chooseFolder(context); + path = Platform.isIOS + ? await method.iosGetDocumentDir() + : await chooseFolder(context); } catch (e) { defaultToast(context, "$e"); return; @@ -191,7 +193,9 @@ class _DownloadExportToFileScreenState onPressed: () async { late String? path; try { - path = await chooseFolder(context); + path = Platform.isIOS + ? await method.iosGetDocumentDir() + : await chooseFolder(context); } catch (e) { defaultToast(context, "$e"); return; @@ -244,7 +248,9 @@ class _DownloadExportToFileScreenState onPressed: () async { late String? path; try { - path = await chooseFolder(context); + path = Platform.isIOS + ? await method.iosGetDocumentDir() + : await chooseFolder(context); } catch (e) { defaultToast(context, "$e"); return; @@ -296,7 +302,9 @@ class _DownloadExportToFileScreenState onPressed: () async { late String? path; try { - path = await chooseFolder(context); + path = Platform.isIOS + ? await method.iosGetDocumentDir() + : await chooseFolder(context); } catch (e) { defaultToast(context, "$e"); return; diff --git a/lib/screens/DownloadExportingGroupScreen.dart b/lib/screens/DownloadExportingGroupScreen.dart index e4c32e8..fd2e43c 100644 --- a/lib/screens/DownloadExportingGroupScreen.dart +++ b/lib/screens/DownloadExportingGroupScreen.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:pikapika/basic/Common.dart'; @@ -79,7 +81,9 @@ class _DownloadExportingGroupScreenState _exportPkz() async { late String? path; try { - path = await chooseFolder(context); + path = Platform.isIOS + ? await method.iosGetDocumentDir() + : await chooseFolder(context); } catch (e) { defaultToast(context, "$e"); return; @@ -127,7 +131,9 @@ class _DownloadExportingGroupScreenState } late String? path; try { - path = await chooseFolder(context); + path = Platform.isIOS + ? await method.iosGetDocumentDir() + : await chooseFolder(context); } catch (e) { defaultToast(context, "$e"); return; @@ -161,7 +167,9 @@ class _DownloadExportingGroupScreenState } late String? path; try { - path = await chooseFolder(context); + path = Platform.isIOS + ? await method.iosGetDocumentDir() + : await chooseFolder(context); } catch (e) { defaultToast(context, "$e"); return; diff --git a/lib/screens/DownloadInfoScreen.dart b/lib/screens/DownloadInfoScreen.dart index 896d044..9e26818 100644 --- a/lib/screens/DownloadInfoScreen.dart +++ b/lib/screens/DownloadInfoScreen.dart @@ -203,7 +203,7 @@ class _DownloadInfoScreenState extends State } }, ), - ..._epList.map((e) { + ..._epList.reversed.map((e) { return MaterialButton( onPressed: () { _push(_task, _epList, e.epOrder, null); diff --git a/pubspec.yaml b/pubspec.yaml index 8fbb261..1b92514 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.5.12+6 +version: 1.5.13+7 environment: sdk: ">=2.12.0 <3.0.0"