From 2156e0a0991cd5a61a7426aadbc3caa08189324a Mon Sep 17 00:00:00 2001 From: hd Date: Mon, 23 Dec 2024 05:03:12 +0800 Subject: [PATCH] fix: GalleryBgHook on QQ 9.0.56+ Closes #1279 --- app/src/main/java/cc/ioctl/hook/chat/GalleryBgHook.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cc/ioctl/hook/chat/GalleryBgHook.java b/app/src/main/java/cc/ioctl/hook/chat/GalleryBgHook.java index 56dd75469c..eefab04fb8 100644 --- a/app/src/main/java/cc/ioctl/hook/chat/GalleryBgHook.java +++ b/app/src/main/java/cc/ioctl/hook/chat/GalleryBgHook.java @@ -33,7 +33,9 @@ import io.github.qauxv.base.annotation.UiItemAgentEntry; import io.github.qauxv.dsl.FunctionEntryRouter.Locations.Simplify; import io.github.qauxv.hook.CommonSwitchFunctionHook; +import io.github.qauxv.util.HostInfo; import io.github.qauxv.util.Initiator; +import io.github.qauxv.util.QQVersion; import io.github.qauxv.util.SyncUtils; import io.github.qauxv.util.dexkit.CAbsGalScene; import io.github.qauxv.util.dexkit.CGalleryBaseScene; @@ -59,7 +61,9 @@ public boolean initOnce() throws Exception { if (kRFWLayerAnimPart != null) { Method m = kRFWLayerAnimPart.getDeclaredMethod("initStartAnim", ImageView.class); HookUtils.hookAfterIfEnabled(this, m, param -> { - Object mDragLayout = Reflex.getInstanceObject(param.thisObject, "mDragLayout", null); + Object mDragLayout = Reflex.getInstanceObject(param.thisObject, + HostInfo.requireMinQQVersion(QQVersion.QQ_9_0_56) ? "dragLayout" : "mDragLayout", + null); Reflex.setInstanceObject(mDragLayout, "mWindowBgDrawable", new ColorDrawable(Color.TRANSPARENT)); }); Method m2 = kRFWLayerAnimPart.getDeclaredMethod("updateBackgroundAlpha", int.class);