正在查看: Biko v2.0.23 应用的 SplashActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Biko v2.0.23 应用的 SplashActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui;
import android.R;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.core.content.FileProvider;
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import app.callpe.App;
import app.callpe.common.utils.DateHelper;
import app.callpe.common.utils.Helper;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.common.utils.extensions.ContextExtKt;
import app.callpe.common.utils.helper_functions.AdjustAnalyticsHelper;
import app.callpe.common.utils.helper_functions.CrashLogHelper;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.APIError;
import app.callpe.data.model.AppModel;
import app.callpe.data.model.BanDetails;
import app.callpe.data.model.CountryModel;
import app.callpe.data.model.ErrorHandler;
import app.callpe.data.model.IPModel;
import app.callpe.data.model.User;
import app.callpe.data.repository.upload.DownloadProgressHelper;
import app.callpe.databinding.ActivitySplashBinding;
import app.callpe.db.LocalDB;
import app.callpe.service.ApiService;
import app.callpe.service.FirebaseNotificationService;
import app.callpe.service.jobs.JobPriority;
import app.callpe.ui.home.AgentHomeActivity;
import app.callpe.ui.home.HomeActivity;
import app.callpe.ui.home.NonLiveHomeActivity;
import app.callpe.ui.home.StreamerHomeActivity;
import app.callpe.ui.login.LoginActivity;
import app.callpe.ui.misc.BanActivity;
import app.callpe.ui.onboarding.NonLiveOnboardActivity;
import app.callpe.ui.onboarding.OnboardActivity;
import app.callpe.ui.onboarding.StreamerProfileStatusActivity;
import com.adjust.sdk.Constants;
import com.android.installreferrer.api.InstallReferrerClient;
import com.downloader.OnDownloadListener;
import com.downloader.OnProgressListener;
import com.downloader.OnStartOrResumeListener;
import com.downloader.PRDownloader;
import com.downloader.Priority;
import com.downloader.Progress;
import com.downloader.request.DownloadRequest;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.gson.Gson;
import dagger.hilt.android.AndroidEntryPoint;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;
import java.util.concurrent.CancellationException;
import javax.inject.Inject;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.Job;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import timber.log.Timber;
@Metadata(d1 = {"\u0000¶\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\t\n\u0002\b\u0003\b\u0007\u0018\u0000 q2\u00020\u0001:\u0001qB\u0005¢\u0006\u0002\u0010\u0002J\u0010\u00102\u001a\u0002032\u0006\u00104\u001a\u00020\u001aH\u0002J$\u00105\u001a\u0002032\b\u00106\u001a\u0004\u0018\u00010\u001a2\b\u00107\u001a\u0004\u0018\u0001082\u0006\u00109\u001a\u00020\u001aH\u0002J\b\u0010:\u001a\u000203H\u0002J\u0013\u0010;\u001a\u0004\u0018\u00010\u001aH\u0082@ø\u0001\u0000¢\u0006\u0002\u0010<J\u0013\u0010=\u001a\u0004\u0018\u000108H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010<J\b\u0010>\u001a\u000203H\u0002J\b\u0010?\u001a\u000203H\u0002J\b\u0010@\u001a\u000203H\u0002J\u0010\u0010A\u001a\u0002032\u0006\u0010B\u001a\u00020CH\u0002J\b\u0010D\u001a\u000203H\u0002J\b\u0010E\u001a\u000203H\u0002J\u0014\u0010F\u001a\u0002032\n\b\u0002\u0010B\u001a\u0004\u0018\u00010CH\u0002J$\u0010G\u001a\u0002032\u0006\u0010H\u001a\u00020\u001c2\u0006\u0010I\u001a\u00020\u001c2\n\b\u0002\u0010B\u001a\u0004\u0018\u00010CH\u0002J\b\u0010J\u001a\u000203H\u0002J\u0010\u0010K\u001a\u0002032\u0006\u0010L\u001a\u00020MH\u0002J\u0010\u0010N\u001a\u0002032\u0006\u0010L\u001a\u00020MH\u0002J\u0010\u0010N\u001a\u0002032\u0006\u0010O\u001a\u00020\u001aH\u0002J\u0010\u0010P\u001a\u0002032\u0006\u0010Q\u001a\u00020\u001aH\u0002J\u0013\u0010R\u001a\u0004\u0018\u00010\u001aH\u0082@ø\u0001\u0000¢\u0006\u0002\u0010<J\b\u0010S\u001a\u000203H\u0002J\b\u0010T\u001a\u000203H\u0002J\b\u0010U\u001a\u000203H\u0016J\u0012\u0010V\u001a\u0002032\b\u0010W\u001a\u0004\u0018\u00010XH\u0014J\b\u0010Y\u001a\u000203H\u0014J\u0010\u0010Z\u001a\u0002032\u0006\u0010[\u001a\u00020\\H\u0002J\"\u0010]\u001a\u0002032\u0018\b\u0002\u0010^\u001a\u0012\u0012\u0004\u0012\u00020`0_j\b\u0012\u0004\u0012\u00020``aH\u0002J(\u0010b\u001a\u0002032\u0006\u0010[\u001a\u00020\\2\u0006\u0010c\u001a\u00020,2\u0006\u0010d\u001a\u00020,2\u0006\u0010e\u001a\u00020,H\u0002J\b\u0010f\u001a\u000203H\u0002J\u001e\u0010g\u001a\u0002032\u0006\u0010h\u001a\u00020\u001a2\f\u0010i\u001a\b\u0012\u0004\u0012\u0002030jH\u0002J\u0010\u0010k\u001a\u0002032\u0006\u0010l\u001a\u00020\u001cH\u0002J \u0010k\u001a\u0002032\u0006\u0010l\u001a\u00020\u001c2\u0006\u0010m\u001a\u00020\u001a2\u0006\u0010n\u001a\u00020oH\u0002J\b\u0010p\u001a\u000203H\u0002R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010\u0005\u001a\u00020\u00068\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u001a\u0010\u000b\u001a\u00020\fX\u0086.¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R\u001c\u0010\u0011\u001a\u0004\u0018\u00010\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0013\u0010\u0014\"\u0004\b\u0015\u0010\u0016R\u0010\u0010\u0017\u001a\u0004\u0018\u00010\u0018X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u001aX\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u001b\u001a\u00020\u001c8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u001b\u0010\u001dR\u000e\u0010\u001e\u001a\u00020\u001cX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001f\u001a\u00020\u001cX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010 \u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u001c\u0010!\u001a\u0010\u0012\f\u0012\n $*\u0004\u0018\u00010#0#0\"X\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010%\u001a\u00020&8\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b'\u0010(\"\u0004\b)\u0010*R\u000e\u0010+\u001a\u00020,X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010-\u001a\u0004\u0018\u00010.X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010/\u001a\u0004\u0018\u000100X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u00101\u001a\u00020,X\u0082\u000e¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006r"}, d2 = {"Lapp/callpe/ui/SplashActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "alertDialog", "Landroid/app/AlertDialog;", "apiService", "Lapp/callpe/service/ApiService;", "getApiService", "()Lapp/callpe/service/ApiService;", "setApiService", "(Lapp/callpe/service/ApiService;)V", "binding", "Lapp/callpe/databinding/ActivitySplashBinding;", "getBinding", "()Lapp/callpe/databinding/ActivitySplashBinding;", "setBinding", "(Lapp/callpe/databinding/ActivitySplashBinding;)V", "delayJob", "Lkotlinx/coroutines/Job;", "getDelayJob", "()Lkotlinx/coroutines/Job;", "setDelayJob", "(Lkotlinx/coroutines/Job;)V", "dialog", "Landroid/app/Dialog;", "id", "", "isLoggedIn", "", "()Z", "isNotLive", "isVitokDownloading", "languageDialog", "launcher", "Landroidx/activity/result/ActivityResultLauncher;", "Landroid/content/Intent;", "kotlin.jvm.PlatformType", "localDB", "Lapp/callpe/db/LocalDB;", "getLocalDB", "()Lapp/callpe/db/LocalDB;", "setLocalDB", "(Lapp/callpe/db/LocalDB;)V", "maxRetry", "", "progressHelper", "Lapp/callpe/data/repository/upload/DownloadProgressHelper;", "referrerClient", "Lcom/android/installreferrer/api/InstallReferrerClient;", "retryCount", "downloadApk", "", "url", "fetchAppInfo", Constants.REFERRER, "ipModel", "Lapp/callpe/data/model/IPModel;", "fcmId", "getAppStatus", "getInstallReferrer", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getUserIPCountry", "getUserMetaData", "goToAgentActivity", "goToHomeActivity", "goToInputUserInfoActivity", "user", "Lapp/callpe/data/model/User;", "goToLoginActivity", "goToNonLiveHomeActivity", "goToOnBoardActivity", "goToProfileStatusActivity", "created", "rejected", "goToStreamerHomeActivity", "gotToBanScreen", "metadata", "Lapp/callpe/data/model/Metadata;", "gotToNextScreen", "role", "handleAppType", "userType", "handleInstallReferrer", "installApkProgrammatically", "logIn", "onBackPressed", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "setAlphaAnimation", "v", "Landroid/view/View;", "setCountryListData", "countries", "Ljava/util/ArrayList;", "Lapp/callpe/data/model/CountryModel;", "Lkotlin/collections/ArrayList;", "setSlideAnimation", "delay", "start", "end", "setUpAnimation", "showSnackbar", "message", "function", "Lkotlin/Function0;", "showUpdateDialog", "isCancelable", "feAppUrl", "appVersion", "", "versionInfo", "Companion", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class SplashActivity extends Hilt_SplashActivity {
private static final String TAG = "SplashActivity";
private AlertDialog alertDialog;
@Inject
public ApiService apiService;
public ActivitySplashBinding binding;
private Job delayJob;
private Dialog dialog;
private boolean isNotLive;
private boolean isVitokDownloading;
private AlertDialog languageDialog;
private ActivityResultLauncher<Intent> launcher;
@Inject
public LocalDB localDB;
private DownloadProgressHelper progressHelper;
private InstallReferrerClient referrerClient;
private int retryCount;
private String id = "";
private int maxRetry = 1;
public SplashActivity() {
ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult((ActivityResultContract) new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
public final void onActivityResult(Object obj) {
SplashActivity.launcher$lambda$8(SplashActivity.this, (ActivityResult) obj);
}
});
Intrinsics.checkNotNullExpressionValue(registerForActivityResult, "registerForActivityResul…tically()\n }\n }");
this.launcher = registerForActivityResult;
}
public final ActivitySplashBinding getBinding() {
ActivitySplashBinding activitySplashBinding = this.binding;
if (activitySplashBinding != null) {
return activitySplashBinding;
}
Intrinsics.throwUninitializedPropertyAccessException("binding");
return null;
}
public final void setBinding(ActivitySplashBinding activitySplashBinding) {
Intrinsics.checkNotNullParameter(activitySplashBinding, "<set-?>");
this.binding = activitySplashBinding;
}
public final Job getDelayJob() {
return this.delayJob;
}
public final void setDelayJob(Job job) {
this.delayJob = job;
}
public final ApiService getApiService() {
ApiService apiService = this.apiService;
if (apiService != null) {
return apiService;
}
Intrinsics.throwUninitializedPropertyAccessException("apiService");
return null;
}
public final void setApiService(ApiService apiService) {
Intrinsics.checkNotNullParameter(apiService, "<set-?>");
this.apiService = apiService;
}
public final LocalDB getLocalDB() {
LocalDB localDB = this.localDB;
if (localDB != null) {
return localDB;
}
Intrinsics.throwUninitializedPropertyAccessException("localDB");
return null;
}
public final void setLocalDB(LocalDB localDB) {
Intrinsics.checkNotNullParameter(localDB, "<set-?>");
this.localDB = localDB;
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivitySplashBinding inflate = ActivitySplashBinding.inflate(getLayoutInflater());
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
setBinding(inflate);
setContentView((View) getBinding().getRoot());
setUpAnimation();
versionInfo();
getAppStatus();
}
static void setCountryListData$default(SplashActivity splashActivity, ArrayList arrayList, int i, Object obj) {
if ((i & 1) != 0) {
arrayList = new ArrayList();
}
splashActivity.setCountryListData(arrayList);
}
public final void setCountryListData(ArrayList<CountryModel> countries) {
App.Companion.getCountryList().clear();
App.Companion.getCountryList().addAll(countries);
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new SplashActivity$setCountryListData$1(this, countries, null), 3, (Object) null);
}
private final void setUpAnimation() {
getBinding().imageView2.setVisibility(0);
getBinding().imageView2.setAlpha(0.0f);
getBinding().linearLayout6.setAlpha(0.0f);
getBinding().linearLayout8.setAlpha(0.0f);
ImageView imageView = getBinding().imageView2;
Intrinsics.checkNotNullExpressionValue(imageView, "binding.imageView2");
setAlphaAnimation(imageView);
LinearLayout linearLayout = getBinding().linearLayout6;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.linearLayout6");
setSlideAnimation(linearLayout, JobPriority.MID, -1000, 0);
LinearLayout linearLayout2 = getBinding().linearLayout8;
Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.linearLayout8");
setSlideAnimation(linearLayout2, JobPriority.MID, 1000, 0);
}
private final void setAlphaAnimation(View v) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(v, "alpha", 0.0f, 1.0f);
ofFloat.setDuration(1500L);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ofFloat);
animatorSet.addListener(new AnimatorListenerAdapter() {
});
animatorSet.start();
}
private final void setSlideAnimation(final View v, int delay, int start, int end) {
TimeInterpolator fastOutSlowInInterpolator = new FastOutSlowInInterpolator();
ObjectAnimator objectAnimator = new ObjectAnimator();
objectAnimator.setTarget(v);
objectAnimator.setPropertyName("translationX");
objectAnimator.setFloatValues(start, end);
objectAnimator.setInterpolator(fastOutSlowInInterpolator);
long j = delay;
objectAnimator.setStartDelay(j);
objectAnimator.setDuration(1500L);
Looper myLooper = Looper.myLooper();
Intrinsics.checkNotNull(myLooper);
new Handler(myLooper).postDelayed(new Runnable() {
@Override
public final void run() {
SplashActivity.setSlideAnimation$lambda$0(v);
}
}, j * 2);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(objectAnimator);
animatorSet.addListener(new AnimatorListenerAdapter() {
});
animatorSet.start();
}
public static final void setSlideAnimation$lambda$0(View view) {
Intrinsics.checkNotNullParameter(view, "$v");
view.setAlpha(1.0f);
}
private final void versionInfo() {
TextView textView = getBinding().versionInfo;
Intrinsics.checkNotNullExpressionValue(textView, "binding.versionInfo");
Context context = (Context) this;
int versionCode = Helper.getVersionCode(context);
textView.setText('v' + Helper.getVersionName(context) + " (" + versionCode + ')');
}
public final void logIn() {
Timber.e("logIn: " + isLoggedIn(), new Object[0]);
if (isLoggedIn()) {
Context context = (Context) this;
FirebaseNotificationService.INSTANCE.fetchFCMToken(context);
SharedPref.getBoolean(context, PrefKeys.USER_DETAILS_AVAILABLE);
getUserMetaData();
return;
}
this.delayJob = BuildersKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getIO()), (CoroutineContext) null, (CoroutineStart) null, new SplashActivity$logIn$1(this, null), 3, (Object) null);
}
public final boolean isLoggedIn() {
String string = SharedPref.getString((Context) this, PrefKeys.ACCOUNT_ID);
Intrinsics.checkNotNullExpressionValue(string, "getString(this, PrefKeys.ACCOUNT_ID)");
this.id = string;
Timber.e("Account Id: " + this.id, new Object[0]);
return this.id.length() > 0;
}
public final void getAppStatus() {
Context context = (Context) this;
if (!ContextExtKt.isConnected(context)) {
String string = getString(2131951841);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.check_internet_connection)");
showSnackbar(string, new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m683invoke();
return Unit.INSTANCE;
}
public final void m683invoke() {
SplashActivity.this.getAppStatus();
}
});
return;
}
if (LoginActivity.INSTANCE.isVitok()) {
this.isNotLive = false;
SharedPref.setBoolean(context, PrefKeys.IS_NOT_LIVE, false);
ProgressBar progressBar = getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar, "binding.progress");
progressBar.setVisibility(0);
ApiService.DefaultImpls.getAppStatus$default(getApiService(), "app.b1k0", null, null, 6, null).enqueue(new Callback<AppModel>() {
public void onResponse(Call<AppModel> call, Response<AppModel> response) {
Unit unit;
Intrinsics.checkNotNullParameter(call, "call");
Intrinsics.checkNotNullParameter(response, "response");
Timber.d("onResponse: %s", new Object[]{response.raw()});
if (response.isSuccessful()) {
ProgressBar progressBar2 = SplashActivity.this.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar2, "binding.progress");
progressBar2.setVisibility(8);
if (response.body() != null) {
try {
AppModel appModel = (AppModel) response.body();
if (appModel != null) {
SplashActivity splashActivity = SplashActivity.this;
ArrayList<CountryModel> countries = appModel.getCountries();
if (countries == null) {
countries = new ArrayList<>();
}
splashActivity.setCountryListData(countries);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.FIREBASE_OTP, false);
SharedPref.setString((Context) splashActivity, PrefKeys.PRIVACY_POLICY, appModel.getGetPrivacyPolicy());
SharedPref.setString((Context) splashActivity, PrefKeys.TERMS_AND_CONDITIONS, appModel.getGetTermsAndConditions());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.ENABLE_SCREENSHOTS, appModel.getEnableScreenshots());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.USE_OLD_API, appModel.getUseOldLoginApi());
Timber.e("onResponse : SP " + appModel.getUseOldLoginApi(), new Object[0]);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.INTERNATIONAL_STREAMERS_ENABLED, appModel.getInternationalStreamersEnabled());
Context context2 = (Context) splashActivity;
Boolean allowAgencyCreation = appModel.getAllowAgencyCreation();
SharedPref.setBoolean(context2, PrefKeys.ALLOW_AGENCY_CREATION, allowAgencyCreation != null ? allowAgencyCreation.booleanValue() : false);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.WHATS_APP_OTP, appModel.getWhatsAppOtp());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.LOCK_CHAT_MESSAGES_AFTER_FREE_PERIOD, appModel.getLockChatMessagesAfterFreePeriod());
Timber.d("FLAG_SECURE streamer, enable ss :" + appModel.getEnableScreenshots(), new Object[0]);
App.Companion.setFlagSecureDisabled(appModel.getEnableScreenshots());
if (LoginActivity.INSTANCE.isVitok()) {
splashActivity.logIn();
return;
}
if (appModel.getVersion() <= Helper.getVersionCode((Context) splashActivity)) {
splashActivity.logIn();
return;
}
if (appModel.getAppUrl() != null) {
splashActivity.showUpdateDialog(false, appModel.getAppUrl(), appModel.getVersion());
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
SplashActivity$getAppStatus$2 splashActivity$getAppStatus$2 = this;
ActivityExtKt.toast((Activity) splashActivity, "Download url not present");
return;
}
return;
}
return;
} catch (Exception unused) {
return;
}
}
return;
}
ProgressBar progressBar3 = SplashActivity.this.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar3, "binding.progress");
progressBar3.setVisibility(8);
APIError parseError = ErrorHandler.parseError(response);
Intrinsics.checkNotNullExpressionValue(parseError, "parseError(response)");
SplashActivity splashActivity2 = SplashActivity.this;
String reason = parseError.getReason();
if (reason == null) {
reason = SplashActivity.this.getString(2131952996);
Intrinsics.checkNotNullExpressionValue(reason, "getString(R.string.toast_error_message)");
}
final SplashActivity splashActivity3 = SplashActivity.this;
splashActivity2.showSnackbar(reason, new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m685invoke();
return Unit.INSTANCE;
}
public final void m685invoke() {
SplashActivity.this.getAppStatus();
}
});
CrashLogHelper.Companion companion = CrashLogHelper.INSTANCE;
String response2 = response.raw().toString();
String reason2 = parseError.getReason();
if (reason2 == null) {
reason2 = "";
}
companion.logApiError(response2, reason2);
}
public void onFailure(Call<AppModel> call, Throwable t) {
Intrinsics.checkNotNullParameter(call, "call");
Intrinsics.checkNotNullParameter(t, "t");
ProgressBar progressBar2 = SplashActivity.this.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar2, "binding.progress");
progressBar2.setVisibility(8);
SplashActivity splashActivity = SplashActivity.this;
String string2 = splashActivity.getString(2131951841);
Intrinsics.checkNotNullExpressionValue(string2, "getString(R.string.check_internet_connection)");
final SplashActivity splashActivity2 = SplashActivity.this;
splashActivity.showSnackbar(string2, new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m684invoke();
return Unit.INSTANCE;
}
public final void m684invoke() {
SplashActivity.this.getAppStatus();
}
});
}
});
return;
}
if (Helper.isGooglePlayServicesAvailable(context)) {
String token = FirebaseNotificationService.INSTANCE.getToken(context);
if (token.length() == 0) {
ProgressBar progressBar2 = getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar2, "binding.progress");
progressBar2.setVisibility(0);
Task token2 = FirebaseMessaging.getInstance().getToken();
final Function1<String, Unit> function1 = new Function1<String, Unit>() {
{
super(1);
}
public Object invoke(Object obj) {
invoke((String) obj);
return Unit.INSTANCE;
}
public final void invoke(String str) {
Intrinsics.checkNotNullParameter(str, "token");
if (!TextUtils.isEmpty(str)) {
Timber.d("retrieve token successful : " + str, new Object[0]);
return;
}
Timber.w("token should not be null...", new Object[0]);
ProgressBar progressBar3 = SplashActivity.this.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar3, "binding.progress");
progressBar3.setVisibility(8);
}
};
token2.addOnSuccessListener(new OnSuccessListener() {
public final void onSuccess(Object obj) {
SplashActivity.getAppStatus$lambda$1(function1, obj);
}
}).addOnFailureListener(new OnFailureListener() {
public final void onFailure(Exception exc) {
SplashActivity.getAppStatus$lambda$2(SplashActivity.this, exc);
}
}).addOnCompleteListener(new OnCompleteListener() {
public final void onComplete(Task task) {
SplashActivity.getAppStatus$lambda$4(SplashActivity.this, task);
}
});
return;
}
ProgressBar progressBar3 = getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar3, "binding.progress");
progressBar3.setVisibility(0);
BuildersKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getDefault()), (CoroutineContext) null, (CoroutineStart) null, new SplashActivity$getAppStatus$6(this, token, null), 3, (Object) null);
return;
}
ProgressBar progressBar4 = getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar4, "binding.progress");
progressBar4.setVisibility(0);
BuildersKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getDefault()), (CoroutineContext) null, (CoroutineStart) null, new SplashActivity$getAppStatus$7(this, null), 3, (Object) null);
}
public static final void getAppStatus$lambda$1(Function1 function1, Object obj) {
Intrinsics.checkNotNullParameter(function1, "$tmp0");
function1.invoke(obj);
}
public static final void getAppStatus$lambda$2(SplashActivity splashActivity, Exception exc) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
ProgressBar progressBar = splashActivity.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar, "binding.progress");
progressBar.setVisibility(8);
}
public static final void getAppStatus$lambda$4(final SplashActivity splashActivity, Task task) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
Intrinsics.checkNotNullParameter(task, "task");
ProgressBar progressBar = splashActivity.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar, "binding.progress");
progressBar.setVisibility(8);
if (task.isSuccessful()) {
String str = (String) task.getResult();
if (str != null) {
if (str.length() > 0) {
Timber.d("FCM Token " + str, new Object[0]);
SharedPreferences.Editor edit = splashActivity.getSharedPreferences("vitok_perf_fcm", 0).edit();
edit.putString("fcm", str).apply();
edit.apply();
splashActivity.getAppStatus();
AdjustAnalyticsHelper adjustAnalyticsHelper = AdjustAnalyticsHelper.INSTANCE;
Context applicationContext = splashActivity.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
adjustAnalyticsHelper.setUpPushToken(str, applicationContext);
return;
}
splashActivity.showSnackbar("Failed to retrieve FCM token. Please try again.", new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m686invoke();
return Unit.INSTANCE;
}
public final void m686invoke() {
Helper.INSTANCE.triggerRebirth((Context) SplashActivity.this);
}
});
return;
}
return;
}
Timber.e("retryCount " + splashActivity.retryCount, new Object[0]);
int i = splashActivity.retryCount + 1;
splashActivity.retryCount = i;
if (i > splashActivity.maxRetry) {
CrashLogHelper.INSTANCE.logError("Failed to retrieve FCM token.");
splashActivity.showSnackbar("Failed to retrieve FCM token. Please try again.", new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m687invoke();
return Unit.INSTANCE;
}
public final void m687invoke() {
SplashActivity.this.retryCount = 0;
SplashActivity.this.getAppStatus();
}
});
} else {
splashActivity.getAppStatus();
}
}
public final void fetchAppInfo(String referrer, IPModel ipModel, final String fcmId) {
String str;
if (ipModel != null) {
SharedPref.setString((Context) this, PrefKeys.IP_DETAILS, new Gson().toJson(ipModel));
}
ApiService apiService = getApiService();
if (ipModel == null || (str = ipModel.getCountryCode()) == null) {
str = "IN";
}
apiService.getAppStatus("app.b1k0", referrer, str).enqueue(new Callback<AppModel>() {
public void onResponse(Call<AppModel> call, Response<AppModel> response) {
boolean z;
Intrinsics.checkNotNullParameter(call, "call");
Intrinsics.checkNotNullParameter(response, "response");
Timber.d("onResponse: %s", new Object[]{response.raw()});
if (response.isSuccessful()) {
if (response.body() != null) {
try {
AppModel appModel = (AppModel) response.body();
if (appModel != null) {
SplashActivity splashActivity = SplashActivity.this;
String str2 = fcmId;
ArrayList<CountryModel> countries = appModel.getCountries();
if (countries == null) {
countries = new ArrayList<>();
}
splashActivity.setCountryListData(countries);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.TRUE_CALLER_LOGIN, appModel.getTruecallerLogin());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.GOOGLE_LOGIN, appModel.getGoogleLogin());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.DEVICE_LOGIN, appModel.getDeviceLogin());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.OTP_LOGIN, appModel.getOtpLogin());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.FIREBASE_OTP, false);
SharedPref.setInt((Context) splashActivity, PrefKeys.OTP_WAIT_TIME, appModel.getOtpWaitTime());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.HIDE_CALL_RATE, false);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.HIDE_STREAMER_PICS, appModel.getHideStreamerPics());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.USE_OLD_API, appModel.getUseOldLoginApi());
SharedPref.setString((Context) splashActivity, PrefKeys.GRIEVANCE_FORM_URL, appModel.getGetGrievanceFrom());
SharedPref.setString((Context) splashActivity, PrefKeys.PRIVACY_POLICY, appModel.getGetPrivacyPolicy());
SharedPref.setString((Context) splashActivity, PrefKeys.TERMS_AND_CONDITIONS, appModel.getGetTermsAndConditions());
SharedPref.setString((Context) splashActivity, PrefKeys.PRICING_POLICY, appModel.getGetPricingPolicy());
SharedPref.setString((Context) splashActivity, PrefKeys.COMMUNITY_GUIDELINES, appModel.getGetCommunityGuidelines());
SharedPref.setString((Context) splashActivity, PrefKeys.COMPLIANCE_STATEMENT, appModel.getGetComplianceStatement());
SharedPref.setString((Context) splashActivity, PrefKeys.CONTENT_MODERATION_POLICY, appModel.getGetContentModerationPolicy());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.ENABLE_SCREENSHOTS, appModel.getEnableScreenshots());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.WHATS_APP_OTP, appModel.getWhatsAppOtp());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.LOCK_CHAT_MESSAGES_AFTER_FREE_PERIOD, appModel.getLockChatMessagesAfterFreePeriod());
Timber.d("FLAG_SECURE server value = enable ss :" + appModel.getEnableScreenshots(), new Object[0]);
App.Companion.setFlagSecureDisabled(appModel.getEnableScreenshots());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.NEW_GST_UI, false);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.BLOCK_LIVESTREAM_UNPAID_USER_MESSAGE, true);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.IS_COHOST_ENABLED, true);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.SUPPORT_CHAT_ONLY_FOR_VIP, appModel.getSupportChatOnlyVip());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.TICKETS, appModel.getTickets());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.ADJUST_TRACKING_ENABLED, appModel.getAdjustTracking());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.APPS_FLYER_TRACKING, appModel.getAppsflyerTracking());
if (!AdjustAnalyticsHelper.INSTANCE.isAdjustSdkEnabled() && appModel.getAdjustTracking()) {
AdjustAnalyticsHelper.INSTANCE.setAdjustSdkEnabled(true);
AdjustAnalyticsHelper adjustAnalyticsHelper = AdjustAnalyticsHelper.INSTANCE;
Context applicationContext = splashActivity.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
adjustAnalyticsHelper.initAdjustSdk(applicationContext, new Function1<String, Unit>() {
public Object invoke(Object obj) {
invoke((String) obj);
return Unit.INSTANCE;
}
public final void invoke(String str3) {
Intrinsics.checkNotNullParameter(str3, "adjustConfig");
Timber.d("Adjust Config: " + str3, new Object[0]);
}
});
}
AdjustAnalyticsHelper.INSTANCE.setValueToAdjustSdkToEnabled((Context) splashActivity);
AdjustAnalyticsHelper adjustAnalyticsHelper2 = AdjustAnalyticsHelper.INSTANCE;
Context applicationContext2 = splashActivity.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext2, "applicationContext");
adjustAnalyticsHelper2.setUpPushToken(str2, applicationContext2);
SharedPref.setInt((Context) splashActivity, PrefKeys.UNLOCKED_PICS_COUNT, Integer.MAX_VALUE);
boolean z2 = SharedPref.getBoolean((Context) splashActivity, PrefKeys.IS_NOT_LIVE);
String appMode = appModel.getAppMode();
if (appMode == null) {
appMode = PrefKeys.IS_LIVE;
}
splashActivity.isNotLive = Intrinsics.areEqual(appMode, "LISTING");
z = splashActivity.isNotLive;
SharedPref.setBoolean((Context) splashActivity, PrefKeys.IS_NOT_LIVE, z);
SharedPref.setBoolean((Context) splashActivity, PrefKeys.USE_WEB_VIEW_VIDEO_CALL, appModel.getWebviewVideoCall());
SharedPref.setBoolean((Context) splashActivity, PrefKeys.USE_WEB_VIEW_LIVESTREAM, appModel.getWebviewLivestream());
App.Companion.setWebViewVideoCall(appModel.getWebviewVideoCall());
App.Companion.setWebViewLivestream(appModel.getWebviewLivestream());
Timber.d("Live " + z2, new Object[0]);
splashActivity.logIn();
return;
}
return;
} catch (Exception unused) {
return;
}
}
return;
}
ProgressBar progressBar = SplashActivity.this.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar, "binding.progress");
progressBar.setVisibility(8);
APIError parseError = ErrorHandler.parseError(response);
Intrinsics.checkNotNullExpressionValue(parseError, "parseError(response)");
SplashActivity splashActivity2 = SplashActivity.this;
String reason = parseError.getReason();
if (reason == null) {
reason = SplashActivity.this.getString(2131952996);
Intrinsics.checkNotNullExpressionValue(reason, "getString(R.string.toast_error_message)");
}
final SplashActivity splashActivity3 = SplashActivity.this;
splashActivity2.showSnackbar(reason, new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m682invoke();
return Unit.INSTANCE;
}
public final void m682invoke() {
SplashActivity.this.getAppStatus();
}
});
CrashLogHelper.Companion companion = CrashLogHelper.INSTANCE;
String response2 = response.raw().toString();
String reason2 = parseError.getReason();
if (reason2 == null) {
reason2 = "";
}
companion.logApiError(response2, reason2);
}
public void onFailure(Call<AppModel> call, Throwable t) {
Intrinsics.checkNotNullParameter(call, "call");
Intrinsics.checkNotNullParameter(t, "t");
ProgressBar progressBar = SplashActivity.this.getBinding().progress;
Intrinsics.checkNotNullExpressionValue(progressBar, "binding.progress");
progressBar.setVisibility(8);
SplashActivity splashActivity = SplashActivity.this;
String string = splashActivity.getString(2131951841);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.check_internet_connection)");
final SplashActivity splashActivity2 = SplashActivity.this;
splashActivity.showSnackbar(string, new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m681invoke();
return Unit.INSTANCE;
}
public final void m681invoke() {
SplashActivity.this.getAppStatus();
}
});
}
});
}
private final void getUserMetaData() {
Context context = (Context) this;
if (!ContextExtKt.isConnected(context)) {
String string = getString(2131951841);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.check_internet_connection)");
ActivityExtKt.toast((Activity) this, string);
return;
}
final String string2 = SharedPref.getString(context, PrefKeys.USER_ROLE);
if (string2 == null) {
string2 = "";
}
String token = FirebaseNotificationService.INSTANCE.getToken(context);
Call<app.callpe.data.model.Metadata> metaData = getApiService().getMetaData();
if (token.length() > 0) {
metaData = getApiService().getMetaDataWithHeader(token);
}
metaData.enqueue(new Callback<app.callpe.data.model.Metadata>() {
public void onResponse(retrofit2.Call<app.callpe.data.model.Metadata> r14, retrofit2.Response<app.callpe.data.model.Metadata> r15) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.SplashActivity$getUserMetaData$1.onResponse(retrofit2.Call, retrofit2.Response):void");
}
public void onFailure(Call<app.callpe.data.model.Metadata> call, Throwable t) {
Intrinsics.checkNotNullParameter(call, "call");
Intrinsics.checkNotNullParameter(t, "t");
SplashActivity.this.gotToNextScreen(string2);
}
});
}
public final java.lang.Object getUserIPCountry(kotlin.coroutines.Continuation<? super app.callpe.data.model.IPModel> r6) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.SplashActivity.getUserIPCountry(kotlin.coroutines.Continuation):java.lang.Object");
}
public final void gotToBanScreen(app.callpe.data.model.Metadata metadata) {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, false);
BanDetails banDetails = metadata.getUser().getBanDetails();
if (banDetails != null) {
Timber.e("ban " + banDetails, new Object[0]);
Intent intent = new Intent(context, (Class<?>) BanActivity.class);
String banTime = banDetails.getBanTime();
if (banTime != null) {
intent.putExtra("banTime", DateHelper.INSTANCE.getTimeDifferenceMillis(banTime));
}
intent.putExtra("remarks", banDetails.getRemarks());
intent.putExtra("permanent", banDetails.getPermanent());
intent.putExtra("userId", metadata.getUser().getId());
startActivity(intent);
finish();
}
}
public final void gotToNextScreen(app.callpe.data.model.Metadata r5) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.SplashActivity.gotToNextScreen(app.callpe.data.model.Metadata):void");
}
public final void goToInputUserInfoActivity(User user) {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, false);
Intent intent = new Intent(context, (Class<?>) OnboardActivity.class);
intent.putExtra("user", new Gson().toJson(user));
intent.addFlags(268468224);
startActivity(intent);
}
public final void handleAppType(String userType) {
Timber.e("user role " + userType, new Object[0]);
if (LoginActivity.INSTANCE.isVitok()) {
return;
}
if (Intrinsics.areEqual(userType, "STREAMER") || Intrinsics.areEqual(userType, "AGENT")) {
Helper.signOut$default((Context) this, null, 2, null);
}
}
public final void gotToNextScreen(String role) {
if (LoginActivity.INSTANCE.isVitok() && (Intrinsics.areEqual(role, "STREAMER") || Intrinsics.areEqual(role, "AGENT"))) {
if (Intrinsics.areEqual(role, "STREAMER")) {
goToStreamerHomeActivity();
return;
} else {
goToAgentActivity();
return;
}
}
if (this.isNotLive) {
goToNonLiveHomeActivity();
} else if (Intrinsics.areEqual(role, "USER")) {
goToHomeActivity();
}
}
private final void goToHomeActivity() {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, true);
Intent intent = new Intent(context, (Class<?>) HomeActivity.class);
intent.addFlags(268468224);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
private final void goToNonLiveHomeActivity() {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, true);
Intent intent = new Intent(context, (Class<?>) NonLiveHomeActivity.class);
intent.addFlags(268468224);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
private final void goToStreamerHomeActivity() {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, true);
Intent intent = new Intent(context, (Class<?>) StreamerHomeActivity.class);
intent.addFlags(268468224);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
private final void goToAgentActivity() {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, true);
Intent intent = new Intent(context, (Class<?>) AgentHomeActivity.class);
intent.addFlags(268468224);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
static void goToOnBoardActivity$default(SplashActivity splashActivity, User user, int i, Object obj) {
if ((i & 1) != 0) {
user = null;
}
splashActivity.goToOnBoardActivity(user);
}
private final void goToOnBoardActivity(User user) {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, false);
Intent intent = new Intent(context, (Class<?>) OnboardActivity.class);
if (this.isNotLive) {
intent = new Intent(context, (Class<?>) NonLiveOnboardActivity.class);
}
intent.addFlags(268468224);
intent.putExtra("user", new Gson().toJson(user));
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
static void goToProfileStatusActivity$default(SplashActivity splashActivity, boolean z, boolean z2, User user, int i, Object obj) {
if ((i & 4) != 0) {
user = null;
}
splashActivity.goToProfileStatusActivity(z, z2, user);
}
private final void goToProfileStatusActivity(boolean created, boolean rejected, User user) {
Context context = (Context) this;
SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, false);
Intent intent = new Intent(context, (Class<?>) StreamerProfileStatusActivity.class);
intent.addFlags(268468224);
intent.putExtra("status_created", created);
intent.putExtra("status_rejected", rejected);
intent.putExtra("user", new Gson().toJson(user));
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
public final void goToLoginActivity() {
Intent intent = new Intent((Context) this, (Class<?>) LoginActivity.class);
intent.addFlags(268468224);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
protected void onDestroy() {
super.onDestroy();
AlertDialog alertDialog = this.languageDialog;
if (alertDialog != null) {
Intrinsics.checkNotNull(alertDialog);
alertDialog.dismiss();
}
Dialog dialog = this.dialog;
if (dialog != null) {
Intrinsics.checkNotNull(dialog);
dialog.dismiss();
}
AlertDialog alertDialog2 = this.alertDialog;
if (alertDialog2 != null) {
Intrinsics.checkNotNull(alertDialog2);
alertDialog2.dismiss();
}
Job job = this.delayJob;
if (job != null) {
Job.DefaultImpls.cancel$default(job, (CancellationException) null, 1, (Object) null);
}
}
public static final void launcher$lambda$8(SplashActivity splashActivity, ActivityResult activityResult) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
Intrinsics.checkNotNullParameter(activityResult, "result");
if (activityResult.getResultCode() == -1) {
splashActivity.installApkProgrammatically();
}
}
public final void showUpdateDialog(boolean isCancelable) {
Window window;
Window window2;
try {
AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
LayoutInflater layoutInflater = getLayoutInflater();
Intrinsics.checkNotNullExpressionValue(layoutInflater, "layoutInflater");
View inflate = layoutInflater.inflate(2131559115, (ViewGroup) null);
Intrinsics.checkNotNullExpressionValue(inflate, "inflater.inflate(R.layout.update_popup, null)");
MaterialButton findViewById = inflate.findViewById(2131365240);
MaterialButton findViewById2 = inflate.findViewById(2131365242);
ImageView imageView = (ImageView) inflate.findViewById(2131365244);
builder.setCancelable(isCancelable);
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity.showUpdateDialog$lambda$9(SplashActivity.this, view);
}
});
builder.setView(inflate);
if (!isCancelable) {
imageView.setVisibility(8);
findViewById2.setVisibility(8);
}
findViewById2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity.showUpdateDialog$lambda$10(SplashActivity.this, view);
}
});
this.alertDialog = builder.create();
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity.showUpdateDialog$lambda$11(SplashActivity.this, view);
}
});
AlertDialog alertDialog = this.alertDialog;
Window window3 = (Window) Objects.requireNonNull(alertDialog != null ? alertDialog.getWindow() : null);
if (window3 != null) {
window3.clearFlags(131080);
}
AlertDialog alertDialog2 = this.alertDialog;
if (alertDialog2 != null && (window2 = alertDialog2.getWindow()) != null) {
window2.setSoftInputMode(4);
}
AlertDialog alertDialog3 = this.alertDialog;
if (alertDialog3 != null) {
alertDialog3.show();
}
AlertDialog alertDialog4 = this.alertDialog;
if (alertDialog4 == null || (window = alertDialog4.getWindow()) == null) {
return;
}
window.setBackgroundDrawable(new ColorDrawable(0));
} catch (Exception e) {
Timber.e(e, "showChangePasswordDialog ", new Object[0]);
}
}
public static final void showUpdateDialog$lambda$9(SplashActivity splashActivity, View view) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
try {
String string = splashActivity.getString(2131951676);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.app_package)");
try {
splashActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
splashActivity.finishAffinity();
} catch (ActivityNotFoundException unused) {
splashActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
splashActivity.finishAffinity();
}
} catch (Exception unused2) {
}
}
public static final void showUpdateDialog$lambda$10(SplashActivity splashActivity, View view) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
AlertDialog alertDialog = splashActivity.alertDialog;
Intrinsics.checkNotNull(alertDialog);
alertDialog.dismiss();
}
public static final void showUpdateDialog$lambda$11(SplashActivity splashActivity, View view) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
AlertDialog alertDialog = splashActivity.alertDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
public final void showUpdateDialog(boolean isCancelable, final String feAppUrl, long appVersion) {
Window window;
Window window2;
try {
Log.d("User app url", feAppUrl);
DownloadProgressHelper downloadProgressHelper = new DownloadProgressHelper((Context) this, (Activity) this);
this.progressHelper = downloadProgressHelper;
downloadProgressHelper.setCancelable(isCancelable);
AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
LayoutInflater layoutInflater = getLayoutInflater();
Intrinsics.checkNotNullExpressionValue(layoutInflater, "layoutInflater");
View inflate = layoutInflater.inflate(2131559115, (ViewGroup) null);
MaterialButton findViewById = inflate.findViewById(2131365240);
MaterialButton findViewById2 = inflate.findViewById(2131365242);
TextView textView = (TextView) inflate.findViewById(2131363406);
ImageView imageView = (ImageView) inflate.findViewById(2131365244);
builder.setCancelable(isCancelable);
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity.showUpdateDialog$lambda$12(SplashActivity.this, feAppUrl, view);
}
});
builder.setView(inflate);
imageView.setVisibility(8);
findViewById2.setVisibility(8);
Intrinsics.checkNotNullExpressionValue(textView, "versionTv");
textView.setVisibility(0);
StringBuilder sb = new StringBuilder();
sb.append('v');
sb.append(appVersion);
textView.setText(sb.toString());
AlertDialog create = builder.create();
this.alertDialog = create;
((Window) Objects.requireNonNull(create != null ? create.getWindow() : null)).clearFlags(131080);
AlertDialog alertDialog = this.alertDialog;
if (alertDialog != null && (window2 = alertDialog.getWindow()) != null) {
window2.setSoftInputMode(4);
}
AlertDialog alertDialog2 = this.alertDialog;
if (alertDialog2 != null) {
alertDialog2.show();
}
AlertDialog alertDialog3 = this.alertDialog;
if (alertDialog3 == null || (window = alertDialog3.getWindow()) == null) {
return;
}
window.setBackgroundDrawable(new ColorDrawable(0));
} catch (Exception e) {
Timber.e(e, "showChangePasswordDialog ", new Object[0]);
}
}
public static final void showUpdateDialog$lambda$12(SplashActivity splashActivity, String str, View view) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
Intrinsics.checkNotNullParameter(str, "$feAppUrl");
try {
splashActivity.downloadApk(str);
} catch (Exception unused) {
}
}
public final void installApkProgrammatically() {
try {
Activity activity = (Activity) this;
File file = new File(activity.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "vitok.apk");
if (file.exists()) {
if (Build.VERSION.SDK_INT >= 26) {
Intent intent = new Intent("android.settings.MANAGE_UNKNOWN_APP_SOURCES");
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format("package:%s", Arrays.copyOf(new Object[]{activity.getPackageName()}, 1));
Intrinsics.checkNotNullExpressionValue(format, "format(format, *args)");
Intent data = intent.setData(Uri.parse(format));
Intrinsics.checkNotNullExpressionValue(data, "Intent(Settings.ACTION_M… )");
if (!activity.getPackageManager().canRequestPackageInstalls()) {
this.launcher.launch(data);
} else {
Uri uriForFile = FileProvider.getUriForFile(activity.getBaseContext(), activity.getApplicationContext().getPackageName() + ".provider", file);
Intent intent2 = new Intent("android.intent.action.VIEW", uriForFile);
intent2.putExtra("android.intent.extra.NOT_UNKNOWN_SOURCE", true);
intent2.setDataAndType(uriForFile, "application/vnd.android.package-archive");
intent2.setFlags(268468224);
intent2.addFlags(1);
startActivity(intent2);
}
} else {
Intent intent3 = new Intent("android.intent.action.INSTALL_PACKAGE");
Uri uriForFile2 = FileProvider.getUriForFile(activity.getApplicationContext(), "app.b1k0.provider", file);
Intrinsics.checkNotNullExpressionValue(uriForFile2, "getUriForFile(\n …ile\n )");
activity.grantUriPermission(activity.getPackageName(), uriForFile2, 1);
activity.grantUriPermission(activity.getPackageName(), uriForFile2, 2);
intent3.setDataAndType(uriForFile2, "application/*");
intent3.setFlags(268435456);
intent3.addFlags(1);
intent3.addFlags(2);
startActivity(intent3);
}
} else {
Toast.makeText(activity, getString(2131952060), 0).show();
Timber.i(" file " + file.getPath() + " does not exist", new Object[0]);
}
} catch (Exception e) {
Timber.i("%s", new Object[]{e.getMessage()});
}
}
private final void downloadApk(String url) {
if (this.isVitokDownloading) {
Toast.makeText((Context) this, "Download already started.", 0).show();
return;
}
File externalFilesDir = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
File file = new File(externalFilesDir, "vitok.apk");
if (file.exists()) {
PackageInfo packageArchiveInfo = getPackageManager().getPackageArchiveInfo(file.getPath(), 0);
Intrinsics.checkNotNull(packageArchiveInfo);
Context context = (Context) this;
if (packageArchiveInfo.versionCode == Helper.getVersionCode(context)) {
Timber.i("package version is same", new Object[0]);
file.delete();
} else if (packageArchiveInfo.versionCode > Helper.getVersionCode(context)) {
Timber.i("package version is greater then current", new Object[0]);
installApkProgrammatically();
return;
} else {
Timber.i("package version is smaller then current", new Object[0]);
file.delete();
}
}
Intrinsics.checkNotNull(externalFilesDir);
DownloadRequest build = PRDownloader.download(url, externalFilesDir.getPath(), "vitok.apk").setPriority(Priority.IMMEDIATE).build();
this.isVitokDownloading = true;
build.start(new OnDownloadListener() {
public void onDownloadComplete() {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.SplashActivity$downloadApk$1.onDownloadComplete():void");
}
public void onError(com.downloader.Error r3) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.SplashActivity$downloadApk$1.onError(com.downloader.Error):void");
}
});
build.setOnStartOrResumeListener(new OnStartOrResumeListener() {
public final void onStartOrResume() {
SplashActivity.downloadApk$lambda$13(SplashActivity.this);
}
});
build.setOnProgressListener(new OnProgressListener() {
public final void onProgress(Progress progress) {
SplashActivity.downloadApk$lambda$14(SplashActivity.this, progress);
}
});
}
public static final void downloadApk$lambda$13(SplashActivity splashActivity) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
DownloadProgressHelper downloadProgressHelper = splashActivity.progressHelper;
if (downloadProgressHelper != null) {
if (downloadProgressHelper != null) {
downloadProgressHelper.dismiss(splashActivity);
}
DownloadProgressHelper downloadProgressHelper2 = splashActivity.progressHelper;
if (downloadProgressHelper2 != null) {
downloadProgressHelper2.setProgressDialog();
}
}
}
public static final void downloadApk$lambda$14(SplashActivity splashActivity, Progress progress) {
Intrinsics.checkNotNullParameter(splashActivity, "this$0");
Intrinsics.checkNotNullParameter(progress, "progress");
float f = (progress.currentBytes * 100) / progress.totalBytes;
DownloadProgressHelper downloadProgressHelper = splashActivity.progressHelper;
if (downloadProgressHelper != null && downloadProgressHelper != null) {
downloadProgressHelper.progressDialogPercent(f);
}
Timber.e("Download Progress %s", new Object[]{Float.valueOf(f)});
}
public final void showSnackbar(String message, final Function0<Unit> function) {
Snackbar make = Snackbar.make(getBinding().getRoot(), message, -2);
Intrinsics.checkNotNullExpressionValue(make, "make(binding.root, messa…ackbar.LENGTH_INDEFINITE)");
make.setAction("Retry", new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity.showSnackbar$lambda$15(function, view);
}
});
make.show();
}
public static final void showSnackbar$lambda$15(Function0 function0, View view) {
Intrinsics.checkNotNullParameter(function0, "$function");
function0.invoke();
}
public void onBackPressed() {
super.onBackPressed();
finish();
}
public final java.lang.Object handleInstallReferrer(kotlin.coroutines.Continuation<? super java.lang.String> r5) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.SplashActivity.handleInstallReferrer(kotlin.coroutines.Continuation):java.lang.Object");
}
public final java.lang.Object getInstallReferrer(kotlin.coroutines.Continuation<? super java.lang.String> r13) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.SplashActivity.getInstallReferrer(kotlin.coroutines.Continuation):java.lang.Object");
}
}