diff --git a/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt b/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt index 589a13fa55..24550a5dc1 100644 --- a/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt +++ b/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt @@ -1002,7 +1002,7 @@ data object Hd_AutoSendOriginalPhoto_photoListPanel_Method : DexKitTarget.UsingS override val filter = DexKitFilter.allowAll } -data object Hd_DisableGrowHalfLayer_Method : DexKitTarget.UsingStringVector() { +data object Hd_DisableGrowHalfLayer_Method1 : DexKitTarget.UsingStringVector() { override val findMethod = true override val traitStringVectors = arrayOf(arrayOf("grow_half_layer_info", "grow_half_layer_tech_info")) override val declaringClass = "cooperation.vip.ad.GrowHalfLayerHelper" @@ -1012,6 +1012,13 @@ data object Hd_DisableGrowHalfLayer_Method : DexKitTarget.UsingStringVector() { } } +data object Hd_DisableGrowHalfLayer_Method2 : DexKitTarget.UsingStr() { + override val findMethod = true + override val traitString = arrayOf("start showVasADBanner") + override val declaringClass = "cooperation.vip.qqbanner.manager.VasADBannerManager" + override val filter = DexKitFilter.allowAll +} + data object Hd_GagInfoDisclosure_Method : DexKitTarget.UsingStr() { override val findMethod = true override val traitString = arrayOf("<---0x2dc push groupCode:") diff --git a/app/src/main/java/me/hd/hook/DisableGrowHalfLayer.kt b/app/src/main/java/me/hd/hook/DisableGrowHalfLayer.kt index 64e1a705fb..aff24a9e17 100644 --- a/app/src/main/java/me/hd/hook/DisableGrowHalfLayer.kt +++ b/app/src/main/java/me/hd/hook/DisableGrowHalfLayer.kt @@ -28,14 +28,20 @@ import io.github.qauxv.base.annotation.UiItemAgentEntry import io.github.qauxv.dsl.FunctionEntryRouter import io.github.qauxv.hook.CommonSwitchFunctionHook import io.github.qauxv.util.QQVersion +import io.github.qauxv.util.Toasts import io.github.qauxv.util.dexkit.DexKit -import io.github.qauxv.util.dexkit.Hd_DisableGrowHalfLayer_Method +import io.github.qauxv.util.dexkit.Hd_DisableGrowHalfLayer_Method1 +import io.github.qauxv.util.dexkit.Hd_DisableGrowHalfLayer_Method2 import io.github.qauxv.util.requireMinQQVersion +import io.github.qauxv.util.xpcompat.XposedBridge @FunctionHookEntry @UiItemAgentEntry object DisableGrowHalfLayer : CommonSwitchFunctionHook( - targets = arrayOf(Hd_DisableGrowHalfLayer_Method) + targets = arrayOf( + Hd_DisableGrowHalfLayer_Method1, + Hd_DisableGrowHalfLayer_Method2, + ) ) { override val name = "屏蔽广告弹窗(测试版)" @@ -44,9 +50,24 @@ object DisableGrowHalfLayer : CommonSwitchFunctionHook( override val isAvailable = requireMinQQVersion(QQVersion.QQ_8_9_88) override fun initOnce(): Boolean { - hookBeforeIfEnabled(DexKit.requireMethodFromCache(Hd_DisableGrowHalfLayer_Method)) { param -> + hookBeforeIfEnabled(DexKit.requireMethodFromCache(Hd_DisableGrowHalfLayer_Method1)) { param -> + printStackTrace("屏蔽广告弹窗 -> 测试1") + Toasts.show("屏蔽广告弹窗 -> 测试1成功") + param.result = null + } + hookBeforeIfEnabled(DexKit.requireMethodFromCache(Hd_DisableGrowHalfLayer_Method2)) { param -> + printStackTrace("屏蔽广告弹窗 -> 测试2") + Toasts.show("屏蔽广告弹窗 -> 测试2成功") param.result = null } return true } + + private fun printStackTrace(name: String) { + val stackTrace = Throwable().stackTrace + val stackTraceStr = stackTrace.joinToString("\n") { element -> + "at ${element.className}.${element.methodName}(${element.fileName}:${element.lineNumber})" + } + XposedBridge.log("[$name] -> $stackTraceStr") + } } \ No newline at end of file