Live Football Updates v1.0版本的 MD5 值为:95609b5a5bec0a5f5a0b6e8e4d8f1cba

以下内容为反编译后的 j.java 源代码,内容仅作参考


package x6;

import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.drawable.ColorDrawable;
import android.media.AudioTrack;
import android.media.MediaDrm;
import android.net.Uri;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.CookieManager;
import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface;
import android.webkit.URLUtil;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.d;
import androidx.appcompat.widget.n1;
import androidx.media3.ui.PlayerView;
import androidx.media3.ui.TrackSelectionView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.applive.app.MyApplication;
import com.applive.app.db.AppDatabase;
import com.google.common.collect.u;
import com.google.gson.Gson;
import com.ironsource.q2;
import com.millingoupdate.app.R;
import h0.a;
import i1.z0;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.net.URL;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import lj.d0;
import lj.y;
import p1.b0;
import p1.g0;
import p1.h0;
import p1.j0;
import p1.l0;
import p1.p0;
import p1.t;
import s1.e0;
import s1.f0;
import u1.e;
import u1.i;
import u1.j;
import w1.a1;
import w1.c0;
import w1.m;
import x6.a0;
@SuppressLint({"SetJavaScriptEnabled"})
public abstract class j extends x6.a implements SwipeRefreshLayout.f, PlayerView.c, PlayerView.d {
    public static final int f33534d1 = 0;
    public boolean R0;
    public int S0;
    public int T0;
    public int U0;
    public i7.k V;
    public ImageView W;
    public List<p1.t> W0;
    public ImageView X;
    public List<p1.t> X0;
    public e.a Y;
    public PlayerView Z;
    public int Z0;
    public c0 f33535a0;
    public boolean f33536a1;
    public j0 f33537b0;
    public FrameLayout f33539c0;
    public WebView d0;
    public Handler f33541e0;
    public Handler f0;
    public FrameLayout f33542g0;
    public ImageView f33543h0;
    public ViewGroup f33544i0;
    public ImageButton f33545j0;
    public ViewGroup f33546k0;
    public ImageView f33547l0;
    public SwipeRefreshLayout f33548m0;
    public int f33549n0;
    public long f33550o0;
    public boolean f33552q0;
    public boolean f33551p0 = true;
    public b V0 = null;
    public ArrayList<String> Y0 = new ArrayList<>();
    public final x6.b f33538b1 = new x6.b(0, this);
    public final x6.c f33540c1 = new DownloadListener() {
        @Override
        public final void onDownloadStart(String str, String str2, String str3, String str4, long j4) {
            j jVar = j.this;
            jVar.getClass();
            try {
                if (!TextUtils.isEmpty(str)) {
                    jVar.e1(str);
                }
            } catch (Exception unused) {
            }
        }
    };

    public class a extends GestureDetector.SimpleOnGestureListener {
        public a() {
        }

        @Override
        public final boolean onDoubleTap(MotionEvent motionEvent) {
            float x10 = motionEvent.getX();
            j jVar = j.this;
            if (x10 < jVar.Z.getWidth() / 2.0f) {
                jVar.X.setImageResource(R.drawable.ic_preview_backward);
                jVar.X.setVisibility(0);
                ObjectAnimator ofFloat = ObjectAnimator.ofFloat(jVar.X, "alpha", 1.0f, 0.0f);
                ofFloat.setDuration(1000L);
                ofFloat.start();
                c0 c0Var = jVar.f33535a0;
                c0Var.c0(5, c0Var.getCurrentPosition() - 10000);
                return true;
            }
            jVar.W.setImageResource(R.drawable.ic_preview_forward);
            jVar.W.setVisibility(0);
            ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(jVar.W, "alpha", 1.0f, 0.0f);
            ofFloat2.setDuration(1000L);
            ofFloat2.start();
            c0 c0Var2 = jVar.f33535a0;
            c0Var2.c0(5, c0Var2.getCurrentPosition() + 10000);
            return true;
        }
    }

    public static class b {
        public final WeakReference<j> f33554a;
        public String f33555b = "";

        public b(j jVar) {
            this.f33554a = new WeakReference<>(jVar);
            jVar.Z0 = 0;
            jVar.Y0 = new ArrayList<>();
            jVar.W0 = Collections.emptyList();
            jVar.X0 = Collections.emptyList();
            jVar.a1();
        }

        public static ArrayList c(j jVar, String str) throws Exception {
            String str2;
            String m10 = i7.l.m(jVar.W(), str);
            jVar.Y0 = jVar.L0(String.format(Locale.US, "%s: %s", "User-Agent", i7.u.w(jVar)));
            Bundle bundle = new Bundle();
            bundle.putStringArrayList("headers", jVar.Y0);
            lj.w b10 = i7.r.b(bundle);
            b10.f26222a.k();
            lj.c0 i = i(b10, m10);
            lj.q qVar = i.f26076f;
            String str3 = "";
            if (qVar.f26183a.length / 2 > 0) {
                for (int i10 = 0; i10 < qVar.f26183a.length / 2; i10++) {
                    String f10 = qVar.f(i10);
                    str2 = qVar.i(i10).toLowerCase(Locale.US);
                    if (f10.equalsIgnoreCase("content-type")) {
                        break;
                    }
                }
            }
            str2 = "";
            if (!i.b()) {
                return null;
            }
            if (!TextUtils.isEmpty(str2)) {
                if (str2.contains("text/html")) {
                    d0 d0Var = i.f26077g;
                    Objects.requireNonNull(d0Var);
                    ck.f b11 = dk.f.a().b(d0Var.f(), jVar.T());
                    String f11 = ae.d.d().f("mediafire_file_element_css_query");
                    if (TextUtils.isEmpty(f11)) {
                        f11 = "a[id=downloadButton]";
                    }
                    String f12 = ae.d.d().f("mediafire_direct_link_attribute_key");
                    if (TextUtils.isEmpty(f12)) {
                        f12 = "href";
                    }
                    ck.o j02 = b11.q0().j0(f11);
                    if (j02 != null && j02.q(f12) && !TextUtils.isEmpty(j02.d(f12))) {
                        String a10 = j02.a(f12);
                        if (!TextUtils.isEmpty(a10.trim())) {
                            str3 = a10.trim();
                        }
                    }
                } else if (str2.contains("video/")) {
                    str3 = m10;
                }
            }
            if (!TextUtils.isEmpty(str3)) {
                ArrayList arrayList = new ArrayList();
                Uri parse = Uri.parse(str3);
                t.a aVar = new t.a();
                aVar.f28127b = parse;
                String uri = parse.toString();
                uri.getClass();
                aVar.f28126a = uri;
                arrayList.add(aVar.a());
                return arrayList;
            }
            jVar.runOnUiThread(new z0(jVar, 5, m10));
            return null;
        }

        public static p1.t d(j jVar, String str) {
            String str2;
            if (!TextUtils.isEmpty(str)) {
                String str3 = "";
                if (!str.contains("|")) {
                    str2 = "";
                } else {
                    String[] split = str.split(Pattern.quote("|"));
                    if (TextUtils.isEmpty(split[0])) {
                        str2 = "";
                    } else {
                        str2 = split[0].replace("18", "360").replace("59", "480").replace("22", "720").replace("37", "1080");
                    }
                    str = split[1];
                }
                Uri parse = Uri.parse(str.replace("\\u003d", q2.i.f20137b).replace("\\u0026", q2.i.f20139c).replace("%2C", ","));
                t.a aVar = new t.a();
                aVar.f28127b = parse;
                String uri = parse.toString();
                uri.getClass();
                aVar.f28126a = uri;
                aVar.i = str2;
                o6.c W = jVar.W();
                if (W != null && !TextUtils.isEmpty(W.I)) {
                    str3 = W.I;
                }
                if (!TextUtils.isEmpty(str3)) {
                    aVar.f28128c = str3;
                }
                return aVar.a();
            }
            return null;
        }

        public static ArrayList f(j jVar) {
            String str;
            String str2;
            UUID uuid;
            ArrayList arrayList = new ArrayList();
            try {
                o6.c W = jVar.W();
                String str3 = W.K;
                if (!TextUtils.isEmpty(str3)) {
                    String m10 = i7.l.m(W, str3);
                    Uri uri = null;
                    if (!TextUtils.isEmpty(W.B)) {
                        str = W.B;
                    } else {
                        str = null;
                    }
                    if (!TextUtils.isEmpty(W.F)) {
                        str2 = W.F;
                    } else {
                        str2 = null;
                    }
                    if (!TextUtils.isEmpty(W.E)) {
                        String str4 = W.E;
                        int i = e0.f30447a;
                        String y10 = androidx.lifecycle.r.y(str4);
                        y10.getClass();
                        char c10 = 65535;
                        switch (y10.hashCode()) {
                            case -1860423953:
                                if (y10.equals("playready")) {
                                    c10 = 0;
                                    break;
                                }
                                break;
                            case -1400551171:
                                if (y10.equals("widevine")) {
                                    c10 = 1;
                                    break;
                                }
                                break;
                            case 790309106:
                                if (y10.equals("clearkey")) {
                                    c10 = 2;
                                    break;
                                }
                                break;
                        }
                        switch (c10) {
                            case 0:
                                uuid = p1.h.f27942e;
                                break;
                            case 1:
                                uuid = p1.h.f27941d;
                                break;
                            case 2:
                                uuid = p1.h.f27940c;
                                break;
                            default:
                                try {
                                    uuid = UUID.fromString(str4);
                                    break;
                                } catch (RuntimeException unused) {
                                    break;
                                }
                        }
                        Uri parse = Uri.parse(m10);
                        t.a aVar = new t.a();
                        aVar.f28127b = parse;
                        String uri2 = parse.toString();
                        uri2.getClass();
                        aVar.f28126a = uri2;
                        aVar.f28128c = str;
                        if (uuid != null) {
                            t.d.a aVar2 = new t.d.a(uuid);
                            List<String> list = W.f27657e0;
                            if (list != null && !list.isEmpty()) {
                                HashMap hashMap = new HashMap();
                                for (String str5 : list) {
                                    if (!TextUtils.isEmpty(str5) && str5.contains(":")) {
                                        String[] split = str5.split(":", 2);
                                        hashMap.put(split[0].trim(), split[1].trim());
                                    }
                                }
                                aVar2.f28158c = com.google.common.collect.v.a(hashMap);
                            }
                            if (!TextUtils.isEmpty(str2)) {
                                if (str2 != null) {
                                    uri = Uri.parse(str2);
                                }
                                aVar2.f28157b = uri;
                            }
                            aVar.f28130e = new t.d.a(new t.d(aVar2));
                        }
                        arrayList.add(aVar.a());
                    }
                    uuid = null;
                    Uri parse2 = Uri.parse(m10);
                    t.a aVar3 = new t.a();
                    aVar3.f28127b = parse2;
                    String uri22 = parse2.toString();
                    uri22.getClass();
                    aVar3.f28126a = uri22;
                    aVar3.f28128c = str;
                    if (uuid != null) {
                    }
                    arrayList.add(aVar3.a());
                }
            } catch (Exception unused2) {
            }
            return arrayList;
        }

        public static ArrayList h(j jVar, String str, String str2) throws IOException {
            m6.b bVar;
            jVar.Y0 = jVar.L0(String.format(Locale.US, "%s: %s", "Authorization", str2));
            Bundle bundle = new Bundle();
            bundle.putStringArrayList("headers", jVar.Y0);
            lj.w b10 = i7.r.b(bundle);
            b10.f26222a.k();
            lj.c0 i = i(b10, i7.l.m(jVar.W(), str));
            d0 d0Var = i.f26077g;
            Objects.requireNonNull(d0Var);
            String f10 = d0Var.f();
            ArrayList arrayList = null;
            if (!i.b() || (bVar = (m6.b) new Gson().b(m6.b.class, f10)) == null) {
                return null;
            }
            if (!TextUtils.isEmpty(bVar.f26518a)) {
                arrayList = new ArrayList();
                Uri parse = Uri.parse(bVar.f26518a);
                t.a aVar = new t.a();
                aVar.f28127b = parse;
                String uri = parse.toString();
                uri.getClass();
                aVar.f28126a = uri;
                m6.a aVar2 = bVar.f26522e;
                if (aVar2 != null && !TextUtils.isEmpty(aVar2.f26517a)) {
                    aVar.f28128c = bVar.f26522e.f26517a;
                }
                arrayList.add(aVar.a());
            }
            return arrayList;
        }

        public static lj.c0 i(lj.w wVar, String str) throws IOException {
            y.a aVar = new y.a();
            lj.r f10 = lj.r.f(str);
            Objects.requireNonNull(f10);
            aVar.f26284a = f10;
            return new pj.e(wVar, aVar.a(), false).e();
        }

        public final void a() {
            try {
                j jVar = this.f33554a.get();
                if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                    ViewGroup viewGroup = jVar.f33546k0;
                    if (viewGroup != null) {
                        viewGroup.setVisibility(0);
                    }
                    jVar.V.f24725b.execute(new j1.b(this, 10, jVar));
                }
            } catch (Exception unused) {
            }
        }

        public final ArrayList b(j jVar, String str, String str2) throws IOException {
            String substring;
            g6.d dVar;
            List<String> list;
            String str3 = q2.i.f20139c;
            jVar.Y0 = jVar.L0(String.format(Locale.US, "%s: %s", "Authorization", str2));
            Bundle bundle = new Bundle();
            bundle.putStringArrayList("headers", jVar.Y0);
            lj.w b10 = i7.r.b(bundle);
            b10.f26222a.k();
            String m10 = i7.l.m(jVar.W(), str);
            String f10 = ae.d.d().f("drive_file_url_parameters_json");
            if (TextUtils.isEmpty(f10)) {
                f10 = "{\"items\":[\"&amp;drive_originator_app=303\"]}";
            }
            try {
                if (!TextUtils.isEmpty(m10) && !TextUtils.isEmpty(f10) && (dVar = (g6.d) new Gson().b(g6.d.class, f10)) != null && (list = dVar.f23261a) != null && !list.isEmpty()) {
                    StringBuilder sb = new StringBuilder(m10.replaceAll("/$", ""));
                    for (String str4 : dVar.f23261a) {
                        try {
                            if (!TextUtils.isEmpty(str4) && str4.contains(q2.i.f20137b) && !sb.toString().contains(str4.split(q2.i.f20137b)[0].replace(q2.i.f20139c, "").replace("?", ""))) {
                                sb.append(str4);
                            }
                        } catch (Exception unused) {
                        }
                    }
                    m10 = sb.toString();
                }
            } catch (Exception unused2) {
            }
            lj.c0 i = i(b10, m10);
            d0 d0Var = i.f26077g;
            Objects.requireNonNull(d0Var);
            String f11 = d0Var.f();
            ArrayList arrayList = null;
            if (!i.b()) {
                return null;
            }
            StringBuilder sb2 = new StringBuilder();
            try {
                String f12 = ae.d.d().f("drive_stream_map_key");
                if (TextUtils.isEmpty(f12)) {
                    f12 = "fmt_stream_map=";
                }
                try {
                    if (f11.contains(f12)) {
                        int indexOf = f11.indexOf(f12) + f12.length();
                        try {
                            String f13 = ae.d.d().f("drive_stream_map_key_ends");
                            if (!TextUtils.isEmpty(f13)) {
                                str3 = f13;
                            }
                            substring = f11.substring(indexOf, f11.indexOf(str3, indexOf));
                        } catch (Exception unused3) {
                            substring = f11.substring(indexOf);
                        }
                        f11 = URLDecoder.decode(substring, "UTF-8");
                        if (f11.contains(",")) {
                            String[] split = f11.split(",");
                            if (!Arrays.toString(split).isEmpty()) {
                                for (String str5 : split) {
                                    sb2.append(str5);
                                    sb2.append(",");
                                }
                            }
                        } else {
                            sb2.append(f11);
                        }
                    }
                } catch (Exception unused4) {
                }
                if (TextUtils.isEmpty(sb2.toString()) && f11.contains(f12)) {
                    String[] split2 = f11.split("" + f12 + "\",");
                    if (!Arrays.toString(split2).isEmpty()) {
                        for (String str6 : split2[1].split("\"")[1].split(",")) {
                            sb2.append(str6);
                            sb2.append(",");
                        }
                    }
                }
            } catch (Exception unused5) {
            }
            String sb3 = sb2.toString();
            if (!TextUtils.isEmpty(sb3)) {
                if (sb3.endsWith(",")) {
                    sb3 = sb3.substring(0, sb3.lastIndexOf(","));
                }
                arrayList = new ArrayList();
                if (sb3.contains(",")) {
                    for (String str7 : sb3.split(",")) {
                        p1.t d10 = d(jVar, str7);
                        if (d10 != null) {
                            arrayList.add(d10);
                        }
                    }
                } else {
                    p1.t d11 = d(jVar, sb3);
                    if (d11 != null) {
                        arrayList.add(d11);
                    }
                }
                if (!arrayList.isEmpty()) {
                    arrayList.sort(new m2.b(4));
                }
                StringBuilder sb4 = new StringBuilder();
                for (String str8 : i.f26076f.j()) {
                    if (str8.contains(";")) {
                        String[] split3 = str8.split(";");
                        if (ae.d.d().c("drive_is_get_specific_cookie")) {
                            String f14 = ae.d.d().f("drive_cookie_contains_json");
                            if (!TextUtils.isEmpty(f14)) {
                                for (String str9 : split3) {
                                    if (i7.l.H(str9, f14)) {
                                        sb4.append(str9);
                                    }
                                }
                            } else {
                                sb4.append(str8);
                            }
                        } else {
                            sb4.append(split3[0]);
                        }
                    } else {
                        sb4.append(str8);
                    }
                    sb4.append("#");
                }
                if (!arrayList.isEmpty()) {
                    String sb5 = sb4.toString();
                    String replace = sb5.substring(0, sb5.lastIndexOf("#")).replace("#", ";");
                    if (!TextUtils.isEmpty(replace) && replace.length() > 1) {
                        this.f33555b = replace;
                    }
                }
            }
            return arrayList;
        }

        public final ArrayList e() {
            j jVar;
            ArrayList arrayList;
            ArrayList<String> arrayList2;
            boolean z10;
            char c10;
            String str;
            ArrayList arrayList3;
            p1.t a10;
            ArrayList<String> arrayList4;
            ArrayList arrayList5 = new ArrayList();
            try {
                jVar = this.f33554a.get();
                arrayList = null;
            } catch (Exception unused) {
            }
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                o6.c W = jVar.W();
                if (W != null && (arrayList4 = W.O) != null && !arrayList4.isEmpty()) {
                    arrayList2 = W.O;
                } else {
                    arrayList2 = new ArrayList<>();
                }
                jVar.Y0 = arrayList2;
                boolean z11 = true;
                if (!arrayList2.isEmpty()) {
                    Iterator<String> it = jVar.Y0.iterator();
                    while (it.hasNext()) {
                        String next = it.next();
                        if (!TextUtils.isEmpty(next) && next.toLowerCase(Locale.US).startsWith("user-agent")) {
                            z10 = true;
                            break;
                        }
                    }
                }
                z10 = false;
                if (!z10) {
                    jVar.Y0 = jVar.L0(String.format(Locale.US, "%s: %s", "User-Agent", i7.u.w(jVar)));
                }
                String str2 = jVar.W().f27653c;
                if (!TextUtils.isEmpty(str2)) {
                    int hashCode = str2.hashCode();
                    if (hashCode != 1587) {
                        if (hashCode != 2191) {
                            if (hashCode != 2457) {
                                if (hashCode == 2780 && str2.equals("WS")) {
                                    c10 = 3;
                                    if (c10 == 0) {
                                        if (c10 != 1) {
                                            if (c10 != 2) {
                                                if (c10 != 3) {
                                                    arrayList5 = g(jVar);
                                                } else {
                                                    try {
                                                        t.a aVar = new t.a();
                                                        aVar.f28127b = Uri.parse("https://dummy.9kw7Kc8dzaa0BJ.live/file-f4k3.mp4");
                                                        a10 = aVar.a();
                                                        arrayList3 = new ArrayList();
                                                    } catch (Exception unused2) {
                                                    }
                                                    try {
                                                        arrayList3.add(a10);
                                                        String f0 = jVar.f0();
                                                        if (!TextUtils.isEmpty(f0)) {
                                                            jVar.runOnUiThread(new g(jVar, f0, 1));
                                                        }
                                                    } catch (Exception unused3) {
                                                        arrayList = arrayList3;
                                                        arrayList3 = arrayList;
                                                        arrayList5 = arrayList3;
                                                        j.J0(jVar);
                                                        return arrayList5;
                                                    }
                                                    arrayList5 = arrayList3;
                                                }
                                            } else {
                                                arrayList5 = f(jVar);
                                            }
                                        } else {
                                            arrayList = new ArrayList();
                                            try {
                                                List<String> list = jVar.W().L;
                                                if (list != null && !list.isEmpty()) {
                                                    for (String str3 : list) {
                                                        try {
                                                            arrayList = c(jVar, str3);
                                                            if (arrayList != null && !arrayList.isEmpty()) {
                                                                break;
                                                            }
                                                        } catch (Exception unused4) {
                                                        }
                                                    }
                                                }
                                            } catch (Exception unused5) {
                                            }
                                        }
                                    } else {
                                        ArrayList arrayList6 = new ArrayList();
                                        try {
                                            List<String> list2 = jVar.W().L;
                                            if (list2 != null && !list2.isEmpty()) {
                                                o6.d dVar = jVar.f33506z;
                                                if (dVar == null) {
                                                    z11 = false;
                                                }
                                                if (z11 && !TextUtils.isEmpty(dVar.f27680d)) {
                                                    str = dVar.f27680d;
                                                } else {
                                                    str = null;
                                                }
                                                String e10 = i7.n.e(jVar, str);
                                                if (!TextUtils.isEmpty(e10)) {
                                                    for (String str4 : list2) {
                                                        try {
                                                            arrayList6 = h(jVar, str4, e10);
                                                            if (arrayList6 != null && !arrayList6.isEmpty()) {
                                                                break;
                                                            }
                                                        } catch (Exception unused6) {
                                                        }
                                                    }
                                                }
                                            }
                                        } catch (Exception unused7) {
                                        }
                                        arrayList = arrayList6;
                                    }
                                    arrayList5 = arrayList;
                                }
                                c10 = 65535;
                                if (c10 == 0) {
                                }
                                arrayList5 = arrayList;
                            } else {
                                if (str2.equals("MF")) {
                                    c10 = 1;
                                    if (c10 == 0) {
                                    }
                                    arrayList5 = arrayList;
                                }
                                c10 = 65535;
                                if (c10 == 0) {
                                }
                                arrayList5 = arrayList;
                            }
                        } else {
                            if (str2.equals("DS")) {
                                c10 = 2;
                                if (c10 == 0) {
                                }
                                arrayList5 = arrayList;
                            }
                            c10 = 65535;
                            if (c10 == 0) {
                            }
                            arrayList5 = arrayList;
                        }
                    } else {
                        if (str2.equals("1D")) {
                            c10 = 0;
                            if (c10 == 0) {
                            }
                            arrayList5 = arrayList;
                        }
                        c10 = 65535;
                        if (c10 == 0) {
                        }
                        arrayList5 = arrayList;
                    }
                }
                j.J0(jVar);
                return arrayList5;
            }
            return null;
        }

        public final ArrayList g(j jVar) {
            boolean z10;
            String str;
            ArrayList arrayList = new ArrayList();
            try {
                List<String> list = jVar.W().L;
                if (list != null && !list.isEmpty()) {
                    o6.d dVar = jVar.f33506z;
                    if (dVar != null) {
                        z10 = true;
                    } else {
                        z10 = false;
                    }
                    if (z10 && !TextUtils.isEmpty(dVar.f27680d)) {
                        str = dVar.f27680d;
                    } else {
                        str = null;
                    }
                    String b10 = i7.n.b(jVar, str);
                    if (TextUtils.isEmpty(b10)) {
                        return null;
                    }
                    for (String str2 : list) {
                        try {
                            this.f33555b = "";
                            arrayList = b(jVar, str2, b10);
                            if (arrayList != null && !arrayList.isEmpty()) {
                                break;
                            }
                        } catch (Exception unused) {
                        }
                    }
                }
            } catch (Exception unused2) {
            }
            return arrayList;
        }
    }

    public static class c {
        public final WeakReference<j> f33556a;

        public c(j jVar) {
            this.f33556a = new WeakReference<>(jVar);
        }

        @JavascriptInterface
        public void processHTML(String str) {
            j jVar = this.f33556a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing() && !TextUtils.isEmpty(str)) {
                jVar.runOnUiThread(new y1.h(jVar, 7, str));
            }
        }
    }

    public static class d extends WebViewClient {
        public final WeakReference<j> f33557a;

        public d(j jVar) {
            this.f33557a = new WeakReference<>(jVar);
        }

        @Override
        public final void onLoadResource(WebView webView, String str) {
            boolean z10;
            super.onLoadResource(webView, str);
            j jVar = this.f33557a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                try {
                    String z02 = x6.a.z0(x6.a.y0(jVar.l0()));
                    if (!TextUtils.isEmpty(z02)) {
                        webView.evaluateJavascript(z02, null);
                    }
                } catch (Exception unused) {
                }
                try {
                    List<o6.e> o02 = jVar.o0();
                    boolean z11 = false;
                    if (o02 != null && !o02.isEmpty()) {
                        z10 = false;
                        for (o6.e eVar : o02) {
                            List<String> list = eVar.f27701a;
                            if (list != null && !list.isEmpty()) {
                                Iterator<String> it = list.iterator();
                                while (true) {
                                    if (!it.hasNext()) {
                                        break;
                                    }
                                    String next = it.next();
                                    if (!TextUtils.isEmpty(next)) {
                                        if (str.contains(next)) {
                                            z10 = true;
                                        } else {
                                            z10 = false;
                                            break;
                                        }
                                    }
                                }
                                if (z10) {
                                    break;
                                }
                            }
                        }
                    } else {
                        List<String> n02 = jVar.n0();
                        if (n02 != null && !n02.isEmpty()) {
                            z10 = false;
                            for (String str2 : n02) {
                                if (!TextUtils.isEmpty(str2)) {
                                    if (!str.contains(str2)) {
                                        break;
                                    }
                                    z10 = true;
                                }
                            }
                        }
                        if (!z11) {
                            jVar.e1(str);
                            return;
                        }
                        return;
                    }
                    z11 = z10;
                    if (!z11) {
                    }
                } catch (Exception unused2) {
                }
            }
        }

        @Override
        public final void onPageFinished(WebView webView, String str) {
            boolean z10;
            long j4;
            super.onPageFinished(webView, str);
            j jVar = this.f33557a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                try {
                    String z02 = x6.a.z0(x6.a.y0(jVar.l0()));
                    if (!TextUtils.isEmpty(z02)) {
                        webView.evaluateJavascript(z02, null);
                    }
                } catch (Exception unused) {
                }
                try {
                    String z03 = x6.a.z0(x6.a.y0(jVar.m0()));
                    if (!TextUtils.isEmpty(z03)) {
                        webView.evaluateJavascript(z03, null);
                    }
                } catch (Exception unused2) {
                }
                if (webView != null) {
                    webView.loadUrl("javascript:window.HtmlViewer.processHTML('<html>'+document.getElementsByTagName('html')[0].innerHTML+'</html>');");
                }
                o6.c W = jVar.W();
                if (W != null && W.f27670s) {
                    z10 = true;
                } else {
                    z10 = false;
                }
                if (z10) {
                    try {
                        Handler handler = jVar.f33541e0;
                        if (handler != null) {
                            handler.removeCallbacksAndMessages(null);
                            jVar.f33541e0 = null;
                        }
                    } catch (Exception unused3) {
                    }
                    Handler handler2 = new Handler(Looper.getMainLooper());
                    jVar.f33541e0 = handler2;
                    y1.h hVar = new y1.h(jVar, 6, webView);
                    o6.c W2 = jVar.W();
                    if (W2 != null) {
                        j4 = W2.f27676z;
                    } else {
                        j4 = 1000;
                    }
                    handler2.postDelayed(hVar, j4);
                }
            }
        }

        @Override
        public final void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
            j jVar = this.f33557a.get();
            if (jVar != null && !jVar.isDestroyed()) {
                jVar.isFinishing();
            }
            super.onReceivedError(webView, webResourceRequest, webResourceError);
        }

        @Override
        public final WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
            boolean z10;
            Map<String, String> requestHeaders;
            ArrayList<String> arrayList;
            String str;
            ArrayList<String> arrayList2;
            j jVar = this.f33557a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                try {
                    String uri = webResourceRequest.getUrl().toString();
                    List<o6.e> o02 = jVar.o0();
                    if (o02 != null && !o02.isEmpty()) {
                        z10 = false;
                        for (o6.e eVar : o02) {
                            List<String> list = eVar.f27701a;
                            if (list != null && !list.isEmpty()) {
                                Iterator<String> it = list.iterator();
                                while (true) {
                                    if (!it.hasNext()) {
                                        break;
                                    }
                                    String next = it.next();
                                    if (!TextUtils.isEmpty(next)) {
                                        if (uri.contains(next)) {
                                            z10 = true;
                                        } else {
                                            z10 = false;
                                            break;
                                        }
                                    }
                                }
                                if (z10) {
                                    break;
                                }
                            }
                        }
                    } else {
                        List<String> n02 = jVar.n0();
                        if (n02 != null && !n02.isEmpty()) {
                            z10 = false;
                            for (String str2 : n02) {
                                if (!TextUtils.isEmpty(str2)) {
                                    if (uri.contains(str2)) {
                                        z10 = true;
                                    }
                                }
                            }
                        }
                        z10 = false;
                        break;
                    }
                    if (z10 && (requestHeaders = webResourceRequest.getRequestHeaders()) != null && !requestHeaders.isEmpty()) {
                        o6.c W = jVar.W();
                        if (W != null && (arrayList2 = W.P) != null && !arrayList2.isEmpty()) {
                            arrayList = W.P;
                        } else {
                            arrayList = new ArrayList<>();
                        }
                        if (arrayList != null && !arrayList.isEmpty()) {
                            jVar.Y0 = new ArrayList<>();
                            Iterator<String> it2 = arrayList.iterator();
                            while (it2.hasNext()) {
                                String next2 = it2.next();
                                if (!TextUtils.isEmpty(next2) && (str = requestHeaders.get(next2)) != null) {
                                    jVar.Y0 = jVar.L0(String.format(Locale.US, "%s: %s", next2, str));
                                }
                            }
                        }
                    }
                } catch (Exception unused) {
                }
                return jVar.G0(webResourceRequest);
            }
            return super.shouldInterceptRequest(webView, webResourceRequest);
        }

        @Override
        public final boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
            List<String> list;
            List<String> list2;
            j jVar = this.f33557a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                String uri = webResourceRequest.getUrl().toString();
                if (i7.l.H(uri, jVar.h0())) {
                    return false;
                }
                o6.c W = jVar.W();
                if (W != null && (list2 = W.U) != null && !list2.isEmpty()) {
                    list = W.U;
                } else {
                    list = null;
                }
                return i7.l.H(uri, x6.a.y0(list));
            }
            return super.shouldOverrideUrlLoading(webView, webResourceRequest);
        }
    }

    public static class e implements p1.p<p1.z> {
        public final WeakReference<j> f33558a;

        public e(j jVar) {
            this.f33558a = new WeakReference<>(jVar);
        }
    }

    public static class f implements b0.c {
        public final WeakReference<j> f33559a;

        public f(j jVar) {
            this.f33559a = new WeakReference<>(jVar);
        }

        @Override
        public final void E(b0.a aVar) {
        }

        @Override
        public final void F(l0 l0Var) {
        }

        @Override
        public final void H(boolean z10) {
            j jVar = this.f33559a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                jVar.c1();
            }
        }

        @Override
        public final void J(int i, boolean z10) {
        }

        @Override
        public final void L(int i) {
            boolean z10;
            boolean z11;
            ImageButton imageButton;
            j jVar = this.f33559a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                if (i != 1 && i != 2) {
                    ViewGroup viewGroup = jVar.f33546k0;
                    if (viewGroup != null) {
                        viewGroup.setVisibility(8);
                    }
                } else {
                    ViewGroup viewGroup2 = jVar.f33546k0;
                    if (viewGroup2 != null) {
                        viewGroup2.setVisibility(0);
                    }
                }
                if (i == 4) {
                    z10 = true;
                } else {
                    z10 = false;
                }
                jVar.f33552q0 = z10;
                if (i == 4) {
                    jVar.f33544i0.setVisibility(0);
                    jVar.Z.setUseController(false);
                } else {
                    jVar.f33544i0.setVisibility(8);
                    if (i != 1 && i != 2) {
                        jVar.Z.setUseController(true);
                    } else {
                        PlayerView playerView = jVar.Z;
                        if (jVar.f33551p0 && i == 1) {
                            z11 = false;
                        } else {
                            z11 = true;
                        }
                        playerView.setUseController(z11);
                    }
                }
                if (i != 1) {
                    if (i != 2) {
                        if (i != 3) {
                            if (i == 4) {
                                if (jVar.D && (imageButton = jVar.f33545j0) != null) {
                                    imageButton.performClick();
                                }
                                jVar.f33547l0.setVisibility(0);
                                jVar.getWindow().clearFlags(128);
                                return;
                            }
                            return;
                        }
                        jVar.d1(true);
                        return;
                    }
                    jVar.b1(false);
                    jVar.getWindow().addFlags(128);
                    return;
                }
                jVar.b1(false);
                if (!jVar.D) {
                    jVar.f33547l0.setVisibility(0);
                }
                jVar.getWindow().clearFlags(128);
            }
        }

        @Override
        public final void N(p1.t tVar, int i) {
        }

        @Override
        public final void S(boolean z10) {
        }

        @Override
        public final void T(w1.l lVar) {
        }

        @Override
        public final void V(w1.l lVar) {
            c0 c0Var;
            j jVar = this.f33559a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                int i = lVar.f28255a;
                jVar.Z0 = i;
                if (i == 1002 && (c0Var = jVar.f33535a0) != null) {
                    c0Var.p();
                    jVar.f33535a0.b();
                }
            }
        }

        @Override
        public final void W(int i) {
        }

        @Override
        public final void Y(p1.v vVar) {
        }

        @Override
        public final void Z(int i) {
        }

        @Override
        public final void b0() {
            j jVar = this.f33559a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                jVar.d1(true);
            }
        }

        @Override
        public final void c0(p1.e eVar) {
        }

        @Override
        public final void d0(p1.m mVar) {
        }

        @Override
        public final void e0(List list) {
        }

        @Override
        public final void f(p1.w wVar) {
        }

        @Override
        public final void g(r1.b bVar) {
        }

        @Override
        public final void g0(int i, boolean z10) {
        }

        @Override
        public final void h(p0 p0Var) {
        }

        @Override
        public final void i0(int i, b0.d dVar, b0.d dVar2) {
        }

        @Override
        public final void j0(int i, int i10) {
        }

        @Override
        public final void l() {
        }

        @Override
        public final void m0(b0.b bVar) {
        }

        @Override
        public final void n(boolean z10) {
        }

        @Override
        public final void n0(j0 j0Var) {
        }

        @Override
        public final void p0(p1.a0 a0Var) {
        }

        @Override
        public final void q0(boolean z10) {
            j jVar = this.f33559a.get();
            if (jVar != null && !jVar.isDestroyed() && !jVar.isFinishing()) {
                jVar.c1();
                if (z10) {
                    jVar.d1(true);
                    ImageView imageView = jVar.f33547l0;
                    if (imageView != null) {
                        imageView.setVisibility(8);
                    }
                    jVar.Z0 = -10101;
                    jVar.f33536a1 = true;
                    WebView webView = jVar.d0;
                    if (webView != null) {
                        webView.loadUrl("javascript:window.HtmlViewer.processHTML('<html>'+document.getElementsByTagName('html')[0].innerHTML+'</html>');");
                    }
                    jVar.f1();
                    jVar.getWindow().addFlags(128);
                }
            }
        }

        @Override
        public final void r() {
        }

        @Override
        public final void x(int i) {
        }
    }

    public static void J0(j jVar) {
        e6.d b10;
        try {
            if (Objects.equals(Integer.valueOf(jVar.f33549n0), -1) && Objects.equals(Long.valueOf(jVar.f33550o0), -9223372036854775807L) && !jVar.v0()) {
                a6.b a10 = ((MyApplication) jVar.getApplicationContext()).a();
                String string = jVar.A.getString("post_id");
                if (!TextUtils.isEmpty(string) && (b10 = ((AppDatabase) a10.f782a).A().b(string)) != null) {
                    int i = b10.f22251b;
                    long j4 = b10.f22252c;
                    if (!Objects.equals(Integer.valueOf(i), -1) && !Objects.equals(Long.valueOf(j4), -9223372036854775807L)) {
                        jVar.f33549n0 = i;
                        jVar.f33550o0 = j4;
                    }
                }
            }
        } catch (Exception unused) {
        }
    }

    public static void K0(j jVar, String str) {
        String str2;
        ck.f b10 = dk.f.a().b(str, jVar.T());
        if ("MF".equalsIgnoreCase(jVar.W().f27653c)) {
            String f10 = ae.d.d().f("mediafire_file_element_css_query");
            if (TextUtils.isEmpty(f10)) {
                f10 = "a[id=downloadButton]";
            }
            String f11 = ae.d.d().f("mediafire_direct_link_attribute_key");
            if (TextUtils.isEmpty(f11)) {
                f11 = "href";
            }
            ck.o j02 = b10.q0().j0(f10);
            if (j02 != null && j02.q(f11) && !TextUtils.isEmpty(j02.d(f11))) {
                String a10 = j02.a(f11);
                if (!TextUtils.isEmpty(a10.trim())) {
                    str2 = a10.trim();
                    if (TextUtils.isEmpty(str2)) {
                        jVar.e1(str2);
                        return;
                    }
                    return;
                }
            }
            str2 = "";
            if (TextUtils.isEmpty(str2)) {
            }
        }
    }

    public static HashMap R0(ArrayList arrayList) {
        try {
            HashMap hashMap = new HashMap();
            if (arrayList != null && !arrayList.isEmpty()) {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    String str = (String) it.next();
                    if (!TextUtils.isEmpty(str) && str.contains(":")) {
                        String[] split = str.split(":", 2);
                        hashMap.put(split[0].trim(), split[1].trim());
                    }
                }
                if (!hashMap.isEmpty()) {
                    return hashMap;
                }
                return null;
            }
            return null;
        } catch (Exception unused) {
            return null;
        }
    }

    public final ArrayList<String> L0(String str) {
        if (!TextUtils.isEmpty(str) && str.contains(":")) {
            String[] split = str.split(":", 2);
            if (split.length >= 2) {
                String trim = split[0].trim();
                if (!this.Y0.isEmpty()) {
                    for (int i = 0; i < this.Y0.size(); i++) {
                        String str2 = this.Y0.get(i);
                        Locale locale = Locale.US;
                        if (str2.toLowerCase(locale).startsWith(trim.toLowerCase(locale))) {
                            this.Y0.remove(str2);
                        }
                    }
                }
            }
            if (!this.Y0.contains(str)) {
                this.Y0.add(str);
            }
        }
        return this.Y0;
    }

    public final void M0() {
        this.f33551p0 = true;
        this.f33549n0 = -1;
        this.f33550o0 = -9223372036854775807L;
    }

    public final List<p1.t> N0() {
        t.f fVar;
        boolean z10;
        List<p1.t> list = this.W0;
        if (list != null && !list.isEmpty()) {
            for (int i = 0; i < this.W0.size(); i++) {
                p1.t tVar = this.W0.get(i);
                if (e0.f30447a >= 24 && (fVar = tVar.f28121b) != null) {
                    if (!e0.O(fVar.f28174a)) {
                        int i10 = 0;
                        while (true) {
                            t.f fVar2 = tVar.f28121b;
                            if (i10 >= fVar2.f28179f.size()) {
                                break;
                            } else if (e0.O(fVar2.f28179f.get(i10).f28183a)) {
                                break;
                            } else {
                                i10++;
                            }
                        }
                    }
                    z10 = false;
                    if (z10) {
                        Toast.makeText(this, getString(R.string.error_cleartext_not_permitted), 1).show();
                        finish();
                        return Collections.emptyList();
                    }
                    t.f fVar3 = tVar.f28121b;
                    fVar3.getClass();
                    t.d dVar = fVar3.f28176c;
                    if (dVar != null && !MediaDrm.isCryptoSchemeSupported(b2.u.o(dVar.f28148a))) {
                        Toast.makeText(this, getString(R.string.error_drm_unsupported_scheme), 1).show();
                        finish();
                        return Collections.emptyList();
                    }
                }
                z10 = true;
                if (z10) {
                }
            }
            return this.W0;
        }
        return Collections.emptyList();
    }

    public final void O0() {
        try {
            FrameLayout frameLayout = this.f33539c0;
            if (frameLayout != null) {
                frameLayout.removeAllViews();
            }
            WebView webView = this.d0;
            if (webView != null) {
                webView.loadUrl("about:blank");
                this.d0.clearHistory();
                this.d0.clearCache(true);
                this.d0.onPause();
                this.d0.removeAllViews();
                this.d0.destroyDrawingCache();
                this.d0.destroy();
                this.d0 = null;
            }
        } catch (Exception unused) {
        }
        try {
            Handler handler = this.f33541e0;
            if (handler != null) {
                handler.removeCallbacksAndMessages(null);
                this.f33541e0 = null;
            }
        } catch (Exception unused2) {
        }
        try {
            Handler handler2 = this.f0;
            if (handler2 != null) {
                handler2.removeCallbacksAndMessages(null);
                this.f0 = null;
            }
        } catch (Exception unused3) {
        }
    }

    public final p1.t P0() {
        boolean z10;
        List<p1.t> list;
        if (this.f33535a0 != null && (list = this.X0) != null && !list.isEmpty()) {
            z10 = true;
        } else {
            z10 = false;
        }
        if (z10) {
            for (p1.t tVar : this.X0) {
                if (this.f33535a0.a() != null && tVar.f28120a.equals(this.f33535a0.a().f28120a)) {
                    return tVar;
                }
            }
            return null;
        }
        return null;
    }

    public final i.a Q0(HashMap hashMap) {
        j.a aVar = new j.a();
        TimeUnit timeUnit = TimeUnit.SECONDS;
        aVar.f31282c = (int) timeUnit.toMillis(10L);
        aVar.f31283d = (int) timeUnit.toMillis(16L);
        aVar.f31284e = true;
        if (hashMap != null && !hashMap.isEmpty()) {
            u1.r rVar = aVar.f31280a;
            synchronized (rVar) {
                rVar.f31294b = null;
                ((Map) rVar.f31293a).clear();
                ((Map) rVar.f31293a).putAll(hashMap);
            }
        }
        return new i.a(this, aVar);
    }

    public final ck.f S0(String str, HashMap hashMap) throws IOException {
        if (!hashMap.isEmpty()) {
            ak.d b10 = zj.c.b(str);
            b10.b(hashMap);
            b10.f987a.f996h = true;
            b10.c((int) TimeUnit.SECONDS.toMillis(120L));
            return b10.a();
        }
        ak.d b11 = zj.c.b(str);
        b11.f987a.f996h = true;
        b11.c((int) TimeUnit.SECONDS.toMillis(120L));
        return b11.a();
    }

    public final void T0() {
        if (this.D) {
            getWindow().getDecorView().setSystemUiVisibility(3846);
        }
    }

    public final void U0() {
        boolean z10;
        int i;
        if (this.f33535a0 == null) {
            List<p1.t> N0 = N0();
            this.W0 = N0;
            if (N0.isEmpty()) {
                return;
            }
            m.b bVar = new m.b(this);
            i2.n nVar = new i2.n(this.Y, new r2.j());
            f0.f(!bVar.f32320u);
            bVar.f32305d = new w1.p(0, nVar);
            f0.f(!bVar.f32320u);
            bVar.f32311k = true;
            f0.f(!bVar.f32320u);
            bVar.f32320u = true;
            this.f33535a0 = new c0(bVar);
            final GestureDetector gestureDetector = new GestureDetector(this, new a());
            this.Z.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public final boolean onTouch(View view, MotionEvent motionEvent) {
                    return gestureDetector.onTouchEvent(motionEvent);
                }
            });
            this.Z.setUseController(false);
            this.f33535a0.q(this.f33537b0);
            c0 c0Var = this.f33535a0;
            f fVar = new f(this);
            c0Var.getClass();
            c0Var.f32130l.a(fVar);
            c0 c0Var2 = this.f33535a0;
            o2.a aVar = new o2.a();
            c0Var2.getClass();
            c0Var2.f32136r.f0(aVar);
            c0 c0Var3 = this.f33535a0;
            p1.e eVar = p1.e.f27893g;
            c0Var3.B0();
            if (!c0Var3.f32120e0) {
                boolean a10 = e0.a(c0Var3.Y, eVar);
                s1.m<b0.c> mVar = c0Var3.f32130l;
                if (!a10) {
                    c0Var3.Y = eVar;
                    c0Var3.r0(1, 3, eVar);
                    mVar.c(20, new d7.o(0, eVar));
                }
                w1.d dVar = c0Var3.A;
                dVar.c(eVar);
                c0Var3.f32124h.f(eVar);
                boolean j4 = c0Var3.j();
                int e10 = dVar.e(c0Var3.A(), j4);
                if (j4 && e10 != 1) {
                    i = 2;
                } else {
                    i = 1;
                }
                c0Var3.x0(e10, i, j4);
                mVar.b();
            }
            this.f33535a0.u0(this.f33551p0);
            this.Z.setPlayer(this.f33535a0);
        }
        int i10 = this.f33549n0;
        if (i10 != -1) {
            z10 = true;
        } else {
            z10 = false;
        }
        if (z10) {
            this.f33535a0.b0(i10, this.f33550o0, false);
        }
        this.f33535a0.s0(this.W0, true ^ z10);
        this.f33535a0.b();
    }

    public final void V0() {
        try {
            com.bumptech.glide.b.b(this).c(this).k(this.A.getString("thumb", "https://dummy.lM9OSQ9ttBQ.w3bs1t3/file-f4k3.jpg")).l(R.color.night_100).e(R.color.night_100).B(this.f33547l0);
        } catch (Exception unused) {
        }
    }

    public final void W0() {
        boolean z10;
        boolean z11;
        try {
            o6.c W = W();
            boolean z12 = true;
            if (W != null && W.f27667p) {
                z10 = true;
            } else {
                z10 = false;
            }
            if (z10) {
                this.f33539c0 = (FrameLayout) findViewById(R.id.webViewContainerFullscreen);
            } else {
                this.f33539c0 = (FrameLayout) findViewById(R.id.webViewContainer);
            }
            WebView webView = new WebView(getApplicationContext());
            this.d0 = webView;
            webView.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
            this.f33539c0.removeAllViews();
            this.f33539c0.addView(this.d0);
            this.f33539c0.setVisibility(4);
            CookieManager.getInstance().setAcceptCookie(true);
            CookieManager.getInstance().setAcceptThirdPartyCookies(this.d0, true);
            String p02 = p0();
            if (TextUtils.isEmpty(p02)) {
                p02 = i7.u.w(this);
                if (TextUtils.isEmpty(p02)) {
                    p02 = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36";
                }
            }
            if (!TextUtils.isEmpty(p02)) {
                String d0 = d0();
                String e02 = e0();
                if (!TextUtils.isEmpty(d0) && !TextUtils.isEmpty(e02)) {
                    String p10 = i7.l.p(d0, e02);
                    if (!TextUtils.isEmpty(p10)) {
                        p02 = p10 + p02;
                    }
                } else {
                    String j02 = j0();
                    if (!TextUtils.isEmpty(j02) && !p02.startsWith(j02)) {
                        p02 = j02 + p02;
                    }
                    String k02 = k0();
                    if (!TextUtils.isEmpty(k02) && !p02.startsWith(k02)) {
                        p02 = p02 + k02;
                    }
                }
            }
            WebSettings settings = this.d0.getSettings();
            settings.setJavaScriptEnabled(true);
            settings.setDomStorageEnabled(true);
            settings.setUserAgentString(p02);
            o6.c W2 = W();
            if (W2 != null && W2.f27668q) {
                z11 = true;
            } else {
                z11 = false;
            }
            settings.setLoadsImagesAutomatically(z11);
            o6.c W3 = W();
            if (W3 == null || !W3.f27669r) {
                z12 = false;
            }
            settings.setMediaPlaybackRequiresUserGesture(z12);
            this.d0.setHapticFeedbackEnabled(false);
            this.d0.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public final boolean onLongClick(View view) {
                    int i = j.f33534d1;
                    return true;
                }
            });
            WebView.setWebContentsDebuggingEnabled(false);
            this.d0.addJavascriptInterface(new c(this), "HtmlViewer");
            this.d0.setWebViewClient(new d(this));
        } catch (Exception unused) {
        }
    }

    public final void X0() {
        if (this.V0 != null) {
            this.V0 = null;
        }
        b bVar = new b(this);
        this.V0 = bVar;
        bVar.a();
    }

    public final void Y0(String str) {
        String str2;
        jk.a.a("j").a("loadIFrameData() url = %s", str);
        String c02 = dk.f.a().b(be.h.e("<!doctype html><html style=\"height:100%;\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\"></head><body style=\"height:100%;margin:0;\">", "<iframe id=\"x-iframe\" style=\"display:block;border:none;height:100vh;width:100vw;\" src=\"" + str + "\" frameborder=\"0\" allowfullscreen allowtransparency></iframe>", "</body></html>"), "").c0();
        try {
            URL url = new URL(str);
            String T = T();
            if (!TextUtils.isEmpty(T) && (URLUtil.isHttpsUrl(T) || URLUtil.isHttpUrl(T))) {
                url = new URL(T);
            }
            str2 = url.getProtocol() + "://" + url.getHost();
        } catch (Exception unused) {
            str2 = "https://example.com";
        }
        String str3 = str2;
        WebView webView = this.d0;
        if (webView != null) {
            webView.loadDataWithBaseURL(str3, c02, "text/html", "UTF-8", null);
        }
    }

    public final void Z0() {
        FrameLayout frameLayout;
        FrameLayout frameLayout2;
        int i;
        p1.t P0;
        boolean z10;
        int i10;
        t.f fVar;
        String upperCase;
        boolean z11;
        boolean z12;
        int i11;
        int i12;
        int i13;
        try {
            Button button = (Button) findViewById(R.id.exo_rew_with_amount);
            if (button != null) {
                button.setVisibility(8);
            }
            Button button2 = (Button) findViewById(R.id.exo_ffwd_with_amount);
            if (button2 != null) {
                button2.setVisibility(8);
            }
            FrameLayout frameLayout3 = (FrameLayout) findViewById(R.id.liveBadge);
            if (frameLayout3 != null) {
                if (v0()) {
                    i12 = 0;
                } else {
                    i12 = 8;
                }
                frameLayout3.setVisibility(i12);
                FrameLayout frameLayout4 = (FrameLayout) findViewById(R.id.durationHolder);
                if (frameLayout4 != null) {
                    if (v0()) {
                        i13 = 8;
                    } else {
                        i13 = 0;
                    }
                    frameLayout4.setVisibility(i13);
                }
            }
            FrameLayout frameLayout5 = (FrameLayout) findViewById(R.id.subtitleBtnHolder);
            boolean z13 = true;
            if (frameLayout5 != null) {
                o6.d dVar = this.f33506z;
                o6.c W = W();
                if (dVar != null) {
                    z11 = true;
                } else {
                    z11 = false;
                }
                if (z11 && W != null && W.f27671u) {
                    z12 = true;
                } else {
                    z12 = false;
                }
                if (z12) {
                    i11 = 0;
                } else {
                    i11 = 8;
                }
                frameLayout5.setVisibility(i11);
            }
            try {
                P0 = P0();
            } catch (Exception unused) {
            }
            if (P0 != null && (fVar = P0.f28121b) != null) {
                Object obj = fVar.f28180g;
                if (obj instanceof String) {
                    String str = (String) obj;
                    if (!TextUtils.isEmpty(str)) {
                        if (TextUtils.isDigitsOnly(str)) {
                            upperCase = str + ah.a.PUSH_MINIFIED_BUTTON_ICON;
                        } else {
                            upperCase = str.toUpperCase(Locale.US);
                        }
                        ((TextView) findViewById(R.id.qualityTV)).setText(upperCase);
                        z10 = true;
                        View findViewById = findViewById(R.id.qualityBtnHolder);
                        if (!z10) {
                            i10 = 0;
                        } else {
                            i10 = 8;
                        }
                        findViewById.setVisibility(i10);
                        frameLayout = (FrameLayout) findViewById(R.id.selectTracksBtnHolder);
                        if (frameLayout != null && this.f33535a0 != null) {
                            FrameLayout frameLayout6 = (FrameLayout) findViewById(R.id.qualityBtnHolder);
                            if (a0.u0(this.f33535a0) || frameLayout6.getVisibility() != 8) {
                                z13 = false;
                            }
                            if (!z13) {
                                i = 0;
                            } else {
                                i = 8;
                            }
                            frameLayout.setVisibility(i);
                        }
                        frameLayout2 = (FrameLayout) findViewById(R.id.fullscreenBtnHolder);
                        if (frameLayout2 == null && this.Z != null) {
                            if (x0()) {
                                this.Z.setFullscreenButtonClickListener(this);
                                frameLayout2.setVisibility(0);
                                return;
                            }
                            this.Z.setFullscreenButtonClickListener(null);
                            frameLayout2.setVisibility(8);
                            return;
                        }
                    }
                }
            }
            z10 = false;
            View findViewById2 = findViewById(R.id.qualityBtnHolder);
            if (!z10) {
            }
            findViewById2.setVisibility(i10);
            frameLayout = (FrameLayout) findViewById(R.id.selectTracksBtnHolder);
            if (frameLayout != null) {
                FrameLayout frameLayout62 = (FrameLayout) findViewById(R.id.qualityBtnHolder);
                if (a0.u0(this.f33535a0)) {
                }
                z13 = false;
                if (!z13) {
                }
                frameLayout.setVisibility(i);
            }
            frameLayout2 = (FrameLayout) findViewById(R.id.fullscreenBtnHolder);
            if (frameLayout2 == null) {
            }
        } catch (Exception unused2) {
        }
    }

    @Override
    public final int a0() {
        return R.layout.activity_player_exo;
    }

    public final void a1() {
        String str;
        AudioTrack audioTrack;
        c0 c0Var = this.f33535a0;
        if (c0Var != null) {
            if (c0Var != null) {
                this.f33537b0 = c0Var.Q();
            }
            i1();
            c0 c0Var2 = this.f33535a0;
            c0Var2.getClass();
            StringBuilder sb = new StringBuilder("Release ");
            sb.append(Integer.toHexString(System.identityHashCode(c0Var2)));
            sb.append(" [AndroidXMedia3/1.3.0] [");
            sb.append(e0.f30451e);
            sb.append("] [");
            HashSet<String> hashSet = p1.u.f28197a;
            synchronized (p1.u.class) {
                str = p1.u.f28198b;
            }
            sb.append(str);
            sb.append(q2.i.f20142e);
            s1.n.f("ExoPlayerImpl", sb.toString());
            c0Var2.B0();
            if (e0.f30447a < 21 && (audioTrack = c0Var2.O) != null) {
                audioTrack.release();
                c0Var2.O = null;
            }
            c0Var2.f32143z.a(false);
            c0Var2.B.getClass();
            c0Var2.C.getClass();
            w1.d dVar = c0Var2.A;
            dVar.f32154c = null;
            dVar.a();
            if (!c0Var2.f32129k.z()) {
                c0Var2.f32130l.e(10, new p1.b(4));
            }
            c0Var2.f32130l.d();
            c0Var2.i.e();
            c0Var2.t.c(c0Var2.f32136r);
            a1 a1Var = c0Var2.f32125h0;
            if (a1Var.f32090o) {
                c0Var2.f32125h0 = a1Var.a();
            }
            a1 g10 = c0Var2.f32125h0.g(1);
            c0Var2.f32125h0 = g10;
            a1 b10 = g10.b(g10.f32078b);
            c0Var2.f32125h0 = b10;
            b10.f32091p = b10.f32093r;
            c0Var2.f32125h0.f32092q = 0L;
            c0Var2.f32136r.a();
            c0Var2.f32124h.d();
            c0Var2.q0();
            Surface surface = c0Var2.Q;
            if (surface != null) {
                surface.release();
                c0Var2.Q = null;
            }
            c0Var2.getClass();
            c0Var2.f32115b0 = r1.b.f29823b;
            c0Var2.f32120e0 = true;
            this.f33535a0 = null;
            this.Z.setPlayer(null);
            ImageView imageView = this.f33547l0;
            if (imageView != null && this.f33552q0 && !this.D) {
                imageView.setVisibility(0);
            }
        }
    }

    public final void b1(boolean z10) {
        long j4;
        c1();
        try {
            Handler handler = this.f0;
            if (handler != null) {
                handler.removeCallbacksAndMessages(null);
                this.f0 = null;
            }
        } catch (Exception unused) {
        }
        o6.c W = W();
        String str = W.f27653c;
        if (z10) {
            j4 = 0;
        } else {
            j4 = W.A;
        }
        Handler handler2 = new Handler(Looper.getMainLooper());
        this.f0 = handler2;
        handler2.postDelayed(new j.u(this, 8, str), j4);
    }

    public final void c1() {
        boolean z10;
        int G;
        long max;
        String str;
        if (this.f33535a0 != null && !v0()) {
            boolean equals = Objects.equals(Integer.valueOf(this.f33535a0.A()), 3);
            boolean equals2 = Objects.equals(Integer.valueOf(this.f33535a0.A()), 2);
            boolean equals3 = Objects.equals(Integer.valueOf(this.f33535a0.A()), 4);
            if (!equals && !equals2 && !equals3) {
                z10 = false;
            } else {
                z10 = true;
            }
            final boolean z11 = z10;
            if (equals3) {
                G = -1;
            } else {
                G = this.f33535a0.G();
            }
            final int i = G;
            if (equals3) {
                max = -9223372036854775807L;
            } else {
                max = Math.max(0L, this.f33535a0.y());
            }
            final long j4 = max;
            Bundle bundle = this.A;
            if (bundle != null) {
                str = bundle.getString("post_id");
            } else {
                str = null;
            }
            final String str2 = str;
            if (this.V != null && !TextUtils.isEmpty(str2)) {
                this.V.f24724a.execute(new Runnable() {
                    @Override
                    public final void run() {
                        String str3 = str2;
                        int i10 = i;
                        long j10 = j4;
                        j jVar = j.this;
                        jVar.getClass();
                        try {
                            a6.b a10 = ((MyApplication) jVar.getApplicationContext()).a();
                            e6.d dVar = new e6.d();
                            Objects.requireNonNull(str3);
                            dVar.f22250a = str3;
                            dVar.f22251b = i10;
                            dVar.f22252c = j10;
                            dVar.f22253d = System.currentTimeMillis();
                            if (z11) {
                                ((AppDatabase) a10.f782a).A().a(dVar);
                            }
                        } catch (Exception unused) {
                        }
                    }
                });
            }
        }
    }

    public final void d1(boolean z10) {
        int i;
        ImageButton imageButton = this.f33545j0;
        if (imageButton != null) {
            imageButton.setEnabled(z10);
            if (z10) {
                i = 17170443;
            } else {
                i = R.color.white_30;
            }
            Object obj = h0.a.f23629a;
            w0.e.c(this.f33545j0, ColorStateList.valueOf(a.c.a(this, i)));
        }
    }

    @Override
    public final boolean dispatchKeyEvent(KeyEvent keyEvent) {
        return this.Z.dispatchKeyEvent(keyEvent) || super.dispatchKeyEvent(keyEvent);
    }

    public final void e1(String str) {
        String str2;
        this.Y = Q0(R0(this.Y0));
        t.a aVar = new t.a();
        aVar.f28127b = Uri.parse(str);
        o6.c W = W();
        if (W != null && !TextUtils.isEmpty(W.I)) {
            str2 = W.I;
        } else {
            str2 = "";
        }
        if (TextUtils.isEmpty(str2) && str.contains(".m3u8")) {
            str2 = "application/x-mpegURL";
        }
        if (!TextUtils.isEmpty(str2)) {
            aVar.f28128c = str2;
        }
        p1.t a10 = aVar.a();
        if (v0()) {
            M0();
        }
        ArrayList arrayList = new ArrayList();
        this.W0 = arrayList;
        arrayList.add(a10);
        this.f33535a0 = null;
        U0();
        f1();
    }

    public final void f1() {
        try {
            if (this.d0 != null) {
                if (o0().isEmpty()) {
                    O0();
                } else {
                    this.d0.stopLoading();
                }
            }
        } catch (Exception unused) {
        }
        try {
            Handler handler = this.f33541e0;
            if (handler != null) {
                handler.removeCallbacksAndMessages(null);
                this.f33541e0 = null;
            }
        } catch (Exception unused2) {
        }
        try {
            Handler handler2 = this.f0;
            if (handler2 != null) {
                handler2.removeCallbacksAndMessages(null);
                this.f0 = null;
            }
        } catch (Exception unused3) {
        }
        lj.w wVar = i7.s.a().f24732a;
        try {
            for (lj.d dVar : wVar.f26222a.h()) {
                if (Object.class.cast(dVar.g().f26282e.get(Object.class)).equals("REFRESH_MEDIA_SOURCE")) {
                    dVar.cancel();
                }
            }
        } catch (Exception unused4) {
        }
        try {
            for (lj.d dVar2 : wVar.f26222a.i()) {
                if (Object.class.cast(dVar2.g().f26282e.get(Object.class)).equals("REFRESH_MEDIA_SOURCE")) {
                    dVar2.cancel();
                }
            }
        } catch (Exception unused5) {
        }
    }

    public final void g1(boolean z10) {
        if (z10) {
            this.S0 = getWindow().getDecorView().getSystemUiVisibility();
            this.T0 = getWindow().getNavigationBarColor();
            this.U0 = getRequestedOrientation();
            WindowManager.LayoutParams attributes = getWindow().getAttributes();
            attributes.flags |= 1024;
            getWindow().setAttributes(attributes);
            getWindow().getDecorView().setSystemUiVisibility(3846);
            Window window = getWindow();
            Object obj = h0.a.f23629a;
            window.setNavigationBarColor(a.c.a(this, R.color.dark_50));
            setRequestedOrientation(10);
            return;
        }
        WindowManager.LayoutParams attributes2 = getWindow().getAttributes();
        attributes2.flags &= -1025;
        getWindow().setAttributes(attributes2);
        getWindow().getDecorView().setSystemUiVisibility(this.S0);
        getWindow().setNavigationBarColor(this.T0);
        setRequestedOrientation(this.U0);
    }

    public final void h1(String str) {
        Bundle bundle = this.A;
        if (bundle != null) {
            s5.f.b(this, bundle.getString(q2.h.D0), this.A.getString("b_url"), str);
        }
    }

    public final void i1() {
        c0 c0Var = this.f33535a0;
        if (c0Var != null) {
            this.f33551p0 = c0Var.j();
            this.f33549n0 = this.f33535a0.G();
            this.f33550o0 = Math.max(0L, this.f33535a0.y());
        }
    }

    @Override
    public final void l(int i) {
        if (i == 0) {
            Z0();
        } else {
            new Handler(Looper.getMainLooper()).postDelayed(new e.n(6, this), TimeUnit.SECONDS.toMillis(3L));
        }
    }

    @Override
    public final void onBackPressed() {
        if (this.D) {
            ImageButton imageButton = this.f33545j0;
            if (imageButton != null) {
                imageButton.performClick();
            }
        } else if (!this.B) {
            super.onBackPressed();
        } else {
            N(this);
        }
    }

    @Override
    public void onClickModuleButton(View view) {
        boolean z10;
        String upperCase;
        List<p1.t> list;
        List<o6.c> g02;
        super.onClickModuleButton(view);
        c1();
        boolean z11 = false;
        if (view.getId() == R.id.qualityBtnHolder) {
            try {
                if (this.f33535a0 != null && (list = this.X0) != null && !list.isEmpty()) {
                    z10 = true;
                } else {
                    z10 = false;
                }
                if (z10) {
                    n1 n1Var = new n1(new o.c(this, (int) R.style.CustomPopupThemeDark), view);
                    androidx.appcompat.view.menu.f fVar = n1Var.f1723a;
                    fVar.setGroupCheckable(0, true, true);
                    int size = this.X0.size();
                    int i = 0;
                    while (true) {
                        if (i < size) {
                            p1.t tVar = this.X0.get(i);
                            if (!TextUtils.isEmpty(tVar.f28120a) && this.f33535a0.a() != null && !TextUtils.isEmpty(this.f33535a0.a().f28120a)) {
                                if (tVar.f28120a.equals(this.f33535a0.a().f28120a)) {
                                    break;
                                }
                            }
                            i++;
                        } else {
                            i = 0;
                            break;
                        }
                    }
                    for (int i10 = 0; i10 < size; i10++) {
                        t.f fVar2 = this.X0.get(i10).f28121b;
                        if (fVar2 != null) {
                            Object obj = fVar2.f28180g;
                            if (obj instanceof String) {
                                String str = (String) obj;
                                if (TextUtils.isDigitsOnly(str)) {
                                    upperCase = str + ah.a.PUSH_MINIFIED_BUTTON_ICON;
                                } else {
                                    upperCase = str.toUpperCase(Locale.US);
                                }
                                int i11 = i10 + 1;
                                if (i == i10) {
                                    androidx.appcompat.view.menu.h a10 = fVar.a(0, i10, i11, upperCase);
                                    a10.setCheckable(true);
                                    a10.setChecked(true);
                                } else {
                                    fVar.a(0, i10, i11, upperCase);
                                }
                            }
                        }
                    }
                    if (fVar.hasVisibleItems()) {
                        fVar.a(0, 1000, 0, getString(R.string.menu_popup_quality)).setEnabled(false);
                        n1Var.f1726d = new h(this, i, this);
                        androidx.appcompat.view.menu.i iVar = n1Var.f1725c;
                        if (!iVar.b()) {
                            if (iVar.f1252f != null) {
                                iVar.d(0, 0, false, false);
                            } else if (z11) {
                                throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor");
                            } else {
                                return;
                            }
                        }
                        z11 = true;
                        if (z11) {
                        }
                    }
                }
            } catch (Exception unused) {
            }
        } else if (view.getId() == R.id.selectTracksBtnHolder) {
            if (!this.R0 && a0.u0(this.f33535a0)) {
                this.R0 = true;
                c0 c0Var = this.f33535a0;
                DialogInterface.OnDismissListener onDismissListener = new DialogInterface.OnDismissListener() {
                    @Override
                    public final void onDismiss(DialogInterface dialogInterface) {
                        j.this.R0 = false;
                    }
                };
                l0 C = c0Var.C();
                final j0 Q = c0Var.Q();
                final n3.o oVar = new n3.o(c0Var);
                final a0 a0Var = new a0();
                DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i12) {
                        boolean z12;
                        Map<g0, h0> map;
                        com.google.common.collect.j0 j0Var = a0.T0;
                        j0.b a11 = j0.this.a();
                        int i13 = 0;
                        while (true) {
                            com.google.common.collect.j0 j0Var2 = a0.T0;
                            if (i13 < j0Var2.f17586d) {
                                int intValue = ((Integer) j0Var2.get(i13)).intValue();
                                a0 a0Var2 = a0Var;
                                a0.c cVar = a0Var2.f33511o0.get(intValue);
                                if (cVar != null && cVar.f33516b0) {
                                    z12 = true;
                                } else {
                                    z12 = false;
                                }
                                a11.k(intValue, z12);
                                a11.c(intValue);
                                a0.c cVar2 = a0Var2.f33511o0.get(intValue);
                                if (cVar2 == null) {
                                    map = Collections.emptyMap();
                                } else {
                                    map = cVar2.f33517c0;
                                }
                                for (h0 h0Var : map.values()) {
                                    a11.a(h0Var);
                                }
                                i13++;
                            } else {
                                ((b0) ((n3.o) oVar).f26949a).q(a11.b());
                                return;
                            }
                        }
                    }
                };
                a0Var.f33513q0 = R.string.track_selection_title;
                a0Var.R0 = onClickListener;
                a0Var.S0 = onDismissListener;
                int i12 = 0;
                while (true) {
                    com.google.common.collect.j0 j0Var = a0.T0;
                    if (i12 < j0Var.f17586d) {
                        int intValue = ((Integer) j0Var.get(i12)).intValue();
                        ArrayList arrayList = new ArrayList();
                        u.b listIterator = C.f28029a.listIterator(0);
                        while (listIterator.hasNext()) {
                            l0.a aVar = (l0.a) listIterator.next();
                            if (aVar.f28031b.f27935c == intValue) {
                                arrayList.add(aVar);
                            }
                        }
                        if (!arrayList.isEmpty()) {
                            a0.c cVar = new a0.c();
                            boolean contains = Q.B.contains(Integer.valueOf(intValue));
                            cVar.Y = arrayList;
                            cVar.f33516b0 = contains;
                            cVar.Z = true;
                            cVar.f33515a0 = false;
                            cVar.f33517c0 = new HashMap(TrackSelectionView.a(arrayList, Q.A, false));
                            a0Var.f33511o0.put(intValue, cVar);
                            a0Var.f33512p0.add(Integer.valueOf(intValue));
                        }
                        i12++;
                    } else {
                        a0Var.t0(F(), null);
                        return;
                    }
                }
            }
        } else if (view.getId() == R.id.replay_btn) {
            c0 c0Var2 = this.f33535a0;
            if (c0Var2 != null) {
                c0Var2.c0(5, 0L);
                this.f33535a0.u0(true);
            }
        } else if (view.getId() == R.id.server_btn && (g02 = g0()) != null && !g02.isEmpty()) {
            String[] strArr = new String[g02.size()];
            for (int i13 = 0; i13 < g02.size(); i13++) {
                strArr[i13] = i0(g02.get(i13));
            }
            int i14 = x6.a.U;
            d.a aVar2 = new d.a(this);
            String string = getString(R.string.dialog_server_title);
            SpannableStringBuilder r10 = i7.l.r(this, string, getString(R.string.dialog_server_message));
            if (r10 != null) {
                TextView textView = new TextView(this);
                int f10 = i7.l.f(this, 22.0f);
                textView.setPadding(f10, f10, f10, 0);
                textView.setText(r10);
                aVar2.f1110a.f1084e = textView;
                TypedValue typedValue = new TypedValue();
                getTheme().resolveAttribute(R.attr.appTextColorPrimary, typedValue, true);
                textView.setTextColor(typedValue.data);
            } else {
                aVar2.setTitle(string);
            }
            aVar2.a(strArr, i14, new w6.f(this, i14, 1));
            aVar2.create().show();
        }
    }

    @Override
    public final void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        T0();
    }

    @Override
    @SuppressLint({"InflateParams"})
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (bundle != null) {
            this.f33549n0 = bundle.getInt("start_item_index");
            this.f33550o0 = bundle.getLong("start_position");
            Bundle bundle2 = bundle.getBundle("track_selector_parameters");
            if (bundle2 != null) {
                j0 j0Var = j0.C;
                this.f33537b0 = new j0(new j0.b(bundle2));
            }
        } else {
            j0.b bVar = new j0.b(this);
            bVar.i(new String[0]);
            bVar.j();
            bVar.h(this);
            this.f33537b0 = bVar.b();
            M0();
        }
        this.V = new i7.k();
        this.W = (ImageView) findViewById(R.id.previewArrows);
        this.X = (ImageView) findViewById(R.id.previewBArrows);
        PlayerView playerView = (PlayerView) findViewById(R.id.playerView);
        this.Z = playerView;
        playerView.setControllerVisibilityListener(this);
        this.Z.setErrorMessageProvider(new e(this));
        this.Z.requestFocus();
        FrameLayout overlayFrameLayout = this.Z.getOverlayFrameLayout();
        LayoutInflater layoutInflater = getLayoutInflater();
        this.f33546k0 = (ViewGroup) layoutInflater.inflate(R.layout.progress_bar_round_buffer, (ViewGroup) null);
        ViewGroup viewGroup = (ViewGroup) layoutInflater.inflate(R.layout.layout_share_exo_player, (ViewGroup) null);
        this.f33544i0 = viewGroup;
        FrameLayout frameLayout = (FrameLayout) viewGroup.findViewById(R.id.share_telegram);
        FrameLayout frameLayout2 = (FrameLayout) this.f33544i0.findViewById(R.id.share_x);
        SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
        this.f33548m0 = swipeRefreshLayout;
        swipeRefreshLayout.setColorSchemeResources(i7.l.s(this, true));
        this.f33548m0.setProgressBackgroundColorSchemeResource(i7.l.s(this, false));
        this.f33548m0.setOnRefreshListener(this);
        this.f33542g0 = (FrameLayout) findViewById(R.id.btn_favorite);
        this.f33543h0 = (ImageView) findViewById(R.id.iconFavorite);
        this.f33545j0 = (ImageButton) findViewById(R.id.exo_fullscreen);
        d1(false);
        Bundle bundle3 = this.A;
        if (bundle3 != null) {
            String string = bundle3.getString(q2.h.D0, "");
            TextView textView = (TextView) findViewById(R.id.playerVideoTitle);
            if (textView != null) {
                textView.setText(dk.f.a().b(string, "").n0());
            }
        }
        ImageView imageView = new ImageView(this);
        this.f33547l0 = imageView;
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        Object obj = h0.a.f23629a;
        this.f33547l0.setImageDrawable(new ColorDrawable(a.c.a(this, 17170444)));
        if (overlayFrameLayout != null) {
            overlayFrameLayout.addView(this.f33547l0);
            overlayFrameLayout.addView(this.f33546k0);
            overlayFrameLayout.addView(this.f33544i0);
            if (frameLayout2.getVisibility() == 0 && !i7.l.v(this, b7.a.TWITTER.f3706a) && i7.l.v(this, b7.a.TELEGRAM.f3706a)) {
                frameLayout2.setVisibility(8);
                frameLayout.setVisibility(0);
            }
        }
        V0();
        X0();
        B0(i7.u.l(), x6.a.u0(i7.u.l()));
    }

    @Override
    public final void onDestroy() {
        O0();
        i7.t.W(this, this.f33538b1);
        super.onDestroy();
    }

    @Override
    public final void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        a1();
        M0();
        setIntent(intent);
    }

    @Override
    public final void onPause() {
        super.onPause();
        c1();
        WebView webView = this.d0;
        if (webView != null) {
            webView.onPause();
        }
    }

    @Override
    public final void onResume() {
        super.onResume();
        i7.t.l(this, this.f33538b1);
        if (this.f33535a0 == null) {
            U0();
            PlayerView playerView = this.Z;
            if (playerView != null) {
                View view = playerView.f2528d;
                if (view instanceof GLSurfaceView) {
                    ((GLSurfaceView) view).onResume();
                }
            }
        }
        WebView webView = this.d0;
        if (webView != null) {
            webView.onResume();
            this.d0.setDownloadListener(this.f33540c1);
        }
    }

    @Override
    public final void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        c0 c0Var = this.f33535a0;
        if (c0Var != null) {
            this.f33537b0 = c0Var.Q();
        }
        i1();
        bundle.putInt("start_item_index", this.f33549n0);
        bundle.putLong("start_position", this.f33550o0);
        bundle.putBundle("track_selector_parameters", this.f33537b0.b());
    }

    @Override
    public final void onStart() {
        super.onStart();
        U0();
        PlayerView playerView = this.Z;
        if (playerView != null) {
            View view = playerView.f2528d;
            if (view instanceof GLSurfaceView) {
                ((GLSurfaceView) view).onResume();
            }
        }
    }

    @Override
    public final void onStop() {
        super.onStop();
        PlayerView playerView = this.Z;
        if (playerView != null) {
            View view = playerView.f2528d;
            if (view instanceof GLSurfaceView) {
                ((GLSurfaceView) view).onPause();
            }
        }
        c1();
        a1();
        WebView webView = this.d0;
        if (webView != null) {
            webView.setDownloadListener(null);
        }
    }

    @Override
    public final void onWindowFocusChanged(boolean z10) {
        super.onWindowFocusChanged(z10);
        if (z10 && this.D) {
            T0();
        }
    }
}