From 130694fa5536f262601830557c87f76d99bd72f2 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Thu, 11 Aug 2022 16:52:48 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=B9=A6=E7=B1=8D=E8=AF=A6=E6=83=85=E7=95=8C?= =?UTF-8?q?=E9=9D=A2]=E5=8F=96=E6=B6=88=E4=B9=A6=E7=B1=8D=E7=AE=80?= =?UTF-8?q?=E4=BB=8B=E5=B1=95=E5=BC=80=E6=97=B6=E6=9C=80=E5=A4=A7=E8=A1=8C?= =?UTF-8?q?=E6=95=B0=E9=99=90=E5=88=B6(=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AE=8C=E5=85=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 + .../ui/activity/BookDetailedActivity.java | 2 +- .../main/java/xyz/fycz/dynamic/AppLoadImpl.kt | 1 + .../java/xyz/fycz/dynamic/fix/App250Fix.kt | 61 +++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 dynamic/src/main/java/xyz/fycz/dynamic/fix/App250Fix.kt diff --git a/.idea/misc.xml b/.idea/misc.xml index ded8613..9f2d6c6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,6 +5,7 @@ + @@ -18,6 +19,7 @@ + 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 9572509..b62a4fb 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 @@ -361,7 +361,7 @@ public class BookDetailedActivity extends BaseActivity. + * + * Copyright (C) 2020 - 2022 fengyuecanzhu + */ + +package xyz.fycz.dynamic.fix + +import android.widget.TextView +import androidx.viewbinding.ViewBinding +import me.fycz.maple.MapleBridge +import me.fycz.maple.MapleUtils +import me.fycz.maple.MethodReplacement +import xyz.fycz.myreader.ui.activity.BookDetailedActivity + +/** + * @author fengyue + * @date 2022/8/11 16:44 + */ +@AppFix([243, 244, 245, 246, 250], ["[书籍详情界面]取消书籍简介展开时最大行数限制(无法显示完全)"], "2022-08-11") +class App250Fix : AppFixHandle { + override fun onFix(key: String): BooleanArray { + return handleFix( + key, + "showMoreDesc" to { fxShowMoreDesc() }, + ) + } + + fun fxShowMoreDesc() { + MapleUtils.findAndHookMethod( + BookDetailedActivity::class.java, + "showMoreDesc", + object : MethodReplacement() { + override fun replaceHookedMethod(param: MapleBridge.MethodHookParam) { + val binding = + MapleUtils.getObjectField(param.thisObject, "binding") as ViewBinding + val icBinding = MapleUtils.getObjectField(binding, "ic") as ViewBinding + val bookDetailTvDesc = + MapleUtils.getObjectField(icBinding, "bookDetailTvDesc") as TextView + if (bookDetailTvDesc.maxLines == 5) { + bookDetailTvDesc.maxLines = Int.MAX_VALUE + } else { + bookDetailTvDesc.maxLines = 5 + } + } + } + ) + } +} \ No newline at end of file