Skip to content

Commit

Permalink
fix: DisableEnterEffect for QQ 8.9.63+
Browse files Browse the repository at this point in the history
  • Loading branch information
klxiaoniu committed Jul 1, 2023
1 parent f8f67e2 commit 77b4a86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/main/java/cc/ioctl/hook/chat/DisableEnterEffect.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
import io.github.qauxv.dsl.FunctionEntryRouter.Locations.Simplify;
import io.github.qauxv.hook.CommonSwitchFunctionHook;
import io.github.qauxv.util.Initiator;
import io.github.qauxv.util.QQVersion;
import io.github.qauxv.util.dexkit.DexKit;
import io.github.qauxv.util.dexkit.DexKitTarget;
import io.github.qauxv.util.dexkit.TroopEnterEffect_QQNT;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

Expand All @@ -40,7 +44,7 @@ public class DisableEnterEffect extends CommonSwitchFunctionHook {
public static final DisableEnterEffect INSTANCE = new DisableEnterEffect();

protected DisableEnterEffect() {
super("rq_disable_enter_effect");
super("rq_disable_enter_effect", new DexKitTarget[]{TroopEnterEffect_QQNT.INSTANCE});
}

@NonNull
Expand All @@ -62,6 +66,11 @@ public boolean isAvailable() {

@Override
public boolean initOnce() {
if (HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63)) {
Method m = DexKit.requireMethodFromCache(TroopEnterEffect_QQNT.INSTANCE);
HookUtils.hookBeforeIfEnabled(this, m, param -> param.setResult(null));
return true;
}
for (Method m : Initiator._TroopEnterEffectController().getDeclaredMethods()) {
if ((m.getName().equals("a") || m.getName().equals("l")) && !Modifier.isStatic(m.getModifiers())
&& m.getParameterTypes().length == 0 && m.getReturnType() == void.class) {
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -712,3 +712,11 @@ object TroopSendFile_QQNT : DexKitTarget.UsingStr() {
override val declaringClass = ""
override val filter = DexKitFilter.allowAll
}

object TroopEnterEffect_QQNT : DexKitTarget.UsingStr() {
override val findMethod: Boolean = true
override val traitString = arrayOf("playAnimaions: isSimpleUISwitch = true")
override val declaringClass = ""
override val filter = DexKitFilter.allowAll
// 理论上非NT也能用,但祖法不可变
}

0 comments on commit 77b4a86

Please sign in to comment.