From 24ba2c5da0ff5d1c8232d202f602ba065ac4d082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=9C=88=E6=AE=8B=E7=83=9B?= <61369261+fengyuecanzhu@users.noreply.github.com> Date: Wed, 4 May 2022 08:48:18 +0800 Subject: [PATCH 01/15] add getKey function to CookieStore --- .../xyz/fycz/myreader/greendao/service/CookieStore.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt b/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt index 84e917a..82f5cdf 100644 --- a/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt +++ b/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt @@ -53,6 +53,12 @@ object CookieStore : CookieManager { return cookieBean?.cookie ?: "" } + fun getKey(url: String, key: String): String { + val cookie = getCookie(url) + val cookieMap = cookieToMap(cookie) + return cookieMap[key] ?: "" + } + override fun removeCookie(url: String) { DbManager.getDaoSession().cookieBeanDao.deleteByKey(NetworkUtils.getSubDomain(url)) } @@ -93,4 +99,4 @@ object CookieStore : CookieManager { } return builder.deleteCharAt(builder.lastIndexOf(";")).toString() } -} \ No newline at end of file +} From 6df2b8910f63de356aee5c87ce1d4cb3ad2d480e Mon Sep 17 00:00:00 2001 From: fengyue Date: Wed, 4 May 2022 09:14:21 +0800 Subject: [PATCH 02/15] change build type --- .github/workflows/reader.yml | 16 +++++++++------- app/version_code.properties | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index d204b4d..82e7efb 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -31,13 +31,15 @@ jobs: one=$(expr ${version} % 10) versionN=v$hun.$ten.$one - echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE" + echo ::set-output name=create_release::"$CREATE_RELEASE" + echo ::set-output name=build_release::"$BUILD_RELEASE" echo ::set-output name=version_name::"$versionN" - echo need_create_release=$NEED_CREATE_RELEASE + echo create_release=$CREATE_RELEASE + echo build_release=$BUILD_RELEASE echo version_name=$versionN - if [[ $NEED_CREATE_RELEASE == 'true' ]];then + if [[ $CREATE_RELEASE == 'true' ]];then echo ::set-output name=lanzou_folder_id::"1608604" echo ::set-output name=lanzou_share_url::"https://fycz.lanzoui.com/b00ngso7e" else @@ -49,7 +51,7 @@ jobs: run: | echo "开始编译打包" chmod +x gradlew - if [[ ${{ steps.config.outputs.need_create_release }} == 'true' ]];then + if [[ ${{ steps.config.outputs.create_release }} == 'true' ] -o [ ${{ steps.config.outputs.build_release }} == 'true' ]];then echo "进行release构建" ./gradlew assembleRelease --parallel else @@ -60,7 +62,7 @@ jobs: id: get_path run: | path="$GITHUB_WORKSPACE/app/build/outputs/apk/release" - if [[ ${{ steps.config.outputs.need_create_release }} != 'true' ]];then + if [[ ${{ steps.config.outputs.create_release }} != 'true' ] -a [ ${{ steps.config.outputs.build_release }} != 'true' ]];then path="$GITHUB_WORKSPACE/app/build/outputs/apk/debug" fi files=$(ls $path) @@ -86,7 +88,7 @@ jobs: echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: ${{ steps.config.outputs.lanzou_share_url }}" - name: Create Release id: create_release - if: ${{ steps.config.outputs.need_create_release == 'true' }} + if: ${{ steps.config.outputs.create_release == 'true' }} uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -98,7 +100,7 @@ jobs: draft: false - name: Upload Release Asset id: upload_release_asset - if: ${{ steps.config.outputs.need_create_release == 'true' && steps.create_release.outputs.upload_url }} + if: ${{ steps.config.outputs.create_release == 'true' && steps.create_release.outputs.upload_url }} uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/app/version_code.properties b/app/version_code.properties index 7a0a8d0..3a8dfa8 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -18,4 +18,5 @@ #Fri Jun 18 21:45:31 CST 2021 VERSION_CODE=245 -NEED_CREATE_RELEASE=false +CREATE_RELEASE=false +BUILD_RELEASE=true \ No newline at end of file From bf1fd28ad34391d7376eb00223949b108485396b Mon Sep 17 00:00:00 2001 From: fengyue Date: Wed, 4 May 2022 09:22:56 +0800 Subject: [PATCH 03/15] fix syntax --- .github/workflows/reader.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index 82e7efb..ca94e7e 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -51,7 +51,7 @@ jobs: run: | echo "开始编译打包" chmod +x gradlew - if [[ ${{ steps.config.outputs.create_release }} == 'true' ] -o [ ${{ steps.config.outputs.build_release }} == 'true' ]];then + if [ ${{ steps.config.outputs.create_release }} == 'true' -o ${{ steps.config.outputs.build_release }} == 'true' ];then echo "进行release构建" ./gradlew assembleRelease --parallel else @@ -62,7 +62,7 @@ jobs: id: get_path run: | path="$GITHUB_WORKSPACE/app/build/outputs/apk/release" - if [[ ${{ steps.config.outputs.create_release }} != 'true' ] -a [ ${{ steps.config.outputs.build_release }} != 'true' ]];then + if [ ${{ steps.config.outputs.create_release }} != 'true' -a ${{ steps.config.outputs.build_release }} != 'true' ];then path="$GITHUB_WORKSPACE/app/build/outputs/apk/debug" fi files=$(ls $path) From 509068e58987b04067578a85993b75b32724c481 Mon Sep 17 00:00:00 2001 From: fengyue Date: Wed, 4 May 2022 09:45:30 +0800 Subject: [PATCH 04/15] add backup&restore cookie feature --- .../main/java/xyz/fycz/myreader/model/storage/Backup.kt | 8 ++++++++ .../main/java/xyz/fycz/myreader/model/storage/Restore.kt | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/app/src/main/java/xyz/fycz/myreader/model/storage/Backup.kt b/app/src/main/java/xyz/fycz/myreader/model/storage/Backup.kt index 8124e9d..c4b5409 100644 --- a/app/src/main/java/xyz/fycz/myreader/model/storage/Backup.kt +++ b/app/src/main/java/xyz/fycz/myreader/model/storage/Backup.kt @@ -62,6 +62,7 @@ object Backup { "readRecord.json", "searchWord.json", "subscribe.json", + "cookie.json", "config.xml" ) } @@ -163,6 +164,13 @@ object Backup { .writeText(json) } } + DbManager.getDaoSession().cookieBeanDao.queryBuilder().list().let { + if (it.isNotEmpty()) { + val json = GSON.toJson(it) + FileUtils.getFile(backupPath + File.separator + "cookie.json") + .writeText(json) + } + } try { val setting = SysManager.getNewSetting() val readStyles = setting.readStyles diff --git a/app/src/main/java/xyz/fycz/myreader/model/storage/Restore.kt b/app/src/main/java/xyz/fycz/myreader/model/storage/Restore.kt index 2ceb814..a80265c 100644 --- a/app/src/main/java/xyz/fycz/myreader/model/storage/Restore.kt +++ b/app/src/main/java/xyz/fycz/myreader/model/storage/Restore.kt @@ -166,6 +166,15 @@ object Restore { } catch (e: Exception) { e.printStackTrace() } + try { + val file = FileUtils.getFile(path + File.separator + "cookie.json") + val json = file.readText() + GSON.fromJsonArray(json)?.let { + DbManager.getInstance().session.cookieBeanDao.insertOrReplaceInTx(it) + } + } catch (e: Exception) { + e.printStackTrace() + } try { val settingFile = FileUtils.getFile(path + File.separator + "setting.json") val settingJson = settingFile.readText() From e1ae079ab6f8b02783b63e068eef8964771be40e Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Wed, 4 May 2022 12:30:49 +0800 Subject: [PATCH 05/15] fix load book details when a book with the same name exists --- app/src/main/assets/updatelog.fy | 3 +++ .../ui/activity/BookDetailedActivity.java | 8 ++++++- gradlew | 22 +++++++++---------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index f399522..edcded0 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,6 +1,9 @@ 风月读书v2.4.5 更新内容: 1、修复书籍无法导出缓存的问题 +2、修复部分书源bug +3、修复同名书籍详情页加载bug +4、Cookie支持备份&恢复 2022.04.24 风月读书v2.4.4 diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java index 08a81a7..9572509 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java @@ -386,7 +386,13 @@ public class BookDetailedActivity extends BaseActivity. +# You should have received a copy of the GNU General Public License +# along with FYReader. If not, see . # -# Copyright (C) 2020 - 2022 fengyuecanzhu +# Copyright (C) 2020 - 2022 fengyuecanzhu # ############################################################################## From 323b1ba9f58fab66f524c8dc03ba7c4905ac544c Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Wed, 11 May 2022 09:37:09 +0800 Subject: [PATCH 06/15] fix getEnableReadCrawlers --- .../xyz/fycz/myreader/model/SearchEngine.java | 8 +- .../webapi/crawler/ReadCrawlerUtil.java | 3 + .../main/java/xyz/fycz/dynamic/AppLoadImpl.kt | 4 +- .../java/xyz/fycz/dynamic/fix/App244Fix2.kt | 77 +++++++++++++++++++ 4 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt diff --git a/app/src/main/java/xyz/fycz/myreader/model/SearchEngine.java b/app/src/main/java/xyz/fycz/myreader/model/SearchEngine.java index bec483e..a4e7230 100644 --- a/app/src/main/java/xyz/fycz/myreader/model/SearchEngine.java +++ b/app/src/main/java/xyz/fycz/myreader/model/SearchEngine.java @@ -161,8 +161,8 @@ public class SearchEngine { searchSiteIndex++; if (searchSiteIndex < mSourceList.size()) { ReadCrawler crawler = mSourceList.get(searchSiteIndex); - //BookApi.search(keyword, crawler, executorService) - BookApi.search(keyword, crawler) + BookApi.search(keyword, crawler, executorService) + //BookApi.search(keyword, crawler) .subscribeOn(scheduler) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer>() { @@ -210,8 +210,8 @@ public class SearchEngine { if (searchSiteIndex < mSourceList.size()) { ReadCrawler crawler = mSourceList.get(searchSiteIndex); String searchKey = title; - //BookApi.search(searchKey, crawler, executorService) - BookApi.search(searchKey, crawler) + BookApi.search(searchKey, crawler, executorService) + //BookApi.search(searchKey, crawler) .subscribeOn(scheduler) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer>() { diff --git a/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java index e55f646..ef81df6 100644 --- a/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java @@ -244,6 +244,9 @@ public class ReadCrawlerUtil { List sources = TextUtils.isEmpty(group) ? BookSourceManager.getEnabledBookSource() : BookSourceManager.getEnableSourceByGroup(group); + if (sources.size() == 0){ + sources = BookSourceManager.getEnabledBookSource(); + } for (BookSource source : sources) { crawlers.add(getReadCrawler(source)); } diff --git a/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt b/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt index 93ffd53..b42b82a 100644 --- a/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt +++ b/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt @@ -27,6 +27,7 @@ import me.fycz.maple.MapleUtils import me.fycz.maple.MethodHook import xyz.fycz.dynamic.fix.App243Fix import xyz.fycz.dynamic.fix.App244Fix +import xyz.fycz.dynamic.fix.App244Fix2 import xyz.fycz.dynamic.fix.AppFix import xyz.fycz.myreader.application.App import xyz.fycz.myreader.ui.activity.MainActivity @@ -45,7 +46,8 @@ class AppLoadImpl : IAppLoader { private val fixList = listOf( App243Fix::class.java, - App244Fix::class.java + App244Fix::class.java, + App244Fix2::class.java, ) override fun onLoad(appParam: AppParam) { diff --git a/dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt b/dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt new file mode 100644 index 0000000..55ec6cf --- /dev/null +++ b/dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt @@ -0,0 +1,77 @@ +/* + * This file is part of FYReader. + * FYReader is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FYReader is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FYReader. If not, see . + * + * Copyright (C) 2020 - 2022 fengyuecanzhu + */ + +package xyz.fycz.dynamic.fix + +import android.text.TextUtils +import me.fycz.maple.MapleBridge +import me.fycz.maple.MapleUtils +import me.fycz.maple.MethodReplacement +import xyz.fycz.myreader.greendao.entity.Book +import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager +import xyz.fycz.myreader.ui.adapter.BookcaseAdapter +import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil +import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler + +/** + * @author fengyue + * @date 2022/5/11 9:31 + */ +@AppFix([243, 244], ["修复搜索时当前分组不存在时无法搜索的问题"], "2022-05-11") +class App244Fix2 : AppFixHandle{ + override fun onFix(key: String): BooleanArray { + var fx = false + try { + fixGetEnableReadCrawlers() + fx = true + fixResult(key, "getEnableReadCrawlers", true) + } catch (e: Exception) { + MapleUtils.log(e) + fixResult(key, "getEnableReadCrawlers", false) + } + return booleanArrayOf(fx) + } + + private fun fixGetEnableReadCrawlers() { + MapleUtils.findAndHookMethod( + ReadCrawlerUtil::class.java, + "getEnableReadCrawlers", + String::class.java, + object : MethodReplacement() { + override fun replaceHookedMethod(param: MapleBridge.MethodHookParam): Any { + return getEnableReadCrawlers(param.args[0] as String) + } + } + ) + } + + fun getEnableReadCrawlers(group: String?): List { + val crawlers = ArrayList() + var sources = + if (group.isNullOrEmpty()) + BookSourceManager.getEnabledBookSource() + else BookSourceManager.getEnableSourceByGroup(group) + if (sources.size == 0) { + sources = BookSourceManager.getEnabledBookSource() + } + for (source in sources) { + crawlers.add(ReadCrawlerUtil.getReadCrawler(source)) + } + return crawlers + } +} \ No newline at end of file From c370f3deb1c43fb4d1798002c28b004e6115095a Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Wed, 11 May 2022 09:43:51 +0800 Subject: [PATCH 07/15] fix getEnableReadCrawlers --- app/src/test/java/Test.java | 2 +- dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/test/java/Test.java b/app/src/test/java/Test.java index 2bbaa5e..65fcd2a 100644 --- a/app/src/test/java/Test.java +++ b/app/src/test/java/Test.java @@ -135,7 +135,7 @@ public class Test { @org.junit.Test public void md5(){ - File file = new File("D:\\Java\\AndroidSdk\\build-tools\\29.0.3\\dynamic_v1.0.4.dex"); + File file = new File("D:\\Java\\AndroidSdk\\build-tools\\29.0.3\\dynamic_v1.0.5.dex"); System.out.println(MD5Utils.INSTANCE.getFileMD5s(file, 32)); } } diff --git a/dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt b/dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt index 55ec6cf..93c079d 100644 --- a/dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt +++ b/dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt @@ -18,13 +18,10 @@ package xyz.fycz.dynamic.fix -import android.text.TextUtils import me.fycz.maple.MapleBridge import me.fycz.maple.MapleUtils import me.fycz.maple.MethodReplacement -import xyz.fycz.myreader.greendao.entity.Book import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager -import xyz.fycz.myreader.ui.adapter.BookcaseAdapter import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler From cd362e0fd9be311e4b16b4cd917580d3254438fb Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Wed, 11 May 2022 09:49:20 +0800 Subject: [PATCH 08/15] fix getEnableReadCrawlers --- app/src/main/assets/updatelog.fy | 3 ++- dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index edcded0..2b1fad5 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -3,7 +3,8 @@ 1、修复书籍无法导出缓存的问题 2、修复部分书源bug 3、修复同名书籍详情页加载bug -4、Cookie支持备份&恢复 +4、修复搜索时当前分组不存在时无法搜索的问题 +5、Cookie支持备份&恢复 2022.04.24 风月读书v2.4.4 diff --git a/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt b/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt index b42b82a..dc42269 100644 --- a/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt +++ b/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt @@ -75,7 +75,7 @@ class AppLoadImpl : IAppLoader { } if (sb.isNotEmpty()) { if (sb.endsWith("\n")) sb.substring(0, sb.length - 1) - val key = "fix244" + val key = "fix244-2" val hasRead = spu.getBoolean(key, false) if (!hasRead) { announce("插件更新", "更新内容:\n$sb") From e5fbc9024d71c4abb8981c5fa2c30d172fada1aa Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Fri, 20 May 2022 08:32:11 +0800 Subject: [PATCH 09/15] change fix dialog style --- .idea/gradle.xml | 1 - .idea/misc.xml | 1 + .idea/modules.xml | 9 +++++++++ .../java/xyz/fycz/myreader/ui/activity/ReadActivity.java | 5 ++++- dynamic/build.gradle | 1 + dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt | 8 ++------ 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index ab232b8..2818960 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -16,7 +16,6 @@ - diff --git a/.idea/misc.xml b/.idea/misc.xml index bba6cb8..5f8ba6c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,6 +5,7 @@ + diff --git a/.idea/modules.xml b/.idea/modules.xml index 35e7452..8bd560e 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -4,8 +4,17 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java index e502c38..7bb29d3 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java @@ -392,6 +392,10 @@ public class ReadActivity extends BaseActivity implements C @Override public void onLongPress() { + if (mSetting.getPageMode() == PageMode.SCROLL){ + ToastUtils.showWarring("滚动模式暂不支持长按复制"); + return; + } if (!binding.readPvContent.isRunning()) { selectTextCursorShow(); showAction(); @@ -2062,7 +2066,6 @@ public class ReadActivity extends BaseActivity implements C break; } url = url.replace("{key}", selectString); - Log.d("SEARCH_URL", url); try { Uri uri = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, uri); diff --git a/dynamic/build.gradle b/dynamic/build.gradle index 68196b3..adbb350 100644 --- a/dynamic/build.gradle +++ b/dynamic/build.gradle @@ -55,4 +55,5 @@ dependencies { compileOnly("me.fycz.maple:maple:1.7") compileOnly 'org.greenrobot:greendao:3.3.0' compileOnly project(":app") + compileOnly project(":DialogX") } \ No newline at end of file diff --git a/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt b/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt index dc42269..b3d299c 100644 --- a/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt +++ b/dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt @@ -22,6 +22,7 @@ import android.app.AlertDialog import android.content.Context import android.content.SharedPreferences import android.os.Bundle +import com.kongzue.dialogx.dialogs.BottomDialog import me.fycz.maple.MapleBridge import me.fycz.maple.MapleUtils import me.fycz.maple.MethodHook @@ -95,13 +96,8 @@ class AppLoadImpl : IAppLoader { Bundle::class.java, object : MethodHook() { override fun afterHookedMethod(param: MapleBridge.MethodHookParam) { - val context = param.thisObject as Context App.getHandler().postDelayed({ - AlertDialog.Builder(context) - .setTitle(title) - .setMessage(msg) - .setPositiveButton("我知道了", null) - .create().show() + BottomDialog.show(title, msg).cancelButton = "知道了" }, 1000) } } From 265eeb623c1380a11bf1178178f6a1372149e37e Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 22 May 2022 19:02:56 +0800 Subject: [PATCH 10/15] update workflows --- .github/workflows/{reader.yml => build.yml} | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) rename .github/workflows/{reader.yml => build.yml} (83%) diff --git a/.github/workflows/reader.yml b/.github/workflows/build.yml similarity index 83% rename from .github/workflows/reader.yml rename to .github/workflows/build.yml index ca94e7e..5b6c3ed 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/build.yml @@ -31,15 +31,13 @@ jobs: one=$(expr ${version} % 10) versionN=v$hun.$ten.$one - echo ::set-output name=create_release::"$CREATE_RELEASE" - echo ::set-output name=build_release::"$BUILD_RELEASE" + echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE" echo ::set-output name=version_name::"$versionN" - echo create_release=$CREATE_RELEASE - echo build_release=$BUILD_RELEASE + echo need_create_release=$NEED_CREATE_RELEASE echo version_name=$versionN - if [[ $CREATE_RELEASE == 'true' ]];then + if [[ $NEED_CREATE_RELEASE == 'true' ]];then echo ::set-output name=lanzou_folder_id::"1608604" echo ::set-output name=lanzou_share_url::"https://fycz.lanzoui.com/b00ngso7e" else @@ -51,7 +49,7 @@ jobs: run: | echo "开始编译打包" chmod +x gradlew - if [ ${{ steps.config.outputs.create_release }} == 'true' -o ${{ steps.config.outputs.build_release }} == 'true' ];then + if [[ ${{ steps.config.outputs.need_create_release }} == 'true' ]];then echo "进行release构建" ./gradlew assembleRelease --parallel else @@ -62,7 +60,7 @@ jobs: id: get_path run: | path="$GITHUB_WORKSPACE/app/build/outputs/apk/release" - if [ ${{ steps.config.outputs.create_release }} != 'true' -a ${{ steps.config.outputs.build_release }} != 'true' ];then + if [[ ${{ steps.config.outputs.need_create_release }} != 'true' ]];then path="$GITHUB_WORKSPACE/app/build/outputs/apk/debug" fi files=$(ls $path) @@ -88,7 +86,7 @@ jobs: echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: ${{ steps.config.outputs.lanzou_share_url }}" - name: Create Release id: create_release - if: ${{ steps.config.outputs.create_release == 'true' }} + if: ${{ steps.config.outputs.need_create_release == 'true' && github.ref == 'refs/heads/master' }} uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -100,7 +98,7 @@ jobs: draft: false - name: Upload Release Asset id: upload_release_asset - if: ${{ steps.config.outputs.create_release == 'true' && steps.create_release.outputs.upload_url }} + if: ${{ steps.config.outputs.need_create_release == 'true' && steps.create_release.outputs.upload_url }} uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 245f4b80b3eacecb3c280894d845d3153b54375b Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 22 May 2022 19:22:24 +0800 Subject: [PATCH 11/15] add some tips --- app/src/main/assets/updatelog.fy | 11 +++---- .../myreader/ui/activity/ReadActivity.java | 9 ++++-- .../ui/activity/SearchBookActivity.java | 29 +++++++++++++++---- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index 2b1fad5..28404c8 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,10 +1,11 @@ 风月读书v2.4.5 更新内容: -1、修复书籍无法导出缓存的问题 -2、修复部分书源bug -3、修复同名书籍详情页加载bug -4、修复搜索时当前分组不存在时无法搜索的问题 -5、Cookie支持备份&恢复 +1、新增部分提示 +2、修复书籍无法导出缓存的问题 +3、修复部分书源bug +4、修复同名书籍详情页加载bug +5、修复搜索时当前分组不存在时无法搜索的问题 +6、Cookie支持备份&恢复 2022.04.24 风月读书v2.4.4 diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java index 7bb29d3..26a6f60 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java @@ -140,6 +140,7 @@ import xyz.fycz.myreader.widget.page.TxtChar; import static android.view.View.GONE; import static android.view.View.VISIBLE; import static xyz.fycz.myreader.util.UriFileUtil.getPath; +import static xyz.fycz.myreader.widget.page.PageMode.SCROLL; /** * @author fengyue @@ -392,7 +393,7 @@ public class ReadActivity extends BaseActivity implements C @Override public void onLongPress() { - if (mSetting.getPageMode() == PageMode.SCROLL){ + if (mSetting.getPageMode() == SCROLL){ ToastUtils.showWarring("滚动模式暂不支持长按复制"); return; } @@ -515,7 +516,7 @@ public class ReadActivity extends BaseActivity implements C }); binding.readTvListenBook.setOnClickListener(v -> { - if (mSetting.getPageMode() == PageMode.SCROLL) { + if (mSetting.getPageMode() == SCROLL) { ToastUtils.showWarring("朗读暂不支持滚动翻页模式!"); return; } @@ -1274,6 +1275,10 @@ public class ReadActivity extends BaseActivity implements C @Override public void onPageModeChange() { mPageLoader.setPageMode(mSetting.getPageMode()); + if (mSetting.getPageMode().equals(SCROLL)){ + DialogCreator.createTipDialog(ReadActivity.this, + "滚动模式存在大量问题,不建议使用;且作者本人不使用此模式,大概率不会进行修复/优化,也不接受此模式的问题反馈"); + } } @Override diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java index d3eb4e1..18cb0de 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java @@ -105,8 +105,6 @@ public class SearchBookActivity extends BaseActivity private SearchHistoryService mSearchHistoryService; - private int allThreadCount; - private SearchEngine searchEngine; private Setting mSetting; @@ -751,8 +749,7 @@ public class SearchBookActivity extends BaseActivity initSearchList(); List readCrawlers = ReadCrawlerUtil .getEnableReadCrawlers(SharedPreUtils.getInstance().getString("searchGroup")); - allThreadCount = readCrawlers.size(); - if (allThreadCount == 0) { + if (readCrawlers.size() == 0) { ToastUtils.showWarring("当前书源已全部禁用,无法搜索!"); binding.rpb.setIsAutoLoading(false); return; @@ -760,8 +757,28 @@ public class SearchBookActivity extends BaseActivity /*for (ReadCrawler readCrawler : readCrawlers) { searchBookByCrawler(readCrawler, readCrawler.getSearchCharset()); }*/ - searchEngine.initSearchEngine(readCrawlers); - searchEngine.search(searchKey); + if (readCrawlers.size() > 2000 && !SharedPreUtils.getInstance().getBoolean("searchBookWarning")) { + DialogCreator.createThreeButtonDialog(this, "书源过多警告", + "当前搜索书源数量超过2000(建议1000以内),继续搜索可能会导致软件异常(如搜索时前往阅读页返回后将会导致卡死黑屏),确定要继续搜索吗?", + true, "继续搜索并不再提示", "书源管理", "继续搜索", + (dialog, which) -> { + SharedPreUtils.getInstance().putBoolean("searchBookWarning", true); + searchEngine.initSearchEngine(readCrawlers); + searchEngine.search(searchKey); + }, (dialog, which) -> { + startActivityForResult(new Intent(this, BookSourceActivity.class), + APPCONST.REQUEST_BOOK_SOURCE); + }, + (dialog, which) -> { + searchEngine.initSearchEngine(readCrawlers); + searchEngine.search(searchKey); + } + ); + } else { + searchEngine.initSearchEngine(readCrawlers); + searchEngine.search(searchKey); + } + } /** From 4d3916356f44618ea9d9c48539e7217e93338e94 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 22 May 2022 21:21:50 +0800 Subject: [PATCH 12/15] release v2.4.5 --- .github/workflows/build.yml | 2 +- app/release.md | 9 ++++++--- app/src/main/assets/updatelog.fy | 1 + app/version_code.properties | 3 +-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b6c3ed..78fb73d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: echo need_create_release=$NEED_CREATE_RELEASE echo version_name=$versionN - if [[ $NEED_CREATE_RELEASE == 'true' ]];then + if [ $NEED_CREATE_RELEASE == 'true' -a ${{ github.ref }} == 'refs/heads/master' ];then echo ::set-output name=lanzou_folder_id::"1608604" echo ::set-output name=lanzou_share_url::"https://fycz.lanzoui.com/b00ngso7e" else diff --git a/app/release.md b/app/release.md index b8caf4c..b36dc1f 100644 --- a/app/release.md +++ b/app/release.md @@ -1,3 +1,6 @@ -* 1、修复软件无法打开的问题(超时时间为5s) -* 2、修复DIY书源重复显示订阅书源的问题 -* 3、优化动态插件加载 \ No newline at end of file +* 1、新增部分提示 +* 2、修复书籍无法导出缓存的问题 +* 3、修复部分书源bug +* 4、修复同名书籍详情页加载bug +* 5、修复搜索时当前分组不存在时无法搜索的问题 +* 6、Cookie支持备份&恢复 \ No newline at end of file diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index 28404c8..3e76db7 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,3 +1,4 @@ +2022.05.22 风月读书v2.4.5 更新内容: 1、新增部分提示 diff --git a/app/version_code.properties b/app/version_code.properties index 3a8dfa8..a50cefc 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -18,5 +18,4 @@ #Fri Jun 18 21:45:31 CST 2021 VERSION_CODE=245 -CREATE_RELEASE=false -BUILD_RELEASE=true \ No newline at end of file +CREATE_RELEASE=true \ No newline at end of file From 50df293166c293eb6633c6cb91cfbe25be8b86cc Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 22 May 2022 21:25:29 +0800 Subject: [PATCH 13/15] fix build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78fb73d..950d92c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE" echo ::set-output name=version_name::"$versionN" - echo need_create_release=$NEED_CREATE_RELEASE + echo need_create_release=$CREATE_RELEASE echo version_name=$versionN if [ $NEED_CREATE_RELEASE == 'true' -a ${{ github.ref }} == 'refs/heads/master' ];then From 9d523ef80680c5faf135e6d22eeee0a78749cd0c Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 22 May 2022 21:27:29 +0800 Subject: [PATCH 14/15] fix build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 950d92c..ccfb6dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: one=$(expr ${version} % 10) versionN=v$hun.$ten.$one - echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE" + echo ::set-output name=need_create_release::"$CREATE_RELEASE" echo ::set-output name=version_name::"$versionN" echo need_create_release=$CREATE_RELEASE From fd7ab4cf93d3d57aa506f2ed5e770408ccc55ac2 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 22 May 2022 21:54:10 +0800 Subject: [PATCH 15/15] add commitId to debug build --- app/build.gradle | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0d6d0ae..f235272 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,7 +24,7 @@ def releaseTime() { return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+08:00")) } -def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim()) +def commitId = 'git rev-parse --short HEAD'.execute().text.trim() def getVersionCode() { def versionCodeFile = file('version_code.properties') @@ -122,14 +122,19 @@ android { signingConfig signingConfigs.myConifg } applicationIdSuffix ".debug" - versionNameSuffix "-" + gitCommits + versionNameSuffix "-" + commitId ndk { abiFilters "arm64-v8a" } } android.applicationVariants.all { variant -> + def buildType = variant.buildType.name + def fileName = "${name}v${defaultConfig.versionName}.apk" + if (buildType == "debug"){ + fileName = "${name}v${defaultConfig.versionName}-${commitId}.apk" + } variant.outputs.all { - outputFileName = "${name}v${defaultConfig.versionName}.apk" + outputFileName = fileName } } }