导航菜单

页面标题

页面副标题

Easycash v3.75.13 - SecureCheckOtpActivity.java 源代码

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

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


package com.fintopia.lender.module.security;

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.fintopia.lender.R;
import com.fintopia.lender.module.baseui.LenderCommonActivity;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.security.SecureCheckOtpGetter;
import com.fintopia.lender.widget.LenderDoubleContentSingleButtonDialog;
import com.fintopia.lender.widget.VerificationCodeEditText;
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.VerificationType;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.lingyue.supertoolkit.widgets.countdown.CustomCountDownTimer;
import com.veda.android.bananalibrary.infrastructure.BaseActivity;
import io.reactivex.disposables.Disposable;
import java.text.MessageFormat;

public class SecureCheckOtpActivity extends LenderCommonActivity implements TextWatcher {

    @BindView(4696)
    Button btnGetVerificationCode;

    @BindView(4693)
    Button button;

    @BindView(4903)
    VerificationCodeEditText etVerificationCode;

    @BindView(5138)
    LinearLayout llIVR;

    @BindView(5686)
    TextView tvIvrCountDown;

    @BindView(5912)
    TextView tvTryVerification;

    private String f158u;

    private int f159v;

    private SecureCheckOtpGetter f160w;

    private CustomCountDownTimer f161x;
    int y;

    private void O() {
        String u2 = EcFormatUtil.u(this.f158u);
        LenderDoubleContentSingleButtonDialog.d(this).l("dialog_lender_ivr_verification_secure_check_purpose_" + this.f159v).k(getString(R.string.lender_ivr_verification_dlg_title)).h(MessageFormat.format(getString(R.string.lender_ivr_verification_dlg_content), u2)).j(getString(R.string.lender_ivr_verification_dlg_sub_content)).g(R.string.lender_ivr_dlg_call).i(new LenderDoubleContentSingleButtonDialog.OnDoubleContentDialogButtonClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                SecureCheckOtpActivity.this.Q(dialogInterface, i);
            }
        }).show();
    }

    private void P() {
        SecureCheckOtpGetter secureCheckOtpGetter = new SecureCheckOtpGetter(this, this.f158u, this.f159v, new SecureCheckOtpGetter.Callback() {
            @Override
            public void a(VerificationType verificationType) {
                SecureCheckOtpActivity.this.dealGetOtpSuccess(verificationType);
            }

            @Override
            public void b() {
                SecureCheckOtpActivity.this.U();
                SecureCheckOtpActivity.this.llIVR.setClickable(true);
                SecureCheckOtpActivity.this.tvIvrCountDown.setVisibility(8);
                SecureCheckOtpActivity secureCheckOtpActivity = SecureCheckOtpActivity.this;
                secureCheckOtpActivity.tvTryVerification.setTextColor(secureCheckOtpActivity.getResources().getColor(R.color.c_base_blue));
            }
        });
        this.f160w = secureCheckOtpGetter;
        secureCheckOtpGetter.f(this.btnGetVerificationCode);
    }

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

    public void R(CashListResponse cashListResponse) {
        SecureUtil.d(this, this.f158u, this.f159v, cashListResponse.body);
        finish();
    }

    private void S() {
        int i = AppGeneralConfigUtils.o().q().displayTipsRetryNumber;
        this.y = i;
        renderIVRVerificationView(i <= 0);
    }

    private void T() {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).C(this.f158u, this.f159v, this.etVerificationCode.getVerificationCode()).a(new IdnObserver<CashListResponse>(this) {
            public void onSuccess(CashListResponse cashListResponse) {
                SecureCheckOtpActivity.this.dismissLoadingDialog();
                SecureCheckOtpActivity.this.R(cashListResponse);
            }
        });
    }

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

    public void dealGetOtpSuccess(VerificationType verificationType) {
        showSoftInput(this.etVerificationCode);
        this.llIVR.setClickable(false);
        this.tvTryVerification.setTextColor(getResources().getColor(R.color.c_base_light_black));
        if (verificationType == VerificationType.SMS) {
            this.tvIvrCountDown.setVisibility(8);
            return;
        }
        this.btnGetVerificationCode.setEnabled(false);
        this.btnGetVerificationCode.setBackgroundResource(R.drawable.base_shape_mid_gray_r_8);
        this.tvIvrCountDown.setVisibility(0);
        CustomCountDownTimer customCountDownTimer = new CustomCountDownTimer(60000L, 1000L) {
            public void e() {
                SecureCheckOtpActivity.this.btnGetVerificationCode.setEnabled(true);
                SecureCheckOtpActivity.this.btnGetVerificationCode.setBackgroundResource(R.drawable.lender_shape_blue_r_8);
                SecureCheckOtpActivity.this.tvIvrCountDown.setVisibility(8);
                SecureCheckOtpActivity secureCheckOtpActivity = SecureCheckOtpActivity.this;
                secureCheckOtpActivity.tvTryVerification.setTextColor(secureCheckOtpActivity.getResources().getColor(R.color.c_base_blue));
                SecureCheckOtpActivity.this.llIVR.setClickable(true);
            }

            public void f(long j) {
                ?? r0 = SecureCheckOtpActivity.this;
                r0.tvIvrCountDown.setText(String.format(r0.getString(R.string.ec_count_down_second), Long.valueOf(j / 1000)));
            }
        };
        this.f161x = 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 A() {
        super.A();
        this.etVerificationCode.removeTextChangedListener(this);
        this.etVerificationCode.addTextChangedListener(this);
        P();
        S();
    }

    @Override
    protected void G(@NonNull Bundle bundle) {
        bundle.putString("mobile_num", this.f158u);
        bundle.putInt("purpose", this.f159v);
        super.G(bundle);
    }

    @Override
    public void afterTextChanged(Editable editable) {
        this.button.setEnabled(FieldRuleUtils.h(this.etVerificationCode.getVerificationCode()));
    }

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

    @OnClick({5138})
    public void onClickIVR() {
        if (BaseUtils.l()) {
            return;
        }
        O();
    }

    @OnClick({4693})
    public void onConfirmClicked() {
        if (BaseUtils.l() || ((BaseActivity) this).isDialogShowing) {
            return;
        }
        T();
    }

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

    public void renderIVRVerificationView(boolean z) {
        if (z) {
            this.llIVR.setVisibility(0);
        } else {
            this.llIVR.setVisibility(8);
        }
    }

    @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
    protected void y(@NonNull Bundle bundle) {
        super.y(bundle);
        this.f158u = bundle.getString("mobile_num");
        this.f159v = bundle.getInt("purpose");
    }

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

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