Skip to content

Commit

Permalink
fix: optimize SimplifyQQSettingMe
Browse files Browse the repository at this point in the history
  • Loading branch information
klxiaoniu committed Dec 12, 2023
1 parent 162c3f4 commit 001ceb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import androidx.core.view.forEachIndexed
import androidx.core.view.get
import androidx.core.view.size
import cc.ioctl.util.HookUtils
import com.github.kyuubiran.ezxhelper.utils.findAllMethods
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getStaticObjectOrNull
import com.github.kyuubiran.ezxhelper.utils.hookAfter
Expand Down Expand Up @@ -238,15 +237,13 @@ object SimplifyQQSettingMe : MultiItemDelayableHook("SimplifyQQSettingMe") {
if (requireMinQQVersion(QQVersion.QQ_8_9_88)) "com.tencent.mobileqq.QQSettingMeViewV9"
else "com.tencent.mobileqq.activity.QQSettingMeViewV9"
)
clazz?.findAllMethods { paramCount == 1 && parameterTypes[0].name.contains("com.tencent.mobileqq.activity.qqsettingme") }?.hookAfter {
if (clazz != null) {
val cz = clazz.superclass.superclass
val m = cz.findMethod { returnType == View::class.java && paramCount == 1 && parameterTypes[0] == String::class.java }
for (activeItem in activeItems) {
if (items2Hide.contains(activeItem)) {
val viewObj = m.invoke(null, items2Hide[activeItem])
if (viewObj != null) {
val view = viewObj as View
view.visibility = View.GONE
m.hookAfter {
for (activeItem in activeItems) {
if (items2Hide[activeItem] == it.args[0]) {
(it.result as View).setViewZeroSize()
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/io/github/qauxv/tlb/QQConfigTable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import io.github.qauxv.util.QQVersion.QQ_8_9_68
import io.github.qauxv.util.QQVersion.QQ_8_9_70
import io.github.qauxv.util.QQVersion.QQ_8_9_8
import io.github.qauxv.util.QQVersion.QQ_8_9_90
import io.github.qauxv.util.QQVersion.QQ_9_0_0
import me.ketal.hook.SortAtPanel
import xyz.nextalone.hook.ChatWordsCount

Expand Down Expand Up @@ -123,6 +124,7 @@ class QQConfigTable : ConfigTableInterface {
QQ_8_9_28 to "m0",
QQ_8_9_68 to "l0",
QQ_8_9_90 to "i0",
QQ_9_0_0 to "f0",
),

SortAtPanel.sessionInfoTroopUin to mapOf(
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/io/github/qauxv/util/QQVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ private QQVersion() {
public static final long QQ_8_9_88 = 4852;
public static final long QQ_8_9_90 = 4938;
public static final long QQ_8_9_93_BETA_13315 = 4964;
public static final long QQ_9_0_0 = 5220; //beta1
}

0 comments on commit 001ceb2

Please sign in to comment.