Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 MfaTurnFragment.java 源代码,内容仅作参考
package by.kufar.mfa.ui.turn;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.ViewAnimator;
import androidx.autofill.HintConstants;
import androidx.compose.runtime.internal.StabilityInferred;
import androidx.core.view.ViewGroupKt;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.mfa.R$id;
import by.kufar.mfa.R$layout;
import by.kufar.mfa.ui.turn.MfaTurnVM;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import by.kufar.sharedmodels.entity.SpanContent;
import com.google.android.material.snackbar.Snackbar;
import db.h0;
import e80.t;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.s;
import kotlin.reflect.KProperty;
import qd.d;
@StabilityInferred(parameters = 0)
@Metadata(d1 = {"\u0000\u0088\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0007\u0018\u0000 U2\u00020\u0001:\u0001VB\u0007¢\u0006\u0004\bS\u0010TJ\b\u0010\u0003\u001a\u00020\u0002H\u0002J\u0010\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004H\u0002J\b\u0010\u0007\u001a\u00020\u0002H\u0002J\u0010\u0010\n\u001a\u00020\u00022\u0006\u0010\t\u001a\u00020\bH\u0002J\u0010\u0010\f\u001a\u00020\u00022\u0006\u0010\u000b\u001a\u00020\u0004H\u0002J\n\u0010\u000e\u001a\u0004\u0018\u00010\rH\u0002J\b\u0010\u000f\u001a\u00020\u0002H\u0002J\b\u0010\u0010\u001a\u00020\u0002H\u0016J&\u0010\u0018\u001a\u0004\u0018\u00010\u00172\u0006\u0010\u0012\u001a\u00020\u00112\b\u0010\u0014\u001a\u0004\u0018\u00010\u00132\b\u0010\u0016\u001a\u0004\u0018\u00010\u0015H\u0016J\b\u0010\u0019\u001a\u00020\u0002H\u0016J\u001a\u0010\u001b\u001a\u00020\u00022\u0006\u0010\u001a\u001a\u00020\u00172\b\u0010\u0016\u001a\u0004\u0018\u00010\u0015H\u0016J\"\u0010!\u001a\u00020\u00022\u0006\u0010\u001d\u001a\u00020\u001c2\u0006\u0010\u001e\u001a\u00020\u001c2\b\u0010 \u001a\u0004\u0018\u00010\u001fH\u0016R\"\u0010#\u001a\u00020\"8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b#\u0010$\u001a\u0004\b%\u0010&\"\u0004\b'\u0010(R\"\u0010*\u001a\u00020)8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b*\u0010+\u001a\u0004\b,\u0010-\"\u0004\b.\u0010/R\"\u00101\u001a\u0002008\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b1\u00102\u001a\u0004\b3\u00104\"\u0004\b5\u00106R\u001b\u0010;\u001a\u00020\u00178BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b7\u00108\u001a\u0004\b9\u0010:R\u001b\u0010\u000b\u001a\u00020<8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b=\u00108\u001a\u0004\b>\u0010?R\u001b\u0010D\u001a\u00020@8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bA\u00108\u001a\u0004\bB\u0010CR\u001b\u0010G\u001a\u00020@8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bE\u00108\u001a\u0004\bF\u0010CR\u001b\u0010J\u001a\u00020\u00178BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bH\u00108\u001a\u0004\bI\u0010:R\u001b\u0010O\u001a\u00020K8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bL\u00108\u001a\u0004\bM\u0010NR\u0016\u0010Q\u001a\u00020P8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bQ\u0010R¨\u0006W"}, d2 = {"Lby/kufar/mfa/ui/turn/MfaTurnFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "", "openCustomerSupportLink", "", "url", "openUrl", "setUpViewModel", "Lby/kufar/mfa/ui/turn/MfaTurnVM$a;", "state", "showState", HintConstants.AUTOFILL_HINT_PHONE, "showMfaSuccessScreen", "Lby/kufar/mfa/ui/turn/MfaTurnActivity;", "mfaTurnActivity", "startVerification", "onInject", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "onStart", "view", "onViewCreated", "", "requestCode", "resultCode", "Landroid/content/Intent;", "data", "onActivityResult", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelFactory", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelFactory", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Lcb/b;", "mediator", "Lcb/b;", "getMediator", "()Lcb/b;", "setMediator", "(Lcb/b;)V", "Lnd/a;", "tracker", "Lnd/a;", "getTracker", "()Lnd/a;", "setTracker", "(Lnd/a;)V", "close$delegate", "Li6/c;", "getClose", "()Landroid/view/View;", "close", "Landroid/widget/TextView;", "phone$delegate", "getPhone", "()Landroid/widget/TextView;", "Landroid/widget/Button;", "acceptPhoneNumber$delegate", "getAcceptPhoneNumber", "()Landroid/widget/Button;", "acceptPhoneNumber", "changePhoneNumber$delegate", "getChangePhoneNumber", "changePhoneNumber", "help$delegate", "getHelp", "help", "Landroid/widget/ViewAnimator;", "animator$delegate", "getAnimator", "()Landroid/widget/ViewAnimator;", "animator", "Lby/kufar/mfa/ui/turn/MfaTurnVM;", "viewModel", "Lby/kufar/mfa/ui/turn/MfaTurnVM;", "<init>", "()V", "Companion", "a", "feature-mfa_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class MfaTurnFragment extends BaseFragment {
private static final int VERIFICATION_REQUEST_CODE = 1000;
public cb.b mediator;
public nd.a tracker;
private MfaTurnVM viewModel;
public ViewModelProvider.Factory viewModelFactory;
static final KProperty<Object>[] $$delegatedProperties = {o0.i(new g0(MfaTurnFragment.class, "close", "getClose()Landroid/view/View;", 0)), o0.i(new g0(MfaTurnFragment.class, HintConstants.AUTOFILL_HINT_PHONE, "getPhone()Landroid/widget/TextView;", 0)), o0.i(new g0(MfaTurnFragment.class, "acceptPhoneNumber", "getAcceptPhoneNumber()Landroid/widget/Button;", 0)), o0.i(new g0(MfaTurnFragment.class, "changePhoneNumber", "getChangePhoneNumber()Landroid/widget/Button;", 0)), o0.i(new g0(MfaTurnFragment.class, "help", "getHelp()Landroid/view/View;", 0)), o0.i(new g0(MfaTurnFragment.class, "animator", "getAnimator()Landroid/widget/ViewAnimator;", 0))};
public static final int $stable = 8;
private final i6.c close = bindView(R$id.f11301d);
private final i6.c phone = bindView(R$id.f11307j);
private final i6.c acceptPhoneNumber = bindView(R$id.f11298a);
private final i6.c changePhoneNumber = bindView(R$id.f11300c);
private final i6.c help = bindView(R$id.f11304g);
private final i6.c animator = bindView(R$id.f11299b);
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n"}, d2 = {"Lby/kufar/mfa/ui/turn/MfaTurnVM$a;", "kotlin.jvm.PlatformType", "it", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class b implements Observer<MfaTurnVM.a> {
public b() {
}
@Override
public final void onChanged(MfaTurnVM.a aVar) {
MfaTurnFragment mfaTurnFragment = MfaTurnFragment.this;
s.g(aVar);
mfaTurnFragment.showState(aVar);
}
}
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class c implements Observer<by.kufar.core.android.arch.a<? extends String>> {
public c() {
}
@Override
public final void onChanged(by.kufar.core.android.arch.a<String> aVar) {
String a11 = aVar.a();
if (a11 != null) {
MfaTurnFragment.this.showMfaSuccessScreen(a11);
}
}
}
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u0010\u0004\u001a\u00020\u00012\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class d implements Observer<by.kufar.core.android.arch.a<? extends Unit>> {
public d() {
}
@Override
public final void onChanged(by.kufar.core.android.arch.a<Unit> aVar) {
MfaTurnFragment.this.startVerification();
}
}
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u0010\u0004\u001a\u00020\u00012\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class e implements Observer<by.kufar.core.android.arch.a<? extends Unit>> {
public e() {
}
@Override
public final void onChanged(by.kufar.core.android.arch.a<Unit> aVar) {
FragmentActivity activity = MfaTurnFragment.this.getActivity();
if (activity != null) {
activity.setResult(0);
}
FragmentActivity activity2 = MfaTurnFragment.this.getActivity();
if (activity2 != null) {
activity2.finish();
}
}
}
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class f implements Observer<by.kufar.core.android.arch.a<? extends Integer>> {
public f() {
}
@Override
public final void onChanged(by.kufar.core.android.arch.a<Integer> aVar) {
Integer a11 = aVar.a();
if (a11 != null) {
Snackbar s11 = ek.b.s(ek.b.f75340a, MfaTurnFragment.this.getView(), MfaTurnFragment.this.getString(a11.intValue()), 0, null, 0, null, 56, null);
if (s11 != null) {
s11.W();
}
}
}
}
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n"}, d2 = {"Lby/kufar/core/android/arch/a;", "Lby/kufar/sharedmodels/entity/SpanContent;", "kotlin.jvm.PlatformType", "it", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class g implements Observer<by.kufar.core.android.arch.a<? extends SpanContent>> {
public g() {
}
@Override
public final void onChanged(by.kufar.core.android.arch.a<SpanContent> aVar) {
Snackbar r11;
SpanContent a11 = aVar.a();
if (a11 != null && (r11 = ek.b.r(ek.b.f75340a, MfaTurnFragment.this.getView(), a11, 0, null, 0, null, 60, null)) != null) {
r11.W();
}
}
}
private final Button getAcceptPhoneNumber() {
return (Button) this.acceptPhoneNumber.getValue(this, $$delegatedProperties[2]);
}
private final ViewAnimator getAnimator() {
return (ViewAnimator) this.animator.getValue(this, $$delegatedProperties[5]);
}
private final Button getChangePhoneNumber() {
return (Button) this.changePhoneNumber.getValue(this, $$delegatedProperties[3]);
}
private final View getClose() {
return (View) this.close.getValue(this, $$delegatedProperties[0]);
}
private final View getHelp() {
return (View) this.help.getValue(this, $$delegatedProperties[4]);
}
private final TextView getPhone() {
return (TextView) this.phone.getValue(this, $$delegatedProperties[1]);
}
private final MfaTurnActivity mfaTurnActivity() {
FragmentActivity activity = getActivity();
if (activity instanceof MfaTurnActivity) {
return (MfaTurnActivity) activity;
}
return null;
}
public static final void onViewCreated$lambda$0(MfaTurnFragment this$0, View view) {
s.j(this$0, "this$0");
this$0.openCustomerSupportLink();
}
public static final void onViewCreated$lambda$1(MfaTurnFragment this$0, View view) {
s.j(this$0, "this$0");
FragmentActivity activity = this$0.getActivity();
if (activity != null) {
activity.onBackPressed();
}
}
public static final void onViewCreated$lambda$2(MfaTurnFragment this$0, View view) {
s.j(this$0, "this$0");
this$0.getTracker().b();
MfaTurnVM mfaTurnVM = this$0.viewModel;
if (mfaTurnVM == null) {
s.B("viewModel");
mfaTurnVM = null;
}
mfaTurnVM.turnOnMfa();
}
public static final void onViewCreated$lambda$3(MfaTurnFragment this$0, View view) {
s.j(this$0, "this$0");
this$0.getTracker().a();
this$0.startVerification();
}
private final void openCustomerSupportLink() {
openUrl("https://support.kufar.by/hc/ru/requests/new?utm_source=android&utm_medium=verification&utm_campaign=mfa_help");
}
private final void openUrl(String url) {
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, url, false, null, false, false, 60, null));
}
private final void setUpViewModel() {
MfaTurnVM mfaTurnVM = (MfaTurnVM) new ViewModelProvider(this, getViewModelFactory()).get(MfaTurnVM.class);
this.viewModel = mfaTurnVM;
if (mfaTurnVM == null) {
s.B("viewModel");
mfaTurnVM = null;
}
mfaTurnVM.getState().observe(getViewLifecycleOwner(), new b());
mfaTurnVM.getShowSuccessScreen().observe(getViewLifecycleOwner(), new c());
mfaTurnVM.getShowVerification().observe(getViewLifecycleOwner(), new d());
mfaTurnVM.getFinish().observe(getViewLifecycleOwner(), new e());
mfaTurnVM.getSnackError().observe(getViewLifecycleOwner(), new f());
mfaTurnVM.getSnackErrorSpan().observe(getViewLifecycleOwner(), new g());
mfaTurnVM.init();
}
public final void showMfaSuccessScreen(String phone) {
MfaTurnActivity mfaTurnActivity = mfaTurnActivity();
if (mfaTurnActivity != null) {
mfaTurnActivity.onMfaTurnSuccess(phone);
}
}
public final void showState(MfaTurnVM.a state) {
boolean z11;
boolean z12;
int i11 = -1;
if (state instanceof MfaTurnVM.a.C0260a) {
ViewAnimator animator = getAnimator();
int i12 = R$id.f11303f;
Iterator<View> it = ViewGroupKt.getChildren(animator).iterator();
int i13 = 0;
while (true) {
if (!it.hasNext()) {
break;
}
View next = it.next();
if (i13 < 0) {
t.x();
}
if (next.getId() == i12) {
z12 = true;
} else {
z12 = false;
}
if (z12) {
i11 = i13;
break;
}
i13++;
}
if (animator.getDisplayedChild() != i11) {
if (i11 >= 0) {
animator.setDisplayedChild(i11);
} else {
throw new IllegalArgumentException("View with ID " + i12 + " not found.");
}
}
getPhone().setText(((MfaTurnVM.a.C0260a) state).getAndroidx.autofill.HintConstants.AUTOFILL_HINT_PHONE java.lang.String());
return;
}
if (s.e(state, MfaTurnVM.a.b.f11527a)) {
ViewAnimator animator2 = getAnimator();
int i14 = R$id.f11308k;
Iterator<View> it2 = ViewGroupKt.getChildren(animator2).iterator();
int i15 = 0;
while (true) {
if (!it2.hasNext()) {
break;
}
View next2 = it2.next();
if (i15 < 0) {
t.x();
}
if (next2.getId() == i14) {
z11 = true;
} else {
z11 = false;
}
if (z11) {
i11 = i15;
break;
}
i15++;
}
if (animator2.getDisplayedChild() != i11) {
if (i11 >= 0) {
animator2.setDisplayedChild(i11);
return;
}
throw new IllegalArgumentException("View with ID " + i14 + " not found.");
}
}
}
public final void startVerification() {
Context context = getContext();
if (context == null) {
return;
}
startActivityForResult(getMediator().p().a(context, h0.b.f73641b), 1000);
}
public final cb.b getMediator() {
cb.b bVar = this.mediator;
if (bVar != null) {
return bVar;
}
s.B("mediator");
return null;
}
public final nd.a getTracker() {
nd.a aVar = this.tracker;
if (aVar != null) {
return aVar;
}
s.B("tracker");
return null;
}
public final ViewModelProvider.Factory getViewModelFactory() {
ViewModelProvider.Factory factory = this.viewModelFactory;
if (factory != null) {
return factory;
}
s.B("viewModelFactory");
return null;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1000) {
MfaTurnVM mfaTurnVM = null;
if (resultCode == -1) {
MfaTurnVM mfaTurnVM2 = this.viewModel;
if (mfaTurnVM2 == null) {
s.B("viewModel");
} else {
mfaTurnVM = mfaTurnVM2;
}
mfaTurnVM.onVerificationSuccess();
return;
}
MfaTurnVM mfaTurnVM3 = this.viewModel;
if (mfaTurnVM3 == null) {
s.B("viewModel");
} else {
mfaTurnVM = mfaTurnVM3;
}
mfaTurnVM.onVerificationCancelled();
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
s.j(inflater, "inflater");
return inflater.inflate(R$layout.f11313d, container, false);
}
@Override
public void onInject() {
super.onInject();
d.a a11 = qd.b.a();
Object obj = m5.a.d(this).get(qd.e.class);
if (obj != null) {
a11.a((qd.e) obj).b(this);
return;
}
throw new NullPointerException("null cannot be cast to non-null type by.kufar.mfa.di.MfaFeatureDependencies");
}
@Override
public void onStart() {
super.onStart();
getTracker().d();
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
setUpViewModel();
getHelp().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
MfaTurnFragment.onViewCreated$lambda$0(MfaTurnFragment.this, view2);
}
});
getClose().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
MfaTurnFragment.onViewCreated$lambda$1(MfaTurnFragment.this, view2);
}
});
getAcceptPhoneNumber().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
MfaTurnFragment.onViewCreated$lambda$2(MfaTurnFragment.this, view2);
}
});
getChangePhoneNumber().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
MfaTurnFragment.onViewCreated$lambda$3(MfaTurnFragment.this, view2);
}
});
}
public final void setMediator(cb.b bVar) {
s.j(bVar, "<set-?>");
this.mediator = bVar;
}
public final void setTracker(nd.a aVar) {
s.j(aVar, "<set-?>");
this.tracker = aVar;
}
public final void setViewModelFactory(ViewModelProvider.Factory factory) {
s.j(factory, "<set-?>");
this.viewModelFactory = factory;
}
}