导航菜单

页面标题

页面副标题

Easycash v3.75.13 - SecureCheckOtpActivity.java 源代码

正在查看: Easycash v3.75.13 应用的 SecureCheckOtpActivity.java JAVA 源代码文件

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


package com.lingyue.easycash.activity.secure;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.OnClick;
import com.lingyue.easycash.R;
import com.lingyue.easycash.SecureUtil;
import com.lingyue.easycash.activity.secure.SecureCheckOtpGetter;
import com.lingyue.easycash.commom.EasyCashCommonActivity;
import com.lingyue.easycash.utils.EasycashUmengEvent;
import com.lingyue.easycash.widght.EasycashDoubleContentSingleButtonDialog;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.framework.lifecycle.m;
import com.lingyue.idnbaselib.model.CashListResponse;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.utils.EcFormatUtil;
import com.lingyue.idnbaselib.utils.FieldRuleUtils;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.idnbaselib.utils.VerificationType;
import com.lingyue.idnbaselib.widget.pincodeInput.CodeInputView;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.lingyue.supertoolkit.widgets.countdown.CustomCountDownTimer;
import io.reactivex.disposables.Disposable;
import java.text.MessageFormat;

public class SecureCheckOtpActivity extends EasyCashCommonActivity implements TextWatcher {
    private String B;
    private int C;
    private SecureCheckOtpGetter D;
    private CustomCountDownTimer E;
    int F;

    @BindView(R.id.btn_get_verification_code)
    Button btnGetVerificationCode;

    @BindView(2131361988)
    Button button;

    @BindView(R.id.civ_verification_code)
    CodeInputView civVerificationCode;

    @BindView(R.id.ll_ivr)
    LinearLayout llIVR;

    @BindView(R.id.tv_ivr_count_down)
    TextView tvIvrCountDown;

    @BindView(R.id.tv_try_ivr_verification)
    TextView tvTryVerification;

    private void U() {
        String u = EcFormatUtil.u(this.B);
        EasycashDoubleContentSingleButtonDialog.e(this).m("dialog_ivr_verification_secure_check_purpose_" + this.C).l(getString(R.string.easycash_ivr_verification_dlg_title)).i(MessageFormat.format(getString(R.string.easycash_ivr_verification_dlg_content), u)).k(getString(R.string.easycash_ivr_verification_dlg_sub_content)).h(R.string.easycash_ivr_dlg_call).j(new EasycashDoubleContentSingleButtonDialog.OnDoubleContentDialogButtonClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                SecureCheckOtpActivity.this.W(dialogInterface, i);
            }
        }).show();
    }

    private void V() {
        SecureCheckOtpGetter secureCheckOtpGetter = new SecureCheckOtpGetter(this, this.B, this.C, new SecureCheckOtpGetter.Callback() {
            @Override
            public void a(VerificationType verificationType) {
                SecureCheckOtpActivity.this.dealGetOtpSuccess(verificationType);
            }

            @Override
            public void b() {
                SecureCheckOtpActivity.this.a0();
                SecureCheckOtpActivity.this.llIVR.setClickable(true);
                SecureCheckOtpActivity.this.tvIvrCountDown.setVisibility(8);
                SecureCheckOtpActivity secureCheckOtpActivity = SecureCheckOtpActivity.this;
                secureCheckOtpActivity.tvTryVerification.setTextColor(secureCheckOtpActivity.getResources().getColor(2131099780));
            }
        });
        this.D = secureCheckOtpGetter;
        secureCheckOtpGetter.f(this.btnGetVerificationCode);
    }

    public void W(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        this.D.o(null, null, VerificationType.IVR);
    }

    public void X(CashListResponse cashListResponse) {
        SecureUtil.d(this, this.B, this.C, cashListResponse.body);
        finish();
    }

    private void Y() {
        int i = this.userSession.f().verificationConfig.displayTipsRetryNumber;
        this.F = i;
        renderIVRVerificationView(i <= 0);
    }

    private void Z() {
        showLoadingDialog();
        this.apiHelper.a().C(this.B, this.C, this.civVerificationCode.getText().toString()).a(new IdnObserver<CashListResponse>(this) {
            @Override
            public void onSuccess(CashListResponse cashListResponse) {
                SecureCheckOtpActivity.this.dismissLoadingDialog();
                SecureCheckOtpActivity.this.X(cashListResponse);
            }
        });
    }

    public void a0() {
        int i = this.F - 1;
        this.F = i;
        if (i == 0) {
            renderIVRVerificationView(true);
        }
    }

    public void dealGetOtpSuccess(VerificationType verificationType) {
        showSoftInput(this.civVerificationCode);
        this.llIVR.setClickable(false);
        this.tvTryVerification.setTextColor(getResources().getColor(2131099787));
        if (verificationType == VerificationType.SMS) {
            this.tvIvrCountDown.setVisibility(8);
            return;
        }
        this.btnGetVerificationCode.setEnabled(false);
        this.btnGetVerificationCode.setBackgroundResource(2131230964);
        this.tvIvrCountDown.setVisibility(0);
        CustomCountDownTimer customCountDownTimer = new CustomCountDownTimer(60000L, 1000L) {
            @Override
            public void e() {
                SecureCheckOtpActivity.this.btnGetVerificationCode.setEnabled(true);
                SecureCheckOtpActivity.this.btnGetVerificationCode.setBackgroundResource(R.drawable.easycash_shape_c_green_r_8);
                SecureCheckOtpActivity.this.tvIvrCountDown.setVisibility(8);
                SecureCheckOtpActivity secureCheckOtpActivity = SecureCheckOtpActivity.this;
                secureCheckOtpActivity.tvTryVerification.setTextColor(secureCheckOtpActivity.getResources().getColor(2131099780));
                SecureCheckOtpActivity.this.llIVR.setClickable(true);
            }

            @Override
            public void f(long j) {
                ?? r0 = SecureCheckOtpActivity.this;
                r0.tvIvrCountDown.setText(String.format(r0.getString(2131886774), Long.valueOf(j / 1000)));
            }
        };
        this.E = customCountDownTimer;
        customCountDownTimer.g();
    }

    public static void startSecureOtpActivity(Activity activity, String str, int i) {
        Intent intent = new Intent(activity, (Class<?>) SecureCheckOtpActivity.class);
        intent.putExtra("mobile_num", str);
        intent.putExtra("purpose", i);
        activity.startActivity(intent);
    }

    @Override
    protected void B(@NonNull Bundle bundle) {
        super.B(bundle);
        this.B = bundle.getString("mobile_num");
        this.C = bundle.getInt("purpose");
    }

    @Override
    protected void D() {
        super.D();
        this.civVerificationCode.removeTextChangedListener(this);
        this.civVerificationCode.addTextChangedListener(this);
        V();
        Y();
    }

    @Override
    protected void N(@NonNull Bundle bundle) {
        bundle.putString("mobile_num", this.B);
        bundle.putInt("purpose", this.C);
        super.N(bundle);
    }

    @Override
    public void afterTextChanged(Editable editable) {
        this.button.setEnabled(FieldRuleUtils.h(this.civVerificationCode.getText().toString()));
    }

    @Override
    public int getLayoutID() {
        return R.layout.easycash_activity_secure_otp;
    }

    @OnClick({R.id.ll_ivr})
    public void onClickIVR() {
        if (BaseUtils.l()) {
            return;
        }
        U();
    }

    @OnClick({2131361988})
    public void onConfirmClicked() {
        if (BaseUtils.l() || this.isDialogShowing) {
            return;
        }
        Z();
    }

    @Override
    protected void onDestroy() {
        this.D.j();
        CustomCountDownTimer customCountDownTimer = this.E;
        if (customCountDownTimer != null) {
            customCountDownTimer.i();
        }
        super.onDestroy();
    }

    public void renderIVRVerificationView(boolean z2) {
        if (!z2) {
            this.llIVR.setVisibility(8);
        } else {
            this.llIVR.setVisibility(0);
            ThirdPartEventUtils.y(this, EasycashUmengEvent.d1);
        }
    }

    @Override
    public Disposable runOnActiveEvent(Runnable runnable) {
        return m.a(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnCreated(@NonNull Runnable runnable) {
        return m.b(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnDestroy(@NonNull Runnable runnable) {
        return m.c(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
        return m.d(this, lifecycleEvent, runnable);
    }

    @Override
    public Disposable runOnEvents(@NonNull LifecycleEvent[] lifecycleEventArr, @Nullable Runnable runnable) {
        return m.e(this, lifecycleEventArr, runnable);
    }

    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }
}