导航菜单

页面标题

页面副标题

Easycash v3.75.13 - EcIdCardPreviewActivity.java 源代码

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

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


package com.lingyue.easycash.authentication.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import butterknife.BindView;
import butterknife.OnClick;
import com.google.android.material.imageview.ShapeableImageView;
import com.lingyue.easycash.R;
import com.lingyue.easycash.authentication.AuthBusinessProcessor;
import com.lingyue.easycash.commom.EasyCashCommonActivity;
import com.lingyue.easycash.models.AwardStepType;
import com.lingyue.easycash.models.enums.IdCardDisplayType;
import com.lingyue.easycash.models.event.ReUploadIdCardPicStickyEvent;
import com.lingyue.easycash.utils.AuthBackTipsDialogUtil;
import com.lingyue.easycash.utils.EasycashUmengEvent;
import com.lingyue.easycash.utils.GiftAwardOperationUtil;
import com.lingyue.easycash.utils.SensorTrackEvent;
import com.lingyue.easycash.widght.EasycashSingleButtonDialog;
import com.lingyue.easycash.widght.FullScreenDialog;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.MediaRegisterAwardResponse;
import com.lingyue.idnbaselib.sentrybusiness.SentryBusiness;
import com.lingyue.idnbaselib.utils.GeneralUtil;
import com.lingyue.idnbaselib.utils.JsonParamsBuilder;
import com.lingyue.idnbaselib.utils.TextViewUtil;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionDenied;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionGranted;
import com.lingyue.supertoolkit.screen.IScreenShotProtectPage;
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.imageloaderlib.IImageLoader;
import com.veda.android.imageloaderlib.Imager;
import com.yangqianguan.statistics.AutoTrackHelper;
import com.yangqianguan.statistics.autotrack.TrackDataApi;
import io.reactivex.disposables.Disposable;
import io.sentry.ITransaction;
import io.sentry.Sentry;
import io.sentry.SpanStatus;
import java.util.HashMap;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class EcIdCardPreviewActivity extends EasyCashCommonActivity implements IScreenShotProtectPage {
    private IdCardDisplayType B;
    private ITransaction C;

    @BindView(R.id.iv_enhance_safe_tip)
    ImageView ivEnhanceSafeTip;

    @BindView(R.id.ll_enhance_safe_tip)
    LinearLayout llEnhanceSafeTip;

    @BindView(R.id.ll_safe_tip)
    LinearLayout llSafeTip;

    @BindView(R.id.rl_award_content)
    RelativeLayout rlAwardContent;

    @BindView(R.id.siv_award_content)
    ShapeableImageView sivAwardContent;

    @BindView(R.id.tv_award_content)
    TextView tvAwardContent;

    @BindView(R.id.tv_enhance_safe_tip)
    TextView tvEnhanceSafeTip;

    @BindView(R.id.tv_enhance_view_sample)
    TextView tvEnhanceViewSample;

    @BindView(R.id.tv_safe_tip)
    TextView tvSafeTip;

    @BindView(R.id.tv_view_sample)
    TextView tvViewSample;

    private void W() {
        this.a.setVisibility(this.userSession.f().showCustomerService ? 0 : 8);
        this.a.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                EcIdCardPreviewActivity.this.Y(view);
            }
        });
    }

    private boolean X() {
        return IdCardDisplayType.ALL_NEW_PAGE_C.equals(this.B);
    }

    @SensorsDataInstrumented
    public void Y(View view) {
        if (BaseUtils.l()) {
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
            return;
        }
        openCustomerService();
        ThirdPartEventUtils.t("auth_ktp_prepare_csc_click");
        logSensorEvent(SensorTrackEvent.EC_KTP_PREVIEW_CSC_CLICK);
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    @SensorsDataInstrumented
    public void Z(FullScreenDialog fullScreenDialog, View view) {
        fullScreenDialog.dismiss();
        logSensorEvent(SensorTrackEvent.EC_KTP_PREVIEW_OK_CLICK);
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    public void a0(Activity activity, final FullScreenDialog fullScreenDialog, View view, Object obj) {
        view.findViewById(R.id.tv_confirm).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                EcIdCardPreviewActivity.this.Z(fullScreenDialog, view2);
            }
        });
        TrackDataApi.a().setViewID(view.findViewById(R.id.tv_confirm), "dialog_view_sample");
    }

    public void b0(DialogInterface dialogInterface) {
        ThirdPartEventUtils.y(this, EasycashUmengEvent.S2);
        logSensorEvent(SensorTrackEvent.EC_KTP_PREVIEW_EXAMPLE_SHOW);
    }

    public void c0(DialogInterface dialogInterface, int i) {
        GeneralUtil.g(this);
        dialogInterface.dismiss();
    }

    private void d0() {
        this.permissionHelper.requestPermissions((Activity) this, "android.permission.CAMERA");
    }

    private void e0() {
        EasycashSingleButtonDialog.d(this).f(R.string.go_to_setting_page).o("dialog_permission_denied_camera").g(R.string.permission_denied_camera).l(new EasycashSingleButtonDialog.OnDialogButtonClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                EcIdCardPreviewActivity.this.c0(dialogInterface, i);
            }
        }).show();
        ThirdPartEventUtils.D(this, EasycashUmengEvent.j4, new JsonParamsBuilder().d("popupType").a("own").c());
    }

    private void initSafeTipView() {
        if (X()) {
            this.llSafeTip.setVisibility(8);
            this.ivEnhanceSafeTip.setVisibility(0);
            this.tvEnhanceViewSample.setVisibility(0);
            this.tvViewSample.setVisibility(8);
            if (TextUtils.isEmpty(this.userSession.f().minimalistProcessAuthContent)) {
                this.llEnhanceSafeTip.setVisibility(8);
                return;
            } else {
                this.llEnhanceSafeTip.setVisibility(0);
                this.tvEnhanceSafeTip.setText(this.userSession.f().minimalistProcessAuthContent);
                return;
            }
        }
        this.llEnhanceSafeTip.setVisibility(8);
        this.ivEnhanceSafeTip.setVisibility(8);
        this.tvEnhanceViewSample.setVisibility(8);
        this.tvViewSample.setVisibility(0);
        if (TextUtils.isEmpty(this.userSession.f().minimalistProcessAuthContent)) {
            this.llSafeTip.setVisibility(8);
        } else {
            this.llSafeTip.setVisibility(0);
            this.tvSafeTip.setText(this.userSession.f().minimalistProcessAuthContent);
        }
    }

    public void processAwardContentResponse(MediaRegisterAwardResponse.Body body) {
        if (TextUtils.isEmpty(body.pageShowDes)) {
            this.rlAwardContent.setVisibility(8);
            return;
        }
        this.tvAwardContent.setText(TextViewUtil.a(body.pageShowDes, body.pageSpecialDes, getResources().getColor(2131099780), 1));
        Imager.a().c(this, body.pageImageUrl, this.sivAwardContent, new IImageLoader.IImageLoaderListener<String>() {
            @Override
            public boolean b(Exception exc, String str) {
                EcIdCardPreviewActivity.this.sivAwardContent.setImageResource(R.drawable.easycash_banner_media_register_auth_award);
                ThirdPartEventUtils.z(EcIdCardPreviewActivity.this, EasycashUmengEvent.i2, new JsonParamsBuilder().d("step").a(AwardStepType.KTP.name()).c());
                return true;
            }

            @Override
            public boolean a(String str) {
                return false;
            }
        });
        this.sivAwardContent.setVisibility(0);
        this.rlAwardContent.setVisibility(0);
        ThirdPartEventUtils.z(this, EasycashUmengEvent.h2, new JsonParamsBuilder().d("step").a(AwardStepType.KTP.name()).c());
    }

    public static void startEcIdCardPreviewActivity(Activity activity, IdCardDisplayType idCardDisplayType) {
        Intent intent = new Intent(activity, (Class<?>) EcIdCardPreviewActivity.class);
        intent.putExtra("idCardDisplayType", idCardDisplayType);
        activity.startActivity(intent);
    }

    @Override
    protected void B(@NonNull Bundle bundle) {
        super.B(bundle);
        this.B = (IdCardDisplayType) bundle.getSerializable("idCardDisplayType");
    }

    @Override
    protected void D() {
        super.D();
        W();
        initSafeTipView();
        AuthBusinessProcessor.a().e(this);
    }

    @Override
    protected void N(@NonNull Bundle bundle) {
        super.N(bundle);
        bundle.putSerializable("idCardDisplayType", this.B);
    }

    @PermissionDenied("android.permission.CAMERA")
    public void deniedCameraPermission() {
        if (!ActivityCompat.shouldShowRequestPermissionRationale(this, "android.permission.CAMERA")) {
            e0();
        }
        this.C.a("errorCode", "2002");
        this.C.o(SpanStatus.INTERNAL_ERROR);
        logNextStepResult(this.C.getName(), "2002", null);
    }

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

    @Override
    public String getTrackUrl() {
        return j0.b.a(this);
    }

    @PermissionGranted({"android.permission.CAMERA"})
    public void grantedCameraPermission() {
        ECIdCardAutoScanActivity.startECIdCardAutoScanActivity(this, true, false);
        this.C.o(SpanStatus.OK);
        logNextStepResult(this.C.getName(), null, null);
    }

    @Override
    public boolean isNeedProcessScreenShot() {
        return j0.a.a(this);
    }

    public void logNextStepResult(String str, String str2, @Nullable String str3) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("entry_page", str);
        if (str2 != null) {
            hashMap.put("reason", str2);
        }
        if (!TextUtils.isEmpty(str3)) {
            hashMap.put("error_cause", str3);
        }
        logSensorEventWithParams(SensorTrackEvent.EC_AUTH_NEXT_STEP_RESULT, hashMap);
    }

    public void onBackPressed() {
        AuthBackTipsDialogUtil.g(this, "1");
        ThirdPartEventUtils.t("auth_ktp_prepare_back_click");
        logSensorEvent(SensorTrackEvent.EC_KTP_PREVIEW_BACK);
    }

    @Override
    protected void onDestroy() {
        SentryBusiness.e().d("UserAuthOrder");
        super.onDestroy();
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onReUploadIdCardEvent(ReUploadIdCardPicStickyEvent reUploadIdCardPicStickyEvent) {
        EventBus.c().q(reUploadIdCardPicStickyEvent);
        finish();
    }

    @Override
    protected void onResume() {
        super.onResume();
        ThirdPartEventUtils.t("auth_ktp_prepare_expose");
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("test_name", this.B.name());
        logSensorEventWithParams(SensorTrackEvent.EC_KTP_PREVIEW_SHOW, hashMap);
    }

    @OnClick({R.id.btn_take_photo})
    protected void onTakePhotoClick(View view) {
        if (BaseUtils.l()) {
            return;
        }
        ThirdPartEventUtils.t("auth_ktp_prepare_next_click");
        this.C = Sentry.C("auth_ktp_prepare_next_click_result", "monitor");
        d0();
        logSensorEvent(SensorTrackEvent.EC_KTP_PREVIEW_TAKE_PHOTO_CLICK);
    }

    @OnClick({R.id.tv_view_sample, R.id.tv_enhance_view_sample})
    protected void onViewSampleClick(View view) {
        if (BaseUtils.l()) {
            return;
        }
        FullScreenDialog a = new FullScreenDialog.Builder(this).d(R.layout.easycash_dialog_ktp_tip).b(new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view2, Object obj) {
                EcIdCardPreviewActivity.this.a0(activity, fullScreenDialog, view2, obj);
            }
        }).a();
        a.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public final void onShow(DialogInterface dialogInterface) {
                EcIdCardPreviewActivity.this.b0(dialogInterface);
            }
        });
        a.show();
        ThirdPartEventUtils.t("auth_ktp_prepare_sample_click");
        logSensorEvent(SensorTrackEvent.EC_KTP_PREVIEW_EXAMPLE_CLICK);
    }

    @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 z() {
        super.z();
        GiftAwardOperationUtil.a(AwardStepType.KTP.name(), this, true, new GiftAwardOperationUtil.GiftAwardCallback() {
            @Override
            public void b(MediaRegisterAwardResponse mediaRegisterAwardResponse) {
                EcIdCardPreviewActivity.this.processAwardContentResponse(mediaRegisterAwardResponse.body);
            }

            @Override
            public void a() {
            }
        });
        L();
    }
}