导航菜单

页面标题

页面副标题

Chaupal v3.2 - a1.java 源代码

正在查看: Chaupal v3.2 应用的 a1.java JAVA 源代码文件

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


package com.yupptv.ott.fragments;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatButton;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.deeplink.DeepLink;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdLoader;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.LoadAdError;
import com.google.android.gms.ads.VideoOptions;
import com.google.android.gms.ads.formats.UnifiedNativeAd;
import com.google.android.gms.ads.nativead.NativeAd;
import com.google.android.gms.ads.nativead.NativeAdOptions;
import com.yupptv.ott.MainActivity;
import com.yupptv.ott.OTTApplication;
import com.yupptv.ott.activity.LoadScreenActivity;
import com.yupptv.ott.controllers.GridController;
import com.yupptv.ott.controllers.RowController;
import com.yupptv.ott.enums.ButtonType;
import com.yupptv.ott.enums.DialogType;
import com.yupptv.ott.enums.PageType;
import com.yupptv.ott.enums.PosterType;
import com.yupptv.ott.enums.ScreenType;
import com.yupptv.ott.widget.HeaderItemWithControls;
import com.yupptv.ottsdk.OttSDK;
import com.yupptv.ottsdk.managers.MediaCatalog.MediaCatalogManager;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.model.Banner;
import com.yupptv.ottsdk.model.Card;
import com.yupptv.ottsdk.model.Content;
import com.yupptv.ottsdk.model.ContentPage;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.Filter;
import com.yupptv.ottsdk.model.Menu;
import com.yupptv.ottsdk.model.PageData;
import com.yupptv.ottsdk.model.Section;
import com.yupptv.ottsdk.model.User;
import com.yupptv.ottsdk.model.ads.AdUrlResponse;
import com.yupptv.ottsdk.model.ads.AdUrlType;
import com.yupptv.ottsdk.model.user.Configs;
import hd.a;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import org.json.JSONException;
import org.json.JSONObject;

public class a1 extends p1 implements oc.a, oc.j {
    private static final Integer F1 = 10;
    private List<PageData> B0;
    private List<Banner> C0;
    private List<Filter> D0;
    private Card E0;
    private int Q0;
    private PageType V0;
    private AdUrlResponse c1;
    public boolean d1;
    private long e1;
    hd.z f0;
    hd.a0 f1;
    boolean h0;
    boolean i0;
    private RowController j0;
    private AdLoader j1;
    private GridController k0;
    private OttSDK l0;
    private Context n0;
    String[] q1;
    private ContentPage s0;
    private oc.l t0;
    private Bundle x0;
    private String Z = getClass().getSimpleName();
    private final RecyclerView.u e0 = new RecyclerView.u();
    boolean g0 = false;
    private int m0 = 5;
    private List<ld.a> o0 = new ArrayList();
    public String p0 = "home";
    private String q0 = "";
    private boolean r0 = false;
    private int u0 = -1;
    private String v0 = "Home";
    public boolean w0 = false;
    private int y0 = 6;
    private int z0 = 0;
    private int A0 = 0;
    private List<Card> F0 = new ArrayList();
    private int G0 = -1;
    public boolean H0 = false;
    private String I0 = "home";
    private List<Section> J0 = new ArrayList();
    private List<Section> K0 = new ArrayList();
    final Handler L0 = new Handler();
    private String M0 = "";
    List<Card> N0 = new ArrayList();
    private boolean O0 = false;
    private boolean P0 = false;
    private boolean R0 = true;
    private String S0 = "";
    private String T0 = "";
    private int U0 = -1;
    private String W0 = "not_agree";
    private String X0 = "";
    List<Menu> Y0 = new ArrayList();
    List<String> Z0 = new ArrayList();
    private boolean a1 = false;
    private boolean b1 = false;
    private String g1 = "";
    private String h1 = "";
    private String i1 = "";
    private List<UnifiedNativeAd> k1 = new ArrayList();
    private List<NativeAd> l1 = new ArrayList();
    boolean m1 = false;
    String n1 = "";
    String o1 = "";
    boolean p1 = false;
    private String r1 = "";
    private String s1 = "";
    private int t1 = 0;
    private boolean u1 = true;
    boolean v1 = false;
    private boolean w1 = false;
    private final Runnable x1 = new j();
    Comparator<Section> y1 = new t();
    oc.i z1 = new c0();
    SwipeRefreshLayout.j A1 = new d0();
    private oc.h B1 = new g();
    oc.b C1 = new h();
    oc.b D1 = new i();
    public BroadcastReceiver E1 = new a0();

    class a extends hd.z {
        a(LinearLayoutManager linearLayoutManager) {
            super(linearLayoutManager);
        }

        @Override
        public void h(int i, RecyclerView recyclerView) {
            a1.this.F1(true);
        }
    }

    class a0 extends BroadcastReceiver {
        a0() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            a1.this.J1("onReceiver of broadcast");
            String u = hd.a0.y(a1.this.getActivity()).u("appsflyer_data");
            if (TextUtils.isEmpty(u) || hd.e.v || !a1.this.w1) {
                return;
            }
            a1.this.O1(u);
            hd.e.v = true;
            OTTApplication.C = "";
        }
    }

    class b extends hd.z {
        b(GridLayoutManager gridLayoutManager) {
            super(gridLayoutManager);
        }

        @Override
        public void h(int i, RecyclerView recyclerView) {
            if (a1.this.R0) {
                a1.this.R0 = false;
                a1.this.P1(true);
            } else {
                hd.z zVar = a1.this.f0;
                if (zVar != null) {
                    zVar.i(true);
                }
            }
        }
    }

    static class b0 {
        static final int[] a;

        static {
            int[] iArr = new int[PageType.values().length];
            a = iArr;
            try {
                iArr[PageType.Content.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[PageType.Details.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[PageType.List.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
        }
    }

    class c implements MediaCatalogManager.MediaCatalogCallback<List<Section.SectionData>> {
        final boolean a;

        c(boolean z) {
            this.a = z;
        }

        @Override
        public void onSuccess(List<Section.SectionData> list) {
            if (a1.this.getActivity() == null) {
                return;
            }
            a1.this.b0(false);
            if (list == null || list.size() < 1) {
                return;
            }
            a1.this.U0 = list.get(0).getLastIndex().intValue();
            a1.this.R0 = list.get(0).getHasMoreData().booleanValue();
            if (a1.this.F0 != null) {
                a1.this.F0.addAll(list.get(0).getCards());
            }
            if (a1.this.F0 == null || a1.this.F0.size() < 1) {
                a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.M0), Boolean.FALSE);
                a1 a1Var = a1.this;
                a1Var.m0(true, a1Var.getActivity().getResources().getString(2131952524), a1.this.x1(), null);
            } else {
                a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.M0), Boolean.valueOf(a1.this.R0));
                hd.z zVar = a1.this.f0;
                if (zVar != null) {
                    zVar.i(true);
                }
            }
        }

        @Override
        public void onFailure(Error error) {
            if (a1.this.getActivity() == null) {
                return;
            }
            a1.this.b0(false);
            if (this.a) {
                return;
            }
            a1 a1Var = a1.this;
            a1Var.m0(true, a1Var.getActivity().getResources().getString(2131952524), a1.this.x1(), null);
        }
    }

    class c0 implements oc.i {
        c0() {
        }

        @Override
        public void a() {
            a1.this.j0(true);
            a1.this.b0(true);
            a1 a1Var = a1.this;
            if (a1Var.H0) {
                a1Var.U1();
            } else {
                a1Var.F1(false);
            }
            ((MainActivity) a1.this.n0).Y1(true, "");
        }
    }

    class d implements OttSDK.OttSDKCallback<String> {
        final boolean a;

        d(boolean z) {
            this.a = z;
        }

        public void onSuccess(String str) {
            a1.this.l0 = hd.a.a.b(OTTApplication.o());
            if (a1.this.s0 == null || this.a) {
                a1.this.W1(this.a);
            } else {
                a1.this.Y1();
            }
            hd.u.x0(a1.this.getActivity());
        }

        public void onFailure(Error error) {
            hd.h.b(a1.this.Z, "initSDK failure" + error.getMessage());
        }

        public void onProgressChanged(double d) {
        }
    }

    class d0 implements SwipeRefreshLayout.j {
        d0() {
        }

        public void a() {
            a1.this.T1(true);
            a1.this.z0 = 0;
        }
    }

    class e implements MediaCatalogManager.MediaCatalogCallback<ContentPage> {

        class a implements View.OnClickListener {
            a() {
            }

            @Override
            public void onClick(View view) {
                hd.h.b("HomeFragment", "Select all");
                if (!a1.this.a1) {
                    a1.this.a1 = true;
                    a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.M0), Boolean.FALSE);
                } else {
                    a1.this.a1 = false;
                    a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.L0), Boolean.FALSE);
                    a1.this.Z0.clear();
                    a1.this.getActivity().d5(a1.this.Z0);
                }
            }
        }

        e() {
        }

        @Override
        public void onSuccess(com.yupptv.ottsdk.model.ContentPage r15) {
            throw new UnsupportedOperationException("Method not decompiled: com.yupptv.ott.fragments.a1.e.onSuccess(com.yupptv.ottsdk.model.ContentPage):void");
        }

        @Override
        public void onFailure(Error error) {
            if (a1.this.getActivity() == null) {
                return;
            }
            if (hd.e0.h0(a1.this.getContext())) {
                a1.this.k0(error, true, error.getMessage(), "", a1.this.z1);
            } else {
                a1.this.i0(error.getMessage(), a1.this.z1);
            }
            hd.h.b(a1.this.Z, "requestSectionMetaData failure" + error.getMessage());
        }
    }

    class e0 implements View.OnClickListener {
        e0() {
        }

        @Override
        public void onClick(View view) {
            a1.this.G0 = 0;
            a1.this.Z1();
        }
    }

    class f implements Runnable {

        class a implements MediaCatalogManager.MediaCatalogCallback<Section.SectionData> {
            a() {
            }

            @Override
            public void onSuccess(Section.SectionData sectionData) {
                Card card = (Card) sectionData.getCards().get(0);
                a1.this.t0.z(false);
                MainActivity activity = a1.this.getActivity();
                Objects.requireNonNull(activity);
                activity.Y1(false, "");
                hd.u.y0(a1.this.getContext(), "player", card);
            }

            @Override
            public void onFailure(Error error) {
            }
        }

        f() {
        }

        @Override
        public void run() {
            User loggedUser;
            if (OTTApplication.A.isEmpty()) {
                return;
            }
            hd.h.b("Shared path ", "homefrag" + OTTApplication.A);
            if (OTTApplication.A.equalsIgnoreCase("watchoonelink")) {
                OTTApplication.A = "";
                OTTApplication.D = "";
                return;
            }
            if (OTTApplication.A.equalsIgnoreCase("isFromBranchIO")) {
                OTTApplication.A = "";
                OTTApplication.D = "";
                return;
            }
            a.C0133a c0133a = hd.a.a;
            String lmsApiUrl = c0133a.c(OTTApplication.o()).getLmsApiUrl();
            String str = OTTApplication.A;
            if (str == null || !str.startsWith("http") || lmsApiUrl == null || !OTTApplication.A.contains(lmsApiUrl) || c0133a.g(OTTApplication.o()) == null || (loggedUser = c0133a.g(OTTApplication.o()).getLoggedUser()) == null) {
                if (OTTApplication.A.contains(".html")) {
                    hd.u.t0(a1.this.getActivity(), OTTApplication.A);
                } else if (OTTApplication.A.startsWith("http")) {
                    hd.u.f0(a1.this.getActivity(), hd.r.F1, OTTApplication.A, OTTApplication.D);
                } else {
                    String str2 = OTTApplication.G;
                    if (str2 != null && a1.this.C1(str2) != null && !a1.this.C1(OTTApplication.G).isEmpty()) {
                        a1 a1Var = a1.this;
                        a1Var.E1(a1Var.C1(OTTApplication.G));
                        OTTApplication.A = "";
                        OTTApplication.D = "";
                        OTTApplication.G = "";
                        return;
                    }
                    String str3 = OTTApplication.A;
                    if (str3 == null || !str3.contains("shorts/")) {
                        hd.u.t0(a1.this.getActivity(), OTTApplication.A.startsWith("/") ? OTTApplication.A.substring(1) : OTTApplication.A);
                    } else {
                        c0133a.f(OTTApplication.o()).getShortsCardData(OTTApplication.A, new a());
                    }
                }
            } else if (loggedUser.getPackages() != null && loggedUser.getPackages().size() == 0) {
                hd.u.S(a1.this.getActivity(), ScreenType.PAYMENTS, hd.r.F1);
            } else if (loggedUser.getAttributes() == null || loggedUser.getAttributes().getLms_user_name() == null || loggedUser.getAttributes().getLms_user_name().trim().length() <= 0) {
                HashMap hashMap = new HashMap();
                hashMap.put("msg2", "");
                hashMap.put("msg1", "Something went wrong, Please send email to our support team");
                hd.u.J0(a1.this.getActivity(), DialogType.ERROR_MESSAGE_DIALOG, hashMap, null);
            } else {
                hd.u.f0(a1.this.getActivity(), hd.r.w1, OTTApplication.A, OTTApplication.D);
            }
            OTTApplication.A = "";
            OTTApplication.D = "";
        }
    }

    class f0 implements View.OnClickListener {
        f0() {
        }

        @Override
        public void onClick(View view) {
            a1.this.G0 = 1;
            a1.this.Z1();
        }
    }

    class g implements oc.h {

        class a implements UserManager.UserCallback<String> {
            final String a;

            a(String str) {
                this.a = str;
            }

            @Override
            public void onSuccess(String str) {
                hd.h.a("DEBUG", "pin success : " + str);
                a1 a1Var = a1.this;
                a1Var.d1 = true;
                a1Var.F1(false);
                a1.this.f1.z(System.currentTimeMillis());
            }

            @Override
            public void onFailure(Error error) {
                HashMap hashMap = new HashMap();
                hashMap.put("msg1", a1.this.getResources().getString(2131952647));
                hashMap.put("msg2", a1.this.getResources().getString(2131952646));
                if (error != null) {
                    hashMap.put("errorMsg", error.getMessage());
                }
                hashMap.put("PIN", this.a);
                hd.u.J0(a1.this.getActivity(), DialogType.AFTER_DARK_PASSCODE_DIALOG, hashMap, a1.this.B1);
            }
        }

        g() {
        }

        @Override
        public void o(boolean z, int i, HashMap hashMap) {
            if (z) {
                if (i == 1) {
                    hd.u.Q(a1.this.getActivity(), ScreenType.FORGOT_PIN, hd.r.i1, "", 32, false, false);
                    return;
                } else {
                    String format = String.format("%04d", Integer.valueOf(i));
                    hd.a.a.b(OTTApplication.o()).getUserManager().validateUserProfilePin(Long.valueOf(a1.this.e1), format, new a(format));
                    return;
                }
            }
            a1.this.b0(false);
            if (a1.this.getActivity() == null || !(a1.this.getActivity() instanceof MainActivity)) {
                return;
            }
            a1.this.getActivity().J2();
        }

        @Override
        public void y(boolean z, int i, int i2) {
        }
    }

    class g0 implements View.OnClickListener {
        g0() {
        }

        @Override
        public void onClick(View view) {
            a1.this.G0 = 2;
            a1.this.Z1();
        }
    }

    class h implements oc.b {
        h() {
        }

        @Override
        public void a(RelativeLayout relativeLayout) {
            HashMap hashMap = new HashMap();
            hashMap.put("msg1", String.format(a1.this.getActivity().getResources().getString(2131952643), Integer.valueOf(hd.d.d)));
            hashMap.put("isShowForgot", Boolean.FALSE);
            a1.this.v1(hashMap, relativeLayout);
        }

        @Override
        public void onCanceled() {
            if (a1.this.getActivity() == null || !(a1.this.getActivity() instanceof MainActivity)) {
                return;
            }
            a1.this.getActivity().J2();
        }
    }

    class h0 implements Runnable {
        h0() {
        }

        @Override
        public void run() {
            if (!a1.this.isAdded() || a1.this.requireActivity() == null) {
                return;
            }
            a1.this.requireActivity().e5();
        }
    }

    class i implements oc.b {
        i() {
        }

        @Override
        public void a(RelativeLayout relativeLayout) {
            a1 a1Var = a1.this;
            a1Var.d1 = true;
            a1Var.F1(false);
        }

        @Override
        public void onCanceled() {
        }
    }

    class j implements Runnable {
        j() {
        }

        @Override
        public void run() {
            a1.this.R1(true);
        }
    }

    class k implements oc.h {
        final RelativeLayout a;

        class a implements UserManager.UserCallback<String> {

            class C0055a implements UserManager.UserCallback<User> {
                C0055a() {
                }

                @Override
                public void onSuccess(User user) {
                }

                @Override
                public void onFailure(Error error) {
                }
            }

            a() {
            }

            @Override
            public void onSuccess(String str) {
                a1.this.b0(false);
                a1.this.f1.z(System.currentTimeMillis());
                if (a1.this.l0 != null) {
                    a1.this.l0.getUserManager().getUserInfo(new C0055a());
                }
                a1 a1Var = a1.this;
                a1Var.O(true, a1Var.getResources().getString(2131951677), "", a1.this.D1);
            }

            @Override
            public void onFailure(Error error) {
                a1.this.b0(false);
                RelativeLayout relativeLayout = k.this.a;
                if (relativeLayout != null) {
                    relativeLayout.setVisibility(0);
                }
                if (TextUtils.isEmpty(error.getMessage().trim())) {
                    return;
                }
                Toast.makeText((Context) a1.this.getActivity(), (CharSequence) error.getMessage(), 1).show();
            }
        }

        k(RelativeLayout relativeLayout) {
            this.a = relativeLayout;
        }

        @Override
        public void o(boolean z, int i, HashMap hashMap) {
            if (z) {
                String format = String.format("%04d", Integer.valueOf(i));
                JSONObject jSONObject = new JSONObject();
                try {
                    jSONObject.put("profileId", a1.this.e1);
                    jSONObject.put("pin", format);
                    jSONObject.put("isProfileLockActive", false);
                    jSONObject.put("addProfilePinEnable", false);
                    jSONObject.put("isParentalControlEnable", true);
                    a1.this.b0(true);
                    RelativeLayout relativeLayout = this.a;
                    if (relativeLayout != null) {
                        relativeLayout.setVisibility(8);
                    }
                    hd.a.a.b(OTTApplication.o()).getUserManager().createUserProfileLock(jSONObject, new a());
                } catch (Exception unused) {
                }
            }
        }

        @Override
        public void y(boolean z, int i, int i2) {
        }
    }

    class l implements MediaCatalogManager.MediaCatalogCallback<List<Section.SectionData>> {
        l() {
        }

        @Override
        public void onSuccess(List<Section.SectionData> list) {
            a1.this.u1 = true;
            a1.this.w1(null, list);
        }

        @Override
        public void onFailure(Error error) {
            a1.this.u1 = true;
            a1.this.b0(false);
            hd.h.b(a1.this.Z, "on failure");
        }
    }

    class m implements MediaCatalogManager.MediaCatalogCallback<List<PageData>> {
        m() {
        }

        @Override
        public void onSuccess(List<PageData> list) {
            a1.this.u1 = true;
            if (list == null || list.size() < 1) {
                return;
            }
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            for (int i = 0; i < list.size(); i++) {
                arrayList2.add(list.get(i).getSection().getSectionData());
                arrayList.add(list.get(i).getSection().getSectionInfo());
            }
            a1.this.w1(arrayList, arrayList2);
        }

        @Override
        public void onFailure(Error error) {
            a1.this.u1 = true;
            a1.this.b0(false);
            hd.h.b(a1.this.Z, "on failure");
        }
    }

    class n implements Runnable {
        n() {
        }

        @Override
        public void run() {
            cc.b.B0().f2(a1.this.v0);
        }
    }

    class o implements Runnable {
        o() {
        }

        @Override
        public void run() {
            a1.this.j0.setData(a1.this.o0, Boolean.FALSE);
            a1.this.a2();
        }
    }

    class p implements Runnable {
        p() {
        }

        @Override
        public void run() {
            String str = a1.this.p0;
            if (str == null || !str.contains("favourites")) {
                a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.M0), Boolean.FALSE);
            } else {
                a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.L0), Boolean.FALSE);
            }
            a1.this.a2();
            a1 a1Var = a1.this;
            a1Var.g0(a1Var.E0 = (Card) a1Var.F0.get(0));
        }
    }

    class q implements oc.h {
        final String a;
        final int c;
        final View d;
        final Card e;

        class a implements MediaCatalogManager.MediaCatalogCallback<String> {
            a() {
            }

            @Override
            public void onSuccess(String str) {
                a1.this.b0(false);
                if (!TextUtils.isEmpty(str.trim())) {
                    Toast.makeText((Context) a1.this.getActivity(), (CharSequence) str, 1).show();
                }
                q qVar = q.this;
                int i = qVar.c;
                if (i == 1) {
                    ((TextView) qVar.d).setText(hd.e0.T(41));
                    if (OTTApplication.w().B() != null) {
                        OTTApplication.w().B().put(q.this.e.getTarget().getPath(), 1);
                    }
                } else if (i == 0) {
                    ((TextView) qVar.d).setText(hd.e0.T(40));
                    if (OTTApplication.w().B() != null) {
                        OTTApplication.w().B().put(q.this.e.getTarget().getPath(), 0);
                    }
                }
                a1.this.getActivity().c4();
            }

            @Override
            public void onFailure(Error error) {
                a1.this.b0(false);
                if (TextUtils.isEmpty(error.getMessage().trim())) {
                    return;
                }
                Toast.makeText((Context) a1.this.getActivity(), (CharSequence) error.getMessage(), 1).show();
            }
        }

        q(String str, int i, View view, Card card) {
            this.a = str;
            this.c = i;
            this.d = view;
            this.e = card;
        }

        @Override
        public void o(boolean z, int i, HashMap hashMap) {
            if (i == 0) {
                return;
            }
            a1.this.b0(true);
            hd.a.a.f(OTTApplication.o()).updateRecording(this.a, new a());
        }

        @Override
        public void y(boolean z, int i, int i2) {
        }
    }

    class r implements oc.d {
        final Object a;

        class a implements UserManager.UserCallback<String> {
            final Card a;

            a(Card card) {
                this.a = card;
            }

            @Override
            public void onSuccess(String str) {
                if (a1.this.getActivity() == null) {
                    return;
                }
                if (a1.this.j0 != null) {
                    int size = a1.this.o0.size();
                    int i = 0;
                    while (true) {
                        if (i >= size) {
                            break;
                        }
                        ArrayList arrayList = (a1.this.o0.get(i) == null || ((ld.a) a1.this.o0.get(i)).g() == null) ? new ArrayList() : new ArrayList(((ld.a) a1.this.o0.get(i)).g());
                        hd.h.a("HomeFragment>>", "Before>>" + ((ld.a) a1.this.o0.get(i)).g() + " at " + i);
                        if (arrayList.contains(this.a)) {
                            arrayList.remove(this.a);
                            ld.a aVar = new ld.a("section", ((ld.a) a1.this.o0.get(i)).a(), arrayList);
                            if (aVar.g() == null || aVar.g().size() != 0) {
                                a1.this.o0.set(i, aVar);
                            } else {
                                a1.this.o0.remove(i);
                                if (arrayList.size() == 0) {
                                    Fragment j0 = a1.this.getActivity().getSupportFragmentManager().j0(2131427847);
                                    if (j0 instanceof a1) {
                                        ((a1) j0).T1(true);
                                    }
                                }
                            }
                        } else {
                            i++;
                        }
                    }
                    a1.this.j0.setData(a1.this.o0, Boolean.TRUE);
                }
                if (TextUtils.isEmpty(str.trim())) {
                    return;
                }
                Toast.makeText((Context) a1.this.getActivity(), (CharSequence) str, 1).show();
            }

            @Override
            public void onFailure(Error error) {
                if (a1.this.getActivity() == null || TextUtils.isEmpty(error.getMessage().trim())) {
                    return;
                }
                Toast.makeText((Context) a1.this.getActivity(), (CharSequence) error.getMessage(), 1).show();
            }
        }

        r(Object obj) {
            this.a = obj;
        }

        @Override
        public void a(AppCompatButton appCompatButton, Object obj, ButtonType buttonType) {
            Object obj2 = this.a;
            if (obj2 == null || !(obj2 instanceof Card)) {
                return;
            }
            Card card = (Card) obj2;
            hd.a.a.b(OTTApplication.o()).getUserManager().removeUserFavourite(card.getTarget().getPath(), new a(card));
        }

        @Override
        public void onDismiss() {
        }
    }

    class s implements oc.h {
        final Object a;

        class a implements MediaCatalogManager.MediaCatalogCallback<String> {
            final Card a;

            a(Card card) {
                this.a = card;
            }

            @Override
            public void onSuccess(String str) {
                if (a1.this.j0 != null) {
                    int size = a1.this.o0.size();
                    int i = 0;
                    while (true) {
                        if (i >= size) {
                            break;
                        }
                        ArrayList arrayList = (a1.this.o0.get(i) == null || ((ld.a) a1.this.o0.get(i)).g() == null) ? new ArrayList() : new ArrayList(((ld.a) a1.this.o0.get(i)).g());
                        hd.h.a("HomeFragment>>", "Before>>" + ((ld.a) a1.this.o0.get(i)).g() + " at " + i);
                        if (arrayList.contains(this.a)) {
                            arrayList.remove(this.a);
                            ld.a aVar = new ld.a("section", ((ld.a) a1.this.o0.get(i)).a(), arrayList);
                            if (aVar.g() == null || aVar.g().size() != 0) {
                                a1.this.o0.set(i, aVar);
                            } else {
                                a1.this.o0.remove(i);
                                if (arrayList.size() == 0) {
                                    a1.this.M1();
                                }
                            }
                        } else {
                            i++;
                        }
                    }
                    a1.this.j0.setData(a1.this.o0, Boolean.TRUE);
                }
                Log.v("HomeFragment>>", "listRows::" + a1.this.o0.size());
                if (TextUtils.isEmpty(str.trim())) {
                    return;
                }
                Toast.makeText(a1.this.n0, str, 0).show();
            }

            @Override
            public void onFailure(Error error) {
                if (TextUtils.isEmpty(error.getMessage().trim())) {
                    return;
                }
                Toast.makeText(a1.this.n0, error.getMessage(), 0).show();
            }
        }

        s(Object obj) {
            this.a = obj;
        }

        @Override
        public void o(boolean z, int i, HashMap hashMap) {
            Object obj = this.a;
            if (obj == null || !(obj instanceof Card)) {
                return;
            }
            Card card = (Card) obj;
            JSONObject jSONObject = new JSONObject();
            try {
                jSONObject.put("viewType", "continue_watching");
                jSONObject.put("pagePath", card.getTarget().getPath());
                hd.a.a.f(OTTApplication.o()).deleteContentFromContinueWatch(jSONObject, new a(card));
            } catch (JSONException e) {
                throw new RuntimeException(e);
            }
        }

        @Override
        public void y(boolean z, int i, int i2) {
        }
    }

    class t implements Comparator<Section> {
        t() {
        }

        @Override
        public int compare(Section section, Section section2) {
            return section.getSectionData().getSection().compareTo(section2.getSectionData().getSection());
        }
    }

    class u implements OttSDK.OttSDKCallback<String> {
        u() {
        }

        public void onSuccess(String str) {
            a1.this.l0 = hd.a.a.b(OTTApplication.o());
            a1.this.U1();
            hd.u.x0(a1.this.getActivity());
        }

        public void onFailure(Error error) {
            hd.h.b(a1.this.Z, "initSDK failure" + error.getMessage());
        }

        public void onProgressChanged(double d) {
        }
    }

    class v implements MediaCatalogManager.MediaCatalogCallback<List<Section.SectionData>> {
        v() {
        }

        @Override
        public void onSuccess(List<Section.SectionData> list) {
            a1.this.y.setAdapter((RecyclerView.Adapter) null);
            a1.this.J.setVisibility(0);
            a1.this.e0.b();
            a1.this.k0 = new GridController(a1.this);
            a1.this.k0.setFilterDuplicates(false);
            a1.this.F0.clear();
            a1.this.b0(false);
            if (list == null || list.size() < 1 || list.get(0).getCards().size() < 1) {
                a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.M0), Boolean.FALSE);
                a1 a1Var = a1.this;
                a1Var.m0(true, a1Var.getString(2131952514), "", a1.this.z1);
                return;
            }
            if (list.size() > 0) {
                a1.this.F0 = list.get(0).getCards();
            }
            a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.M0), Boolean.TRUE);
            a1.this.a2();
            if (a1.this.F0 != null && a1.this.F0.size() + 1 == a1.this.k0.getAdapter().E().size()) {
                a1.this.k0.setData(a1.this.F0, Integer.valueOf(hd.r.M0), Boolean.FALSE);
            }
            if (a1.this.F0.size() > 0) {
                a1 a1Var2 = a1.this;
                a1Var2.g0(a1Var2.E0 = (Card) a1Var2.F0.get(0));
            }
            a1 a1Var3 = a1.this;
            a1Var3.f0(a1Var3.k0);
        }

        @Override
        public void onFailure(Error error) {
            if (a1.this.getActivity() == null) {
                return;
            }
            a1.this.b0(false);
            a1.this.m0(true, error.getMessage(), "", a1.this.z1);
        }
    }

    class w implements Runnable {
        final int a;

        w(int i) {
            this.a = i;
        }

        @Override
        public void run() {
            a1.this.y.getLayoutManager().B1(this.a);
        }
    }

    class x implements Runnable {
        final int a;

        x(int i) {
            this.a = i;
        }

        @Override
        public void run() {
            a1.this.y.getLayoutManager().B1(this.a);
        }
    }

    class y implements NativeAd.OnNativeAdLoadedListener {
        final int a;
        final String b;
        final String[] c;
        final int d;

        y(int i, String str, String[] strArr, int i2) {
            this.a = i;
            this.b = str;
            this.c = strArr;
            this.d = i2;
        }

        public void onNativeAdLoaded(@NonNull NativeAd nativeAd) {
            if (a1.this.l1 != null) {
                a1.this.l1.clear();
            }
            for (int i = 1; i <= this.a + 1; i++) {
                a1.this.l1.add(nativeAd);
            }
            String str = this.b;
            if (str == null || str.equalsIgnoreCase("")) {
                return;
            }
            if (this.b.equalsIgnoreCase("adSlot")) {
                a1.this.H1(this.c);
            } else {
                a1.this.G1(this.d);
            }
        }
    }

    class z extends AdListener {
        z() {
        }

        public void onAdFailedToLoad(LoadAdError loadAdError) {
            hd.h.a("DFP ADS", "error" + String.format(Locale.getDefault(), "domain: %s, code: %d, message: %s", loadAdError.getDomain(), Integer.valueOf(loadAdError.getCode()), loadAdError.getMessage()).toString());
        }
    }

    private String A1() {
        String str;
        User loggedUser = hd.a.a.g(OTTApplication.o()).getLoggedUser();
        String appsFlyerUID = AppsFlyerLib.getInstance().getAppsFlyerUID(this.n0);
        if (loggedUser != null) {
            String phoneNumber = loggedUser.getPhoneNumber();
            if (phoneNumber == null) {
                phoneNumber = "";
            } else if (phoneNumber.trim().length() > 10) {
                phoneNumber = phoneNumber.substring(phoneNumber.length() - 10);
            }
            str = "authToken=" + loggedUser.getAuthToken() + "&mobileNumber=" + phoneNumber + "&customerUserId=" + loggedUser.getExternalUserId() + "&appsflyerId=" + appsFlyerUID + "&advertisingId=" + hd.a0.y(getActivity()).u("pref_key_advertising_id");
        } else {
            str = "appsflyerId=" + appsFlyerUID + "&advertisingId=" + hd.a0.y(getActivity()).u("pref_key_advertising_id");
        }
        hd.h.b("HomeFragment", "landing page params : " + str);
        return str;
    }

    @NonNull
    public hd.z B1(boolean z2) {
        return !z2 ? new a(this.A) : new b(this.A);
    }

    private ScreenType D1() {
        return (getActivity() == null || !(getActivity() instanceof MainActivity)) ? ScreenType.NONE : getActivity().B2();
    }

    public void F1(boolean z2) {
        if (OttSDK.sInstance == null) {
            OttSDK.init(this.n0, hd.e.z, hd.e0.b0(requireContext()), String.valueOf(204), " ", new d(z2));
            OttSDK.setLogEnabled(true);
            return;
        }
        this.l0 = hd.a.a.b(OTTApplication.o());
        if (this.s0 == null || z2) {
            W1(z2);
        } else {
            Y1();
        }
    }

    private boolean I1() {
        int j2;
        if (getActivity() != null && (j2 = getActivity().j2()) > -1 && getActivity().U2()) {
            a.C0133a c0133a = hd.a.a;
            List<Menu> menuList = c0133a.d(OTTApplication.o()).getMenuList();
            this.Y0 = menuList;
            if (menuList != null && menuList.size() > 0 && j2 < this.Y0.size() && c0133a.g(OTTApplication.o()).getLoggedUser() == null) {
                if (this.Y0.get(j2).getCode().equalsIgnoreCase("favourites") || this.Y0.get(j2).getCode().equalsIgnoreCase("favorites") || this.Y0.get(j2).getCode().equalsIgnoreCase("my-aha_mobile")) {
                    l0(true, getActivity().getResources().getString(2131952226), "", 50, true, this.z1);
                    return false;
                }
                if (!this.Y0.get(j2).getCode().equalsIgnoreCase("my_library") && !this.Y0.get(j2).getCode().equalsIgnoreCase("mylibrary")) {
                    return true;
                }
                l0(true, getActivity().getResources().getString(2131952484), "", 50, false, this.z1);
                return false;
            }
        }
        return true;
    }

    private void L1(String str, int i2, int i3, String[] strArr, String str2) {
        if (getActivity() != null) {
            AdLoader.Builder builder = new AdLoader.Builder(getActivity(), str);
            List<NativeAd> list = this.l1;
            if (list != null) {
                list.clear();
            }
            if (this.j1 != null) {
                this.j1 = null;
            }
            builder.forNativeAd(new y(i3, str2, strArr, i2));
            builder.withNativeAdOptions(new NativeAdOptions.Builder().setVideoOptions(new VideoOptions.Builder().build()).build());
            builder.withAdListener(new z()).build().loadAds(new AdRequest.Builder().build(), 1);
        }
    }

    private void N1(String str) {
        if (str == null || str.trim().length() <= 0) {
            return;
        }
        String A1 = A1();
        hd.u.f0(this.n0, hd.r.E1, "https://offers" + hd.g0.c(str) + ".watcho.com/?" + A1, "");
    }

    public void O1(String str) {
        DeepLink deepLink = (DeepLink) new com.google.gson.d().h(str, DeepLink.class);
        if (deepLink != null) {
            try {
                String str2 = new JSONObject(deepLink.toString()).getString("deep_link_value").toString();
                if (str2 == null || str2.trim().length() <= 0) {
                    return;
                }
                String A1 = A1();
                hd.u.f0(this.n0, hd.r.E1, "https://offers" + hd.g0.c(str2) + ".watcho.com/?" + A1, "");
            } catch (JSONException unused) {
            }
        }
    }

    public void P1(boolean z2) {
        if (z2) {
            hd.a.a.f(OTTApplication.o()).getPageSectionContent(this.S0, this.T0, this.U0, 10, null, null, new c(z2));
        }
    }

    private void Q1(boolean z2) {
        List<Section> list;
        String str = "";
        String str2 = "";
        int i2 = 0;
        while (true) {
            int size = this.J0.size();
            int i3 = this.y0;
            if (size < i3) {
                i3 = this.J0.size();
            }
            if (i2 >= i3) {
                break;
            }
            if (this.z0 < this.J0.size()) {
                str2 = str2.concat(this.J0.get(this.z0).getSectionInfo().getCode() + ",");
                if (this.J0.get(this.z0).getSectionInfo().getParams() != null && this.J0.get(this.z0).getSectionInfo().getParams().getHasDynamicName() != null) {
                    str = str.concat(this.J0.get(this.z0).getSectionInfo().getParams().getHasDynamicName() + ",");
                }
            }
            i2++;
            this.z0++;
        }
        Log.v("HomeFragment>>", "hasDynamicName::" + str);
        if (str.contains("true")) {
            this.v1 = true;
        } else {
            this.v1 = false;
        }
        if (!str2.isEmpty()) {
            V1(str2, z2);
            return;
        }
        if (this.j0 != null) {
            if (this.c1 != null) {
                getActivity().j5(this.c1, this.p0);
            }
            if (this.n1.equalsIgnoreCase("true") && (((list = this.J0) == null || list.size() == 0) && !this.p1)) {
                t1();
            }
            this.j0.setData(this.o0, Boolean.FALSE);
        }
    }

    public void R1(boolean z2) {
        String str = "";
        for (int i2 = 0; i2 < this.K0.size(); i2++) {
            str = str.concat(this.K0.get(i2).getSectionInfo().getCode() + ",");
        }
        if (str.isEmpty()) {
            RowController rowController = this.j0;
            if (rowController != null) {
                rowController.setData(this.o0, Boolean.FALSE);
                return;
            }
            return;
        }
        if (str.endsWith(",") && str.length() > 1) {
            str = str.substring(0, str.length() - 1);
        }
        V1(str, z2);
    }

    private void V1(String str, boolean z2) {
        if (z2) {
            this.u1 = false;
            if (this.v1) {
                hd.h.a("HomeFragment>>", "requestSectionData_hasDynamicNameNEW>>" + this.v1);
                hd.a.a.f(OTTApplication.o()).getPageSectionContent(this.p0, str, -1, 10, null, z1(), true, new m());
                return;
            }
            hd.h.a("HomeFragment>>", "requestSectionData_hasDynamicNameOLD>>" + this.v1);
            hd.a.a.f(OTTApplication.o()).getPageSectionContent(this.p0, str, -1, 10, null, z1(), new l());
        }
    }

    public void W1(boolean z2) {
        if (I1()) {
            if (z2) {
                if (this.u1) {
                    Q1(z2);
                    return;
                }
                return;
            }
            this.o0.clear();
            this.J0.clear();
            List<Section> list = this.K0;
            if (list != null) {
                list.clear();
            }
            this.z0 = 0;
            this.p1 = false;
            hd.h.b("Shared path ", "homefrag requestmeta " + this.p0);
            if (this.l0 != null) {
                ProgressBar progressBar = this.z;
                if (progressBar != null && progressBar.getVisibility() != 0) {
                    b0(true);
                }
                hd.a.a.f(OTTApplication.o()).getPageContent(this.p0, new e());
                new Handler().postDelayed(new f(), 500L);
            }
        }
    }

    public void X1() {
        int i2;
        Configs c2 = hd.a.a.c(getActivity());
        String showBanners = (c2 == null || c2.getShowBanners() == null) ? "true" : c2.getShowBanners();
        if (TextUtils.isEmpty(showBanners) || showBanners.equalsIgnoreCase("false") || TextUtils.isEmpty(showBanners) || !showBanners.equalsIgnoreCase("true")) {
            return;
        }
        if (this.C0.size() > 0) {
            if (isAdded()) {
                hd.h.b(this.Z, "Banner List :" + this.o0.toString());
                this.o0.add(0, new ld.a(new HeaderItemWithControls("", null, -1L, "banner", hd.r.Q1, PosterType.BANNER.getValue(), null, "", this.r1, this.s1, ""), this.C0));
                this.j0.setData(this.o0, Boolean.valueOf(this.J0.size() > 0));
                return;
            }
            return;
        }
        if (this.y == null || !com.yupptv.ott.a.S) {
            return;
        }
        Object obj = this.n0;
        int dimension = (obj != null && (obj instanceof MainActivity) && ((MainActivity) obj).U2()) ? (int) this.n0.getResources().getDimension(2131166796) : 0;
        if (!this.w0) {
            Object obj2 = this.n0;
            if (((MainActivity) obj2) != null && ((MainActivity) obj2).q0 != null && ((MainActivity) obj2).q0.getVisibility() == 0) {
                i2 = (int) getActivity().getResources().getDimension(2131166782);
                this.y.setPadding(0, i2, 0, dimension);
            }
        }
        i2 = 0;
        this.y.setPadding(0, i2, 0, dimension);
    }

    public void Y1() {
        ContentPage contentPage;
        List<Menu> list;
        boolean z2;
        List<Menu> list2;
        if (I1() && (contentPage = this.s0) != null) {
            this.B0 = contentPage.getPageData();
            this.C0 = this.s0.getBanners();
            this.D0 = this.s0.getFilters();
            AdUrlResponse adUrlResponse = this.s0.getAdUrlResponse();
            this.c1 = adUrlResponse;
            if (adUrlResponse != null) {
                getActivity().j5(this.c1, this.p0);
            }
            c2();
            PageType type = PageType.getType(this.s0.getPageInfo().getPageType());
            this.V0 = type;
            int i2 = b0.a[type.ordinal()];
            if (i2 != 1 && i2 != 2) {
                if (i2 != 3) {
                    return;
                }
                if (this.s0.getError() != null) {
                    List<Menu> list3 = this.Y0;
                    if (list3 != null && this.u0 < list3.size() && this.Y0.get(this.u0).getCode().equalsIgnoreCase(hd.e.b)) {
                        c0(true, this.s0.getError().getMessage(), this.s0.getError().getDetails().getDescription(), null);
                        return;
                    }
                    List<Menu> list4 = this.Y0;
                    if (list4 == null || this.u0 >= list4.size() || !(this.Y0.get(this.u0).getCode().equalsIgnoreCase("favourites") || this.Y0.get(this.u0).getCode().equalsIgnoreCase("my-aha_mobile"))) {
                        U(true, this.s0.getError().getMessage(), this.s0.getError().getDetails().getDescription(), null, null);
                        return;
                    } else {
                        W(true, getActivity().getResources().getString(2131952097), x1(), null);
                        return;
                    }
                }
                this.y.setAdapter((RecyclerView.Adapter) null);
                List<Filter> list5 = this.D0;
                if (list5 != null && list5.size() > 0) {
                    this.J.setVisibility(0);
                }
                this.e0.b();
                GridController gridController = new GridController(this);
                this.k0 = gridController;
                gridController.setFilterDuplicates(false);
                List<Card> cards = this.B0.get(0).getSection().getSectionData().getCards();
                this.F0 = cards;
                if (cards == null || cards.size() < 1) {
                    if (this.u0 > -1 && (list2 = this.Y0) != null && list2.size() > 0 && this.Y0.get(this.u0).getCode().equalsIgnoreCase("my_library")) {
                        c0(true, getActivity().getResources().getString(2131952524), x1(), this.z1);
                        return;
                    }
                    List<Menu> list6 = this.Y0;
                    if (list6 == null || this.u0 >= list6.size() || !(this.Y0.get(this.u0).getCode().equalsIgnoreCase("favourites") || this.Y0.get(this.u0).getCode().equalsIgnoreCase("my-aha_mobile"))) {
                        U(true, getActivity().getResources().getString(2131952524), x1(), null, null);
                        return;
                    } else {
                        W(true, getActivity().getResources().getString(2131952097), x1(), null);
                        return;
                    }
                }
                this.k0.setData(this.F0, Integer.valueOf(hd.r.M0), Boolean.TRUE);
                a2();
                List<Card> list7 = this.F0;
                if (list7 != null && list7.size() + 1 == this.k0.getAdapter().E().size()) {
                    this.k0.setData(this.F0, Integer.valueOf(hd.r.M0), Boolean.FALSE);
                }
                if (this.F0.size() > 0) {
                    Card card = this.F0.get(0);
                    this.E0 = card;
                    g0(card);
                }
                hd.z B1 = B1(true);
                this.f0 = B1;
                B1.i(false);
                this.y.p(this.f0);
                f0(this.k0);
                return;
            }
            if (this.s0.getError() != null) {
                List<Menu> list8 = this.Y0;
                if (list8 != null && this.u0 < list8.size() && this.Y0.get(this.u0).getCode().equalsIgnoreCase(hd.e.b)) {
                    c0(true, this.s0.getError().getMessage(), this.s0.getError().getDetails().getDescription(), null);
                    return;
                } else if (this.s0.getPageInfo().getPath().equalsIgnoreCase("favorites")) {
                    U(true, getResources().getString(2131952516), getResources().getString(2131951865), null, null);
                    return;
                } else {
                    U(true, this.s0.getError().getMessage(), this.s0.getError().getDetails().getDescription(), null, null);
                    return;
                }
            }
            List<Menu> list9 = this.Y0;
            if (list9 != null && this.u0 < list9.size() && this.Y0.get(this.u0).getParams() != null && this.Y0.get(this.u0).getParams().getIsDarkMenu() != null && this.Y0.get(this.u0).getParams().getIsDarkMenu().equalsIgnoreCase("true") && this.p0.equalsIgnoreCase("after_dark") && this.Y0.get(this.u0).getParams().getIsLoginRequired() != null && this.Y0.get(this.u0).getParams().getIsLoginRequired().equalsIgnoreCase("true")) {
                a.C0133a c0133a = hd.a.a;
                String str = "";
                if (c0133a.g(OTTApplication.o()).getLoggedUser() != null || (getActivity() == null && getActivity().isFinishing())) {
                    if (!this.d1 && c0133a.g(OTTApplication.o()).getLoggedUser() != null && this.Y0.get(this.u0).getParams().getIsPinRequired() != null && this.Y0.get(this.u0).getParams().getIsPinRequired().equalsIgnoreCase("true")) {
                        User loggedUser = c0133a.g(OTTApplication.o()).getLoggedUser();
                        List<User.ProfileParentalDetails> profileParentalDetails = loggedUser.getProfileParentalDetails() != null ? loggedUser.getProfileParentalDetails() : null;
                        if (profileParentalDetails != null) {
                            z2 = false;
                            for (User.ProfileParentalDetails profileParentalDetails2 : profileParentalDetails) {
                                if (loggedUser.getProfileId().toString().equalsIgnoreCase(profileParentalDetails2.getProfileId().toString())) {
                                    z2 = profileParentalDetails2.getPinAvailable().booleanValue();
                                    this.e1 = profileParentalDetails2.getProfileId().intValue();
                                    str = profileParentalDetails2.getName();
                                }
                            }
                        } else {
                            z2 = false;
                        }
                        if (!z2) {
                            if (this.Y0.get(this.u0).getParams().getPinMessage() != null) {
                                d0(true, "Hi " + str, this.Y0.get(this.u0).getParams().getPinMessage(), this.C1);
                                return;
                            }
                            return;
                        }
                        long c2 = this.f1.c();
                        long currentTimeMillis = System.currentTimeMillis();
                        if (c2 == 0 || currentTimeMillis - c2 >= hd.e.q) {
                            HashMap hashMap = new HashMap();
                            hashMap.put("msg1", getResources().getString(2131952647));
                            hashMap.put("msg2", getResources().getString(2131952646));
                            hd.u.J0(getActivity(), DialogType.AFTER_DARK_PASSCODE_DIALOG, hashMap, this.B1);
                            return;
                        }
                        this.f1.z(currentTimeMillis);
                    }
                } else if (this.Y0.get(this.u0).getParams().getLoginMessage() != null) {
                    Y(true, "", this.Y0.get(this.u0).getParams().getLoginMessage(), null);
                    return;
                }
            }
            this.y.setAdapter((RecyclerView.Adapter) null);
            this.J.setVisibility(8);
            RowController rowController = new RowController(this, this.e0, hd.r.L0, getActivity().v, getActivity().w, this.u0);
            this.j0 = rowController;
            rowController.setFilterDuplicates(true);
            if (this.V0 == PageType.Details) {
                if (getActivity() != null && (getActivity() instanceof MainActivity)) {
                    getActivity().H5(0, false);
                }
            } else if (getActivity() != null && (getActivity() instanceof MainActivity)) {
                getActivity().H5(1, true);
            }
            X1();
            u1();
            hd.h.b(this.Z, "listrows size2 = " + this.o0.size());
            List<ld.a> list10 = this.o0;
            if (list10 == null || list10.size() < 1) {
                if (this.u0 <= -1 || (list = this.Y0) == null || list.size() <= 0 || !this.Y0.get(this.u0).getCode().equalsIgnoreCase(hd.e.b)) {
                    U(true, getActivity().getResources().getString(2131952524), x1(), null, null);
                    return;
                } else {
                    c0(true, getActivity().getResources().getString(2131952524), x1(), this.z1);
                    return;
                }
            }
            this.j0.setData(this.o0, Boolean.TRUE);
            a2();
            hd.h.b(this.Z, "copyofmodels size2 = " + this.j0.getAdapter().E().size());
            List<ld.a> list11 = this.o0;
            if (list11 != null && list11.size() + 1 == this.j0.getAdapter().E().size() && this.J0.size() < 1) {
                hd.h.b(this.Z, "copyofmodels size3 = " + this.j0.getAdapter().E().size());
                this.j0.setData(this.o0, Boolean.FALSE);
            }
            hd.z B12 = B1(false);
            this.f0 = B12;
            B12.i(false);
            this.y.p(this.f0);
            e0(this.j0);
        }
    }

    public void a2() {
        j0(true);
        b0(false);
        this.F.setRefreshing(false);
    }

    private void b2(java.lang.Object r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.yupptv.ott.fragments.a1.b2(java.lang.Object):void");
    }

    public void c2() {
        List<Filter> list = this.D0;
        if (list == null || list.size() < 0) {
            this.J.setVisibility(8);
            return;
        }
        int size = this.D0.size();
        if (size == 0) {
            this.J.setVisibility(8);
            return;
        }
        if (size == 1) {
            this.J.setVisibility(0);
            this.L.setVisibility(0);
            this.M.setVisibility(8);
            this.N.setVisibility(8);
            this.O.setText(this.D0.get(0).getTitle());
            this.P.setText(getString(2131951698) + " " + this.D0.get(0).getTitle());
            return;
        }
        if (size == 2) {
            this.J.setVisibility(0);
            this.L.setVisibility(0);
            this.M.setVisibility(0);
            this.N.setVisibility(8);
            this.O.setText(this.D0.get(0).getTitle());
            this.P.setText(getString(2131951698) + " " + this.D0.get(0).getTitle());
            this.Q.setText(this.D0.get(1).getTitle());
            this.R.setText(getString(2131951698) + " " + this.D0.get(1).getTitle());
            return;
        }
        if (size != 3) {
            this.J.setVisibility(0);
            this.L.setVisibility(0);
            this.M.setVisibility(0);
            this.N.setVisibility(0);
            this.O.setText(this.D0.get(0).getTitle());
            this.P.setText(getString(2131951698) + " " + this.D0.get(0).getTitle());
            this.Q.setText(this.D0.get(1).getTitle());
            this.R.setText(getString(2131951698) + " " + this.D0.get(1).getTitle());
            this.S.setText(this.D0.get(2).getTitle());
            this.T.setText(getString(2131951698) + " " + this.D0.get(2).getTitle());
            return;
        }
        this.J.setVisibility(0);
        this.L.setVisibility(0);
        this.M.setVisibility(0);
        this.N.setVisibility(0);
        this.O.setText(this.D0.get(0).getTitle());
        this.P.setText(getString(2131951698) + " " + this.D0.get(0).getTitle());
        this.Q.setText(this.D0.get(1).getTitle());
        this.R.setText(getString(2131951698) + " " + this.D0.get(1).getTitle());
        this.S.setText(this.D0.get(2).getTitle());
        this.T.setText(getString(2131951698) + " " + this.D0.get(2).getTitle());
    }

    private void d2(String str) {
        int i2 = this.G0;
        if (i2 == 0) {
            this.P.setText(str);
            return;
        }
        if (i2 == 1) {
            this.R.setText(str);
        } else {
            if (i2 == 2) {
                this.T.setText(str);
                return;
            }
            this.P.setText("");
            this.R.setText("");
            this.T.setText("");
        }
    }

    private void n0(Long l2) {
        Handler handler = this.L0;
        if (handler == null) {
            return;
        }
        handler.postDelayed(this.x1, l2.longValue());
    }

    private void t1() {
        if (this.o0.size() <= 0 || this.l1.size() <= 0) {
            return;
        }
        List<NativeAd> list = this.l1;
        ld.a aVar = new ld.a(1, list.get(list.size() - 1));
        aVar.p(this.o1);
        aVar.r(true);
        List<ld.a> list2 = this.o0;
        list2.add(list2.size(), aVar);
        this.p1 = true;
    }

    public void u1() {
        String str;
        PageType pageType;
        Long l2 = 0L;
        for (int i2 = 0; i2 < this.B0.size(); i2++) {
            str = "";
            if (this.B0.get(i2).getPaneType().equalsIgnoreCase("section")) {
                if (this.B0.get(i2).getSection().getSectionData().getCards().size() > 0) {
                    Section.SectionInfo sectionInfo = this.B0.get(i2).getSection().getSectionInfo();
                    Section.SectionData sectionData = this.B0.get(i2).getSection().getSectionData();
                    Section.SectionControls sectionControls = this.B0.get(i2).getSection().getSectionControls();
                    List subSectionInfo = this.B0.get(i2).getSection().getSubSectionInfo();
                    if (sectionInfo.getDataSubType().equalsIgnoreCase("live")) {
                        List<Banner> list = this.C0;
                        if (list == null || list.size() < 1) {
                            this.Q0 = i2;
                        } else {
                            this.Q0 = i2 + 1;
                        }
                    }
                    PageType pageType2 = this.V0;
                    if (pageType2 == null || pageType2 != PageType.Details || !sectionInfo.getDataType().equalsIgnoreCase("button")) {
                        String myRecoTrackingId = (sectionData == null || sectionData.getMyRecoTrackingId() == null) ? "" : sectionData.getMyRecoTrackingId();
                        if (sectionInfo.getParams() != null && sectionInfo.getParams().getMultiSectionRows() != null) {
                            this.s1 = sectionData.getParams().getMultiSectionRows();
                        }
                        ld.a aVar = new ld.a(this.B0.get(i2).getPaneType(), new HeaderItemWithControls(sectionInfo.getSectionPresentation() != null ? sectionInfo.getSectionPresentation() : "", subSectionInfo, i2, sectionInfo.getName(), this.p0, sectionInfo.getDataType(), sectionControls, sectionInfo.getIconUrl(), myRecoTrackingId, (sectionData == null || sectionData.getParams() == null || sectionData.getParams().getMultiSectionRows() == null) ? "" : sectionData.getParams().getMultiSectionRows(), this.B0.get(i2).getSection().getSectionInfo().getBannerImage()), this.B0.get(i2).getSection().getSectionData().getCards());
                        hd.h.b("HomeFragment", "CreateListrows : " + sectionInfo.getName());
                        List<ld.a> list2 = this.o0;
                        if (list2 != null) {
                            PageType pageType3 = this.V0;
                            if (pageType3 == null || pageType3 != PageType.Details) {
                                list2.add(aVar);
                            } else {
                                list2.add(aVar);
                            }
                        }
                    }
                } else if (this.B0.get(i2).getSection().getSectionData().getHasMoreData().booleanValue()) {
                    if (this.B0.get(i2).getSection().getSectionData().getDataRequestDelay().longValue() > 0) {
                        this.K0.add(this.B0.get(i2).getSection());
                        if (l2.longValue() == 0) {
                            l2 = this.B0.get(i2).getSection().getSectionData().getDataRequestDelay();
                        } else if (l2.longValue() < this.B0.get(i2).getSection().getSectionData().getDataRequestDelay().longValue()) {
                            l2 = this.B0.get(i2).getSection().getSectionData().getDataRequestDelay();
                        }
                    } else {
                        this.J0.add(this.B0.get(i2).getSection());
                    }
                }
            } else if (this.B0.get(i2).getPaneType().equalsIgnoreCase("content") && ((pageType = this.V0) == null || pageType != PageType.Details)) {
                String myRecoTrackingId2 = (this.B0.get(i2).getSection() == null || this.B0.get(i2).getSection().getSectionData() == null || this.B0.get(i2).getSection().getSectionData().getMyRecoTrackingId() == null) ? "" : this.B0.get(i2).getSection().getSectionData().getMyRecoTrackingId();
                if (this.B0.get(i2).getSection() != null && this.B0.get(i2).getSection().getSectionData() != null && this.B0.get(i2).getSection().getSectionData().getParams() != null && this.B0.get(i2).getSection().getSectionData().getParams().getMultiSectionRows() != null) {
                    str = this.B0.get(i2).getSection().getSectionData().getParams().getMultiSectionRows();
                }
                this.o0.add(new ld.a(this.B0.get(i2).getPaneType(), new HeaderItemWithControls("", null, i2, this.B0.get(i2).getContent().getTitle(), this.B0.get(i2).getContent().getBackgroundImage(), this.B0.get(i2).getContent().getDescription(), null, "", myRecoTrackingId2, str, this.B0.get(i2).getSection().getSectionInfo().getBannerImage()), this.B0.get(i2).getContent().getDataRows()));
            }
        }
        if (l2.longValue() > 0) {
            n0(l2);
        }
    }

    public void w1(java.util.List<com.yupptv.ottsdk.model.Section.SectionInfo> r28, java.util.List<com.yupptv.ottsdk.model.Section.SectionData> r29) {
        throw new UnsupportedOperationException("Method not decompiled: com.yupptv.ott.fragments.a1.w1(java.util.List, java.util.List):void");
    }

    public String x1() {
        int i2;
        List<Menu> list = this.Y0;
        return (list == null || (i2 = this.u0) < 0 || i2 >= list.size()) ? "" : (this.Y0.get(this.u0).getCode().equalsIgnoreCase("favourites") || this.Y0.get(this.u0).getCode().equalsIgnoreCase("my-aha_mobile")) ? getActivity().getResources().getString(2131952096) : this.Y0.get(this.u0).getCode().equalsIgnoreCase("my_library") ? getActivity().getResources().getString(2131952114) : this.Y0.get(this.u0).getCode().equalsIgnoreCase(hd.e.b) ? getActivity().getResources().getString(2131952124) : "";
    }

    private String y1() {
        return (getActivity() == null || !(getActivity() instanceof MainActivity)) ? cc.c.M1 : getActivity().u2();
    }

    private String z1() {
        HashMap<String, List<Filter.FilterItem>> filtersList;
        a.C0133a c0133a = hd.a.a;
        String str = "";
        if (c0133a.b(OTTApplication.o()) != null && (filtersList = c0133a.g(OTTApplication.o()).getFiltersList()) != null && filtersList.size() > 0) {
            String str2 = "";
            for (Map.Entry<String, List<Filter.FilterItem>> entry : filtersList.entrySet()) {
                String str3 = entry.getKey() + ":";
                String str4 = "";
                for (int i2 = 0; i2 < entry.getValue().size(); i2++) {
                    str4 = str4 + entry.getValue().get(i2).getCode() + ",";
                }
                if (str4.endsWith(",")) {
                    str4 = str4.substring(0, str4.length() - 1);
                }
                str2 = str3 + str4 + ";";
            }
            str = str2;
        }
        return str.endsWith(";") ? str.substring(0, str.length() - 1) : str;
    }

    public String C1(String str) {
        return (str == null || str.split("pd=") == null || str.split("pd=").length <= 1) ? "" : str.split("pd=")[1];
    }

    public void E1(String str) {
        if (str != null) {
            String str2 = "";
            if (str.equals("")) {
                return;
            }
            byte[] bArr = new byte[0];
            if (Build.VERSION.SDK_INT >= 26) {
                bArr = Base64.getDecoder().decode(str);
            }
            String str3 = new String(bArr);
            String[] split = str3.split("&&&");
            String str4 = "";
            String str5 = str4;
            if (split != null) {
                for (int i2 = 0; i2 < split.length; i2++) {
                    if (split[i2] != null && split[i2].length() > 0) {
                        if (split[i2].contains("dt===")) {
                            str5 = split[i2].split("===")[1];
                        } else if (split[i2].contains("pi===")) {
                            str4 = split[i2].split("===")[1];
                        }
                    }
                }
            }
            a.C0133a c0133a = hd.a.a;
            Configs c2 = c0133a.c(OTTApplication.o());
            if (c2 != null && c2.getFlexiPlanRedirectionUrl() != null) {
                str2 = c2.getFlexiPlanRedirectionUrl();
            }
            if (c0133a.g(OTTApplication.o()) == null || c0133a.g(OTTApplication.o()).getLoggedUser() == null || c0133a.g(OTTApplication.o()).getLoggedUser().getUserId() == null) {
                Intent intent = new Intent();
                intent.putExtra(hd.r.n1, str2);
                intent.putExtra(hd.r.M1, str);
                intent.putExtra(hd.r.m1, true);
                if (getActivity() != null && (getActivity() instanceof MainActivity)) {
                    getActivity().z3(intent);
                }
            } else {
                getActivity().D3(str2, str4, false);
            }
            hd.h.a("decodedString", str3);
            hd.h.a("piValue", str4);
            hd.h.a("dtValue", str5);
        }
    }

    public void G1(int i2) {
        GridController gridController;
        RowController rowController;
        if (this.l1.size() <= 0) {
            return;
        }
        int size = !this.m1 ? this.o0.size() : this.F0.size();
        int i3 = i2;
        for (NativeAd nativeAd : this.l1) {
            if (!this.m1) {
                ld.a aVar = new ld.a(1, nativeAd);
                aVar.r(true);
                if (i3 < size) {
                    if (!this.o0.get(i3).o()) {
                        this.o0.add(i3, aVar);
                    }
                    i3 = i3 + i2 + 1;
                }
            } else if (i3 < size) {
                String cardType = this.F0.get(i3).getCardType();
                PosterType posterType = PosterType.NATIVE_AD_POSTER;
                if (cardType.equalsIgnoreCase(posterType.getValue())) {
                    return;
                }
                if (this.F0.get(i3).getAdObject() == null) {
                    Card card = new Card();
                    card.setCardType(posterType.getValue());
                    card.setAdObject(nativeAd);
                    this.F0.add(i3, card);
                }
                i3 += i2;
            } else {
                continue;
            }
        }
        if (this.m1) {
            if (this.F0.size() <= size || (gridController = this.k0) == null) {
                return;
            }
            gridController.setData(this.o0, Integer.valueOf(hd.r.M0), Boolean.TRUE);
            return;
        }
        if (this.o0.size() <= size || (rowController = this.j0) == null) {
            return;
        }
        rowController.setData(this.o0, Boolean.TRUE);
    }

    public void H1(String[] strArr) {
        GridController gridController;
        RowController rowController;
        List<ld.a> list = this.o0;
        if (list != null && list.size() > 0 && hd.e0.c) {
            int size = this.o0.size();
            for (int i2 = 0; i2 < size; i2++) {
                if (i2 < this.o0.size() && this.o0.get(i2).o()) {
                    this.o0.remove(i2);
                }
            }
            List<ld.a> list2 = this.o0;
            if (list2 != null && list2.size() > 0) {
                List<ld.a> list3 = this.o0;
                if (list3.get(list3.size() - 1).o()) {
                    List<ld.a> list4 = this.o0;
                    list4.remove(list4.size() - 1);
                }
            }
        }
        List<Banner> list5 = this.C0;
        boolean z2 = list5 != null && list5.size() > 0;
        if (this.l1.size() <= 0) {
            return;
        }
        int size2 = !this.m1 ? this.o0.size() : this.F0.size();
        for (int i3 = 0; i3 < this.l1.size() - 1; i3++) {
            String[] split = strArr[i3].split("-");
            int parseInt = Integer.parseInt(split[0]);
            String str = split[1];
            int i4 = z2 ? parseInt + i3 + 1 : parseInt + i3;
            if (!this.m1) {
                ld.a aVar = new ld.a(1, this.l1.get(i3));
                aVar.p(str);
                aVar.r(true);
                if (i4 <= this.o0.size()) {
                    if (i4 >= this.o0.size()) {
                        this.o0.add(i4, aVar);
                    } else if (!this.o0.get(i4).o()) {
                        this.o0.add(i4, aVar);
                    }
                }
            } else if (i4 <= size2) {
                String cardType = this.F0.get(i4).getCardType();
                PosterType posterType = PosterType.NATIVE_AD_POSTER;
                if (cardType.equalsIgnoreCase(posterType.getValue())) {
                    return;
                }
                if (this.F0.get(i4).getAdObject() == null) {
                    Card card = new Card();
                    card.setCardType(posterType.getValue());
                    card.setAdObject(this.l1.get(i3));
                    this.F0.add(i4, card);
                }
            } else {
                continue;
            }
        }
        if (this.m1) {
            if (this.F0.size() <= size2 || (gridController = this.k0) == null) {
                return;
            }
            gridController.setData(this.o0, Integer.valueOf(hd.r.M0), Boolean.TRUE);
            return;
        }
        if (this.n1.equalsIgnoreCase("true") && hd.e0.c && this.p1) {
            t1();
        }
        if (this.o0.size() <= size2 || (rowController = this.j0) == null) {
            return;
        }
        rowController.setData(this.o0, Boolean.TRUE);
    }

    public void J1(String str) {
    }

    public void K1(AdUrlType.Position position, String str) {
        String adSlot;
        if (hd.e0.a && hd.e0.c) {
            String str2 = this.X0;
            if (str2 == null || str2.trim().length() < 1) {
                List<ld.a> list = this.o0;
                if (list == null || list.size() <= 0) {
                    return;
                } else {
                    this.m1 = false;
                }
            }
            String str3 = this.X0;
            if (str3 != null && str3.trim().length() > 0) {
                int i2 = b0.a[PageType.getType(this.X0).ordinal()];
                if (i2 == 1) {
                    this.m1 = false;
                } else if (i2 == 3) {
                    this.m1 = true;
                }
            }
            String top = (position.getTop() == null || position.getTop().equalsIgnoreCase("")) ? "" : position.getTop();
            if (position.getBottom() != null && !position.getBottom().equalsIgnoreCase("")) {
                this.n1 = position.getBottom();
            }
            String topAdStlye = (position.getTopAdStlye() == null || position.getTopAdStlye().equalsIgnoreCase("")) ? "" : position.getTopAdStlye();
            if (position.getBottomAdStlye() != null && !position.getBottomAdStlye().equalsIgnoreCase("")) {
                this.o1 = position.getBottomAdStlye();
            }
            if (position.getAdSlot() == null || position.getAdSlot().equalsIgnoreCase("")) {
                if (position.getInterval() == null || position.getInterval().equalsIgnoreCase("") || position.getMaxCount() == null || position.getMaxCount().equalsIgnoreCase("")) {
                    return;
                }
                L1(str, Integer.parseInt(position.getInterval()), Integer.parseInt(position.getMaxCount()), null, "interval");
                return;
            }
            if (top.equalsIgnoreCase("true")) {
                adSlot = "0-" + topAdStlye + "," + position.getAdSlot();
            } else {
                adSlot = position.getAdSlot();
            }
            String[] split = adSlot.split(",");
            this.q1 = split;
            L1(str, 0, split.length, split, "adSlot");
        }
    }

    public void M1() {
        try {
            if (this.j0 != null) {
                int a2 = this.y.getLayoutManager().a2();
                this.y.G1(this.j0.getAdapter(), true);
                new Handler().postDelayed(new w(a2), 1000L);
            } else if (this.k0 != null) {
                int a22 = this.y.getLayoutManager().a2();
                this.y.G1(this.k0.getAdapter(), true);
                new Handler().postDelayed(new x(a22), 1000L);
            }
        } catch (Exception unused) {
        }
    }

    public void S1(String str) {
        if (this.p0.equalsIgnoreCase(str)) {
            return;
        }
        this.p0 = str;
        V(false);
        SwipeRefreshLayout swipeRefreshLayout = this.F;
        if (swipeRefreshLayout != null) {
            swipeRefreshLayout.setRefreshing(false);
        }
        a.C0133a c0133a = hd.a.a;
        if (c0133a.f(OTTApplication.o()) != null) {
            c0133a.f(OTTApplication.o()).cancelAll();
        }
        RecyclerView recyclerView = this.y;
        if (recyclerView != null) {
            recyclerView.setVisibility(8);
        }
        List<Section> list = this.J0;
        if (list != null) {
            list.clear();
        }
        List<Section> list2 = this.K0;
        if (list2 != null) {
            list2.clear();
        }
        this.o0.clear();
        this.e0.b();
        hd.z zVar = this.f0;
        if (zVar != null) {
            zVar.k();
        }
        b0(true);
        F1(false);
    }

    public void T1(boolean z2) {
        SwipeRefreshLayout swipeRefreshLayout = this.F;
        if (swipeRefreshLayout != null) {
            swipeRefreshLayout.setRefreshing(z2);
        }
        this.R0 = true;
        this.U0 = -1;
        this.p1 = false;
        j0(true);
        List<Section> list = this.J0;
        if (list != null) {
            list.clear();
        }
        List<Section> list2 = this.K0;
        if (list2 != null) {
            list2.clear();
        }
        List<ld.a> list3 = this.o0;
        if (list3 != null) {
            list3.clear();
        }
        RecyclerView.u uVar = this.e0;
        if (uVar != null) {
            uVar.b();
        }
        hd.z zVar = this.f0;
        if (zVar != null) {
            zVar.k();
        }
        F1(false);
        b0(false);
    }

    public void U1() {
        hd.a.a.f(OTTApplication.o()).getPageSectionContent(this.p0, this.D0.get(this.G0).getCode(), -1, -1, null, z1(), new v());
    }

    public void Z1() {
        FragmentManager supportFragmentManager = getActivity().getSupportFragmentManager();
        j0 G = j0.G(this.D0.get(this.G0).getCode(), this.D0.get(this.G0), this.D0.get(this.G0).getMultiSelectable().booleanValue());
        G.setTargetFragment(this, 333);
        G.show(supportFragmentManager, "fragment_alert");
    }

    @Override
    public void c(Object obj) {
        MainActivity activity = getActivity();
        String str = "";
        activity.Y1(false, "");
        activity.O5(false);
        if (this.w0) {
            activity.E5(false, getActivity().getResources().getString(2131952224), false);
        }
        b2(obj);
        oc.l lVar = this.t0;
        if (lVar != null) {
            lVar.z(false);
        }
        int size = this.o0.size();
        int i2 = 0;
        while (true) {
            if (i2 < size) {
                if (this.o0.get(i2) != null && this.o0.get(i2).g() != null && this.o0.get(i2).a().equals(obj)) {
                    str = ((Card) this.o0.get(i2).g().get(0)).getCardType();
                    break;
                }
                i2++;
            } else {
                break;
            }
        }
        hd.u.r0(getActivity(), PageType.Content, obj, str);
    }

    @Override
    public void l(Object obj, int i2) {
        MainActivity activity = getActivity();
        if (obj == null || activity == null) {
            return;
        }
        boolean z2 = obj instanceof Card;
        String str = "";
        String path = z2 ? ((Card) obj).getTarget().getPath() : "";
        if (TextUtils.isEmpty(path) || !(path.equalsIgnoreCase("subscribe") || path.equalsIgnoreCase("buy/packages-list"))) {
            activity.O5(false);
            if (!this.p0.toLowerCase().contains("favourites") && !this.p0.toLowerCase().contains("favorites")) {
                activity.Y1(false, "");
            }
        }
        if (activity.V2()) {
            return;
        }
        activity.u4(true);
        activity.w3.postDelayed(activity.x3, 1000L);
        Card card = (Card) obj;
        cc.b.B0().v1(card.getDisplay().getTitle());
        b2(obj);
        if (obj instanceof Content.Elements) {
            Content.Elements elements = (Content.Elements) obj;
            if (elements.getElementSubtype() != null && elements.getElementSubtype().equalsIgnoreCase("Subscribe")) {
                Intent intent = new Intent((Context) getActivity(), (Class<?>) LoadScreenActivity.class);
                intent.putExtra(hd.r.i, ScreenType.PACKAGES_MAIN);
                intent.putExtra(hd.r.y0, "button");
                startActivityForResult(intent, 18);
                return;
            }
            if (elements.getElementSubtype() == null || !elements.getElementSubtype().equalsIgnoreCase("Signin")) {
                if (elements.getElementSubtype() == null || !elements.getElementSubtype().equalsIgnoreCase("Signup")) {
                    return;
                }
                Intent intent2 = new Intent((Context) getActivity(), (Class<?>) LoadScreenActivity.class);
                intent2.putExtra(hd.r.i, ScreenType.SIGNUP);
                intent2.putExtra(hd.r.C0, cc.d.L);
                startActivityForResult(intent2, 16);
                return;
            }
            Intent intent3 = new Intent((Context) getActivity(), (Class<?>) LoadScreenActivity.class);
            String str2 = hd.r.i;
            ScreenType screenType = ScreenType.SIGNIN;
            intent3.putExtra(str2, screenType);
            intent3.putExtra(hd.r.y0, screenType.getValue());
            intent3.putExtra(hd.r.C0, cc.d.K);
            startActivityForResult(intent3, 15);
            return;
        }
        if (z2) {
            if (card.getDisplay() != null && card.getDisplay().getTitle() != null) {
                cc.b.B0().v1(card.getDisplay().getTitle());
            }
            if (card.getTarget() != null && card.getTarget().getPageType() != null && card.getTarget().getPageType().equalsIgnoreCase("player")) {
                cc.c.d().t("click_event", cc.b.B0().h("direct_play", (card.getTarget().getPageAttributes() == null || card.getTarget().getPageAttributes().getContentType() == null) ? null : card.getTarget().getPageAttributes().getContentType()));
            }
            if (card.getTarget() != null && card.getTarget().getPageAttributes() != null && card.getTarget().getPageAttributes().getPageSubtype() != null && card.getTarget().getPageAttributes().getPageSubtype().equalsIgnoreCase("pdf")) {
                hd.u.f0(getActivity(), hd.r.x1, card.getTarget().getPath(), "");
                return;
            } else if (card.getTarget() != null && card.getTarget().getPath() != null && card.getTarget().getPath().startsWith("http")) {
                hd.u.A(getActivity(), card.getTarget().getPath());
                return;
            }
        }
        String u2 = getActivity() instanceof MainActivity ? getActivity().u2() : "";
        if (u2.equalsIgnoreCase("WatchList_Page")) {
            if (getActivity().T0.getVisibility() == 0) {
                this.b1 = true;
                getActivity().T0.setVisibility(8);
            } else {
                this.b1 = false;
            }
        }
        List<ld.a> list = this.o0;
        if (list != null && list.size() > 0 && cc.e.n().c() < this.o0.size()) {
            List<Banner> list2 = this.C0;
            this.t1 = (list2 == null || list2.size() <= 0 || this.u0 != 0) ? cc.e.n().c() : cc.e.n().c() + 1;
            if (cc.e.n().c() >= 0 && cc.e.n().c() < this.o0.size()) {
                ld.a aVar = this.o0.get(cc.e.n().c());
                if (this.o0.get(cc.e.n().c()).a() != null && this.o0.get(cc.e.n().c()).a().m() != null) {
                    str = this.o0.get(cc.e.n().c()).a().m();
                }
                if (aVar != null && aVar.a() != null && aVar.a().a() != null) {
                    cc.e.n().x(aVar.a().a());
                }
                aVar.s(i2);
            }
        }
        if (hd.e0.h0(this.n0)) {
            hd.u.s0(this, getActivity(), obj, u2, str, cc.b.B0().q1());
        } else {
            i0(this.n0.getResources().getString(2131952922), this.z1);
        }
    }

    public void o0(Object obj, int i2) {
        if (i2 == 28) {
            getActivity().c4();
        }
    }

    public void onActivityCreated(Bundle bundle) {
        oc.l lVar;
        String string;
        super.onActivityCreated(bundle);
        this.n0 = getActivity();
        this.x0 = getArguments();
        this.a1 = false;
        this.w0 = false;
        cc.b.B0().U1("Home");
        Bundle bundle2 = this.x0;
        if (bundle2 != null) {
            this.v0 = bundle2.containsKey(hd.r.I0) ? this.x0.getString(hd.r.I0) : "";
            if (this.x0.containsKey(hd.r.z)) {
                this.p0 = this.x0.getString(hd.r.z);
            }
            if (this.x0.containsKey(hd.r.B)) {
                this.q0 = this.x0.getString(hd.r.B);
            }
            if (this.x0.containsKey(hd.r.C)) {
                this.r0 = this.x0.getBoolean(hd.r.C);
            }
            if (this.x0.containsKey(hd.r.A)) {
                this.u0 = this.x0.getInt(hd.r.A);
            }
            if (this.x0.containsKey(hd.r.U0) && (((string = this.x0.getString(hd.r.U0)) != null && string.contains("my-aha_mobile")) || string.contains("favourites") || string.contains("favorites"))) {
                this.w0 = true;
                cc.b.B0().H1("Watchlist");
                cc.b.B0().C1("Watchlist");
            }
            if (this.x0.containsKey(hd.r.y0)) {
                String string2 = this.x0.getString(hd.r.y0);
                this.I0 = string2;
                if (string2 != null && !string2.equalsIgnoreCase("home") && (lVar = this.t0) != null && this.v0 != null) {
                    lVar.setTitle("");
                }
            }
            if (this.x0.containsKey(hd.r.C0)) {
                this.M0 = this.x0.getString(hd.r.C0);
            }
            if (this.x0.containsKey(hd.r.d)) {
                this.s0 = this.x0.getParcelable(hd.r.d);
            }
        }
        b0(true);
        this.F.setOnRefreshListener(this.A1);
        SwipeRefreshLayout swipeRefreshLayout = this.F;
        if (swipeRefreshLayout != null) {
            swipeRefreshLayout.s(true, 180, 350);
        }
        a.C0133a c0133a = hd.a.a;
        if (c0133a.b(OTTApplication.o()) != null) {
            c0133a.g(OTTApplication.o()).setFiltersList(new HashMap<>());
        }
        this.H0 = false;
        this.f1 = hd.a0.y(getContext());
        hd.h.b("HOmefragment", "handleGuidePopup onActivityCreated" + hd.e.v);
        hd.h.b("HOmefragment", "OTTApplication.sharedPath" + OTTApplication.A);
        String str = OTTApplication.A;
        if (str == null || !str.equalsIgnoreCase("isFromBranchIO")) {
            String str2 = OTTApplication.A;
            if (str2 == null || !str2.equalsIgnoreCase("watchoonelink")) {
                String str3 = OTTApplication.C;
                if (str3 != null && str3.equalsIgnoreCase("campaign")) {
                    String u2 = hd.a0.y(getActivity()).u("appsflyer_data");
                    if (!TextUtils.isEmpty(u2) && !hd.e.v) {
                        J1("coming from campaign data");
                        hd.e.v = true;
                        O1(u2);
                    }
                }
            } else {
                String u3 = hd.a0.y(getActivity()).u("appsflyer_data");
                if (!TextUtils.isEmpty(u3) && !hd.e.v) {
                    hd.e.v = true;
                    O1(u3);
                }
            }
        } else {
            String u4 = hd.a0.y(getActivity()).u("appsflyer_data");
            if (!TextUtils.isEmpty(u4) && !hd.e.v) {
                hd.e.v = true;
                N1(u4);
            }
        }
        F1(false);
        this.L.setOnClickListener(new e0());
        this.M.setOnClickListener(new f0());
        this.N.setOnClickListener(new g0());
        new com.airbnb.epoxy.s().l(this.y);
    }

    public void onAttach(Activity activity) {
        super.onAttach(activity);
        this.t0 = (oc.l) activity;
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        IntentFilter intentFilter = new IntentFilter("APPSFLYER_DATA");
        if (requireActivity() != null) {
            J1("Register Receiver");
            if (Build.VERSION.SDK_INT >= 33) {
                requireActivity().registerReceiver(this.E1, intentFilter, 2);
            } else {
                requireActivity().registerReceiver(this.E1, intentFilter);
            }
            this.i0 = true;
        }
    }

    public void onDestroy() {
        super.onDestroy();
    }

    public void onDestroyView() {
        super.onDestroyView();
        this.y.setVisibility(8);
        this.y.setAdapter((RecyclerView.Adapter) null);
        this.e0.b();
        this.o0.clear();
        Handler handler = this.L0;
        if (handler != null) {
            handler.removeCallbacks(this.x1);
        }
        this.z0 = 0;
        this.g0 = false;
        hd.a.a.f(OTTApplication.o()).cancelAll();
        if (getActivity() == null || this.E1 == null || !this.i0) {
            return;
        }
        this.i0 = false;
        try {
            getActivity().unregisterReceiver(this.E1);
        } catch (IllegalArgumentException unused) {
        }
    }

    public void onPause() {
        super.onPause();
        this.w1 = false;
    }

    public void onResume() {
        Fragment j0;
        super.onResume();
        this.w1 = true;
        OTTApplication.J = false;
        if (this.t0 != null) {
            try {
                j0 = getActivity().getSupportFragmentManager().j0(2131427847);
            } catch (Exception unused) {
                this.t0.k(false);
            }
            if (getActivity().getSupportFragmentManager() != null && ((getActivity().getSupportFragmentManager().j0(2131427847) != null && ((getActivity().getSupportFragmentManager().j0(2131427847) instanceof q0) || (getActivity().getSupportFragmentManager().j0(2131427847) instanceof u0))) || (getActivity().getSupportFragmentManager().j0(2131428004) != null && (getActivity().getSupportFragmentManager().j0(2131428004) instanceof q0)))) {
                if (getActivity().getSupportFragmentManager().j0(2131427847) instanceof u0) {
                    getActivity().p1 = true;
                }
                this.t0.k(true);
                return;
            }
            this.t0.k(false);
            if (!this.p0.equalsIgnoreCase("favorites") && !this.p0.equalsIgnoreCase("favourites")) {
                this.t0.k(true);
            }
            if ((this.p0.equalsIgnoreCase("favorites") || this.p0.equalsIgnoreCase("favourites")) && (j0 instanceof a1) && OTTApplication.F.booleanValue()) {
                if (this.o0.size() != 0) {
                    T1(true);
                }
                OTTApplication.F = Boolean.FALSE;
            }
            if (!this.w0 || !(j0 instanceof a1)) {
                if (((MainActivity) this.n0).U2() && !((MainActivity) this.n0).v.contains("account") && !((MainActivity) this.n0).v.contains("menu") && !((MainActivity) this.n0).v.contains("setting")) {
                    ((MainActivity) this.n0).Y1(true, "");
                }
                if (this.r0 && j0 != null && (j0 instanceof a1)) {
                    ((MainActivity) this.n0).Y1(true, this.v0);
                }
            } else if (getActivity() != null && (getActivity() instanceof MainActivity)) {
                getActivity().E5(true, getActivity().getResources().getString(2131952478), true);
            }
            String str = this.I0;
            if ((str == null || !str.equalsIgnoreCase("home") || this.t0 == null || this.v0 == null) && this.v0 != null && getActivity() != null && (getActivity() instanceof MainActivity) && !getActivity().U2() && getActivity().getSupportFragmentManager() != null && getActivity().getSupportFragmentManager().j0(2131427847) != null && !(getActivity().getSupportFragmentManager().j0(2131427847) instanceof z0)) {
                this.t0.setTitle(this.v0);
            }
        }
        new Handler().postDelayed(new h0(), 0L);
        if (getActivity().T0.getVisibility() == 0) {
            getActivity().T0.setVisibility(0);
        } else {
            getActivity().T0.setVisibility(8);
        }
        ContentPage contentPage = this.s0;
        if (contentPage != null && contentPage.getPageInfo() != null) {
            this.s0.getPageInfo().getPath();
        }
        Object obj = this.n0;
        if (((MainActivity) obj) == null || ((MainActivity) obj).q0 == null) {
            return;
        }
        ((MainActivity) obj).q0.getVisibility();
    }

    @Override
    public void q(String str) {
        j0(true);
        b0(false);
        d2(str);
        this.H0 = true;
        List<Section> list = this.J0;
        if (list != null) {
            list.clear();
        }
        this.o0.clear();
        hd.z zVar = this.f0;
        if (zVar != null) {
            zVar.k();
        }
        if (OttSDK.sInstance == null) {
            OttSDK.init(this.n0, hd.e.z, hd.e0.b0(requireContext()), String.valueOf(204), " ", new u());
            OttSDK.setLogEnabled(true);
        } else {
            this.l0 = hd.a.a.b(OTTApplication.o());
            U1();
        }
    }

    @Override
    public void r(Object obj, int i2, View view, int i3) {
        String str;
        String replace;
        String[] split;
        if (view != null) {
            hd.e0.n0(obj, i2, view, i3, getActivity(), this);
            return;
        }
        if (i3 == 35) {
            if (obj != null && (obj instanceof Card)) {
                String path = ((Card) obj).getTarget().getPath();
                if (this.Z0.contains(path)) {
                    this.Z0.remove(path);
                    if (this.a1) {
                        this.a1 = false;
                    }
                } else {
                    this.Z0.add(path);
                }
            }
            getActivity().d5(this.Z0);
            return;
        }
        String str2 = "";
        if (view == null || !(view instanceof TextView)) {
            if (i3 == 45) {
                hd.u.F0(this.n0, DialogType.DIALOG_BOOKMARK_REMOVE_BOTTOM_RENDERING, obj, new r(obj));
                return;
            } else {
                if (i3 == 44) {
                    HashMap hashMap = new HashMap();
                    hashMap.put("msg2", "");
                    hashMap.put("msg1", getResources().getString(2131952717));
                    hd.u.J0(getActivity(), DialogType.REMOVE_FROM_CONTINUE_WATCHING, hashMap, new s(obj));
                    return;
                }
                return;
            }
        }
        if (view.getId() == 2131428662 && obj != null && (obj instanceof Card)) {
            Card card = (Card) obj;
            int i4 = -1;
            int i5 = 0;
            while (true) {
                if (i5 >= card.getDisplay().getMarkers().size()) {
                    break;
                }
                if (((Card.PosterDisplay.Marker) card.getDisplay().getMarkers().get(i5)).getMarkerType().equalsIgnoreCase("record")) {
                    str2 = ((Card.PosterDisplay.Marker) card.getDisplay().getMarkers().get(i5)).getValue();
                    i4 = 1;
                    break;
                } else {
                    if (((Card.PosterDisplay.Marker) card.getDisplay().getMarkers().get(i5)).getMarkerType().equalsIgnoreCase("stoprecord")) {
                        str2 = ((Card.PosterDisplay.Marker) card.getDisplay().getMarkers().get(i5)).getValue();
                        i4 = 0;
                        break;
                    }
                    i5++;
                }
            }
            if (str2.trim().length() > 0 && str2.contains(",") && (split = str2.split(",")) != null && split.length > 0) {
                str2 = split[0];
            }
            HashMap hashMap2 = new HashMap();
            hashMap2.put("msg2", i4 == 1 ? "record" : "stoprecord");
            hashMap2.put("msg1", i4 == 1 ? String.format(getActivity().getResources().getString(2131952703), card.getDisplay().getTitle()) : String.format(getActivity().getResources().getString(2131952846), card.getDisplay().getTitle()));
            if (OTTApplication.w().B() != null) {
                HashMap<String, Integer> B = OTTApplication.w().B();
                if (B.containsKey(card.getTarget().getPath())) {
                    if (B.get(card.getTarget().getPath()).intValue() == 1) {
                        if (str2.contains("action=1")) {
                            replace = str2.replace("action=1", "action=0");
                            str = replace;
                        }
                    } else if (B.get(card.getTarget().getPath()).intValue() == 0 && str2.contains("action=0")) {
                        replace = str2.replace("action=0", "action=1");
                        str = replace;
                    }
                    hd.u.J0(getActivity(), DialogType.RECORD, hashMap2, new q(str, i4, view, card));
                }
            }
            str = str2;
            hd.u.J0(getActivity(), DialogType.RECORD, hashMap2, new q(str, i4, view, card));
        }
    }

    public void setUserVisibleHint(boolean z2) {
        List<Card> list;
        super.setUserVisibleHint(z2);
        this.h0 = z2;
        if (z2) {
            new Handler().postDelayed(new n(), 500L);
        }
        if (z2 && !this.g0) {
            if (this.o0.size() > 0) {
                new Handler().postDelayed(new o(), 100L);
            } else if (this.F0.size() > 0) {
                new Handler().postDelayed(new p(), 100L);
            }
            this.g0 = true;
        }
        if (z2 && isResumed()) {
            String str = this.p0;
            if (str != null && str.equalsIgnoreCase("live")) {
                this.Q0 = 0;
                List<Banner> list2 = this.C0;
                if (list2 == null || list2.size() < 1) {
                    this.Q0 = 0;
                } else {
                    this.Q0++;
                }
            }
            if (getActivity() != null && (getActivity() instanceof MainActivity) && getActivity().j1) {
                List<ld.a> list3 = this.o0;
                if ((list3 == null || list3.size() <= 0) && ((list = this.F0) == null || list.size() <= 0)) {
                    return;
                }
                T1(true);
                getActivity().j1 = false;
            }
        }
    }

    public void v1(HashMap hashMap, RelativeLayout relativeLayout) {
        hd.u.J0(getActivity(), DialogType.AFTER_DARK_PASSCODE_DIALOG, hashMap, new k(relativeLayout));
    }
}