Skip to content

Commit

Permalink
fix: HookUpgrade Crash
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Oct 15, 2024
1 parent 0adefba commit f376784
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/main/java/com/alphi/qhmk/module/HookUpgrade.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@UiItemAgentEntry
@FunctionHookEntry
public class HookUpgrade extends CommonSwitchFunctionHook {
public class HookUpgrade extends CommonSwitchFunctionHook {

public static final HookUpgrade INSTANCE = new HookUpgrade();

Expand All @@ -33,6 +33,15 @@ public String[] getUiItemLocation() {

@Override
protected boolean initOnce() throws Exception {

try {
Class<?> shiplyUpgradeManagerClass = Initiator.loadClass("com.tencent.mobileqq.upgrade.a.a");
Class<?> upgradeStrategyClass = Initiator.loadClass("com.tencent.upgrade.bean.UpgradeStrategy");
Method getConfigUpgradeMethod = shiplyUpgradeManagerClass.getDeclaredMethod("c", upgradeStrategyClass, boolean.class);
HookUtils.hookBeforeIfEnabled(this, getConfigUpgradeMethod, param -> param.setResult(null));
} catch (Exception ignored) {
}

Class<?> configHandlerClass = Initiator.loadClass("com.tencent.mobileqq.app.ConfigHandler");
for (Method m : configHandlerClass.getDeclaredMethods()) {
Class<?>[] parameterTypes = m.getParameterTypes();
Expand Down

0 comments on commit f376784

Please sign in to comment.