导航菜单

页面标题

页面副标题

Easycash v3.75.13 - LenderSignWebActivity.java 源代码

正在查看: Easycash v3.75.13 应用的 LenderSignWebActivity.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.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.fintopia.lender.R;
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.events.LenderSignResultEvent;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.launch.model.LenderConfigKey;
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.pendingtransaction.PendingTransactionActivity;
import com.fintopia.lender.module.sign.LenderSignWebActivity;
import com.fintopia.lender.module.sign.models.BizCheckResultResponseV3;
import com.fintopia.lender.module.traderecord.model.DebtProductType;
import com.fintopia.lender.module.traderecord.model.TransactionType;
import com.fintopia.lender.module.webpage.LenderWebViewActivity;
import com.fintopia.lender.widget.LenderSingleButtonDialog;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.IdnBaseResult;
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.CheckType;
import com.lingyue.idnbaselib.model.sign.ExtraInfo;
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.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
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;

public class LenderSignWebActivity extends LenderWebViewActivity {
    private BizCheckResultInfoV3 E;
    private TransferType F;
    private long G;

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

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

        public void d(DialogInterface dialogInterface) {
            LenderSignWebActivity.this.finish();
        }

        public void onError(Throwable th, BizCheckResultResponseV3 bizCheckResultResponseV3) {
            super.onError(th, bizCheckResultResponseV3);
            LenderSingleButtonDialog i = LenderSingleButtonDialog.d(LenderSignWebActivity.this).k("dialog_sign_status_error").g(((IdnBaseResult) bizCheckResultResponseV3).status.detail).e(R.string.dialog_ok).i(new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i2) {
                    LenderSignWebActivity.AnonymousClass1.c(dialogInterface, i2);
                }
            });
            i.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    LenderSignWebActivity.AnonymousClass1.this.d(dialogInterface);
                }
            });
            i.show();
        }

        public void onSuccess(BizCheckResultResponseV3 bizCheckResultResponseV3) {
            if (EcActivityLifecycleCallback.f.f(LenderSignWebActivity.this)) {
                LenderSignWebActivity.this.u0(bizCheckResultResponseV3);
            }
        }
    }

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

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

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

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

    static class AnonymousClass4 {
        static final int[] a;
        static final int[] b;

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

    private void p0(ExtraInfo extraInfo) {
        int i = AnonymousClass4.b[DebtProductType.fromName(AppGeneralConfigUtils.o().p(LenderConfigKey.DEBT_PRODUCT_TYPE, DebtProductType.RIGID_PAYMENT.name())).ordinal()];
        if (i == 1) {
            PendingTransactionActivity.startPendingTransactionActivity(this, TransactionType.CONFIRMING);
        } else if (i != 2) {
            LenderOrdersActivity.startLenderOrdersActivity(u(), this.F, extraInfo.popupContent);
        } else {
            PendingTransactionActivity.startPendingTransactionActivity(this, this.userSession.b().c() ? TransactionType.CONFIRMING : TransactionType.MATCH);
        }
        EventBus.c().k(new EventLendSuccess());
        finish();
    }

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

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

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

    public static void startLenderSignWebActivity(Activity activity, String str, long j, BizCheckResultInfoV3 bizCheckResultInfoV3, TransferType transferType) {
        Intent intent = new Intent(activity, (Class<?>) LenderSignWebActivity.class);
        intent.putExtra("intentKeyActionUrL", str);
        intent.putExtra("relatedId", j);
        intent.putExtra("orderCheckInfo", (Serializable) bizCheckResultInfoV3);
        intent.putExtra("transferType", transferType == null ? null : transferType.name());
        activity.startActivity(intent);
    }

    public void t0() {
        if (EcActivityLifecycleCallback.f.f(this)) {
            x0();
        }
    }

    public void u0(BizCheckResultResponseV3 bizCheckResultResponseV3) {
        BizCheckResultInfoV3 bizCheckResultInfoV3 = bizCheckResultResponseV3.body;
        this.E = bizCheckResultInfoV3;
        int i = AnonymousClass4.a[CheckStatus.a(bizCheckResultInfoV3.checkGroupStatus).ordinal()];
        if (i == 1) {
            if (this.userSession.b().g == UserVerificationStatusEnum.SERVICE_AGREEMENT) {
                y0();
                return;
            } else {
                p0(bizCheckResultResponseV3.body.extraInfo);
                return;
            }
        }
        if (i != 2 && i != 3) {
            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) {
                    LenderSignWebActivity.r0(dialogInterface, i3);
                }
            });
            i2.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    LenderSignWebActivity.this.s0(dialogInterface);
                }
            });
            i2.show();
            return;
        }
        if (!q0(this.E.obtainMultipleSignInfo().signStatusInfoList)) {
            v0();
            return;
        }
        SignStatusInfo nextSign = this.E.obtainMultipleSignInfo().getNextSign();
        if (nextSign == null) {
            EventBus.c().k(new CloseSignEvent());
            finish();
        } else {
            this.G = nextSign.relatedId;
            e0(nextSign.magicLink);
            v0();
        }
    }

    private void v0() {
        if (getWebView() == null) {
            return;
        }
        getWebView().postDelayed(new Runnable() {
            @Override
            public final void run() {
                LenderSignWebActivity.this.t0();
            }
        }, TimeUnit.SECONDS.toMillis(this.E.obtainMultipleSignInfo().timeInterval));
    }

    private void w0() {
        showLoadingDialog();
        ILenderApiRoutes iLenderApiRoutes = (ILenderApiRoutes) this.apiHelper.a();
        BizCheckResultInfoV3 bizCheckResultInfoV3 = this.E;
        iLenderApiRoutes.y0(bizCheckResultInfoV3.businessId, bizCheckResultInfoV3.businessType, bizCheckResultInfoV3.checkTypeGroup).a(new IdnObserver<BizCheckResultResponseV3>(this) {
            public void onSuccess(BizCheckResultResponseV3 bizCheckResultResponseV3) {
                LenderSignWebActivity.this.u0(bizCheckResultResponseV3);
            }
        });
    }

    private void x0() {
        ILenderApiRoutes iLenderApiRoutes = (ILenderApiRoutes) this.apiHelper.a();
        BizCheckResultInfoV3 bizCheckResultInfoV3 = this.E;
        iLenderApiRoutes.p1(bizCheckResultInfoV3.businessId, bizCheckResultInfoV3.businessType, bizCheckResultInfoV3.checkTypeGroup, bizCheckResultInfoV3.checkType, this.G).a(new AnonymousClass1(this));
    }

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

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

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        EventBus.c().k(new LenderSignInterrupt(this.G));
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (CheckType.a(this.E.checkType) == CheckType.PRIVY_SIGNATURE || CheckType.a(this.E.checkType) == CheckType.OJK_FIN_DEMO_SIGNATURE) {
            x0();
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onSignResult(LenderSignResultEvent lenderSignResultEvent) {
        if (!lenderSignResultEvent.a) {
            w0();
        } else if (this.userSession.b().g == UserVerificationStatusEnum.SERVICE_AGREEMENT) {
            y0();
        } else {
            w0();
        }
    }

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

    @Override
    protected void y(@NonNull Bundle bundle) {
        super.y(bundle);
        this.E = bundle.getSerializable("orderCheckInfo");
        this.G = bundle.getLong("relatedId");
        this.F = TransferType.fromName(bundle.getString("transferType"));
    }
}