Skip to content

Commit

Permalink
revert: SimplifyQQSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Dec 24, 2024
1 parent d04bb07 commit 6872c15
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions app/src/main/java/xyz/nextalone/hook/SimplifyQQSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import io.github.qauxv.base.annotation.UiItemAgentEntry
import io.github.qauxv.dsl.FunctionEntryRouter
import io.github.qauxv.util.Initiator
import io.github.qauxv.util.QQVersion
import io.github.qauxv.util.requireMaxQQVersion
import io.github.qauxv.util.requireMinQQVersion
import io.github.qauxv.util.xpcompat.XC_MethodHook
import io.github.qauxv.util.xpcompat.XposedBridge
Expand Down Expand Up @@ -118,23 +117,20 @@ object SimplifyQQSettings : MultiItemDelayableHook("na_simplify_qq_settings_mult
}
}

//单独处理 其他选项
Initiator.loadClass("com.tencent.mobileqq.setting.main.MainSettingConfigProvider").method { it.returnType == List::class.java }!!
.hookAfter { param ->
param.result = (param.result as List<*>).filter { obj ->
(((obj ?: return@filter true)::class.java.getFieldByType(List::class.java).get(obj)
?: return@filter true) as List<*>).firstOrNull {
val name = (it ?: return@firstOrNull false)::class.java.simpleName
(activeItems.contains("通知") && name == "MsgNotifyItemProcessor")
|| (activeItems.contains("免流量") && name == "CUOpenCardItemProcessor" && requireMinQQVersion(QQVersion.QQ_9_0_30))
|| (activeItems.contains("关于") && name == "AboutItemProcessor")
} == null
}
}

// 单独处理 免流量(9.0.25之前)
if (activeItems.contains("免流量") && requireMaxQQVersion(QQVersion.QQ_9_0_25)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
// 免流量 单独处理
if (activeItems.contains("免流量")) {
// if() CUOpenCardGuideMng guideEntry
if (requireMinQQVersion(QQVersion.QQ_9_0_30)) {
Initiator.loadClass("com.tencent.mobileqq.setting.main.MainSettingConfigProvider").method { it.returnType == List::class.java }!!
.hookAfter { param ->
param.result = (param.result as List<*>).filter { obj ->
(((obj ?: return@filter true)::class.java.getFieldByType(List::class.java).get(obj)
?: return@filter true) as List<*>).firstOrNull {
(it ?: return@firstOrNull false)::class.java.simpleName == "CUOpenCardItemProcessor"
} == null
}
}
} else if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
//Lcom/tencent/mobileqq/managers/CUOpenCardGuideMng;->b(I)Lcom/tencent/mobileqq/managers/CUOpenCardGuideMng$a;
Initiator.loadClass("com/tencent/mobileqq/managers/CUOpenCardGuideMng").let { clz ->
val m = clz.declaredMethods.single {
Expand Down

0 comments on commit 6872c15

Please sign in to comment.