导航菜单

页面标题

页面副标题

Credmex v3.12.2 - LiveCheckPreviewActivity.java 源代码

正在查看: Credmex v3.12.2 应用的 LiveCheckPreviewActivity.java JAVA 源代码文件

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


package com.credmex.authentication.activity;

import a3d20240717.Oo000ooo00;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.OnClick;
import com.credmex.activity.LaunchActivityFolder.SplashActivity;
import com.credmex.commom.CommonActivity;
import com.credmex.models.AdvanceTokenResponse;
import com.credmex.net.CredMexObserver;
import com.credmex.net.IApiRoutes;
import com.credmex.track.ThirdPartTrackEvents;
import com.credmex.track.ThirdPartTrackLib;
import com.credmex.utils.AppUtil;
import com.credmex.widght.dialog.CommonDialog;
import com.credmex.widght.dialog.DialogButtonListener;
import com.open.mx.ui.views.button.PrimaryButton;
import com.open.mxbaselib.sentrybusiness.SentryBusiness;
import com.veda.android.bananalibrary.infrastructure.BaseActivity;
import com.veda.supertoolkit.lifecycle.LifecycleEvent;
import com.veda.supertoolkit.utils.FormatUtil;
import com.veda.supertoolkit.widgets.BaseUtils;
import com.veda.supertoolkit.widgets.StatusBarCompat;
import io.reactivex.disposables.Disposable;
import io.sentry.SpanStatus;

public abstract class LiveCheckPreviewActivity extends CommonActivity {
    protected static String F = "mobile";
    protected String D;
    private CountDownTimer E;

    @BindView(2131361975)
    PrimaryButton btnNext;

    @BindView(2131362363)
    ImageView ivLiveCheckPreview;

    private void f0() {
        this.E = new CountDownTimer(SplashActivity.COUNT_DOWN_WITH_SPLASH_DURATION, 1000L) {
            @Override
            public void onFinish() {
                ?? r0 = LiveCheckPreviewActivity.this;
                r0.btnNext.setTitle(r0.getString(2131820889));
                LiveCheckPreviewActivity.this.q0();
            }

            @Override
            public void onTick(long j2) {
                ?? r0 = LiveCheckPreviewActivity.this;
                r0.btnNext.setTitle(FormatUtil.h(r0.getString(2131820890), new Object[]{Long.valueOf(j2 / 1000)}));
            }
        };
        this.btnNext.post(new Runnable() {
            @Override
            public final void run() {
                LiveCheckPreviewActivity.this.k0();
            }
        });
    }

    public void j0(Dialog dialog) {
        AppUtil.e(this);
        dialog.dismiss();
    }

    public void k0() {
        this.E.start();
    }

    @Override
    protected int A() {
        return 0;
    }

    @Override
    protected void D() {
        super.D();
        reportFullyDisplayed();
    }

    @Override
    protected void G(@NonNull Bundle bundle) {
        super.G(bundle);
        this.D = bundle.getString(F);
    }

    @Override
    protected void K() {
        g0();
        f0();
    }

    @Override
    protected boolean L() {
        return true;
    }

    @Override
    protected void X(@NonNull Bundle bundle) {
        super.X(bundle);
        bundle.putString(F, this.D);
    }

    protected void d0() {
        CommonDialog.CommonDialogBuilder.c(this).q("dialog_go_setting").m(2131821337, new DialogButtonListener() {
            @Override
            public final void a(Dialog dialog) {
                LiveCheckPreviewActivity.this.j0(dialog);
            }
        }).d(1).i(2131821034).a().show();
    }

    protected void e0() {
        showLoadingDialog();
        ((IApiRoutes) this.apiHelper.a()).U0().a(new CredMexObserver<AdvanceTokenResponse>(this) {
            @Override
            public void onError(Throwable th, AdvanceTokenResponse advanceTokenResponse) {
                super.onError(th, (Throwable) advanceTokenResponse);
                LiveCheckPreviewActivity.this.l0();
                LiveCheckPreviewActivity.this.o0();
            }

            public void onSuccess(AdvanceTokenResponse advanceTokenResponse) {
                LiveCheckPreviewActivity.this.r0(advanceTokenResponse);
                LiveCheckPreviewActivity.this.p0();
            }
        });
    }

    @Override
    protected void g() {
        StatusBarCompat.d(this, A(), false);
    }

    protected void g0() {
        setToolbarTransparentTitleWhite();
        ((BaseActivity) this).a.setVisibility(8);
    }

    @Override
    public int getLayoutID() {
        return 2131558715;
    }

    protected abstract void h0();

    protected abstract void i0();

    protected abstract void l0();

    protected void m0(String str) {
        ThirdPartTrackLib.d(this, ThirdPartTrackEvents.UserAuth.MEX_ADVANCE_LICENSE_CHECK_ERROR);
        SentryBusiness.h().i("advanceCheck").a("licenseCheckTag", str);
        finishBusinessTransaction("advanceCheck", SpanStatus.CANCELLED);
    }

    protected void n0() {
        ThirdPartTrackLib.d(this, ThirdPartTrackEvents.UserAuth.MEX_ADVANCE_LICENSE_CHECK_SUCCESS);
        SentryBusiness.h().i("advanceCheck").a("licenseCheckTag", "licenseCheckSuccess");
    }

    protected void o0() {
        ThirdPartTrackLib.d(this, ThirdPartTrackEvents.UserAuth.MEX_ADVANCE_GET_TOKEN_FAILED);
        SentryBusiness.h().i("advanceCheck").a("fetchToken", "fetchTokenFailed");
        finishBusinessTransaction("advanceCheck", SpanStatus.CANCELLED);
    }

    public void onBackPressed() {
        t0();
        finish();
    }

    @Override
    protected void onDestroy() {
        this.E.cancel();
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        t0();
        super.onPause();
    }

    @OnClick({2131361975, 2131362413})
    public void onViewClick(View view) {
        if (BaseUtils.b()) {
            return;
        }
        int id = view.getId();
        if (id == 2131361975) {
            s0();
        } else {
            if (id != 2131362413) {
                return;
            }
            t0();
            B();
        }
    }

    protected void p0() {
        ThirdPartTrackLib.d(this, ThirdPartTrackEvents.UserAuth.MEX_ADVANCE_GET_TOKEN_SUCCESS);
        SentryBusiness.h().i("advanceCheck").a("fetchToken", "fetchTokenSuccess");
    }

    protected void q0() {
        requestCameraPermission(new CommonActivity.CameraPermissionCallback() {
            @Override
            public void a() {
                LiveCheckPreviewActivity.this.d0();
            }

            @Override
            public void b() {
                LiveCheckPreviewActivity.this.showNormalToast(2131821099);
            }

            @Override
            public void c() {
                LiveCheckPreviewActivity.this.i0();
            }
        });
    }

    protected void r0(AdvanceTokenResponse advanceTokenResponse) {
        String s2 = Oo000ooo00.s(advanceTokenResponse.body.license);
        Oo000ooo00.n(true);
        if (AdvanceLivenessActivity.DETECT_SUCCESS.equals(s2)) {
            h0();
            n0();
        } else {
            showErrorToast(s2);
            l0();
            m0(s2);
        }
        dismissLoadingDialog();
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnCreated(@NonNull Runnable runnable) {
        return com.veda.supertoolkit.lifecycle.i.a(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnDestroy(@NonNull Runnable runnable) {
        return com.veda.supertoolkit.lifecycle.i.b(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
        return com.veda.supertoolkit.lifecycle.i.c(this, lifecycleEvent, runnable);
    }

    protected void s0() {
        t0();
        q0();
    }

    protected void t0() {
        this.E.cancel();
        this.btnNext.setTitle(getString(2131820889));
    }
}