mirror of
https://github.com/areteruhiro/LIME-beta-hiro.git
synced 2025-02-10 23:41:38 +09:00
space
This commit is contained in:
parent
540b5c3d21
commit
17c88b079b
@ -26,16 +26,15 @@ public class RedirectWebView implements IHook {
|
|||||||
@Override
|
@Override
|
||||||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
Activity activity = (Activity) param.thisObject;
|
Activity activity = (Activity) param.thisObject;
|
||||||
|
|
||||||
View rootView = activity.getWindow().getDecorView().getRootView();
|
View rootView = activity.getWindow().getDecorView().getRootView();
|
||||||
WebView webView = findWebView(rootView);
|
WebView webView = findWebView(rootView);
|
||||||
|
|
||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
webView.setVisibility(View.GONE);
|
webView.setVisibility(View.GONE);
|
||||||
webView.stopLoading();
|
webView.stopLoading();
|
||||||
|
|
||||||
Uri uri = Uri.parse(webView.getUrl());
|
Uri uri = Uri.parse(webView.getUrl());
|
||||||
|
|
||||||
if (limeOptions.openInBrowser.checked) {
|
if (limeOptions.openInBrowser.checked) {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
intent.setData(uri);
|
intent.setData(uri);
|
||||||
@ -47,7 +46,7 @@ public class RedirectWebView implements IHook {
|
|||||||
.build();
|
.build();
|
||||||
tabsIntent.launchUrl(activity, uri);
|
tabsIntent.launchUrl(activity, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.finish();
|
activity.finish();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -55,6 +54,7 @@ public class RedirectWebView implements IHook {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private WebView findWebView(View view) {
|
private WebView findWebView(View view) {
|
||||||
if (view instanceof WebView) {
|
if (view instanceof WebView) {
|
||||||
return (WebView) view;
|
return (WebView) view;
|
||||||
|
Loading…
Reference in New Issue
Block a user