Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Dec 26, 2024
1 parent 4223075 commit e26ac81
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 87 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ jobs:
cd native/jmbackend/platforms/android
cargo ndk -o ../../../../android/app/src/main/jniLibs -t arm64-v8a build --release
cd ../../../..
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm64.tgz
tar zxvf pdfium-android-arm64.tgz --strip-components=1 -C android/app/src/main/jniLibs/arm64-v8a lib/libpdfium.so
flutter build apk --target-platform android-arm64
- name: Install rust target and build (Android-arm32)
Expand All @@ -208,8 +206,6 @@ jobs:
cd native/jmbackend/platforms/android
cargo ndk -o ../../../../android/app/src/main/jniLibs -t armeabi-v7a build --release
cd ../../../..
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm.tgz
tar zxvf pdfium-android-arm.tgz --strip-components=1 -C android/app/src/main/jniLibs/armeabi-v7a lib/libpdfium.so
flutter build apk --target-platform android-arm
- name: Install rust target and build (Android-x86_64)
Expand All @@ -220,8 +216,6 @@ jobs:
cd native/jmbackend/platforms/android
cargo ndk -o ../../../../android/app/src/main/jniLibs -t x86_64 build --release
cd ../../../..
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-x64.tgz
tar zxvf pdfium-android-x64.tgz --strip-components=1 -C android/app/src/main/jniLibs/x86_64 lib/libpdfium.so
flutter build apk --target-platform android-x64
- name: Install dependencies and build (Linux)
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,13 @@ jobs:
zip -r -9 nosign.ipa Payload
cd ..


# wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6913/pdfium-ios-device-arm64.tgz
# tar zxvf pdfium-ios-device-arm64.tgz --strip-components=1 -C ios/Runner lib/libpdfium.dylib

# if ios-sim
# cargo build --manifest-path native/jmbackend/platforms/ios-sim/Cargo.toml --features= --lib --release --target=aarch64-apple-ios-sim
# cargo build --manifest-path native/jmbackend/platforms/ios-sim/Cargo.toml --features= --lib --release --target=x86_64-apple-ios
# 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
# cbindgen native/jmbackend/src/lib.rs -l c > ios/rust.h

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


- name: Install rust target and build (Android-arm64)
if: steps.check_asset.outputs.skip_build != 'true' && ( matrix.config.target == 'android-arm64')
Expand All @@ -238,8 +231,6 @@ jobs:
cd native/jmbackend/platforms/android
cargo ndk -o ../../../../android/app/src/main/jniLibs -t arm64-v8a build --release
cd ../../../..
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm64.tgz
tar zxvf pdfium-android-arm64.tgz --strip-components=1 -C android/app/src/main/jniLibs/arm64-v8a lib/libpdfium.so
flutter build apk --target-platform android-arm64
- name: Install rust target and build (Android-arm32)
Expand All @@ -250,8 +241,6 @@ jobs:
cd native/jmbackend/platforms/android
cargo ndk -o ../../../../android/app/src/main/jniLibs -t armeabi-v7a build --release
cd ../../../..
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-arm.tgz
tar zxvf pdfium-android-arm.tgz --strip-components=1 -C android/app/src/main/jniLibs/armeabi-v7a lib/libpdfium.so
flutter build apk --target-platform android-arm
- name: Install rust target and build (Android-x86_64)
Expand All @@ -262,8 +251,6 @@ jobs:
cd native/jmbackend/platforms/android
cargo ndk -o ../../../../android/app/src/main/jniLibs -t x86_64 build --release
cd ../../../..
wget https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6899/pdfium-android-x64.tgz
tar zxvf pdfium-android-x64.tgz --strip-components=1 -C android/app/src/main/jniLibs/x86_64 lib/libpdfium.so
flutter build apk --target-platform android-x64
- name: Install dependencies and build (Linux)
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.6.10
v1.7.1
9 changes: 5 additions & 4 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v1.7.1

- [x] ✨ 导出PDF
- [x] ♻️ macOS 导出优化

v1.6.10

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

v1.6.8

- [x] ✨ 分流修复 (默认,分流1,分流2)

v1.6.7

- [x] ✨ 对分类进行排序(设置项)
Expand Down
11 changes: 0 additions & 11 deletions lib/basic/methods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ class Methods {
});
}

Future check_binding() {
return _invoke("check_binding", "");
}

Future import_jm_zip(String path) {
print(path);
return _invoke("import_jm_zip", path);
Expand Down Expand Up @@ -510,13 +506,6 @@ class Methods {
return await _channel.invokeMethod("verifyAuthentication");
}

Future<String> checkLibpdfium() async {
return await _invoke("check_libpdfium", "");
}

Future<String> downloadLibpdfium() async {
return await _invoke("download_libpdfium", "");
}
}

class _Response {
Expand Down
29 changes: 17 additions & 12 deletions lib/configs/export_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,15 @@ Widget displayExportPathInfo() {
);
}
return Column(children: [
ListTile(
onTap: () async {
String? choose = await chooseFolder(context);
if (choose != null) {
_setExportPath(choose);
}
setState(() {});
},
title: const Text("导出路径 (点击可修改)"),
subtitle: Text(_currentExportPath),
),
if (!Platform.isMacOS)
ListTile(
onTap: () async {
await chooseEx(context);
setState(() {});
},
title: const Text("导出路径 (点击可修改)"),
subtitle: Text(_currentExportPath),
),
...Platform.isAndroid
? [
Container(height: 15),
Expand All @@ -93,7 +91,7 @@ Future<String> attachExportPath() async {
if (Platform.isIOS) {
path = await methods.iosGetDocumentDir();
} else {
if(!await androidMangeStorageRequest()) {
if (!await androidMangeStorageRequest()) {
throw Exception("申请权限被拒绝");
}
path = _currentExportPath;
Expand All @@ -105,3 +103,10 @@ Future<String> attachExportPath() async {
}
return path;
}

Future chooseEx(BuildContext context) async {
String? choose = await chooseFolder(context);
if (choose != null) {
await _setExportPath(choose);
}
}
55 changes: 16 additions & 39 deletions lib/screens/downloads_exporting_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
"分别导出CBZS.ZIP" + (!isPro ? "\n(发电后使用)" : ""),
),
Container(height: 20),
if (Platform.isAndroid) ...[
if (true) ...[
_buildButtonInner(
_exportPdf,
"分别导Pdf" + (!isPro ? "\n(发电后使用)" : ""),
Expand Down Expand Up @@ -142,6 +142,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
defaultToast(context, "请先发电鸭");
return;
}
if (Platform.isMacOS) {
await chooseEx(context);
}
if (!await confirmDialog(
context, "导出确认", "将您所选的漫画分别导出JMI${showExportPath()}")) {
return;
Expand Down Expand Up @@ -184,44 +187,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
defaultToast(context, "请先发电鸭");
return;
}
// if (Platform.isAndroid) {
// } else {
// // check pdf lib
// if (await methods.checkLibpdfium() == "") {
// var down = await confirmDialog(context, "需要下载PDF支持插件", "是否下载PDF支持插件?");
// if (down) {
// exportMessage = "正在下载PDF支持插件";
// setState(() {
// exporting = true;
// });
// try {
// await methods.downloadLibpdfium();
// defaultToast(context, "PDF支持插件下载成功, 请重试");
// } catch (e, s) {
// defaultToast(context, "PDF支持插件下载失败");
// } finally {
// setState(() {
// exporting = false;
// });
// }
// }
// return;
// }
// try {
// await methods.check_binding();
// } catch (e, s) {
// var msg = "$e";
// // 300字输出一行
// var idx = 0;
// while (idx < msg.length) {
// var out = msg.substring(idx, min(idx + 300, msg.length)) + "\n";
// print(out);
// idx += 300;
// }
// defaultToast(context, "pdf loading error $e");
// return;
// }
// }
if (Platform.isMacOS) {
await chooseEx(context);
}
if (!await confirmDialog(
context, "导出确认", "将您所选的漫画分别导出PDF${showExportPath()}")) {
return;
Expand Down Expand Up @@ -258,6 +226,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
defaultToast(context, "请先发电鸭");
return;
}
if (Platform.isMacOS) {
await chooseEx(context);
}
if (!await confirmDialog(
context, "导出确认", "将您所选的漫画分别导出cbzs.zip${showExportPath()}")) {
return;
Expand Down Expand Up @@ -300,6 +271,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
defaultToast(context, "请先发电鸭");
return;
}
if (Platform.isMacOS) {
await chooseEx(context);
}
if (!await confirmDialog(
context, "导出确认", "将您所选的漫画分别导出ZIP${showExportPath()}")) {
return;
Expand Down Expand Up @@ -342,6 +316,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
defaultToast(context, "请先发电鸭");
return;
}
if (Platform.isMacOS) {
await chooseEx(context);
}
if (!await confirmDialog(
context, "导出确认", "将您所选的漫画分别导出JPEGS.ZIP${showExportPath()}")) {
return;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: jasmine comic browser

publish_to: 'none'

version: 1.7.0+30
version: 1.7.1+31

environment:
sdk: ">=2.15.1 <3.0.0"
Expand Down

0 comments on commit e26ac81

Please sign in to comment.