导航菜单

页面标题

页面副标题

Empower MX v1.29.4.340 - PaymentAuthWebViewActivity.java 源代码

正在查看: Empower MX v1.29.4.340 应用的 PaymentAuthWebViewActivity.java JAVA 源代码文件

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


package com.stripe.android.view;

import Gf.AbstractC0767s;
import Gf.C0765p;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import androidx.activity.ComponentActivity;
import androidx.lifecycle.f0;
import com.google.android.gms.internal.common.zgyE.ScvWBticsRgdcT;
import com.google.android.material.progressindicator.CircularProgressIndicator;
import com.stripe.android.core.exception.StripeException;
import com.stripe.android.model.Source;
import com.stripe.android.view.C1185q0;
import com.withpersona.sdk2.inquiry.network.HttpStatusCode;
import i9.h;
import java.util.Map;
import java.util.Set;
import kotlin.KotlinNothingValueException;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import m8.a;
import r8.d;

@Metadata(d1 = {"\u0000h\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0003\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\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\u0005\b\u0007\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u000f\u0010\u0005\u001a\u00020\u0004H\u0002¢\u0006\u0004\b\u0005\u0010\u0003J\u000f\u0010\u0006\u001a\u00020\u0004H\u0002¢\u0006\u0004\b\u0006\u0010\u0003J\u0017\u0010\n\u001a\u00020\t2\u0006\u0010\b\u001a\u00020\u0007H\u0002¢\u0006\u0004\b\n\u0010\u000bJ\u0019\u0010\u000e\u001a\u00020\u00042\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0014¢\u0006\u0004\b\u000e\u0010\u000fJ\u0019\u0010\u0012\u001a\u00020\u00042\b\u0010\u0011\u001a\u0004\u0018\u00010\u0010H\u0001¢\u0006\u0004\b\u0012\u0010\u0013J\u000f\u0010\u0014\u001a\u00020\u0004H\u0014¢\u0006\u0004\b\u0014\u0010\u0003J\u0017\u0010\u0018\u001a\u00020\u00172\u0006\u0010\u0016\u001a\u00020\u0015H\u0016¢\u0006\u0004\b\u0018\u0010\u0019J\u0017\u0010\u001c\u001a\u00020\u00172\u0006\u0010\u001b\u001a\u00020\u001aH\u0016¢\u0006\u0004\b\u001c\u0010\u001dR\u001b\u0010#\u001a\u00020\u001e8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u001f\u0010 \u001a\u0004\b!\u0010\"R\u001d\u0010(\u001a\u0004\u0018\u00010$8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b%\u0010 \u001a\u0004\b&\u0010'R\u001b\u0010-\u001a\u00020)8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b*\u0010 \u001a\u0004\b+\u0010,R\u001b\u00102\u001a\u00020.8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b/\u0010 \u001a\u0004\b0\u00101¨\u00063"}, d2 = {"Lcom/stripe/android/view/PaymentAuthWebViewActivity;", "Landroidx/appcompat/app/c;", "<init>", "()V", "", "A1", "C1", "Lc9/c;", "paymentFlowResult", "Landroid/content/Intent;", "B1", "(Lc9/c;)Landroid/content/Intent;", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "(Landroid/os/Bundle;)V", "", "error", "H1", "(Ljava/lang/Throwable;)V", "onDestroy", "Landroid/view/Menu;", "menu", "", "onCreateOptionsMenu", "(Landroid/view/Menu;)Z", "Landroid/view/MenuItem;", "item", "onOptionsItemSelected", "(Landroid/view/MenuItem;)Z", "LF8/p;", "b0", "Lsf/l;", "E1", "()LF8/p;", "viewBinding", "Lm8/a$a;", "c0", "G1", "()Lm8/a$a;", "_args", "Lr8/d;", "d0", "D1", "()Lr8/d;", "logger", "Lcom/stripe/android/view/q0;", "e0", "F1", "()Lcom/stripe/android/view/q0;", "viewModel", "payments-core_release"}, k = 1, mv = {1, 9, HttpStatusCode.NETWORK_ERROR_0}, xi = 48)
public final class PaymentAuthWebViewActivity extends androidx.appcompat.app.c {

    private final sf.l viewBinding = sf.m.a(new j());

    private final sf.l _args = sf.m.a(new a());

    private final sf.l logger = sf.m.a(new b());

    private final sf.l viewModel = new androidx.lifecycle.e0(Gf.M.b(C1185q0.class), new h(this), new k(), new i(null, this));

    static final class a extends AbstractC0767s implements Function0 {
        a() {
            super(0);
        }

        @Override
        public final a.a invoke() {
            a.b bVar = m8.a.a;
            Intent intent = PaymentAuthWebViewActivity.this.getIntent();
            Intrinsics.checkNotNullExpressionValue(intent, "getIntent(...)");
            return bVar.a(intent);
        }
    }

    static final class b extends AbstractC0767s implements Function0 {
        b() {
            super(0);
        }

        @Override
        public final r8.d invoke() {
            d.a aVar = r8.d.a;
            a.a G1 = PaymentAuthWebViewActivity.this.G1();
            boolean z = false;
            if (G1 != null && G1.c()) {
                z = true;
            }
            return aVar.a(z);
        }
    }

    static final class c extends AbstractC0767s implements Function1 {
        c() {
            super(1);
        }

        public final void a(d.C addCallback) {
            Intrinsics.checkNotNullParameter(addCallback, "$this$addCallback");
            if (PaymentAuthWebViewActivity.this.E1().d.canGoBack()) {
                PaymentAuthWebViewActivity.this.E1().d.goBack();
            } else {
                PaymentAuthWebViewActivity.this.A1();
            }
        }

        @Override
        public Object invoke(Object obj) {
            a((d.C) obj);
            return Unit.a;
        }
    }

    static final class d extends kotlin.coroutines.jvm.internal.m implements Function2 {
        int d;
        final Uf.A e;
        final PaymentAuthWebViewActivity i;

        static final class a implements Uf.f {
            final PaymentAuthWebViewActivity d;

            a(PaymentAuthWebViewActivity paymentAuthWebViewActivity) {
                this.d = paymentAuthWebViewActivity;
            }

            public Object a(Object obj, vf.b bVar) {
                return b(((Boolean) obj).booleanValue(), bVar);
            }

            public final Object b(boolean z, vf.b bVar) {
                if (z) {
                    CircularProgressIndicator progressBar = this.d.E1().b;
                    Intrinsics.checkNotNullExpressionValue(progressBar, "progressBar");
                    progressBar.setVisibility(8);
                }
                return Unit.a;
            }
        }

        d(Uf.A a2, PaymentAuthWebViewActivity paymentAuthWebViewActivity, vf.b bVar) {
            super(2, bVar);
            this.e = a2;
            this.i = paymentAuthWebViewActivity;
        }

        @Override
        public final vf.b create(Object obj, vf.b bVar) {
            return new d(this.e, this.i, bVar);
        }

        @Override
        public final Object invoke(Rf.N n, vf.b bVar) {
            return ((d) create(n, bVar)).invokeSuspend(Unit.a);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object f = wf.b.f();
            int i = this.d;
            if (i == 0) {
                sf.t.b(obj);
                Uf.A a2 = this.e;
                a aVar = new a(this.i);
                this.d = 1;
                if (a2.b(aVar, this) == f) {
                    return f;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                sf.t.b(obj);
            }
            throw new KotlinNothingValueException();
        }
    }

    static final class e extends AbstractC0767s implements Function0 {
        final C1186r0 d;

        e(C1186r0 c1186r0) {
            super(0);
            this.d = c1186r0;
        }

        public final void a() {
            this.d.j(true);
        }

        @Override
        public Object invoke() {
            a();
            return Unit.a;
        }
    }

    class f extends C0765p implements Function1 {
        f(Object obj) {
            super(1, obj, PaymentAuthWebViewActivity.class, "startActivity", "startActivity(Landroid/content/Intent;)V", 0);
        }

        @Override
        public Object invoke(Object obj) {
            u((Intent) obj);
            return Unit.a;
        }

        public final void u(Intent intent) {
            ((PaymentAuthWebViewActivity) this.e).startActivity(intent);
        }
    }

    class g extends C0765p implements Function1 {
        g(Object obj) {
            super(1, obj, PaymentAuthWebViewActivity.class, "onAuthComplete", "onAuthComplete$payments_core_release(Ljava/lang/Throwable;)V", 0);
        }

        @Override
        public Object invoke(Object obj) {
            u((Throwable) obj);
            return Unit.a;
        }

        public final void u(Throwable th) {
            ((PaymentAuthWebViewActivity) this.e).H1(th);
        }
    }

    public static final class h extends AbstractC0767s implements Function0 {
        final ComponentActivity d;

        public h(ComponentActivity componentActivity) {
            super(0);
            this.d = componentActivity;
        }

        @Override
        public final androidx.lifecycle.g0 invoke() {
            return this.d.H();
        }
    }

    public static final class i extends AbstractC0767s implements Function0 {
        final Function0 d;
        final ComponentActivity e;

        public i(Function0 function0, ComponentActivity componentActivity) {
            super(0);
            this.d = function0;
            this.e = componentActivity;
        }

        @Override
        public final n2.a invoke() {
            n2.a aVar;
            Function0 function0 = this.d;
            return (function0 == null || (aVar = (n2.a) function0.invoke()) == null) ? this.e.A() : aVar;
        }
    }

    static final class j extends AbstractC0767s implements Function0 {
        j() {
            super(0);
        }

        @Override
        public final F8.p invoke() {
            F8.p c = F8.p.c(PaymentAuthWebViewActivity.this.getLayoutInflater());
            Intrinsics.checkNotNullExpressionValue(c, ScvWBticsRgdcT.ivUGobsgLDM);
            return c;
        }
    }

    static final class k extends AbstractC0767s implements Function0 {
        k() {
            super(0);
        }

        @Override
        public final f0.c invoke() {
            Application application = PaymentAuthWebViewActivity.this.getApplication();
            Intrinsics.checkNotNullExpressionValue(application, "getApplication(...)");
            r8.d D1 = PaymentAuthWebViewActivity.this.D1();
            a.a G1 = PaymentAuthWebViewActivity.this.G1();
            if (G1 != null) {
                return new C1185q0.a(application, D1, G1);
            }
            throw new IllegalArgumentException("Required value was null.");
        }
    }

    public final void A1() {
        setResult(-1, F1().j());
        finish();
    }

    private final Intent B1(c9.c paymentFlowResult) {
        Intent putExtras = new Intent().putExtras(paymentFlowResult.k());
        Intrinsics.checkNotNullExpressionValue(putExtras, "putExtras(...)");
        return putExtras;
    }

    private final void C1() {
        D1().b("PaymentAuthWebViewActivity#customizeToolbar()");
        C1185q0.b n = F1().n();
        if (n != null) {
            D1().b("PaymentAuthWebViewActivity#customizeToolbar() - updating toolbar title");
            E1().c.setTitle(V9.a.a.b(this, n.a(), n.b()));
        }
        String m = F1().m();
        if (m != null) {
            D1().b("PaymentAuthWebViewActivity#customizeToolbar() - updating toolbar background color");
            int parseColor = Color.parseColor(m);
            E1().c.setBackgroundColor(parseColor);
            V9.a.a.e(this, parseColor);
        }
    }

    public final r8.d D1() {
        return (r8.d) this.logger.getValue();
    }

    public final F8.p E1() {
        return (F8.p) this.viewBinding.getValue();
    }

    private final C1185q0 F1() {
        return (C1185q0) this.viewModel.getValue();
    }

    public final a.a G1() {
        return (a.a) this._args.getValue();
    }

    public final void H1(Throwable error) {
        if (error != null) {
            h.a aVar = i9.h.a;
            Context applicationContext = getApplicationContext();
            Intrinsics.checkNotNullExpressionValue(applicationContext, "getApplicationContext(...)");
            i9.h b2 = h.a.b(aVar, applicationContext, (Set) null, 2, (Object) null);
            h.d dVar = h.d.e;
            StripeException.a aVar2 = StripeException.w;
            h.b.a(b2, dVar, aVar2.b(error), (Map) null, 4, (Object) null);
            F1().p();
            setResult(-1, B1(c9.c.b(F1().l(), (String) null, 2, aVar2.b(error), true, (String) null, (Source) null, (String) null, 113, (Object) null)));
        } else {
            F1().o();
        }
        finish();
    }

    protected void onCreate(Bundle savedInstanceState) {
        super/*androidx.fragment.app.i*/.onCreate(savedInstanceState);
        a.a G1 = G1();
        if (G1 == null) {
            setResult(0);
            finish();
            h.a aVar = i9.h.a;
            Context applicationContext = getApplicationContext();
            Intrinsics.checkNotNullExpressionValue(applicationContext, "getApplicationContext(...)");
            h.b.a(h.a.b(aVar, applicationContext, (Set) null, 2, (Object) null), h.d.i, (StripeException) null, (Map) null, 6, (Object) null);
            return;
        }
        D1().b("PaymentAuthWebViewActivity#onCreate()");
        setContentView(E1().b());
        t1(E1().c);
        C1();
        d.D i2 = i();
        Intrinsics.checkNotNullExpressionValue(i2, "<get-onBackPressedDispatcher>(...)");
        d.F.b(i2, (androidx.lifecycle.x) null, false, new c(), 3, (Object) null);
        String m = G1.m();
        setResult(-1, B1(F1().l()));
        if (StringsKt.f0(m)) {
            D1().b("PaymentAuthWebViewActivity#onCreate() - clientSecret is blank");
            finish();
            h.a aVar2 = i9.h.a;
            Context applicationContext2 = getApplicationContext();
            Intrinsics.checkNotNullExpressionValue(applicationContext2, "getApplicationContext(...)");
            h.b.a(h.a.b(aVar2, applicationContext2, (Set) null, 2, (Object) null), h.f.e, (StripeException) null, (Map) null, 6, (Object) null);
            return;
        }
        D1().b("PaymentAuthWebViewActivity#onCreate() - PaymentAuthWebView init and loadUrl");
        Uf.A a2 = Uf.Q.a(Boolean.FALSE);
        Rf.i.d(androidx.lifecycle.y.a(this), (CoroutineContext) null, (Rf.P) null, new d(a2, this, null), 3, (Object) null);
        C1186r0 c1186r0 = new C1186r0(D1(), a2, m, G1.t0(), new f(this), new g(this));
        E1().d.setOnLoadBlank$payments_core_release(new e(c1186r0));
        E1().d.setWebViewClient(c1186r0);
        E1().d.setWebChromeClient(new C1183p0(this, D1()));
        F1().q();
        E1().d.loadUrl(G1.q(), F1().k());
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        Intrinsics.checkNotNullParameter(menu, "menu");
        D1().b("PaymentAuthWebViewActivity#onCreateOptionsMenu()");
        getMenuInflater().inflate(k8.F.b, menu);
        String i2 = F1().i();
        if (i2 != null) {
            D1().b("PaymentAuthWebViewActivity#customizeToolbar() - updating close button text");
            menu.findItem(k8.C.a).setTitle(i2);
        }
        return super/*android.app.Activity*/.onCreateOptionsMenu(menu);
    }

    protected void onDestroy() {
        E1().e.removeAllViews();
        E1().d.destroy();
        super.onDestroy();
    }

    public boolean onOptionsItemSelected(MenuItem item) {
        Intrinsics.checkNotNullParameter(item, "item");
        D1().b("PaymentAuthWebViewActivity#onOptionsItemSelected()");
        if (item.getItemId() != k8.C.a) {
            return super/*android.app.Activity*/.onOptionsItemSelected(item);
        }
        A1();
        return true;
    }
}