导航菜单

页面标题

页面副标题

Mabilis Cash v1.19.4 - PHIDInformationOCRCActivity.java 源代码

正在查看: Mabilis Cash v1.19.4 应用的 PHIDInformationOCRCActivity.java JAVA 源代码文件

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


package com.loans.mabiliscash.auth.idcard;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputFilter;
import android.text.TextUtils;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.fintopia.libCommon.widgets.input.BaseContentView;
import com.lingyue.supertoolkit.statistics.TrackingUtil;
import com.lingyue.supertoolkit.tools.customtools.CollectionUtils;
import com.lingyue.supertoolkit.tools.customtools.CrashReporter;
import com.lingyue.supertoolkit.widgets.adapters.OnItemClickListener;
import com.lingyue.tracklib.ThirdPartTrackLib;
import com.lingyue.tracklib.TrackEventParamsConfigurator;
import com.loans.mabiliscash.R;
import com.loans.mabiliscash.auth.IAuthProcessTracker;
import com.loans.mabiliscash.auth.helper.AuthUtils;
import com.loans.mabiliscash.auth.idcard.PHIDInformationOCRCActivity;
import com.loans.mabiliscash.auth.idcard.adapters.UploadImageTipsAdapter;
import com.loans.mabiliscash.auth.idcard.dialog.IDCardQuitBottomDialog;
import com.loans.mabiliscash.auth.idcard.dialog.IDCardSkipBottomDialog;
import com.loans.mabiliscash.auth.idcard.dialog.IDCardTypeBottomDialog;
import com.loans.mabiliscash.auth.idcard.scanv2.PHIdCardScanOCRV2Activity;
import com.loans.mabiliscash.auth.idcard.widgets.IDCardTypeExampleDialog;
import com.loans.mabiliscash.common.BindClickCall;
import com.loans.mabiliscash.databinding.ActivityIdInformationOcrCBinding;
import com.loans.mabiliscash.models.DocumentsType;
import com.loans.mabiliscash.models.TrackingEvents;
import com.loans.mabiliscash.models.response.DocumentsTypeListResponse;
import com.loans.mabiliscash.models.response.OCRResponse;
import com.loans.mabiliscash.models.response.UploadIdentityInfoResponse;
import com.loans.mabiliscash.net.ECObserver;
import com.loans.mabiliscash.net.IApiRoutes;
import com.loans.mabiliscash.sentry.sentrybusiness.ISentryBusinessEventAutoFinish;
import com.loans.mabiliscash.storage.MMKVUtil;
import com.loans.mabiliscash.thirdpart.AppsFlyerUtil;
import com.loans.mabiliscash.utils.ComponentExtensionsKt;
import com.loans.mabiliscash.utils.IMMKVPageController;
import com.veda.android.bananalibrary.net.ICallBack;
import com.veda.android.statistics.AutoTrackHelper;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Action;
import io.reactivex.schedulers.Schedulers;
import io.sentry.SpanStatus;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import org.jetbrains.annotations.NotNull;

public class PHIDInformationOCRCActivity extends PHIDInformationBaseActivity<ActivityIdInformationOcrCBinding> implements BaseContentView.OnContentChangedListener, ISentryBusinessEventAutoFinish, IMMKVPageController {
    public String idCardNumber;

    private String f100u;

    private String f101v;

    private OCRResponse.Body f102w;

    private ArrayList<DocumentsType> f103x = new ArrayList<>();

    private UploadImageTipsAdapter f104y;

    class AnonymousClass5 extends ECObserver<UploadIdentityInfoResponse> {
        AnonymousClass5(ICallBack iCallBack) {
            super(iCallBack);
        }

        public static void h(UploadIdentityInfoResponse uploadIdentityInfoResponse, Map map) {
            map.put("is_success", String.valueOf(false));
            map.put("api_code", uploadIdentityInfoResponse != null ? uploadIdentityInfoResponse.getStatusCodeString() : "");
        }

        public static void i(Map map) {
            map.put("is_success", String.valueOf(true));
        }

        @Override
        public void e(Throwable th, final UploadIdentityInfoResponse uploadIdentityInfoResponse) {
            super.e(th, uploadIdentityInfoResponse);
            ThirdPartTrackLib.d(PHIDInformationOCRCActivity.this, "auth_kyc_document_result", new TrackEventParamsConfigurator() {
                @Override
                public final void a(Map map) {
                    PHIDInformationOCRCActivity.AnonymousClass5.h(UploadIdentityInfoResponse.this, map);
                }
            });
            IAuthProcessTracker.c(PHIDInformationOCRCActivity.this, "提交证件", false, th != null ? th.getMessage() : uploadIdentityInfoResponse != null ? uploadIdentityInfoResponse.getStatusCodeString() : "");
            PHIDInformationOCRCActivity.this.businessTransaction("UserAuthOrder").b(SpanStatus.INTERNAL_ERROR);
            PHIDInformationOCRCActivity.this.dismissLoadingDialog();
        }

        @Override
        public void c(UploadIdentityInfoResponse uploadIdentityInfoResponse) {
            MMKVUtil.c(PHIDInformationOCRCActivity.this.getMMKVPagePrefix());
            ThirdPartTrackLib.d(PHIDInformationOCRCActivity.this, "auth_kyc_document_result", new TrackEventParamsConfigurator() {
                @Override
                public final void a(Map map) {
                    PHIDInformationOCRCActivity.AnonymousClass5.i(map);
                }
            });
            IAuthProcessTracker.b(PHIDInformationOCRCActivity.this, "提交证件", true);
            PHIDInformationOCRCActivity.this.businessTransaction("UserAuthOrder").i(SpanStatus.OK);
            PHIDInformationOCRCActivity.this.M1();
        }
    }

    public Unit A1() {
        IDInformationOCRCTrackUtil.a.D0(this);
        return Unit.a;
    }

    public Unit B1(DocumentsType documentsType, String str) {
        IDInformationOCRCTrackUtil.a.B0(this);
        S1(documentsType, str);
        return Unit.a;
    }

    public static void C1(Map map) {
        map.put("requirement_id", 18);
        map.put("track_sign", "aauth.b47.d327.exposure.auth_b47_d327_exposure");
    }

    public Unit D1() {
        ThirdPartTrackLib.d(this, "auth_b47_d327_exposure", new TrackEventParamsConfigurator() {
            @Override
            public final void a(Map map) {
                PHIDInformationOCRCActivity.C1(map);
            }
        });
        return Unit.a;
    }

    public void E1(boolean z2) throws Exception {
        if (z2) {
            return;
        }
        readLocalStorage();
    }

    public void F1() {
        ((ActivityIdInformationOcrCBinding) this.o).h.A();
    }

    public void G1() {
        ((ActivityIdInformationOcrCBinding) this.o).h.A();
    }

    public static void H1(Map map) {
        map.put("requirement_id", 18);
        map.put("track_sign", "aauth.result.auth_id_ocr_identity_idnumber_auto_input_result.540");
    }

    public void I1(DocumentsType documentsType) {
        DocumentsType documentsType2 = this.f95t;
        if (documentsType2 == null || !documentsType2.value.equals(documentsType.value)) {
            Iterator<DocumentsType> it = this.f103x.iterator();
            while (it.hasNext()) {
                DocumentsType next = it.next();
                if (documentsType.value.equals(next.value)) {
                    next.isSelected = true;
                    this.f95t = next;
                } else {
                    next.isSelected = false;
                }
            }
            ((ActivityIdInformationOcrCBinding) this.o).m.setContentText(documentsType.label);
            V1();
            U1(documentsType);
            W0(this.f95t);
        }
    }

    private void J1() {
        if (CollectionUtils.a(this.f103x)) {
            O1(true);
        } else {
            Q1();
        }
    }

    private void K1() {
        if (TextUtils.isEmpty(this.idCardNumber) || this.f95t == null || !Y()) {
            new IDCardSkipBottomDialog(this, this.f95t, this.idCardNumber, this.f103x, this.p, this.q, new Function0() {
                public final Object invoke() {
                    Unit w1;
                    w1 = PHIDInformationOCRCActivity.this.w1();
                    return w1;
                }
            }, new Function1() {
                public final Object invoke(Object obj) {
                    Unit x1;
                    x1 = PHIDInformationOCRCActivity.this.x1((DocumentsType) obj);
                    return x1;
                }
            }, new Function0() {
                public final Object invoke() {
                    Unit y1;
                    y1 = PHIDInformationOCRCActivity.this.y1();
                    return y1;
                }
            }, new Function0() {
                public final Object invoke() {
                    Unit z1;
                    z1 = PHIDInformationOCRCActivity.this.z1();
                    return z1;
                }
            }, new Function0() {
                public final Object invoke() {
                    Unit A1;
                    A1 = PHIDInformationOCRCActivity.this.A1();
                    return A1;
                }
            }, new Function2() {
                public final Object invoke(Object obj, Object obj2) {
                    Unit B1;
                    B1 = PHIDInformationOCRCActivity.this.B1((DocumentsType) obj, (String) obj2);
                    return B1;
                }
            }).show();
        } else {
            P1(this.f95t);
        }
    }

    public void L1(DocumentsTypeListResponse documentsTypeListResponse) {
        this.f103x = documentsTypeListResponse.body.documentTypeVOList;
    }

    public void M1() {
        this.authUtil.h(this, new AuthUtils.DefaultAuthCallBack(this));
    }

    private void N1() {
        DocumentsType documentsType = this.f95t;
        if (documentsType != null) {
            I1(documentsType);
        }
        i0(((ActivityIdInformationOcrCBinding) this.o).h, this.idCardNumber);
        if (TextUtils.isEmpty(this.idCardNumber)) {
            return;
        }
        ComponentExtensionsKt.o(((ActivityIdInformationOcrCBinding) this.o).h, 0, new Function0() {
            public final Object invoke() {
                Unit D1;
                D1 = PHIDInformationOCRCActivity.this.D1();
                return D1;
            }
        });
    }

    private void O1(final boolean z2) {
        this.apiHelper.a().k0().w(AndroidSchedulers.a()).K(Schedulers.b()).j(new Action() {
            public final void run() {
                PHIDInformationOCRCActivity.this.E1(z2);
            }
        }).a(new ECObserver<DocumentsTypeListResponse>(this) {
            @Override
            public void e(Throwable th, DocumentsTypeListResponse documentsTypeListResponse) {
                super.e(th, documentsTypeListResponse);
                PHIDInformationOCRCActivity.this.dismissLoadingDialog();
                PHIDInformationOCRCActivity.this.Q();
                if (z2) {
                    PHIDInformationOCRCActivity.this.finish();
                }
            }

            @Override
            public void c(DocumentsTypeListResponse documentsTypeListResponse) {
                PHIDInformationOCRCActivity.this.dismissLoadingDialog();
                PHIDInformationOCRCActivity.this.L1(documentsTypeListResponse);
                PHIDInformationOCRCActivity.this.Q();
            }
        });
    }

    private void P1(@NonNull DocumentsType documentsType) {
        showLoadingDialog();
        HashMap hashMap = new HashMap();
        hashMap.put("idNo", this.idCardNumber);
        hashMap.put("type", documentsType.value);
        hashMap.put("idFrontImage", this.p);
        if (documentsType.needBackCardPhoto) {
            hashMap.put("idBackImage", this.q);
        }
        IApiRoutes a = this.apiHelper.a();
        String t2 = this.gson.t(hashMap);
        AppsFlyerUtil.Companion companion = AppsFlyerUtil.b;
        a.c0(t2, companion.b().f(this), companion.b().e(this)).w(AndroidSchedulers.a()).a(new AnonymousClass5(this));
    }

    private void Q1() {
        ?? iDCardTypeBottomDialog = new IDCardTypeBottomDialog(this, TrackingEvents.PH_ID_CARD_TYPE_SELECT_DIALOG, new OnItemClickListener<Object>() {
            public void a(View view, int i, @Nullable Object obj) {
                if (obj instanceof DocumentsType) {
                    DocumentsType documentsType = (DocumentsType) obj;
                    IDInformationOCRCTrackUtil.a.b0(PHIDInformationOCRCActivity.this, documentsType.value);
                    ?? r0 = PHIDInformationOCRCActivity.this;
                    r0.saveDataToLocal(PHIDInformationBaseActivity.DOCUMENTS_TYPE, r0.gson.t(obj));
                    PHIDInformationOCRCActivity.this.I1(documentsType);
                    PHIDInformationOCRCActivity pHIDInformationOCRCActivity = PHIDInformationOCRCActivity.this;
                    pHIDInformationOCRCActivity.R1(pHIDInformationOCRCActivity.idCardNumber);
                }
                AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, obj);
            }
        }, new IDCardTypeBottomDialog.OnDialogCloseListener() {
            @Override
            public void onClose() {
                IDInformationOCRCTrackUtil.a.Z(PHIDInformationOCRCActivity.this);
            }
        });
        iDCardTypeBottomDialog.v(this.f103x);
        iDCardTypeBottomDialog.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialogInterface) {
                IDInformationOCRCTrackUtil.a.d0(PHIDInformationOCRCActivity.this);
            }
        });
        iDCardTypeBottomDialog.show();
    }

    public void R1(@NonNull String str) {
        if (TextUtils.isEmpty(str)) {
            if (TextUtils.isEmpty(this.idCardNumber)) {
                ((ActivityIdInformationOcrCBinding) this.o).getRoot().postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        PHIDInformationOCRCActivity.this.G1();
                    }
                }, 500L);
            }
        } else if (this.f95t != null) {
            String replaceAll = str.replaceAll("\\s", "");
            boolean isIdNumberFormatDocumentType = DocumentsType.isIdNumberFormatDocumentType(replaceAll, this.f95t);
            this.idCardNumber = replaceAll;
            i0(((ActivityIdInformationOcrCBinding) this.o).h, replaceAll);
            ThirdPartTrackLib.d(this, "auth_id_ocr_identity_idnumber_auto_input_result", new TrackEventParamsConfigurator() {
                @Override
                public final void a(Map map) {
                    PHIDInformationOCRCActivity.H1(map);
                }
            });
            if (isIdNumberFormatDocumentType) {
                return;
            }
            ((ActivityIdInformationOcrCBinding) this.o).getRoot().postDelayed(new Runnable() {
                @Override
                public final void run() {
                    PHIDInformationOCRCActivity.this.F1();
                }
            }, 500L);
        }
    }

    private void S1(DocumentsType documentsType, String str) {
        this.idCardNumber = str;
        if (documentsType != null) {
            saveDataToLocal(PHIDInformationBaseActivity.DOCUMENTS_TYPE, this.gson.t(documentsType));
            I1(documentsType);
        }
        ((ActivityIdInformationOcrCBinding) this.o).h.setContentText(str);
    }

    private void T1() {
        DocumentsType documentsType = this.f95t;
        if (documentsType != null) {
            ((ActivityIdInformationOcrCBinding) this.o).e.a(documentsType.frontUrl);
            ((ActivityIdInformationOcrCBinding) this.o).d.a(this.f95t.backUrl);
        }
    }

    private void U1(DocumentsType documentsType) {
        if (documentsType == null) {
            return;
        }
        if (TextUtils.isEmpty(this.p) || TextUtils.isEmpty(this.r)) {
            ((ActivityIdInformationOcrCBinding) this.o).e.c();
            ((ActivityIdInformationOcrCBinding) this.o).e.a(documentsType.frontUrl);
        }
        if (!documentsType.needBackCardPhoto) {
            this.q = null;
            this.s = null;
            ((ActivityIdInformationOcrCBinding) this.o).d.setVisibility(8);
        } else if (TextUtils.isEmpty(this.s) || TextUtils.isEmpty(this.q)) {
            ((ActivityIdInformationOcrCBinding) this.o).d.setVisibility(0);
            IDInformationOCRCTrackUtil.a.V(this);
            ((ActivityIdInformationOcrCBinding) this.o).d.c();
            ((ActivityIdInformationOcrCBinding) this.o).d.a(documentsType.backUrl);
        }
    }

    private void V1() {
        DocumentsType documentsType;
        OCRResponse.Body body = this.f102w;
        if (body == null || (documentsType = this.f95t) == null) {
            ((ActivityIdInformationOcrCBinding) this.o).g.getRoot().setVisibility(8);
            return;
        }
        List<String> promptListByCurrentIdType = body.getPromptListByCurrentIdType(documentsType.value);
        if (CollectionUtils.a(promptListByCurrentIdType)) {
            ((ActivityIdInformationOcrCBinding) this.o).g.getRoot().setVisibility(8);
            return;
        }
        IDInformationOCRCTrackUtil.a.N0(this, promptListByCurrentIdType);
        ((ActivityIdInformationOcrCBinding) this.o).g.getRoot().setVisibility(0);
        UploadImageTipsAdapter uploadImageTipsAdapter = this.f104y;
        if (uploadImageTipsAdapter == null) {
            this.f104y = new UploadImageTipsAdapter(this, promptListByCurrentIdType);
        } else {
            uploadImageTipsAdapter.g(promptListByCurrentIdType);
        }
        ((ActivityIdInformationOcrCBinding) this.o).g.c.setAdapter(this.f104y);
        ((ActivityIdInformationOcrCBinding) this.o).g.c.setLayoutManager(new LinearLayoutManager(this));
    }

    private void W0(@NonNull DocumentsType documentsType) {
        IDCardTypeHelper.a(documentsType, ((ActivityIdInformationOcrCBinding) this.o).h);
        ((ActivityIdInformationOcrCBinding) this.o).h.setInputType(documentsType.pureNumber ? 2 : 1);
        ((ActivityIdInformationOcrCBinding) this.o).h.setFilters(new InputFilter[]{new InputFilter.LengthFilter(documentsType.idLengthWithBlank)});
        ((ActivityIdInformationOcrCBinding) this.o).d.setVisibility(documentsType.needBackCardPhoto ? 0 : 4);
        if (documentsType.needBackCardPhoto) {
            IDInformationOCRCTrackUtil.a.V(this);
        }
    }

    private DocumentsType Y0(String str) {
        if (!CollectionUtils.a(this.f103x) && !TextUtils.isEmpty(str)) {
            Iterator<DocumentsType> it = this.f103x.iterator();
            while (it.hasNext()) {
                DocumentsType next = it.next();
                if (str.equals(next.value)) {
                    return next;
                }
            }
        }
        return null;
    }

    private void Z0(boolean z2, @Nullable String str, @NotNull OCRResponse.Body body) {
        this.f102w = body;
        IDInformationOCRCTrackUtil.a.f0(this, body.ocrCardType, body.idNo);
        if (z2) {
            this.r = str;
            this.p = body.imageKey;
            String str2 = body.ocrCardType;
            this.f101v = str2;
            DocumentsType Y0 = Y0(str2);
            if (Y0 != null) {
                I1(Y0);
            } else if (this.f95t == null) {
                J1();
            }
            R1(body.idNo);
        } else {
            this.s = str;
            this.q = body.imageKey;
        }
        j0(z2, str);
    }

    private void a1() {
        int i = ("C".equals(this.f100u) || "D".equals(this.f100u)) ? R.drawable.ico_auth_step_two : R.drawable.ic_auth_id_info;
        AuthUtils authUtils = this.authUtil;
        T t2 = this.o;
        authUtils.q(this, ((ActivityIdInformationOcrCBinding) t2).i, i, ((ActivityIdInformationOcrCBinding) t2).j.d, ((ActivityIdInformationOcrCBinding) t2).j.c);
    }

    private void b1() {
        ((ActivityIdInformationOcrCBinding) this.o).h.setOnContentChangedListener(this);
        ((ActivityIdInformationOcrCBinding) this.o).m.setOnContentChangedListener(this);
    }

    private void c1() {
        V(((ActivityIdInformationOcrCBinding) this.o).f, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHIDInformationOCRCActivity.this.d1(view);
            }
        });
        V(((ActivityIdInformationOcrCBinding) this.o).m, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHIDInformationOCRCActivity.this.e1(view);
            }
        });
        V(((ActivityIdInformationOcrCBinding) this.o).e, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHIDInformationOCRCActivity.this.f1(view);
            }
        });
        V(((ActivityIdInformationOcrCBinding) this.o).d, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHIDInformationOCRCActivity.this.g1(view);
            }
        });
        V(((ActivityIdInformationOcrCBinding) this.o).b, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHIDInformationOCRCActivity.this.h1(view);
            }
        });
        V(((ActivityIdInformationOcrCBinding) this.o).l, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHIDInformationOCRCActivity.this.o1(view);
            }
        });
        ComponentExtensionsKt.g(((ActivityIdInformationOcrCBinding) this.o).h, new Function0<Unit>() {
            public Unit invoke() {
                IDInformationOCRCTrackUtil.a.P(PHIDInformationOCRCActivity.this);
                return null;
            }
        });
    }

    public void d1(View view) {
        IDInformationOCRCTrackUtil.a.H(this);
        new IDCardTypeExampleDialog(this, new IDCardTypeExampleDialog.IdCardTypeExampleDialogListener() {
            @Override
            public void a() {
                IDInformationOCRCTrackUtil.a.L(PHIDInformationOCRCActivity.this);
            }

            @Override
            public void b() {
                IDInformationOCRCTrackUtil.a.N(PHIDInformationOCRCActivity.this);
            }

            @Override
            public void onClose() {
                IDInformationOCRCTrackUtil.a.J(PHIDInformationOCRCActivity.this);
            }
        }).show();
    }

    public void e1(View view) {
        IDInformationOCRCTrackUtil.a.X(this, this.f95t);
        J1();
    }

    public void f1(View view) {
        DocumentsType documentsType = this.f95t;
        IDInformationOCRCTrackUtil.a.T(this, PHIDInformationBaseActivity.TYPE_FRONT, documentsType != null ? documentsType.value : "");
        k0(true);
    }

    public void g1(View view) {
        DocumentsType documentsType = this.f95t;
        IDInformationOCRCTrackUtil.a.T(this, PHIDInformationBaseActivity.TYPE_BACK, documentsType != null ? documentsType.value : "");
        k0(false);
    }

    public void h1(View view) {
        IDInformationOCRCTrackUtil.a.F(this);
        K1();
    }

    public Unit i1() {
        IDInformationOCRCTrackUtil.a.J0(this);
        return Unit.a;
    }

    public Unit j1(DocumentsType documentsType) {
        IDInformationOCRCTrackUtil.a.L0(this, documentsType);
        return Unit.a;
    }

    public Unit k1() {
        IDInformationOCRCTrackUtil.a.F0(this);
        return Unit.a;
    }

    public Unit l1() {
        IDInformationOCRCTrackUtil.a.H0(this);
        return Unit.a;
    }

    public Unit m1() {
        IDInformationOCRCTrackUtil.a.D0(this);
        return Unit.a;
    }

    public Unit n1(DocumentsType documentsType, String str) {
        IDInformationOCRCTrackUtil.a.B0(this);
        S1(documentsType, str);
        return Unit.a;
    }

    public void o1(View view) {
        IDInformationOCRCTrackUtil.a.z0(this);
        new IDCardSkipBottomDialog(this, this.f95t, this.idCardNumber, this.f103x, this.p, this.q, new Function0() {
            public final Object invoke() {
                Unit i1;
                i1 = PHIDInformationOCRCActivity.this.i1();
                return i1;
            }
        }, new Function1() {
            public final Object invoke(Object obj) {
                Unit j1;
                j1 = PHIDInformationOCRCActivity.this.j1((DocumentsType) obj);
                return j1;
            }
        }, new Function0() {
            public final Object invoke() {
                Unit k1;
                k1 = PHIDInformationOCRCActivity.this.k1();
                return k1;
            }
        }, new Function0() {
            public final Object invoke() {
                Unit l1;
                l1 = PHIDInformationOCRCActivity.this.l1();
                return l1;
            }
        }, new Function0() {
            public final Object invoke() {
                Unit m1;
                m1 = PHIDInformationOCRCActivity.this.m1();
                return m1;
            }
        }, new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                Unit n1;
                n1 = PHIDInformationOCRCActivity.this.n1((DocumentsType) obj, (String) obj2);
                return n1;
            }
        }).show();
    }

    public Unit p1() {
        IDInformationOCRCTrackUtil.a.v0(this);
        return Unit.a;
    }

    public Unit q1(DocumentsType documentsType) {
        IDInformationOCRCTrackUtil.a.x0(this, documentsType);
        return Unit.a;
    }

    public Unit r1() {
        IDInformationOCRCTrackUtil.a.p0(this);
        return Unit.a;
    }

    private void readLocalStorage() {
        try {
            DocumentsType documentsType = (DocumentsType) this.gson.k(MMKVUtil.b(getMMKVKey(PHIDInformationBaseActivity.DOCUMENTS_TYPE), ""), DocumentsType.class);
            if (documentsType != null) {
                I1(documentsType);
            }
        } catch (Throwable th) {
            CrashReporter.a(th);
        }
    }

    public Unit s1() {
        IDInformationOCRCTrackUtil.a.r0(this);
        return Unit.a;
    }

    public static void start(Activity activity, String str) {
        Intent intent = new Intent(activity, (Class<?>) PHIDInformationOCRCActivity.class);
        intent.putExtra("extra_auth_ab_type", str);
        activity.startActivity(intent);
    }

    public Unit t1() {
        IDInformationOCRCTrackUtil.a.n0(this);
        return Unit.a;
    }

    public Unit u1() {
        IDInformationOCRCTrackUtil.a.t0(this);
        return Unit.a;
    }

    public Unit v1(DocumentsType documentsType, String str) {
        IDInformationOCRCTrackUtil.a.l0(this);
        S1(documentsType, str);
        return Unit.a;
    }

    public Unit w1() {
        IDInformationOCRCTrackUtil.a.J0(this);
        return Unit.a;
    }

    public Unit x1(DocumentsType documentsType) {
        IDInformationOCRCTrackUtil.a.L0(this, documentsType);
        return Unit.a;
    }

    public Unit y1() {
        IDInformationOCRCTrackUtil.a.F0(this);
        return Unit.a;
    }

    public Unit z1() {
        IDInformationOCRCTrackUtil.a.H0(this);
        return Unit.a;
    }

    @Override
    public ActivityIdInformationOcrCBinding bindingInflater() {
        return ActivityIdInformationOcrCBinding.c(getLayoutInflater());
    }

    @Override
    @NotNull
    public String getMMKVKey(@NotNull String str) {
        return IMMKVPageController.DefaultImpls.a(this, str);
    }

    @Override
    @NotNull
    public String getMMKVPagePrefix() {
        return "id_info";
    }

    @Override
    protected void h0(boolean z2) {
        int i = z2 ? 10030 : 10031;
        int i2 = z2 ? 1 : 11;
        DocumentsType documentsType = this.f95t;
        PHIdCardScanOCRV2Activity.startForResult(this, i, i2, documentsType != null ? documentsType.value : "");
    }

    protected void j() {
        super.j();
        showLoadingDialog();
        O1(false);
    }

    @Override
    protected void j0(boolean z2, @Nullable String str) {
        (z2 ? ((ActivityIdInformationOcrCBinding) this.o).e : ((ActivityIdInformationOcrCBinding) this.o).d).b(str);
    }

    @Override
    protected void k(@NonNull Bundle bundle) {
        super.k(bundle);
        this.idCardNumber = bundle.getString("id_card_number");
        this.f100u = getIntent().getStringExtra("extra_auth_ab_type");
    }

    @Override
    protected void o() {
        super.o();
        b1();
        a1();
        c0(((ActivityIdInformationOcrCBinding) this.o).h);
        N1();
        c1();
        ((ActivityIdInformationOcrCBinding) this.o).d.setVisibility(4);
        T1();
        IDInformationOCRCTrackUtil.a.V(this);
    }

    protected void onActivityResult(int i, int i2, Intent intent) {
        OCRResponse.Body body;
        super.onActivityResult(i, i2, intent);
        if (i2 != -1 || intent == null) {
            return;
        }
        if (i == 10030) {
            OCRResponse.Body body2 = (OCRResponse.Body) intent.getSerializableExtra(PHIdCardScanOCRActivity.OCR_RESULT);
            if (body2 == null) {
                return;
            }
            Z0(true, intent.getStringExtra(PHBaseIdCardScanActivity.FILE_PATH), body2);
            return;
        }
        if (i != 10031 || (body = (OCRResponse.Body) intent.getSerializableExtra(PHIdCardScanOCRActivity.OCR_RESULT)) == null) {
            return;
        }
        Z0(false, intent.getStringExtra(PHBaseIdCardScanActivity.FILE_PATH), body);
    }

    @Override
    public void onBackPressed() {
        new IDCardQuitBottomDialog(this, this.f95t, this.idCardNumber, this.f103x, this.p, this.q, new Function0() {
            public final Object invoke() {
                Unit p1;
                p1 = PHIDInformationOCRCActivity.this.p1();
                return p1;
            }
        }, new Function1() {
            public final Object invoke(Object obj) {
                Unit q1;
                q1 = PHIDInformationOCRCActivity.this.q1((DocumentsType) obj);
                return q1;
            }
        }, new Function0() {
            public final Object invoke() {
                Unit r1;
                r1 = PHIDInformationOCRCActivity.this.r1();
                return r1;
            }
        }, new Function0() {
            public final Object invoke() {
                Unit s1;
                s1 = PHIDInformationOCRCActivity.this.s1();
                return s1;
            }
        }, new Function0() {
            public final Object invoke() {
                Unit t1;
                t1 = PHIDInformationOCRCActivity.this.t1();
                return t1;
            }
        }, new Function0() {
            public final Object invoke() {
                Unit u1;
                u1 = PHIDInformationOCRCActivity.this.u1();
                return u1;
            }
        }, new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                Unit v1;
                v1 = PHIDInformationOCRCActivity.this.v1((DocumentsType) obj, (String) obj2);
                return v1;
            }
        }).show();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        ThirdPartTrackLib.c(this, "auth_kyc_document_enter");
        businessTransaction("UserAuthOrder");
        super.onCreate(bundle);
        TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_SHOW, a0().c("mergeStrategyABType").a(this.f100u).b());
        IDInformationOCRCTrackUtil.a.j0(this);
    }

    @Override
    protected void onDestroy() {
        IDInformationOCRCTrackUtil.a.h0(this);
        super.onDestroy();
    }

    public void onEditContentChanged(BaseContentView baseContentView) {
        if (baseContentView.getId() == 2131362079) {
            this.idCardNumber = ((ActivityIdInformationOcrCBinding) this.o).h.getContent();
            IDInformationOCRCTrackUtil.a.R(this);
        }
    }

    @Override
    protected void s(@NonNull Bundle bundle) {
        super.s(bundle);
        bundle.putString("id_card_number", this.idCardNumber);
        bundle.putString("extra_auth_ab_type", this.f100u);
    }

    public void saveDataToLocal(@NotNull String str, @Nullable String str2) {
        IMMKVPageController.DefaultImpls.b(this, str, str2);
    }
}