导航菜单

页面标题

页面副标题

Rilo v2.0.21 - ChallengeActivity.java 源代码

正在查看: Rilo v2.0.21 应用的 ChallengeActivity.java JAVA 源代码文件

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


package com.stripe.android.stripe3ds2.views;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.activity.ComponentActivity;
import androidx.activity.OnBackPressedCallback;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.os.BundleKt;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import com.stripe.android.stripe3ds2.databinding.StripeChallengeActivityBinding;
import com.stripe.android.stripe3ds2.databinding.StripeChallengeFragmentBinding;
import com.stripe.android.stripe3ds2.init.ui.UiCustomization;
import com.stripe.android.stripe3ds2.observability.DefaultErrorReporter;
import com.stripe.android.stripe3ds2.observability.ErrorReporter;
import com.stripe.android.stripe3ds2.observability.Stripe3ds2ErrorReporterConfig;
import com.stripe.android.stripe3ds2.transaction.ChallengeAction;
import com.stripe.android.stripe3ds2.transaction.ChallengeActionHandler;
import com.stripe.android.stripe3ds2.transaction.ChallengeRequestExecutor;
import com.stripe.android.stripe3ds2.transaction.ChallengeResult;
import com.stripe.android.stripe3ds2.transaction.DefaultTransactionTimer;
import com.stripe.android.stripe3ds2.transaction.ErrorRequestExecutor;
import com.stripe.android.stripe3ds2.transaction.StripeErrorRequestExecutor;
import com.stripe.android.stripe3ds2.transaction.TransactionTimer;
import com.stripe.android.stripe3ds2.transactions.ChallengeRequestData;
import com.stripe.android.stripe3ds2.transactions.ChallengeResponseData;
import com.stripe.android.stripe3ds2.transactions.UiType;
import com.stripe.android.stripe3ds2.views.ChallengeActivityViewModel;
import com.stripe.android.stripe3ds2.views.ChallengeViewArgs;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.Reflection;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.Dispatchers;

@Metadata(d1 = {"\u0000\u008a\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\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\u0000\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\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u0000 N2\u00020\u0001:\u0001NB\u0005¢\u0006\u0002\u0010\u0002J\b\u0010=\u001a\u00020>H\u0002J\b\u0010?\u001a\u00020>H\u0002J\b\u0010@\u001a\u00020>H\u0002J\u0012\u0010A\u001a\u00020>2\b\u0010B\u001a\u0004\u0018\u00010CH\u0014J\b\u0010D\u001a\u00020>H\u0014J\b\u0010E\u001a\u00020>H\u0016J\b\u0010F\u001a\u00020>H\u0014J\b\u0010G\u001a\u00020>H\u0014J\u0010\u0010H\u001a\u00020>2\u0006\u0010I\u001a\u00020JH\u0016J\u0010\u0010K\u001a\u00020>2\u0006\u0010L\u001a\u00020MH\u0002R\u001b\u0010\u0003\u001a\u00020\u00048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0007\u0010\b\u001a\u0004\b\u0005\u0010\u0006R\u001b\u0010\t\u001a\u00020\n8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\r\u0010\b\u001a\u0004\b\u000b\u0010\fR\u001b\u0010\u000e\u001a\u00020\u000f8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0012\u0010\b\u001a\u0004\b\u0010\u0010\u0011R\u001b\u0010\u0013\u001a\u00020\u00148@X\u0080\u0084\u0002¢\u0006\f\n\u0004\b\u0017\u0010\b\u001a\u0004\b\u0015\u0010\u0016R\u001b\u0010\u0018\u001a\u00020\u00198@X\u0080\u0084\u0002¢\u0006\f\n\u0004\b\u001c\u0010\b\u001a\u0004\b\u001a\u0010\u001bR\u001b\u0010\u001d\u001a\u00020\u001e8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b!\u0010\b\u001a\u0004\b\u001f\u0010 R\u0010\u0010\"\u001a\u0004\u0018\u00010#X\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010$\u001a\u00020%8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b(\u0010\b\u001a\u0004\b&\u0010'R\u001b\u0010)\u001a\u00020*8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b-\u0010\b\u001a\u0004\b+\u0010,R\u001b\u0010.\u001a\u00020/8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b2\u0010\b\u001a\u0004\b0\u00101R\u001b\u00103\u001a\u0002048@X\u0080\u0084\u0002¢\u0006\f\n\u0004\b7\u0010\b\u001a\u0004\b5\u00106R\u001b\u00108\u001a\u0002098@X\u0080\u0084\u0002¢\u0006\f\n\u0004\b<\u0010\b\u001a\u0004\b:\u0010;¨\u0006O"}, d2 = {"Lcom/stripe/android/stripe3ds2/views/ChallengeActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "challengeActionHandler", "Lcom/stripe/android/stripe3ds2/transaction/ChallengeActionHandler;", "getChallengeActionHandler", "()Lcom/stripe/android/stripe3ds2/transaction/ChallengeActionHandler;", "challengeActionHandler$delegate", "Lkotlin/Lazy;", "errorReporter", "Lcom/stripe/android/stripe3ds2/observability/ErrorReporter;", "getErrorReporter", "()Lcom/stripe/android/stripe3ds2/observability/ErrorReporter;", "errorReporter$delegate", "errorRequestExecutor", "Lcom/stripe/android/stripe3ds2/transaction/ErrorRequestExecutor;", "getErrorRequestExecutor", "()Lcom/stripe/android/stripe3ds2/transaction/ErrorRequestExecutor;", "errorRequestExecutor$delegate", "fragment", "Lcom/stripe/android/stripe3ds2/views/ChallengeFragment;", "getFragment$3ds2sdk_release", "()Lcom/stripe/android/stripe3ds2/views/ChallengeFragment;", "fragment$delegate", "fragmentViewBinding", "Lcom/stripe/android/stripe3ds2/databinding/StripeChallengeFragmentBinding;", "getFragmentViewBinding$3ds2sdk_release", "()Lcom/stripe/android/stripe3ds2/databinding/StripeChallengeFragmentBinding;", "fragmentViewBinding$delegate", "keyboardController", "Lcom/stripe/android/stripe3ds2/views/KeyboardController;", "getKeyboardController", "()Lcom/stripe/android/stripe3ds2/views/KeyboardController;", "keyboardController$delegate", "progressDialog", "Landroid/app/Dialog;", "progressDialogFactory", "Lcom/stripe/android/stripe3ds2/views/ChallengeSubmitDialogFactory;", "getProgressDialogFactory", "()Lcom/stripe/android/stripe3ds2/views/ChallengeSubmitDialogFactory;", "progressDialogFactory$delegate", "transactionTimer", "Lcom/stripe/android/stripe3ds2/transaction/TransactionTimer;", "getTransactionTimer", "()Lcom/stripe/android/stripe3ds2/transaction/TransactionTimer;", "transactionTimer$delegate", "viewArgs", "Lcom/stripe/android/stripe3ds2/views/ChallengeViewArgs;", "getViewArgs", "()Lcom/stripe/android/stripe3ds2/views/ChallengeViewArgs;", "viewArgs$delegate", "viewBinding", "Lcom/stripe/android/stripe3ds2/databinding/StripeChallengeActivityBinding;", "getViewBinding$3ds2sdk_release", "()Lcom/stripe/android/stripe3ds2/databinding/StripeChallengeActivityBinding;", "viewBinding$delegate", "viewModel", "Lcom/stripe/android/stripe3ds2/views/ChallengeActivityViewModel;", "getViewModel$3ds2sdk_release", "()Lcom/stripe/android/stripe3ds2/views/ChallengeActivityViewModel;", "viewModel$delegate", "configureHeaderZone", "", "dismissDialog", "dismissKeyboard", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onLowMemory", "onPause", "onResume", "onTrimMemory", "level", "", "startFragment", "cres", "Lcom/stripe/android/stripe3ds2/transactions/ChallengeResponseData;", "Companion", "3ds2sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
public final class ChallengeActivity extends AppCompatActivity {
    private static final Companion Companion = new Companion(null);

    @Deprecated
    private static final CoroutineDispatcher WORK_CONTEXT = Dispatchers.getIO();
    private Dialog progressDialog;

    private final Lazy viewModel;

    private final Lazy transactionTimer = LazyKt.lazy(new Function0<DefaultTransactionTimer>() {
        {
            super(0);
        }

        public final DefaultTransactionTimer m677invoke() {
            ChallengeViewArgs viewArgs;
            ErrorRequestExecutor errorRequestExecutor;
            ChallengeViewArgs viewArgs2;
            viewArgs = ChallengeActivity.this.getViewArgs();
            int timeoutMins$3ds2sdk_release = viewArgs.getTimeoutMins$3ds2sdk_release();
            errorRequestExecutor = ChallengeActivity.this.getErrorRequestExecutor();
            viewArgs2 = ChallengeActivity.this.getViewArgs();
            return new DefaultTransactionTimer(timeoutMins$3ds2sdk_release, errorRequestExecutor, viewArgs2.getCreqData$3ds2sdk_release());
        }
    });

    private final Lazy errorReporter = LazyKt.lazy(new Function0<DefaultErrorReporter>() {
        {
            super(0);
        }

        public final DefaultErrorReporter m671invoke() {
            ChallengeViewArgs viewArgs;
            Context applicationContext = ChallengeActivity.this.getApplicationContext();
            Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
            viewArgs = ChallengeActivity.this.getViewArgs();
            return new DefaultErrorReporter(applicationContext, new Stripe3ds2ErrorReporterConfig(viewArgs.getSdkTransactionId$3ds2sdk_release()), null, null, null, null, null, 0, 252, null);
        }
    });

    private final Lazy fragment = LazyKt.lazy(new Function0<ChallengeFragment>() {
        {
            super(0);
        }

        public final ChallengeFragment m673invoke() {
            return (ChallengeFragment) ChallengeActivity.this.getViewBinding$3ds2sdk_release().fragmentContainer.getFragment();
        }
    });

    private final Lazy fragmentViewBinding = LazyKt.lazy(new Function0<StripeChallengeFragmentBinding>() {
        {
            super(0);
        }

        public final StripeChallengeFragmentBinding m674invoke() {
            return ChallengeActivity.this.getFragment$3ds2sdk_release().getViewBinding$3ds2sdk_release();
        }
    });

    private final Lazy viewBinding = LazyKt.lazy(new Function0<StripeChallengeActivityBinding>() {
        {
            super(0);
        }

        public final StripeChallengeActivityBinding m679invoke() {
            StripeChallengeActivityBinding inflate = StripeChallengeActivityBinding.inflate(ChallengeActivity.this.getLayoutInflater());
            Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
            return inflate;
        }
    });

    private final Lazy challengeActionHandler = LazyKt.lazy(new Function0<ChallengeActionHandler.Default>() {
        {
            super(0);
        }

        public final ChallengeActionHandler.Default m670invoke() {
            ChallengeViewArgs viewArgs;
            ErrorReporter errorReporter;
            ChallengeViewArgs viewArgs2;
            CoroutineContext coroutineContext;
            viewArgs = ChallengeActivity.this.getViewArgs();
            ChallengeRequestData creqData$3ds2sdk_release = viewArgs.getCreqData$3ds2sdk_release();
            errorReporter = ChallengeActivity.this.getErrorReporter();
            viewArgs2 = ChallengeActivity.this.getViewArgs();
            ChallengeRequestExecutor.Factory creqExecutorFactory$3ds2sdk_release = viewArgs2.getCreqExecutorFactory$3ds2sdk_release();
            coroutineContext = ChallengeActivity.WORK_CONTEXT;
            return new ChallengeActionHandler.Default(creqData$3ds2sdk_release, errorReporter, creqExecutorFactory$3ds2sdk_release, coroutineContext);
        }
    });

    private final Lazy errorRequestExecutor = LazyKt.lazy(new Function0<ErrorRequestExecutor>() {
        {
            super(0);
        }

        public final ErrorRequestExecutor m672invoke() {
            CoroutineContext coroutineContext;
            ChallengeViewArgs viewArgs;
            ErrorReporter errorReporter;
            coroutineContext = ChallengeActivity.WORK_CONTEXT;
            StripeErrorRequestExecutor.Factory factory = new StripeErrorRequestExecutor.Factory(coroutineContext);
            viewArgs = ChallengeActivity.this.getViewArgs();
            String acsUrl$3ds2sdk_release = viewArgs.getCreqExecutorConfig$3ds2sdk_release().getAcsUrl$3ds2sdk_release();
            errorReporter = ChallengeActivity.this.getErrorReporter();
            return factory.create(acsUrl$3ds2sdk_release, errorReporter);
        }
    });

    private final Lazy viewArgs = LazyKt.lazy(new Function0<ChallengeViewArgs>() {
        {
            super(0);
        }

        public final ChallengeViewArgs m678invoke() {
            ChallengeViewArgs.Companion companion = ChallengeViewArgs.INSTANCE;
            Bundle extras = ChallengeActivity.this.getIntent().getExtras();
            if (extras == null) {
                extras = Bundle.EMPTY;
            }
            Intrinsics.checkNotNullExpressionValue(extras, "intent.extras ?: Bundle.EMPTY");
            return companion.create(extras);
        }
    });

    private final Lazy keyboardController = LazyKt.lazy(new Function0<KeyboardController>() {
        {
            super(0);
        }

        public final KeyboardController m675invoke() {
            return new KeyboardController(ChallengeActivity.this);
        }
    });

    private final Lazy progressDialogFactory = LazyKt.lazy(new Function0<ChallengeSubmitDialogFactory>() {
        {
            super(0);
        }

        public final ChallengeSubmitDialogFactory m676invoke() {
            ChallengeViewArgs viewArgs;
            ChallengeActivity challengeActivity = ChallengeActivity.this;
            Context context = (Context) challengeActivity;
            viewArgs = challengeActivity.getViewArgs();
            return new ChallengeSubmitDialogFactory(context, viewArgs.getUiCustomization$3ds2sdk_release());
        }
    });

    public ChallengeActivity() {
        final ComponentActivity componentActivity = (ComponentActivity) this;
        final Function0 function0 = null;
        this.viewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(ChallengeActivityViewModel.class), new Function0<ViewModelStore>() {
            {
                super(0);
            }

            public final ViewModelStore m668invoke() {
                ViewModelStore viewModelStore = componentActivity.getViewModelStore();
                Intrinsics.checkNotNullExpressionValue(viewModelStore, "viewModelStore");
                return viewModelStore;
            }
        }, new Function0<ViewModelProvider.Factory>() {
            {
                super(0);
            }

            public final ViewModelProvider.Factory m680invoke() {
                ChallengeActionHandler challengeActionHandler;
                TransactionTimer transactionTimer;
                ErrorReporter errorReporter;
                CoroutineContext coroutineContext;
                challengeActionHandler = ChallengeActivity.this.getChallengeActionHandler();
                transactionTimer = ChallengeActivity.this.getTransactionTimer();
                errorReporter = ChallengeActivity.this.getErrorReporter();
                coroutineContext = ChallengeActivity.WORK_CONTEXT;
                return new ChallengeActivityViewModel.Factory(challengeActionHandler, transactionTimer, errorReporter, coroutineContext);
            }
        }, new Function0<CreationExtras>() {
            {
                super(0);
            }

            public final CreationExtras m669invoke() {
                CreationExtras creationExtras;
                Function0 function02 = function0;
                if (function02 != null && (creationExtras = (CreationExtras) function02.invoke()) != null) {
                    return creationExtras;
                }
                CreationExtras defaultViewModelCreationExtras = componentActivity.getDefaultViewModelCreationExtras();
                Intrinsics.checkNotNullExpressionValue(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
                return defaultViewModelCreationExtras;
            }
        });
    }

    public final TransactionTimer getTransactionTimer() {
        return (TransactionTimer) this.transactionTimer.getValue();
    }

    public final ErrorReporter getErrorReporter() {
        return (ErrorReporter) this.errorReporter.getValue();
    }

    public final ChallengeFragment getFragment$3ds2sdk_release() {
        return (ChallengeFragment) this.fragment.getValue();
    }

    public final StripeChallengeFragmentBinding getFragmentViewBinding$3ds2sdk_release() {
        return (StripeChallengeFragmentBinding) this.fragmentViewBinding.getValue();
    }

    public final StripeChallengeActivityBinding getViewBinding$3ds2sdk_release() {
        return (StripeChallengeActivityBinding) this.viewBinding.getValue();
    }

    public final ChallengeActionHandler getChallengeActionHandler() {
        return (ChallengeActionHandler) this.challengeActionHandler.getValue();
    }

    public final ErrorRequestExecutor getErrorRequestExecutor() {
        return (ErrorRequestExecutor) this.errorRequestExecutor.getValue();
    }

    public final ChallengeActivityViewModel getViewModel$3ds2sdk_release() {
        return (ChallengeActivityViewModel) this.viewModel.getValue();
    }

    public final ChallengeViewArgs getViewArgs() {
        return (ChallengeViewArgs) this.viewArgs.getValue();
    }

    private final KeyboardController getKeyboardController() {
        return (KeyboardController) this.keyboardController.getValue();
    }

    public final ChallengeSubmitDialogFactory getProgressDialogFactory() {
        return (ChallengeSubmitDialogFactory) this.progressDialogFactory.getValue();
    }

    protected void onCreate(Bundle savedInstanceState) {
        getSupportFragmentManager().setFragmentFactory(new ChallengeFragmentFactory(getViewArgs().getUiCustomization$3ds2sdk_release(), getTransactionTimer(), getErrorRequestExecutor(), getErrorReporter(), getChallengeActionHandler(), getViewArgs().getCresData$3ds2sdk_release().getUiType(), getViewArgs().getIntentData$3ds2sdk_release(), WORK_CONTEXT));
        super.onCreate(savedInstanceState);
        getOnBackPressedDispatcher().addCallback(new OnBackPressedCallback() {
            {
                super(true);
            }

            public void handleOnBackPressed() {
                ChallengeActivity.this.getViewModel$3ds2sdk_release().submit(ChallengeAction.Cancel.INSTANCE);
            }
        });
        getWindow().setFlags(8192, 8192);
        setContentView(getViewBinding$3ds2sdk_release().getRoot());
        LiveData<ChallengeAction> submitClicked = getViewModel$3ds2sdk_release().getSubmitClicked();
        LifecycleOwner lifecycleOwner = (LifecycleOwner) this;
        final Function1<ChallengeAction, Unit> function1 = new Function1<ChallengeAction, Unit>() {
            {
                super(1);
            }

            public Object invoke(Object obj) {
                invoke((ChallengeAction) obj);
                return Unit.INSTANCE;
            }

            public final void invoke(ChallengeAction challengeAction) {
                ChallengeSubmitDialogFactory progressDialogFactory;
                if (ChallengeActivity.this.isFinishing()) {
                    return;
                }
                ChallengeActivity.this.dismissKeyboard();
                ChallengeActivity challengeActivity = ChallengeActivity.this;
                progressDialogFactory = challengeActivity.getProgressDialogFactory();
                Dialog create = progressDialogFactory.create();
                create.show();
                challengeActivity.progressDialog = create;
                ChallengeActivityViewModel viewModel$3ds2sdk_release = ChallengeActivity.this.getViewModel$3ds2sdk_release();
                Intrinsics.checkNotNullExpressionValue(challengeAction, "challengeAction");
                viewModel$3ds2sdk_release.submit(challengeAction);
            }
        };
        submitClicked.observe(lifecycleOwner, new Observer() {
            public final void onChanged(Object obj) {
                ChallengeActivity.onCreate$lambda$0(function1, obj);
            }
        });
        LiveData<ChallengeResult> shouldFinish = getViewModel$3ds2sdk_release().getShouldFinish();
        final Function1<ChallengeResult, Unit> function12 = new Function1<ChallengeResult, Unit>() {
            {
                super(1);
            }

            public Object invoke(Object obj) {
                invoke((ChallengeResult) obj);
                return Unit.INSTANCE;
            }

            public final void invoke(ChallengeResult challengeResult) {
                ChallengeActivity.this.setResult(-1, new Intent().putExtras(challengeResult.toBundle$3ds2sdk_release()));
                if (ChallengeActivity.this.isFinishing()) {
                    return;
                }
                ChallengeActivity.this.finish();
            }
        };
        shouldFinish.observe(lifecycleOwner, new Observer() {
            public final void onChanged(Object obj) {
                ChallengeActivity.onCreate$lambda$1(function12, obj);
            }
        });
        configureHeaderZone();
        final Ref.ObjectRef objectRef = new Ref.ObjectRef();
        objectRef.element = "";
        LiveData<ChallengeResponseData> nextScreen = getViewModel$3ds2sdk_release().getNextScreen();
        final Function1<ChallengeResponseData, Unit> function13 = new Function1<ChallengeResponseData, Unit>() {
            {
                super(1);
            }

            public Object invoke(Object obj) {
                invoke((ChallengeResponseData) obj);
                return Unit.INSTANCE;
            }

            public final void invoke(ChallengeResponseData challengeResponseData) {
                ChallengeActivity.this.dismissDialog();
                if (challengeResponseData != null) {
                    ChallengeActivity.this.startFragment(challengeResponseData);
                    Ref.ObjectRef<String> objectRef2 = objectRef;
                    UiType uiType = challengeResponseData.getUiType();
                    String code = uiType != null ? uiType.getCode() : null;
                    if (code == null) {
                        code = "";
                    }
                    objectRef2.element = code;
                }
            }
        };
        nextScreen.observe(lifecycleOwner, new Observer() {
            public final void onChanged(Object obj) {
                ChallengeActivity.onCreate$lambda$2(function13, obj);
            }
        });
        if (savedInstanceState == null) {
            getViewModel$3ds2sdk_release().onNextScreen(getViewArgs().getCresData$3ds2sdk_release());
        }
        LiveData<Boolean> timeout = getViewModel$3ds2sdk_release().getTimeout();
        final Function1<Boolean, Unit> function14 = new Function1<Boolean, Unit>() {
            {
                super(1);
            }

            public Object invoke(Object obj) {
                invoke((Boolean) obj);
                return Unit.INSTANCE;
            }

            public final void invoke(Boolean bool) {
                ChallengeViewArgs viewArgs;
                ChallengeViewArgs viewArgs2;
                if (Intrinsics.areEqual(bool, true)) {
                    ChallengeActivityViewModel viewModel$3ds2sdk_release = ChallengeActivity.this.getViewModel$3ds2sdk_release();
                    String str = (String) objectRef.element;
                    viewArgs = ChallengeActivity.this.getViewArgs();
                    UiType uiType = viewArgs.getCresData$3ds2sdk_release().getUiType();
                    viewArgs2 = ChallengeActivity.this.getViewArgs();
                    viewModel$3ds2sdk_release.onFinish(new ChallengeResult.Timeout(str, uiType, viewArgs2.getIntentData$3ds2sdk_release()));
                }
            }
        };
        timeout.observe(lifecycleOwner, new Observer() {
            public final void onChanged(Object obj) {
                ChallengeActivity.onCreate$lambda$3(function14, obj);
            }
        });
    }

    public static final void onCreate$lambda$0(Function1 function1, Object obj) {
        Intrinsics.checkNotNullParameter(function1, "$tmp0");
        function1.invoke(obj);
    }

    public static final void onCreate$lambda$1(Function1 function1, Object obj) {
        Intrinsics.checkNotNullParameter(function1, "$tmp0");
        function1.invoke(obj);
    }

    public static final void onCreate$lambda$2(Function1 function1, Object obj) {
        Intrinsics.checkNotNullParameter(function1, "$tmp0");
        function1.invoke(obj);
    }

    public static final void onCreate$lambda$3(Function1 function1, Object obj) {
        Intrinsics.checkNotNullParameter(function1, "$tmp0");
        function1.invoke(obj);
    }

    public final void startFragment(ChallengeResponseData cres) {
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        Intrinsics.checkNotNullExpressionValue(supportFragmentManager, "supportFragmentManager");
        FragmentTransaction beginTransaction = supportFragmentManager.beginTransaction();
        Intrinsics.checkNotNullExpressionValue(beginTransaction, "beginTransaction()");
        beginTransaction.setCustomAnimations(AnimationConstants.INSTANCE.getSLIDE_IN(), AnimationConstants.INSTANCE.getSLIDE_OUT(), AnimationConstants.INSTANCE.getSLIDE_IN(), AnimationConstants.INSTANCE.getSLIDE_OUT());
        beginTransaction.replace(getViewBinding$3ds2sdk_release().fragmentContainer.getId(), ChallengeFragment.class, BundleKt.bundleOf(new Pair[]{TuplesKt.to(ChallengeFragment.ARG_CRES, cres)}));
        beginTransaction.commit();
    }

    public void onLowMemory() {
        super.onLowMemory();
        getViewModel$3ds2sdk_release().onMemoryEvent();
    }

    public void onTrimMemory(int level) {
        super.onTrimMemory(level);
        getViewModel$3ds2sdk_release().onMemoryEvent();
    }

    public final void dismissKeyboard() {
        getKeyboardController().hide();
    }

    protected void onPause() {
        super.onPause();
        getViewModel$3ds2sdk_release().setShouldRefreshUi(true);
        dismissKeyboard();
    }

    protected void onResume() {
        super.onResume();
        if (getViewModel$3ds2sdk_release().getShouldRefreshUi()) {
            getViewModel$3ds2sdk_release().onRefreshUi();
        }
    }

    private final void configureHeaderZone() {
        final ThreeDS2Button customize = new HeaderZoneCustomizer((FragmentActivity) this).customize(getViewArgs().getUiCustomization$3ds2sdk_release().getToolbarCustomization(), getViewArgs().getUiCustomization$3ds2sdk_release().getButtonCustomization(UiCustomization.ButtonType.CANCEL));
        if (customize != null) {
            customize.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    ChallengeActivity.configureHeaderZone$lambda$5(ThreeDS2Button.this, this, view);
                }
            });
        }
    }

    public static final void configureHeaderZone$lambda$5(ThreeDS2Button threeDS2Button, ChallengeActivity challengeActivity, View view) {
        Intrinsics.checkNotNullParameter(challengeActivity, "this$0");
        threeDS2Button.setClickable(false);
        challengeActivity.getViewModel$3ds2sdk_release().submit(ChallengeAction.Cancel.INSTANCE);
    }

    protected void onDestroy() {
        super.onDestroy();
        dismissDialog();
    }

    public final void dismissDialog() {
        Dialog dialog = this.progressDialog;
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
        this.progressDialog = null;
    }

    @Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0082\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0005"}, d2 = {"Lcom/stripe/android/stripe3ds2/views/ChallengeActivity$Companion;", "", "()V", "WORK_CONTEXT", "Lkotlinx/coroutines/CoroutineDispatcher;", "3ds2sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    private static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }
    }
}