Skip to content

Commit

Permalink
🚀 Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Jun 20, 2023
1 parent e2ff23f commit 3b919e7
Show file tree
Hide file tree
Showing 23 changed files with 409 additions and 143 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,34 @@ jobs:
flutter_version: '2.10.3'
- target: ios
host: macos-latest
flutter_version: '3.7.3'
flutter_version: '3.10.5'
- target: ios
host: macos-latest
flutter_version: '2.10.5'
- target: android-arm32
host: ubuntu-20.04
flutter_version: '2.10.5'
jdk_version: '8'
- target: android-arm64
host: ubuntu-20.04
flutter_version: '2.10.5'
jdk_version: '8'
- target: android-x86_64
host: ubuntu-20.04
flutter_version: '2.10.5'
jdk_version: '8'
- target: android-arm32
host: ubuntu-20.04
flutter_version: '3.7.3'
flutter_version: '3.10.5'
jdk_version: '17'
- target: android-arm64
host: ubuntu-20.04
flutter_version: '3.7.3'
flutter_version: '3.10.5'
jdk_version: '17'
- target: android-x86_64
host: ubuntu-20.04
flutter_version: '3.7.3'
flutter_version: '3.10.5'
jdk_version: '17'

runs-on: ${{ matrix.config.host }}

Expand Down Expand Up @@ -200,7 +206,7 @@ jobs:
if: steps.check_asset.outputs.skip_build != 'true' && ( matrix.config.target == 'android-arm32' || matrix.config.target == 'android-arm64' || matrix.config.target == 'android-x86_64' )
uses: actions/setup-java@v3
with:
java-version: 8
java-version: ${{ matrix.config.jdk_version }}
distribution: 'zulu'

- name: Setup android tools (Android)
Expand Down Expand Up @@ -240,19 +246,21 @@ jobs:
go install github.com/go-flutter-desktop/hover@latest
- name: Upgrade deps version (Android)
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.host != 'macos-latest' && startsWith(matrix.config.flutter_version, '3')
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.host != 'macos-latest' && startsWith(matrix.config.flutter_version, '2')
run: |
sed -i "s/another_xlider: 1.0.1+2/another_xlider: ^1.0.1+2/g" pubspec.yaml
sed -i "s/flutter_styled_toast: 2.0.0/flutter_styled_toast: ^2.0.0/g" pubspec.yaml
sed -i "s/modal_bottom_sheet: 2.0.1/modal_bottom_sheet: ^3.0.0-pre/g" pubspec.yaml
sed -i "s/another_xlider: ^1.0.1+2/another_xlider: 1.0.1+2/g" pubspec.yaml
sed -i "s/flutter_styled_toast: ^2.0.0/flutter_styled_toast: 2.0.0/g" pubspec.yaml
sed -i "s/modal_bottom_sheet: ^3.0.0-pre/modal_bottom_sheet: 2.0.1/g" pubspec.yaml
sed -i "s/photo_view: ^0.14.0/photo_view: 0.13.0/g" pubspec.yaml
- name: Upgrade deps version (iOS)
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.host == 'macos-latest' && startsWith(matrix.config.flutter_version, '3')
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.host == 'macos-latest' && startsWith(matrix.config.flutter_version, '2')
run: |
brew install gnu-sed
gsed -i "s/another_xlider: 1.0.1+2/another_xlider: ^1.0.1+2/g" pubspec.yaml
gsed -i "s/flutter_styled_toast: 2.0.0/flutter_styled_toast: ^2.0.0/g" pubspec.yaml
gsed -i "s/modal_bottom_sheet: 2.0.1/modal_bottom_sheet: ^3.0.0-pre/g" pubspec.yaml
gsed -i "s/another_xlider: ^1.0.1+2/another_xlider: 1.0.1+2/g" pubspec.yaml
gsed -i "s/flutter_styled_toast: ^2.0.0/flutter_styled_toast: 2.0.0/g" pubspec.yaml
gsed -i "s/modal_bottom_sheet: ^3.0.0-pre/modal_bottom_sheet: 2.0.1/g" pubspec.yaml
gsed -i "s/photo_view: ^0.14.0/photo_view: 0.13.0/g" pubspec.yaml
- name: Install go mobile (mobile)
if: steps.check_asset.outputs.skip_build != 'true' && ( matrix.config.target == 'ios' || matrix.config.target == 'android-arm64' || matrix.config.target == 'android-arm32' || matrix.config.target == 'android-x86_64' )
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ wax
[![downloads](https://img.shields.io/github/downloads/niuhuan/wax/total)](https://github.com/niuhuan/wax/releases)

- 美观易用且无广告的漫画客户端, 能运行在Windows/MacOS/Linux/Android/IOS中。
- 此APP只是个客户端,不包含任何内容。需要您自行寻找漫画源使用。
- 部分漫画源内容存在限制级别内容(例如 露骨/血腥/暴力/吸毒),18岁以下的用户需在监护人陪同下使用,并请您在遵守当地法律法规。
- 您的star是对开发者的莫大鼓励,源仓库地址 [https://github.com/niuhuan/wax](https://github.com/niuhuan/wax)
- 此APP内容存在限制级别内容(例如 露骨/血腥/暴力/吸毒),18岁以下的用户需在监护人陪同下使用,并请您在遵守当地法律法规。
- 您的star和issue是对开发者的莫大鼓励, 可以源仓库下载最新的源码/安装包, 表示支持/提出建议。
- 源仓库地址 [https://github.com/niuhuan/wax](https://github.com/niuhuan/wax)



## 技术架构

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.13
v1.2.1
10 changes: 8 additions & 2 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
v1.1.13
- [x] 🚀FF
v1.2.1
- [x] 🚀修复分流
- [x] 🚀修复登录动画
- [x] 🚀请重新注册以前一样的用户名

计划
- [ ] 🚀代理设置
- [ ] 🚀导出
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- Flutter (1.0.0)
- permission_handler_apple (9.0.4):
- permission_handler_apple (9.1.0):
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
Expand All @@ -20,7 +20,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
permission_handler_apple: 8f116445eff3c0e7c65ad60f5fef5490aa94b4e4
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
Expand Down
1 change: 1 addition & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down
22 changes: 11 additions & 11 deletions lib/basic/methods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ class Methods {
));
}

Future<IsPro> reloadPro() async {
return IsPro.fromBuffer(await _flatInvoke(
"reloadPro",
Empty(),
));
}

Future inputCdKey(String k) {
return _flatInvoke("inputCdKey", Puff(value: k));
}

Future saveViewInfo(ComicInfoResult info) async {
// todo
}
Expand Down Expand Up @@ -338,15 +349,4 @@ class Methods {
),
);
}

Future setIsPro(
bool isPro,
) async {
return _flatInvoke(
"setIsPro",
SetIsPro(
isPro: isPro,
),
);
}
}
39 changes: 31 additions & 8 deletions lib/configs/host.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,24 @@ import 'package:flutter/material.dart';
import 'package:wax/basic/commons.dart';
import 'package:wax/basic/methods.dart';

const _defaultHost = "https://www.wnacg.com";
const _hostMap = {
"https://www.wnacg.com": "MAIN",
"https://www.htmanga9.top": "TOP9",
};

late String host;
final hostEvent = Event();

Future initHost() async {
if (await methods.loadProperty(k: "fc_host") == "") {
await methods.saveProperty(k: "fc_host", v: "true");
await methods.saveProperty(k: "host", v: _defaultHost);
}
host = await methods.loadProperty(k: "host");
if (host == "") {
host = _defaultHost;
}
}

Future _updateHost(String choose) async {
Expand All @@ -16,15 +29,25 @@ Future _updateHost(String choose) async {
hostEvent.broadcast();
}

currentHost() {
return _hostMap[host] ?? "自定义";
}

Future chooseHost(BuildContext context) async {
var choose = await displayTextInputDialog(context, src: host);
if (choose != null) {
// 正则判断是否未网站uri
if (!RegExp(r"^https://[A-Za-z0-9\-_]+(\.[A-Za-z0-9\-_]+)+$").hasMatch(choose)) {
defaultToast(context, "请输入正确的网站地址, 必须以https开头, 结尾不能添加斜线。例如 https://aa.bb.cc");
return;
var choose =
await chooseListDialog(context, values: ["选择预设", "手动输入"], title: '分流');
if ("选择预设" == choose) {
choose = await chooseMapDialog(context,
title: "分流",
values: _hostMap.map((key, value) => MapEntry(value, key)));
if (choose != null) {
await _updateHost(choose);
}
} else if ("手动输入" == choose) {
choose = await displayTextInputDialog(context, src: host);
if (choose != null) {
await _updateHost(choose);
}
await _updateHost(choose);
}
}

Expand All @@ -33,7 +56,7 @@ Widget hostSetting() {
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text("分流"),
subtitle: Text(host),
subtitle: Text("${_hostMap[host]} (登录注册不上试试换分流或改变网络)"),
onTap: () async {
await chooseHost(context);
setState(() {});
Expand Down
Loading

0 comments on commit 3b919e7

Please sign in to comment.