正在查看: Empower MX v1.29.4.340 应用的 AddPaymentMethodActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Empower MX v1.29.4.340 应用的 AddPaymentMethodActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.stripe.android.view;
import Gf.AbstractC0767s;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.lifecycle.f0;
import com.stripe.android.model.q;
import com.stripe.android.view.AbstractC1156c;
import com.stripe.android.view.C1154b;
import com.stripe.android.view.C1172k;
import com.stripe.android.view.InterfaceC1196y;
import com.withpersona.sdk2.inquiry.network.HttpStatusCode;
import java.util.Set;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import sa.AbstractC2257a;
import sf.s;
@Metadata(d1 = {"\u0000}\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\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\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u000f\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0006*\u0001D\b\u0007\u0018\u0000 L2\u00020\u0001:\u0001MB\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0017\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u0004H\u0002¢\u0006\u0004\b\u0007\u0010\bJ\u0017\u0010\n\u001a\u00020\t2\u0006\u0010\u0005\u001a\u00020\u0004H\u0002¢\u0006\u0004\b\n\u0010\u000bJ\u0019\u0010\u000f\u001a\u0004\u0018\u00010\u000e2\u0006\u0010\r\u001a\u00020\fH\u0002¢\u0006\u0004\b\u000f\u0010\u0010J\u0017\u0010\u0013\u001a\u00020\u00062\u0006\u0010\u0012\u001a\u00020\u0011H\u0002¢\u0006\u0004\b\u0013\u0010\u0014J\u0017\u0010\u0015\u001a\u00020\u00062\u0006\u0010\u0012\u001a\u00020\u0011H\u0002¢\u0006\u0004\b\u0015\u0010\u0014J\u0017\u0010\u0018\u001a\u00020\u00062\u0006\u0010\u0017\u001a\u00020\u0016H\u0002¢\u0006\u0004\b\u0018\u0010\u0019J\u0019\u0010\u001c\u001a\u00020\u00062\b\u0010\u001b\u001a\u0004\u0018\u00010\u001aH\u0014¢\u0006\u0004\b\u001c\u0010\u001dJ\u000f\u0010\u001e\u001a\u00020\u0006H\u0014¢\u0006\u0004\b\u001e\u0010\u0003J\u000f\u0010\u001f\u001a\u00020\u0006H\u0016¢\u0006\u0004\b\u001f\u0010\u0003J\u000f\u0010 \u001a\u00020\u0006H\u0016¢\u0006\u0004\b \u0010\u0003J!\u0010%\u001a\u00020\u00062\u0006\u0010\"\u001a\u00020!2\b\u0010$\u001a\u0004\u0018\u00010#H\u0000¢\u0006\u0004\b%\u0010&J\u0017\u0010)\u001a\u00020\u00062\u0006\u0010(\u001a\u00020'H\u0014¢\u0006\u0004\b)\u0010*R\u001b\u0010\u0005\u001a\u00020\u00048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b+\u0010,\u001a\u0004\b-\u0010.R\u001b\u00103\u001a\u00020/8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b0\u0010,\u001a\u0004\b1\u00102R\u001b\u00108\u001a\u0002048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b5\u0010,\u001a\u0004\b6\u00107R\u001b\u0010<\u001a\u00020'8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b9\u0010,\u001a\u0004\b:\u0010;R\u001b\u0010@\u001a\u00020\t8BX\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\bA\u0010,\u001a\u0004\bB\u0010CR\u0014\u0010G\u001a\u00020D8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bE\u0010FR\u0014\u0010K\u001a\u00020H8CX\u0082\u0004¢\u0006\u0006\u001a\u0004\bI\u0010J¨\u0006N"}, d2 = {"Lcom/stripe/android/view/AddPaymentMethodActivity;", "Lcom/stripe/android/view/O0;", "<init>", "()V", "Lcom/stripe/android/view/b;", "args", "", "P1", "(Lcom/stripe/android/view/b;)V", "Lcom/stripe/android/view/j;", "S1", "(Lcom/stripe/android/view/b;)Lcom/stripe/android/view/j;", "Landroid/view/ViewGroup;", "contentRoot", "Landroid/view/View;", "Q1", "(Landroid/view/ViewGroup;)Landroid/view/View;", "Lcom/stripe/android/model/q;", "paymentMethod", "O1", "(Lcom/stripe/android/model/q;)V", "T1", "Lcom/stripe/android/view/c;", "result", "U1", "(Lcom/stripe/android/view/c;)V", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "(Landroid/os/Bundle;)V", "onResume", "onUserInteraction", "C1", "Lcom/stripe/android/view/k;", "viewModel", "Lcom/stripe/android/model/r;", "params", "R1", "(Lcom/stripe/android/view/k;Lcom/stripe/android/model/r;)V", "", "visible", "D1", "(Z)V", "h0", "Lsf/l;", "W1", "()Lcom/stripe/android/view/b;", "Lk8/K;", "i0", "Z1", "()Lk8/K;", "stripe", "Lcom/stripe/android/model/q$n;", "j0", "X1", "()Lcom/stripe/android/model/q$n;", "paymentMethodType", "k0", "Y1", "()Z", "shouldAttachToCustomer", "l0", "V1", "()Lcom/stripe/android/view/j;", "addPaymentMethodView", "m0", "b2", "()Lcom/stripe/android/view/k;", "com/stripe/android/view/AddPaymentMethodActivity$f", "n0", "Lcom/stripe/android/view/AddPaymentMethodActivity$f;", "cardInputListener", "", "a2", "()I", "titleStringRes", "o0", "a", "payments-core_release"}, k = 1, mv = {1, 9, HttpStatusCode.NETWORK_ERROR_0}, xi = 48)
public final class AddPaymentMethodActivity extends O0 {
public static final int p0 = 8;
private final sf.l args = sf.m.a(new d());
private final sf.l stripe = sf.m.a(new m());
private final sf.l paymentMethodType = sf.m.a(new i());
private final sf.l shouldAttachToCustomer = sf.m.a(new j());
private final sf.l addPaymentMethodView = sf.m.a(new c());
private final sf.l viewModel = new androidx.lifecycle.e0(Gf.M.b(C1172k.class), new k(this), new n(), new l(null, this));
private final f cardInputListener = new f();
public class b {
public static final int[] a;
static {
int[] iArr = new int[q.n.values().length];
try {
iArr[q.n.I.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[q.n.K.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[q.n.a0.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
a = iArr;
}
}
static final class c extends AbstractC0767s implements Function0 {
c() {
super(0);
}
@Override
public final AbstractC1170j invoke() {
AddPaymentMethodActivity addPaymentMethodActivity = AddPaymentMethodActivity.this;
AbstractC1170j S1 = addPaymentMethodActivity.S1(addPaymentMethodActivity.W1());
S1.setId(k8.C.Y);
return S1;
}
}
static final class d extends AbstractC0767s implements Function0 {
d() {
super(0);
}
@Override
public final C1154b invoke() {
C1154b.C0228b c0228b = C1154b.H;
Intent intent = AddPaymentMethodActivity.this.getIntent();
Intrinsics.checkNotNullExpressionValue(intent, "getIntent(...)");
return c0228b.a(intent);
}
}
static final class e extends kotlin.coroutines.jvm.internal.m implements Function2 {
int d;
final com.stripe.android.model.q i;
e(k8.f fVar, com.stripe.android.model.q qVar, vf.b bVar) {
super(2, bVar);
this.i = qVar;
}
@Override
public final vf.b create(Object obj, vf.b bVar) {
return AddPaymentMethodActivity.this.new e(null, this.i, bVar);
}
@Override
public final Object invoke(Rf.N n, vf.b bVar) {
return ((e) create(n, bVar)).invokeSuspend(Unit.a);
}
@Override
public final Object invokeSuspend(Object obj) {
Object h;
Object f = wf.b.f();
int i = this.d;
if (i == 0) {
sf.t.b(obj);
C1172k b2 = AddPaymentMethodActivity.this.b2();
com.stripe.android.model.q qVar = this.i;
this.d = 1;
h = b2.h(null, qVar, this);
if (h == f) {
return f;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
sf.t.b(obj);
h = ((sf.s) obj).j();
}
AddPaymentMethodActivity addPaymentMethodActivity = AddPaymentMethodActivity.this;
Throwable e = sf.s.e(h);
if (e == null) {
addPaymentMethodActivity.T1((com.stripe.android.model.q) h);
} else {
addPaymentMethodActivity.E1(false);
String message = e.getMessage();
if (message == null) {
message = "";
}
addPaymentMethodActivity.F1(message);
}
return Unit.a;
}
}
public static final class f implements InterfaceC1196y {
f() {
}
@Override
public void a() {
}
@Override
public void b() {
}
@Override
public void c() {
}
@Override
public void d(InterfaceC1196y.a focusField) {
Intrinsics.checkNotNullParameter(focusField, "focusField");
}
@Override
public void e() {
AddPaymentMethodActivity.this.b2().l();
}
}
static final class g extends kotlin.coroutines.jvm.internal.m implements Function2 {
int d;
final C1172k e;
final com.stripe.android.model.r i;
final AddPaymentMethodActivity v;
g(C1172k c1172k, com.stripe.android.model.r rVar, AddPaymentMethodActivity addPaymentMethodActivity, vf.b bVar) {
super(2, bVar);
this.e = c1172k;
this.i = rVar;
this.v = addPaymentMethodActivity;
}
@Override
public final vf.b create(Object obj, vf.b bVar) {
return new g(this.e, this.i, this.v, bVar);
}
@Override
public final Object invoke(Rf.N n, vf.b bVar) {
return ((g) create(n, bVar)).invokeSuspend(Unit.a);
}
@Override
public final Object invokeSuspend(Object obj) {
Object i;
Object f = wf.b.f();
int i2 = this.d;
if (i2 == 0) {
sf.t.b(obj);
C1172k c1172k = this.e;
com.stripe.android.model.r rVar = this.i;
this.d = 1;
i = c1172k.i(rVar, this);
if (i == f) {
return f;
}
} else {
if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
sf.t.b(obj);
i = ((sf.s) obj).j();
}
AddPaymentMethodActivity addPaymentMethodActivity = this.v;
Throwable e = sf.s.e(i);
if (e == null) {
com.stripe.android.model.q qVar = (com.stripe.android.model.q) i;
if (addPaymentMethodActivity.Y1()) {
addPaymentMethodActivity.O1(qVar);
} else {
addPaymentMethodActivity.T1(qVar);
}
} else {
addPaymentMethodActivity.E1(false);
String message = e.getMessage();
if (message == null) {
message = "";
}
addPaymentMethodActivity.F1(message);
}
return Unit.a;
}
}
static final class h extends AbstractC0767s implements Function0 {
h() {
super(0);
}
public final void a() {
AddPaymentMethodActivity.this.W1();
}
@Override
public Object invoke() {
a();
return Unit.a;
}
}
static final class i extends AbstractC0767s implements Function0 {
i() {
super(0);
}
@Override
public final q.n invoke() {
return AddPaymentMethodActivity.this.W1().d();
}
}
static final class j extends AbstractC0767s implements Function0 {
j() {
super(0);
}
@Override
public final Boolean invoke() {
return Boolean.valueOf(AddPaymentMethodActivity.this.X1().e && AddPaymentMethodActivity.this.W1().e());
}
}
public static final class k extends AbstractC0767s implements Function0 {
final ComponentActivity d;
public k(ComponentActivity componentActivity) {
super(0);
this.d = componentActivity;
}
@Override
public final androidx.lifecycle.g0 invoke() {
return this.d.H();
}
}
public static final class l extends AbstractC0767s implements Function0 {
final Function0 d;
final ComponentActivity e;
public l(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 m extends AbstractC0767s implements Function0 {
m() {
super(0);
}
@Override
public final k8.K invoke() {
k8.r c = AddPaymentMethodActivity.this.W1().c();
if (c == null) {
c = k8.r.i.a(AddPaymentMethodActivity.this);
}
Context applicationContext = AddPaymentMethodActivity.this.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "getApplicationContext(...)");
return new k8.K(applicationContext, c.c(), c.d(), false, (Set) null, 24, (DefaultConstructorMarker) null);
}
}
static final class n extends AbstractC0767s implements Function0 {
n() {
super(0);
}
@Override
public final f0.c invoke() {
return new C1172k.b(AddPaymentMethodActivity.this.Z1(), AddPaymentMethodActivity.this.W1());
}
}
public final void O1(com.stripe.android.model.q paymentMethod) {
Object b2;
try {
s.a aVar = sf.s.e;
k8.f.a.a();
b2 = sf.s.b(null);
} catch (Throwable th) {
s.a aVar2 = sf.s.e;
b2 = sf.s.b(sf.t.a(th));
}
Throwable e2 = sf.s.e(b2);
if (e2 != null) {
U1(new AbstractC1156c.C0230c(e2));
} else {
androidx.appcompat.app.x.a(b2);
Rf.i.d(androidx.lifecycle.y.a(this), (CoroutineContext) null, (Rf.P) null, new e(null, paymentMethod, null), 3, (Object) null);
}
}
private final void P1(C1154b args) {
Integer f2 = args.f();
if (f2 != null) {
getWindow().addFlags(f2.intValue());
}
B1().setLayoutResource(k8.E.c);
View inflate = B1().inflate();
Intrinsics.g(inflate, "null cannot be cast to non-null type android.view.ViewGroup");
F8.c a = F8.c.a((ViewGroup) inflate);
Intrinsics.checkNotNullExpressionValue(a, "bind(...)");
a.b.addView(V1());
LinearLayout root = a.b;
Intrinsics.checkNotNullExpressionValue(root, "root");
View Q1 = Q1(root);
if (Q1 != null) {
V1().setAccessibilityTraversalBefore(Q1.getId());
Q1.setAccessibilityTraversalAfter(V1().getId());
a.b.addView(Q1);
}
setTitle(a2());
}
private final View Q1(ViewGroup contentRoot) {
if (W1().a() <= 0) {
return null;
}
View inflate = getLayoutInflater().inflate(W1().a(), contentRoot, false);
inflate.setId(k8.C.X);
if (!(inflate instanceof TextView)) {
return inflate;
}
TextView textView = (TextView) inflate;
N1.c.d(textView, 15);
androidx.core.view.Z.j(inflate);
textView.setMovementMethod(LinkMovementMethod.getInstance());
return inflate;
}
public final AbstractC1170j S1(C1154b args) {
int i2 = b.a[X1().ordinal()];
if (i2 == 1) {
C1158d c1158d = new C1158d(this, null, 0, args.b(), 6, null);
c1158d.setCardInputListener(this.cardInputListener);
return c1158d;
}
if (i2 == 2) {
return C1162f.v.a(this);
}
if (i2 == 3) {
return C1168i.i.a(this);
}
throw new IllegalArgumentException("Unsupported Payment Method type: " + X1().d);
}
public final void T1(com.stripe.android.model.q paymentMethod) {
U1(new AbstractC1156c.d(paymentMethod));
}
private final void U1(AbstractC1156c result) {
E1(false);
setResult(-1, new Intent().putExtras(result.a()));
finish();
}
private final AbstractC1170j V1() {
return (AbstractC1170j) this.addPaymentMethodView.getValue();
}
public final C1154b W1() {
return (C1154b) this.args.getValue();
}
public final q.n X1() {
return (q.n) this.paymentMethodType.getValue();
}
public final boolean Y1() {
return ((Boolean) this.shouldAttachToCustomer.getValue()).booleanValue();
}
public final k8.K Z1() {
return (k8.K) this.stripe.getValue();
}
private final int a2() {
int i2 = b.a[X1().ordinal()];
if (i2 == 1) {
return k8.G.F0;
}
if (i2 == 2) {
return k8.G.H0;
}
if (i2 == 3) {
return k8.G.H0;
}
throw new IllegalArgumentException("Unsupported Payment Method type: " + X1().d);
}
public final C1172k b2() {
return (C1172k) this.viewModel.getValue();
}
@Override
public void C1() {
b2().o();
R1(b2(), V1().getCreateParams());
}
@Override
protected void D1(boolean visible) {
V1().setCommunicatingProgress(visible);
}
public final void R1(C1172k viewModel, com.stripe.android.model.r params) {
Intrinsics.checkNotNullParameter(viewModel, "viewModel");
if (params == null) {
return;
}
E1(true);
Rf.i.d(androidx.lifecycle.y.a(this), (CoroutineContext) null, (Rf.P) null, new g(viewModel, params, this, null), 3, (Object) null);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (AbstractC2257a.a(this, new h())) {
return;
}
b2().n();
P1(W1());
setResult(-1, new Intent().putExtras(AbstractC1156c.a.e.a()));
}
protected void onResume() {
super/*androidx.fragment.app.i*/.onResume();
V1().requestFocus();
}
public void onUserInteraction() {
super/*android.app.Activity*/.onUserInteraction();
b2().m();
}
}