导航菜单

页面标题

页面副标题

Chaupal v3.2 - OttSDK.java 源代码

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

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


package com.yupptv.ottsdk;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Handler;
import com.google.gson.k;
import com.yupptv.ottsdk.constants.Constants;
import com.yupptv.ottsdk.enums.Device;
import com.yupptv.ottsdk.enums.TenantBuildType;
import com.yupptv.ottsdk.managers.Application.AppManager;
import com.yupptv.ottsdk.managers.Application.AppManagerImp;
import com.yupptv.ottsdk.managers.MediaCatalog.MediaCatalogManager;
import com.yupptv.ottsdk.managers.MediaCatalog.MediaCatalogManagerImpl;
import com.yupptv.ottsdk.managers.Payment.PaymentManager;
import com.yupptv.ottsdk.managers.Payment.PaymentManagerImpl;
import com.yupptv.ottsdk.managers.Preferences.PreferenceManager;
import com.yupptv.ottsdk.managers.Preferences.PreferenceManagerImp;
import com.yupptv.ottsdk.managers.Status.StatusManager;
import com.yupptv.ottsdk.managers.Status.StatusManagerImp;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.managers.User.UserManagerImpl;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.LocationInfo;
import com.yupptv.ottsdk.model.Menu;
import com.yupptv.ottsdk.model.ResourceProfile;
import com.yupptv.ottsdk.model.SessionInfo;
import com.yupptv.ottsdk.model.User;
import com.yupptv.ottsdk.rest.network.RestAdapter;
import com.yupptv.ottsdk.utils.CipherUtils;
import com.yupptv.ottsdk.utils.OttLog;
import com.yupptv.ottsdk.utils.PreferencesUtils;
import com.yupptv.ottsdk.utils.ValidatorUtils;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import org.json.JSONObject;

public class OttSDK {
    private static final String TAG = "OTT SDK";
    public static String brandName = null;
    public static boolean debugEnabled = false;
    private static String displayLocale = "en";
    private static boolean initialized = false;
    public static boolean isPlayStoreBuild = false;
    private static String liteSdkToken = "";
    private static String liteSdkVendorCode = "";
    public static OttSDK sInstance;
    private AppManager appManager;
    private String appVersionName;
    private int deviceID;
    private boolean isLiteSdk;
    private Context mContext;
    private MediaCatalogManager mediaCatalogManager;
    private PaymentManager paymentManager;
    private PreferenceManager preferenceManager;
    private StatusManager statusManager;
    private TenantBuildType tenantBuildType;
    private UserManager userManager;

    static class AnonymousClass9 {
        static final int[] $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType;

        static {
            int[] iArr = new int[TenantBuildType.values().length];
            $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType = iArr;
            try {
                iArr[TenantBuildType.TELEUP_BRAZIL_BETA.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TELEUP_BRAZIL_LIVE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TELEUP_BRAZIL_UAT.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TELEUP_TEST.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIEWLIST_BETA.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIEWLIST_LIVE.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIEWLIST_UAT.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.USTVNOW_BETA.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.USTVNOW_LIVE.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.USTVNOW_UAT.ordinal()] = 10;
            } catch (NoSuchFieldError unused10) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FRNDLYTV_BETA.ordinal()] = 11;
            } catch (NoSuchFieldError unused11) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FRNDLYTV_BETA2.ordinal()] = 12;
            } catch (NoSuchFieldError unused12) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FRNDLYTV_LIVE.ordinal()] = 13;
            } catch (NoSuchFieldError unused13) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FRNDLYTV_UAT.ordinal()] = 14;
            } catch (NoSuchFieldError unused14) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_LIVE.ordinal()] = 15;
            } catch (NoSuchFieldError unused15) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_BETA.ordinal()] = 16;
            } catch (NoSuchFieldError unused16) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_BETA_76.ordinal()] = 17;
            } catch (NoSuchFieldError unused17) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_BETA_73.ordinal()] = 18;
            } catch (NoSuchFieldError unused18) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_LIVE.ordinal()] = 19;
            } catch (NoSuchFieldError unused19) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_BETA.ordinal()] = 20;
            } catch (NoSuchFieldError unused20) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_MASTER.ordinal()] = 21;
            } catch (NoSuchFieldError unused21) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_UAT.ordinal()] = 22;
            } catch (NoSuchFieldError unused22) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_LIVE.ordinal()] = 23;
            } catch (NoSuchFieldError unused23) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_BETA.ordinal()] = 24;
            } catch (NoSuchFieldError unused24) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_UAT.ordinal()] = 25;
            } catch (NoSuchFieldError unused25) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_MASTER.ordinal()] = 26;
            } catch (NoSuchFieldError unused26) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIEWLIST_FUSION.ordinal()] = 27;
            } catch (NoSuchFieldError unused27) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TELEUP_BRAZIL_FUSION.ordinal()] = 28;
            } catch (NoSuchFieldError unused28) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SEVENSTAR_BETA.ordinal()] = 29;
            } catch (NoSuchFieldError unused29) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SEVENSTAR_LIVE.ordinal()] = 30;
            } catch (NoSuchFieldError unused30) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DIALOG_BETA.ordinal()] = 31;
            } catch (NoSuchFieldError unused31) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DIALOG_LIVE.ordinal()] = 32;
            } catch (NoSuchFieldError unused32) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_FUSION.ordinal()] = 33;
            } catch (NoSuchFieldError unused33) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_LIVE.ordinal()] = 34;
            } catch (NoSuchFieldError unused34) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_BETA.ordinal()] = 35;
            } catch (NoSuchFieldError unused35) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_UAT.ordinal()] = 36;
            } catch (NoSuchFieldError unused36) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CINESOFTMEDIA_LIVE.ordinal()] = 37;
            } catch (NoSuchFieldError unused37) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CINESOFTMEDIA_UAT.ordinal()] = 38;
            } catch (NoSuchFieldError unused38) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CINESOFTMEDIA_BETA.ordinal()] = 39;
            } catch (NoSuchFieldError unused39) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.USTVNOW_FUSION.ordinal()] = 40;
            } catch (NoSuchFieldError unused40) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_BETA.ordinal()] = 41;
            } catch (NoSuchFieldError unused41) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_UAT.ordinal()] = 42;
            } catch (NoSuchFieldError unused42) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_LIVE.ordinal()] = 43;
            } catch (NoSuchFieldError unused43) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_FUSION.ordinal()] = 44;
            } catch (NoSuchFieldError unused44) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.BSNL_BETA.ordinal()] = 45;
            } catch (NoSuchFieldError unused45) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.BSNL_LIVE.ordinal()] = 46;
            } catch (NoSuchFieldError unused46) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AIRTEL_LANKA_BETA.ordinal()] = 47;
            } catch (NoSuchFieldError unused47) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AIRTEL_LANKA_LIVE.ordinal()] = 48;
            } catch (NoSuchFieldError unused48) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AIRTEL_LANKA_FUSION.ordinal()] = 49;
            } catch (NoSuchFieldError unused49) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.EDUCATIONAL_BETA.ordinal()] = 50;
            } catch (NoSuchFieldError unused50) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.EDUCATIONAL_LIVE.ordinal()] = 51;
            } catch (NoSuchFieldError unused51) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.REELDRAMA_BETA.ordinal()] = 52;
            } catch (NoSuchFieldError unused52) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.REELDRAMA_BETA2.ordinal()] = 53;
            } catch (NoSuchFieldError unused53) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.REELDRAMA_LIVE.ordinal()] = 54;
            } catch (NoSuchFieldError unused54) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.REELDRAMA_FUSION.ordinal()] = 55;
            } catch (NoSuchFieldError unused55) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FIRSTSHOW_LIVE.ordinal()] = 56;
            } catch (NoSuchFieldError unused56) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FIRSTSHOW_BETA.ordinal()] = 57;
            } catch (NoSuchFieldError unused57) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FIRSTSHOW_FUSION.ordinal()] = 58;
            } catch (NoSuchFieldError unused58) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_FUSION.ordinal()] = 59;
            } catch (NoSuchFieldError unused59) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_FUSION.ordinal()] = 60;
            } catch (NoSuchFieldError unused60) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_LIVE.ordinal()] = 61;
            } catch (NoSuchFieldError unused61) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_FUSION.ordinal()] = 62;
            } catch (NoSuchFieldError unused62) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_BETA.ordinal()] = 63;
            } catch (NoSuchFieldError unused63) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_UAT.ordinal()] = 64;
            } catch (NoSuchFieldError unused64) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_LIVE.ordinal()] = 65;
            } catch (NoSuchFieldError unused65) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_FUSION.ordinal()] = 66;
            } catch (NoSuchFieldError unused66) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_BETA.ordinal()] = 67;
            } catch (NoSuchFieldError unused67) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_UAT.ordinal()] = 68;
            } catch (NoSuchFieldError unused68) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.YVS_LIVE.ordinal()] = 69;
            } catch (NoSuchFieldError unused69) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.YVS_FUSION.ordinal()] = 70;
            } catch (NoSuchFieldError unused70) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_LIVE.ordinal()] = 71;
            } catch (NoSuchFieldError unused71) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_BETA.ordinal()] = 72;
            } catch (NoSuchFieldError unused72) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_UAT.ordinal()] = 73;
            } catch (NoSuchFieldError unused73) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_FUSION.ordinal()] = 74;
            } catch (NoSuchFieldError unused74) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GAC_LIVE.ordinal()] = 75;
            } catch (NoSuchFieldError unused75) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GAC_UAT.ordinal()] = 76;
            } catch (NoSuchFieldError unused76) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GAC_BETA.ordinal()] = 77;
            } catch (NoSuchFieldError unused77) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.JANYA_LIVE.ordinal()] = 78;
            } catch (NoSuchFieldError unused78) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_LIVE.ordinal()] = 79;
            } catch (NoSuchFieldError unused79) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_UAT.ordinal()] = 80;
            } catch (NoSuchFieldError unused80) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_FUSION.ordinal()] = 81;
            } catch (NoSuchFieldError unused81) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_BETA.ordinal()] = 82;
            } catch (NoSuchFieldError unused82) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_BETA2.ordinal()] = 83;
            } catch (NoSuchFieldError unused83) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_UAT2.ordinal()] = 84;
            } catch (NoSuchFieldError unused84) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MYTV_BETA.ordinal()] = 85;
            } catch (NoSuchFieldError unused85) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MYTV_LIVE.ordinal()] = 86;
            } catch (NoSuchFieldError unused86) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TIMESPLAY_BETA.ordinal()] = 87;
            } catch (NoSuchFieldError unused87) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TIMESPLAY_LIVE.ordinal()] = 88;
            } catch (NoSuchFieldError unused88) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.HEROTVGO_BETA.ordinal()] = 89;
            } catch (NoSuchFieldError unused89) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.HEROTVGO_LIVE.ordinal()] = 90;
            } catch (NoSuchFieldError unused90) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FASTCHANNELS_LIVE.ordinal()] = 91;
            } catch (NoSuchFieldError unused91) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FASTCHANNELS_TEST.ordinal()] = 92;
            } catch (NoSuchFieldError unused92) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VESTA_LIVE.ordinal()] = 93;
            } catch (NoSuchFieldError unused93) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VESTA_BETA.ordinal()] = 94;
            } catch (NoSuchFieldError unused94) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.ORKA_BETA.ordinal()] = 95;
            } catch (NoSuchFieldError unused95) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.ORKA_LIVE.ordinal()] = 96;
            } catch (NoSuchFieldError unused96) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.PURALOCAL_LIVE.ordinal()] = 97;
            } catch (NoSuchFieldError unused97) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.PURALOCAL_BETA.ordinal()] = 98;
            } catch (NoSuchFieldError unused98) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MMTV_LIVE.ordinal()] = 99;
            } catch (NoSuchFieldError unused99) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MMTV_UAT.ordinal()] = 100;
            } catch (NoSuchFieldError unused100) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MMTV_BETA.ordinal()] = 101;
            } catch (NoSuchFieldError unused101) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.ARHA_BETA.ordinal()] = 102;
            } catch (NoSuchFieldError unused102) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.ARHA_LIVE.ordinal()] = 103;
            } catch (NoSuchFieldError unused103) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.ARHA_MIGRATION.ordinal()] = 104;
            } catch (NoSuchFieldError unused104) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VODAFONE_FIJI_UAT.ordinal()] = 105;
            } catch (NoSuchFieldError unused105) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VODAFONE_FIJI_LIVE.ordinal()] = 106;
            } catch (NoSuchFieldError unused106) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VODAFONE_FIJI_BETA.ordinal()] = 107;
            } catch (NoSuchFieldError unused107) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.NEWS9PLUS_LIVE.ordinal()] = 108;
            } catch (NoSuchFieldError unused108) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.NEWS9PLUS_BETA.ordinal()] = 109;
            } catch (NoSuchFieldError unused109) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CHAUPAL_BETA.ordinal()] = 110;
            } catch (NoSuchFieldError unused110) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CHAUPAL_LIVE.ordinal()] = 111;
            } catch (NoSuchFieldError unused111) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CHAUPAL_MIGRATION.ordinal()] = 112;
            } catch (NoSuchFieldError unused112) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.STARHUB_BETA.ordinal()] = 113;
            } catch (NoSuchFieldError unused113) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.BHAVANI_MEDIA_LIVE.ordinal()] = 114;
            } catch (NoSuchFieldError unused114) {
            }
            try {
                $SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.BHAVANI_MEDIA_BETA.ordinal()] = 115;
            } catch (NoSuchFieldError unused115) {
            }
        }
    }

    public interface OttSDKCallback<T> {
        void onFailure(Error error);

        void onProgressChanged(double d7);

        void onSuccess(T t6);
    }

    private OttSDK(Context context, final String str, final TenantBuildType tenantBuildType, String str2, final OttSDKCallback ottSDKCallback, final boolean z6) {
        this.isLiteSdk = false;
        this.mContext = context;
        this.appVersionName = str2;
        if (str != null && str.trim().length() > 0) {
            try {
                this.deviceID = Integer.parseInt(str);
            } catch (NumberFormatException unused) {
            }
        }
        PreferenceManagerImp preferenceManagerImp = new PreferenceManagerImp(this.mContext, str, getAppVersionName());
        this.preferenceManager = preferenceManagerImp;
        this.mediaCatalogManager = new MediaCatalogManagerImpl(this.mContext, preferenceManagerImp);
        this.userManager = new UserManagerImpl(this.mContext, this.preferenceManager);
        this.statusManager = new StatusManagerImp(this.mContext, this.preferenceManager);
        this.paymentManager = new PaymentManagerImpl(this.mContext, this.preferenceManager);
        this.appManager = new AppManagerImp(this.mContext, this.preferenceManager);
        this.tenantBuildType = tenantBuildType;
        this.isLiteSdk = z6;
        setDisplayLanguage(tenantBuildType, context);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                ottSDKCallback.onProgressChanged(10.0d);
                if (OttSDK.this.mContext == null || ValidatorUtils.hasInternet(OttSDK.this.mContext)) {
                    OttSDK.this.appManager.getInitialInfo(OttSDK.this.getInitBaseUrl(tenantBuildType), new AppManager.AppManagerCallback<k>() {
                        public void onFailure(Error error) {
                            String str3;
                            String str4;
                            if (tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_BETA.getValue()) || tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_BETA2.getValue()) || tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_UAT.getValue()) || tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_LIVE.getValue())) {
                                OttSDKCallback ottSDKCallback2 = ottSDKCallback;
                                if (OttSDK.this.mContext != null) {
                                    str3 = OttSDK.this.mContext.getResources().getString(R.string.error_initial_data_failed1);
                                } else {
                                    str3 = "" + error.getMessage();
                                }
                                ottSDKCallback2.onFailure(new Error(0, str3));
                                return;
                            }
                            OttSDKCallback ottSDKCallback3 = ottSDKCallback;
                            if (OttSDK.this.mContext != null) {
                                str4 = OttSDK.this.mContext.getResources().getString(R.string.error_initial_data_failed);
                            } else {
                                str4 = "" + error.getMessage();
                            }
                            ottSDKCallback3.onFailure(new Error(0, str4));
                        }

                        public void onSuccess(k kVar) {
                            if (kVar == null || !(OttSDK.this.getPreferenceManager().getAppInitialData() == null || OttSDK.this.getPreferenceManager().getAppInitialData().getIsSupported().booleanValue())) {
                                ottSDKCallback.onFailure(new Error(0, OttSDK.this.mContext != null ? OttSDK.this.mContext.getResources().getString(R.string.error_notsupported) : ""));
                                return;
                            }
                            OttSDK.this.getPreferenceManager().setLocationInfo("");
                            AnonymousClass1 anonymousClass1 = AnonymousClass1.this;
                            OttSDK.this.getLocationInfo(ottSDKCallback);
                            AnonymousClass1 anonymousClass12 = AnonymousClass1.this;
                            CipherUtils.setValues(tenantBuildType, str);
                            String sessionId = OttSDK.this.getPreferenceManager().getSessionId();
                            if (z6) {
                                sessionId = "";
                            }
                            if (sessionId != null && !sessionId.isEmpty()) {
                                OttSDK.sInstance = OttSDK.this;
                                OttLog.error(OttSDK.TAG, "session available");
                                ottSDKCallback.onProgressChanged(70.0d);
                                AnonymousClass1 anonymousClass13 = AnonymousClass1.this;
                                OttSDK.this.fetchConfigurationData(ottSDKCallback, tenantBuildType);
                                return;
                            }
                            OttSDK.this.getPreferenceManager().setLiteSdkTenantCode("");
                            OttSDK.this.getPreferenceManager().setLiteSdkBoxid("");
                            TenantBuildType tenantBuildType2 = tenantBuildType;
                            if (tenantBuildType2 == null) {
                                OttLog.error(OttSDK.TAG, "session empty (Tenant Buildtype is Null) ");
                                ottSDKCallback.onProgressChanged(40.0d);
                                AnonymousClass1 anonymousClass14 = AnonymousClass1.this;
                                if (z6) {
                                    OttSDK.this.generateLiteSdkSession(ottSDKCallback);
                                } else {
                                    OttSDK.this.generateSession(ottSDKCallback);
                                    return;
                                }
                            }
                            switch (AnonymousClass9.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType2.ordinal()]) {
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                    OttLog.error(OttSDK.TAG, "session empty (Teleup Client) ");
                                    break;
                                default:
                                    OttLog.error(OttSDK.TAG, "session empty (Non Teleup Client) ");
                                    ottSDKCallback.onProgressChanged(40.0d);
                                    AnonymousClass1 anonymousClass15 = AnonymousClass1.this;
                                    if (!z6) {
                                        OttSDK.this.generateSession(ottSDKCallback);
                                        break;
                                    } else {
                                        OttSDK.this.generateLiteSdkSession(ottSDKCallback);
                                        break;
                                    }
                            }
                        }
                    });
                    return;
                }
                Error error = new Error();
                error.setCode(1);
                error.setMessage(OttSDK.this.mContext.getResources().getString(R.string.error_checkinternet));
                ottSDKCallback.onFailure(error);
            }
        }, 10L);
    }

    private void createAllObjects(Context context, String str, TenantBuildType tenantBuildType, String str2) {
        this.mContext = context;
        this.tenantBuildType = tenantBuildType;
        this.deviceID = Integer.parseInt(str);
        PreferenceManagerImp preferenceManagerImp = new PreferenceManagerImp(this.mContext, str, str2);
        this.preferenceManager = preferenceManagerImp;
        this.mediaCatalogManager = new MediaCatalogManagerImpl(this.mContext, preferenceManagerImp);
        this.userManager = new UserManagerImpl(this.mContext, this.preferenceManager);
        this.statusManager = new StatusManagerImp(this.mContext, this.preferenceManager);
        this.paymentManager = new PaymentManagerImpl(this.mContext, this.preferenceManager);
        this.appManager = new AppManagerImp(this.mContext, this.preferenceManager);
        sInstance = this;
    }

    public void fetchConfigurationData(final OttSDKCallback ottSDKCallback, final TenantBuildType tenantBuildType) {
        this.appManager.getConfigurationData(tenantBuildType, new AppManager.AppManagerCallback<JSONObject>() {
            public void onFailure(Error error) {
                ottSDKCallback.onFailure(new Error(-111, OttSDK.this.mContext != null ? OttSDK.this.mContext.getResources().getString(R.string.error_config_fetch_failed) : ""));
            }

            public void onSuccess(JSONObject jSONObject) {
                OttSDK.sInstance = OttSDK.this;
                TenantBuildType tenantBuildType2 = tenantBuildType;
                if (tenantBuildType2 == null) {
                    OttLog.error("yupptv session", "available+++++++");
                    ottSDKCallback.onProgressChanged(100.0d);
                    ottSDKCallback.onSuccess("OttSDK is initialised successfully");
                }
                switch (AnonymousClass9.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType2.ordinal()]) {
                    case 11:
                    case 12:
                    case 13:
                    case 14:
                        OttLog.error("yupptv session", "available+++++++");
                        ottSDKCallback.onProgressChanged(100.0d);
                        ottSDKCallback.onSuccess("OttSDK is initialised successfully");
                        break;
                    default:
                        OttLog.error(OttSDK.TAG, "getting system features after config... ");
                        ottSDKCallback.onProgressChanged(85.0d);
                        OttSDK.this.fetchSystemFeaturesData(ottSDKCallback);
                        break;
                }
            }
        });
    }

    public void fetchSystemFeaturesData(final OttSDKCallback ottSDKCallback) {
        this.appManager.getSystemFeatures((String) null, new AppManager.AppManagerCallback<JSONObject>() {
            public void onFailure(Error error) {
                ottSDKCallback.onProgressChanged(100.0d);
                ottSDKCallback.onSuccess("OttSDK is initialised successfully");
            }

            public void onSuccess(JSONObject jSONObject) {
                OttLog.error("yupptv session", "available+++++++");
                ottSDKCallback.onProgressChanged(100.0d);
                ottSDKCallback.onSuccess("OttSDK is initialised successfully");
            }
        });
    }

    public void generateLiteSdkSession(final OttSDKCallback ottSDKCallback) {
        this.statusManager.generateLiteSdkSession(liteSdkVendorCode, liteSdkToken, new StatusManager.StatusCallback<SessionInfo>() {
            public void onFailure(Error error) {
                String str;
                OttLog.error("failure", "generate session " + error.toString());
                OttSDKCallback ottSDKCallback2 = ottSDKCallback;
                if (OttSDK.this.mContext != null) {
                    str = OttSDK.this.mContext.getResources().getString(R.string.error_generate_session_failed);
                } else {
                    str = "" + error.getMessage();
                }
                ottSDKCallback2.onFailure(new Error(0, str));
            }

            public void onSuccess(SessionInfo sessionInfo) {
                OttSDK.sInstance = OttSDK.this;
                OttLog.error("Generate session  ", "init session Id :" + sessionInfo.getSession().getSessionId());
                ottSDKCallback.onProgressChanged(70.0d);
                OttSDK ottSDK = OttSDK.this;
                ottSDK.fetchConfigurationData(ottSDKCallback, ottSDK.tenantBuildType);
            }
        });
    }

    public void generateSession(final OttSDKCallback ottSDKCallback) {
        this.statusManager.generateSession(new StatusManager.StatusCallback<SessionInfo>() {
            public void onFailure(Error error) {
                String str;
                OttLog.error("failure", "generate session " + error.toString());
                OttSDKCallback ottSDKCallback2 = ottSDKCallback;
                if (OttSDK.this.mContext != null) {
                    str = OttSDK.this.mContext.getResources().getString(R.string.error_generate_session_failed);
                } else {
                    str = "" + error.getMessage();
                }
                ottSDKCallback2.onFailure(new Error(0, str));
            }

            public void onSuccess(SessionInfo sessionInfo) {
                OttSDK.sInstance = OttSDK.this;
                OttLog.error("Generate session  ", "init session Id :" + sessionInfo.getSession().getSessionId());
                ottSDKCallback.onProgressChanged(70.0d);
                OttSDK ottSDK = OttSDK.this;
                ottSDK.fetchConfigurationData(ottSDKCallback, ottSDK.tenantBuildType);
            }
        });
    }

    private String getClientType() {
        PreferenceManager preferenceManager = this.preferenceManager;
        if (preferenceManager == null) {
            return "android";
        }
        int yuppDeviceId = preferenceManager.getYuppDeviceId();
        return yuppDeviceId != 40 ? yuppDeviceId != 43 ? yuppDeviceId != 47 ? yuppDeviceId != 57 ? yuppDeviceId != 74 ? yuppDeviceId != 76 ? yuppDeviceId != 78 ? yuppDeviceId != 85 ? yuppDeviceId != 87 ? yuppDeviceId != 91 ? "android" : "whale_os" : "cloud_tv_os" : "IHU" : "JioAndroidTV" : "APFiber" : "Humax" : "ScopeInternational" : "stbbox" : "AndroidTV" : "FireTV";
    }

    public static OttSDK getInstance() {
        if (sInstance == null) {
            OttLog.error(TAG, "No OttSDK instance was found, did you forget to initialize it?");
        }
        return sInstance;
    }

    public void getLocationInfo(final OttSDKCallback ottSDKCallback) {
        this.preferenceManager.setLocationInfo("");
        RestAdapter.enableCache(false);
        this.appManager.getLocationInfo(this.preferenceManager.getTenantCode(), this.preferenceManager.getProductCode(), getClientType(), new AppManager.AppManagerCallback<LocationInfo>() {
            public void onFailure(Error error) {
            }

            public void onSuccess(LocationInfo locationInfo) {
                String sessionId = OttSDK.this.getPreferenceManager().getSessionId();
                if (sessionId == null || sessionId.isEmpty()) {
                    if (OttSDK.this.tenantBuildType == null) {
                        OttLog.error(OttSDK.TAG, "Tenant build type null after Location Info ");
                    }
                    switch (AnonymousClass9.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[OttSDK.this.tenantBuildType.ordinal()]) {
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                        case 6:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                            OttLog.error(OttSDK.TAG, "getting session after Location Info (TeleUP client) ");
                            ottSDKCallback.onProgressChanged(40.0d);
                            OttSDK.this.generateSession(ottSDKCallback);
                            break;
                        default:
                            OttLog.error(OttSDK.TAG, "get session after Location Info (Non TeleUP client) ");
                            break;
                    }
                }
            }
        });
    }

    public static OttSDK getNewInstance(Context context, Device device, OttSDKCallback<String> ottSDKCallback) {
        if (sInstance == null) {
            sInstance = new OttSDK(context, device.getValue());
        }
        return sInstance;
    }

    public static void init(Context context, Device device, String str, TenantBuildType tenantBuildType, OttSDKCallback<String> ottSDKCallback) {
        if (sInstance == null) {
            sInstance = new OttSDK(context, device.getValue(), tenantBuildType, str, ottSDKCallback, false);
            initialized = true;
        }
    }

    public static void initLiteSdk(Context context, Device device, String str, String str2, TenantBuildType tenantBuildType, String str3, OttSDKCallback<String> ottSDKCallback) {
        if (str != null) {
            liteSdkToken = str;
        }
        if (str2 != null) {
            liteSdkVendorCode = str2;
        }
        if (sInstance != null) {
            sInstance = null;
        }
        if (sInstance == null) {
            sInstance = new OttSDK(context, device.getValue(), tenantBuildType, str3, ottSDKCallback, true);
            initialized = true;
        }
    }

    public static void log(String str, String str2) {
        if (debugEnabled) {
            OttLog.error(str, str2);
        }
    }

    public static void releaseInstance() {
        if (sInstance != null) {
            sInstance = null;
            initialized = false;
            debugEnabled = false;
        }
    }

    public static void setBrandName(String str, Context context) {
        brandName = str;
        PreferencesUtils.putBoolean(context, PreferencesUtils.SDK_PREFERENCE_NAME, Constants.BRAND_NAME, false);
    }

    private void setDisplayLanguage(TenantBuildType tenantBuildType, Context context) {
        if (tenantBuildType == null || context == null) {
            return;
        }
        int i7 = AnonymousClass9.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType.ordinal()];
        if (i7 == 1 || i7 == 2 || i7 == 3 || i7 == 4) {
            PreferenceManager preferenceManager = this.preferenceManager;
            if (preferenceManager == null || preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()) == null || this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).trim().length() <= 1) {
                setLocalePortuguese(context);
                return;
            } else if (this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).equalsIgnoreCase("pot")) {
                setLocalePortuguese(context);
                return;
            } else {
                setLocaleEnglish(context);
                return;
            }
        }
        if (i7 != 91 && i7 != 92) {
            switch (i7) {
                case 34:
                case 35:
                case 36:
                    PreferenceManager preferenceManager2 = this.preferenceManager;
                    if (preferenceManager2 == null || preferenceManager2.getDisplayLanguage(getDefaultDisplayLanguage()) == null || this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).trim().length() <= 1) {
                        setLocaleFrench(context);
                        return;
                    } else if (this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).equalsIgnoreCase("Fre")) {
                        setLocaleFrench(context);
                        return;
                    } else {
                        setLocaleEnglish(context);
                        return;
                    }
                default:
                    switch (i7) {
                        case 79:
                        case 80:
                        case 81:
                        case 82:
                            break;
                        default:
                            switch (i7) {
                            }
                            return;
                    }
            }
        }
        String str = displayLocale;
        if (str == null || str.trim().length() <= 0) {
            setLocaleEnglish(context);
            return;
        }
        if (displayLocale.equalsIgnoreCase("TEL")) {
            setLocaleTelugu(context);
            return;
        }
        if (displayLocale.equalsIgnoreCase("TAM")) {
            setLocaleTamil(context);
            return;
        }
        if (displayLocale.equalsIgnoreCase("HIN")) {
            setLocaleHindi(context);
            return;
        }
        if (displayLocale.equalsIgnoreCase("BEN")) {
            setLocaleBengali(context);
        } else if (displayLocale.equalsIgnoreCase("FRE")) {
            setLocaleFrench(context);
        } else {
            setLocaleEnglish(context);
        }
    }

    public static void setIsPlayStoreBuild(boolean z6, Context context) {
        isPlayStoreBuild = z6;
        PreferencesUtils.putBoolean(context, PreferencesUtils.SDK_PREFERENCE_NAME, Constants.IS_PLAY_STORE_BUILD, true);
    }

    public static void setLocaleEnglish(Context context) {
        Locale locale = new Locale("en_US");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        context.getApplicationContext().getResources().updateConfiguration(configuration, null);
    }

    public static void setLocaleFrench(Context context) {
        Locale locale = new Locale("fr", "SN");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        context.getApplicationContext().getResources().updateConfiguration(configuration, null);
    }

    public static void setLocalePortuguese(Context context) {
        Locale locale = new Locale("pt", "BR");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        context.getApplicationContext().getResources().updateConfiguration(configuration, null);
    }

    public static void setLogEnabled(boolean z6, Context context) {
        debugEnabled = z6;
        PreferencesUtils.putBoolean(context, PreferencesUtils.SDK_PREFERENCE_NAME, Constants.IS_DEBUG_ENABLED, false);
    }

    private void showMenus(List<Menu> list) {
        if (list == null) {
            OttLog.error(TAG, "Menus list is null");
            return;
        }
        for (int i7 = 0; i7 < list.size(); i7++) {
            OttLog.error(TAG, "Menus : " + list.get(i7).getDisplayText() + "\n");
        }
    }

    private void showResourceProfiles(List<ResourceProfile> list) {
        if (list == null) {
            OttLog.error(TAG, "Resource prodile list is null");
            return;
        }
        for (int i7 = 0; i7 < list.size(); i7++) {
            OttLog.error(TAG, "Resource profiles : " + list.get(i7).getUrlPrefix() + "\n");
        }
    }

    private void signin() {
        this.userManager.login("krishna", "krishna", new UserManager.UserCallback<User>() {
            public void onFailure(Error error) {
            }

            public void onSuccess(User user) {
                OttLog.error(OttSDK.TAG, "User response" + user.getMessage());
            }
        });
    }

    public void cancelAllRequests() {
        Context context = this.mContext;
        if (context == null || RestAdapter.getInstance(context) == null) {
            return;
        }
        RestAdapter.getInstance(this.mContext).cancelAll();
    }

    public void generateNewSession(final OttSDKCallback ottSDKCallback) {
        this.statusManager.generateSession(new StatusManager.StatusCallback<SessionInfo>() {
            public void onFailure(Error error) {
                String str;
                OttLog.error("failure", "generate new session " + error.toString());
                OttSDKCallback ottSDKCallback2 = ottSDKCallback;
                if (OttSDK.this.mContext != null) {
                    str = OttSDK.this.mContext.getResources().getString(R.string.error_generate_session_failed);
                } else {
                    str = "" + error.getMessage();
                }
                ottSDKCallback2.onFailure(new Error(0, str));
            }

            public void onSuccess(SessionInfo sessionInfo) {
                OttSDK.sInstance = OttSDK.this;
                OttLog.error("Generate New session  ", "init session Id :" + sessionInfo.getSession().getSessionId());
                ottSDKCallback.onSuccess("New Session Generated ");
            }
        });
    }

    public String getAppVersionName() {
        PreferenceManager preferenceManager;
        if (this.appVersionName == null && (preferenceManager = this.preferenceManager) != null) {
            this.appVersionName = preferenceManager.getAppVersionName();
        }
        return this.appVersionName;
    }

    public AppManager getApplicationManager() {
        return this.appManager;
    }

    public String getDefaultDisplayLanguage() {
        try {
            TenantBuildType tenantBuildType = this.tenantBuildType;
            if (tenantBuildType == null) {
                return "eng";
            }
            int i7 = AnonymousClass9.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType.ordinal()];
            if (i7 == 2 || i7 == 3 || i7 == 4) {
                return "pot";
            }
            switch (i7) {
            }
            return "eng";
        } catch (Exception unused) {
            return "eng";
        }
    }

    public int getDeviceID() {
        PreferenceManager preferenceManager;
        if (this.deviceID == 0 && (preferenceManager = this.preferenceManager) != null) {
            this.deviceID = preferenceManager.getYuppDeviceId();
        }
        return this.deviceID;
    }

    public String getInitBaseUrl(TenantBuildType tenantBuildType) {
        switch (AnonymousClass9.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType.ordinal()]) {
            case 1:
                return "https://paas-init.revlet.net/clients/teleupbrazil/init/test/teleupbrazil-beta.json";
            case 2:
                return "https://paas-init.revlet.net/clients/viewlist/init/teleupbrazil-v1.json";
            case 3:
                return "https://paas-init.revlet.net/clients/teleup/init/uat/teleupbrazil.json";
            case 4:
                return "https://paas-init.revlet.net/clients/teleup/init/test/init.json";
            case 5:
                return "https://paas-init.revlet.net/clients/viewlist/init/test/viewlist-beta76.json";
            case 6:
                return "https://paas-init.revlet.net/clients/viewlist/init/teleup-v1.json";
            case 7:
                return "https://paas-init.revlet.net/clients/teleup/init/uat/teleup.json";
            case 8:
                return "https://paas-init.revlet.net/clients/ustvnow/init/test/ustvnow-beta.json";
            case 9:
                return "https://paas-init.revlet.net/clients/viewlist/init/ustvnow-v1.json";
            case 10:
                return "https://paas-init.revlet.net/clients/teleup/init/uat/ustvnow.json";
            case 11:
                return "https://paas-init.revlet.net/clients/frndlytv/init/test/frndlytv-beta.json";
            case 12:
                return "http://paas-init.revlet.net/clients/frndlytv/init/test/frndlytv-beta2.json";
            case 13:
                return "https://paas-init.revlet.net/clients/frndlytv/init/live/frndlytv-live-v2.json";
            case 14:
                return "https://paas-init.revlet.net/clients/frndlytv/init/uat/frndlytv-uat-v2.json";
            case 15:
                return "https://paas-init.revlet.net/clients/tsat/init/tsat-v1.json";
            case 16:
                return "https://paas.globaltakeoff.net/clients/beta1/manatv/init/manatv-v2.json";
            case 17:
                return "https://paas.globaltakeoff.net/clients/beta1/manatv/init/tsat_dev.json";
            case 18:
                return "https://paas.globaltakeoff.net/clients/beta1/manatv/init/tsat_deploy.json";
            case 19:
                return "https://paas-init.globaltakeoff.net/clients/viusasa/init/viusasa-v1.json";
            case 20:
                return "http://paas.globaltakeoff.net/clients/beta1/royalmedia/init/viusasa_deploy.json";
            case 21:
                return "https://paas-init.revlet.net/clients/royalmedia/init/royalmedia-beta.json";
            case 22:
                return "https://paas-init.globaltakeoff.net/clients/uat/init/uat-viusasa-v1.json";
            case 23:
                return "https://paas-init.revlet.net/clients/aastha/init/aastha-v1.json";
            case 24:
            case 25:
                return "https://paas-init.revlet.net/clients/aastha/init/aastha_fusion.json";
            case 26:
                return "https://paas-init.revlet.net/clients/aastha/init/test/aastha-master.json";
            case 27:
                return "https://paas-init.revlet.net/clients/teleup/init/test/military-init.json";
            case 28:
                return "https://paas-init.revlet.net/clients/teleupbrazil/init/test/teleupbrazil-beta.json";
            case 29:
                return "https://paas.globaltakeoff.net/clients/beta1/sevenstar/init/sevenstar-beta.json";
            case 30:
                return "https://paas-init.revlet.net/clients/sevenstar/init/sevenstar-v1.json";
            case 31:
            case 32:
                return "https://paas.globaltakeoff.net/clients/beta1/dialog/init/dialog-demo.json";
            case 33:
                return "https://paas-init.revlet.net/clients/fusion/init/fusion-waasa.json";
            case 34:
                return "https://wassa-init.yuppcdn.net/clients/lynktelecom/init/lynktelecom.json";
            case 35:
            case 36:
                return "https://paas-init.revlet.net/clients/lynktelecom/init/test/lynktelecom.json";
            case 37:
                return "https://paas-init.revlet.net/clients/cinesoftmedia/init/cinesoftmedia.json";
            case 38:
            case 39:
                return "https://paas-init.revlet.net/clients/cinesoftmedia/init/test/cinesoftmedia.json";
            case 40:
                return "https://paas-init.revlet.net/clients/teleup/init/test/ustv-init.json";
            case 41:
                return "http://paas-init.revlet.net/clients/mobitel/init/test/mobitel-beta.json";
            case 42:
                return "http://paas-init.revlet.net/clients/mobitel/init/uat/mobitel-uat.json";
            case 43:
                return "http://paas-init.revlet.net/clients/mobitel/init/live/mobitel-live.json";
            case 44:
                return "https://paas-init.revlet.net/clients/fusion/init/fusion-mobitel.json";
            case 45:
                return "https://paas-init.revlet.net/clients/bsnl/init/test/bsnl.json";
            case 46:
                return "https://paas-init.revlet.net/clients/bsnl/init/live/bsnl.json";
            case 47:
                return "https://paas-init.revlet.net/clients/airtelsl/init/test/airtelsl-test.json";
            case 48:
                return "https://paas-init.revlet.net/clients/airtelsl/init/live/airtelsl.json";
            case 49:
                return "https://paas-init.revlet.net/clients/airtelsl/init/test/airtelsl-test.json";
            case 50:
                return "https://paas-init.revlet.net/clients/yuppeducation/init/test/yuppeducation-test.json";
            case 51:
                return "https://paas-init.revlet.net/clients/yuppeducation/init/live/yuppeducation.json";
            case 52:
                return "https://paas-init.revlet.net/clients/reeldrama/init/test/reeldrama.json";
            case 53:
                return "https://paas-init.revlet.net/clients/reeldrama/init/test/reeldrama2.json";
            case 54:
                return "https://paas-init.revlet.net/clients/reeldrama/init/live/reeldrama.json";
            case 55:
                return "https://paas-init.revlet.net/clients/fusion/init/fusion-reeldrama.json";
            case 56:
                return "https://paas-init.revlet.net/clients/firstshows/init/live/firstshows.json";
            case 57:
                return "https://paas-init.revlet.net/clients/firstshows/init/test/firstshows.json";
            case 58:
                return "https://paas-init.revlet.net/clients/fusion/init/fusion-firstshows.json";
            case 59:
                return "https://paas-init.revlet.net/clients/tsat/init/tsat_fusion.json";
            case 60:
                return "https://paas-init.revlet.net/clients/fusion/init/fusion-aastha.json";
            case 61:
                return "https://paas-init.revlet.net/clients/gotv/init/live/gotv.json";
            case 62:
            case 63:
            case 64:
                return "https://paas-init.revlet.net/clients/gotv/init/uat/gotv.json";
            case 65:
                return "https://paas-init.revlet.net/clients/levelnews/init/live/levelnews.json";
            case 66:
            case 67:
            case 68:
                return "https://paas-init.revlet.net/clients/levelnews/init/uat/levelnews.json";
            case 69:
                return "https://paas-init.revlet.net/clients/yvs/init/live/yvs.json";
            case 70:
                return " https://paas-init.revlet.net/clients/yvs/init/test/yvs-fusion.json";
            case 71:
                return "https://paas-init.revlet.net/clients/slt/live/slt-live.json";
            case 72:
            case 73:
                return "https://paas-init.revlet.net/clients/fusion/init/fusion-mobitel.json";
            case 74:
                return "https://paas-init.revlet.net/clients/fusion/init/fusion-slt.json";
            case 75:
                return "https://paas-init.revlet.net/clients/gacmedia/live/gacmedia.json";
            case 76:
                return "https://paas-init.revlet.net/clients/gacmedia/uat/gacmedia-uat.json";
            case 77:
                return "https://paas-init.revlet.net/clients/gacmedia/beta/gacmedia-beta.json";
            case 78:
                return "https://paas-init.revlet.net/clients/janya/init/live/janya.json";
            case 79:
                return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/live/dishtv.json";
            case 80:
                return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/uat/dishtv.json";
            case 81:
                return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/preprod/dishtv.json";
            case 82:
                return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/test/dishtv.json";
            case 83:
                return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/test/dishtv2.json";
            case 84:
                return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/uat/dishtv2.json";
            case 85:
                return "https://d31u2qcarfbblp.cloudfront.net/mytv/init/test/mytv.json";
            case 86:
                return "https://d31u2qcarfbblp.cloudfront.net/mytv/init/live/mytv.json";
            case 87:
                return "https://paas-init.revlet.net/clients/timesnow/init/test/timesnow-test.json";
            case 88:
                return "https://paas-init.revlet.net/clients/timesnow/init/live/timesplay.json";
            case 89:
                return "https://paas-init.revlet.net/clients/timesnow/init/test/herogotv-test.json";
            case 90:
                return "https://paas-init.revlet.net/clients/herogotv/init/live/herogotv.json";
            case 91:
                return "https://paas-init.revlet.net/clients/yuppfree/init/live/yuppfast.json";
            case 92:
                return "https://paas-init.revlet.net/clients/timesnow/init/test/yuppfast-test.json";
            case 93:
                return "https://paas-init.revlet.net/clients/vesta/init/live/vesta.json";
            case 94:
                return "https://paas-init.revlet.net/clients/vesta/init/test/vesta-test.json";
            case 95:
                return "https://paas-init.revlet.net/clients/orkatv/init/test/orkatv.json";
            case 96:
                return "https://paas-init.revlet.net/clients/orkatv/init/live/orkatv.json";
            case 97:
                return "https://paas-init.revlet.net/clients/janya/init/live/puralocal.json";
            case 98:
                return "https://paas-init.revlet.net/clients/janya/init/test/puralocal-test.json";
            case 99:
                return "https://d323opiebffk8l.cloudfront.net/prod/mmtvmax.json";
            case 100:
                return "https://paas-init.revlet.net/clients/manoramamax/init/test/manoramamax-test.json";
            case 101:
                return "https://paas-init.revlet.net/clients/gacmedia/beta/mmtv-beta.json";
            case 102:
                return "https://paas-init.revlet.net/clients/arha/init/test/arha-test.json";
            case 103:
                return "https://d2rk2j33tli0ne.cloudfront.net/prod/arha.json";
            case 104:
                return "https://d2rk2j33tli0ne.cloudfront.net/prod/arha_migration.json";
            case 105:
                return "https://d323opiebffk8l.cloudfront.net/vodafonefiji/stag/vodafonefiji.json";
            case 106:
                return "https://d2z1vz35oflhrf.cloudfront.net/prod/vodaplay.json";
            case 107:
                return "https://d2z1vz35oflhrf.cloudfront.net/stag/vodaplay.json";
            case 108:
                return "https://d2rk2j33tli0ne.cloudfront.net/prod/news9plus-prod.json";
            case 109:
                return "https://d2rk2j33tli0ne.cloudfront.net/beta/news9plus-beta.json";
            case 110:
                return "https://paas-init.revlet.net/clients/chaupal/test/chaupal-beta.json";
            case 111:
                return "https://paas-init.revlet.net/clients/chaupal/live/chaupal.json";
            case 112:
                return "https://paas-init.revlet.net/clients/chaupal/beta-mig/chaupal-migration.json";
            case 113:
                return "https://paas-init.revlet.net/clients/starhub/init/stag/starhub-init.json";
            case 114:
                return "https://d18et6aw9b1gbe.cloudfront.net/clients/prod/bhavanimedia-init.json";
            case 115:
                return "https://d2rk2j33tli0ne.cloudfront.net/beta/bhavanimedia-beta.json";
            default:
                return "";
        }
    }

    public MediaCatalogManager getMediaManager() {
        return this.mediaCatalogManager;
    }

    public PaymentManager getPaymentManager() {
        return this.paymentManager;
    }

    public PreferenceManager getPreferenceManager() {
        return this.preferenceManager;
    }

    public StatusManager getStatusManager() {
        return this.statusManager;
    }

    public TenantBuildType getTenantBuildType() {
        return this.tenantBuildType;
    }

    public String getTimeZone() {
        if (TimeZone.getDefault() != null) {
            TimeZone timeZone = TimeZone.getDefault();
            OttLog.error(TAG, "TimeZone from default : " + timeZone.getID());
            return timeZone.getID();
        }
        PreferenceManager preferenceManager = this.preferenceManager;
        if (preferenceManager == null || preferenceManager.getIpInfo() == null || this.preferenceManager.getIpInfo().getTimezone() == null) {
            return null;
        }
        OttLog.error(TAG, "TimeZone from Location : " + this.preferenceManager.getIpInfo().getTimezone());
        return this.preferenceManager.getIpInfo().getTimezone();
    }

    public UserManager getUserManager() {
        return this.userManager;
    }

    public void setLocaleBengali(Context context) {
        Locale locale = new Locale("ba");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        context.getApplicationContext().getResources().updateConfiguration(configuration, null);
    }

    public void setLocaleHindi(Context context) {
        Locale locale = new Locale("hi");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        context.getApplicationContext().getResources().updateConfiguration(configuration, null);
    }

    public void setLocaleTamil(Context context) {
        Locale locale = new Locale("ta", "IN");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        context.getApplicationContext().getResources().updateConfiguration(configuration, null);
    }

    public void setLocaleTelugu(Context context) {
        Locale locale = new Locale("te");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        context.getApplicationContext().getResources().updateConfiguration(configuration, null);
    }

    public void setPaymentManager(PaymentManager paymentManager) {
        this.paymentManager = paymentManager;
    }

    public void setTrueClientIP(String str) {
        Context context = this.mContext;
        if (context == null || RestAdapter.getInstance(context) == null || str == null || str.trim().length() <= 3) {
            return;
        }
        RestAdapter.getInstance(this.mContext).setTrueClientIP(str);
    }

    public static void setLogEnabled(boolean z6) {
        debugEnabled = z6;
    }

    public static OttSDK getNewInstance(Context context, Device device) {
        if (sInstance == null) {
            sInstance = new OttSDK(context, device.getValue());
        }
        return sInstance;
    }

    public static void init(Context context, Device device, TenantBuildType tenantBuildType, String str, String str2, OttSDKCallback<String> ottSDKCallback) {
        if (sInstance == null) {
            if (str2 != null && str2.trim().length() > 0) {
                displayLocale = str2;
            }
            sInstance = new OttSDK(context, device.getValue(), tenantBuildType, str, ottSDKCallback, false);
            initialized = true;
        }
    }

    public static OttSDK getNewInstance(Context context, Device device, TenantBuildType tenantBuildType) {
        if (sInstance == null) {
            sInstance = new OttSDK(context, device.getValue(), tenantBuildType);
        }
        return sInstance;
    }

    private OttSDK(Context context, String str) {
        this.isLiteSdk = false;
        this.mContext = context;
        PreferenceManagerImp preferenceManagerImp = new PreferenceManagerImp(context, str, getAppVersionName());
        this.preferenceManager = preferenceManagerImp;
        this.mediaCatalogManager = new MediaCatalogManagerImpl(this.mContext, preferenceManagerImp);
        this.userManager = new UserManagerImpl(this.mContext, this.preferenceManager);
        this.statusManager = new StatusManagerImp(this.mContext, this.preferenceManager);
        this.paymentManager = new PaymentManagerImpl(this.mContext, this.preferenceManager);
        this.appManager = new AppManagerImp(this.mContext, this.preferenceManager);
        sInstance = this;
    }

    private OttSDK(Context context, String str, TenantBuildType tenantBuildType) {
        this.isLiteSdk = false;
        createAllObjects(context, str, tenantBuildType, getAppVersionName());
        PreferencesUtils.getBoolean(context, PreferencesUtils.SDK_PREFERENCE_NAME, Constants.IS_PLAY_STORE_BUILD, true);
        PreferencesUtils.getBoolean(context, PreferencesUtils.SDK_PREFERENCE_NAME, Constants.IS_DEBUG_ENABLED, false);
    }
}