Skip to content

Commit

Permalink
fix: DefaultFont on QQNT
Browse files Browse the repository at this point in the history
Signed-off-by: Hicores <me@hicore.cc>
  • Loading branch information
Hicores committed Jun 21, 2023
1 parent e49037f commit eb758dd
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions app/src/main/java/cc/ioctl/hook/chat/DefaultFont.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import cc.hicore.QApp.QAppUtils;
import cc.ioctl.util.HookUtils;
import com.tencent.qqnt.kernel.nativeinterface.VASMsgFont;
import io.github.qauxv.base.annotation.FunctionHookEntry;
import io.github.qauxv.base.annotation.UiItemAgentEntry;
import io.github.qauxv.dsl.FunctionEntryRouter.Locations.Simplify;
Expand Down Expand Up @@ -119,14 +121,21 @@ public Step[] makePreparationSteps() {

@Override
public boolean initOnce() throws ReflectiveOperationException {
Method method = DexKit.loadMethodFromCache(NTextItemBuilder_setETText.INSTANCE);
Objects.requireNonNull(method, "NTextItemBuilder_setETText.INSTANCE");
HookUtils.hookBeforeIfEnabled(this, method, param -> param.setResult(null));

Method enlargeTextMsg = Initiator.loadClass("com.tencent.mobileqq.vas.font.api.impl.FontManagerServiceImpl")
.getDeclaredMethod("enlargeTextMsg", TextView.class);
HookUtils.hookBeforeIfEnabled(this, enlargeTextMsg, param -> param.setResult(null));
return true;
if (QAppUtils.isQQnt()){
Method getFontID = VASMsgFont.class.getDeclaredMethod("getFontId");
HookUtils.hookBeforeIfEnabled(this, getFontID, param -> param.setResult(0));
return true;
}else {
Method method = DexKit.loadMethodFromCache(NTextItemBuilder_setETText.INSTANCE);
Objects.requireNonNull(method, "NTextItemBuilder_setETText.INSTANCE");
HookUtils.hookBeforeIfEnabled(this, method, param -> param.setResult(null));

Method enlargeTextMsg = Initiator.loadClass("com.tencent.mobileqq.vas.font.api.impl.FontManagerServiceImpl")
.getDeclaredMethod("enlargeTextMsg", TextView.class);
HookUtils.hookBeforeIfEnabled(this, enlargeTextMsg, param -> param.setResult(null));
return true;
}

}

@Override
Expand Down

0 comments on commit eb758dd

Please sign in to comment.