Skip to content

Commit

Permalink
fix: partially rollback SimplifyQQSettingMe V9
Browse files Browse the repository at this point in the history
  • Loading branch information
klxiaoniu committed Dec 12, 2023
1 parent 001ceb2 commit 2167bd9
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ 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 @@ -237,13 +238,29 @@ object SimplifyQQSettingMe : MultiItemDelayableHook("SimplifyQQSettingMe") {
if (requireMinQQVersion(QQVersion.QQ_8_9_88)) "com.tencent.mobileqq.QQSettingMeViewV9"
else "com.tencent.mobileqq.activity.QQSettingMeViewV9"
)
if (clazz != null) {
val cz = clazz.superclass.superclass
val m = cz.findMethod { returnType == View::class.java && paramCount == 1 && parameterTypes[0] == String::class.java }
m.hookAfter {
if (requireMinQQVersion(QQVersion.QQ_9_0_0)) {
if (clazz != null) {
val cz = clazz.superclass.superclass
val m = cz.findMethod { returnType == View::class.java && paramCount == 1 && parameterTypes[0] == String::class.java }
m.hookAfter {
for (activeItem in activeItems) {
if (items2Hide[activeItem] == it.args[0]) {
(it.result as View).setViewZeroSize()
}
}
}
}
} else {
clazz?.findAllMethods { paramCount == 1 && parameterTypes[0].name.contains("com.tencent.mobileqq.activity.qqsettingme") }?.hookAfter {
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[activeItem] == it.args[0]) {
(it.result as View).setViewZeroSize()
if (items2Hide.contains(activeItem)) {
val viewObj = m.invoke(null, items2Hide[activeItem])
if (viewObj != null) {
val view = viewObj as View
view.setViewZeroSize()
}
}
}
}
Expand Down

0 comments on commit 2167bd9

Please sign in to comment.