From d0d037d7d44beea420596e370a75e3dd9a8de93a Mon Sep 17 00:00:00 2001 From: niuhuan Date: Fri, 25 Feb 2022 19:20:53 +0800 Subject: [PATCH] modify version pattern --- README.md | 5 +++-- lib/basic/config/Version.dart | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 03b1dfa..09d2ef0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ VPN->代理->分流, 这三个功能如果同时设置, 您会在您手机的VPN - [x] 用户 - [x] 登录 / 注册 / 获取个人信息 / 自动打卡 + - [x] 修改密码 / 修改签名 / 修改头像 - [x] 漫画 - [x] 分类 / 搜索 / 随机本子 / 看此本子的也在看 / 排行榜 - [x] 在分类中搜索 / 按 "分类 / 标签 / 创建人 / 汉化组" 检索 @@ -76,7 +77,7 @@ VPN->代理->分流, 这三个功能如果同时设置, 您会在您手机的VPN ### 开发环境准备 - [golang](https://golang.org/) (1.16以上版本) -- [flutter](https://flutter.dev/) (stable-2.10.1) +- [flutter](https://flutter.dev/) (stable-2.10.2) ### 环境配置 @@ -151,7 +152,7 @@ VPN->代理->分流, 这三个功能如果同时设置, 您会在您手机的VPN ```shell go install golang.org/x/mobile/cmd/gomobile@latest ``` -- 先编译golang库, 再打包flutter +- 先编译golang库, 再打包flutter ```shell # android diff --git a/lib/basic/config/Version.dart b/lib/basic/config/Version.dart index 44ffb00..4ce88f8 100644 --- a/lib/basic/config/Version.dart +++ b/lib/basic/config/Version.dart @@ -10,7 +10,6 @@ import '../Method.dart'; const _versionUrl = "https://api.github.com/repos/niuhuan/pikapika/releases/latest"; const _versionAssets = 'lib/assets/version.txt'; -RegExp _versionExp = RegExp(r"^v\d+\.\d+.\d+$"); late String _version; String? _latestVersion; @@ -69,12 +68,12 @@ Future manualCheckNewVersion(BuildContext context) async { } bool dirtyVersion() { - return !_versionExp.hasMatch(_version); + return "dirty" == _version; } // maybe exception Future _versionCheck() async { - if (_versionExp.hasMatch(_version)) { + if (!dirtyVersion()) { // 检查更新只能使用defaultHttpClient, 而不能使用pika的client, 否则会 "tls handshake failure" var json = jsonDecode(await method.defaultHttpClientGet(_versionUrl)); if (json["name"] != null) {