Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 MfaDescriptionFragment.java 源代码,内容仅作参考
package by.kufar.mfa.ui.description;
import android.content.Context;
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 androidx.compose.runtime.internal.StabilityInferred;
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.description.MfaDescriptionVM;
import by.kufar.re.ui.widget.button.ProgressButton;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import com.google.android.material.snackbar.Snackbar;
import d80.f;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.m;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.s;
import kotlin.jvm.internal.u;
import kotlin.reflect.KProperty;
import qd.d;
@StabilityInferred(parameters = 0)
@Metadata(d1 = {"\u0000p\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\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\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\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\u0007\b\u0007\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b9\u0010:J\b\u0010\u0003\u001a\u00020\u0002H\u0002J\b\u0010\u0004\u001a\u00020\u0002H\u0002J\u0010\u0010\u0007\u001a\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u0005H\u0002J\n\u0010\t\u001a\u0004\u0018\u00010\bH\u0002J\u0010\u0010\f\u001a\u00020\u00022\u0006\u0010\u000b\u001a\u00020\nH\u0002J\b\u0010\r\u001a\u00020\u0002H\u0016J&\u0010\u0015\u001a\u0004\u0018\u00010\u00142\u0006\u0010\u000f\u001a\u00020\u000e2\b\u0010\u0011\u001a\u0004\u0018\u00010\u00102\b\u0010\u0013\u001a\u0004\u0018\u00010\u0012H\u0016J\u001a\u0010\u0017\u001a\u00020\u00022\u0006\u0010\u0016\u001a\u00020\u00142\b\u0010\u0013\u001a\u0004\u0018\u00010\u0012H\u0016R\"\u0010\u0019\u001a\u00020\u00188\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b\u0019\u0010\u001a\u001a\u0004\b\u001b\u0010\u001c\"\u0004\b\u001d\u0010\u001eR\"\u0010 \u001a\u00020\u001f8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b \u0010!\u001a\u0004\b\"\u0010#\"\u0004\b$\u0010%R\u0016\u0010'\u001a\u00020&8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b'\u0010(R\u001b\u0010.\u001a\u00020)8BX\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\u00107¨\u0006;"}, d2 = {"Lby/kufar/mfa/ui/description/MfaDescriptionFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "", "setUpActions", "setUpViewModel", "", "url", "openUrl", "Lby/kufar/mfa/ui/description/MfaDescriptionActivity;", "mfaDescriptionActivity", "Lby/kufar/mfa/ui/description/MfaDescriptionVM$a;", "state", "showState", "onInject", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "Lnd/a;", "tracker", "Lnd/a;", "getTracker", "()Lnd/a;", "setTracker", "(Lnd/a;)V", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelFactory", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelFactory", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Lby/kufar/mfa/ui/description/MfaDescriptionVM;", "viewModel", "Lby/kufar/mfa/ui/description/MfaDescriptionVM;", "Landroid/widget/TextView;", "howItWorks$delegate", "Li6/c;", "getHowItWorks", "()Landroid/widget/TextView;", "howItWorks", "Lby/kufar/re/ui/widget/button/ProgressButton;", "turn$delegate", "getTurn", "()Lby/kufar/re/ui/widget/button/ProgressButton;", "turn", "Landroid/widget/Button;", "notTurn$delegate", "getNotTurn", "()Landroid/widget/Button;", "notTurn", "<init>", "()V", "feature-mfa_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class MfaDescriptionFragment extends BaseFragment {
static final KProperty<Object>[] $$delegatedProperties = {o0.i(new g0(MfaDescriptionFragment.class, "howItWorks", "getHowItWorks()Landroid/widget/TextView;", 0)), o0.i(new g0(MfaDescriptionFragment.class, "turn", "getTurn()Lby/kufar/re/ui/widget/button/ProgressButton;", 0)), o0.i(new g0(MfaDescriptionFragment.class, "notTurn", "getNotTurn()Landroid/widget/Button;", 0))};
public static final int $stable = 8;
public nd.a tracker;
private MfaDescriptionVM viewModel;
public ViewModelProvider.Factory viewModelFactory;
private final i6.c howItWorks = bindView(R$id.f11305h);
private final i6.c turn = bindView(R$id.f11309l);
private final i6.c notTurn = bindView(R$id.f11306i);
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public static final class a implements Observer, m {
public final Function1 f11503b;
public a(Function1 function) {
s.j(function, "function");
this.f11503b = function;
}
public final boolean equals(Object obj) {
if (!(obj instanceof Observer) || !(obj instanceof m)) {
return false;
}
return s.e(getFunctionDelegate(), ((m) obj).getFunctionDelegate());
}
@Override
public final f<?> getFunctionDelegate() {
return this.f11503b;
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
@Override
public final void onChanged(Object obj) {
this.f11503b.invoke(obj);
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lby/kufar/mfa/ui/description/MfaDescriptionVM$a;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/mfa/ui/description/MfaDescriptionVM$a;)V"}, k = 3, mv = {1, 9, 0})
public static final class b extends u implements Function1<MfaDescriptionVM.a, Unit> {
public b() {
super(1);
}
public final void a(MfaDescriptionVM.a aVar) {
MfaDescriptionFragment mfaDescriptionFragment = MfaDescriptionFragment.this;
s.g(aVar);
mfaDescriptionFragment.showState(aVar);
}
@Override
public Unit invoke(MfaDescriptionVM.a aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "", "it", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class c extends u implements Function1<String, Unit> {
public c() {
super(1);
}
@Override
public Unit invoke(String str) {
invoke2(str);
return Unit.f82492a;
}
public final void invoke2(String it) {
s.j(it, "it");
MfaDescriptionFragment.this.openUrl(it);
}
}
private final TextView getHowItWorks() {
return (TextView) this.howItWorks.getValue(this, $$delegatedProperties[0]);
}
private final Button getNotTurn() {
return (Button) this.notTurn.getValue(this, $$delegatedProperties[2]);
}
private final ProgressButton getTurn() {
return (ProgressButton) this.turn.getValue(this, $$delegatedProperties[1]);
}
private final MfaDescriptionActivity mfaDescriptionActivity() {
FragmentActivity activity = getActivity();
if (activity instanceof MfaDescriptionActivity) {
return (MfaDescriptionActivity) activity;
}
return null;
}
public 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 setUpActions() {
getNotTurn().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MfaDescriptionFragment.setUpActions$lambda$0(MfaDescriptionFragment.this, view);
}
});
getTurn().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MfaDescriptionFragment.setUpActions$lambda$1(MfaDescriptionFragment.this, view);
}
});
getHowItWorks().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MfaDescriptionFragment.setUpActions$lambda$2(MfaDescriptionFragment.this, view);
}
});
}
public static final void setUpActions$lambda$0(MfaDescriptionFragment this$0, View view) {
s.j(this$0, "this$0");
FragmentActivity activity = this$0.getActivity();
if (activity != null) {
activity.finish();
}
}
public static final void setUpActions$lambda$1(MfaDescriptionFragment this$0, View view) {
s.j(this$0, "this$0");
this$0.getTracker().e();
MfaDescriptionVM mfaDescriptionVM = this$0.viewModel;
if (mfaDescriptionVM == null) {
s.B("viewModel");
mfaDescriptionVM = null;
}
mfaDescriptionVM.turnOnMfa();
}
public static final void setUpActions$lambda$2(MfaDescriptionFragment this$0, View view) {
s.j(this$0, "this$0");
Context context = this$0.getContext();
if (context == null) {
return;
}
this$0.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru/articles/360019237117-Двухэтапная-проверка-Что-это-Как-ее-включить-выключить-", false, null, false, false, 60, null));
}
private final void setUpViewModel() {
MfaDescriptionVM mfaDescriptionVM = (MfaDescriptionVM) new ViewModelProvider(this, getViewModelFactory()).get(MfaDescriptionVM.class);
this.viewModel = mfaDescriptionVM;
if (mfaDescriptionVM == null) {
s.B("viewModel");
mfaDescriptionVM = null;
}
mfaDescriptionVM.getState().observe(getViewLifecycleOwner(), new a(new b()));
}
public final void showState(MfaDescriptionVM.a state) {
if (state instanceof MfaDescriptionVM.a.C0259a) {
getTurn().e(false);
Snackbar t11 = ek.b.t(ek.b.f75340a, getView(), ((MfaDescriptionVM.a.C0259a) state).getError(), 0, null, 0, null, 56, null);
if (t11 != null) {
t11.W();
}
} else if (s.e(state, MfaDescriptionVM.a.b.f11507a)) {
getTurn().e(true);
} else {
if (state instanceof MfaDescriptionVM.a.c) {
getTurn().e(false);
Snackbar s11 = ek.b.s(ek.b.f75340a, getView(), o5.d.c(o5.d.f87043a, ((MfaDescriptionVM.a.c) state).getError().getLabel(), false, null, new c(), 6, null), 0, null, 0, null, 56, null);
if (s11 != null) {
s11.W();
return;
}
return;
}
if (state instanceof MfaDescriptionVM.a.d) {
getTurn().e(false);
MfaDescriptionActivity mfaDescriptionActivity = mfaDescriptionActivity();
if (mfaDescriptionActivity != null) {
mfaDescriptionActivity.onMfaSuccessTurnOn(((MfaDescriptionVM.a.d) state).getAndroidx.autofill.HintConstants.AUTOFILL_HINT_PHONE java.lang.String());
}
}
}
}
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 View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
s.j(inflater, "inflater");
return inflater.inflate(R$layout.f11311b, 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).a(this);
return;
}
throw new NullPointerException("null cannot be cast to non-null type by.kufar.mfa.di.MfaFeatureDependencies");
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
setUpViewModel();
setUpActions();
}
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;
}
}