正在查看: MX Player v1.97.8 应用的 WebViewActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: MX Player v1.97.8 应用的 WebViewActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mxtech.videoplayer;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.webkit.WebView;
import android.widget.FrameLayout;
import com.microsoft.identity.common.java.AuthenticationConstants;
import defpackage.psi;
import defpackage.qbg;
import defpackage.rsi;
import defpackage.tya;
import defpackage.vsi;
import defpackage.yki;
public class WebViewActivity extends pg0 {
public static final int h = tya.m.getResources().getColor(2131102467);
public static Class i = WebViewActivity.class;
public WebView b;
public Uri c;
public boolean d = false;
public boolean f = false;
public boolean g;
public static void R5(Context context, String str) {
U5(context, str, false, true, false, h);
}
public static void S5(Context context, String str, boolean z) {
U5(context, str, true, false, z, h);
}
public static void U5(Context context, String str, boolean z, boolean z2, boolean z3, int i2) {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str.trim())) {
return;
}
Intent intent = new Intent(context, (Class<?>) i);
intent.setData(Uri.parse(str));
intent.putExtra("auto_play", z);
intent.putExtra("plain_mode", z2);
intent.putExtra("handle_market", z3);
intent.putExtra("status_bar", i2);
context.startActivity(intent);
}
public static void W5(e eVar, String str) {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str.trim())) {
return;
}
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
intent.addCategory("android.intent.category.BROWSABLE");
intent.addFlags(268435456);
eVar.startActivity(intent);
}
public final void onCreate(Bundle bundle) {
Uri uri;
String host;
super/*androidx.fragment.app.m*/.onCreate(bundle);
Uri data = getIntent().getData();
this.c = data;
if (data == null) {
finish();
return;
}
qbg.d(this, getIntent().getIntExtra("status_bar", h));
WebView webView = new WebView(this);
this.b = webView;
webView.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
setContentView(this.b);
Intent intent = getIntent();
if (intent != null) {
this.d = intent.getBooleanExtra("auto_play", false);
this.f = intent.getBooleanExtra("handle_market", false);
this.g = intent.getBooleanExtra("plain_mode", false);
}
if (this.d) {
this.b.getSettings().setMediaPlaybackRequiresUserGesture(false);
}
this.b.getSettings().setJavaScriptEnabled(true);
this.b.getSettings().setBlockNetworkImage(false);
this.b.getSettings().setMixedContentMode(0);
vsi.a(this.b.getSettings(), true);
this.b.getSettings().setDatabaseEnabled(true);
this.b.getSettings().setDomStorageEnabled(true);
this.b.getSettings().setSupportZoom(true);
this.b.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
this.b.getSettings().setBuiltInZoomControls(true);
if (!this.g && AuthenticationConstants.HTTPS_PROTOCOL_STRING.equalsIgnoreCase(this.c.getScheme()) && ((uri = this.c) == null || (host = uri.getHost()) == null || (!host.contains("j2inter.com") && !host.contains("support.mxplayer.in")))) {
this.b.setWebChromeClient(new psi());
} else {
this.b.setWebViewClient(new rsi(this));
}
this.b.loadUrl(this.c.toString());
}
public final void onDestroy() {
super.onDestroy();
WebView webView = this.b;
if (webView != null) {
try {
yki.d(webView);
this.b.onPause();
this.b.removeAllViews();
this.b.destroy();
} catch (Exception unused) {
}
this.b = null;
}
}
public final boolean onKeyDown(int i2, KeyEvent keyEvent) {
if (i2 == 4 && this.b.canGoBack()) {
String url = this.b.getUrl();
?? pathSegments = TextUtils.isEmpty(url) ? 0 : Uri.parse(url).getPathSegments();
Uri uri = this.c;
?? pathSegments2 = uri != null ? uri.getPathSegments() : 0;
if (pathSegments == 0 || pathSegments2 == 0 || !pathSegments2.containsAll(pathSegments) || !pathSegments.containsAll(pathSegments2)) {
this.b.goBack();
return true;
}
}
return super.onKeyDown(i2, keyEvent);
}
}