1
0
mirror of https://github.com/areteruhiro/LIME-beta-hiro.git synced 2025-02-05 21:11:39 +09:00
This commit is contained in:
Syuugo 2024-10-09 04:34:45 +09:00 committed by GitHub
parent 540b5c3d21
commit 17c88b079b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,16 +26,15 @@ public class RedirectWebView implements IHook {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Activity activity = (Activity) param.thisObject;
View rootView = activity.getWindow().getDecorView().getRootView();
WebView webView = findWebView(rootView);
if (webView != null) {
webView.setVisibility(View.GONE);
webView.stopLoading();
Uri uri = Uri.parse(webView.getUrl());
if (limeOptions.openInBrowser.checked) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
@ -47,7 +46,7 @@ public class RedirectWebView implements IHook {
.build();
tabsIntent.launchUrl(activity, uri);
}
activity.finish();
}
@ -55,6 +54,7 @@ public class RedirectWebView implements IHook {
}
);
}
private WebView findWebView(View view) {
if (view instanceof WebView) {
return (WebView) view;