From a4a632847b66b86b1d202841017752f6608afaf0 Mon Sep 17 00:00:00 2001 From: ACh Sulfate Date: Mon, 2 Oct 2023 13:33:17 +0800 Subject: [PATCH] fix: BrowserRestrictMitigation: CommonJsPluginFactory class not found --- .../java/cc/ioctl/hook/misc/BrowserRestrictMitigation.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/cc/ioctl/hook/misc/BrowserRestrictMitigation.java b/app/src/main/java/cc/ioctl/hook/misc/BrowserRestrictMitigation.java index cd7021536e..0d82549bb1 100644 --- a/app/src/main/java/cc/ioctl/hook/misc/BrowserRestrictMitigation.java +++ b/app/src/main/java/cc/ioctl/hook/misc/BrowserRestrictMitigation.java @@ -109,6 +109,13 @@ protected boolean initOnce() throws Exception { } } } + if (kCommonJsPluginFactory == null) { + Class kAbsWebView = Initiator.findClassWithSynthetics("com.tencent.mobileqq.webview.AbsWebView", 1); + if (kAbsWebView != null) { + Method myCommonJsPlugins = kAbsWebView.getDeclaredMethod("myCommonJsPlugins"); + kCommonJsPluginFactory = myCommonJsPlugins.getReturnType(); + } + } Objects.requireNonNull(kCommonJsPluginFactory, "kCommonJsPluginFactory is null"); Method m1 = ArraysKt.single(kCommonJsPluginFactory.getDeclaredMethods(), m -> m.getReturnType() == List.class); HookUtils.hookAfterIfEnabled(this, m1, param -> {