正在查看: BodyTech v7.6.4 应用的 CustomerSheetActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: BodyTech v7.6.4 应用的 CustomerSheetActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.stripe.android.customersheet;
import android.content.Intent;
import android.os.Bundle;
import androidx.activity.compose.BackHandlerKt;
import androidx.activity.compose.ComponentActivityKt;
import androidx.appcompat.app.AppCompatActivity;
import androidx.compose.material.ModalBottomSheetValue;
import androidx.compose.runtime.Composable;
import androidx.compose.runtime.ComposableTarget;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.CompositionContext;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.SnapshotStateKt;
import androidx.compose.runtime.State;
import androidx.compose.runtime.internal.ComposableLambdaKt;
import androidx.compose.runtime.internal.StabilityInferred;
import androidx.compose.ui.Modifier;
import androidx.core.view.WindowCompat;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.background.ApplicationStateMonitor;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
import com.stripe.android.common.ui.ElementsBottomSheetLayoutKt;
import com.stripe.android.customersheet.Args;
import com.stripe.android.customersheet.CustomerSheetViewModel;
import com.stripe.android.customersheet.g;
import com.stripe.android.customersheet.n;
import com.stripe.android.customersheet.ui.CustomerSheetScreenKt;
import com.stripe.android.uicore.StripeThemeKt;
import com.stripe.android.uicore.elements.bottomsheet.StripeBottomSheetState;
import com.stripe.android.uicore.elements.bottomsheet.StripeBottomSheetStateKt;
import java.util.ArrayList;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.r;
import kotlin.jvm.internal.v;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.scheduling.WorkQueueKt;
@StabilityInferred(parameters = 0)
@Metadata(d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b \u0010\u0019J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\u0012\u0010\b\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0014J\b\u0010\t\u001a\u00020\u0004H\u0016R\u001d\u0010\u000f\u001a\u0004\u0018\u00010\n8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u000b\u0010\f\u001a\u0004\b\r\u0010\u000eR.\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u00110\u00108\u0000@\u0000X\u0081\u000e¢\u0006\u0018\n\u0004\b\u0012\u0010\u0013\u0012\u0004\b\u0018\u0010\u0019\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017R\u001b\u0010\u001f\u001a\u00020\u001b8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u001c\u0010\f\u001a\u0004\b\u001d\u0010\u001e¨\u0006#²\u0006\f\u0010\"\u001a\u00020!8\nX\u008a\u0084\u0002²\u0006\u000e\u0010\u0003\u001a\u0004\u0018\u00010\u00028\nX\u008a\u0084\u0002"}, d2 = {"Lcom/stripe/android/customersheet/CustomerSheetActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "Lcom/stripe/android/customersheet/n;", "result", "", "D", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "finish", "Lcom/stripe/android/customersheet/d;", "c", "Lkotlin/Lazy;", "E", "()Lcom/stripe/android/customersheet/d;", "args", "Lkotlin/Function0;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "d", "Lkotlin/jvm/functions/Function0;", "G", "()Lkotlin/jvm/functions/Function0;", "setViewModelFactoryProducer$paymentsheet_release", "(Lkotlin/jvm/functions/Function0;)V", "getViewModelFactoryProducer$paymentsheet_release$annotations", "()V", "viewModelFactoryProducer", "Lcom/stripe/android/customersheet/CustomerSheetViewModel;", "e", "F", "()Lcom/stripe/android/customersheet/CustomerSheetViewModel;", "viewModel", "<init>", "Lcom/stripe/android/customersheet/i;", "viewState", "paymentsheet_release"}, k = 1, mv = {1, 9, 0})
@Instrumented
public final class CustomerSheetActivity extends AppCompatActivity implements TraceFieldInterface {
private final Lazy args;
private Function0<? extends ViewModelProvider.Factory> viewModelFactoryProducer;
private final Lazy viewModel;
public Trace k;
public CustomerSheetActivity() {
Lazy b;
b = kotlin.d.b(new Function0<Args>() {
{
super(0);
}
@Override
public final Args invoke() {
Args.Companion companion = Args.INSTANCE;
Intent intent = CustomerSheetActivity.this.getIntent();
r.h(intent, "getIntent(...)");
return companion.a(intent);
}
});
this.args = b;
this.viewModelFactoryProducer = new Function0<CustomerSheetViewModel.a>() {
{
super(0);
}
@Override
public final CustomerSheetViewModel.a invoke() {
Args E;
E = CustomerSheetActivity.this.E();
r.f(E);
return new CustomerSheetViewModel.a(E);
}
};
final Function0 function0 = null;
this.viewModel = new ViewModelLazy(v.b(CustomerSheetViewModel.class), new Function0<ViewModelStore>() {
{
super(0);
}
@Override
public final ViewModelStore invoke() {
return this.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
@Override
public final ViewModelProvider.Factory invoke() {
return CustomerSheetActivity.this.G().invoke();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
@Override
public final CreationExtras invoke() {
CreationExtras creationExtras;
Function0 function02 = Function0.this;
return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? this.getDefaultViewModelCreationExtras() : creationExtras;
}
});
}
public final void D(n result) {
setResult(-1, new Intent().putExtras(result.b()));
finish();
}
public final Args E() {
return (Args) this.args.getValue();
}
public final CustomerSheetViewModel F() {
return (CustomerSheetViewModel) this.viewModel.getValue();
}
public final Function0<ViewModelProvider.Factory> G() {
return this.viewModelFactoryProducer;
}
public void finish() {
super/*android.app.Activity*/.finish();
com.stripe.android.uicore.utils.c.a(this);
}
protected void onCreate(Bundle savedInstanceState) {
TraceMachine.startTracing("CustomerSheetActivity");
try {
TraceMachine.enterMethod(this.k, "CustomerSheetActivity#onCreate", (ArrayList) null);
} catch (NoSuchFieldError unused) {
TraceMachine.enterMethod((Trace) null, "CustomerSheetActivity#onCreate", (ArrayList) null);
}
super/*androidx.fragment.app.FragmentActivity*/.onCreate(savedInstanceState);
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
if (E() == null) {
D(new n.c(new IllegalStateException("No CustomerSheetContract.Args provided")));
TraceMachine.exitMethod();
} else {
F().p0(this, this);
ComponentActivityKt.setContent$default(this, (CompositionContext) null, ComposableLambdaKt.composableLambdaInstance(602239828, true, new Function2<Composer, Integer, Unit>() {
{
super(2);
}
@Override
public Unit invoke(Composer composer, Integer num) {
invoke(composer, num.intValue());
return Unit.a;
}
@ComposableTarget(applier = "androidx.compose.ui.UiComposable")
@Composable
public final void invoke(Composer composer, int i) {
if ((i & 11) == 2 && composer.getSkipping()) {
composer.skipToGroupEnd();
return;
}
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(602239828, i, -1, "com.stripe.android.customersheet.CustomerSheetActivity.onCreate.<anonymous> (CustomerSheetActivity.kt:68)");
}
final CustomerSheetActivity customerSheetActivity = CustomerSheetActivity.this;
StripeThemeKt.a(null, null, null, ComposableLambdaKt.composableLambda(composer, -295136510, true, new Function2<Composer, Integer, Unit>() {
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = WorkQueueKt.STEAL_ANY, mv = {1, 9, 0})
@kotlin.coroutines.jvm.internal.c(c = "com.stripe.android.customersheet.CustomerSheetActivity$onCreate$1$1$1", f = "CustomerSheetActivity.kt", l = {85}, m = "invokeSuspend")
static final class C00221 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
final StripeBottomSheetState $bottomSheetState;
final State<n> $result$delegate;
Object L$0;
Object L$1;
int label;
final CustomerSheetActivity this$0;
C00221(State<? extends n> state, StripeBottomSheetState stripeBottomSheetState, CustomerSheetActivity customerSheetActivity, Continuation<? super C00221> continuation) {
super(2, continuation);
this.$result$delegate = state;
this.$bottomSheetState = stripeBottomSheetState;
this.this$0 = customerSheetActivity;
}
@Override
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
return new C00221(this.$result$delegate, this.$bottomSheetState, this.this$0, continuation);
}
@Override
public final Object invokeSuspend(Object obj) {
Object f;
n nVar;
CustomerSheetActivity customerSheetActivity;
f = kotlin.coroutines.intrinsics.b.f();
int i = this.label;
if (i == 0) {
kotlin.f.b(obj);
n d = AnonymousClass1.d(this.$result$delegate);
if (d != null) {
StripeBottomSheetState stripeBottomSheetState = this.$bottomSheetState;
CustomerSheetActivity customerSheetActivity2 = this.this$0;
this.L$0 = customerSheetActivity2;
this.L$1 = d;
this.label = 1;
if (stripeBottomSheetState.c(this) == f) {
return f;
}
nVar = d;
customerSheetActivity = customerSheetActivity2;
}
return Unit.a;
}
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
nVar = (n) this.L$1;
customerSheetActivity = (CustomerSheetActivity) this.L$0;
kotlin.f.b(obj);
customerSheetActivity.D(nVar);
return Unit.a;
}
@Override
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
return ((C00221) create(coroutineScope, continuation)).invokeSuspend(Unit.a);
}
}
{
super(2);
}
public static final i c(State<? extends i> state) {
return (i) state.getValue();
}
public static final n d(State<? extends n> state) {
return (n) state.getValue();
}
@Override
public Unit invoke(Composer composer2, Integer num) {
invoke(composer2, num.intValue());
return Unit.a;
}
@ComposableTarget(applier = "androidx.compose.ui.UiComposable")
@Composable
public final void invoke(Composer composer2, int i2) {
CustomerSheetViewModel F;
CustomerSheetViewModel F2;
if ((i2 & 11) == 2 && composer2.getSkipping()) {
composer2.skipToGroupEnd();
return;
}
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-295136510, i2, -1, "com.stripe.android.customersheet.CustomerSheetActivity.onCreate.<anonymous>.<anonymous> (CustomerSheetActivity.kt:69)");
}
final CustomerSheetActivity customerSheetActivity2 = CustomerSheetActivity.this;
StripeBottomSheetState b = StripeBottomSheetStateKt.b(null, new Function1<ModalBottomSheetValue, Boolean>() {
{
super(1);
}
@Override
public final Boolean invoke(ModalBottomSheetValue it) {
boolean z;
CustomerSheetViewModel F3;
r.i(it, "it");
if (it == ModalBottomSheetValue.Hidden) {
F3 = CustomerSheetActivity.this.F();
z = F3.H();
} else {
z = true;
}
return Boolean.valueOf(z);
}
}, composer2, 0, 1);
F = CustomerSheetActivity.this.F();
final State collectAsState = SnapshotStateKt.collectAsState(F.Q(), (CoroutineContext) null, composer2, 8, 1);
F2 = CustomerSheetActivity.this.F();
State collectAsState2 = SnapshotStateKt.collectAsState(F2.P(), (CoroutineContext) null, composer2, 8, 1);
EffectsKt.LaunchedEffect(d(collectAsState2), new C00221(collectAsState2, b, CustomerSheetActivity.this, null), composer2, 64);
final CustomerSheetActivity customerSheetActivity3 = CustomerSheetActivity.this;
BackHandlerKt.BackHandler(false, new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.a;
}
public final void invoke2() {
CustomerSheetViewModel F3;
F3 = CustomerSheetActivity.this.F();
F3.V(g.c.a);
}
}, composer2, 0, 1);
final CustomerSheetActivity customerSheetActivity4 = CustomerSheetActivity.this;
Function0<Unit> function0 = new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.a;
}
public final void invoke2() {
CustomerSheetViewModel F3;
F3 = CustomerSheetActivity.this.F();
F3.V(g.h.a);
}
};
final CustomerSheetActivity customerSheetActivity5 = CustomerSheetActivity.this;
ElementsBottomSheetLayoutKt.a(b, (Modifier) null, function0, ComposableLambdaKt.composableLambda(composer2, 1927642793, true, new Function2<Composer, Integer, Unit>() {
@Metadata(k = WorkQueueKt.STEAL_ANY, mv = {1, 9, 0}, xi = 48)
class C00231 extends FunctionReferenceImpl implements Function1<g, Unit> {
C00231(Object obj) {
super(1, obj, CustomerSheetViewModel.class, "handleViewAction", "handleViewAction(Lcom/stripe/android/customersheet/CustomerSheetViewAction;)V", 0);
}
public final void g(g p0) {
r.i(p0, "p0");
((CustomerSheetViewModel) this.receiver).V(p0);
}
@Override
public Unit invoke(g gVar) {
g(gVar);
return Unit.a;
}
}
@Metadata(k = WorkQueueKt.STEAL_ANY, mv = {1, 9, 0}, xi = 48)
class AnonymousClass2 extends FunctionReferenceImpl implements Function1<String, String> {
AnonymousClass2(Object obj) {
super(1, obj, CustomerSheetViewModel.class, "providePaymentMethodName", "providePaymentMethodName(Ljava/lang/String;)Ljava/lang/String;", 0);
}
@Override
public final String invoke(String str) {
return ((CustomerSheetViewModel) this.receiver).o0(str);
}
}
{
super(2);
}
@Override
public Unit invoke(Composer composer3, Integer num) {
invoke(composer3, num.intValue());
return Unit.a;
}
@ComposableTarget(applier = "androidx.compose.ui.UiComposable")
@Composable
public final void invoke(Composer composer3, int i3) {
CustomerSheetViewModel F3;
CustomerSheetViewModel F4;
if ((i3 & 11) == 2 && composer3.getSkipping()) {
composer3.skipToGroupEnd();
return;
}
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(1927642793, i3, -1, "com.stripe.android.customersheet.CustomerSheetActivity.onCreate.<anonymous>.<anonymous>.<anonymous> (CustomerSheetActivity.kt:97)");
}
i c = AnonymousClass1.c(collectAsState);
F3 = CustomerSheetActivity.this.F();
C00231 c00231 = new C00231(F3);
F4 = CustomerSheetActivity.this.F();
CustomerSheetScreenKt.b(c, false, null, c00231, new AnonymousClass2(F4), composer3, 8, 6);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
}
}), composer2, StripeBottomSheetState.e | 3072, 2);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
}
}), composer, 3072, 7);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
}
}), 1, (Object) null);
TraceMachine.exitMethod();
}
}
protected void onStart() {
super.onStart();
ApplicationStateMonitor.getInstance().activityStarted();
}
protected void onStop() {
super.onStop();
ApplicationStateMonitor.getInstance().activityStopped();
}
}