Merge pull request #22 from fengyuecanzhu/dev

release v2.4.5
master v2.4.5
风月残烛 3 years ago committed by GitHub
commit d44cc49047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .github/workflows/build.yml
  2. 1
      .idea/gradle.xml
  3. 1
      .idea/misc.xml
  4. 9
      .idea/modules.xml
  5. 11
      app/build.gradle
  6. 9
      app/release.md
  7. 8
      app/src/main/assets/updatelog.fy
  8. 8
      app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt
  9. 8
      app/src/main/java/xyz/fycz/myreader/model/SearchEngine.java
  10. 8
      app/src/main/java/xyz/fycz/myreader/model/storage/Backup.kt
  11. 9
      app/src/main/java/xyz/fycz/myreader/model/storage/Restore.kt
  12. 8
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  13. 12
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  14. 29
      app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java
  15. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java
  16. 2
      app/src/test/java/Test.java
  17. 2
      app/version_code.properties
  18. 1
      dynamic/build.gradle
  19. 14
      dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt
  20. 74
      dynamic/src/main/java/xyz/fycz/dynamic/fix/App244Fix2.kt
  21. 22
      gradlew

@ -31,13 +31,13 @@ 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=$NEED_CREATE_RELEASE
echo need_create_release=$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
@ -86,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.need_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 }}

@ -16,7 +16,6 @@
<option value="$PROJECT_DIR$/dynamic" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>

@ -5,6 +5,7 @@
<map>
<entry key="..\:/android/FYReader/app/src/main/res/layout/activity_donate.xml" value="0.264" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/activity_more_setting.xml" value="0.2" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/activity_read.xml" value="0.12132725430597771" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/activity_user_info.xml" value="0.2" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/fragment_private_bookcase.xml" value="0.12132725430597771" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/fragment_proxy_setting.xml" value="0.22826086956521738" />

@ -4,8 +4,17 @@
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/FYReader.iml" filepath="$PROJECT_DIR$/.idea/modules/FYReader.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.iml" filepath="$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.androidTest.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.main.iml" filepath="$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/DialogX/FYReader.DialogX.unitTest.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/app/FYReader.app.iml" filepath="$PROJECT_DIR$/.idea/modules/app/FYReader.app.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/app/FYReader.app.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/app/FYReader.app.androidTest.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/app/FYReader.app.main.iml" filepath="$PROJECT_DIR$/.idea/modules/app/FYReader.app.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/app/FYReader.app.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/app/FYReader.app.unitTest.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.iml" filepath="$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.androidTest.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.main.iml" filepath="$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/dynamic/FYReader.dynamic.unitTest.iml" />
</modules>
</component>
</project>

@ -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
}
}
}

@ -1,3 +1,6 @@
* 1、修复软件无法打开的问题(超时时间为5s)
* 2、修复DIY书源重复显示订阅书源的问题
* 3、优化动态插件加载
* 1、新增部分提示
* 2、修复书籍无法导出缓存的问题
* 3、修复部分书源bug
* 4、修复同名书籍详情页加载bug
* 5、修复搜索时当前分组不存在时无法搜索的问题
* 6、Cookie支持备份&恢复

@ -1,6 +1,12 @@
2022.05.22
风月读书v2.4.5
更新内容:
1、修复书籍无法导出缓存的问题
1、新增部分提示
2、修复书籍无法导出缓存的问题
3、修复部分书源bug
4、修复同名书籍详情页加载bug
5、修复搜索时当前分组不存在时无法搜索的问题
6、Cookie支持备份&恢复
2022.04.24
风月读书v2.4.4

@ -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()
}
}
}

@ -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<ConMVMap<SearchBookBean, Book>>() {
@ -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<ConMVMap<SearchBookBean, Book>>() {

@ -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

@ -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<CookieBean>(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()

@ -386,7 +386,13 @@ public class BookDetailedActivity extends BaseActivity<ActivityBookDetailBinding
* @return
*/
private boolean isBookCollected() {
Book book = mBookService.findBookByAuthorAndName(mBook.getName(), mBook.getAuthor());
Book book = null;
if (!TextUtils.isEmpty(mBook.getId())){
book = mBookService.getBookById(mBook.getId());
}
if (book == null) {
book = mBookService.findBookByAuthorAndName(mBook.getName(), mBook.getAuthor());
}
if (book == null) {
return false;
} else {

@ -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,6 +393,10 @@ public class ReadActivity extends BaseActivity<ActivityReadBinding> implements C
@Override
public void onLongPress() {
if (mSetting.getPageMode() == SCROLL){
ToastUtils.showWarring("滚动模式暂不支持长按复制");
return;
}
if (!binding.readPvContent.isRunning()) {
selectTextCursorShow();
showAction();
@ -511,7 +516,7 @@ public class ReadActivity extends BaseActivity<ActivityReadBinding> implements C
});
binding.readTvListenBook.setOnClickListener(v -> {
if (mSetting.getPageMode() == PageMode.SCROLL) {
if (mSetting.getPageMode() == SCROLL) {
ToastUtils.showWarring("朗读暂不支持滚动翻页模式!");
return;
}
@ -1270,6 +1275,10 @@ public class ReadActivity extends BaseActivity<ActivityReadBinding> implements C
@Override
public void onPageModeChange() {
mPageLoader.setPageMode(mSetting.getPageMode());
if (mSetting.getPageMode().equals(SCROLL)){
DialogCreator.createTipDialog(ReadActivity.this,
"滚动模式存在大量问题,不建议使用;且作者本人不使用此模式,大概率不会进行修复/优化,也不接受此模式的问题反馈");
}
}
@Override
@ -2062,7 +2071,6 @@ public class ReadActivity extends BaseActivity<ActivityReadBinding> 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);

@ -105,8 +105,6 @@ public class SearchBookActivity extends BaseActivity<ActivitySearchBookBinding>
private SearchHistoryService mSearchHistoryService;
private int allThreadCount;
private SearchEngine searchEngine;
private Setting mSetting;
@ -751,8 +749,7 @@ public class SearchBookActivity extends BaseActivity<ActivitySearchBookBinding>
initSearchList();
List<ReadCrawler> 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<ActivitySearchBookBinding>
/*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);
}
}
/**

@ -244,6 +244,9 @@ public class ReadCrawlerUtil {
List<BookSource> sources = TextUtils.isEmpty(group) ?
BookSourceManager.getEnabledBookSource() :
BookSourceManager.getEnableSourceByGroup(group);
if (sources.size() == 0){
sources = BookSourceManager.getEnabledBookSource();
}
for (BookSource source : sources) {
crawlers.add(getReadCrawler(source));
}

@ -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));
}
}

@ -18,4 +18,4 @@
#Fri Jun 18 21:45:31 CST 2021
VERSION_CODE=245
NEED_CREATE_RELEASE=false
CREATE_RELEASE=true

@ -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")
}

@ -22,11 +22,13 @@ 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
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 +47,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) {
@ -73,7 +76,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")
@ -93,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)
}
}

@ -0,0 +1,74 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2020 - 2022 fengyuecanzhu
*/
package xyz.fycz.dynamic.fix
import me.fycz.maple.MapleBridge
import me.fycz.maple.MapleUtils
import me.fycz.maple.MethodReplacement
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager
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<ReadCrawler> {
val crawlers = ArrayList<ReadCrawler>()
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
}
}

22
gradlew vendored

@ -2,20 +2,20 @@
#
# 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 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.
# 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 <https://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License
# along with FYReader. If not, see <https://www.gnu.org/licenses/>.
#
# Copyright (C) 2020 - 2022 fengyuecanzhu
# Copyright (C) 2020 - 2022 fengyuecanzhu
#
##############################################################################

Loading…
Cancel
Save