导航菜单

页面标题

页面副标题

BetterTogether v3.0.0 - SplashActivity.java 源代码

正在查看: BetterTogether v3.0.0 应用的 SplashActivity.java JAVA 源代码文件

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


package com.bettertogether.screens.splash;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import com.adapty.internal.data.cloud.SendEventRequestSerializer;
import com.appsflyer.AppsFlyerLib;
import com.bettertogether.BetterTogetherApp;
import com.bettertogether.cache.preferences.PreferenceData;
import com.bettertogether.remote.model.common.SplashItem;
import com.bettertogether.screens.account.create.OnBoardAccountActivity;
import com.bettertogether.screens.chat.view.ChatActivity;
import com.bettertogether.screens.confirmation.email.EmailConfirmationActivity;
import com.bettertogether.screens.group.invite.InviteGroupActivity;
import com.bettertogether.screens.login.LoginActivity;
import com.bettertogether.screens.main.MainActivity;
import com.bettertogether.screens.password.create.CreateNewPasswordActivity;
import com.bettertogether.screens.social_sign_up.SocialSignUpActivity;
import com.bettertogether.screens.welcome.WelcomeActivity;
import com.google.firebase.messaging.e;
import com.onesignal.y3;
import dd.s;
import et.d;
import h.o;
import hd.c;
import java.util.Date;
import java.util.Random;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.b0;
import kotlin.jvm.internal.f0;
import kotlin.jvm.internal.g0;
import kotlin.text.u;
import kotlin.text.y;
import lf.b;
import lf.i;
import lf.j;
import lf.k;
import lq.m;
import lq.n;
import md.l;
import nl.f;
import s8.h;
import yp.kGSY.OOFrcTqEDRwK;
import zs.a;

@Metadata
public final class SplashActivity extends o implements SplashView, c {
    public static final String ACTION_STOP_FOREGROUND = "com.bettertogether.us.stopforeground";
    public static final lf.c Companion = new lf.c();
    private static boolean isAppsFlyerDeepLinkFound = true;
    private final String analyticsScreenName = "splash_android";
    private final m binding$delegate = n.b(new j(this, 0));
    private final m preferenceData$delegate;
    private final m presenter$delegate;
    private final a splashScope;

    public SplashActivity() {
        h s3 = e.s(this);
        a a = ((ys.a) s3.a).a(e.o(), new xs.c(g0.a(SplashActivity.class)));
        this.splashScope = a;
        j jVar = new j(this, 1);
        lq.o oVar = lq.o.d;
        this.presenter$delegate = n.a(oVar, new l(a, jVar, 26));
        this.preferenceData$delegate = n.a(oVar, new s(this, 27));
    }

    private final void appsFlyerDeepLinkHandling() {
        String str = OOFrcTqEDRwK.OlSWluRe;
        d.d(str).c("apps flyer deep link parsing is called from splash screen.", new Object[0]);
        AppsFlyerLib.getInstance().subscribeForDeepLink(new b(this));
        d.d(str).c("apps flyer deep link found with deep link below the deep link handling " + isAppsFlyerDeepLinkFound + " " + getIntent().getData() + " ", new Object[0]);
        if (isAppsFlyerDeepLinkFound && getIntent().getData() == null) {
            d.d(str).c("main activity is launched normally", new Object[0]);
            getPresenter().init((Uri) null);
            f.O(rh.c.q(this), (kotlin.coroutines.a) null, 0, new i(this, (oq.c) null), 3);
        }
    }

    public static final void appsFlyerDeepLinkHandling$lambda$1(com.bettertogether.screens.splash.SplashActivity r12, com.appsflyer.deeplink.DeepLinkResult r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.bettertogether.screens.splash.SplashActivity.appsFlyerDeepLinkHandling$lambda$1(com.bettertogether.screens.splash.SplashActivity, com.appsflyer.deeplink.DeepLinkResult):void");
    }

    private final void checkWhichIntentIsThere() {
        Uri data;
        Uri data2;
        d.d("WhichIssueISThrer").a("Check which intent is there is called From the Splash Screen  ", new Object[0]);
        PreferenceData preferenceData = getPreferenceData();
        preferenceData.getClass();
        preferenceData.t("storyLyIntent", "");
        Intent intent = getIntent();
        if (Intrinsics.c((intent == null || (data2 = intent.getData()) == null) ? null : data2.getScheme(), "storylyapp")) {
            Intent intent2 = getIntent();
            Uri data3 = intent2 != null ? intent2.getData() : null;
            PreferenceData preferenceData2 = getPreferenceData();
            Intent intent3 = getIntent();
            if (intent3 != null && (data = intent3.getData()) != null) {
                r5 = data.toString();
            }
            preferenceData2.getClass();
            preferenceData2.t("storyLyIntent", r5 != null ? r5 : "");
            getPresenter().init(data3);
            isAppsFlyerDeepLinkFound = false;
            return;
        }
        Intent intent4 = getIntent();
        Uri data4 = intent4 != null ? intent4.getData() : null;
        et.a d2 = d.d("WhichIssueISThrer");
        Intent intent5 = getIntent();
        d2.c("Check which intent is there is called From the Splash Screen " + (intent5 != null ? intent5.getData() : null) + "  ", new Object[0]);
        String valueOf = String.valueOf(data4 != null ? data4.getQueryParameter("links") : null);
        String R = y.R(valueOf, "url=", valueOf);
        if (data4 != null) {
            if (R == null || R.length() == 0) {
                d.d("WhichIssueISThrer").c(g0.b.k("Check which intent is there is called From the Splash Screen ", R, "  "), new Object[0]);
                startActivity(new Intent("android.intent.action.VIEW", Uri.parse(R)));
            }
        }
        d.d("WhichISCalledFirst").c("Check which intent this is not the storyly story this is a Normal Intent or from the deep linking ", new Object[0]);
        appsFlyerDeepLinkHandling();
        BetterTogetherApp betterTogetherApp = BetterTogetherApp.f198d;
        s6.s.k().start(this, "wayzp4kcqdvYnqjoJQny9i", new k(0));
    }

    private final Uri convertLink(String str) {
        boolean z = false;
        if (str != null && y.C(str, "luz2win.com", false)) {
            z = true;
        }
        if (z) {
            return Uri.parse(u.m(str, "betterapp://", "https://"));
        }
        if (str != null) {
            return Uri.parse(str);
        }
        return null;
    }

    public static final void firstNavigateToMainScreen$lambda$3(f0 f0Var, SplashActivity splashActivity, boolean z, b0 b0Var) {
        Intrinsics.checkNotNullParameter(f0Var, "$storyLinks");
        Intrinsics.checkNotNullParameter(splashActivity, "this$0");
        Intrinsics.checkNotNullParameter(b0Var, "$enableWaterReminder");
        Object obj = f0Var.d;
        if (obj != null) {
            ye.a aVar = MainActivity.Companion;
            boolean z2 = b0Var.d;
            aVar.getClass();
            ye.a.c(splashActivity, (String) obj, z, z2);
            return;
        }
        ye.a aVar2 = MainActivity.Companion;
        boolean z4 = b0Var.d;
        aVar2.getClass();
        splashActivity.startActivity(ye.a.d(splashActivity, z, z4));
    }

    public final cd.y getBinding() {
        return (cd.y) this.binding$delegate.getValue();
    }

    private final PreferenceData getPreferenceData() {
        return (PreferenceData) this.preferenceData$delegate.getValue();
    }

    public final SplashPresenter getPresenter() {
        return (SplashPresenter) this.presenter$delegate.getValue();
    }

    public static final void navigateToMainScreen$lambda$2(SplashActivity splashActivity, Uri uri, boolean z, b0 b0Var, f0 f0Var) {
        Intent d2;
        Intrinsics.checkNotNullParameter(splashActivity, "this$0");
        Intrinsics.checkNotNullParameter(b0Var, "$enableWaterReminder");
        Intrinsics.checkNotNullParameter(f0Var, "$storyLinks");
        if (uri != null) {
            ye.a aVar = MainActivity.Companion;
            boolean z2 = b0Var.d;
            aVar.getClass();
            Intrinsics.checkNotNullParameter(splashActivity, "context");
            d2 = new Intent((Context) splashActivity, (Class<?>) MainActivity.class);
            d2.putExtra("param_storyly_data", String.valueOf(uri)).putExtra("param_join_group", z);
            d2.putExtra(MainActivity.SHOW_RECORD_WATER, z2);
            d2.addFlags(268468224);
        } else {
            Object obj = f0Var.d;
            if (obj != null) {
                ye.a aVar2 = MainActivity.Companion;
                boolean z4 = b0Var.d;
                aVar2.getClass();
                d2 = ye.a.c(splashActivity, (String) obj, z, z4);
            } else {
                ye.a aVar3 = MainActivity.Companion;
                boolean z5 = b0Var.d;
                aVar3.getClass();
                d2 = ye.a.d(splashActivity, z, z5);
            }
        }
        splashActivity.startActivity(d2);
    }

    private final void setRandomOneSignalId() {
        if (getPreferenceData().b("isExternalRandomIdSet", false)) {
            return;
        }
        int nextInt = new Random().nextInt(900) + 100;
        long time = new Date().getTime();
        StringBuilder sb2 = new StringBuilder();
        sb2.append(nextInt);
        sb2.append(time);
        y3.T(sb2.toString(), (String) null);
        getPreferenceData().w(true);
    }

    @Override
    public void attachBaseContext(Context context) {
        super.attachBaseContext(context);
        fs.d.D(this, context);
    }

    public void firstNavigateToMainScreen(boolean z) {
        b0 b0Var = new b0();
        f0 f0Var = new f0();
        if (getIntent() != null && getIntent().getExtras() != null) {
            Bundle extras = getIntent().getExtras();
            Intrinsics.e(extras);
            if (extras.containsKey(SendEventRequestSerializer.TYPE)) {
                Bundle extras2 = getIntent().getExtras();
                Intrinsics.e(extras2);
                if (Intrinsics.c(extras2.getString(SendEventRequestSerializer.TYPE), "waterReminder")) {
                    b0Var.d = true;
                } else {
                    Bundle extras3 = getIntent().getExtras();
                    Intrinsics.e(extras3);
                    if (Intrinsics.c(extras3.getString(SendEventRequestSerializer.TYPE), "customNotification") && (getIntent().getFlags() & 1048576) == 0) {
                        Bundle extras4 = getIntent().getExtras();
                        Intrinsics.e(extras4);
                        f0Var.d = extras4.getString("links");
                    }
                }
            }
        }
        new Handler(getMainLooper()).postDelayed(new androidx.fragment.app.c(f0Var, this, z, b0Var, 1), 4000L);
    }

    public Activity getActivity() {
        return this;
    }

    public String getAnalyticsScreenName() {
        return this.analyticsScreenName;
    }

    public void navigateToChangePasswordScreen(String str) {
        Intrinsics.checkNotNullParameter(str, "code");
        startActivity(CreateNewPasswordActivity.w.l(this, str));
    }

    public void navigateToChatScreen(int i) {
        startActivity(ChatActivity.V.i(this, i));
    }

    public void navigateToConfirmEmailScreen(String str) {
        startActivity(EmailConfirmationActivity.v.l(this, str));
    }

    public void navigateToGroupInviteScreen() {
        startActivity(InviteGroupActivity.w.n(this));
        finish();
    }

    public void navigateToLoginScreen() {
        startActivity(LoginActivity.y.p(this, false));
    }

    public void navigateToMainScreen(Uri uri, boolean z) {
        b0 b0Var = new b0();
        f0 f0Var = new f0();
        if (getIntent() != null && getIntent().getExtras() != null) {
            Bundle extras = getIntent().getExtras();
            Intrinsics.e(extras);
            if (extras.containsKey(SendEventRequestSerializer.TYPE)) {
                Bundle extras2 = getIntent().getExtras();
                Intrinsics.e(extras2);
                if (Intrinsics.c(extras2.getString(SendEventRequestSerializer.TYPE), "waterReminder")) {
                    b0Var.d = true;
                } else {
                    Bundle extras3 = getIntent().getExtras();
                    Intrinsics.e(extras3);
                    if (Intrinsics.c(extras3.getString(SendEventRequestSerializer.TYPE), "customNotification") && (getIntent().getFlags() & 1048576) == 0) {
                        Bundle extras4 = getIntent().getExtras();
                        Intrinsics.e(extras4);
                        f0Var.d = extras4.getString("links");
                    }
                }
            }
        }
        new Handler(getMainLooper()).postDelayed(new lf.a(this, uri, z, b0Var, f0Var), 500L);
    }

    public void navigateToOnAccountDetailsScreen() {
        startActivity(OnBoardAccountActivity.Q.n(this));
    }

    public void navigateToRegisterScreen() {
        startActivity(WelcomeActivity.v.p(this, true));
    }

    public void navigateToSocialLoginScreen() {
        int i = SocialSignUpActivity.y;
        startActivity(cf.d.r(this, null, 6));
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView((View) getBinding().a);
        et.a d2 = d.d("WhichIssueISThrer");
        Intent intent = getIntent();
        d2.a(a0.g0.h("Splash Has been created here ", intent != null ? intent.getData() : null), new Object[0]);
        getPreferenceData().r("storyly_story_open", false);
        setRandomOneSignalId();
        checkWhichIntentIsThere();
    }

    @Override
    public void onStop() {
        super.onStop();
        BetterTogetherApp betterTogetherApp = BetterTogetherApp.f198d;
        BetterTogetherApp.w = false;
        isAppsFlyerDeepLinkFound = true;
    }

    public void showDefaultLogo() {
        getBinding().b.setVisibility(8);
        getBinding().d.setVisibility(8);
        getBinding().e.setVisibility(8);
        getBinding().g.setImageResource(2131231179);
        getPreferenceData().x(false);
    }

    public void showLogo(SplashItem splashItem) {
        Intrinsics.checkNotNullParameter(splashItem, "item");
        getBinding().b.setVisibility(0);
        getBinding().d.setVisibility(0);
        getBinding().h.setVisibility(8);
        ImageView imageView = getBinding().c;
        Intrinsics.checkNotNullExpressionValue(imageView, "binding.ivRemote");
        imageView.setVisibility(0);
        ImageView imageView2 = getBinding().g;
        Intrinsics.checkNotNullExpressionValue(imageView2, "binding.splashLogo");
        imageView2.setVisibility(8);
        ImageView imageView3 = getBinding().f;
        Intrinsics.checkNotNullExpressionValue(imageView3, "binding.splashImg");
        imageView3.setVisibility(8);
        com.bumptech.glide.b.c(this).g(this).n(splashItem.getLogo()).f(2131231179).v(new g9.b(this, 4)).A(getBinding().c);
        getPreferenceData().x(true);
    }

    public void showProgress() {
        getBinding().d.setVisibility(8);
        getBinding().e.setVisibility(8);
        getBinding().e.setVisibility(0);
    }
}