Skip to content

Commit e26ac81

Browse files
committed
1 parent 4223075 commit e26ac81

File tree

8 files changed

+40
-87
lines changed

8 files changed

+40
-87
lines changed

.github/workflows/Build.yml

-6
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ jobs:
196196
cd native/jmbackend/platforms/android
197197
cargo ndk -o ../../../../android/app/src/main/jniLibs -t arm64-v8a build --release
198198
cd ../../../..
199-
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm64.tgz
200-
tar zxvf pdfium-android-arm64.tgz --strip-components=1 -C android/app/src/main/jniLibs/arm64-v8a lib/libpdfium.so
201199
flutter build apk --target-platform android-arm64
202200
203201
- name: Install rust target and build (Android-arm32)
@@ -208,8 +206,6 @@ jobs:
208206
cd native/jmbackend/platforms/android
209207
cargo ndk -o ../../../../android/app/src/main/jniLibs -t armeabi-v7a build --release
210208
cd ../../../..
211-
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm.tgz
212-
tar zxvf pdfium-android-arm.tgz --strip-components=1 -C android/app/src/main/jniLibs/armeabi-v7a lib/libpdfium.so
213209
flutter build apk --target-platform android-arm
214210
215211
- name: Install rust target and build (Android-x86_64)
@@ -220,8 +216,6 @@ jobs:
220216
cd native/jmbackend/platforms/android
221217
cargo ndk -o ../../../../android/app/src/main/jniLibs -t x86_64 build --release
222218
cd ../../../..
223-
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-x64.tgz
224-
tar zxvf pdfium-android-x64.tgz --strip-components=1 -C android/app/src/main/jniLibs/x86_64 lib/libpdfium.so
225219
flutter build apk --target-platform android-x64
226220
227221
- name: Install dependencies and build (Linux)

.github/workflows/Release.yml

-13
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,13 @@ jobs:
215215
zip -r -9 nosign.ipa Payload
216216
cd ..
217217
218-
219-
220-
# wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6913/pdfium-ios-device-arm64.tgz
221-
# tar zxvf pdfium-ios-device-arm64.tgz --strip-components=1 -C ios/Runner lib/libpdfium.dylib
222218

223219
# if ios-sim
224220
# cargo build --manifest-path native/jmbackend/platforms/ios-sim/Cargo.toml --features= --lib --release --target=aarch64-apple-ios-sim
225221
# cargo build --manifest-path native/jmbackend/platforms/ios-sim/Cargo.toml --features= --lib --release --target=x86_64-apple-ios
226222
# lipo -create -output ios/librust.a native/jmbackend/platforms/ios-sim/target/x86_64-apple-ios/release/librust.a native/jmbackend/platforms/ios-sim/target/aarch64-apple-ios-sim/release/librust.a
227223
# cbindgen native/jmbackend/src/lib.rs -l c > ios/rust.h
228224

229-
# pdfium-ios-simulator-arm64.tgz https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6913/pdfium-ios-simulator-arm64.tgz
230-
# pdfium-ios-simulator-x64.tgz
231-
232225

233226
- name: Install rust target and build (Android-arm64)
234227
if: steps.check_asset.outputs.skip_build != 'true' && ( matrix.config.target == 'android-arm64')
@@ -238,8 +231,6 @@ jobs:
238231
cd native/jmbackend/platforms/android
239232
cargo ndk -o ../../../../android/app/src/main/jniLibs -t arm64-v8a build --release
240233
cd ../../../..
241-
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm64.tgz
242-
tar zxvf pdfium-android-arm64.tgz --strip-components=1 -C android/app/src/main/jniLibs/arm64-v8a lib/libpdfium.so
243234
flutter build apk --target-platform android-arm64
244235
245236
- name: Install rust target and build (Android-arm32)
@@ -250,8 +241,6 @@ jobs:
250241
cd native/jmbackend/platforms/android
251242
cargo ndk -o ../../../../android/app/src/main/jniLibs -t armeabi-v7a build --release
252243
cd ../../../..
253-
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm.tgz
254-
tar zxvf pdfium-android-arm.tgz --strip-components=1 -C android/app/src/main/jniLibs/armeabi-v7a lib/libpdfium.so
255244
flutter build apk --target-platform android-arm
256245
257246
- name: Install rust target and build (Android-x86_64)
@@ -262,8 +251,6 @@ jobs:
262251
cd native/jmbackend/platforms/android
263252
cargo ndk -o ../../../../android/app/src/main/jniLibs -t x86_64 build --release
264253
cd ../../../..
265-
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-x64.tgz
266-
tar zxvf pdfium-android-x64.tgz --strip-components=1 -C android/app/src/main/jniLibs/x86_64 lib/libpdfium.so
267254
flutter build apk --target-platform android-x64
268255
269256
- name: Install dependencies and build (Linux)

ci/version.code.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.6.10
1+
v1.7.1

ci/version.info.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v1.7.1
2+
3+
- [x] ✨ 导出PDF
4+
- [x] ♻️ macOS 导出优化
5+
16
v1.6.10
27

38
- [x] ✨ 分流修复
@@ -8,10 +13,6 @@ v1.6.9
813
- [x] ♻️ 相册阅读器添加缓存
914
- [x] ✨ 查看登录错误信息
1015

11-
v1.6.8
12-
13-
- [x] ✨ 分流修复 (默认,分流1,分流2)
14-
1516
v1.6.7
1617

1718
- [x] ✨ 对分类进行排序(设置项)

lib/basic/methods.dart

-11
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,6 @@ class Methods {
387387
});
388388
}
389389

390-
Future check_binding() {
391-
return _invoke("check_binding", "");
392-
}
393-
394390
Future import_jm_zip(String path) {
395391
print(path);
396392
return _invoke("import_jm_zip", path);
@@ -510,13 +506,6 @@ class Methods {
510506
return await _channel.invokeMethod("verifyAuthentication");
511507
}
512508

513-
Future<String> checkLibpdfium() async {
514-
return await _invoke("check_libpdfium", "");
515-
}
516-
517-
Future<String> downloadLibpdfium() async {
518-
return await _invoke("download_libpdfium", "");
519-
}
520509
}
521510

522511
class _Response {

lib/configs/export_path.dart

+17-12
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,15 @@ Widget displayExportPathInfo() {
5757
);
5858
}
5959
return Column(children: [
60-
ListTile(
61-
onTap: () async {
62-
String? choose = await chooseFolder(context);
63-
if (choose != null) {
64-
_setExportPath(choose);
65-
}
66-
setState(() {});
67-
},
68-
title: const Text("导出路径 (点击可修改)"),
69-
subtitle: Text(_currentExportPath),
70-
),
60+
if (!Platform.isMacOS)
61+
ListTile(
62+
onTap: () async {
63+
await chooseEx(context);
64+
setState(() {});
65+
},
66+
title: const Text("导出路径 (点击可修改)"),
67+
subtitle: Text(_currentExportPath),
68+
),
7169
...Platform.isAndroid
7270
? [
7371
Container(height: 15),
@@ -93,7 +91,7 @@ Future<String> attachExportPath() async {
9391
if (Platform.isIOS) {
9492
path = await methods.iosGetDocumentDir();
9593
} else {
96-
if(!await androidMangeStorageRequest()) {
94+
if (!await androidMangeStorageRequest()) {
9795
throw Exception("申请权限被拒绝");
9896
}
9997
path = _currentExportPath;
@@ -105,3 +103,10 @@ Future<String> attachExportPath() async {
105103
}
106104
return path;
107105
}
106+
107+
Future chooseEx(BuildContext context) async {
108+
String? choose = await chooseFolder(context);
109+
if (choose != null) {
110+
await _setExportPath(choose);
111+
}
112+
}

lib/screens/downloads_exporting_screen.dart

+16-39
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
104104
"分别导出CBZS.ZIP" + (!isPro ? "\n(发电后使用)" : ""),
105105
),
106106
Container(height: 20),
107-
if (Platform.isAndroid) ...[
107+
if (true) ...[
108108
_buildButtonInner(
109109
_exportPdf,
110110
"分别导Pdf" + (!isPro ? "\n(发电后使用)" : ""),
@@ -142,6 +142,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
142142
defaultToast(context, "请先发电鸭");
143143
return;
144144
}
145+
if (Platform.isMacOS) {
146+
await chooseEx(context);
147+
}
145148
if (!await confirmDialog(
146149
context, "导出确认", "将您所选的漫画分别导出JMI${showExportPath()}")) {
147150
return;
@@ -184,44 +187,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
184187
defaultToast(context, "请先发电鸭");
185188
return;
186189
}
187-
// if (Platform.isAndroid) {
188-
// } else {
189-
// // check pdf lib
190-
// if (await methods.checkLibpdfium() == "") {
191-
// var down = await confirmDialog(context, "需要下载PDF支持插件", "是否下载PDF支持插件?");
192-
// if (down) {
193-
// exportMessage = "正在下载PDF支持插件";
194-
// setState(() {
195-
// exporting = true;
196-
// });
197-
// try {
198-
// await methods.downloadLibpdfium();
199-
// defaultToast(context, "PDF支持插件下载成功, 请重试");
200-
// } catch (e, s) {
201-
// defaultToast(context, "PDF支持插件下载失败");
202-
// } finally {
203-
// setState(() {
204-
// exporting = false;
205-
// });
206-
// }
207-
// }
208-
// return;
209-
// }
210-
// try {
211-
// await methods.check_binding();
212-
// } catch (e, s) {
213-
// var msg = "$e";
214-
// // 300字输出一行
215-
// var idx = 0;
216-
// while (idx < msg.length) {
217-
// var out = msg.substring(idx, min(idx + 300, msg.length)) + "\n";
218-
// print(out);
219-
// idx += 300;
220-
// }
221-
// defaultToast(context, "pdf loading error $e");
222-
// return;
223-
// }
224-
// }
190+
if (Platform.isMacOS) {
191+
await chooseEx(context);
192+
}
225193
if (!await confirmDialog(
226194
context, "导出确认", "将您所选的漫画分别导出PDF${showExportPath()}")) {
227195
return;
@@ -258,6 +226,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
258226
defaultToast(context, "请先发电鸭");
259227
return;
260228
}
229+
if (Platform.isMacOS) {
230+
await chooseEx(context);
231+
}
261232
if (!await confirmDialog(
262233
context, "导出确认", "将您所选的漫画分别导出cbzs.zip${showExportPath()}")) {
263234
return;
@@ -300,6 +271,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
300271
defaultToast(context, "请先发电鸭");
301272
return;
302273
}
274+
if (Platform.isMacOS) {
275+
await chooseEx(context);
276+
}
303277
if (!await confirmDialog(
304278
context, "导出确认", "将您所选的漫画分别导出ZIP${showExportPath()}")) {
305279
return;
@@ -342,6 +316,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
342316
defaultToast(context, "请先发电鸭");
343317
return;
344318
}
319+
if (Platform.isMacOS) {
320+
await chooseEx(context);
321+
}
345322
if (!await confirmDialog(
346323
context, "导出确认", "将您所选的漫画分别导出JPEGS.ZIP${showExportPath()}")) {
347324
return;

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: jasmine comic browser
33

44
publish_to: 'none'
55

6-
version: 1.7.0+30
6+
version: 1.7.1+31
77

88
environment:
99
sdk: ">=2.15.1 <3.0.0"

0 commit comments

Comments
 (0)