Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: SimplifyQQSettingMe (bottom) on QQ 9.0.85+ #1142

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

//侧滑栏精简
Expand Down Expand Up @@ -177,7 +179,15 @@ object SimplifyQQSettingMe :
XposedBridge.hookAllConstructors(kQQSettingMeView, HookUtils.afterIfEnabled(this) { param ->
//中间部分(QQ会员 我的钱包等)
val midContentName = ConfigTable.getConfig<String>(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
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down
4 changes: 4 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 @@ -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

Expand Down Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/io/github/qauxv/util/QQVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Loading