From 89f82f04beba435b555821260fd8ad9337ff23bc Mon Sep 17 00:00:00 2001 From: ACh Sulfate Date: Wed, 26 Jul 2023 10:33:01 +0800 Subject: [PATCH] fix: ShowMsgAt error msg on non-NT --- app/src/main/java/me/ketal/hook/ShowMsgAt.kt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/me/ketal/hook/ShowMsgAt.kt b/app/src/main/java/me/ketal/hook/ShowMsgAt.kt index 3404361250..615cc9cb49 100644 --- a/app/src/main/java/me/ketal/hook/ShowMsgAt.kt +++ b/app/src/main/java/me/ketal/hook/ShowMsgAt.kt @@ -32,6 +32,7 @@ import android.view.ViewGroup import android.widget.TextView import androidx.appcompat.app.AlertDialog import androidx.core.view.forEach +import cc.hicore.QApp.QAppUtils import cc.ioctl.hook.profile.OpenProfileCard import cc.ioctl.util.HostInfo import cc.ioctl.util.ui.FaultyDialog @@ -88,7 +89,16 @@ object ShowMsgAt : CommonSwitchFunctionHook(), OnBubbleBuilder, DexKitFinder { } override fun initOnce(): Boolean { - return !isTim() && BaseBubbleBuilderHook.initialize() && mTextViewId > 0 + if (isTim()) { + return false + } + if (!BaseBubbleBuilderHook.initialize()) { + return false + } + if (QAppUtils.isQQnt()) { + return mTextViewId > 0 + } + return true } override fun onGetView( @@ -227,7 +237,7 @@ object ShowMsgAt : CommonSwitchFunctionHook(), OnBubbleBuilder, DexKitFinder { override val isNeedFind: Boolean get() { - return mTextViewId == 0 + return QAppUtils.isQQnt() && mTextViewId == 0 } @OptIn(DexKitExperimentalApi::class) @@ -288,6 +298,10 @@ object ShowMsgAt : CommonSwitchFunctionHook(), OnBubbleBuilder, DexKitFinder { } override fun isDone(): Boolean { + if (!QAppUtils.isQQnt()) { + // no need this on non-NT + return true + } return mTextViewId != 0 }