Skip to content

Commit

Permalink
v1.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Oct 21, 2022
1 parent f5e4958 commit 7ddb05c
Show file tree
Hide file tree
Showing 13 changed files with 272 additions and 74 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,31 @@ jobs:
config:
- target: linux
host: ubuntu-latest
flutter_version: '3.3.4'
flutter_version: '3.3.5'
flutter_channel: 'stable'
- target: windows
host: windows-latest
flutter_version: '3.3.4'
flutter_version: '3.3.5'
flutter_channel: 'stable'
- target: macos
host: macos-latest
flutter_version: '3.3.4'
flutter_version: '3.3.5'
flutter_channel: 'stable'
- target: ios
host: macos-latest
flutter_version: '3.3.4'
flutter_version: '3.3.5'
flutter_channel: 'stable'
- target: android-arm32
host: ubuntu-latest
flutter_version: '3.3.4'
flutter_version: '3.3.5'
flutter_channel: 'stable'
- target: android-arm64
host: ubuntu-latest
flutter_version: '3.3.4'
flutter_version: '3.3.5'
flutter_channel: 'stable'
- target: android-x86_64
host: ubuntu-latest
flutter_version: '3.3.4'
flutter_version: '3.3.5'
flutter_channel: 'stable'
- target: android-arm32
host: ubuntu-latest
Expand Down
16 changes: 8 additions & 8 deletions ci/src/check_asset/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ async fn main() -> Result<()> {
let code = vs_code_txt.trim();

let mut release_file_name = match target.as_str() {
"macos" => format!("jasmine-{}-macos-intel.dmg", code),
"ios" => format!("jasmine-{}-ios-nosign.ipa", code),
"macos" => format!("jasmine-{}.dmg", code),
"ios" => format!("jasmine-{}-nosign.ipa", code),
"windows" => format!("jasmine-{}-windows-x86_64.zip", code),
"linux" => format!("jasmine-{}-linux-x86_64.AppImage", code),
"android-arm32" => format!("jasmine-{}-android-arm32.apk", code),
"android-arm64" => format!("jasmine-{}-android-arm64.apk", code),
"android-x86_64" => format!("jasmine-{}-android-x86_64.apk", code),
"linux" => format!("jasmine-{}-x86_64.AppImage", code),
"android-arm32" => format!("jasmine-{}-arm32.apk", code),
"android-arm64" => format!("jasmine-{}-arm64.apk", code),
"android-x86_64" => format!("jasmine-{}-x86_64.apk", code),
un => panic!("unknown target : {}", un),
};
if flutter_version == "2.10.5" {
release_file_name = format!("old_flutter-{}", release_file_name);
if flutter_version.starts_with("2.") {
release_file_name = format!("compatible-{}", release_file_name);
}

let client = reqwest::ClientBuilder::new().user_agent(UA).build()?;
Expand Down
16 changes: 8 additions & 8 deletions ci/src/upload_asset/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ async fn main() -> Result<()> {
let code = vs_code_txt.trim();

let mut release_file_name = match target.as_str() {
"macos" => format!("jasmine-{}-macos-intel.dmg", code),
"ios" => format!("jasmine-{}-ios-nosign.ipa", code),
"macos" => format!("jasmine-{}.dmg", code),
"ios" => format!("jasmine-{}-nosign.ipa", code),
"windows" => format!("jasmine-{}-windows-x86_64.zip", code),
"linux" => format!("jasmine-{}-linux-x86_64.AppImage", code),
"android-arm32" => format!("jasmine-{}-android-arm32.apk", code),
"android-arm64" => format!("jasmine-{}-android-arm64.apk", code),
"android-x86_64" => format!("jasmine-{}-android-x86_64.apk", code),
"linux" => format!("jasmine-{}-x86_64.AppImage", code),
"android-arm32" => format!("jasmine-{}-arm32.apk", code),
"android-arm64" => format!("jasmine-{}-arm64.apk", code),
"android-x86_64" => format!("jasmine-{}-x86_64.apk", code),
un => panic!("unknown target : {}", un),
};
if flutter_version == "2.10.5" {
release_file_name = format!("old_flutter-{}", release_file_name);
if flutter_version.starts_with("2.") {
release_file_name = format!("compatible-{}", release_file_name);
}

let local_path = match target.as_str() {
Expand Down
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.3.6
v1.3.7
19 changes: 18 additions & 1 deletion ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
## !! WARNING !!

本次升级IOS将会迁移数据, 第一次打开会白屏一段时间, 如某些功能出现闪退, 请删除软件并重新安装. 其他平台不受影响.
1.3.5 以下升级上来除IOS会闪退, 请先清理数据。

保存以前的数据请自行研究, 数据库结构没有任何改变, 只有索引有改变, 导致的数据不兼容。

1. IOS : 文件管理其中会出现旧数据。
2. 安卓 : 请删除以前的APP再装新版本或在设置中清理数据
3. windows : 请删除原来的目录。
4. linux : 自行解决
5. macos : ~/Library/Application Support/jasmine

## !! WARNING !!

v1.3.7

- [x] 🚀功能:导出进度显示
- [x] 🚀功能:导出前重命名(发电)
- [x] 🚀功能:下载时顺带导出一份(发电)
- [x] ♻️优化:升级渲染引擎(非兼容包)

v1.3.6

Expand Down
18 changes: 9 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PODS:
- DKImagePickerController/Core (4.3.3):
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.3)
- DKImagePickerController/PhotoGallery (4.3.3):
- DKImagePickerController/ImageDataManager (4.3.4)
- DKImagePickerController/PhotoGallery (4.3.4):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.3)
- DKImagePickerController/Resource (4.3.4)
- DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.17)
Expand Down Expand Up @@ -36,9 +36,9 @@ PODS:
- Flutter (1.0.0)
- permission_handler_apple (9.0.4):
- Flutter
- SDWebImage (5.12.5):
- SDWebImage/Core (= 5.12.5)
- SDWebImage/Core (5.12.5)
- SDWebImage (5.13.4):
- SDWebImage/Core (= 5.13.4)
- SDWebImage/Core (5.13.4)
- SwiftyGif (5.4.3)
- url_launcher_ios (0.0.1):
- Flutter
Expand Down Expand Up @@ -67,12 +67,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
DKImagePickerController: 72fd378f244cef3d27288e0aebf217a4467e4012
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
SDWebImage: 0905f1b7760fc8ac4198cae0036600d67478751e
SDWebImage: e5cc87bf736e60f49592f307bdf9e157189298a3
SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de

Expand Down
24 changes: 24 additions & 0 deletions lib/basic/methods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,29 @@ class Methods {
});
}

Future export_jm_zip_single(int id, String folder, String? rename) {
return _invoke("export_jm_zip_single", {
"id": id,
"folder": folder,
"rename": rename,
});
}

Future export_jm_jmi(List<int> idList, String path) {
return _invoke("export_jm_jmi", {
"comic_id": idList,
"dir": path,
});
}

Future export_jm_jmi_single(int id, String folder, String? rename) {
return _invoke("export_jm_jmi_single", {
"id": id,
"folder": folder,
"rename": rename,
});
}

Future import_jm_zip(String path) {
print(path);
return _invoke("import_jm_zip", path);
Expand Down Expand Up @@ -377,6 +393,14 @@ class Methods {
Future<String> iosGetDocumentDir() async {
return await _channel.invokeMethod("iosGetDocumentDir");
}

Future<String> getDownloadAndExportTo() async {
return await _invoke("get_download_and_export_to", "");
}

Future setDownloadAndExportTo(String path) async {
return await _invoke("set_download_and_export_to", path);
}
}

class _Response {
Expand Down
4 changes: 4 additions & 0 deletions lib/configs/configs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import 'package:jasmine/configs/web_dav_url.dart';
import 'package:jasmine/configs/web_dav_username.dart';

import 'auto_clean.dart';
import 'download_and_export_to.dart';
import 'export_rename.dart';
import 'is_pro.dart';
import 'network_api_host.dart';
import 'network_cdn_host.dart';
Expand Down Expand Up @@ -51,5 +53,7 @@ Future initConfigs() async {
await initWebDavUserName();
await initWebDavPassword();
await initVolumeKeyControl();
await initDownloadAndExportTo();
await initExportRename();
initLogin();
}
94 changes: 94 additions & 0 deletions lib/configs/download_and_export_to.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';

import '../basic/commons.dart';
import '../basic/methods.dart';
import 'android_version.dart';
import 'is_pro.dart';

late String _currentDownloadAndExportTo;
const _propertyName = "DownloadAndExportTo";

Future<String?> initDownloadAndExportTo() async {
_currentDownloadAndExportTo = await methods.getDownloadAndExportTo();
return null;
}

String currentDownloadAndExportToName() {
return _currentDownloadAndExportTo == ""
? "未设置"
: _currentDownloadAndExportTo;
}

String get currentDownloadAndExportTo => _currentDownloadAndExportTo;

Widget downloadAndExportToSetting() {
if (!isPro) {
return SwitchListTile(
title: const Text("下载时同时导出", style: TextStyle(color: Colors.grey)),
subtitle: const Text("发电才能使用", style: TextStyle(color: Colors.grey)),
value: false,
onChanged: (_) {},
);
}
if (Platform.isIOS) {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return SwitchListTile(
title: const Text("下载时同时导出"),
subtitle: Text(_currentDownloadAndExportTo),
value: _currentDownloadAndExportTo.isNotEmpty,
onChanged: (e) async {

var root =
e ? ((await methods.iosGetDocumentDir()) + "/exports") : "";
await methods.setDownloadAndExportTo(root);
_currentDownloadAndExportTo = root;
setState(() {});
},
);
},
);
}
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text("下载的同时导出到某个目录(填完整路径)"),
subtitle: Text(currentDownloadAndExportToName()),
onTap: () async {
var result = await chooseListDialog(context,
values: ["选择新位置", "清除设置"], title: "下载的时候同时导出");
if (result != null) {
if ("选择新位置" == result) {
if (Platform.isAndroid) {
if (androidVersion >= 30) {
if (!(await Permission.manageExternalStorage.request())
.isGranted) {
throw Exception("申请权限被拒绝");
}
} else {
if (!(await Permission.storage.request()).isGranted) {
throw Exception("申请权限被拒绝");
}
}
}
String? root = await chooseFolder(context);
if (root != null) {
await methods.setDownloadAndExportTo(root);
_currentDownloadAndExportTo = root;
setState(() {});
}
} else if ("清除设置" == result) {
const root = "";
await methods.setDownloadAndExportTo(root);
_currentDownloadAndExportTo = root;
setState(() {});
}
}
},
);
},
);
}
54 changes: 54 additions & 0 deletions lib/configs/export_rename.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';

import '../basic/commons.dart';
import '../basic/methods.dart';
import 'is_pro.dart';

const _propertyName = "exportRename";
late bool _exportRename;

Future<void> initExportRename() async {
_exportRename = (await methods.loadProperty(_propertyName)) == "true";
}

bool currentExportRename() {
return _exportRename;
}

Future<void> _chooseExportRename(BuildContext context) async {
String? result = await chooseListDialog<String>(context,
title: "导出的时候重新命名", values: ["是", "否"]);
if (result != null) {
var target = result == "是";
await methods.saveProperty(_propertyName, "$target");
_exportRename = target;
}
}

Widget exportRenameSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: Text(
"导出的时候重新命名",
style: TextStyle(
color: !isPro ? Colors.grey : null,
),
),
subtitle: Text(
_exportRename ? "是" : "否",
style: TextStyle(
color: !isPro ? Colors.grey : null,
),
),
onTap: () async {
if (!isPro) {
return;
}
await _chooseExportRename(context);
setState(() {});
},
);
},
);
}
Loading

0 comments on commit 7ddb05c

Please sign in to comment.