导航菜单

页面标题

页面副标题

MX Player v1.97.8 - WebViewActivity.java 源代码

正在查看: MX Player v1.97.8 应用的 WebViewActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.mxplay.monetize.ui;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.WebView;
import android.widget.FrameLayout;
import defpackage.qsi;

public class WebViewActivity extends pg0 {
    public static final int f = 0;
    public WebView b;
    public Uri c;
    public boolean d = false;

    public final void onCreate(Bundle bundle) {
        super/*androidx.fragment.app.m*/.onCreate(bundle);
        this.c = getIntent().getData();
        int color = getResources().getColor(2131102467);
        getWindow().addFlags(Integer.MIN_VALUE);
        getWindow().clearFlags(67108864);
        getWindow().setStatusBarColor(color);
        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);
        }
        if (this.d) {
            this.b.getSettings().setMediaPlaybackRequiresUserGesture(false);
        }
        this.b.getSettings().setJavaScriptEnabled(true);
        this.b.getSettings().setBlockNetworkImage(false);
        this.b.getSettings().setMixedContentMode(0);
        this.b.setWebViewClient(new qsi(this));
        this.b.loadUrl(this.c.toString());
    }

    public final void onDestroy() {
        super.onDestroy();
        WebView webView = this.b;
        if (webView != null) {
            try {
                ViewParent parent = webView.getParent();
                if (parent instanceof ViewGroup) {
                    ((ViewGroup) parent).removeView(this.b);
                }
                this.b.onPause();
                this.b.removeAllViews();
                this.b.destroy();
            } catch (Exception unused) {
            }
            this.b = null;
        }
    }

    public final boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i == 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(i, keyEvent);
    }
}