导航菜单

页面标题

页面副标题

Vi App v10.18.0 - SplashScreenActivity.java 源代码

正在查看: Vi App v10.18.0 应用的 SplashScreenActivity.java JAVA 源代码文件

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


package com.yupptv.ott;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.VideoView;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.fragment.app.Fragment;
import com.yupptv.ott.activity.BaseActivity;
import com.yupptv.ott.activity.LoadScreenActivity;
import com.yupptv.ott.analytics.AnalyticsUtils;
import com.yupptv.ott.analytics.MyRecoManager;
import com.yupptv.ott.enums.ScreenType;
import com.yupptv.ott.fragments.ErrorFragment;
import com.yupptv.ott.fragments.IntroFragment;
import com.yupptv.ott.interfaces.FragmentCallback;
import com.yupptv.ott.utils.APIUtils;
import com.yupptv.ott.utils.Configurations;
import com.yupptv.ott.utils.Constants;
import com.yupptv.ott.utils.CustomLog;
import com.yupptv.ott.utils.NavigationConstants;
import com.yupptv.ott.utils.NavigationUtils;
import com.yupptv.ott.utils.Preferences;
import com.yupptv.ott.utils.UiUtils;
import com.yupptv.ott.views.LineSpinFadeLoaderView;
import com.yupptv.ottsdk.OttSDK;
import com.yupptv.ottsdk.managers.Application.AppManager;
import com.yupptv.ottsdk.managers.Preferences.PreferenceManager;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.model.Country;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.LocationInfo;
import com.yupptv.ottsdk.model.User;
import com.yupptv.ottsdk.model.systemfeatures.Features;
import com.yupptv.ottsdk.model.user.Configs;
import com.yupptv.ottsdk.utils.PreferencesUtils;
import in.juspay.hypersdk.core.PaymentConstants;
import java.util.List;

public class SplashScreenActivity extends BaseActivity implements FragmentCallback {
    public static OttSDK mOttSDK;
    private Dialog dialog;
    private Intent intent;
    private Preferences preferences;
    private LineSpinFadeLoaderView progressBar;
    private VideoView videoView;
    private String TAG = getClass().getSimpleName();
    private boolean playCompleted = false;
    private boolean servicesCompleted = false;
    private int videoSeekPosition = 0;
    private boolean showWelcomeVideo = false;
    private boolean isComingFromNotification = false;
    public String mobileNum = "";
    public Intent intent_deeplinks = new Intent();

    class AnonymousClass7 implements AppManager.AppManagerCallback<String> {
        public final SplashScreenActivity this$0;

        @Override
        public void onFailure(Error error) {
            Preferences.instance(this.this$0).setMobileNumberFromHeader("");
            NavigationUtils.logKibanaError("SplashScreenActivity", "API", "getMsisdnFromHeader", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
        }

        @Override
        public void onSuccess(String str) {
            if (str != null) {
                CustomLog.e(this.this$0.TAG, "mobile number from header ".concat(str));
                Preferences.instance(this.this$0).setMobileNumberFromHeader(str);
            }
        }
    }

    static {
        AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    }

    public void checkAppUpdate() {
        APIUtils.getUtilPreferenceManager(getApplicationContext()).setCountryIsdCode("");
        if (OttSDK.getInstance() == null || OttSDK.getInstance().getPreferenceManager().getClientInfo() == null) {
            getLocationInfo(true);
        } else {
            launchHomeScreen();
        }
    }

    public void checkAutoLogin(String str, Intent intent) {
        this.intent_deeplinks = intent;
        if (mOttSDK == null) {
            mOttSDK = APIUtils.getOTTSdkInstance(getApplicationContext());
        }
        User loggedUser = mOttSDK.getPreferenceManager().getLoggedUser();
        if (loggedUser == null) {
            doAutoLogin(str);
            return;
        }
        String phoneNumber = loggedUser.getPhoneNumber();
        if (!phoneNumber.contains("91-")) {
            phoneNumber = "91-".concat(phoneNumber);
        }
        if (phoneNumber.equalsIgnoreCase(str)) {
            navigateMainActivity();
        } else {
            logOutCurrentUserAndAUtoLogin(str);
        }
    }

    public void dismissProgressDialog() {
        try {
            Dialog dialog = this.dialog;
            if (dialog == null || !dialog.isShowing()) {
                return;
            }
            this.dialog.dismiss();
        } catch (Exception unused) {
        }
    }

    public void doAutoLogin(final String str) {
        APIUtils.getOTTSdkInstance(getApplicationContext()).getUserManager().autologin(str, "mobile", Boolean.FALSE, new UserManager.UserCallback<User>() {
            @Override
            public void onEmptySuccess() {
                com.yupptv.ottsdk.managers.User.a.a(this);
            }

            @Override
            public void onFailure(Error error) {
                SplashScreenActivity.this.showProgress(false);
                ?? r0 = SplashScreenActivity.this;
                r0.showErrorDialog(r0.getString(R.string.error), error.getMessage());
                NavigationUtils.logKibanaError("SplashScreenActivity", "API", "/service/api/auth/signin", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
            }

            @Override
            public void onSuccess(User user) {
                AnalyticsUtils.getInstance().updateProfileToCleverTap(SplashScreenActivity.this);
                OTTApplication.setAutoLogin(str, "yes", "direct");
                SplashScreenActivity.this.navigateMainActivity();
            }
        });
    }

    private void fetchLatestUserinfo() {
        try {
            mOttSDK.getUserManager().getUserInfo(new UserManager.UserCallback<User>() {
                @Override
                public void onEmptySuccess() {
                    com.yupptv.ottsdk.managers.User.a.a(this);
                }

                @Override
                public void onFailure(Error error) {
                    NavigationUtils.logKibanaError("SplashScreenActivity", "API", "/service/api/auth/user/info", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
                }

                @Override
                public void onSuccess(User user) {
                }
            });
        } catch (NullPointerException unused) {
        }
    }

    public void generateSession(final String str) {
        if (OttSDK.getInstance() != null) {
            OttSDK.getInstance().generateNewSession(new OttSDK.OttSDKCallback() {
                @Override
                public void onFailure(Error error) {
                    SplashScreenActivity.this.showProgress(false);
                    ?? r0 = SplashScreenActivity.this;
                    r0.showErrorDialog(r0.getString(R.string.error), error.getMessage());
                    NavigationUtils.logKibanaError("SplashScreenActivity", "API", "/service/api/v1/get/token", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
                }

                @Override
                public void onProgressChanged(double d2) {
                }

                @Override
                public void onSuccess(Object obj) {
                    SplashScreenActivity.this.doAutoLogin(str);
                }
            });
        }
    }

    private void getCountriesList() {
        APIUtils.getUtilApplicationManager(getApplicationContext()).getCountriesList(new AppManager.AppManagerCallback<List<Country>>() {
            @Override
            public void onFailure(Error error) {
                NavigationUtils.logKibanaError("SplashScreenActivity", "API", "/service/api/v1/get/country", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
            }

            @Override
            public void onSuccess(List<Country> list) {
            }
        });
    }

    private void getLocationInfo(final boolean z) {
        APIUtils.getUtilApplicationManager(getApplicationContext()).getLocationInfo(mOttSDK.getPreferenceManager().getTenantCode(), mOttSDK.getPreferenceManager().getProductCode(), "android_sdk", new AppManager.AppManagerCallback<LocationInfo>() {
            @Override
            public void onFailure(Error error) {
                if (z) {
                    SplashScreenActivity.this.launchHomeScreen();
                }
                NavigationUtils.logKibanaError("SplashScreenActivity", "API", "/service/location/api/v1/locationinfo", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
            }

            @Override
            public void onSuccess(LocationInfo locationInfo) {
                OTTApplication.locationInfo = locationInfo;
                if (z) {
                    if (locationInfo != null && locationInfo.getClientInfo() != null) {
                        SplashScreenActivity.this.checkAppUpdate();
                    } else {
                        SplashScreenActivity.this.preferences.setAppUpdateAvailable(Boolean.FALSE);
                        SplashScreenActivity.this.launchHomeScreen();
                    }
                }
            }
        });
    }

    private void getShareIntentData() {
        OTTApplication.sharedPath = "";
        OTTApplication.sharedPathTitle = "";
        Intent intent = getIntent();
        if (intent != null) {
            String action = intent.getAction();
            Uri data = intent.getData();
            OTTApplication.sharedPathTitle = intent.getStringExtra(PaymentConstants.PAYLOAD);
            if (data == null || action == null || !action.equalsIgnoreCase("android.intent.action.VIEW")) {
                if (intent.hasExtra("launchurl")) {
                    this.isComingFromNotification = true;
                    OTTApplication.sharedPath = intent.getStringExtra("launchurl");
                    Constants.IS_FROM_NOTIFICATION = true;
                    MyRecoManager.getInstance().setOriginSource("Notification");
                    MyRecoManager.getInstance().setOriginMedium("Notification");
                    return;
                }
                return;
            }
            String host = data.getHost();
            MyRecoManager.getInstance().setOriginSource("Share");
            if (host != null && host.trim().length() > 0 && (host.contains("watcho.onelink.me") || host.contains("open"))) {
                OTTApplication.sharedPath = "watchoonelink";
                return;
            }
            String path = data.getPath();
            if (path != null && path.contains("sharedLink/")) {
                path = path.replace("sharedLink/", "");
            }
            if (path != null && path.startsWith("/")) {
                path = path.replaceFirst("/", "");
            }
            OTTApplication.sharedPath = path;
            CustomLog.e(this.TAG, "path=" + data.getPath());
        }
    }

    private void initSDK() {
        OttSDK.setLogEnabled(false);
        OttSDK.setSslPinningEnabled(true);
        OttSDK.setChukersEnabled(false);
        OttSDK.setIsUserInfoEncrypted(true);
        OttSDK.sInstance = null;
        Intent intent = getIntent();
        this.intent = intent;
        if (intent != null && intent.hasExtra("mobileNum")) {
            this.mobileNum = this.intent.getStringExtra("mobileNum");
        }
        PreferencesUtils.putInt(this, PreferencesUtils.SDK_PREFERENCE_NAME, "api_header_ucv", 15);
        PreferencesUtils.putString(this, PreferencesUtils.SDK_PREFERENCE_NAME, "client_app_version", "3.1.5");
        OttSDK.init(OTTApplication.getContext(), Constants.DEVICE_ID, UiUtils.getTenantBuildType(this), 15, new OttSDK.OttSDKCallback<String>() {
            @Override
            public void onFailure(Error error) {
                SplashScreenActivity.this.showProgress(false);
                OttSDK.sInstance = null;
                if (APIUtils.getOTTSdkInstance(SplashScreenActivity.this.getApplicationContext()).getPreferenceManager().getLoggedUser() == null || UiUtils.isNetworkConnected(SplashScreenActivity.this) || SplashScreenActivity.this.preferences == null || !SplashScreenActivity.this.preferences.getEnableOfflineDownload().booleanValue()) {
                    ?? r0 = SplashScreenActivity.this;
                    r0.showErrorDialog(r0.getString(R.string.error), error.getMessage());
                } else {
                    Intent intent2 = new Intent((Context) SplashScreenActivity.this, (Class<?>) FusionViliteMainActivity.class);
                    intent2.putExtra("splashscreen", true);
                    SplashScreenActivity.this.startActivity(intent2);
                    SplashScreenActivity.this.finish();
                }
                CustomLog.e(SplashScreenActivity.this.TAG, "on failure");
                NavigationUtils.logKibanaError("SplashScreenActivity", "API", "init", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
            }

            @Override
            public void onProgressChanged(double d2) {
            }

            @Override
            public void onSuccess(String str) {
                if (OttSDK.getInstance() == null) {
                    return;
                }
                SplashScreenActivity splashScreenActivity = SplashScreenActivity.this;
                splashScreenActivity.checkAutoLogin(splashScreenActivity.mobileNum, splashScreenActivity.intent);
                CustomLog.e(SplashScreenActivity.this.TAG, "on success : " + str);
            }
        });
    }

    public void launchHomeScreen() {
        int i2 = 0;
        if (this.showWelcomeVideo && OTTApplication.sharedPath.trim().isEmpty()) {
            this.servicesCompleted = true;
            showProgress(false);
            if (!this.playCompleted) {
                return;
            }
        }
        if (isFinishing()) {
            return;
        }
        UiUtils.updateConfigFlags();
        Configurations.updateClientConfigurations();
        Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
        if (!Configurations.enableOfflineDownloads || utilAppConfigurations == null || utilAppConfigurations.getEnableOfflineDownloads() == null || !utilAppConfigurations.getEnableOfflineDownloads().equalsIgnoreCase("true")) {
            this.preferences.setEnableOfflineDownload(Boolean.FALSE);
        } else {
            this.preferences.setEnableOfflineDownload(Boolean.TRUE);
        }
        String str = "";
        String allowedCountriesList = utilAppConfigurations != null ? utilAppConfigurations.getAllowedCountriesList() : "";
        Features features = null;
        String[] split = allowedCountriesList != null ? allowedCountriesList.contains(",") ? allowedCountriesList.split(",") : new String[]{allowedCountriesList} : null;
        int length = split != null ? split.length : 0;
        PreferenceManager utilPreferenceManager = APIUtils.getUtilPreferenceManager(getApplicationContext());
        if (utilPreferenceManager != null && utilPreferenceManager.getIpInfo() != null && utilPreferenceManager.getIpInfo().getCountryCode() != null) {
            str = utilPreferenceManager.getIpInfo().getCountryCode();
        }
        while (true) {
            if (i2 < length) {
                if (str.equalsIgnoreCase(split[i2])) {
                    break;
                } else {
                    i2++;
                }
            } else if (length > 0) {
                ErrorFragment errorFragment = new ErrorFragment();
                Bundle bundle = new Bundle();
                bundle.putString(NavigationConstants.NAV_FROM, "CountryRestriction");
                bundle.putString(NavigationConstants.ERROR_MESSAGE, getString(R.string.content_not_available_in_your_country));
                errorFragment.setArguments(bundle);
                getSupportFragmentManager().beginTransaction().setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out).replace(R.id.into_frame, errorFragment).commitAllowingStateLoss();
                return;
            }
        }
        if (mOttSDK == null) {
            mOttSDK = APIUtils.getOTTSdkInstance(getApplicationContext());
        }
        OttSDK ottSDK = mOttSDK;
        User loggedUser = (ottSDK == null || ottSDK.getPreferenceManager() == null) ? null : mOttSDK.getPreferenceManager().getLoggedUser();
        if (mOttSDK.getPreferenceManager() != null && mOttSDK.getPreferenceManager().getSystemFeaturesData() != null && mOttSDK.getPreferenceManager().getSystemFeaturesData().getSystemFeatures() != null) {
            features = mOttSDK.getPreferenceManager().getSystemFeaturesData().getSystemFeatures();
        }
        if (features != null && features.getUserprofiles() != null && features.getUserprofiles().getFields() != null && features.getUserprofiles().getFields().getIsUserprofilesSupported() != null && features.getUserprofiles().getFields().getIsUserprofilesSupported().trim().equalsIgnoreCase("true")) {
            if (features.getUserprofiles().getFields().getMaxProfileLimit() != null && !features.getUserprofiles().getFields().getMaxProfileLimit().trim().isEmpty()) {
                Constants.MAX_PROFILES_LIMIT = Integer.parseInt(features.getUserprofiles().getFields().getMaxProfileLimit());
            }
            Constants.IS_USER_PROFILES_SUPPORTED = true;
        }
        if (features != null && features.getGlobalsettings() != null && features.getGlobalsettings().getFields() != null && features.getGlobalsettings().getFields().getIsMobileSupported() != null && features.getGlobalsettings().getFields().getIsMobileSupported().trim().equalsIgnoreCase("true")) {
            ClientConfiguration.isShowMobileField = true;
        }
        if (features != null && features.getGlobalsettings() != null && features.getGlobalsettings().getFields() != null && features.getGlobalsettings().getFields().getIsEmailSupported() != null && features.getGlobalsettings().getFields().getIsEmailSupported().trim().equalsIgnoreCase("true")) {
            ClientConfiguration.isShowEmailField = true;
        }
        if (features != null && features.getParentalcontrol() != null && features.getParentalcontrol().getFields() != null && features.getParentalcontrol().getFields().getPin_expiry_duration_in_sec_client() != null) {
            Constants.afterDarkExpiryInSeconds = Long.parseLong(features.getParentalcontrol().getFields().getPin_expiry_duration_in_sec_client()) * 1000;
        }
        if (loggedUser != null && Constants.IS_USER_PROFILES_SUPPORTED) {
            launchUserProfilesPage();
            return;
        }
        if (!OTTApplication.sharedPath.isEmpty()) {
            if (this.isComingFromNotification && OTTApplication.sharedPath.startsWith("http") && OTTApplication.sharedPath.contains("play.google.com")) {
                MyRecoManager.getInstance().setOriginSource("Share");
                startActivity(new Intent("android.intent.action.VIEW", Uri.parse(OTTApplication.sharedPath)));
                finish();
                return;
            } else {
                Intent intent = new Intent((Context) this, (Class<?>) FusionViliteMainActivity.class);
                intent.putExtra("fromdeeplink", true);
                intent.putExtra("splashscreen", true);
                startActivity(intent);
                finish();
                return;
            }
        }
        if (utilPreferenceManager != null) {
            utilPreferenceManager.getInitialLaunch();
        }
        Intent intent2 = new Intent((Context) this, (Class<?>) FusionViliteMainActivity.class);
        Intent intent3 = this.intent_deeplinks;
        if (intent3 == null || !intent3.hasExtra("deeplink_path")) {
            Intent intent4 = this.intent_deeplinks;
            if (intent4 == null || !intent4.hasExtra("contentDeepLink")) {
                Intent intent5 = this.intent_deeplinks;
                if (intent5 == null || !intent5.hasExtra("tabName")) {
                    Intent intent6 = this.intent_deeplinks;
                    if (intent6 == null || !intent6.hasExtra("carouselDeeplinkpath")) {
                        Intent intent7 = this.intent_deeplinks;
                        if (intent7 == null || !intent7.hasExtra("partnerpage_path")) {
                            Intent intent8 = this.intent_deeplinks;
                            if (intent8 == null || !intent8.hasExtra(PaymentConstants.URL)) {
                                Intent intent9 = this.intent_deeplinks;
                                if (intent9 == null || !intent9.hasExtra("popupId")) {
                                    intent2.putExtra("splashscreen", true);
                                } else {
                                    String stringExtra = this.intent_deeplinks.getStringExtra("popupId");
                                    if (!TextUtils.isEmpty(stringExtra)) {
                                        intent2.putExtra("popupId", stringExtra);
                                    }
                                }
                            } else {
                                String stringExtra2 = this.intent_deeplinks.getStringExtra(PaymentConstants.URL);
                                if (!TextUtils.isEmpty(stringExtra2)) {
                                    intent2.putExtra(PaymentConstants.URL, stringExtra2);
                                }
                            }
                        } else {
                            String stringExtra3 = this.intent_deeplinks.getStringExtra("partnerpage_path");
                            if (!TextUtils.isEmpty(stringExtra3)) {
                                intent2.putExtra("partnerpage_path", stringExtra3);
                            }
                        }
                    } else {
                        String stringExtra4 = this.intent_deeplinks.getStringExtra("carouselDeeplinkpath");
                        if (!TextUtils.isEmpty(stringExtra4)) {
                            intent2.putExtra("carouselDeeplinkpath", stringExtra4);
                        }
                    }
                } else {
                    String stringExtra5 = this.intent_deeplinks.getStringExtra("tabName");
                    if (stringExtra5 != null && stringExtra5.length() > 0) {
                        intent2.putExtra("tabName", stringExtra5);
                    }
                }
            } else {
                String stringExtra6 = this.intent_deeplinks.getStringExtra("contentDeepLink");
                if (!TextUtils.isEmpty(stringExtra6)) {
                    intent2.putExtra("ContentDeepLink", stringExtra6);
                }
            }
        } else {
            String stringExtra7 = this.intent_deeplinks.getStringExtra("deeplink_path");
            if (!TextUtils.isEmpty(stringExtra7)) {
                intent2.putExtra("deeplink_path", stringExtra7);
            }
        }
        startActivity(intent2);
        finish();
    }

    private void launchUserProfilesPage() {
        Intent intent = new Intent((Context) this, (Class<?>) LoadScreenActivity.class);
        intent.putExtra(NavigationConstants.SCREEN_TYPE, ScreenType.USER_PROFILES);
        intent.putExtra(NavigationConstants.NAV_FROM, NavigationConstants.FROM_INTRO);
        startActivity(intent);
        finish();
    }

    private void logOutCurrentUserAndAUtoLogin(final String str) {
        OttSDK.getInstance().getUserManager().logout(new UserManager.UserCallback<String>() {
            @Override
            public void onEmptySuccess() {
                com.yupptv.ottsdk.managers.User.a.a(this);
            }

            @Override
            public void onFailure(Error error) {
                SplashScreenActivity.this.showProgress(false);
                NavigationUtils.logKibanaError("SplashScreenActivity", "API", "/service/api/auth/signout", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
                SplashScreenActivity.this.doAutoLogin(str);
            }

            @Override
            public void onSuccess(String str2) {
                OttSDK ottSDK = OttSDK.getInstance();
                if (ottSDK != null && ottSDK.getPreferenceManager() != null) {
                    ottSDK.getPreferenceManager().setLoggedInUser("");
                    ottSDK.getPreferenceManager().setPreferedLanguages("");
                    ottSDK.getPreferenceManager().setPreferedMultiLanguages("");
                }
                SplashScreenActivity.this.generateSession(str);
            }
        });
    }

    public void navigateMainActivity() {
        if (isFinishing()) {
            return;
        }
        showProgress(true);
        mOttSDK = APIUtils.getOTTSdkInstance(getApplicationContext());
        fetchLatestUserinfo();
        getCountriesList();
        checkAppUpdate();
    }

    public void showErrorDialog(String str, String str2) {
        Dialog dialog;
        dismissProgressDialog();
        try {
            Dialog dialog2 = new Dialog(this);
            this.dialog = dialog2;
            dialog2.setCancelable(false);
            this.dialog.requestWindowFeature(1);
            this.dialog.setContentView(R.layout.dialog_view);
            TextView textView = (TextView) this.dialog.findViewById(R.id.dialog_title);
            TextView textView2 = (TextView) this.dialog.findViewById(R.id.dialog_msg);
            TextView textView3 = (TextView) this.dialog.findViewById(R.id.dialog_right_btn_neutral);
            textView.setText(str);
            textView2.setText(str2);
            textView3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    SplashScreenActivity.this.dismissProgressDialog();
                    SplashScreenActivity.this.finish();
                }
            });
            if (isFinishing() || (dialog = this.dialog) == null) {
                return;
            }
            dialog.show();
        } catch (Exception unused) {
        }
    }

    public void showProgress(boolean z) {
        LineSpinFadeLoaderView lineSpinFadeLoaderView = this.progressBar;
        if (lineSpinFadeLoaderView != null) {
            lineSpinFadeLoaderView.setVisibility(z ? 0 : 8);
        }
        LineSpinFadeLoaderView lineSpinFadeLoaderView2 = this.progressBar;
        if (lineSpinFadeLoaderView2 instanceof LineSpinFadeLoaderView) {
            if (z) {
                lineSpinFadeLoaderView2.startAnimation();
            } else {
                lineSpinFadeLoaderView2.stopAnimation();
            }
        }
    }

    public void onActivityResult(int i2, int i3, Intent intent) {
        super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(i2, i3, intent);
        if (i2 == 102) {
            CustomLog.e("AppUpdate", "ACTIVITY_RESULT_APP_UPDATE with result code : " + i3);
            if (i3 != -1) {
                Toast.makeText((Context) this, (CharSequence) "App Update failed, please try again on the next app launch.", 0).show();
            }
        }
        if (i2 == 2 && i3 == -1) {
            navigateMainActivity();
        }
    }

    public void onBackPressed() {
        if (OttSDK.getInstance() != null) {
            OttSDK.getInstance().cancelAllRequests();
        }
        if (getSupportFragmentManager().getBackStackEntryCount() <= 0) {
            super/*androidx.activity.ComponentActivity*/.onBackPressed();
            return;
        }
        getSupportFragmentManager().popBackStackImmediate();
        Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.into_frame);
        if (findFragmentById instanceof IntroFragment) {
            ((IntroFragment) findFragmentById).onResume();
        }
    }

    public void onCreate(Bundle bundle) {
        super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
        setRequestedOrientation(1);
        setContentView(R.layout.activity_splash_screen);
        OTTApplication.exitPopupContentClicked = false;
        MyRecoManager.getInstance().setOriginSource("AppOpen");
        LineSpinFadeLoaderView lineSpinFadeLoaderView = (LineSpinFadeLoaderView) findViewById(R.id.progressBar);
        this.progressBar = lineSpinFadeLoaderView;
        if (lineSpinFadeLoaderView != null) {
            showProgress(true);
        }
        this.showWelcomeVideo = false;
        Preferences instance = Preferences.instance(this);
        this.preferences = instance;
        instance.setAppUpdateAvailable(Boolean.FALSE);
        Preferences preferences = this.preferences;
        if (preferences != null) {
            preferences.setBooleanPreference("CLEAR_EPG_FILTER_PREFERENCES", Boolean.TRUE);
        }
        if (getIntent().getExtras() == null || !(getIntent().getExtras().getBoolean("signout") || getIntent().getExtras().getBoolean("reset"))) {
            getShareIntentData();
            initSDK();
        } else {
            this.playCompleted = true;
            launchHomeScreen();
        }
        int i2 = getResources().getDisplayMetrics().densityDpi;
        if (i2 == 120) {
            CustomLog.e("TAG", "LDPI");
            return;
        }
        if (i2 == 160) {
            CustomLog.e("TAG", "MDPI");
        } else if (i2 == 240) {
            CustomLog.e("TAG", "HDPI");
        } else {
            if (i2 != 320) {
                return;
            }
            CustomLog.e("TAG", "XHDPI");
        }
    }

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

    public void onPause() {
        VideoView videoView;
        super/*androidx.fragment.app.FragmentActivity*/.onPause();
        if (this.showWelcomeVideo && (videoView = this.videoView) != null && videoView.isPlaying()) {
            this.videoSeekPosition = this.videoView.getCurrentPosition();
            this.videoView.pause();
        }
    }

    public void onResume() {
        super/*androidx.fragment.app.FragmentActivity*/.onResume();
        if (this.showWelcomeVideo) {
            VideoView videoView = this.videoView;
            if (videoView != null && !this.playCompleted) {
                videoView.seekTo(this.videoSeekPosition);
                this.videoView.start();
            } else {
                if (this.servicesCompleted || videoView == null) {
                    return;
                }
                videoView.setVisibility(8);
            }
        }
    }

    public void onSaveInstanceState(Bundle bundle) {
        super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
        CustomLog.e(this.TAG, "onsave instance state");
    }

    public void onStart() {
        super.onStart();
        if (this.showWelcomeVideo) {
            VideoView videoView = this.videoView;
            if (videoView != null && !this.playCompleted) {
                videoView.seekTo(this.videoSeekPosition);
                this.videoView.start();
            } else {
                if (this.servicesCompleted || videoView == null) {
                    return;
                }
                videoView.setVisibility(8);
            }
        }
    }

    public void onStop() {
        VideoView videoView;
        super.onStop();
        if (this.showWelcomeVideo && (videoView = this.videoView) != null && videoView.isPlaying()) {
            this.videoSeekPosition = this.videoView.getCurrentPosition();
            this.videoView.pause();
        }
    }

    @Override
    public void setTitle(String str) {
    }
}