diff --git a/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt b/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt index cbef0db952..49b99eeece 100644 --- a/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt +++ b/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt @@ -52,6 +52,7 @@ import io.github.qauxv.util.QQVersion.QQ_8_6_5 import io.github.qauxv.util.QQVersion.QQ_8_8_11 import io.github.qauxv.util.QQVersion.QQ_8_9_23 import io.github.qauxv.util.QQVersion.QQ_9_0_20 +import io.github.qauxv.util.QQVersion.QQ_9_0_85 import io.github.qauxv.util.dexkit.DexKit import io.github.qauxv.util.dexkit.QQSettingMeABTestHelper_isZPlanExpGroup_New import io.github.qauxv.util.dexkit.QQSettingMeABTestHelper_isZplanExpGroup_Old @@ -63,6 +64,7 @@ import io.github.qauxv.util.xpcompat.XposedBridge import xyz.nextalone.base.MultiItemDelayableHook import xyz.nextalone.util.* import java.lang.reflect.Array +import java.lang.reflect.Modifier import java.util.SortedMap //侧滑栏精简 @@ -177,7 +179,15 @@ object SimplifyQQSettingMe : XposedBridge.hookAllConstructors(kQQSettingMeView, HookUtils.afterIfEnabled(this) { param -> //中间部分(QQ会员 我的钱包等) val midContentName = ConfigTable.getConfig(MidContentName) - val midContentListLayout = if (requireMinQQVersion(QQ_8_6_5)) { + val midContentListLayout = if (requireMinQQVersion(QQ_9_0_85)) { + param.thisObject::class.java.declaredFields.firstOrNull { + it.modifiers and (Modifier.STATIC or Modifier.FINAL or Modifier.PRIVATE) == Modifier.PRIVATE + && it.type == LinearLayout::class.java + }?.let { + it.isAccessible = true + it.get(param.thisObject) as LinearLayout? + } + } else if (requireMinQQVersion(QQ_8_6_5)) { param.thisObject.get(midContentName, LinearLayout::class.java) } else { param.thisObject.get(midContentName, View::class.java) as LinearLayout @@ -210,9 +220,9 @@ object SimplifyQQSettingMe : val underSettingsLayout = if (id is Int && vg is ViewGroup) { vg.findViewById(id) } else if (requireMinQQVersion(QQ_8_6_5)) { - val parent = midContentListLayout?.parent?.parent as ViewGroup + val parent = midContentListLayout?.parent?.parent as ViewGroup? var ret: LinearLayout? = null - parent.forEach { + parent?.forEach { if (it is LinearLayout && it[0] is LinearLayout) { ret = it } @@ -223,7 +233,11 @@ object SimplifyQQSettingMe : param.thisObject.get(underSettingsName, View::class.java) as? LinearLayout } val correctUSLayout: LinearLayout? = - if (requireMinQQVersion(QQ_8_9_23)) (underSettingsLayout as LinearLayout)[0] as LinearLayout else underSettingsLayout + if (requireMinQQVersion(QQ_8_9_23)) { + (underSettingsLayout as LinearLayout?)?.get(0) as LinearLayout? + } else { + underSettingsLayout + } correctUSLayout?.forEachIndexed { i, v -> val tv = (v as LinearLayout)[1] as TextView val text = tv.text diff --git a/app/src/main/java/io/github/qauxv/tlb/QQConfigTable.kt b/app/src/main/java/io/github/qauxv/tlb/QQConfigTable.kt index b76fe52ede..1ede697269 100644 --- a/app/src/main/java/io/github/qauxv/tlb/QQConfigTable.kt +++ b/app/src/main/java/io/github/qauxv/tlb/QQConfigTable.kt @@ -66,6 +66,8 @@ import io.github.qauxv.util.QQVersion.QQ_8_9_90 import io.github.qauxv.util.QQVersion.QQ_9_0_0 import io.github.qauxv.util.QQVersion.QQ_9_0_20 import io.github.qauxv.util.QQVersion.QQ_9_0_35 +import io.github.qauxv.util.QQVersion.QQ_9_0_85 +import io.github.qauxv.util.QQVersion.QQ_9_0_90 import me.ketal.hook.SortAtPanel import xyz.nextalone.hook.ChatWordsCount @@ -129,6 +131,8 @@ class QQConfigTable : ConfigTableInterface { QQ_9_0_0 to "f0", QQ_9_0_20 to "e0", QQ_9_0_35 to "g0", + QQ_9_0_85 to "h0", + QQ_9_0_90 to "f0", ), SortAtPanel.sessionInfoTroopUin to mapOf( diff --git a/app/src/main/java/io/github/qauxv/util/QQVersion.java b/app/src/main/java/io/github/qauxv/util/QQVersion.java index c4d4d25d55..a5a1dfd39d 100644 --- a/app/src/main/java/io/github/qauxv/util/QQVersion.java +++ b/app/src/main/java/io/github/qauxv/util/QQVersion.java @@ -128,4 +128,7 @@ private QQVersion() { public static final long QQ_9_0_73 = 6722; public static final long QQ_9_0_75 = 6786; public static final long QQ_9_0_80 = 6896; + public static final long QQ_9_0_81 = 6922; + public static final long QQ_9_0_85 = 7068; + public static final long QQ_9_0_90 = 7196; }