导航菜单

页面标题

页面副标题

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

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

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


package com.mxtech.videoplayer.ad.online.tab;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import androidx.fragment.app.m;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.m.x.player.pandora.common.fromstack.From;
import com.mxtech.annotation.NotProguard;
import com.mxtech.videoplayer.ad.online.model.bean.next.WebTab;
import com.vungle.ads.internal.protos.Sdk$SDKError;
import defpackage.bc0;
import defpackage.ly8;
import defpackage.sf;
import defpackage.vk4;
import defpackage.w5c;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
import okhttp3.l;

public class WebTabFragment extends r71 implements View.OnClickListener, a {
    public WebView b;
    public boolean c;
    public boolean f;
    public WebTab g;
    public View h;
    public shc i;
    public View j;
    public wji k;
    public w5c l;
    public SwipeRefreshLayout m;
    public final ly8 n = new ly8(this);
    public final d o = new d();

    @NotProguard
    public static class ParametersWrapper {
        public Map<String, Object> parameters;
    }

    public class a implements SwipeRefreshLayout.f {
        public a() {
        }

        public final void onRefresh() {
            WebTabFragment.this.b.reload();
        }
    }

    public class b implements View.OnTouchListener {
        public b() {
        }

        @Override
        public final boolean onTouch(View view, MotionEvent motionEvent) {
            int actionMasked = motionEvent.getActionMasked();
            if (actionMasked == 3 || actionMasked == 1) {
                WebTabFragment.this.b.getParent().requestDisallowInterceptTouchEvent(false);
            }
            return false;
        }
    }

    public class c {
        public c() {
        }
    }

    public class d extends WebViewClient {
        public d() {
        }

        @Override
        public final void onPageFinished(WebView webView, String str) {
            super.onPageFinished(webView, str);
            WebTabFragment webTabFragment = WebTabFragment.this;
            if (vk4.h(webTabFragment.getActivity())) {
                bc0.a(Sdk$SDKError.b.AD_RESPONSE_RETRY_AFTER_VALUE, webTabFragment.h);
                e0g.b(webTabFragment.k, webTabFragment.j);
                webTabFragment.k = null;
                WebView webView2 = webTabFragment.b;
                if (webView2 != null) {
                    webView2.setVisibility(0);
                }
            }
            webTabFragment.m.setRefreshing(false);
        }

        @Override
        public final void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
            super.onReceivedError(webView, webResourceRequest, webResourceError);
            boolean b = shc.b(tya.m);
            WebTabFragment webTabFragment = WebTabFragment.this;
            if (!b) {
                webTabFragment.i.d();
            }
            webTabFragment.m.setRefreshing(false);
        }

        @Override
        public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
            WebTabFragment webTabFragment = WebTabFragment.this;
            m activity = webTabFragment.getActivity();
            if (activity == null || TextUtils.isEmpty(str)) {
                return true;
            }
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
            intent.addCategory("android.intent.category.DEFAULT");
            intent.addCategory("android.intent.category.BROWSABLE");
            if (sf.c(webTabFragment.getContext(), intent)) {
                activity.startActivity(intent);
            }
            return true;
        }
    }

    public final From getSelfStack() {
        WebTab webTab = this.g;
        return From.create(webTab.getId(), webTab.getName(), "tab");
    }

    public final void j9() {
        l lVar;
        if (this.f) {
            return;
        }
        this.f = true;
        String refreshPath = this.g.getRefreshPath();
        String str = null;
        try {
            l.a aVar = new l.a();
            aVar.f(null, refreshPath);
            lVar = aVar.c();
        } catch (IllegalArgumentException unused) {
            lVar = null;
        }
        if (lVar == null) {
            this.g.getRefreshPath();
            int i = d1j.a;
            try {
                l.a aVar2 = new l.a();
                aVar2.f(null, "https://www.mxplayer.in");
                lVar = aVar2.c();
            } catch (IllegalArgumentException unused2) {
                lVar = null;
            }
        }
        l.a f = lVar.f();
        f.b("theme", i0g.b().k() ? "dark" : "light");
        f.b("uuid", awh.c(getActivity()));
        ArrayList arrayList = e4a.a;
        try {
            Locale locale = tya.r;
            str = locale != null ? locale.getLanguage() : Locale.getDefault().getLanguage();
        } catch (Exception unused3) {
        }
        if (!TextUtils.isEmpty(str)) {
            f.b("app-language", str);
        }
        this.l.b(f.toString());
        this.k = e0g.a(this.j, 2131559272, 2131101581);
        this.b.setVisibility(8);
        if (shc.b(getActivity())) {
            return;
        }
        bc0.b(Sdk$SDKError.b.AD_RESPONSE_RETRY_AFTER_VALUE, this.h);
    }

    public final void o(Pair<Integer, Boolean> pair, Pair<Integer, Boolean> pair2) {
        if (shc.b(getActivity()) && this.h.getVisibility() == 0 && this.b != null) {
            bc0.a(Sdk$SDKError.b.AD_RESPONSE_RETRY_AFTER_VALUE, this.h);
            this.b.reload();
        }
    }

    @Override
    public final void onClick(View view) {
        if (!en2.a(400L) && view.getId() == 2131364030) {
            this.i.d();
            ei0.p(getActivity());
        }
    }

    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.g = getArguments().getSerializable("flow");
    }

    public final View onCreateView(@NonNull LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(2131559062, viewGroup, false);
        this.h = inflate.findViewById(2131364030);
        this.j = inflate.findViewById(2131362134);
        this.m = inflate.findViewById(2131365540);
        WebView webView = new WebView(requireContext().getApplicationContext());
        this.b = webView;
        this.m.addView(webView, new ViewGroup.LayoutParams(-1, -1));
        this.m.setOnRefreshListener(new a());
        getActivity();
        this.i = new shc(this);
        this.h.setOnClickListener(this);
        return inflate;
    }

    public final void onDestroyView() {
        super.onDestroyView();
        this.c = false;
        e0g.b(this.k, this.j);
        this.k = null;
        this.f = false;
        shc shcVar = this.i;
        if (shcVar != null) {
            shcVar.e();
        }
        WebView webView = this.b;
        if (webView != null) {
            try {
                yki.d(webView);
            } catch (Exception unused) {
            }
            this.b = null;
        }
    }

    @SuppressLint({"ClickableViewAccessibility"})
    public final void onViewCreated(@NonNull View view, Bundle bundle) {
        super/*androidx.fragment.app.Fragment*/.onViewCreated(view, bundle);
        this.c = true;
        this.b.getSettings().setJavaScriptEnabled(true);
        vsi.a(this.b.getSettings(), true);
        this.b.getSettings().setDomStorageEnabled(true);
        this.b.getSettings().setLoadsImagesAutomatically(true);
        this.b.getSettings().setBlockNetworkImage(false);
        this.b.getSettings().setMixedContentMode(0);
        w5c.b bVar = new w5c.b();
        bVar.b = this;
        bVar.c = this.b;
        bVar.h = false;
        bVar.d = this.o;
        bVar.g = this.n;
        this.l = bVar.a();
        if (getUserVisibleHint()) {
            j9();
        }
        this.b.setOnTouchListener(new b());
    }

    public final void setUserVisibleHint(boolean z) {
        super.setUserVisibleHint(z);
        if (z && this.c) {
            j9();
        }
    }
}