导航菜单

页面标题

页面副标题

OVO v3.139.0 - ForgotPinOtpFormActivity.java 源代码

正在查看: OVO v3.139.0 应用的 ForgotPinOtpFormActivity.java JAVA 源代码文件

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


package ovo.id.onboarding.unlock.presentation.forgotpin;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import androidx.activity.result.ActivityResult;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;
import androidx.appcompat.widget.AppCompatEditText;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import kotlin.Metadata;
import o.i.Function110;
import o.i.aac;
import o.i.ah5;
import o.i.akb;
import o.i.b0;
import o.i.bc;
import o.i.bh5;
import o.i.ch0;
import o.i.ch5;
import o.i.cuj;
import o.i.cw9;
import o.i.dh5;
import o.i.dw5;
import o.i.eh5;
import o.i.fh5;
import o.i.fqe;
import o.i.fv2;
import o.i.fxa;
import o.i.gx;
import o.i.gy0;
import o.i.if0;
import o.i.im8;
import o.i.jh5;
import o.i.lc;
import o.i.lc2;
import o.i.me3;
import o.i.n2f;
import o.i.ou2;
import o.i.ov5;
import o.i.oye;
import o.i.p1g;
import o.i.pa;
import o.i.pvm;
import o.i.pw5;
import o.i.q99;
import o.i.qn2;
import o.i.t9c;
import o.i.ua8;
import o.i.v11;
import o.i.vk7;
import o.i.vuc;
import o.i.vx0;
import o.i.w6c;
import o.i.wb;
import o.i.wta;
import o.i.xge;
import o.i.y0c;
import o.i.yg5;
import o.i.z8;
import o.i.zg5;
import o.i.zu5;
import ovo.id.base.BaseActivity;
import ovo.id.base.utils.ErrorWrapper;
import ovo.id.base.utils.StringWrapper;
import ovo.id.onboarding.unlock.data.entity.response.ForgotSecurityCodeOtpResponse;
import ovo.id.onboarding.unlock.data.entity.response.ForgotSecurityCodeResponse;

@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lovo/id/onboarding/unlock/presentation/forgotpin/ForgotPinOtpFormActivity;", "Lovo/id/base/BaseActivity;", "<init>", "()V", "unlock-ui_release"}, k = 1, mv = {1, 8, 0})
public final class ForgotPinOtpFormActivity extends BaseActivity {
    public static final int L = 0;
    public akb G;
    public ViewModelProvider.Factory H;
    public if0 J;
    public final oye I = im8.b(new a());
    public final lc K = s0(new bc(), new i());

    public static final class a extends ua8 implements zu5<pa> {
        public a() {
            super(0);
        }

        public final Object invoke() {
            ViewDataBinding c = fv2.c(ForgotPinOtpFormActivity.this, w6c.activity_otp_entry);
            vk7.d(c, "null cannot be cast to non-null type ovo.id.onboarding.unlock.ui.databinding.ActivityOtpEntryBinding");
            return (pa) c;
        }
    }

    public class b extends pw5 implements Function110<fxa<? extends Integer, ? extends Long>, p1g> {
        public b(Object obj) {
            super(1, obj, ForgotPinOtpFormActivity.class, "showTimerCountDown", "showTimerCountDown(Lkotlin/Pair;)V", 0);
        }

        public final Object invoke(Object obj) {
            String str;
            fxa fxaVar = (fxa) obj;
            vk7.f(fxaVar, "p0");
            AppCompatActivity appCompatActivity = (ForgotPinOtpFormActivity) ((v11) this).receiver;
            int i = ForgotPinOtpFormActivity.L;
            appCompatActivity.getClass();
            Number number = (Number) fxaVar.a;
            if (number.intValue() != 0) {
                long longValue = ((Number) fxaVar.b).longValue();
                if (longValue > 1) {
                    str = "(" + (longValue / 1000) + ")";
                } else {
                    str = "";
                }
                boolean z = true;
                String string = appCompatActivity.getResources().getString(number.intValue(), str);
                xge c = gy0.c(string, "resources.getString(data.first, countdownText)");
                c.a = new SpannableString(string);
                Integer valueOf = Integer.valueOf(y0c.turquoise_alpha_50);
                valueOf.intValue();
                if (!(!fqe.A(str)) && longValue != -1) {
                    z = false;
                }
                if (!z) {
                    valueOf = null;
                }
                c.e(lc2.b(appCompatActivity, valueOf != null ? valueOf.intValue() : y0c.turquoise), string, false);
                c.e(lc2.b(appCompatActivity, y0c.dusk), str, false);
                appCompatActivity.M0().f1043u.setText(c.a());
            }
            return p1g.a;
        }
    }

    public static final class c extends ua8 implements Function110<ErrorWrapper, p1g> {
        public c() {
            super(1);
        }

        public final Object invoke(Object obj) {
            ErrorWrapper errorWrapper = (ErrorWrapper) obj;
            vk7.f(errorWrapper, "errorWrapper");
            int i = ForgotPinOtpFormActivity.L;
            ?? r0 = ForgotPinOtpFormActivity.this;
            ConstraintLayout constraintLayout = r0.M0().x;
            vk7.e(constraintLayout, "binding.rootLayout");
            gx.f(constraintLayout, errorWrapper.a((Context) r0));
            return p1g.a;
        }
    }

    public static final class d extends ua8 implements Function110<p1g, p1g> {
        public d() {
            super(1);
        }

        public final Object invoke(Object obj) {
            BaseActivity baseActivity = ForgotPinOtpFormActivity.this;
            if (baseActivity != null) {
                Object systemService = baseActivity.getSystemService("input_method");
                vk7.d(systemService, "null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
                ((InputMethodManager) systemService).toggleSoftInput(2, 1);
            }
            return p1g.a;
        }
    }

    public static final class e extends ua8 implements Function110<p1g, p1g> {
        public e() {
            super(1);
        }

        public final Object invoke(Object obj) {
            int i = ForgotPinOtpFormActivity.L;
            AppCompatEditText appCompatEditText = ForgotPinOtpFormActivity.this.M0().f1045w;
            appCompatEditText.setText(null);
            appCompatEditText.requestFocus();
            return p1g.a;
        }
    }

    public class f extends pw5 implements Function110<Integer, p1g> {
        public f(Object obj) {
            super(1, obj, ForgotPinOtpFormActivity.class, "updatePinLength", "updatePinLength(I)V", 0);
        }

        public final Object invoke(Object obj) {
            int intValue = ((Number) obj).intValue();
            ForgotPinOtpFormActivity forgotPinOtpFormActivity = (ForgotPinOtpFormActivity) ((v11) this).receiver;
            int i = ForgotPinOtpFormActivity.L;
            forgotPinOtpFormActivity.M0().f1045w.setMaxLength(intValue);
            return p1g.a;
        }
    }

    public class g extends pw5 implements Function110<fxa<? extends StringWrapper, ? extends String>, p1g> {
        public g(Object obj) {
            super(1, obj, ForgotPinOtpFormActivity.class, "setSubtitleMessage", "setSubtitleMessage(Lkotlin/Pair;)V", 0);
        }

        public final Object invoke(Object obj) {
            fxa fxaVar = (fxa) obj;
            vk7.f(fxaVar, "p0");
            ?? r0 = (ForgotPinOtpFormActivity) ((v11) this).receiver;
            int i = ForgotPinOtpFormActivity.L;
            AppCompatTextView appCompatTextView = r0.M0().A;
            String a = ((StringWrapper) fxaVar.a).a((Context) r0);
            if (a == null) {
                a = "";
            }
            xge xgeVar = new xge();
            xgeVar.a = new SpannableString(a);
            xgeVar.b((String) fxaVar.b, false);
            appCompatTextView.setText(xgeVar.a());
            return p1g.a;
        }
    }

    public class h extends pw5 implements Function110<ErrorWrapper, p1g> {
        public h(Object obj) {
            super(1, obj, ForgotPinOtpFormActivity.class, "showErrorRetryDialog", "showErrorRetryDialog(Lovo/id/base/utils/ErrorWrapper;)V", 0);
        }

        public final Object invoke(Object obj) {
            ErrorWrapper errorWrapper = (ErrorWrapper) obj;
            vk7.f(errorWrapper, "p0");
            BaseActivity baseActivity = (ForgotPinOtpFormActivity) ((v11) this).receiver;
            int i = ForgotPinOtpFormActivity.L;
            baseActivity.getClass();
            q99 q99Var = new q99(baseActivity);
            wta B = wta.B(LayoutInflater.from(baseActivity));
            vk7.e(B, "inflate(\n               …rmActivity)\n            )");
            q99Var.c(((ViewDataBinding) B).e);
            B.z.setText(baseActivity.getResources().getString(aac.ovo_title_attention));
            B.x.setText(errorWrapper.a(baseActivity));
            B.f1520u.setVisibility(8);
            AppCompatButton appCompatButton = B.f1521v;
            appCompatButton.setVisibility(0);
            appCompatButton.setText(appCompatButton.getResources().getString(aac.ovo_action_oke));
            appCompatButton.setOnClickListener(new n2f(1, q99Var));
            q99Var.show();
            return p1g.a;
        }
    }

    public static final class i implements wb<ActivityResult> {
        public i() {
        }

        public final void a(Object obj) {
            ActivityResult activityResult = (ActivityResult) obj;
            vk7.f(activityResult, "result");
            if (activityResult.a == -1) {
                ?? r4 = ForgotPinOtpFormActivity.this;
                if (r4 != 0) {
                    Object systemService = r4.getSystemService("input_method");
                    vk7.d(systemService, "null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
                    ((InputMethodManager) systemService).toggleSoftInput(2, 1);
                }
                if0 if0Var = r4.J;
                if (if0Var != null) {
                    if0Var.p.setValue(Boolean.TRUE);
                } else {
                    vk7.m("vm");
                    throw null;
                }
            }
        }
    }

    public static final class j implements Observer, dw5 {
        public final Function110 a;

        public j(Function110 function110) {
            this.a = function110;
        }

        public final boolean equals(Object obj) {
            if (!(obj instanceof Observer) || !(obj instanceof dw5)) {
                return false;
            }
            return vk7.a(this.a, ((dw5) obj).getFunctionDelegate());
        }

        public final ov5<?> getFunctionDelegate() {
            return this.a;
        }

        public final int hashCode() {
            return this.a.hashCode();
        }

        public final void onChanged(Object obj) {
            this.a.invoke(obj);
        }
    }

    public final void G0() {
        ou2 ou2Var = cw9.a;
        if (ou2Var == null) {
            vk7.m("unlockComponent");
            throw null;
        }
        qn2 qn2Var = new qn2(new b0(), ou2Var);
        akb H = qn2Var.a.H();
        pvm.p(H);
        this.G = H;
        this.H = qn2Var.a();
    }

    public final pa M0() {
        return (pa) this.I.getValue();
    }

    public final void onCreate(Bundle bundle) {
        if0 if0Var;
        Boolean isNeedDob;
        ForgotSecurityCodeOtpResponse otp;
        super.onCreate(bundle);
        Intent intent = getIntent();
        boolean z = false;
        if ((intent != null ? intent.getIntExtra("flow", 0) : 0) == 11) {
            jh5 jh5Var = (jh5) new ViewModelLazy(vuc.a(jh5.class), new yg5(this), new eh5(this), new zg5(this)).getValue();
            vx0.t(this, new fxa(jh5Var.X, new ch5(this)));
            vx0.t(this, new fxa(jh5Var.Z, new dh5(this)));
            Intent intent2 = getIntent();
            if0Var = jh5Var;
            if (intent2 != null) {
                akb akbVar = this.G;
                if (akbVar == null) {
                    vk7.m("preferenceManager");
                    throw null;
                }
                String e2 = akbVar.b(vuc.a(me3.class)).e();
                if (e2 == null) {
                    e2 = "";
                }
                String str = Build.MANUFACTURER;
                String str2 = Build.MODEL;
                vk7.e(str2, "model");
                vk7.e(str, "manufacturer");
                if (!fqe.H(str2, str, false)) {
                    str2 = cuj.a(str, " ", str2);
                }
                String v2 = fqe.v(str2);
                String g2 = me3.g();
                ForgotSecurityCodeResponse forgotSecurityCodeResponse = (ForgotSecurityCodeResponse) intent2.getParcelableExtra("forgetSecurityCode");
                String stringExtra = intent2.getStringExtra("action");
                if (stringExtra == null) {
                    stringExtra = "";
                }
                String stringExtra2 = intent2.getStringExtra("location");
                if (stringExtra2 == null) {
                    stringExtra2 = "";
                }
                String stringExtra3 = intent2.getStringExtra("updateAccessToken");
                boolean booleanExtra = intent2.getBooleanExtra("isVerifiedEmail", false);
                String stringExtra4 = intent2.getStringExtra("dateOfBirth");
                vk7.f(g2, "pushNotificationId");
                jh5Var.M = stringExtra;
                String otpRefId = (forgotSecurityCodeResponse == null || (otp = forgotSecurityCodeResponse.getOtp()) == null) ? null : otp.getOtpRefId();
                if (otpRefId == null) {
                    otpRefId = "";
                }
                jh5Var.N = otpRefId;
                jh5Var.O = e2;
                jh5Var.P = v2;
                jh5Var.Q = stringExtra2;
                jh5Var.R = g2;
                jh5Var.S = stringExtra3;
                jh5Var.T = booleanExtra;
                if (!booleanExtra && forgotSecurityCodeResponse != null && (isNeedDob = forgotSecurityCodeResponse.isNeedDob()) != null) {
                    z = isNeedDob.booleanValue();
                }
                jh5Var.U = z;
                jh5Var.V = stringExtra4;
                String msisdn = forgotSecurityCodeResponse != null ? forgotSecurityCodeResponse.getMsisdn() : null;
                String str3 = msisdn != null ? msisdn : "";
                jh5Var.s.setValue(new fxa(StringWrapper.a.b(t9c.msg_sent_code_format, str3), str3));
                MutableLiveData<StringWrapper> mutableLiveData = jh5Var.q;
                MutableLiveData<Integer> mutableLiveData2 = jh5Var.F;
                if (booleanExtra) {
                    mutableLiveData2.setValue(4);
                    mutableLiveData.setValue(StringWrapper.a.a(t9c.title_enter_email_code));
                } else {
                    mutableLiveData2.setValue(6);
                    mutableLiveData.setValue(StringWrapper.a.a(t9c.msg_enter_temporary_sec_code));
                    jh5Var.x.setValue(Integer.valueOf(t9c.code_not_received_with_countdown));
                    if (jh5Var.U) {
                        jh5Var.p.setValue(Boolean.FALSE);
                        jh5Var.W.setValue(StringWrapper.a.a(t9c.msg_check_phone));
                    }
                }
                jh5Var.x();
                if0Var = jh5Var;
            }
        } else {
            if0Var = (if0) new ViewModelLazy(vuc.a(if0.class), new ah5(this), new fh5(this), new bh5(this)).getValue();
        }
        vx0.t(this, new fxa(if0Var.A, new b(this)));
        vx0.t(this, new fxa(((ch0) if0Var).j, new c()));
        if0Var.E.observe(this, new j(new d()));
        if0Var.D.observe(this, new j(new e()));
        vx0.t(this, new fxa(if0Var.G, new f(this)));
        vx0.t(this, new fxa(if0Var.f548t, new g(this)));
        vx0.t(this, new fxa(((ch0) if0Var).k, new h(this)));
        this.J = if0Var;
        pa M0 = M0();
        M0.w(this);
        if0 if0Var2 = this.J;
        if (if0Var2 == null) {
            vk7.m("vm");
            throw null;
        }
        M0.B(if0Var2);
        Toolbar toolbar = M0.y.u;
        vk7.e(toolbar, "toolbar.toolbar");
        z8.g(this, toolbar, (r14 & 2) != 0, (r14 & 4) != 0, (r14 & 8) != 0 ? null : Integer.valueOf(t9c.title_forgot_security_code_bar), (r14 & 16) != 0 ? null : null);
        ?? r14 = M0.f1045w;
        r14.setAnimate(true);
        if0 if0Var3 = this.J;
        if (if0Var3 == null) {
            vk7.m("vm");
            throw null;
        }
        r14.setOnPinEnteredListener(if0Var3);
        r14.requestFocus();
    }

    public final boolean onOptionsItemSelected(MenuItem menuItem) {
        vk7.f(menuItem, "item");
        if (menuItem.getItemId() == 16908332) {
            onBackPressed();
        }
        return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
    }

    public final void onPause() {
        super.onPause();
        Object systemService = getSystemService("input_method");
        vk7.d(systemService, "null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
        InputMethodManager inputMethodManager = (InputMethodManager) systemService;
        View currentFocus = getCurrentFocus();
        if (currentFocus == null) {
            currentFocus = new View(this);
        }
        inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
    }

    public final void onResume() {
        super.onResume();
        if0 if0Var = this.J;
        if (if0Var == null) {
            vk7.m("vm");
            throw null;
        }
        if (vk7.a((Boolean) if0Var.p.getValue(), Boolean.TRUE)) {
            Object systemService = getSystemService("input_method");
            vk7.d(systemService, "null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
            ((InputMethodManager) systemService).toggleSoftInput(2, 1);
        }
    }
}