Skip to content

Commit

Permalink
fix: ShowMsgAt error msg on non-NT
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Jul 26, 2023
1 parent d4f55cb commit 89f82f0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions app/src/main/java/me/ketal/hook/ShowMsgAt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 89f82f0

Please sign in to comment.