导航菜单

页面标题

页面副标题

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

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

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


package com.mxtech.videoplayer.ad;

import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Dialog;
import android.app.PictureInPictureParams;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.m;
import com.airbnb.lottie.LottieAnimationView;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.admanager.AdManagerAdView;
import com.google.android.material.snackbar.BaseTransientBottomBar;
import com.google.android.material.snackbar.Snackbar;
import com.m.x.player.pandora.common.fromstack.From;
import com.m.x.player.pandora.common.fromstack.FromStack;
import com.microsoft.identity.common.java.WarningType;
import com.mxplay.monetize.v2.banner.BannerView;
import com.mxtech.io.Files;
import com.mxtech.videoplayer.ActivityScreen;
import com.mxtech.videoplayer.ad.local.ActivityPreferencesOnlineTheme;
import com.mxtech.videoplayer.ad.local.netstream.c;
import com.mxtech.videoplayer.ad.online.download.c;
import com.mxtech.videoplayer.ad.online.download.k;
import com.mxtech.videoplayer.ad.online.forceupdate.b;
import com.mxtech.videoplayer.ad.online.model.bean.ConfigBean;
import com.mxtech.videoplayer.ad.online.model.bean.LocalVideoInfo;
import com.mxtech.videoplayer.ad.online.model.bean.next.ResourceFlow;
import com.mxtech.videoplayer.ad.online.mxexo.WebLinksRouterActivity;
import com.mxtech.videoplayer.ad.online.mxexo.service.ExoPlayerService;
import com.mxtech.videoplayer.ad.view.PreviewExpandView;
import com.mxtech.videoplayer.n;
import com.mxtech.videoplayer.preference.ActivityPreferences;
import com.mxtech.videoplayer.service.PlayService;
import com.mxtech.videoplayer.widget.PlaybackController;
import defpackage.ai8;
import defpackage.ana;
import defpackage.aqd;
import defpackage.ata;
import defpackage.b3b;
import defpackage.b5c;
import defpackage.bf0;
import defpackage.c25;
import defpackage.cn;
import defpackage.coa;
import defpackage.cpa;
import defpackage.cs;
import defpackage.cti;
import defpackage.d05;
import defpackage.d0c;
import defpackage.d1j;
import defpackage.d25;
import defpackage.dna;
import defpackage.dq7;
import defpackage.dw4;
import defpackage.eh3;
import defpackage.en2;
import defpackage.fb1;
import defpackage.gfh;
import defpackage.gqi;
import defpackage.i9d;
import defpackage.ia9;
import defpackage.ina;
import defpackage.j1b;
import defpackage.jnc;
import defpackage.k0d;
import defpackage.koa;
import defpackage.ks5;
import defpackage.ktc;
import defpackage.lg0;
import defpackage.lh;
import defpackage.mdg;
import defpackage.mh;
import defpackage.mha;
import defpackage.ndd;
import defpackage.nod;
import defpackage.oge;
import defpackage.om6;
import defpackage.ood;
import defpackage.oxf;
import defpackage.pa8;
import defpackage.pdd;
import defpackage.pl;
import defpackage.pl0;
import defpackage.pp;
import defpackage.q9c;
import defpackage.qge;
import defpackage.qh;
import defpackage.qj6;
import defpackage.qp;
import defpackage.r74;
import defpackage.rh;
import defpackage.s0b;
import defpackage.s31;
import defpackage.shc;
import defpackage.sj;
import defpackage.tgg;
import defpackage.th;
import defpackage.tj5;
import defpackage.tya;
import defpackage.ul;
import defpackage.uod;
import defpackage.vf;
import defpackage.vg3;
import defpackage.vm3;
import defpackage.w7;
import defpackage.weh;
import defpackage.wfc;
import defpackage.wh;
import defpackage.wma;
import defpackage.wpd;
import defpackage.wv4;
import defpackage.x6g;
import defpackage.xa9;
import defpackage.xe0;
import defpackage.xh;
import defpackage.xk4;
import defpackage.xv4;
import defpackage.y82;
import defpackage.yhg;
import defpackage.yki;
import defpackage.yv4;
import defpackage.z4i;
import defpackage.z6h;
import defpackage.zhg;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import kotlin.coroutines.CoroutineContext;
import kotlin.text.StringsKt;
import okhttp3.p;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONObject;

@TargetApi(14)
public class ActivityScreen extends com.mxtech.videoplayer.ActivityScreen implements BannerView.b, shc.a, om6.a, vg3, vf, c.InterfaceC0061c, oh8 {
    public static final int q5 = 0;
    public View A4;
    public int B4;
    public boolean C4;
    public boolean D4;
    public ana E4;
    public shc F4;
    public Uri G4;
    public boolean H4 = false;
    public final om6 I4;
    public h J4;
    public boolean K4;
    public boolean L4;
    public i9d M4;
    public wma N4;
    public gqi O4;
    public k P4;
    public dw4 Q4;
    public Uri R4;
    public String S4;
    public com.mxtech.videoplayer.ad.online.download.c T4;
    public d05 U4;
    public c25 V4;
    public uod W4;
    public boolean X4;
    public boolean Y4;
    public FrameLayout Z4;
    public Dialog a5;
    public ks5 b5;
    public coa c5;
    public koa d5;
    public q9c e5;
    public boolean f5;
    public th g5;
    public boolean h5;
    public String i5;
    public final b j5;
    public final c k5;
    public final w7 l5;
    public ina m5;
    public final g n5;
    public final a o5;
    public aqd p5;
    public RelativeLayout w4;
    public View x4;
    public View y4;
    public View z4;

    public class a implements pig {
        public a() {
        }

        public final void i4() {
            boolean a = tma.a();
            ActivityScreen activityScreen = ActivityScreen.this;
            if (a) {
                c cVar = a.d;
                int i = ActivityScreen.q5;
                activityScreen.t8(cVar);
            }
            aqd aqdVar = activityScreen.p5;
            if (aqdVar != null) {
                zhg zhgVar = (zhg) aqdVar.c.getValue();
                zhgVar.getClass();
                xfg.C(jz9.I(zhgVar), (CoroutineContext) null, (fs3) null, new yhg(zhgVar, null), 3);
            }
        }
    }

    public class b extends ktc<i9d> {
        public b() {
        }

        @Override
        public final void V7(Object obj, pa8 pa8Var) {
            ActivityScreen activityScreen = ActivityScreen.this;
            if (activityScreen.g5 == null) {
                activityScreen.g5 = new th(this, 0);
            }
            Handler handler = activityScreen.O;
            handler.removeCallbacks(activityScreen.g5);
            handler.postDelayed(activityScreen.g5, 1500L);
        }

        @Override
        public final void e4(Object obj, pa8 pa8Var, int i) {
            ((i9d) obj).V();
        }

        @Override
        public final void q8(Object obj, pa8 pa8Var) {
            ActivityScreen activityScreen = ActivityScreen.this;
            if (activityScreen.D4) {
                return;
            }
            activityScreen.oc();
        }

        @Override
        public final void w4(Object obj) {
            ((i9d) obj).T(false);
        }
    }

    public class c extends oxf<i9d> {
        public c() {
        }

        @Override
        public final void q8(Object obj, pa8 pa8Var) {
            int i = ActivityScreen.q5;
            ActivityScreen.this.nc();
        }
    }

    public class e implements View.OnClickListener {
        public e() {
        }

        @Override
        public final void onClick(View view) {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.D4 = true;
            activityScreen.ic(false);
        }
    }

    public class f {
    }

    public static final class h {
        public static final h b;
        public static final h c;
        public static final h[] d;

        h EF0;

        static {
            h hVar = new h("PLAYING", 0);
            h hVar2 = new h("CLOSE", 1);
            b = hVar2;
            h hVar3 = new h("NONE", 2);
            c = hVar3;
            d = new h[]{hVar, hVar2, hVar3};
        }

        public h() {
            throw null;
        }

        public static h valueOf(String str) {
            return (h) Enum.valueOf(h.class, str);
        }

        public static h[] values() {
            return (h[]) d.clone();
        }
    }

    public ActivityScreen() {
        om6 om6Var = new om6();
        om6Var.a = new ArrayList();
        om6Var.b = new ArrayList();
        this.I4 = om6Var;
        this.J4 = h.c;
        this.K4 = false;
        this.V4 = new c25();
        this.X4 = false;
        this.Y4 = false;
        this.f5 = false;
        this.g5 = null;
        this.h5 = false;
        this.j5 = new b();
        this.k5 = new c();
        this.l5 = new w7(this);
        this.n5 = new g();
        this.o5 = new a();
        if (om6Var.a == null) {
            om6Var.a = new ArrayList();
        }
        if (om6Var.a.contains(this)) {
            return;
        }
        om6Var.a.add(this);
    }

    public static void Ob(ActivityScreen activityScreen, boolean z, ArrayList arrayList) {
        activityScreen.J2 = arrayList;
        super.r7(z);
    }

    public static void Pb(ActivityScreen activityScreen, FromStack fromStack, boolean z) {
        Uri uri;
        activityScreen.getClass();
        z6h.b(2131887481, false);
        String str = activityScreen.V4.a;
        if (TextUtils.isEmpty(str) && (uri = activityScreen.V.o) != null) {
            str = uri.toString();
        }
        String str2 = str;
        if (TextUtils.isEmpty(str2)) {
            return;
        }
        new d25(activityScreen.T4, str2, activityScreen.V4, fromStack, z).a(activityScreen);
    }

    @NonNull
    public static FromStack Ub() {
        return FromStack.empty().newAndPush(From.simple("localPlayback"));
    }

    @Override
    public final void A6() {
        if (isFinishing() || t6()) {
            if (gdg.k9(getSupportFragmentManager())) {
                u6();
            }
            super.A6();
        } else if (!this.L) {
            this.L = true;
            ce.a(this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 1);
            this.M = true;
        } else if (ce.b(this, "android.permission.WRITE_EXTERNAL_STORAGE")) {
            gdg.l9(getSupportFragmentManager(), 1, true);
        } else {
            gdg.l9(getSupportFragmentManager(), 2, true);
        }
    }

    @Override
    public final void A9(boolean z) {
        if (z) {
            lc();
        } else {
            nc();
        }
    }

    @Override
    public final void B3() {
        n nVar;
        PreviewExpandView previewExpandView;
        super.B3();
        gqi gqiVar = this.O4;
        if (gqiVar == null || gqiVar.b == null || (nVar = gqiVar.a) == null) {
            return;
        }
        long L = nVar.L();
        int i = gqiVar.f;
        int i2 = (int) (L / 1000);
        if (10 != i2 && (i == 0 || i != i2)) {
            gqiVar.a();
        } else {
            if (gqiVar.g || (previewExpandView = gqiVar.d) == null) {
                return;
            }
            gqiVar.g = true;
            previewExpandView.a(false);
            gqiVar.c.postDelayed(gqiVar.j, 5000L);
        }
    }

    @Override
    public final void B9(Uri uri) {
        if (uri != null) {
            this.V4.a = uri.toString();
        }
    }

    @Override
    public final void C() {
        super.C();
        if (this.N4 == null || !jnc.b().d(this)) {
            return;
        }
        wma wmaVar = this.N4;
        if (wmaVar.g == null) {
            return;
        }
        int c2 = jnc.b().c(wmaVar.c);
        View findViewById = wmaVar.g.findViewById(2131365604);
        ViewGroup.MarginLayoutParams b2 = yki.b(wmaVar.g.findViewById(2131366932));
        ViewGroup.MarginLayoutParams b3 = yki.b(findViewById);
        if (b3 == null) {
            return;
        }
        int i = this.m4.f;
        if (i == 0) {
            b3.rightMargin = 0;
            b2.rightMargin = 0;
        } else if (i == 1) {
            b2.rightMargin = c2;
            wmaVar.n(c2, c2);
        } else {
            if (i != 3) {
                return;
            }
            wmaVar.n(c2, 0);
        }
    }

    @Override
    public final void D2(PlaybackController playbackController, int i, int i2, boolean z) {
        super.D2(playbackController, i, i2, z);
        uod uodVar = this.W4;
        if (uodVar != null) {
            boolean z2 = false;
            boolean z3 = i != 0;
            bpb bpbVar = this.E1;
            if (bpbVar != null && bpbVar.p) {
                z2 = true;
            }
            boolean Tb = Tb();
            PlaybackController playbackController2 = this.l0;
            int i3 = this.q;
            if (!z2 && Tb) {
                uodVar.e(playbackController2, i3, z3);
            } else {
                uodVar.c(playbackController2, i3, z3);
                uodVar.d();
            }
        }
    }

    @Override
    public final void D9(Uri uri) {
        int i = d1j.a;
        if (uri == null || Q8() || TextUtils.equals(this.j0, "ins_video_stream")) {
            return;
        }
        String str = this.V4.a;
        if (TextUtils.isEmpty(str)) {
            return;
        }
        Uri parse = Uri.parse(str);
        String scheme = parse.getScheme();
        if (TextUtils.isEmpty(scheme)) {
            this.R4 = null;
            this.S4 = null;
            this.U4 = null;
            Rb();
            return;
        }
        if (!scheme.startsWith("http")) {
            this.R4 = null;
            this.S4 = null;
            this.U4 = null;
            Rb();
            return;
        }
        String path = parse.getPath();
        if (TextUtils.isEmpty(path)) {
            this.R4 = null;
            this.S4 = null;
            this.U4 = null;
            Rb();
            return;
        }
        if (ksi.b.contains(Files.n(path.toLowerCase(Locale.ENGLISH)))) {
            this.R4 = null;
            this.S4 = null;
            this.U4 = null;
            Rb();
            return;
        }
        vab vabVar = vab.a;
        if (vabVar.b() && vabVar.a(parse)) {
            if (str != null && str.length() != 0) {
                String lowerCase = str.toLowerCase(Locale.ROOT);
                if (StringsKt.B(lowerCase, "youtube.com/watch?v", false) || StringsKt.B(lowerCase, "youtu.be/", false)) {
                    return;
                }
            }
            if (Q8() || TextUtils.equals(this.j0, "ins_video_stream")) {
                return;
            }
            this.R4 = parse;
            this.S4 = parse.toString();
            Rb();
            String uri2 = parse.toString();
            if (!TextUtils.isEmpty(this.V4.b)) {
                uri2 = this.V4.b;
            } else if (!TextUtils.isEmpty(this.V4.a)) {
                uri2 = this.V4.a;
            }
            if (!Q8()) {
                TextUtils.equals(this.j0, "ins_video_stream");
            }
            this.P4 = com.mxtech.videoplayer.ad.online.download.d.f(getApplicationContext()).m(uri2, new d());
        }
    }

    @Override
    public final void F6() {
        if (this.B1 && !this.i0 && dq7.h()) {
            this.n2 = true;
            String str = this.C1;
            Intent intent = new Intent((Context) this, (Class<?>) StartExternalMusicActivity.class);
            intent.putExtra("PARAM_URI", str);
            startActivity(intent);
            finish();
        }
    }

    @Override
    public final void F8() {
        if (dq7.h()) {
            tgg.b.getClass();
        }
    }

    @Override
    public final boolean G3() {
        return this.R4 != null;
    }

    @Override
    public final void I(dw4 dw4Var, wv4 wv4Var, yv4 yv4Var, boolean z) {
        if (this.S4 == null || dc(dw4Var.X())) {
            return;
        }
        this.Q4 = dw4Var;
    }

    @Override
    public void I9() {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ad.ActivityScreen.I9():void");
    }

    @Override
    public final void Ia() {
        if (en2.a(400L)) {
            return;
        }
        Ta();
        String str = weh.a;
        Uri uri = this.V.o;
        if (uri == null) {
            return;
        }
        ArrayList arrayList = new ArrayList(Arrays.asList(uri));
        boolean X = this.V.X();
        fb1.a.b(this, arrayList);
        Intent a2 = fb1.a.a(arrayList, !X ? 1 : 0, X ? 1 : 0);
        Bundle bundle = new Bundle();
        bundle.putParcelable("PARAM_SHARE_INTENT", a2);
        bundle.putString("PARAM_FROM", "FROM_PLAYER_MORE");
        bundle.putBoolean("PARAM_LOCAL_MUSIC", false);
        ina inaVar = new ina();
        inaVar.setArguments(bundle);
        this.m5 = inaVar;
        inaVar.show(getSupportFragmentManager(), "LocalShareDialogFragment");
    }

    @Override
    public final void J7() {
        if (!bd0.j) {
            bd0.f = dq7.h() && dq7.A();
            bd0.j = true;
        }
        if (bd0.f) {
            startActivity(new Intent(getApplicationContext(), (Class<?>) ActivityPreferencesOnlineTheme.class));
        } else {
            startActivity(new Intent(getApplicationContext(), (Class<?>) ActivityPreferences.class));
        }
    }

    @Override
    public final void L9(Uri uri) {
        c25 c25Var = new c25();
        this.V4 = c25Var;
        c25Var.a = uri.toString();
    }

    public final void M4() {
        Ta();
        int i = 0;
        if (this.Q4 != null) {
            d05 d05Var = this.U4;
            if (d05Var != null) {
                if (d05Var == d05.f) {
                    View decorView = getWindow().getDecorView();
                    qh qhVar = new qh(this, i);
                    int[] iArr = Snackbar.u;
                    Snackbar h2 = Snackbar.h(decorView, decorView.getResources().getText(2131891114), 0);
                    h2.i(((BaseTransientBottomBar) h2).b.getText(2131891261), qhVar);
                    h2.k();
                    return;
                }
                if (d05Var != d05.c && d05Var != d05.b && d05Var != d05.d) {
                    z6h.b(2131887481, false);
                    this.T4.u(this.Q4);
                    return;
                }
                View decorView2 = getWindow().getDecorView();
                rh rhVar = new rh(this, i);
                int[] iArr2 = Snackbar.u;
                Snackbar h3 = Snackbar.h(decorView2, decorView2.getResources().getText(2131891113), 0);
                h3.i(((BaseTransientBottomBar) h3).b.getText(2131891261), rhVar);
                h3.k();
                return;
            }
            return;
        }
        Uri uri = this.V.o;
        if (uri != null) {
            p pVar = z4i.a;
            if (jz9.N(this)) {
                String str = this.V4.d;
                if (TextUtils.isEmpty(str)) {
                    str = com.mxtech.videoplayer.ad.online.download.d.j(uri);
                }
                c25 c25Var = this.V4;
                String str2 = c25Var.f;
                if (str2 == null) {
                    str2 = "";
                }
                FromStack Ub = Ub();
                c25 c25Var2 = this.V4;
                boolean z = c25Var2.i;
                String str3 = c25Var2.a;
                boolean[] zArr = {z};
                eh3 eh3Var = new eh3();
                Bundle d2 = lg0.d("videoTitle", str, "videoCover", str2);
                d2.putString("downloadUrl", str3);
                d2.putLong("size", c25Var.h);
                d2.putBoolean("isMDisk", zArr[0]);
                d2.putParcelable(FromStack.FROM_LIST, Ub);
                eh3Var.setArguments(d2);
                eh3Var.f = new wh(this, Ub, eh3Var);
                this.s2 = false;
                eh3Var.showNow(getSupportFragmentManager(), "download");
            }
        }
    }

    @Override
    public final void M9(long j) {
        String str = this.V4.g;
        if (j <= 0 || str == null || str.length() == 0) {
            return;
        }
        ((b3b) s0b.e()).submit(new k0d(str, "playback_end", j, true));
    }

    @Override
    public final void N3() {
        n nVar = this.V;
        if (nVar != null) {
            this.L4 = nVar.isPlaying();
            this.V.p0(0);
        }
    }

    @Override
    public final void N9(int r14, int r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ad.ActivityScreen.N9(int, int):void");
    }

    @Override
    public final void O3() {
        if (koa.s || ec()) {
            return;
        }
        super.O3();
    }

    @Override
    public final void P4(int i, int i2, int i3) {
        SurfaceView surfaceView;
        super.P4(i, i2, i3);
        if (i == 5) {
            this.D4 = false;
            Wb().a().c(this.V.o);
        } else if (i == 4 && i3 == 1) {
            this.D4 = true;
            int i4 = d1j.a;
        }
        if (this.V.L == 4 && (i2 == 7 || ec())) {
            this.D4 = true;
        }
        oc();
        n nVar = this.V;
        int i5 = nVar.L;
        if ((i5 == 5 || (i5 == 4 && i2 != 7)) && this.N4 != null && nVar != null) {
            if (!(Build.VERSION.SDK_INT >= 26 ? isInPictureInPictureMode() : false)) {
                wma wmaVar = this.N4;
                int i6 = this.V.L;
                if (wmaVar.p != i6) {
                    wmaVar.f(i6);
                } else if (wmaVar.q != i6) {
                    wmaVar.q = Integer.MIN_VALUE;
                }
            }
        }
        gqi gqiVar = this.O4;
        if (gqiVar != null) {
            if (i == -1) {
                gqiVar.c.removeCallbacks(gqiVar.i);
            } else if (i == 0) {
                Handler handler = gqiVar.c;
                gqi.a aVar = gqiVar.i;
                handler.removeCallbacks(aVar);
                handler.post(aVar);
            } else if (i == 1) {
                gqiVar.c.removeCallbacks(gqiVar.i);
            } else if (i == 3) {
                Handler handler2 = gqiVar.c;
                gqi.a aVar2 = gqiVar.i;
                handler2.removeCallbacks(aVar2);
                handler2.post(aVar2);
            } else if (i == 4) {
                gqiVar.c.removeCallbacks(gqiVar.i);
            } else if (i == 5) {
                Handler handler3 = gqiVar.c;
                gqi.a aVar3 = gqiVar.i;
                handler3.removeCallbacks(aVar3);
                handler3.post(aVar3);
            } else if (i == 6) {
                gqiVar.c.removeCallbacks(gqiVar.i);
            }
        }
        if (!ec() || i > 5) {
            if (this.V.isPlaying()) {
                this.X4 = false;
                return;
            }
            return;
        }
        if (this.Y4 && i == 3 && (surfaceView = this.J0) != null) {
            surfaceView.setVisibility(8);
            this.Y4 = false;
        }
        this.V.p0(0);
        if (L8()) {
            u8();
        }
        this.X4 = true;
    }

    public final boolean Qb() {
        Pair a2 = shc.a(this);
        return (((Integer) a2.first).intValue() == 0 || (40 == ((Integer) a2.first).intValue() && !((Boolean) a2.second).booleanValue())) && jc() && hc();
    }

    @Override
    public final void Ra(boolean r4) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ad.ActivityScreen.Ra(boolean):void");
    }

    public final void Rb() {
        k kVar = this.P4;
        if (kVar != null) {
            kVar.c.removeCallbacksAndMessages(null);
            this.P4 = null;
        }
    }

    @Override
    public final boolean S6() {
        ks5 ks5Var = this.b5;
        return (ks5Var == null || !this.X4 || ks5Var.T0) ? false : true;
    }

    @Override
    public final void Sa() {
        z6h.b(2131889435, false);
    }

    public final void Sb() {
        if (this.J4 == h.b && jc()) {
            gc();
            ana anaVar = this.E4;
            if (anaVar.b() || anaVar.g != ana.a.d) {
                return;
            }
            anaVar.h = ana.b.b;
            m mVar = anaVar.b.get();
            if (anaVar.f != null || mVar == null) {
                return;
            }
            FragmentManager supportFragmentManager = mVar.getSupportFragmentManager();
            nod nodVar = new nod();
            anaVar.f = nodVar;
            nodVar.setCancelable(false);
            anaVar.f.show(supportFragmentManager, "PlayingLoadingDialogFragment");
        }
    }

    public final boolean Tb() {
        View view;
        if (koa.s) {
            return false;
        }
        RelativeLayout relativeLayout = this.w4;
        if (relativeLayout != null && relativeLayout.getVisibility() == 0) {
            return false;
        }
        wma wmaVar = this.N4;
        if ((wmaVar != null && (view = wmaVar.g) != null && view.getVisibility() == 0) || isInPictureInPictureMode()) {
            return false;
        }
        bpb bpbVar = this.E1;
        return (bpbVar == null || !bpbVar.p) && !ec() && this.p.j() == 0 && this.f;
    }

    @Override
    public final void V3() {
        ac();
    }

    @Override
    public final void Va() {
        PlayService playService;
        if (this.V != null && (playService = PlayService.L0) != null) {
            playService.K0 = new c();
        }
        if (vm3.b(this) && mc()) {
            this.V.O0();
        }
    }

    @NonNull
    public final String Vb() {
        Bundle extras;
        Intent intent = getIntent();
        String string = (intent == null || (extras = intent.getExtras()) == null) ? null : extras.getString("tr_parameter");
        return !(string == null || StringsKt.I(string)) ? "pauseBlockWeb" : "pauseBlock";
    }

    @Override
    public final void W2() {
        JSONObject jSONObject;
        JSONObject jSONObject2;
        Bundle extras;
        Uri uri = pp.b;
        Uri build = uri.buildUpon().appendPath(Vb()).build();
        cn cnVar = b5c.a;
        i9d d2 = b5c.a.d(build);
        this.M4 = d2;
        if (d2 != null) {
            JSONObject jSONObject3 = d2.o;
            if (jSONObject3 != null) {
                this.f5 = jSONObject3.optInt("preloadCustom", 1) == 1;
            }
            this.M4.getClass();
            this.M4.W(this.j5);
            if (vm3.b(this)) {
                fc();
            }
        }
        if (this.W4 == null) {
            Intent intent = getIntent();
            String string = (intent == null || (extras = intent.getExtras()) == null) ? null : extras.getString("tr_parameter");
            if (string == null || StringsKt.I(string)) {
                return;
            }
            uod uodVar = new uod(this);
            this.W4 = uodVar;
            uodVar.k = (ViewStub) findViewById(2131367756);
            c cVar = this.k5;
            uodVar.m = cVar;
            uodVar.f = new Handler(Looper.getMainLooper(), uodVar);
            i9d d3 = b5c.a.d(uri.buildUpon().appendPath("localWebPlayerBottom").build());
            uodVar.g = d3;
            if (d3 != null) {
                d3.W(cVar);
            }
            i9d i9dVar = uodVar.g;
            if (i9dVar != null) {
                i9dVar.X();
            }
            i9d i9dVar2 = uodVar.g;
            uodVar.h = i9dVar2 != null ? i9dVar2.J : 15;
            uodVar.j = (i9dVar2 == null || (jSONObject2 = i9dVar2.o) == null) ? 5 : jSONObject2.optInt("startTimeInSec");
            i9d i9dVar3 = uodVar.g;
            uodVar.i = (i9dVar3 == null || (jSONObject = i9dVar3.o) == null) ? 10 : jSONObject.optInt("displayTimeInSec");
            ((cn) r74.g()).N(uodVar);
            uod uodVar2 = this.W4;
            long max = Math.max(1, uodVar2.h) * 1000;
            if (uodVar2.c <= 0) {
                uodVar2.c = SystemClock.elapsedRealtime();
                max = Math.max(0, uodVar2.j) * 1000;
            }
            if (!uodVar2.f.hasMessages(1)) {
                uodVar2.f.sendEmptyMessageDelayed(1, max);
            }
            uodVar2.b();
            bpb bpbVar = this.E1;
            if (bpbVar != null) {
                bpbVar.k = this.l5;
            }
        }
    }

    @Override
    public final int W7() {
        if (bd0.f) {
            return 2131952642;
        }
        String string = tya.o.b.getString("playback.theme", null);
        if (string == null || string.length() <= 0) {
            string = tya.w().getString(2131887230);
        }
        return s6d.y(string);
    }

    @Override
    public final void Wa() {
        fke.a = this.j4;
        fke.b("local");
    }

    public final q9c Wb() {
        if (this.e5 == null) {
            this.e5 = new q9c(tya.m, new ia9());
        }
        return this.e5;
    }

    @Override
    public final boolean X6() {
        return super.X6() || ec() || koa.s;
    }

    public final FrameLayout Xb() {
        if (this.Z4 == null) {
            this.Z4 = (FrameLayout) findViewById(2131367583);
        }
        return this.Z4;
    }

    public final coa Yb() {
        if (this.c5 == null) {
            coa coaVar = new coa();
            this.c5 = coaVar;
            coaVar.a(getIntent(), this.q, Ub(), Xb(), getSupportFragmentManager());
        }
        return this.c5;
    }

    @Override
    public final void Z9() {
        if (jnc.b().d(this)) {
            int c2 = jnc.b().c(this);
            ana anaVar = this.E4;
            if (anaVar != null) {
                int i = this.m4.f;
                ood oodVar = anaVar.e;
                if (oodVar != null) {
                    oodVar.q9(i, c2);
                }
            }
        }
    }

    public final koa Zb() {
        JSONObject a2;
        if (this.d5 == null) {
            koa koaVar = new koa();
            this.d5 = koaVar;
            if (koaVar.a().a() != null && (a2 = koaVar.a().a()) != null) {
                koaVar.g = a2.optInt("retry", 0);
                koaVar.f = a2.optInt("minDuration", 0) * 1000;
                koaVar.b = a2.optInt("showInterval", 0);
                koaVar.d = a2.optInt("percent", 0);
                koaVar.c = a2.optInt("displayTime", 0) * 1000;
            }
            if (koaVar.a().a() != null && koaVar.a().f()) {
                qp qpVar = new qp(koaVar, 3);
                tya.w();
                shc shcVar = new shc(qpVar);
                koaVar.j = shcVar;
                shcVar.d();
            }
            koa koaVar2 = this.d5;
            Intent intent = getIntent();
            Uri uri = this.V.o;
            koaVar2.getClass();
            koa.f(intent, uri);
        }
        return this.d5;
    }

    @Override
    public final void a(dw4 dw4Var, wv4 wv4Var, yv4 yv4Var, Throwable th) {
        if (this.S4 == null) {
            return;
        }
        dc(dw4Var.X());
    }

    public final void ac() {
        for (int i = 0; i < this.T.getChildCount(); i++) {
            try {
                if (this.T.getChildAt(i) instanceof BannerView) {
                    ((BannerView) this.T.getChildAt(i)).setListener(null);
                    ((BannerView) this.T.getChildAt(i)).f();
                    ActivityScreen.UILayout uILayout = this.T;
                    uILayout.removeView(uILayout.getChildAt(i));
                }
            } catch (Exception unused) {
                return;
            }
        }
        if (this.C4) {
            this.C4 = false;
            synchronized (cti.class) {
            }
        }
    }

    @Override
    public final <T extends Dialog> void b6(T t) {
        if (ec()) {
            this.a5 = t;
        } else {
            this.a5 = null;
            t.show();
        }
    }

    public final void bc() {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ad.ActivityScreen.bc():void");
    }

    @Override
    public final void c(dw4 dw4Var) {
        if (this.S4 == null) {
            return;
        }
        dc(dw4Var.X());
    }

    @Override
    @SuppressLint({"InflateParams"})
    public final boolean c6(MenuItem menuItem) {
        if (this.O4 != null && menuItem.getItemId() == 2131367582) {
            this.O4.b(!u9(s6d.T));
        }
        return super.c6(menuItem);
    }

    public final void cc() {
        Bundle extras;
        q9c Wb = Wb();
        Intent intent = getIntent();
        String string = (intent == null || (extras = intent.getExtras()) == null) ? null : extras.getString("tr_parameter");
        Wb.c = !(string == null || StringsKt.I(string));
        Wb.a().f(this);
        Wb.a().a(this);
    }

    @Override
    public void d6(int i) {
        super.d6(i);
        ic(true);
        if (((cn) r74.g()).c.a()) {
            Uri c2 = wf1.c(pp.f, "bannerForPlayer");
            cn cnVar = b5c.a;
            s31 b2 = b5c.a.b(c2);
            if (b2 != null ? b2.c() : false) {
                if (this.r) {
                    n nVar = this.V;
                    if (!nVar.f0 && nVar.L == 4) {
                        kc();
                    }
                }
                ac();
            }
        }
        uod uodVar = this.W4;
        if (uodVar != null) {
            boolean L8 = L8();
            bpb bpbVar = this.E1;
            boolean z = bpbVar != null && bpbVar.p;
            boolean Tb = Tb();
            PlaybackController playbackController = this.l0;
            if (!z && Tb) {
                uodVar.e(playbackController, i, L8);
            } else {
                uodVar.c(playbackController, i, L8);
                uodVar.d();
            }
        }
    }

    @Override
    public final void da() {
        String str = this.V4.g;
        if (str != null && str.length() != 0) {
            ((b3b) s0b.e()).submit(new k0d(str, "playback", -1L, true));
        }
        Uri uri = this.V.o;
        String uri2 = uri != null ? uri.toString() : null;
        if (uri2 == null || StringsKt.I(uri2)) {
            return;
        }
        List<String> list = com.mxtech.videoplayer.ad.local.netstream.c.j;
        if (c.a.a(uri2)) {
            ((b3b) s0b.d()).execute(new bf0(uri2, 8));
        }
    }

    public final boolean dc(String str) {
        if (TextUtils.equals(str, this.S4)) {
            return false;
        }
        return !TextUtils.equals(this.V4.a, str);
    }

    public final boolean ec() {
        FrameLayout frameLayout = this.Z4;
        return frameLayout != null && frameLayout.getVisibility() == 0;
    }

    @Override
    public final boolean enterPictureInPictureMode(@NonNull PictureInPictureParams pictureInPictureParams) {
        ina inaVar = this.m5;
        if (inaVar != null && inaVar.getDialog() != null && this.m5.getDialog().isShowing()) {
            this.m5.dismiss();
        }
        boolean enterPictureInPictureMode = super.enterPictureInPictureMode(pictureInPictureParams);
        Wb().a().b(enterPictureInPictureMode);
        return enterPictureInPictureMode;
    }

    public final void fc() {
        i9d i9dVar = this.M4;
        if (i9dVar != null) {
            i9dVar.I();
        }
    }

    @Override
    public final void g3() {
        n nVar;
        if (this.I4.b.size() == 0 && (nVar = this.V) != null && this.L4) {
            nVar.O0();
        }
    }

    public final void gc() {
        if (jc()) {
            LocalVideoInfo build = new LocalVideoInfo.Builder().setUri(this.V.o).setDuration(this.V.w).build();
            if (this.E4 == null) {
                ana anaVar = new ana();
                anaVar.g = ana.a.f;
                anaVar.h = ana.b.c;
                anaVar.b = new WeakReference<>(this);
                anaVar.c = build;
                anaVar.d = build.getUri();
                this.E4 = anaVar;
            }
            ana anaVar2 = this.E4;
            anaVar2.getClass();
            if (ea3.t()) {
                return;
            }
            m mVar = anaVar2.b.get();
            ana.a aVar = anaVar2.g;
            ana.a aVar2 = ana.a.d;
            if (aVar == aVar2 || anaVar2.a() || mVar == null) {
                return;
            }
            anaVar2.g = aVar2;
            dna dnaVar = new dna(ResourceFlow.class);
            cs csVar = new cs();
            dnaVar.j = csVar;
            qge qgeVar = new qge(anaVar2.c);
            dnaVar.c = qgeVar;
            oge ogeVar = new oge();
            dnaVar.d = ogeVar;
            dnaVar.f = new WeakReference<>(mVar);
            qgeVar.c = csVar;
            ogeVar.b = csVar;
            anaVar2.a = dnaVar;
            dnaVar.i = anaVar2;
            if (qgeVar.a == null && !dnaVar.g()) {
                qgeVar.b(dnaVar);
            }
            if (ogeVar.a == null && !dnaVar.f()) {
                xe0.c cVar = new xe0.c();
                cVar.a = "https://androidapi.mxplay.com/v1/browse/browse_relevant";
                xe0 xe0Var = new xe0(cVar);
                ogeVar.a = xe0Var;
                xe0Var.d(dnaVar);
                cs csVar2 = ogeVar.b;
                if (csVar2 != null) {
                    ArrayList arrayList = (ArrayList) csVar2.b;
                    if (arrayList.contains(ogeVar)) {
                        return;
                    }
                    arrayList.add(ogeVar);
                }
            }
        }
    }

    @Override
    public final void h(dw4 dw4Var, wv4 wv4Var, yv4 yv4Var) {
        if (this.S4 == null || dc(dw4Var.X())) {
            return;
        }
        this.U4 = dw4Var.getState();
    }

    public final boolean hc() {
        if (this.J4 == h.b) {
            return this.K4;
        }
        if (s6d.H0 == 1 || this.V.T()) {
            return false;
        }
        n nVar = this.V;
        return (nVar.o == null || nVar.m == null) ? false : true;
    }

    @Override
    public final void i(dw4 dw4Var) {
        if (this.S4 == null || dc(dw4Var.X())) {
            return;
        }
        this.Q4 = null;
    }

    public final void ic(boolean z) {
        if (this.w4 == null) {
            if (this.f5 && this.f) {
                fc();
                return;
            }
            return;
        }
        if (this.M4 != null) {
            View view = this.x4;
            if (view != null) {
                view.setVisibility(8);
                RelativeLayout relativeLayout = this.k0;
                if (relativeLayout != null && !relativeLayout.getClipToPadding()) {
                    this.k0.setClipToPadding(true);
                }
            }
            if (this.w4.getVisibility() == 0) {
                this.M4.X();
                if (vm3.b(this)) {
                    fc();
                }
                HashMap hashMap = tma.a;
                if (tma.b(a.b) && !this.h5) {
                    ((b3b) s0b.e()).submit(new lh(this, 0));
                }
            } else if (this.f5 && vm3.b(this)) {
                fc();
            }
            this.w4.removeAllViews();
            this.w4.setVisibility(8);
            this.y4.setVisibility(8);
            if (z) {
                this.w4 = null;
            }
            nc();
        }
    }

    public final boolean jc() {
        if (!dq7.A()) {
            return false;
        }
        ConfigBean a2 = dq7.a();
        if (!(a2 == null ? true : a2.isLocalToOnlineRecom()) || dq7.k(this)) {
            return false;
        }
        return !(Build.VERSION.SDK_INT >= 26 ? isInPictureInPictureMode() : false);
    }

    public final boolean k1() {
        return this.R4 != null;
    }

    public final void kc() {
        if (((cn) r74.g()).c.a()) {
            if (Build.VERSION.SDK_INT < 26 || !isInPictureInPictureMode()) {
                Uri uri = pp.f;
                Uri c2 = wf1.c(uri, "bannerForPlayer");
                cn cnVar = b5c.a;
                s31 b2 = b5c.a.b(c2);
                if (b2 != null ? b2.c() : false) {
                    ac();
                    try {
                        BannerView b3 = b5c.a.b(uri.buildUpon().appendPath("bannerForPlayer").build()).b(this, true);
                        b3.setListener(this);
                        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
                        layoutParams.addRule(14);
                        layoutParams.addRule(10);
                        b3.setLayoutParams(layoutParams);
                        b3.setMinimumHeight((int) (50.0f * xk4.b));
                        this.T.addView(b3, 0);
                        if (this.r) {
                            b3.e();
                        }
                        if (this.C4) {
                            return;
                        }
                        this.C4 = true;
                        synchronized (cti.class) {
                        }
                    } catch (Exception unused) {
                    }
                }
            }
        }
    }

    public final void lc() {
        uod uodVar = this.W4;
        if (uodVar != null) {
            uodVar.d();
        }
    }

    @Override
    public final void m7() {
        ic(false);
        super.m7();
    }

    public final boolean mc() {
        ks5 ks5Var = this.b5;
        if (ks5Var == null || ks5Var.T0) {
            return false;
        }
        SurfaceView surfaceView = this.J0;
        if (surfaceView != null) {
            surfaceView.setVisibility(0);
        }
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        androidx.fragment.app.a h2 = km4.h(supportFragmentManager, supportFragmentManager);
        h2.o(this.b5);
        h2.e();
        FrameLayout frameLayout = this.Z4;
        if (frameLayout != null) {
            frameLayout.setVisibility(8);
        }
        qj6.q = true;
        coa coaVar = this.c5;
        if (coaVar != null) {
            ks5 ks5Var2 = this.b5;
            boolean z = ks5Var2.U0;
            boolean z2 = ks5Var2.W0;
            HashMap<Integer, Boolean> hashMap = coaVar.d;
            if (z2) {
                if (z) {
                    coaVar.i = System.currentTimeMillis();
                } else {
                    coaVar.m++;
                    LinkedHashMap linkedHashMap = new LinkedHashMap();
                    for (Map.Entry entry : hashMap.entrySet()) {
                        if (!((Boolean) entry.getValue()).booleanValue()) {
                            linkedHashMap.put(entry.getKey(), entry.getValue());
                        }
                    }
                    Iterator it = linkedHashMap.entrySet().iterator();
                    while (it.hasNext()) {
                        hashMap.put(((Map.Entry) it.next()).getKey(), Boolean.TRUE);
                    }
                }
            } else if (!z) {
                Iterator it2 = hashMap.entrySet().iterator();
                while (it2.hasNext()) {
                    if (!((Boolean) ((Map.Entry) it2.next()).getValue()).booleanValue()) {
                        it2.remove();
                    }
                }
            }
        }
        this.b5 = null;
        if (this.a5 != null && vm3.b(this)) {
            this.a5.show();
            this.a5 = null;
        }
        int i = d1j.a;
        return true;
    }

    public final void nc() {
        if (this.W4 == null || !Tb()) {
            return;
        }
        this.W4.e(this.l0, this.q, L8());
    }

    @Override
    public final void o(Pair<Integer, Boolean> pair, Pair<Integer, Boolean> pair2) {
        n nVar = this.V;
        if (nVar != null && nVar.b0() && this.H4 && Qb()) {
            gc();
        } else if (Qb()) {
            Sb();
        }
        if (shc.b(this)) {
            wma wmaVar = this.N4;
            if (wmaVar != null) {
                if (wmaVar.f.isEmpty()) {
                    wmaVar.p(wmaVar.d, wmaVar.s);
                }
                wmaVar.l();
            }
            i9d i9dVar = this.M4;
            if (i9dVar != null) {
                i9dVar.O(sj.c);
            }
        }
    }

    @Override
    public final void o8() {
        ((ViewStub) findViewById(2131366193)).inflate();
        LottieAnimationView findViewById = findViewById(2131364395);
        if (findViewById == null) {
            return;
        }
        aqd aqdVar = new aqd(this, findViewById);
        this.p5 = aqdVar;
        ((zhg) aqdVar.c.getValue()).b.observe(this, new aqd.c(new wpd(aqdVar, new w7(this))));
        zhg zhgVar = (zhg) this.p5.c.getValue();
        zhgVar.getClass();
        xfg.C(jz9.I(zhgVar), (CoroutineContext) null, (fs3) null, new yhg(zhgVar, null), 3);
    }

    public final void oc() {
        int i;
        i9d i9dVar;
        int i2;
        int i3;
        if (!("pauseBlockWeb".equals(Vb()) && koa.s) && ((cn) r74.g()).c.a()) {
            if (!this.D4 && this.r) {
                n nVar = this.V;
                if (!nVar.f0 && ((i = nVar.L) == 4 || (i == 3 && nVar.M == 4 && L0()))) {
                    bpb bpbVar = this.E1;
                    if (bpbVar == null || !bpbVar.p) {
                        if (Build.VERSION.SDK_INT >= 26 && isInPictureInPictureMode()) {
                            ac();
                            ic(false);
                            return;
                        }
                        mha mhaVar = mha.NONE;
                        i9d i9dVar2 = this.M4;
                        boolean z = true;
                        if (i9dVar2 != null) {
                            mhaVar = i9dVar2.B(true);
                            this.M4.b0();
                        }
                        if (mhaVar.b) {
                            ac();
                            try {
                                RelativeLayout relativeLayout = this.w4;
                                if (relativeLayout == null || relativeLayout.getChildCount() == 0) {
                                    lc();
                                    ai8 ai8Var = this.M4.v(true).a;
                                    ndd c2 = ndd.c(this.M4.j);
                                    if (ai8Var != null) {
                                        if (this.w4 == null) {
                                            ViewStub viewStub = (ViewStub) findViewById(2131365083);
                                            if (viewStub != null) {
                                                this.z4 = viewStub.inflate();
                                                this.B4 = viewStub.getLayoutResource();
                                            } else {
                                                ViewGroup viewGroup = (ViewGroup) this.z4.getParent();
                                                ViewGroup.LayoutParams layoutParams = this.z4.getLayoutParams();
                                                int indexOfChild = viewGroup.indexOfChild(this.z4);
                                                viewGroup.removeView(this.z4);
                                                View inflate = LayoutInflater.from(this).inflate(this.B4, (ViewGroup) null, false);
                                                this.z4 = inflate;
                                                viewGroup.addView(inflate, indexOfChild, layoutParams);
                                            }
                                            this.w4 = (RelativeLayout) this.z4.findViewById(2131361963);
                                            this.y4 = this.z4.findViewById(2131365082);
                                        }
                                        ai8Var.N(pp.b.buildUpon().appendPath(Vb()).build());
                                        View x = ai8Var.x(c2.a(((j1b) getResources()).a.getConfiguration().orientation), this.w4);
                                        if (x instanceof AdManagerAdView) {
                                            AdSize adSize = ((AdManagerAdView) x).getAdSize();
                                            if (adSize == null || adSize.getWidth() <= 0 || adSize.getHeight() <= 0) {
                                                i3 = -1;
                                                i2 = -1;
                                            } else {
                                                i2 = iuh.c(adSize.getWidth(), this);
                                                i3 = iuh.c(adSize.getHeight(), this);
                                            }
                                            View inflate2 = LayoutInflater.from(this.w4.getContext()).inflate(2131558607, (ViewGroup) null, false);
                                            ((FrameLayout) inflate2.findViewById(2131362220)).addView(x, new FrameLayout.LayoutParams(i2 & (-2), i3 & (-2)));
                                            x = inflate2;
                                        } else {
                                            z = false;
                                            i2 = -1;
                                        }
                                        View view = this.y4;
                                        if (view != null) {
                                            view.setOnClickListener(new e());
                                        }
                                        RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, -2);
                                        layoutParams2.addRule(13);
                                        ViewGroup.LayoutParams layoutParams3 = x.getLayoutParams();
                                        if (layoutParams3 != null) {
                                            int i4 = layoutParams3.width;
                                            if (i4 > 0) {
                                                layoutParams2.width = i4;
                                            }
                                            int i5 = layoutParams3.height;
                                            if (i5 > 0) {
                                                layoutParams2.height = i5;
                                            }
                                        }
                                        x.setLayoutParams(layoutParams2);
                                        this.w4.addView(x, 0);
                                        this.w4.setVisibility(0);
                                        this.y4.setVisibility(0);
                                        ViewGroup.LayoutParams layoutParams4 = this.w4.getLayoutParams();
                                        if (layoutParams4 != null) {
                                            if (z) {
                                                if (i2 <= 0) {
                                                    i2 = iuh.c(340, this);
                                                }
                                                layoutParams4.width = i2;
                                            } else {
                                                int i6 = layoutParams3 != null ? layoutParams3.width : 0;
                                                if (!"pauseBlockWeb".equals(Vb()) || i6 <= 0) {
                                                    x.addOnLayoutChangeListener(new xh(new mh(this, layoutParams4), x));
                                                } else {
                                                    layoutParams4.width = -2;
                                                }
                                            }
                                        }
                                        View k = pl.k(this.S, this.x4, this.M4.o);
                                        this.x4 = k;
                                        if (k != null) {
                                            RelativeLayout relativeLayout2 = this.k0;
                                            if (relativeLayout2 != null && relativeLayout2.getFitsSystemWindows()) {
                                                this.k0.setClipToPadding(false);
                                            }
                                            this.x4.setVisibility(0);
                                        }
                                        t8(a.d);
                                    }
                                }
                            } catch (Exception unused) {
                            }
                        } else {
                            Uri c3 = wf1.c(pp.f, "bannerForPlayer");
                            cn cnVar = b5c.a;
                            s31 b2 = b5c.a.b(c3);
                            if (b2 != null ? b2.c() : false) {
                                kc();
                            }
                        }
                        if (mhaVar == mha.LOADED || (i9dVar = this.M4) == null || i9dVar.m()) {
                            return;
                        }
                        fc();
                        return;
                    }
                    return;
                }
            }
            ac();
            if (this.V.L == 5) {
                ic(false);
            }
        }
    }

    @Override
    public final void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 100 && Qb()) {
            Sb();
        }
    }

    @Override
    public final void onBackPressed() {
        koa koaVar = this.d5;
        if (koaVar == null || !koa.s) {
            super.onBackPressed();
            return;
        }
        View view = koaVar.l;
        if (view == null || view.getVisibility() == 0) {
            return;
        }
        d0d.f2("playerRewardedScreenBackClick");
        View view2 = koaVar.l;
        if (view2 != null) {
            view2.setVisibility(0);
        }
    }

    @Override
    @SuppressLint({WarningType.NewApi})
    public void onCreate(Bundle bundle) {
        this.v2 = dq7.e();
        super.onCreate(bundle);
        if (this.n2) {
            return;
        }
        xm3 xm3Var = com.mxtech.videoplayer.ad.online.forceupdate.b.d;
        if (b.a.d("Local")) {
            finish();
            return;
        }
        com.mxtech.videoplayer.ad.online.download.c f2 = com.mxtech.videoplayer.ad.online.download.d.f(getApplicationContext());
        this.T4 = f2;
        f2.r(this);
        d0c.i().h(true);
        ExoPlayerService.M();
        if (!dq7.k(getApplicationContext())) {
            y82.e(this);
        }
        ((cn) r74.g()).h0(this);
        this.F4 = new shc(this);
        cc();
        fke.b("local");
        bc();
        Zb();
        qig.a(this.o5);
    }

    @Override
    public void onDestroy() {
        dna dnaVar;
        i9d i9dVar;
        this.a5 = null;
        com.mxtech.videoplayer.ad.online.download.c cVar = this.T4;
        if (cVar != null) {
            cVar.v(this);
        }
        super.onDestroy();
        qig.b(this.o5);
        if (this.n2) {
            return;
        }
        WeakReference<pg0> weakReference = x6g.b;
        Uri c2 = wf1.c(pp.a, "webSharePageOpenAd");
        HashMap hashMap = pl.a;
        if (c2 != null) {
            cn cnVar = b5c.a;
            xa9 c3 = b5c.a.c(c2);
            if (c3 != null) {
                c3.e();
            }
        }
        ((cn) r74.g()).c1(this);
        if (((cn) r74.g()).c.a() && (i9dVar = this.M4) != null) {
            i9dVar.d0(this.j5);
            this.M4.X();
            this.M4.r();
        }
        ana anaVar = this.E4;
        if (anaVar != null && (dnaVar = anaVar.a) != null) {
            qge qgeVar = dnaVar.c;
            if (qgeVar != null) {
                qgeVar.c();
            }
            oge ogeVar = dnaVar.d;
            if (ogeVar != null) {
                ogeVar.a();
            }
            anaVar.a = null;
        }
        ArrayList arrayList = this.I4.a;
        if (arrayList != null) {
            arrayList.remove(this);
        }
        q9c q9cVar = this.e5;
        if (q9cVar != null) {
            q9cVar.b.unregisterActivityLifecycleCallbacks(q9cVar);
            q9cVar.a().release();
        }
        wma wmaVar = this.N4;
        if (wmaVar != null) {
            pdd pddVar = wmaVar.l;
            if (pddVar != null) {
                pddVar.c();
                wmaVar.l = null;
            }
            ValueAnimator valueAnimator = wmaVar.u;
            if (valueAnimator != null && valueAnimator.isRunning()) {
                wmaVar.u.cancel();
                wmaVar.u = null;
            }
            i9d i9dVar2 = wmaVar.i;
            if (i9dVar2 != null) {
                i9dVar2.X();
            }
            if (i9dVar2 != null) {
                i9dVar2.d0(wmaVar.x);
            }
            i9d i9dVar3 = wmaVar.j;
            if (i9dVar3 != null) {
                i9dVar3.X();
            }
            if (i9dVar3 != null) {
                i9dVar3.d0(wmaVar.x);
            }
            ((cn) r74.g()).c1(wmaVar);
        }
        gqi gqiVar = this.O4;
        if (gqiVar != null) {
            gqiVar.c.removeCallbacksAndMessages(null);
            kl3.p(new xe0[]{gqiVar.e});
            gqiVar.b(false);
        }
        uod uodVar = this.W4;
        if (uodVar != null) {
            i9d i9dVar4 = uodVar.g;
            if (i9dVar4 != null) {
                i9dVar4.d0(uodVar.m);
                i9dVar4.X();
            }
            uodVar.f.removeMessages(1);
            uodVar.f.removeMessages(2);
        }
        coa coaVar = this.c5;
        if (coaVar != null) {
            coaVar.i = 0L;
            ((cn) r74.g()).c1(coaVar);
        }
        koa koaVar = this.d5;
        if (koaVar != null) {
            koaVar.p = true;
            koa.s = false;
            koa.r = false;
            koa.t = false;
            koaVar.i.removeCallbacksAndMessages(null);
            koaVar.a().l(koaVar.n);
            shc shcVar = koaVar.j;
            if (shcVar != null) {
                shcVar.c();
            }
            koaVar.j = null;
        }
        th thVar = this.g5;
        if (thVar != null) {
            this.O.removeCallbacks(thVar);
        }
        aqd aqdVar = this.p5;
        if (aqdVar != null) {
            aqdVar.b.d();
        }
    }

    @vgg(threadMode = ThreadMode.MAIN)
    public void onEvent(ata ataVar) {
        if (tj5.a.contains(this)) {
            if (tma.a()) {
                t8(a.d);
            }
            aqd aqdVar = this.p5;
            if (aqdVar != null) {
                zhg zhgVar = (zhg) aqdVar.c.getValue();
                zhgVar.getClass();
                xfg.C(jz9.I(zhgVar), (CoroutineContext) null, (fs3) null, new yhg(zhgVar, null), 3);
            }
        }
    }

    @Override
    public void onNewIntent(Intent intent) {
        ana anaVar;
        ood oodVar;
        n nVar = this.V;
        Uri uri = nVar == null ? null : nVar.o;
        super.onNewIntent(intent);
        if (this.E4 != null && "android.intent.action.SEND".equals(intent.getAction()) && (oodVar = (anaVar = this.E4).e) != null) {
            oodVar.o = true;
            oodVar.dismissAllowingStateLoss();
            oodVar.p9();
            anaVar.e = null;
        }
        mc();
        Uri uri2 = this.V.o;
        if (uri == null || uri2 == null || !TextUtils.equals(uri.toString(), uri2.toString())) {
            cc();
            pc(false);
            if (this.d5 != null) {
                koa.f(intent, this.V.o);
                koa koaVar = this.d5;
                koaVar.p = true;
                koa.s = false;
                koa.r = false;
                koa.t = false;
                koaVar.i.removeCallbacksAndMessages(null);
            }
            if (!ec()) {
                bc();
            }
            coa coaVar = this.c5;
            if (coaVar != null) {
                coaVar.a(intent, this.q, Ub(), Xb(), getSupportFragmentManager());
            }
        }
        if (TextUtils.equals(this.j0, "client_push_new_files")) {
            this.J2 = new ArrayList<>();
        }
    }

    @Override
    public void onPause() {
        n nVar = this.V;
        boolean z = nVar == null || nVar.L == -1;
        if (isFinishing() && !z) {
            cce.n.c();
        }
        super.onPause();
        this.F4.e();
        this.Y4 = ec();
    }

    @Override
    public final void onPictureInPictureModeChanged(boolean z, Configuration configuration) {
        super.onPictureInPictureModeChanged(z, configuration);
        if (z) {
            ic(false);
            lc();
            wma wmaVar = this.N4;
            if (wmaVar != null) {
                wmaVar.o();
            }
        } else {
            nc();
            if (this.N4 != null && this.V != null) {
                if (!(Build.VERSION.SDK_INT >= 26 ? isInPictureInPictureMode() : false)) {
                    wma wmaVar2 = this.N4;
                    int i = this.V.L;
                    if (wmaVar2.p != i) {
                        wmaVar2.f(i);
                    } else if (wmaVar2.q != i) {
                        wmaVar2.q = Integer.MIN_VALUE;
                    }
                }
            }
        }
        Wb().a().b(z);
    }

    @Override
    public final void onProgressChanged(SeekBar seekBar, int i, boolean z) {
        super.onProgressChanged(seekBar, i, z);
        n nVar = this.V;
        if (nVar == null || i + 120000 < nVar.w || !Qb()) {
            return;
        }
        this.H4 = true;
        gc();
    }

    @Override
    public void onResume() {
        super.onResume();
        ExoPlayerService.M();
        this.F4.d();
    }

    @Override
    public void onStart() {
        super.onStart();
        oc();
    }

    @Override
    public void onStop() {
        cce cceVar = cce.n;
        cceVar.getClass();
        if (!pl0.a(this)) {
            cceVar.b = 0;
        }
        if (R6() && mc()) {
            this.V.O0();
        }
        super.onStop();
        ic(false);
        wma wmaVar = this.N4;
        if (wmaVar != null) {
            wmaVar.o();
        }
    }

    @Override
    public final void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        if (z) {
            ul.g.getClass();
            ul.d();
            fc();
            wma wmaVar = this.N4;
            if (wmaVar != null) {
                wmaVar.l();
            }
        }
    }

    public final void pc(boolean z) {
        n nVar = this.V;
        if (nVar == null || this.A4 == null) {
            return;
        }
        if (z) {
            nVar.p0(0);
            u8();
            this.A4.setVisibility(0);
        } else {
            nVar.O0();
            O3();
            this.A4.setVisibility(8);
        }
    }

    @Override
    public final void r7(final boolean z) {
        wfc wfcVar;
        if (!TextUtils.equals(this.j0, "client_push_new_files") || !this.J2.isEmpty()) {
            super.r7(z);
            return;
        }
        n nVar = this.V;
        if (nVar == null || (wfcVar = nVar.m) == null) {
            return;
        }
        Uri[] f2 = wfcVar.f();
        if (f2.length == 0) {
            f2 = new Uri[]{this.V.o};
        }
        new j(f2, new i() {
            public final void a(ArrayList arrayList) {
                com.mxtech.videoplayer.ad.ActivityScreen.Ob(com.mxtech.videoplayer.ad.ActivityScreen.this, z, arrayList);
            }
        }).executeOnExecutor(s0b.d(), new Void[0]);
    }

    @Override
    public final void s7(boolean z) {
        super.s7(z);
        ic(false);
    }

    @Override
    public final void t7() {
        cpa cpaVar = this.V0;
        if (cpaVar != null) {
            cpaVar.e(false);
        }
        this.G4 = this.V.o;
        this.K4 = hc();
        this.J4 = h.b;
        if (jc() && this.K4) {
            ana anaVar = this.E4;
            if (anaVar == null || !anaVar.a()) {
                super.t7();
            } else {
                if (!cce.n.l) {
                    Wb().a().e(false, this);
                }
                if (jc()) {
                    gc();
                    this.E4.b();
                    Z9();
                }
                Uri uri = this.G4;
                String path = uri == null ? null : uri.getPath();
                String str = "" + this.V.w;
                mdg mdgVar = new mdg("onlineGuideViewed", weh.c);
                HashMap hashMap = mdgVar.b;
                hashMap.put("uri", path);
                hashMap.put("duration", str);
                gfh.d(mdgVar);
            }
        } else {
            super.t7();
        }
        ja(-1, "playback_completion");
        this.V.h(0);
    }

    @Override
    public final void ta() {
        PlayService playService = PlayService.L0;
        if (playService == null) {
            return;
        }
        playService.J0 = new f();
    }

    @Override
    public final void u3(boolean z) {
        super.u3(z);
        oc();
    }

    @Override
    public final void u6() {
        gdg.k9(getSupportFragmentManager());
        super.u6();
    }

    @Override
    public final void z9(Intent intent) {
        this.V4 = new c25(intent);
    }

    public class g implements sm1 {
        public g() {
        }

        public final void b() {
            ?? r0 = ActivityScreen.this;
            if (jz9.N((Activity) r0)) {
                WebLinksRouterActivity.u6(r0, ActivityScreen.Ub(), r0.i5);
            }
            int i = ActivityScreen.q5;
            r0.s2 = false;
            d0d.B2(a.b.i, com.inmobi.media.e.CLICK_BEACON, r0.i5);
        }

        public final void c() {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.h5 = true;
            d0d.B2(a.b.i, "close", activityScreen.i5);
        }

        public final void a() {
        }
    }

    @Override
    public final Activity v6() {
        return this;
    }

    public class d implements c.e {
        public d() {
        }

        @Override
        public final void C5(List<xv4> list) {
            if (list.isEmpty()) {
                return;
            }
            dw4 dw4Var = (dw4) list.get(0);
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.Q4 = dw4Var;
            activityScreen.U4 = dw4Var.getState();
        }

        @Override
        public final void q3(Exception exc) {
        }
    }

    @Override
    public final void A8(String str) {
    }

    @Override
    public final void w3(String str) {
    }

    @Override
    public final void e(HashSet hashSet, HashSet hashSet2) {
    }
}