导航菜单

页面标题

页面副标题

Easycash v3.75.13 - ElectronicContractActivity.java 源代码

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

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


package com.fintopia.lender.module.sign;

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.view.View;
import android.widget.Button;
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.common.UserVerificationStatusEnum;
import com.fintopia.lender.module.events.CloseSignEvent;
import com.fintopia.lender.module.events.EventFinishSign;
import com.fintopia.lender.module.events.EventLendSuccess;
import com.fintopia.lender.module.events.LenderSignInterrupt;
import com.fintopia.lender.module.maintab.AuthHelper;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.orders.LenderOrdersActivity;
import com.fintopia.lender.module.orders.models.TransferType;
import com.fintopia.lender.module.profile.PersonalInformationActivity;
import com.fintopia.lender.module.sign.ElectronicContractActivity;
import com.fintopia.lender.module.sign.models.BizCheckResultResponseV3;
import com.fintopia.lender.module.sign.models.ModifyApplyStatus;
import com.fintopia.lender.module.sign.models.RealNameVerificationResponse;
import com.fintopia.lender.module.utils.AuthStepRationale;
import com.fintopia.lender.widget.LenderAuthGeneralView;
import com.fintopia.lender.widget.LenderSingleButtonDialog;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.response.BooleanResponse;
import com.lingyue.idnbaselib.model.sign.BizCheckResultInfoV3;
import com.lingyue.idnbaselib.model.sign.CheckStatus;
import com.lingyue.idnbaselib.model.sign.PrivyInfoSignStatus;
import com.lingyue.idnbaselib.model.sign.SignStatusInfo;
import com.lingyue.idnbaselib.utils.EcActivityLifecycleCallback;
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.veda.android.bananalibrary.infrastructure.BaseActivity;
import com.veda.android.bananalibrary.net.ICallBack;
import com.yangqianguan.statistics.AutoTrackHelper;
import io.reactivex.disposables.Disposable;
import java.io.Serializable;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

@AuthStepRationale
public class ElectronicContractActivity extends LenderCommonActivity {

    @BindView(4699)
    Button btnGotoSign;

    @BindView(5076)
    LenderAuthGeneralView lagvPrivyId;

    private BizCheckResultInfoV3 f171u;

    private TransferType f172v;

    private long f173w;

    class AnonymousClass1 extends IdnObserver<RealNameVerificationResponse> {
        AnonymousClass1(ICallBack iCallBack) {
            super(iCallBack);
        }

        @SensorsDataInstrumented
        public void b(RealNameVerificationResponse realNameVerificationResponse, DialogInterface dialogInterface, int i) {
            if (ModifyApplyStatus.CAN_APPLY.name().equals(realNameVerificationResponse.body.modifyApplyStatus)) {
                PersonalInformationActivity.startPersonalInformationActivity(ElectronicContractActivity.this.u());
            } else if (ModifyApplyStatus.APPROVED.name().equals(realNameVerificationResponse.body.modifyApplyStatus)) {
                ElectronicContractActivity.this.openCustomerService();
            }
            dialogInterface.dismiss();
            SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
            AutoTrackHelper.trackViewOnClick(dialogInterface, i);
        }

        public void onSuccess(final RealNameVerificationResponse realNameVerificationResponse) {
            ElectronicContractActivity.this.dismissLoadingDialog();
            String str = realNameVerificationResponse.body.verificationStatus;
            str.hashCode();
            if (str.equals("VERIFICATION_PASS")) {
                ElectronicContractActivity.this.Q();
            } else if (str.equals("NEED_MODIFY_INFORMATION")) {
                LenderSingleButtonDialog.d(ElectronicContractActivity.this).k("dialog_real_name_verification_fail").g(realNameVerificationResponse.body.errorMessage).e(ModifyApplyStatus.a(realNameVerificationResponse.body.modifyApplyStatus).textResourceId).i(new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i) {
                        ElectronicContractActivity.AnonymousClass1.this.b(realNameVerificationResponse, dialogInterface, i);
                    }
                }).show();
            }
        }
    }

    class AnonymousClass3 extends IdnObserver<BooleanResponse> {
        AnonymousClass3(ICallBack iCallBack) {
            super(iCallBack);
        }

        public void b() {
            ElectronicContractActivity.this.finish();
        }

        public void onError(Throwable th, BooleanResponse booleanResponse) {
            super.onError(th, booleanResponse);
            ElectronicContractActivity.this.finish();
        }

        public void onSuccess(BooleanResponse booleanResponse) {
            ElectronicContractActivity.this.dismissLoadingDialog();
            AuthHelper.f(ElectronicContractActivity.this, new Runnable() {
                @Override
                public final void run() {
                    ElectronicContractActivity.AnonymousClass3.this.b();
                }
            });
        }
    }

    static class AnonymousClass4 {
        static final int[] a;

        static {
            int[] iArr = new int[CheckStatus.values().length];
            a = iArr;
            try {
                iArr[CheckStatus.SUCCESS.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[CheckStatus.INIT.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[CheckStatus.PENDING.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[CheckStatus.EXPIRED.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                a[CheckStatus.FAILED.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                a[CheckStatus.UNKNOWN.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
        }
    }

    public void Q() {
        if (this.f171u.getFirstSignStatusInfo().status == PrivyInfoSignStatus.SEND_CONTRACT) {
            LenderSignLoadingActivity.startLenderSignLoadingActivity(this, this.f171u.obtainMultipleSignInfo().privyId, this.f171u, this.f172v);
        } else {
            R();
        }
    }

    private void R() {
        SignStatusInfo nextSign = this.f171u.obtainMultipleSignInfo().getNextSign();
        if (nextSign == null) {
            return;
        }
        long j = nextSign.relatedId;
        this.f173w = j;
        LenderSignWebActivity.startLenderSignWebActivity(this, nextSign.magicLink, j, this.f171u, this.f172v);
    }

    private boolean S(List<SignStatusInfo> list) {
        if (CollectionUtils.f(list)) {
            return false;
        }
        for (SignStatusInfo signStatusInfo : list) {
            if (signStatusInfo.relatedId == this.f173w) {
                return signStatusInfo.status == PrivyInfoSignStatus.SIGNED;
            }
        }
        return false;
    }

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

    public void U(DialogInterface dialogInterface) {
        EventBus.c().k(new CloseSignEvent());
        finish();
    }

    public void V(long j) {
        if (EcActivityLifecycleCallback.f.f(this)) {
            Y(j);
        } else {
            dismissLoadingDialog();
        }
    }

    public void W(BizCheckResultResponseV3 bizCheckResultResponseV3, long j) {
        BizCheckResultInfoV3 bizCheckResultInfoV3 = bizCheckResultResponseV3.body;
        this.f171u = bizCheckResultInfoV3;
        int i = AnonymousClass4.a[CheckStatus.a(bizCheckResultInfoV3.checkGroupStatus).ordinal()];
        if (i == 1) {
            if (this.userSession.b().g == UserVerificationStatusEnum.SERVICE_AGREEMENT) {
                a0();
                return;
            } else {
                LenderOrdersActivity.startLenderOrdersActivity(this, this.f172v, bizCheckResultResponseV3.body.extraInfo.popupContent);
                finish();
                return;
            }
        }
        if (i == 2 || i == 3) {
            if (TimeUnit.SECONDS.toMillis(this.f171u.obtainMultipleSignInfo().maxTimeInterval) + j < System.currentTimeMillis()) {
                BaseUtils.p(this, getString(R.string.lender_sign_failed_tip));
                dismissLoadingDialog();
                return;
            } else if (S(this.f171u.obtainMultipleSignInfo().signStatusInfoList)) {
                R();
                return;
            } else {
                X(j);
                return;
            }
        }
        if (i != 4 && i != 5) {
            dismissLoadingDialog();
            return;
        }
        dismissLoadingDialog();
        LenderSingleButtonDialog i2 = LenderSingleButtonDialog.d(this).k("dialog_sign_expired").f(R.string.lender_sign_expired).e(R.string.dialog_ok).i(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i3) {
                ElectronicContractActivity.T(dialogInterface, i3);
            }
        });
        i2.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ElectronicContractActivity.this.U(dialogInterface);
            }
        });
        i2.show();
    }

    private void X(final long j) {
        this.btnGotoSign.postDelayed(new Runnable() {
            @Override
            public final void run() {
                ElectronicContractActivity.this.V(j);
            }
        }, TimeUnit.SECONDS.toMillis(this.f171u.obtainMultipleSignInfo().timeInterval));
    }

    private void Y(final long j) {
        showLoadingDialog();
        ILenderApiRoutes iLenderApiRoutes = (ILenderApiRoutes) this.apiHelper.a();
        BizCheckResultInfoV3 bizCheckResultInfoV3 = this.f171u;
        iLenderApiRoutes.p1(bizCheckResultInfoV3.businessId, bizCheckResultInfoV3.businessType, bizCheckResultInfoV3.checkTypeGroup, bizCheckResultInfoV3.checkType, this.f173w).a(new IdnObserver<BizCheckResultResponseV3>(this) {
            public void onSuccess(BizCheckResultResponseV3 bizCheckResultResponseV3) {
                if (EcActivityLifecycleCallback.f.f(ElectronicContractActivity.this)) {
                    ElectronicContractActivity.this.W(bizCheckResultResponseV3, j);
                } else {
                    ElectronicContractActivity.this.dismissLoadingDialog();
                }
            }
        });
    }

    private void Z() {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).M().a(new AnonymousClass1(this));
    }

    private void a0() {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).R0().a(new AnonymousClass3(this));
    }

    public static void startElectronicContractActivity(Activity activity, BizCheckResultInfoV3 bizCheckResultInfoV3, TransferType transferType) {
        Intent intent = new Intent(activity, (Class<?>) ElectronicContractActivity.class);
        intent.putExtra("orderCheckInfo", (Serializable) bizCheckResultInfoV3);
        intent.putExtra("transferType", transferType == null ? null : transferType.name());
        activity.startActivity(intent);
    }

    @Override
    protected void G(@NonNull Bundle bundle) {
        super.G(bundle);
        bundle.putSerializable("orderCheckInfo", this.f171u);
        TransferType transferType = this.f172v;
        bundle.putString("transferType", transferType == null ? null : transferType.name());
    }

    @OnClick({4699})
    public void clickGotoSign(View view) {
        if (BaseUtils.l()) {
            return;
        }
        Z();
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void closeSignActivity(CloseSignEvent closeSignEvent) {
        finish();
    }

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

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void lendSuccess(EventLendSuccess eventLendSuccess) {
        finish();
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onEventFinishSign(EventFinishSign eventFinishSign) {
        finish();
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onSignInterrupt(LenderSignInterrupt lenderSignInterrupt) {
        this.f173w = lenderSignInterrupt.a;
        Y(System.currentTimeMillis());
    }

    @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);
    }

    @OnClick({5858})
    public void showSignIntroduce(View view) {
        if (BaseUtils.l()) {
            return;
        }
        jumpToWebPage(Uri.parse(((BaseActivity) this).appGlobal.a.a().toString()).buildUpon().path("webview/privyid-faq").build().toString());
    }

    @Override
    protected void w() {
        super.w();
        this.lagvPrivyId.setUnChangeContentText(this.f171u.obtainMultipleSignInfo().privyId);
    }

    @Override
    protected void y(@NonNull Bundle bundle) {
        super.y(bundle);
        this.f171u = bundle.getSerializable("orderCheckInfo");
        this.f172v = TransferType.fromName(bundle.getString("transferType"));
    }
}