Skip to content

Commit

Permalink
fix: BrowserRestrictMitigation: CommonJsPluginFactory class not found
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Oct 2, 2023
1 parent e192f09 commit a4a6328
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down

0 comments on commit a4a6328

Please sign in to comment.