导航菜单

页面标题

页面副标题

Easycash v3.75.13 - LenderRechargeActivity.java 源代码

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

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


package com.fintopia.lender.module.lend;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.OnClick;
import com.fintopia.lender.R;
import com.fintopia.lender.module.account.SetPasswordActivity;
import com.fintopia.lender.module.baseui.LenderCommonActivity;
import com.fintopia.lender.module.events.EventTopUpSuccess;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.lend.adapter.BankChannelAdapter;
import com.fintopia.lender.module.lend.model.FinVirtualAccountResponse;
import com.fintopia.lender.module.lend.model.OrderInitInfo;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.sign.ElectronicContractActivity;
import com.fintopia.lender.module.sign.LenderQuickRegisterPrivyIdActivity;
import com.fintopia.lender.module.sign.LenderSignWebActivity;
import com.fintopia.lender.module.sign.models.BizCheckResultResponseV3;
import com.fintopia.lender.module.webpage.LenderWebViewActivity;
import com.fintopia.lender.widget.LenderConfirmDialog;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.BannersBean;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.sign.BizCheckResultInfoV3;
import com.lingyue.idnbaselib.model.sign.CheckType;
import com.lingyue.idnbaselib.utils.EcUriUtil;
import com.lingyue.idnbaselib.utils.SharedPreferenceWithPhoneUtils;
import com.lingyue.idnbaselib.widget.OnItemClickListener;
import com.lingyue.idnbaselib.widget.banner.BannerView;
import com.lingyue.supertoolkit.customtools.CollectionUtils;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.yangqianguan.statistics.AutoTrackHelper;
import io.reactivex.disposables.Disposable;
import java.util.List;
import org.greenrobot.eventbus.EventBus;

public class LenderRechargeActivity extends LenderCommonActivity {
    public static final String PARAMS_AMOUNT = "amount";
    public static final String PARAMS_FROM_TOP_UP = "fromTopUp";

    @BindView(4692)
    public Button btnCompletedTopUp;

    @BindView(4721)
    public BannerView bvBanner;

    @BindView(5316)
    public RecyclerView rclBankList;

    private String f74u;

    private boolean f75v;

    private OrderInitInfo f76w;

    private BankChannelAdapter f77x;

    static class AnonymousClass3 {
        static final int[] a;

        static {
            int[] iArr = new int[CheckType.values().length];
            a = iArr;
            try {
                iArr[CheckType.PRIVY_SIGNATURE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[CheckType.OJK_FIN_DEMO_SIGNATURE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[CheckType.HAND_WRITTEN_SIGNATURE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
        }
    }

    private void P(BizCheckResultInfoV3 bizCheckResultInfoV3) {
        LenderSignWebActivity.startLenderSignWebActivity(this, EcUriUtil.b(Uri.parse(bizCheckResultInfoV3.handWrittenInfo.templateUrl), bizCheckResultInfoV3.handWrittenInfo.minStrokeCount, bizCheckResultInfoV3.businessId).toString(), -1L, bizCheckResultInfoV3, null);
    }

    private void Q() {
        this.f77x = new BankChannelAdapter(this, this.f74u, this.rclBankList);
        this.rclBankList.setLayoutManager(new LinearLayoutManager(this));
        this.rclBankList.setNestedScrollingEnabled(false);
        this.rclBankList.setFocusable(false);
        this.rclBankList.setFocusableInTouchMode(false);
        this.rclBankList.setAdapter(this.f77x);
    }

    private void R() {
        if (!this.f75v || SharedPreferenceWithPhoneUtils.f(this, this.userSession.b().b, "top_up_has_show_set_password_dialog") || this.userSession.b().c) {
            return;
        }
        Y();
        SharedPreferenceWithPhoneUtils.h(this, this.userSession.b().b, Boolean.TRUE, "top_up_has_show_set_password_dialog");
    }

    private boolean S() {
        return AppGeneralConfigUtils.o().f("app_config.is_ojk_demo_user", Boolean.FALSE).booleanValue();
    }

    public void T(View view, int i, BannersBean bannersBean) {
        if (bannersBean != null && !TextUtils.isEmpty(bannersBean.redirectUrl)) {
            LenderWebViewActivity.startWebActivity(this, bannersBean.redirectUrl);
        }
        AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, bannersBean);
    }

    @SensorsDataInstrumented
    public static void U(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
        AutoTrackHelper.trackViewOnClick(dialogInterface, i);
    }

    @SensorsDataInstrumented
    public void V(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        SetPasswordActivity.startSetPasswordActivity(this);
        SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
        AutoTrackHelper.trackViewOnClick(dialogInterface, i);
    }

    public void W(FinVirtualAccountResponse.Body body) {
        this.f77x.g(body.accountResponses);
        X(body.banners);
    }

    private void X(List<BannersBean> list) {
        if (CollectionUtils.f(list)) {
            this.bvBanner.setVisibility(8);
        } else {
            this.bvBanner.setVisibility(0);
            this.bvBanner.j(list, new OnItemClickListener() {
                public final void a(View view, int i, Object obj) {
                    LenderRechargeActivity.this.T(view, i, (BannersBean) obj);
                }
            });
        }
    }

    private void Y() {
        LenderConfirmDialog.e(this).f(R.string.lender_set_password_dialog_tip).k(getString(R.string.lender_set_password_later)).p(getString(R.string.lender_go_to_set)).s("dialog_set_password").i(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                LenderRechargeActivity.U(dialogInterface, i);
            }
        }).n(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                LenderRechargeActivity.this.V(dialogInterface, i);
            }
        }).show();
    }

    public void processBizCheckResultResponse(BizCheckResultInfoV3 bizCheckResultInfoV3) {
        int i = AnonymousClass3.a[CheckType.a(bizCheckResultInfoV3.checkType).ordinal()];
        if (i == 1 || i == 2) {
            if (bizCheckResultInfoV3.obtainMultipleSignInfo().isPrivyIdEmpty()) {
                LenderQuickRegisterPrivyIdActivity.startLenderQuickRegisterPrivyIdActivity(this, bizCheckResultInfoV3, null);
            } else {
                ElectronicContractActivity.startElectronicContractActivity(this, bizCheckResultInfoV3, null);
            }
        } else if (i == 3) {
            P(bizCheckResultInfoV3);
        }
        EventBus.c().k(new EventTopUpSuccess());
        finish();
    }

    private void sendBizCheckResultRequest(String str, String str2, String str3) {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).y0(str, str2, str3).a(new IdnObserver<BizCheckResultResponseV3>(this) {
            public void onSuccess(BizCheckResultResponseV3 bizCheckResultResponseV3) {
                LenderRechargeActivity.this.dismissLoadingDialog();
                LenderRechargeActivity.this.processBizCheckResultResponse(bizCheckResultResponseV3.body);
            }
        });
    }

    public static void startRechargeActivity(Activity activity, @NonNull String str, boolean z) {
        Intent intent = new Intent(activity, (Class<?>) LenderRechargeActivity.class);
        intent.putExtra(PARAMS_AMOUNT, str);
        intent.putExtra(PARAMS_FROM_TOP_UP, z);
        activity.startActivity(intent);
    }

    public static void startRechargeActivityForOjk(Activity activity, @NonNull String str, OrderInitInfo orderInitInfo) {
        Intent intent = new Intent(activity, (Class<?>) LenderRechargeActivity.class);
        intent.putExtra(PARAMS_AMOUNT, str);
        intent.putExtra(PARAMS_FROM_TOP_UP, true);
        intent.putExtra("orderInitInfo", orderInitInfo);
        activity.startActivity(intent);
    }

    @Override
    protected void A() {
        Q();
        R();
        this.btnCompletedTopUp.setVisibility((!S() || this.f76w == null) ? 8 : 0);
    }

    @Override
    protected void G(@NonNull Bundle bundle) {
        super.G(bundle);
        bundle.putString(PARAMS_AMOUNT, this.f74u);
        bundle.putBoolean(PARAMS_FROM_TOP_UP, this.f75v);
        bundle.putSerializable("orderInitInfo", this.f76w);
    }

    @OnClick({4692})
    public void clickCompletedTopUpButton() {
        if (BaseUtils.l()) {
            return;
        }
        OrderInitInfo orderInitInfo = this.f76w;
        sendBizCheckResultRequest(orderInitInfo.businessId, orderInitInfo.businessType, orderInitInfo.checkTypeGroup);
    }

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

    @Override
    protected void init() {
        super.init();
        sendGetBankInfoRequest();
    }

    public void onBackPressed() {
        super/*androidx.activity.ComponentActivity*/.onBackPressed();
        EventBus.c().k(new EventTopUpSuccess());
    }

    @Override
    public Disposable runOnActiveEvent(Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.a(this, runnable);
    }

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

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

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

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

    public void sendGetBankInfoRequest() {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).o1().a(new IdnObserver<FinVirtualAccountResponse>(getCallBack()) {
            public void onSuccess(FinVirtualAccountResponse finVirtualAccountResponse) {
                LenderRechargeActivity.this.dismissLoadingDialog();
                LenderRechargeActivity.this.W(finVirtualAccountResponse.body);
            }
        });
    }

    @Override
    protected void y(@NonNull Bundle bundle) {
        super.G(bundle);
        this.f74u = bundle.getString(PARAMS_AMOUNT);
        this.f75v = bundle.getBoolean(PARAMS_FROM_TOP_UP);
        this.f76w = (OrderInitInfo) bundle.getSerializable("orderInitInfo");
    }

    public static void startRechargeActivity(Activity activity, String str) {
        startRechargeActivity(activity, str, false);
    }
}