Merge pull request #23 from fengyuecanzhu/dev

v2.4.6
master v2.4.6
风月残烛 3 years ago committed by GitHub
commit 4cea3708d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .github/workflows/build.yml
  2. 1
      .gitignore
  3. 1
      .idea/gradle.xml
  4. 4
      .idea/modules.xml
  5. 7
      app/release.md
  6. 3
      app/src/main/java/xyz/fycz/myreader/model/user/UserService.kt
  7. 43
      app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java
  8. 34
      app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchAdapter.kt
  9. 2
      app/version_code.properties
  10. 7
      build.gradle
  11. 6
      dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt
  12. 81
      dynamic/src/main/java/xyz/fycz/dynamic/fix/App245Fix.kt
  13. 1
      settings.gradle

@ -25,11 +25,7 @@ jobs:
echo "读取配置"
source ${{ github.workspace }}/app/version_code.properties
version=$VERSION_CODE
hun=$(expr ${version} / 100)
ten=$(expr ${version} / 10)
ten=$(expr ${ten} % 10)
one=$(expr ${version} % 10)
versionN=v$hun.$ten.$one
versionN=v${version:0:1}.${version:1:1}.${version:2:1}
echo ::set-output name=need_create_release::"$CREATE_RELEASE"
echo ::set-output name=version_name::"$versionN"
@ -37,7 +33,7 @@ jobs:
echo need_create_release=$CREATE_RELEASE
echo version_name=$versionN
if [ $NEED_CREATE_RELEASE == 'true' -a ${{ github.ref }} == 'refs/heads/master' ];then
if [ $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

1
.gitignore vendored

@ -6,6 +6,7 @@
.DS_Store
/build
/captures
/user
.externalNativeBuild
keystore
# Compiled class file

@ -14,6 +14,7 @@
<option value="$PROJECT_DIR$/DialogX" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/dynamic" />
<option value="$PROJECT_DIR$/user" />
</set>
</option>
</GradleProjectSettings>

@ -15,6 +15,10 @@
<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" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/user/FYReader.user.iml" filepath="$PROJECT_DIR$/.idea/modules/user/FYReader.user.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/user/FYReader.user.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/user/FYReader.user.androidTest.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/user/FYReader.user.main.iml" filepath="$PROJECT_DIR$/.idea/modules/user/FYReader.user.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/user/FYReader.user.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/user/FYReader.user.unitTest.iml" />
</modules>
</component>
</project>

@ -1,6 +1 @@
* 1、新增部分提示
* 2、修复书籍无法导出缓存的问题
* 3、修复部分书源bug
* 4、修复同名书籍详情页加载bug
* 5、修复搜索时当前分组不存在时无法搜索的问题
* 6、Cookie支持备份&恢复
* 1、修复书源过多时搜索界面卡死的问题

@ -266,6 +266,7 @@ object UserService {
App.getApplication().packageName,
AppInfoUtils.SHA1
) + "&appVersion=" + App.getVersionCode() +
"&deviceId=" + getUUID() + "&isDebug=" + App.isDebug()
"&isDebug=" + App.isDebug() +
"&deviceId=" + getUUID()
}
}

@ -156,6 +156,25 @@ public class SearchBookActivity extends BaseActivity<ActivitySearchBookBinding>
}
}
@Override
protected void onStop() {
if (mSearchBookAdapter != null) {
mSearchBookAdapter.setStop(true);
}
super.onStop();
}
@Override
protected void onStart() {
super.onStart();
if (mSearchBookAdapter != null) {
mSearchBookAdapter.setStop(false);
if (showBooks) {
mSearchBookAdapter.addAll(new ArrayList<>(), searchKey);
}
}
}
@Override
protected void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
@ -757,28 +776,8 @@ public class SearchBookActivity extends BaseActivity<ActivitySearchBookBinding>
/*for (ReadCrawler readCrawler : readCrawlers) {
searchBookByCrawler(readCrawler, readCrawler.getSearchCharset());
}*/
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);
}
searchEngine.initSearchEngine(readCrawlers);
searchEngine.search(searchKey);
}
/**

@ -24,6 +24,7 @@ import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
@ -52,11 +53,12 @@ class SearchAdapter(
val keyword: String
) : DiffRecyclerAdapter<SearchBookBean, ItemSearchBookBinding>(context) {
private val mBooks: ConMVMap<SearchBookBean, Book> = ConMVMap()
private lateinit var mList: List<SearchBookBean>
private var mList: MutableList<SearchBookBean> = ArrayList()
private val tagList: MutableList<String> = ArrayList()
private val handler = Handler(Looper.getMainLooper())
private var postTime = 0L
private val sendRunnable = Runnable { upAdapter() }
var isStop = false
override val diffItemCallback: DiffUtil.ItemCallback<SearchBookBean>
get() = object : DiffUtil.ItemCallback<SearchBookBean>() {
@ -300,7 +302,7 @@ class SearchAdapter(
}
fun addAll(newDataS: List<SearchBookBean>, keyWord: String?) {
val copyDataS: MutableList<SearchBookBean> = ArrayList(getItems())
val copyData: MutableList<SearchBookBean> = ArrayList(mList)
val filterDataS: MutableList<SearchBookBean> = ArrayList()
when (SysManager.getSetting().searchFilter) {
0 -> filterDataS.addAll(newDataS)
@ -328,16 +330,16 @@ class SearchAdapter(
}
if (filterDataS.size > 0) {
val searchBookBeansAdd: MutableList<SearchBookBean> = ArrayList()
if (copyDataS.size == 0) {
copyDataS.addAll(filterDataS)
if (mList.size == 0) {
mList.addAll(filterDataS)
} else {
//存在
for (temp in filterDataS) {
var hasSame = false
var i = 0
val size = copyDataS.size
val size = copyData.size
while (i < size) {
val searchBook = copyDataS[i]
val searchBook = copyData[i]
if (TextUtils.equals(temp.name, searchBook.name)
&& TextUtils.equals(temp.author, searchBook.author)
) {
@ -353,30 +355,30 @@ class SearchAdapter(
//添加
for (temp in searchBookBeansAdd) {
if (TextUtils.equals(keyWord, temp.name)) {
for (i in copyDataS.indices) {
val searchBook = copyDataS[i]
for (i in copyData.indices) {
val searchBook = copyData[i]
if (!TextUtils.equals(keyWord, searchBook.name)) {
copyDataS.add(i, temp)
mList.add(i, temp)
break
}
}
} else if (TextUtils.equals(keyWord, temp.author)) {
for (i in copyDataS.indices) {
val searchBook = copyDataS[i]
for (i in copyData.indices) {
val searchBook = copyData[i]
if (!TextUtils.equals(keyWord, searchBook.name) &&
!TextUtils.equals(keyWord, searchBook.author)
) {
copyDataS.add(i, temp)
mList.add(i, temp)
break
}
}
} else {
copyDataS.add(temp)
mList.add(temp)
}
}
}
mList = copyDataS
upAdapter()
if (!isStop)
upAdapter()
}
}
@ -385,7 +387,7 @@ class SearchAdapter(
if (System.currentTimeMillis() >= postTime + 500) {
handler.removeCallbacks(sendRunnable)
postTime = System.currentTimeMillis()
setItems(mList)
setItems(ArrayList(mList))
} else {
handler.removeCallbacks(sendRunnable)
handler.postDelayed(sendRunnable, 500 - System.currentTimeMillis() + postTime)

@ -17,5 +17,5 @@
#
#Fri Jun 18 21:45:31 CST 2021
VERSION_CODE=245
VERSION_CODE=246
CREATE_RELEASE=true

@ -28,12 +28,19 @@ buildscript {
maven { url 'https://s3.amazonaws.com/fabric-artifacts/public' }
maven { url 'https://plugins.gradle.org/m2/' }
maven { url "https://maven.java.net/content/groups/public/" }
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.github.megatronking.stringfog:gradle-plugin:3.0.0'
// xor算法使
classpath 'com.github.megatronking.stringfog:xor:3.0.0'
classpath "com.github.CodingGay:BlackObfuscator-ASPlugin:3.7"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

@ -26,10 +26,7 @@ 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.dynamic.fix.*
import xyz.fycz.myreader.application.App
import xyz.fycz.myreader.ui.activity.MainActivity
@ -49,6 +46,7 @@ class AppLoadImpl : IAppLoader {
App243Fix::class.java,
App244Fix::class.java,
App244Fix2::class.java,
App245Fix::class.java,
)
override fun onLoad(appParam: AppParam) {

@ -0,0 +1,81 @@
/*
* 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.application.App
import xyz.fycz.myreader.model.user.UserService
import xyz.fycz.myreader.util.AppInfoUtils
import xyz.fycz.myreader.util.utils.EncoderUtils
/**
* @author fengyue
* @date 2022/5/23 18:20
*/
@AppFix([243, 244, 245], ["修改用户服务验证机制(beta)"], "2022-05-23")
class App245Fix : AppFixHandle {
override fun onFix(key: String): BooleanArray {
val result = try {
fixMakeAuth()
true
} catch (e: Exception) {
MapleUtils.log(e)
false
}
fixResult(key, "makeAuth", result)
return booleanArrayOf(result)
}
private fun fixMakeAuth() {
MapleUtils.findAndHookMethod(
UserService::class.java,
"makeAuth",
object : MethodReplacement() {
override fun replaceHookedMethod(param: MapleBridge.MethodHookParam): Any {
return makeAuth()
}
}
)
}
fun makeAuth(): String {
var auth = "signal=" + AppInfoUtils.getSingInfo(
App.getmContext(),
App.getApplication().packageName,
AppInfoUtils.SHA1
) + "&appVersion=" + App.getVersionCode()
auth = try {
EncoderUtils.encryptAES2Base64(
auth.toByteArray(), DO_FILTER_KEY,
"AES/ECB/PKCS5Padding"
)?.let { String(it) }.toString()
} catch (e: Exception) {
""
}
return "&auth=$auth" +
"&deviceId=" + UserService.getUUID() +
"&isDebug=" + App.isDebug()
}
val DO_FILTER_KEY = "79qdunN8534y44T3".toByteArray()
}

@ -19,3 +19,4 @@
include ':app'
include ':DialogX'
include ':dynamic'
include ':user'

Loading…
Cancel
Save