Skip to content

Commit

Permalink
space
Browse files Browse the repository at this point in the history
  • Loading branch information
s1204IT authored Oct 8, 2024
1 parent 540b5c3 commit 17c88b0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ public void hook(LimeOptions limeOptions, XC_LoadPackage.LoadPackageParam loadPa
@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);
Expand All @@ -47,14 +46,15 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
.build();
tabsIntent.launchUrl(activity, uri);
}

activity.finish();

}
}
}
);
}

private WebView findWebView(View view) {
if (view instanceof WebView) {
return (WebView) view;
Expand Down

0 comments on commit 17c88b0

Please sign in to comment.