正在查看: Vi App v10.18.0 应用的 OttSDK.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Vi App v10.18.0 应用的 OttSDK.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.yupptv.ottsdk;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Handler;
import com.google.gson.JsonObject;
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.managers.User.a;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.LocationInfo;
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.ValidatorUtils;
import in.juspay.hyper.constants.LogSubCategory;
import java.util.Locale;
import java.util.TimeZone;
import org.json.JSONObject;
public class OttSDK {
public static String brandName = null;
public static boolean chuckersEnabled = false;
public static boolean debugEnabled = false;
private static boolean initialized = false;
public static boolean isUserInfoEncrypted = false;
public static boolean locationInfoFailed = false;
public static OttSDK sInstance = null;
public static boolean sslPinningEnabled = false;
public static int ucvVersion;
private AppManager appManager;
private int deviceID;
private String deviceId;
private Context mContext;
private MediaCatalogManager mediaCatalogManager;
private PaymentManager paymentManager;
private PreferenceManager preferenceManager;
private StatusManager statusManager;
private TenantBuildType tenantBuildType;
private UserManager userManager;
public static class AnonymousClass10 {
public 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.FRNDLYTV_UAT2.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIMTV_BETA.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIMTV_FUSION.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIMTV_UAT.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIMTV_LIVE.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_LIVE.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_BETA.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_BETA_76.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_BETA_73.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_LIVE.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_BETA.ordinal()] = 25;
} catch (NoSuchFieldError unused25) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_MASTER.ordinal()] = 26;
} catch (NoSuchFieldError unused26) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIUSASA_UAT.ordinal()] = 27;
} catch (NoSuchFieldError unused27) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_LIVE.ordinal()] = 28;
} catch (NoSuchFieldError unused28) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_BETA.ordinal()] = 29;
} catch (NoSuchFieldError unused29) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_UAT.ordinal()] = 30;
} catch (NoSuchFieldError unused30) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_MASTER.ordinal()] = 31;
} catch (NoSuchFieldError unused31) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.VIEWLIST_FUSION.ordinal()] = 32;
} catch (NoSuchFieldError unused32) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TELEUP_BRAZIL_FUSION.ordinal()] = 33;
} catch (NoSuchFieldError unused33) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SEVENSTAR_BETA.ordinal()] = 34;
} catch (NoSuchFieldError unused34) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SEVENSTAR_LIVE.ordinal()] = 35;
} catch (NoSuchFieldError unused35) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DIALOG_BETA.ordinal()] = 36;
} catch (NoSuchFieldError unused36) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DIALOG_LIVE.ordinal()] = 37;
} catch (NoSuchFieldError unused37) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_FUSION.ordinal()] = 38;
} catch (NoSuchFieldError unused38) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_LIVE.ordinal()] = 39;
} catch (NoSuchFieldError unused39) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_BETA.ordinal()] = 40;
} catch (NoSuchFieldError unused40) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.LYNKTELECOM_UAT.ordinal()] = 41;
} catch (NoSuchFieldError unused41) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CINESOFTMEDIA_LIVE.ordinal()] = 42;
} catch (NoSuchFieldError unused42) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CINESOFTMEDIA_UAT.ordinal()] = 43;
} catch (NoSuchFieldError unused43) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.CINESOFTMEDIA_BETA.ordinal()] = 44;
} catch (NoSuchFieldError unused44) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.USTVNOW_FUSION.ordinal()] = 45;
} catch (NoSuchFieldError unused45) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_BETA.ordinal()] = 46;
} catch (NoSuchFieldError unused46) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_UAT.ordinal()] = 47;
} catch (NoSuchFieldError unused47) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_LIVE.ordinal()] = 48;
} catch (NoSuchFieldError unused48) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MOBITEL_FUSION.ordinal()] = 49;
} catch (NoSuchFieldError unused49) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.BSNL_BETA.ordinal()] = 50;
} catch (NoSuchFieldError unused50) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.BSNL_LIVE.ordinal()] = 51;
} catch (NoSuchFieldError unused51) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AIRTEL_LANKA_BETA.ordinal()] = 52;
} catch (NoSuchFieldError unused52) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AIRTEL_LANKA_LIVE.ordinal()] = 53;
} catch (NoSuchFieldError unused53) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AIRTEL_LANKA_FUSION.ordinal()] = 54;
} catch (NoSuchFieldError unused54) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.EDUCATIONAL_BETA.ordinal()] = 55;
} catch (NoSuchFieldError unused55) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.EDUCATIONAL_LIVE.ordinal()] = 56;
} catch (NoSuchFieldError unused56) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.REELDRAMA_BETA.ordinal()] = 57;
} catch (NoSuchFieldError unused57) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.REELDRAMA_LIVE.ordinal()] = 58;
} catch (NoSuchFieldError unused58) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.REELDRAMA_FUSION.ordinal()] = 59;
} catch (NoSuchFieldError unused59) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FIRSTSHOW_LIVE.ordinal()] = 60;
} catch (NoSuchFieldError unused60) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FIRSTSHOW_BETA.ordinal()] = 61;
} catch (NoSuchFieldError unused61) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.FIRSTSHOW_FUSION.ordinal()] = 62;
} catch (NoSuchFieldError unused62) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.TSAT_FUSION.ordinal()] = 63;
} catch (NoSuchFieldError unused63) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.AASTHA_FUSION.ordinal()] = 64;
} catch (NoSuchFieldError unused64) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_LIVE.ordinal()] = 65;
} catch (NoSuchFieldError unused65) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_FUSION.ordinal()] = 66;
} catch (NoSuchFieldError unused66) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_BETA.ordinal()] = 67;
} catch (NoSuchFieldError unused67) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GOTV_UAT.ordinal()] = 68;
} catch (NoSuchFieldError unused68) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_LIVE.ordinal()] = 69;
} catch (NoSuchFieldError unused69) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_FUSION.ordinal()] = 70;
} catch (NoSuchFieldError unused70) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_BETA.ordinal()] = 71;
} catch (NoSuchFieldError unused71) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SUPPOSETV_UAT.ordinal()] = 72;
} catch (NoSuchFieldError unused72) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.YVS_LIVE.ordinal()] = 73;
} catch (NoSuchFieldError unused73) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.YVS_FUSION.ordinal()] = 74;
} catch (NoSuchFieldError unused74) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_LIVE.ordinal()] = 75;
} catch (NoSuchFieldError unused75) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_BETA.ordinal()] = 76;
} catch (NoSuchFieldError unused76) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_UAT.ordinal()] = 77;
} catch (NoSuchFieldError unused77) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.SLT_FUSION.ordinal()] = 78;
} catch (NoSuchFieldError unused78) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GAC_LIVE.ordinal()] = 79;
} catch (NoSuchFieldError unused79) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GAC_UAT.ordinal()] = 80;
} catch (NoSuchFieldError unused80) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.GAC_BETA.ordinal()] = 81;
} catch (NoSuchFieldError unused81) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.JANYA_LIVE.ordinal()] = 82;
} catch (NoSuchFieldError unused82) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_LIVE.ordinal()] = 83;
} catch (NoSuchFieldError unused83) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_UAT.ordinal()] = 84;
} catch (NoSuchFieldError unused84) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_FUSION.ordinal()] = 85;
} catch (NoSuchFieldError unused85) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_BETA.ordinal()] = 86;
} catch (NoSuchFieldError unused86) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.DISH_UAT2.ordinal()] = 87;
} catch (NoSuchFieldError unused87) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MYTV_BETA.ordinal()] = 88;
} catch (NoSuchFieldError unused88) {
}
try {
$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[TenantBuildType.MYTV_LIVE.ordinal()] = 89;
} catch (NoSuchFieldError unused89) {
}
}
}
class AnonymousClass8 implements UserManager.UserCallback<User> {
@Override
public void onEmptySuccess() {
a.a(this);
}
@Override
public void onFailure(Error error) {
}
@Override
public void onSuccess(User user) {
OttLog.error("OTT SDK", "User response" + user.getMessage());
}
}
public interface OttSDKCallback<T> {
void onFailure(Error error);
void onProgressChanged(double d2);
void onSuccess(T t);
}
private OttSDK(Context context, final String str, final TenantBuildType tenantBuildType, final OttSDKCallback ottSDKCallback) {
this.mContext = context;
if (str != null && str.trim().length() > 0) {
try {
this.deviceID = Integer.parseInt(str);
} catch (NumberFormatException unused) {
}
}
PreferenceManagerImp preferenceManagerImp = new PreferenceManagerImp(this.mContext, str);
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;
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<JsonObject>() {
@Override
public void onFailure(Error error) {
String str2;
String str3;
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_UAT2.getValue()) || tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_LIVE.getValue())) {
OttSDKCallback ottSDKCallback2 = ottSDKCallback;
if (OttSDK.this.mContext != null) {
str2 = OttSDK.this.mContext.getResources().getString(R.string.frndly_error_initial_data_failed);
} else {
str2 = "" + error.getMessage();
}
ottSDKCallback2.onFailure(new Error(0, str2));
return;
}
OttSDKCallback ottSDKCallback3 = ottSDKCallback;
if (OttSDK.this.mContext != null) {
str3 = OttSDK.this.mContext.getResources().getString(R.string.error_initial_data_failed);
} else {
str3 = "" + error.getMessage();
}
ottSDKCallback3.onFailure(new Error(0, str3));
}
@Override
public void onSuccess(JsonObject jsonObject) {
if (jsonObject == 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.locationInfoFailed = false;
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 (sessionId != null && !sessionId.isEmpty()) {
OttSDK.sInstance = OttSDK.this;
OttLog.error("OTT SDK", "session available");
ottSDKCallback.onProgressChanged(70.0d);
AnonymousClass1 anonymousClass13 = AnonymousClass1.this;
OttSDK.this.fetchConfigurationData(ottSDKCallback, tenantBuildType);
return;
}
TenantBuildType tenantBuildType2 = tenantBuildType;
if (tenantBuildType2 == null) {
OttLog.error("OTT SDK", "session empty (Tenant Buildtype is Null) ");
ottSDKCallback.onProgressChanged(40.0d);
AnonymousClass1 anonymousClass14 = AnonymousClass1.this;
OttSDK.this.generateSession(ottSDKCallback);
}
switch (AnonymousClass10.$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("OTT SDK", "session empty (Teleup Client) ");
break;
default:
OttLog.error("OTT SDK", "session empty (Non Teleup Client) ");
ottSDKCallback.onProgressChanged(40.0d);
AnonymousClass1 anonymousClass15 = AnonymousClass1.this;
OttSDK.this.generateSession(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);
}
public void fetchConfigurationData(final OttSDKCallback ottSDKCallback, final TenantBuildType tenantBuildType) {
locationInfoFailed = false;
this.appManager.getConfigurationData(tenantBuildType, new AppManager.AppManagerCallback<JSONObject>() {
@Override
public void onFailure(Error error) {
Resources resources;
int i2;
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_UAT2.getValue()) && !tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_LIVE.getValue())) {
ottSDKCallback.onFailure(new Error(0, OttSDK.this.mContext != null ? OttSDK.this.mContext.getResources().getString(R.string.error_config_fetch_failed) : ""));
return;
}
String message = error.getMessage();
if (OttSDK.this.mContext != null) {
if (OttSDK.locationInfoFailed) {
resources = OttSDK.this.mContext.getResources();
i2 = R.string.frndly_country_restriction_error;
} else {
resources = OttSDK.this.mContext.getResources();
i2 = R.string.frndly_error_initial_data_failed;
}
message = resources.getString(i2);
}
ottSDKCallback.onFailure(new Error(0, message));
}
@Override
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 (AnonymousClass10.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType2.ordinal()]) {
case 11:
case 12:
case 13:
case 14:
case 15:
OttLog.error("yupptv session", "available+++++++");
ottSDKCallback.onProgressChanged(100.0d);
ottSDKCallback.onSuccess("OttSDK is initialised successfully");
break;
default:
OttLog.error("OTT SDK", "getting system features after config... ");
ottSDKCallback.onProgressChanged(85.0d);
OttSDK.this.fetchSystemFeaturesData(ottSDKCallback);
break;
}
}
});
}
public void fetchSystemFeaturesData(final OttSDKCallback ottSDKCallback) {
this.appManager.getSystemFeatures(null, new AppManager.AppManagerCallback<JSONObject>() {
@Override
public void onFailure(Error error) {
ottSDKCallback.onProgressChanged(100.0d);
ottSDKCallback.onSuccess("OttSDK is initialised successfully");
}
@Override
public void onSuccess(JSONObject jSONObject) {
OttLog.error("yupptv session", "available+++++++");
ottSDKCallback.onProgressChanged(100.0d);
ottSDKCallback.onSuccess("OttSDK is initialised successfully");
}
});
}
public void generateSession(final OttSDKCallback ottSDKCallback) {
locationInfoFailed = false;
this.statusManager.generateSession(new StatusManager.StatusCallback<SessionInfo>() {
@Override
public void onFailure(Error error) {
String str;
String str2;
OttLog.error("failure", "generate session " + error.toString());
if ((!OttSDK.locationInfoFailed || !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_BETA.getValue())) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_BETA2.getValue()) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_UAT.getValue()) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_UAT2.getValue()) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_LIVE.getValue())) {
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));
return;
}
OttSDK.locationInfoFailed = false;
OttSDKCallback ottSDKCallback3 = ottSDKCallback;
if (OttSDK.this.mContext != null) {
str2 = OttSDK.this.mContext.getResources().getString(R.string.frndly_country_restriction_error);
} else {
str2 = "" + error.getMessage();
}
ottSDKCallback3.onFailure(new Error(0, str2));
}
@Override
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 generateSessionV2(final OttSDKCallback ottSDKCallback) {
locationInfoFailed = false;
this.statusManager.generateSession(new StatusManager.StatusCallback<SessionInfo>() {
@Override
public void onFailure(Error error) {
String str;
String str2;
OttLog.error("failure", "generate session " + error.toString());
if ((!OttSDK.locationInfoFailed || !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_BETA.getValue())) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_BETA2.getValue()) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_UAT.getValue()) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_UAT2.getValue()) && !OttSDK.this.tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_LIVE.getValue())) {
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));
return;
}
OttSDK.locationInfoFailed = false;
OttSDKCallback ottSDKCallback3 = ottSDKCallback;
if (OttSDK.this.mContext != null) {
str2 = OttSDK.this.mContext.getResources().getString(R.string.frndly_country_restriction_error);
} else {
str2 = "" + error.getMessage();
}
ottSDKCallback3.onFailure(new Error(0, str2));
}
@Override
public void onSuccess(SessionInfo sessionInfo) {
OttSDK.sInstance = OttSDK.this;
OttLog.error("Generate session ", "init session Id :" + sessionInfo.getSession().getSessionId());
ottSDKCallback.onProgressChanged(100.0d);
ottSDKCallback.onSuccess("OttSDK is initialised successfully");
}
});
}
public static OttSDK getInstance() {
if (sInstance == null) {
OttLog.error("OTT SDK", "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>() {
@Override
public void onFailure(Error error) {
ottSDKCallback.onFailure(new Error(0, error.getMessage()));
}
@Override
public void onSuccess(LocationInfo locationInfo) {
String sessionId = OttSDK.this.getPreferenceManager().getSessionId();
if (sessionId == null || sessionId.isEmpty()) {
if (OttSDK.this.tenantBuildType == null) {
OttLog.error("OTT SDK", "Tenant build type null after Location Info ");
}
switch (AnonymousClass10.$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("OTT SDK", "getting session after Location Info (TeleUP client) ");
ottSDKCallback.onProgressChanged(40.0d);
OttSDK.this.generateSession(ottSDKCallback);
break;
default:
OttLog.error("OTT SDK", "get session after Location Info (Non TeleUP client) ");
break;
}
}
}
});
}
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, int i2, OttSDKCallback<String> ottSDKCallback) {
ucvVersion = i2;
if (sInstance == null) {
sInstance = new OttSDK(context, device.getValue(), tenantBuildType, ottSDKCallback);
initialized = true;
}
}
public static void initWithoutConfigsData(Context context, Device device, TenantBuildType tenantBuildType, int i2, OttSDKCallback<String> ottSDKCallback) {
ucvVersion = i2;
if (sInstance == null) {
sInstance = new OttSDK(context, device.getValue(), tenantBuildType, true, ottSDKCallback);
initialized = true;
}
}
public static void setChukersEnabled(boolean z) {
chuckersEnabled = z;
}
private void setDisplayLanguage(TenantBuildType tenantBuildType, Context context) {
if (tenantBuildType == null || context == null) {
return;
}
int i2 = AnonymousClass10.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType.ordinal()];
if (i2 == 1 || i2 == 2 || i2 == 3 || i2 == 4) {
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null || preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()) == null || this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).trim().length() <= 1) {
setLocalePortuguese(context);
} else if (this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).equalsIgnoreCase("pot")) {
setLocalePortuguese(context);
return;
} else {
setLocaleEnglish(context);
return;
}
}
switch (i2) {
case 39:
case 40:
case 41:
PreferenceManager preferenceManager2 = this.preferenceManager;
if (preferenceManager2 != null && preferenceManager2.getDisplayLanguage(getDefaultDisplayLanguage()) != null && this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).trim().length() > 1) {
if (!this.preferenceManager.getDisplayLanguage(getDefaultDisplayLanguage()).equalsIgnoreCase("Fre")) {
setLocaleEnglish(context);
break;
} else {
setLocaleFrench(context);
break;
}
} else {
setLocaleFrench(context);
break;
}
break;
}
}
public static void setIsUserInfoEncrypted(boolean z) {
isUserInfoEncrypted = z;
}
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 z) {
debugEnabled = z;
}
public static void setSslPinningEnabled(boolean z) {
sslPinningEnabled = z;
}
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>() {
@Override
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));
}
@Override
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 AppManager getApplicationManager() {
return this.appManager;
}
public String getClientType() {
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null) {
return LogSubCategory.LifeCycle.ANDROID;
}
int yuppDeviceId = preferenceManager.getYuppDeviceId();
return yuppDeviceId != 40 ? yuppDeviceId != 43 ? yuppDeviceId != 47 ? yuppDeviceId != 57 ? yuppDeviceId != 74 ? yuppDeviceId != 76 ? yuppDeviceId != 78 ? yuppDeviceId != 105 ? LogSubCategory.LifeCycle.ANDROID : "android_sdk" : "JioAndroidTV" : "APFiber" : "Humax" : "ScopeInternational" : "stbbox" : "AndroidTV" : "FireTV";
}
public String getDefaultDisplayLanguage() {
try {
TenantBuildType tenantBuildType = this.tenantBuildType;
if (tenantBuildType == null) {
return "eng";
}
int i2 = AnonymousClass10.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType.ordinal()];
if (i2 == 2 || i2 == 3 || i2 == 4) {
return "pot";
}
switch (i2) {
}
return "eng";
} catch (Exception unused) {
return "eng";
}
}
public int getDeviceID() {
return this.deviceID;
}
public String getDomainCertificate() {
TenantBuildType tenantBuildType = this.tenantBuildType;
if (tenantBuildType == null) {
return "sha256/u3rbb8COgVN+O0EqjmBivieRql7VYTMCSQGAUh/4hGs=";
}
int i2 = AnonymousClass10.$SwitchMap$com$yupptv$ottsdk$enums$TenantBuildType[tenantBuildType.ordinal()];
return "sha256/u3rbb8COgVN+O0EqjmBivieRql7VYTMCSQGAUh/4hGs=";
}
public String getInitBaseUrl(TenantBuildType tenantBuildType) {
switch (AnonymousClass10.$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-v2.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/frndlytv/init/preprod/frndlytv-preprod-v2.json";
case 16:
return "https://d1keqtsg5img48.cloudfront.net/test/vfplay.json";
case 17:
return "https://d1keqtsg5img48.cloudfront.net/stag2/vfplay.json";
case 18:
return "https://d1keqtsg5img48.cloudfront.net/prod/vfplay_parallel_prod.json";
case 19:
return "https://d1keqtsg5img48.cloudfront.net/prod/vfplay.json";
case 20:
return "https://paas-init.revlet.net/clients/tsat/init/tsat-v1.json";
case 21:
return "https://paas.globaltakeoff.net/clients/beta1/manatv/init/manatv-v2.json";
case 22:
return "https://paas.globaltakeoff.net/clients/beta1/manatv/init/tsat_dev.json";
case 23:
return "https://paas.globaltakeoff.net/clients/beta1/manatv/init/tsat_deploy.json";
case 24:
return "https://paas-init.globaltakeoff.net/clients/viusasa/init/viusasa-v1.json";
case 25:
return "http://paas.globaltakeoff.net/clients/beta1/royalmedia/init/viusasa_deploy.json";
case 26:
return "https://paas-init.revlet.net/clients/royalmedia/init/royalmedia-beta.json";
case 27:
return "https://paas-init.globaltakeoff.net/clients/uat/init/uat-viusasa-v1.json";
case 28:
return "https://paas-init.revlet.net/clients/aastha/init/aastha-v1.json";
case 29:
case 30:
return "https://paas-init.revlet.net/clients/aastha/init/aastha_fusion.json";
case 31:
return "https://paas-init.revlet.net/clients/aastha/init/test/aastha-master.json";
case 32:
return "https://paas-init.revlet.net/clients/teleup/init/test/military-init.json";
case 33:
return "https://paas-init.revlet.net/clients/teleupbrazil/init/test/teleupbrazil-beta.json";
case 34:
return "https://paas.globaltakeoff.net/clients/beta1/sevenstar/init/sevenstar-beta.json";
case 35:
return "https://paas-init.revlet.net/clients/sevenstar/init/sevenstar-v1.json";
case 36:
case 37:
return "https://paas.globaltakeoff.net/clients/beta1/dialog/init/dialog-demo.json";
case 38:
return "https://paas-init.revlet.net/clients/fusion/init/fusion-waasa.json";
case 39:
return "https://wassa-init.yuppcdn.net/clients/lynktelecom/init/lynktelecom.json";
case 40:
case 41:
return "https://paas-init.revlet.net/clients/lynktelecom/init/test/lynktelecom.json";
case 42:
return "https://paas-init.revlet.net/clients/cinesoftmedia/init/cinesoftmedia.json";
case 43:
case 44:
return "https://paas-init.revlet.net/clients/cinesoftmedia/init/test/cinesoftmedia.json";
case 45:
return "https://paas-init.revlet.net/clients/teleup/init/test/ustv-init.json";
case 46:
return "http://paas-init.revlet.net/clients/mobitel/init/test/mobitel-beta.json";
case 47:
return "http://paas-init.revlet.net/clients/mobitel/init/uat/mobitel-uat.json";
case 48:
return "http://paas-init.revlet.net/clients/mobitel/init/live/mobitel-live.json";
case 49:
return "https://paas-init.revlet.net/clients/fusion/init/fusion-mobitel.json";
case 50:
return "https://paas-init.revlet.net/clients/bsnl/init/test/bsnl.json";
case 51:
return "https://paas-init.revlet.net/clients/bsnl/init/live/bsnl.json";
case 52:
return "https://paas-init.revlet.net/clients/airtelsl/init/test/airtelsl-test.json";
case 53:
return "https://paas-init.revlet.net/clients/airtelsl/init/live/airtelsl.json";
case 54:
return "https://paas-init.revlet.net/clients/airtelsl/init/test/airtelsl-test.json";
case 55:
return "https://paas-init.revlet.net/clients/yuppeducation/init/test/yuppeducation-test.json";
case 56:
return "https://paas-init.revlet.net/clients/yuppeducation/init/live/yuppeducation.json";
case 57:
return "https://paas-init.revlet.net/clients/reeldrama/init/test/reeldrama.json";
case 58:
return "https://paas-init.revlet.net/clients/reeldrama/init/live/reeldrama.json";
case 59:
return "https://paas-init.revlet.net/clients/fusion/init/fusion-reeldrama.json";
case 60:
return "https://paas-init.revlet.net/clients/firstshows/init/live/firstshows.json";
case 61:
return "https://paas-init.revlet.net/clients/firstshows/init/test/firstshows.json";
case 62:
return "https://paas-init.revlet.net/clients/fusion/init/fusion-firstshows.json";
case 63:
return "https://paas-init.revlet.net/clients/tsat/init/tsat_fusion.json";
case 64:
return "https://paas-init.revlet.net/clients/fusion/init/fusion-aastha.json";
case 65:
return "https://paas-init.revlet.net/clients/gotv/init/live/gotv.json";
case 66:
case 67:
case 68:
return "https://paas-init.revlet.net/clients/gotv/init/uat/gotv.json";
case 69:
return "https://paas-init.revlet.net/clients/levelnews/init/live/levelnews.json";
case 70:
case 71:
case 72:
return "https://paas-init.revlet.net/clients/levelnews/init/uat/levelnews.json";
case 73:
return "https://paas-init.revlet.net/clients/yvs/init/live/yvs.json";
case 74:
return " https://paas-init.revlet.net/clients/yvs/init/test/yvs-fusion.json";
case 75:
return "https://paas-init.revlet.net/clients/slt/live/slt-live.json";
case 76:
case 77:
return "https://paas-init.revlet.net/clients/fusion/init/fusion-mobitel.json";
case 78:
return "https://paas-init.revlet.net/clients/fusion/init/fusion-slt.json";
case 79:
return "https://paas-init.revlet.net/clients/gacmedia/live/gacmedia.json";
case 80:
return "https://paas-init.revlet.net/clients/gacmedia/uat/gacmedia-uat.json";
case 81:
return "https://paas-init.revlet.net/clients/gacmedia/beta/gacmedia-beta.json";
case 82:
return "https://paas-init.revlet.net/clients/janya/init/live/janya.json";
case 83:
return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/live/dishtv.json";
case 84:
return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/uat/dishtv.json";
case 85:
return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/preprod/dishtv.json";
case 86:
return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/test/dishtv.json";
case 87:
return "https://d2k02uhj7uybok.cloudfront.net/init/dishtv/uat/dishtv2.json";
case 88:
return "https://d31u2qcarfbblp.cloudfront.net/mytv/init/test/mytv.json";
case 89:
return "https://d31u2qcarfbblp.cloudfront.net/mytv/init/live/mytv.json";
default:
return "";
}
}
public MediaCatalogManager getMediaManager() {
return this.mediaCatalogManager;
}
public PaymentManager getPaymentManager() {
return this.paymentManager;
}
public PreferenceManager getPreferenceManager() {
return this.preferenceManager;
}
public TenantBuildType getTenantBuildType() {
return this.tenantBuildType;
}
public String getTimeZone() {
if (TimeZone.getDefault() != null) {
TimeZone timeZone = TimeZone.getDefault();
OttLog.error("OTT SDK", "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("OTT SDK", "TimeZone from Location : " + this.preferenceManager.getIpInfo().getTimezone());
return this.preferenceManager.getIpInfo().getTimezone();
}
public UserManager getUserManager() {
return this.userManager;
}
private OttSDK(Context context, final String str, final TenantBuildType tenantBuildType, boolean z, final OttSDKCallback ottSDKCallback) {
this.mContext = context;
if (str != null && str.trim().length() > 0) {
try {
this.deviceID = Integer.parseInt(str);
} catch (NumberFormatException unused) {
}
}
PreferenceManagerImp preferenceManagerImp = new PreferenceManagerImp(this.mContext, str);
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;
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<JsonObject>() {
@Override
public void onFailure(Error error) {
String str2;
String str3;
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_UAT2.getValue()) || tenantBuildType.getValue().equalsIgnoreCase(TenantBuildType.FRNDLYTV_LIVE.getValue())) {
OttSDKCallback ottSDKCallback2 = ottSDKCallback;
if (OttSDK.this.mContext != null) {
str2 = OttSDK.this.mContext.getResources().getString(R.string.frndly_error_initial_data_failed);
} else {
str2 = "" + error.getMessage();
}
ottSDKCallback2.onFailure(new Error(0, str2));
return;
}
OttSDKCallback ottSDKCallback3 = ottSDKCallback;
if (OttSDK.this.mContext != null) {
str3 = OttSDK.this.mContext.getResources().getString(R.string.error_initial_data_failed);
} else {
str3 = "" + error.getMessage();
}
ottSDKCallback3.onFailure(new Error(0, str3));
}
@Override
public void onSuccess(JsonObject jsonObject) {
if (jsonObject == 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;
}
AnonymousClass2 anonymousClass2 = AnonymousClass2.this;
CipherUtils.setValues(tenantBuildType, str);
String sessionId = OttSDK.this.getPreferenceManager().getSessionId();
if (sessionId != null && !sessionId.isEmpty()) {
OttSDK.sInstance = OttSDK.this;
OttLog.error("OTT SDK", "session available");
ottSDKCallback.onProgressChanged(100.0d);
ottSDKCallback.onSuccess("OttSDK is initialised successfully");
return;
}
TenantBuildType tenantBuildType2 = tenantBuildType;
if (tenantBuildType2 == null) {
OttLog.error("OTT SDK", "session empty (Tenant Buildtype is Null) ");
ottSDKCallback.onProgressChanged(40.0d);
AnonymousClass2 anonymousClass22 = AnonymousClass2.this;
OttSDK.this.generateSessionV2(ottSDKCallback);
}
switch (AnonymousClass10.$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("OTT SDK", "session empty (Teleup Client) ");
break;
default:
OttLog.error("OTT SDK", "session empty (Non Teleup Client) ");
ottSDKCallback.onProgressChanged(40.0d);
AnonymousClass2 anonymousClass23 = AnonymousClass2.this;
OttSDK.this.generateSessionV2(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 OttSDK(Context context, String str) {
this.mContext = context;
this.deviceId = str;
PreferenceManagerImp preferenceManagerImp = new PreferenceManagerImp(context, str);
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;
}
}