导航菜单

页面标题

页面副标题

BodyTech v7.6.4 - SplashActivity.java 源代码

正在查看: BodyTech v7.6.4 应用的 SplashActivity.java JAVA 源代码文件

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


package com.fitnessmobileapps.fma.feature.splash;

import a2.b;
import android.R;
import android.content.ComponentCallbacks;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import androidx.compose.runtime.internal.StabilityInferred;
import androidx.core.content.ContextCompat;
import androidx.exifinterface.media.ExifInterface;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.preference.PreferenceManager;
import androidx.savedstate.SavedStateRegistryOwner;
import com.fitnessmobileapps.fma.core.domain.a0;
import com.fitnessmobileapps.fma.core.domain.interactor.ReportForcedLogoutEvents;
import com.fitnessmobileapps.fma.core.feature.analytics.mixpanel.MixpanelLogger;
import com.fitnessmobileapps.fma.core.flags.DevelopmentFlags;
import com.fitnessmobileapps.fma.feature.common.activity.BmaAppCompatActivity;
import com.fitnessmobileapps.fma.feature.notifications.domain.interactors.model.NotificationType;
import com.fitnessmobileapps.fma.feature.splash.domain.interactor.InitializeApplicationData;
import com.fitnessmobileapps.fma.geofence.GeofenceRegistrationReceiver;
import com.fitnessmobileapps.fma.model.Visit;
import com.fitnessmobileapps.fma.model.views.ReviewEvent;
import com.fitnessmobileapps.fma.util.DeepLink;
import com.fitnessmobileapps.fma.util.GlobalKeyPair;
import com.fitnessmobileapps.fma.util.j0;
import com.fitnessmobileapps.fma.util.q0;
import com.fitnessmobileapps.fma.util.t;
import com.fitnessmobileapps.fma.util.t0;
import com.fitnessmobileapps.fma.util.v0;
import com.fitnessmobileapps.fma.util.y;
import com.fitnessmobileapps.fma.util.z;
import com.mindbodyonline.domain.dataModels.GiftCard;
import com.mindbodyonline.gatekeeper.GateKeeper;
import com.mindbodyonline.gatekeeper.e;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import kotlin.Function;
import kotlin.Lazy;
import kotlin.LazyThreadSafetyMode;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.a0;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.r;
import kotlin.jvm.internal.v;
import kotlin.text.s;
import nn.a;
import w5.a;

@StabilityInferred(parameters = 0)
@Metadata(d1 = {"\u0000Ú\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\t\b\u0017\u0018\u0000 \u007f2\u00020\u0001:\u0002\u0080\u0001B\u0007¢\u0006\u0004\b}\u0010~J\b\u0010\u0003\u001a\u00020\u0002H\u0002J\u0010\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004H\u0002J\b\u0010\u0007\u001a\u00020\u0002H\u0002J\b\u0010\b\u001a\u00020\u0002H\u0002J\u0010\u0010\u000b\u001a\u00020\u00022\u0006\u0010\n\u001a\u00020\tH\u0002J\b\u0010\f\u001a\u00020\u0002H\u0002J\b\u0010\r\u001a\u00020\u0002H\u0002J\b\u0010\u000e\u001a\u00020\u0002H\u0002J\b\u0010\u000f\u001a\u00020\u0002H\u0002J\u0010\u0010\u0012\u001a\u00020\u00022\u0006\u0010\u0011\u001a\u00020\u0010H\u0002J\u0012\u0010\u0015\u001a\u00020\u00022\b\u0010\u0014\u001a\u0004\u0018\u00010\u0013H\u0002J\b\u0010\u0017\u001a\u00020\u0016H\u0002J\b\u0010\u0018\u001a\u00020\tH\u0002J\u0016\u0010\u001b\u001a\u00020\u00022\f\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u00020\u0019H\u0002J\u0018\u0010 \u001a\u00020\u00022\u0006\u0010\u001d\u001a\u00020\u001c2\u0006\u0010\u001f\u001a\u00020\u001eH\u0002J\b\u0010!\u001a\u00020\u0002H\u0002J\"\u0010(\u001a\u00020'2\u0006\u0010#\u001a\u00020\"2\u0006\u0010$\u001a\u00020\"2\b\u0010&\u001a\u0004\u0018\u00010%H\u0002J\b\u0010)\u001a\u00020\u0002H\u0002J\u0012\u0010,\u001a\u00020\u00022\b\u0010+\u001a\u0004\u0018\u00010*H\u0016J\b\u0010-\u001a\u00020\u0002H\u0014R\u0016\u0010/\u001a\u00020\t8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b.\u0010\u0007R\u0018\u00102\u001a\u0004\u0018\u00010%8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b0\u00101R\u0018\u00106\u001a\u0004\u0018\u0001038\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b4\u00105R\u0018\u00108\u001a\u0004\u0018\u00010%8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b7\u00101R\u0018\u0010<\u001a\u0004\u0018\u0001098\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b:\u0010;R\u0016\u0010>\u001a\u00020\t8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b=\u0010\u0007R\u0018\u0010A\u001a\u0004\u0018\u00010'8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b?\u0010@R\u0016\u0010C\u001a\u00020%8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bB\u00101R\u0018\u0010G\u001a\u0004\u0018\u00010D8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bE\u0010FR\u0016\u0010K\u001a\u00020H8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bI\u0010JR\u0016\u0010O\u001a\u00020L8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bM\u0010NR\u001b\u0010U\u001a\u00020P8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bQ\u0010R\u001a\u0004\bS\u0010TR\u0016\u0010Y\u001a\u00020V8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bW\u0010XR\u001b\u0010^\u001a\u00020Z8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b[\u0010R\u001a\u0004\b\\\u0010]R\u001b\u0010c\u001a\u00020_8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b`\u0010R\u001a\u0004\ba\u0010bR\u001b\u0010h\u001a\u00020d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\be\u0010R\u001a\u0004\bf\u0010gR\u001b\u0010m\u001a\u00020i8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bj\u0010R\u001a\u0004\bk\u0010lR\u001b\u0010r\u001a\u00020n8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bo\u0010R\u001a\u0004\bp\u0010qR\u001b\u0010w\u001a\u00020s8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bt\u0010R\u001a\u0004\bu\u0010vR\u001b\u0010|\u001a\u00020x8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\by\u0010R\u001a\u0004\bz\u0010{¨\u0006\u0081\u0001"}, d2 = {"Lcom/fitnessmobileapps/fma/feature/splash/SplashActivity;", "Lcom/fitnessmobileapps/fma/feature/common/activity/BmaAppCompatActivity;", "", "n0", "", "message", "z0", "Z", "x0", "", "shouldRegister", "s0", "d0", "v0", "t0", "q0", "Lw5/a;", "initState", "m0", "", "exception", "r0", "Landroid/content/DialogInterface$OnClickListener;", "b0", "a0", "Lkotlin/Function0;", "callback", "C0", "Landroid/view/View;", "view", "Landroid/view/animation/Animation$AnimationListener;", "listener", "B0", "o0", "", GiftCard.SITE_ID_FIELD_NAME, "classInstanceId", "", "fromTab", "Lcom/fitnessmobileapps/fma/util/p;", "k0", "D0", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "onResume", "d", "watermarkOutScreen", "e", "Ljava/lang/String;", "notificationMessage", "Lcom/fitnessmobileapps/fma/model/Visit;", "k", "Lcom/fitnessmobileapps/fma/model/Visit;", "checkInVisit", "n", "startAction", "Lcom/fitnessmobileapps/fma/model/views/ReviewEvent;", "p", "Lcom/fitnessmobileapps/fma/model/views/ReviewEvent;", "reviewEvent", "q", "checkNotifications", "r", "Lcom/fitnessmobileapps/fma/util/p;", "validDeepLinkData", "t", "deepLinkRegion", "Landroid/net/Uri;", "v", "Landroid/net/Uri;", "notificationWebLink", "Lcom/fitnessmobileapps/fma/util/t;", "w", "Lcom/fitnessmobileapps/fma/util/t;", "dialogHelper", "Le0/a;", "x", "Le0/a;", "referrerClient", "Lcom/fitnessmobileapps/fma/feature/splash/SplashViewModel;", "y", "Lkotlin/Lazy;", "l0", "()Lcom/fitnessmobileapps/fma/feature/splash/SplashViewModel;", "viewModel", "Lr2/g;", "z", "Lr2/g;", "binding", "Lcom/fitnessmobileapps/fma/core/domain/interactor/ReportForcedLogoutEvents;", ExifInterface.GPS_MEASUREMENT_IN_PROGRESS, "i0", "()Lcom/fitnessmobileapps/fma/core/domain/interactor/ReportForcedLogoutEvents;", "reportForcedLogoutEvents", "Lcom/fitnessmobileapps/fma/core/domain/interactor/d;", "B", "p0", "()Lcom/fitnessmobileapps/fma/core/domain/interactor/d;", "isMixpanelEnabled", "Lcom/fitnessmobileapps/fma/util/z;", "C", "g0", "()Lcom/fitnessmobileapps/fma/util/z;", "getGlobalStringValue", "Lcom/fitnessmobileapps/fma/util/y;", "G", "f0", "()Lcom/fitnessmobileapps/fma/util/y;", "getGlobalIntValue", "Lcom/fitnessmobileapps/fma/util/t0;", "H", "j0", "()Lcom/fitnessmobileapps/fma/util/t0;", "storeGlobalKeyValue", "Lm2/a;", "I", "e0", "()Lm2/a;", "deepLinkRepository", "Lcom/fitnessmobileapps/fma/feature/notifications/domain/interactors/sharedPrefs/e;", "J", "h0", "()Lcom/fitnessmobileapps/fma/feature/notifications/domain/interactors/sharedPrefs/e;", "getSubscribedLocations", "<init>", "()V", "K", gf.a.A, "FMA_release"}, k = 1, mv = {1, 8, 0})
public class SplashActivity extends BmaAppCompatActivity {
    public static final int L = 8;

    private final Lazy reportForcedLogoutEvents;

    private final Lazy isMixpanelEnabled;

    private final Lazy getGlobalStringValue;

    private final Lazy getGlobalIntValue;

    private final Lazy storeGlobalKeyValue;

    private final Lazy deepLinkRepository;

    private final Lazy getSubscribedLocations;

    private boolean watermarkOutScreen;

    private String notificationMessage;

    private Visit checkInVisit;

    private String startAction;

    private ReviewEvent reviewEvent;

    private DeepLink validDeepLinkData;

    private Uri notificationWebLink;

    private t dialogHelper;

    private e0.a referrerClient;

    private final Lazy viewModel;

    private r2.g binding;

    private boolean checkNotifications = true;

    private String deepLinkRegion = b.e.f217a.h();

    @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
    static final class c implements Observer, o {

        private final Function1 f9856c;

        c(Function1 function) {
            r.i(function, "function");
            this.f9856c = function;
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof Observer) && (obj instanceof o)) {
                return r.d(getFunctionDelegate(), ((o) obj).getFunctionDelegate());
            }
            return false;
        }

        @Override
        public final Function<?> getFunctionDelegate() {
            return this.f9856c;
        }

        public final int hashCode() {
            return getFunctionDelegate().hashCode();
        }

        @Override
        public final void onChanged(Object obj) {
            this.f9856c.invoke(obj);
        }
    }

    @Metadata(d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0006\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\b"}, d2 = {"com/fitnessmobileapps/fma/feature/splash/SplashActivity$d", "Landroid/view/animation/Animation$AnimationListener;", "Landroid/view/animation/Animation;", "animation", "", "onAnimationStart", "onAnimationRepeat", "onAnimationEnd", "FMA_release"}, k = 1, mv = {1, 8, 0})
    public static final class d implements Animation.AnimationListener {

        final Function0<Unit> f9858b;

        d(Function0<Unit> function0) {
            this.f9858b = function0;
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            r.i(animation, "animation");
            r2.g gVar = SplashActivity.this.binding;
            if (gVar == null) {
                r.A("binding");
                gVar = null;
            }
            ImageView imageView = gVar.f41936e;
            r.h(imageView, "binding.watermark");
            imageView.setVisibility(SplashActivity.this.watermarkOutScreen ^ true ? 0 : 8);
            this.f9858b.invoke();
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
            r.i(animation, "animation");
        }

        @Override
        public void onAnimationStart(Animation animation) {
            r.i(animation, "animation");
            SplashActivity.this.watermarkOutScreen = !r2.watermarkOutScreen;
        }
    }

    public SplashActivity() {
        Lazy a10;
        Lazy a11;
        Lazy a12;
        Lazy a13;
        Lazy a14;
        Lazy a15;
        Lazy a16;
        Lazy a17;
        final Function0<nn.a> function0 = new Function0<nn.a>() {
            {
                super(0);
            }

            @Override
            public final nn.a invoke() {
                a.Companion companion = nn.a.INSTANCE;
                ComponentCallbacks componentCallbacks = this;
                return companion.b((ViewModelStoreOwner) componentCallbacks, componentCallbacks instanceof SavedStateRegistryOwner ? (SavedStateRegistryOwner) componentCallbacks : null);
            }
        };
        LazyThreadSafetyMode lazyThreadSafetyMode = LazyThreadSafetyMode.f33241e;
        final xn.a aVar = null;
        final Object[] objArr = 0 == true ? 1 : 0;
        a10 = kotlin.d.a(lazyThreadSafetyMode, new Function0<SplashViewModel>() {
            {
                super(0);
            }

            @Override
            public final SplashViewModel invoke() {
                return org.koin.androidx.viewmodel.ext.android.a.a(this, aVar, v.b(SplashViewModel.class), function0, objArr);
            }
        });
        this.viewModel = a10;
        LazyThreadSafetyMode lazyThreadSafetyMode2 = LazyThreadSafetyMode.f33239c;
        final Object[] objArr2 = 0 == true ? 1 : 0;
        final Object[] objArr3 = 0 == true ? 1 : 0;
        a11 = kotlin.d.a(lazyThreadSafetyMode2, new Function0<ReportForcedLogoutEvents>() {
            {
                super(0);
            }

            @Override
            public final ReportForcedLogoutEvents invoke() {
                ComponentCallbacks componentCallbacks = this;
                return ln.a.a(componentCallbacks).g(v.b(ReportForcedLogoutEvents.class), objArr2, objArr3);
            }
        });
        this.reportForcedLogoutEvents = a11;
        final Object[] objArr4 = 0 == true ? 1 : 0;
        final Object[] objArr5 = 0 == true ? 1 : 0;
        a12 = kotlin.d.a(lazyThreadSafetyMode2, new Function0<com.fitnessmobileapps.fma.core.domain.interactor.d>() {
            {
                super(0);
            }

            @Override
            public final com.fitnessmobileapps.fma.core.domain.interactor.d invoke() {
                ComponentCallbacks componentCallbacks = this;
                return ln.a.a(componentCallbacks).g(v.b(com.fitnessmobileapps.fma.core.domain.interactor.d.class), objArr4, objArr5);
            }
        });
        this.isMixpanelEnabled = a12;
        final Object[] objArr6 = 0 == true ? 1 : 0;
        final Object[] objArr7 = 0 == true ? 1 : 0;
        a13 = kotlin.d.a(lazyThreadSafetyMode2, new Function0<z>() {
            {
                super(0);
            }

            @Override
            public final z invoke() {
                ComponentCallbacks componentCallbacks = this;
                return ln.a.a(componentCallbacks).g(v.b(z.class), objArr6, objArr7);
            }
        });
        this.getGlobalStringValue = a13;
        final Object[] objArr8 = 0 == true ? 1 : 0;
        final Object[] objArr9 = 0 == true ? 1 : 0;
        a14 = kotlin.d.a(lazyThreadSafetyMode2, new Function0<y>() {
            {
                super(0);
            }

            @Override
            public final y invoke() {
                ComponentCallbacks componentCallbacks = this;
                return ln.a.a(componentCallbacks).g(v.b(y.class), objArr8, objArr9);
            }
        });
        this.getGlobalIntValue = a14;
        final Object[] objArr10 = 0 == true ? 1 : 0;
        final Object[] objArr11 = 0 == true ? 1 : 0;
        a15 = kotlin.d.a(lazyThreadSafetyMode2, new Function0<t0>() {
            {
                super(0);
            }

            @Override
            public final t0 invoke() {
                ComponentCallbacks componentCallbacks = this;
                return ln.a.a(componentCallbacks).g(v.b(t0.class), objArr10, objArr11);
            }
        });
        this.storeGlobalKeyValue = a15;
        final Object[] objArr12 = 0 == true ? 1 : 0;
        final Object[] objArr13 = 0 == true ? 1 : 0;
        a16 = kotlin.d.a(lazyThreadSafetyMode2, new Function0<m2.a>() {
            {
                super(0);
            }

            @Override
            public final m2.a invoke() {
                ComponentCallbacks componentCallbacks = this;
                return ln.a.a(componentCallbacks).g(v.b(m2.a.class), objArr12, objArr13);
            }
        });
        this.deepLinkRepository = a16;
        final Object[] objArr14 = 0 == true ? 1 : 0;
        final Object[] objArr15 = 0 == true ? 1 : 0;
        a17 = kotlin.d.a(lazyThreadSafetyMode2, new Function0<com.fitnessmobileapps.fma.feature.notifications.domain.interactors.sharedPrefs.e>() {
            {
                super(0);
            }

            @Override
            public final com.fitnessmobileapps.fma.feature.notifications.domain.interactors.sharedPrefs.e invoke() {
                ComponentCallbacks componentCallbacks = this;
                return ln.a.a(componentCallbacks).g(v.b(com.fitnessmobileapps.fma.feature.notifications.domain.interactors.sharedPrefs.e.class), objArr14, objArr15);
            }
        });
        this.getSubscribedLocations = a17;
    }

    public static final void A0(SplashActivity this$0, DialogInterface dialogInterface) {
        r.i(this$0, "this$0");
        this$0.d0();
    }

    private final void B0(View view, Animation.AnimationListener listener) {
        Resources resources = getResources();
        TranslateAnimation translateAnimation = new TranslateAnimation(0.0f, 0.0f, 0.0f, view.getHeight() * 2);
        translateAnimation.setInterpolator(new DecelerateInterpolator());
        translateAnimation.setDuration(resources.getInteger(R.integer.config_mediumAnimTime));
        translateAnimation.setAnimationListener(listener);
        view.startAnimation(translateAnimation);
    }

    private final void C0(Function0<Unit> callback) {
        d dVar = new d(callback);
        r2.g gVar = this.binding;
        if (gVar == null) {
            r.A("binding");
            gVar = null;
        }
        ImageView imageView = gVar.f41936e;
        r.h(imageView, "binding.watermark");
        B0(imageView, dVar);
    }

    private final void D0() {
        boolean f10 = q0.INSTANCE.f(this);
        if (!DevelopmentFlags.Q.d() || f10) {
            return;
        }
        int intValue = f0().invoke("notificationReminderCountV1").intValue();
        if (intValue == -1111) {
            j0().a(new GlobalKeyPair("notificationReminderCountV1", 1));
        } else if (intValue != -1) {
            j0().a(new GlobalKeyPair("notificationReminderCountV1", Integer.valueOf(intValue + 1)));
        }
    }

    private final void Z() {
        if (a0()) {
            SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
            if (defaultSharedPreferences.getBoolean(getString(com.fitnessmobileapps.bodytech39559.R.string.preference_key_notification), false)) {
                j0.i(this, false);
                d0();
            } else if (Build.VERSION.SDK_INT >= 33) {
                GateKeeper.f21219a.s(this, "android.permission.POST_NOTIFICATIONS", new SplashActivity$checkNotificationPrefs$1(this));
            } else if (defaultSharedPreferences.getBoolean("SplashActivity.FIRST_TIME_NOTIFICATION_PERMISSION", false)) {
                d0();
            } else {
                x0();
            }
        }
    }

    private final boolean a0() {
        int g10 = ea.g.m().g(this);
        if (g10 == 0) {
            return true;
        }
        if (ea.g.m().j(g10)) {
            z0(com.fitnessmobileapps.bodytech39559.R.string.gcm_disabled_notifications);
            return false;
        }
        z0(com.fitnessmobileapps.bodytech39559.R.string.gcm_unsupported_notifications);
        return false;
    }

    public final DialogInterface.OnClickListener b0() {
        return new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i10) {
                SplashActivity.c0(SplashActivity.this, dialogInterface, i10);
            }
        };
    }

    public static final void c0(SplashActivity this$0, DialogInterface dialogInterface, int i10) {
        r.i(this$0, "this$0");
        this$0.finish();
    }

    private final void d0() {
        l0().c().observe(this, new c(new Function1<w5.a, Unit>() {
            {
                super(1);
            }

            public final void a(w5.a it) {
                t tVar;
                DialogInterface.OnClickListener b02;
                t tVar2;
                DialogInterface.OnClickListener b03;
                t tVar3 = null;
                if (r.d(it, a.C0813a.f44526a)) {
                    tVar2 = SplashActivity.this.dialogHelper;
                    if (tVar2 == null) {
                        r.A("dialogHelper");
                    } else {
                        tVar3 = tVar2;
                    }
                    b03 = SplashActivity.this.b0();
                    tVar3.x(b03);
                    return;
                }
                if (it instanceof a.Error) {
                    SplashActivity.this.r0(((a.Error) it).getCause());
                    return;
                }
                if (r.d(it, a.c.f44528a)) {
                    return;
                }
                if (r.d(it, a.d.f44529a)) {
                    tVar = SplashActivity.this.dialogHelper;
                    if (tVar == null) {
                        r.A("dialogHelper");
                    } else {
                        tVar3 = tVar;
                    }
                    b02 = SplashActivity.this.b0();
                    tVar3.x(b02);
                    return;
                }
                if (it instanceof a.Ready) {
                    SplashActivity splashActivity = SplashActivity.this;
                    r.h(it, "it");
                    splashActivity.m0(it);
                    return;
                }
                if (it instanceof a.g) {
                    SplashActivity splashActivity2 = SplashActivity.this;
                    r.h(it, "it");
                    splashActivity2.m0(it);
                } else {
                    if (r.d(it, a.h.f44534a)) {
                        SplashActivity.this.t0();
                        return;
                    }
                    if (r.d(it, a.i.f44535a)) {
                        SplashActivity.this.v0();
                    } else if (r.d(it, a.f.f44532a)) {
                        SplashActivity splashActivity3 = SplashActivity.this;
                        r.h(it, "it");
                        splashActivity3.m0(it);
                    }
                }
            }

            @Override
            public Unit invoke(w5.a aVar) {
                a(aVar);
                return Unit.f33247a;
            }
        }));
        l0().f(new InitializeApplicationData.b.FromInitialState(false, 1, null));
    }

    private final m2.a e0() {
        return (m2.a) this.deepLinkRepository.getValue();
    }

    private final y f0() {
        return (y) this.getGlobalIntValue.getValue();
    }

    private final z g0() {
        return (z) this.getGlobalStringValue.getValue();
    }

    private final com.fitnessmobileapps.fma.feature.notifications.domain.interactors.sharedPrefs.e h0() {
        return (com.fitnessmobileapps.fma.feature.notifications.domain.interactors.sharedPrefs.e) this.getSubscribedLocations.getValue();
    }

    private final ReportForcedLogoutEvents i0() {
        return (ReportForcedLogoutEvents) this.reportForcedLogoutEvents.getValue();
    }

    public final t0 j0() {
        return (t0) this.storeGlobalKeyValue.getValue();
    }

    private final DeepLink k0(long siteId, long classInstanceId, String fromTab) {
        return new DeepLink(e0().c(siteId, classInstanceId, this.deepLinkRegion, false, fromTab));
    }

    public final SplashViewModel l0() {
        return (SplashViewModel) this.viewModel.getValue();
    }

    public final void m0(w5.a initState) {
        if (q0.INSTANCE.e(this)) {
            Intent intent = new Intent(this, (Class<?>) GeofenceRegistrationReceiver.class);
            intent.setAction("com.fitnessmobileapps.bodytech39559.GEOFENCE_REGISTER");
            sendBroadcast(intent);
        }
        C0(new SplashActivity$goNextScreen$1(initState, this));
    }

    private final void n0() {
        if (DevelopmentFlags.f6084c0.d() && g0().invoke("referrerUrl") == null) {
            e0.a a10 = e0.a.b(this).a();
            r.h(a10, "newBuilder(this).build()");
            this.referrerClient = a10;
            if (a10 == null) {
                r.A("referrerClient");
                a10 = null;
            }
            a10.c(new b());
        }
    }

    private final void o0() {
        long j10;
        long j11;
        long j12;
        long j13;
        Uri uri = null;
        this.validDeepLinkData = null;
        Intent intent = getIntent();
        if (intent != null) {
            if (r.d(intent.getAction(), "notification::wap::socialpush")) {
                this.deepLinkRegion = b.e.f217a.y();
                Bundle extras = intent.getExtras();
                if (extras != null) {
                    if (extras.containsKey("deepLink")) {
                        String string = extras.getString("deepLink");
                        if (string != null) {
                            DeepLink deepLink = new DeepLink(Uri.parse(string));
                            j10 = deepLink.g();
                            j11 = deepLink.c();
                            this.validDeepLinkData = k0(j10, deepLink.b(), deepLink.i());
                        }
                    } else if (extras.containsKey("webLink")) {
                        String string2 = extras.getString("webLink");
                        if (string2 != null) {
                            r.h(string2, "getString(WAP_WEB_LINK_KEY)");
                            uri = Uri.parse(string2);
                        }
                        this.notificationWebLink = uri;
                    }
                }
            } else {
                String action = intent.getAction();
                if (action != null) {
                    r.h(action, "action");
                    if (s.K(action, "mbl.scheduling.classes.v1", false, 2, null)) {
                        this.deepLinkRegion = b.e.f217a.z();
                        Bundle extras2 = intent.getExtras();
                        if (extras2 != null) {
                            String string3 = extras2.getString(GiftCard.SITE_ID_FIELD_NAME);
                            if (string3 != null) {
                                r.h(string3, "getString(MBL_SCHEDULING_SITE_ID_KEY)");
                                j12 = Long.parseLong(string3);
                            } else {
                                j12 = 0;
                            }
                            String string4 = extras2.getString("locationId");
                            if (string4 != null) {
                                r.h(string4, "getString(MBL_SCHEDULING_LOCATION_ID_KEY)");
                                j11 = Long.parseLong(string4);
                            } else {
                                j11 = 0;
                            }
                            String action2 = intent.getAction();
                            if (r.d(action2, NotificationType.SCHEDULING_CLASS_BOOKING_CREATED.getId())) {
                                String string5 = extras2.getString("classInstanceId");
                                if (string5 != null) {
                                    r.h(string5, "getString(MBL_SCHEDULING_CLASS_ID_KEY)");
                                    j13 = Long.parseLong(string5);
                                } else {
                                    j13 = 0;
                                }
                                this.validDeepLinkData = k0(j12, j13, "book");
                            } else if (r.d(action2, NotificationType.SCHEDULING_CLASS_BOOKING_CANCELED.getId())) {
                                this.validDeepLinkData = new DeepLink(e0().b());
                            }
                            j10 = j12;
                        }
                    }
                }
                if (r.d(intent.getAction(), "android.intent.action.VIEW")) {
                    this.deepLinkRegion = b.e.f217a.h();
                    Uri it = intent.getData();
                    if (it != null) {
                        r.h(it, "it");
                        DeepLink deepLink2 = new DeepLink(it);
                        long g10 = deepLink2.g();
                        long c10 = deepLink2.c();
                        this.validDeepLinkData = k0(g10, deepLink2.b(), deepLink2.i());
                        j10 = g10;
                        j11 = c10;
                    }
                }
            }
            if (j10 != 0 || j11 == 0) {
            }
            l0().i(j10, j11);
            return;
        }
        j10 = 0;
        j11 = 0;
        if (j10 != 0) {
        }
    }

    private final com.fitnessmobileapps.fma.core.domain.interactor.d p0() {
        return (com.fitnessmobileapps.fma.core.domain.interactor.d) this.isMixpanelEnabled.getValue();
    }

    private final void q0() {
        a0 a0Var = a0.f33399a;
        String format = String.format(Locale.US, "market://details?id=%1$s", Arrays.copyOf(new Object[]{"com.fitnessmobileapps.bodytech39559"}, 1));
        r.h(format, "format(...)");
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(format));
        if (intent.resolveActivity(getPackageManager()) != null) {
            startActivity(intent);
        } else {
            mo.a.INSTANCE.a("No Intent available to handle action", new Object[0]);
            finish();
        }
    }

    public final void r0(Throwable exception) {
        Unit unit;
        t tVar = null;
        if (exception != null) {
            mo.a.INSTANCE.f(new Throwable(exception), "onServerRequestError: when trying to start application", new Object[0]);
            unit = Unit.f33247a;
        } else {
            unit = null;
        }
        if (unit == null) {
            mo.a.INSTANCE.f(new Throwable(), "onServerRequestError: when trying to start application. Error was null.", new Object[0]);
        }
        t tVar2 = this.dialogHelper;
        if (tVar2 == null) {
            r.A("dialogHelper");
        } else {
            tVar = tVar2;
        }
        tVar.s(b0());
    }

    public final void s0(boolean shouldRegister) {
        boolean z10;
        if (shouldRegister) {
            com.fitnessmobileapps.fma.util.f.b().k("PushNotificationAccepted");
            z10 = true;
            j0.i(this, true);
        } else {
            com.fitnessmobileapps.fma.util.f.b().k("PushNotificationDenied");
            j0.j(this);
            z10 = false;
        }
        PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(getString(com.fitnessmobileapps.bodytech39559.R.string.preference_key_notification), z10).apply();
        d0();
    }

    public final void t0() {
        if (!v0.a(this)) {
            l0().f(new InitializeApplicationData.b.FromInitialState(true));
            return;
        }
        t tVar = this.dialogHelper;
        if (tVar == null) {
            r.A("dialogHelper");
            tVar = null;
        }
        tVar.u(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i10) {
                SplashActivity.u0(SplashActivity.this, dialogInterface, i10);
            }
        });
    }

    public static final void u0(SplashActivity this$0, DialogInterface dialog, int i10) {
        r.i(this$0, "this$0");
        r.i(dialog, "dialog");
        if (i10 == -2) {
            dialog.dismiss();
            this$0.l0().f(new InitializeApplicationData.b.FromInitialState(true));
        } else {
            if (i10 != -1) {
                return;
            }
            dialog.dismiss();
            this$0.q0();
        }
    }

    public final void v0() {
        t tVar = this.dialogHelper;
        if (tVar == null) {
            r.A("dialogHelper");
            tVar = null;
        }
        tVar.M(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i10) {
                SplashActivity.w0(SplashActivity.this, dialogInterface, i10);
            }
        });
    }

    public static final void w0(SplashActivity this$0, DialogInterface dialog, int i10) {
        r.i(this$0, "this$0");
        r.i(dialog, "dialog");
        if (i10 == -1) {
            dialog.dismiss();
            this$0.q0();
        }
    }

    private final void x0() {
        t tVar = this.dialogHelper;
        if (tVar == null) {
            r.A("dialogHelper");
            tVar = null;
        }
        tVar.K(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i10) {
                SplashActivity.y0(SplashActivity.this, dialogInterface, i10);
            }
        });
    }

    public static final void y0(SplashActivity this$0, DialogInterface dialogInterface, int i10) {
        r.i(this$0, "this$0");
        PreferenceManager.getDefaultSharedPreferences(this$0).edit().putBoolean("SplashActivity.FIRST_TIME_NOTIFICATION_PERMISSION", true).apply();
        this$0.s0(i10 == -1);
    }

    private final void z0(int message) {
        t tVar = this.dialogHelper;
        if (tVar == null) {
            r.A("dialogHelper");
            tVar = null;
        }
        tVar.y(com.fitnessmobileapps.bodytech39559.R.string.sorry, message, "SplashActivity.DONT_SHOW_AGAIN_PREF", new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                SplashActivity.A0(SplashActivity.this, dialogInterface);
            }
        });
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        Object parcelable;
        super.onCreate(savedInstanceState);
        com.fitnessmobileapps.fma.util.e eVar = com.fitnessmobileapps.fma.util.e.f10391a;
        eVar.j(this, l0().d());
        uf.d.e();
        uf.d.d(new yf.a());
        uf.d.d(new xf.a());
        if (DevelopmentFlags.f6096v.d()) {
            uf.d.d(new b2.a());
        }
        if (((Boolean) a0.a.a(p0(), null, 1, null)).booleanValue()) {
            MixpanelLogger mixpanelLogger = new MixpanelLogger();
            uf.d.d(mixpanelLogger);
            mo.a.INSTANCE.t("BMA Mixpanel").a("Adding Mixpanel Logger", new Object[0]);
            String valueOf = String.valueOf(l0().d());
            String string = getString(com.fitnessmobileapps.bodytech39559.R.string.bma_app_name);
            r.h(string, "getString(R.string.bma_app_name)");
            mixpanelLogger.f(valueOf, string, eVar.b());
        }
        a0.a.a(i0(), null, 1, null);
        r2.g c10 = r2.g.c(LayoutInflater.from(this));
        r.h(c10, "inflate(LayoutInflater.from(this))");
        this.binding = c10;
        if (c10 == null) {
            r.A("binding");
            c10 = null;
        }
        setContentView(c10.getRoot());
        r2.g gVar = this.binding;
        if (gVar == null) {
            r.A("binding");
            gVar = null;
        }
        gVar.f41936e.setColorFilter(ContextCompat.getColor(this, com.fitnessmobileapps.bodytech39559.R.color.watermarkColor), PorterDuff.Mode.MULTIPLY);
        this.dialogHelper = new t(this);
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            l0().g(extras);
            this.notificationMessage = extras.getString("com.fitnessmobileapps.fma.messaging.EXTRA_MESSAGE");
            if (Build.VERSION.SDK_INT >= 33) {
                parcelable = extras.getParcelable("AlarmReceiver.EXTRA_VISIT_CHECK_IN", Visit.class);
                this.checkInVisit = (Visit) parcelable;
            } else {
                this.checkInVisit = (Visit) extras.getParcelable("AlarmReceiver.EXTRA_VISIT_CHECK_IN");
            }
            String string2 = extras.getString("StartAction");
            this.startAction = string2;
            if (r.d("visitReview", string2)) {
                this.reviewEvent = (ReviewEvent) cf.d.b(extras.getString("ReviewEvent"), ReviewEvent.class);
            }
        }
        if (DevelopmentFlags.P.d()) {
            d0();
        } else if (Build.VERSION.SDK_INT >= 33) {
            GateKeeper gateKeeper = GateKeeper.f21219a;
            final String[] strArr = {"android.permission.POST_NOTIFICATIONS"};
            String simpleName = getClass().getSimpleName();
            r.h(simpleName, "getSimpleName(...)");
            gateKeeper.f(this, simpleName, this, this);
            String simpleName2 = getClass().getSimpleName();
            r.h(simpleName2, "getSimpleName(...)");
            gateKeeper.e(this, simpleName2, this);
            MutableLiveData<com.mindbodyonline.gatekeeper.d> mutableLiveData = gateKeeper.j().get(simpleName2);
            if (mutableLiveData != null) {
                mutableLiveData.observe(this, new GateKeeper.f(new Function1<com.mindbodyonline.gatekeeper.d, Unit>() {
                    {
                        super(1);
                    }

                    public final void a(com.mindbodyonline.gatekeeper.d dVar) {
                        boolean e02;
                        com.mindbodyonline.gatekeeper.e b10;
                        e02 = ArraysKt___ArraysKt.e0(strArr, dVar.a());
                        if (!e02 || (b10 = dVar.b()) == null) {
                            return;
                        }
                        this.s0(b10 instanceof e.a);
                    }

                    @Override
                    public Unit invoke(com.mindbodyonline.gatekeeper.d dVar) {
                        a(dVar);
                        return Unit.f33247a;
                    }
                }));
            }
        }
        o0();
        n0();
        l0().h(getIntent(), ((List) a0.a.a(h0(), null, 1, null)).size());
        D0();
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (this.notificationMessage != null) {
            com.fitnessmobileapps.fma.util.f.b().k("LaunchedFromNotification");
        }
        if (DevelopmentFlags.P.d() || !this.checkNotifications) {
            return;
        }
        this.checkNotifications = false;
        Z();
    }

    @Metadata(d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\b\u0010\u0006\u001a\u00020\u0004H\u0016¨\u0006\u0007"}, d2 = {"com/fitnessmobileapps/fma/feature/splash/SplashActivity$b", "Le0/c;", "", "responseCode", "", gf.a.A, "b", "FMA_release"}, k = 1, mv = {1, 8, 0})
    public static final class b implements e0.c {
        b() {
        }

        @Override
        public void a(int responseCode) {
            if (responseCode != 0) {
                return;
            }
            e0.a aVar = SplashActivity.this.referrerClient;
            if (aVar == null) {
                r.A("referrerClient");
                aVar = null;
            }
            e0.d a10 = aVar.a();
            r.h(a10, "referrerClient.installReferrer");
            String a11 = a10.a();
            r.h(a11, "response.installReferrer");
            SplashActivity.this.j0().a(new GlobalKeyPair("referrerUrl", a11));
        }

        @Override
        public void b() {
        }
    }
}