导航菜单

页面标题

页面副标题

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

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

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


package com.loans.mabiliscash.auth.personal;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
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 com.fintopia.libCommon.widgets.dialog.alert.BaseAlertDialog;
import com.fintopia.libCommon.widgets.dialog.bottom.BaseBottomSheetDialog;
import com.fintopia.libCommon.widgets.input.BaseContentView;
import com.fintopia.libCommon.widgets.input.InputContentView;
import com.lingyue.supertoolkit.location.CashLocationManager;
import com.lingyue.supertoolkit.location.GeocoderLocationInfo;
import com.lingyue.supertoolkit.location.LocationHelper;
import com.lingyue.supertoolkit.statistics.TrackingUtil;
import com.lingyue.supertoolkit.tools.customtools.CollectionUtils;
import com.lingyue.supertoolkit.tools.customtools.CrashReporter;
import com.lingyue.supertoolkit.tools.customtools.JsonParamsBuilder;
import com.lingyue.supertoolkit.tools.customtools.Logger;
import com.lingyue.supertoolkit.widgets.ToastCompat;
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.InputNameFilter;
import com.loans.mabiliscash.auth.helper.AreaStandardTreeUtil;
import com.loans.mabiliscash.auth.helper.AuthUtils;
import com.loans.mabiliscash.auth.helper.QuitAuthHelper;
import com.loans.mabiliscash.auth.personal.GenderSelectView;
import com.loans.mabiliscash.auth.personal.PHPersonalInformationActivity;
import com.loans.mabiliscash.common.BindClickCall;
import com.loans.mabiliscash.common.PHViewBindingActivity;
import com.loans.mabiliscash.databinding.ActivityPersonalInformationBinding;
import com.loans.mabiliscash.models.AuthOption;
import com.loans.mabiliscash.models.LabelBean;
import com.loans.mabiliscash.models.TrackingEvents;
import com.loans.mabiliscash.models.response.AuthGuideResponse;
import com.loans.mabiliscash.models.response.MultiAuthOptionListResponse;
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.loans.mabiliscash.utils.ThreadPool;
import com.loans.mabiliscash.widght.BottomSheetDialogHelper;
import com.loans.mabiliscash.widght.dialog.SingleBottomSheetDialog;
import com.loans.mabiliscash.widght.dialog.bottomSelect.Bottom3ColumnsSelectDialog;
import com.loans.mabiliscash.widght.dialog.bottomSelect.BottomBirthdaySelectDialog;
import com.veda.android.bananalibrary.net.ICallBack;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Action;
import io.sentry.SpanStatus;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;

public class PHPersonalInformationActivity extends PHViewBindingActivity<ActivityPersonalInformationBinding> implements BaseContentView.OnContentChangedListener, ISentryBusinessEventAutoFinish, IMMKVPageController {
    public static final String BIRTHDAY = "birthday";
    public static final String DAY_OF_BIRTHDAY = "day_of_birthday";
    public static final int DEFAULT_SELECT_YEAR_INDEX = 14;
    public static final String DETAILED_ADDRESS = "detailed_address";
    public static final String EDUCATION = "education";
    public static final String FIRST_NAME = "first_name";
    public static final String GENDER = "gender";
    public static final String IDENTITY_BRGY = "identity_brgy";
    public static final String IDENTITY_CITY = "identity_city";
    public static final String IDENTITY_REGION = "identity_region";
    public static final String INSTITUTION_TYPE = "institution_type";
    public static final String LAST_NAME = "last_name";
    public static final String MARRY_STATUS = "marry_status";
    public static final String MONTH_OF_BIRTHDAY = "month_of_birthday";
    public static final String NUMBER_OF_CREDIT_CARDS = "number_of_credit_cards";
    public static final String PURPOSE_OF_LOAN = "purpose_of_loan";
    private static final String S;
    private static final Map<String, List<String>> T = new HashMap();
    private static final Map<String, List<String>> U = new HashMap();
    private static final List<String> V = new ArrayList();
    public static final String YEAR_OF_BIRTHDAY = "year_of_birthday";
    LabelBean A;
    String B;
    String C;
    String D;
    String E;
    private ArrayList<LabelBean> G;
    private List<LabelBean> H;
    private List<LabelBean> I;
    private List<LabelBean> J;
    private List<LabelBean> K;
    private List<LabelBean> L;
    private List<LabelBean> M;
    private List<LabelBean> N;
    private Map<LabelBean, List<LabelBean>> O;
    private Map<LabelBean, List<LabelBean>> P;
    private IAuthPersonalExperiment Q;
    private String p;
    String q;
    String r;
    LabelBean s;

    LabelBean f135t;

    LabelBean f136u;

    LabelBean f137v;

    LabelBean f138w;

    LabelBean f139x;

    LabelBean f140y;

    LabelBean f141z;

    @Nullable
    private GeocoderLocationInfo F = null;
    private boolean R = false;

    class AnonymousClass3 extends ECObserver<UploadIdentityInfoResponse> {
        AnonymousClass3(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(PHPersonalInformationActivity.this, "auth_identity_result", new TrackEventParamsConfigurator() {
                @Override
                public final void a(Map map) {
                    PHPersonalInformationActivity.AnonymousClass3.h(UploadIdentityInfoResponse.this, map);
                }
            });
            IAuthProcessTracker.c(PHPersonalInformationActivity.this, "提交个人信息", false, th != null ? th.getMessage() : uploadIdentityInfoResponse != null ? uploadIdentityInfoResponse.getStatusCodeString() : "");
            PHPersonalInformationActivity.this.businessTransaction("UserAuthOrder").b(SpanStatus.INTERNAL_ERROR);
            PHPersonalInformationActivity.this.dismissLoadingDialog();
        }

        @Override
        public void c(UploadIdentityInfoResponse uploadIdentityInfoResponse) {
            ThirdPartTrackLib.d(PHPersonalInformationActivity.this, "auth_identity_result", new TrackEventParamsConfigurator() {
                @Override
                public final void a(Map map) {
                    PHPersonalInformationActivity.AnonymousClass3.i(map);
                }
            });
            IAuthProcessTracker.b(PHPersonalInformationActivity.this, "提交个人信息", true);
            PHPersonalInformationActivity.this.businessTransaction("UserAuthOrder").i(SpanStatus.OK);
            PHPersonalInformationActivity.this.U1(uploadIdentityInfoResponse);
        }
    }

    static {
        StringBuilder sb = new StringBuilder();
        sb.append(Calendar.getInstance().get(1) - 14);
        sb.append("");
        S = sb.toString();
        Q0();
    }

    public static void A1(BaseContentView baseContentView, Map map) {
        map.put("requirement_id", 18);
        map.put("track_sign", "aauth.b38.d40.input.auth_b38_d40_input");
        map.put("text_name", ComponentExtensionsKt.n(baseContentView));
    }

    public Unit B1(String str) {
        f2(str);
        return null;
    }

    public void C1(String str, String str2, String str3) {
        this.C = str3;
        this.D = str;
        this.E = str2;
        ((ActivityPersonalInformationBinding) this.o).j.setContentText(buildBirthday(str3, str, str2));
        saveDataToLocal("birthday", buildBirthday(this.C, this.D, this.E));
        AuthUtils.i(((ActivityPersonalInformationBinding) this.o).j);
    }

    public void D1(LabelBean labelBean, LabelBean labelBean2, LabelBean labelBean3) {
        this.f140y = labelBean;
        this.f141z = labelBean2;
        this.A = labelBean3;
        saveDataToLocal("identity_region", this.gson.t(labelBean));
        saveDataToLocal("identity_city", this.gson.t(this.f141z));
        saveDataToLocal("identity_brgy", this.gson.t(this.A));
        ((ActivityPersonalInformationBinding) this.o).p.setContentText(String.format("%s %s %s", this.f140y.label, this.f141z.label, this.A.label));
        AuthUtils.i(((ActivityPersonalInformationBinding) this.o).p);
    }

    public void E1(View view, int i, LabelBean labelBean) {
        this.f135t = labelBean;
        saveDataToLocal("education", this.gson.t(labelBean));
        ((ActivityPersonalInformationBinding) this.o).k.setContentText(this.f135t.label);
        h2(this.f135t.value);
        AuthUtils.i(((ActivityPersonalInformationBinding) this.o).k);
    }

    public boolean F1(LabelBean labelBean) {
        return labelBean.equals(this.f135t);
    }

    public void G1(View view, int i, LabelBean labelBean) {
        this.f137v = labelBean;
        saveDataToLocal("marry_status", this.gson.t(labelBean));
        ((ActivityPersonalInformationBinding) this.o).m.setContentText(this.f137v.label);
        AuthUtils.i(((ActivityPersonalInformationBinding) this.o).m);
    }

    public boolean H1(LabelBean labelBean) {
        return labelBean.equals(this.f137v);
    }

    public void I1(View view, int i, LabelBean labelBean) {
        this.f139x = labelBean;
        saveDataToLocal("number_of_credit_cards", this.gson.t(labelBean));
        ((ActivityPersonalInformationBinding) this.o).n.setContentText(this.f139x.label);
        AuthUtils.i(((ActivityPersonalInformationBinding) this.o).n);
    }

    public boolean J1(LabelBean labelBean) {
        return labelBean.equals(this.f139x);
    }

    public void K1(View view, int i, LabelBean labelBean) {
        this.f138w = labelBean;
        saveDataToLocal("purpose_of_loan", this.gson.t(labelBean));
        ((ActivityPersonalInformationBinding) this.o).o.setContentText(this.f138w.label);
        AuthUtils.i(((ActivityPersonalInformationBinding) this.o).o);
    }

    public boolean L1(LabelBean labelBean) {
        return labelBean.equals(this.f138w);
    }

    public void M1(View view, int i, LabelBean labelBean) {
        this.f136u = labelBean;
        if (labelBean != null) {
            saveDataToLocal("institution_type", this.gson.t(labelBean));
            ((ActivityPersonalInformationBinding) this.o).l.setContentText(this.f136u.label);
        }
        AuthUtils.i(((ActivityPersonalInformationBinding) this.o).l);
    }

    public boolean N1(LabelBean labelBean) {
        return labelBean.equals(this.f136u);
    }

    public static void O1(String str, Map map) {
        map.put("requirement_id", 9);
        map.put("track_sign", "aauth.b38.d40.click.auth_b38_d40_click");
        map.put("text_name", str);
    }

    private void P0(ArrayList<LabelBean> arrayList) {
        ArrayList<LabelBean> arrayList2;
        this.N = new ArrayList();
        this.O = new HashMap();
        this.P = new HashMap();
        Iterator<LabelBean> it = arrayList.iterator();
        while (it.hasNext()) {
            LabelBean next = it.next();
            if (next != null) {
                this.N.add(next);
                ArrayList<LabelBean> arrayList3 = next.children;
                if (arrayList3 != null) {
                    Iterator<LabelBean> it2 = arrayList3.iterator();
                    while (it2.hasNext()) {
                        LabelBean next2 = it2.next();
                        if (next2 != null && (arrayList2 = next2.children) != null) {
                            this.O.put(next2, arrayList2);
                        }
                    }
                    this.P.put(next, arrayList3);
                }
            }
        }
    }

    private static void Q0() {
        ThreadPool.a(new Runnable() {
            @Override
            public final void run() {
                PHPersonalInformationActivity.d1();
            }
        });
    }

    private void R0() {
        ((ActivityPersonalInformationBinding) this.o).d.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).e.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).j.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).k.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).l.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).m.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).o.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).n.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).p.setOnContentChangedListener(this);
        ((ActivityPersonalInformationBinding) this.o).c.setOnContentChangedListener(this);
    }

    private boolean S0() {
        return this.Q.a();
    }

    private void S1() {
        if (this.Q.e()) {
            g2(TrackingEvents.PH_PERSONAL_INFO_COMMIT);
            V1();
        }
    }

    private void T0() {
        Bundle bundleExtra = getIntent().getBundleExtra("extra_auth_args");
        if (bundleExtra == null || !bundleExtra.getBoolean("intent_key_request_auth_guide_dialog", false)) {
            return;
        }
        this.apiHelper.a().o0().w(AndroidSchedulers.a()).a(new ECObserver<AuthGuideResponse>(this) {
            @Override
            public void c(AuthGuideResponse authGuideResponse) {
                AuthGuideResponse.Body body = authGuideResponse.body;
                if (body == null || TextUtils.isEmpty(body.imageUrl)) {
                    return;
                }
                PHPersonalInformationActivity.this.R = true;
                PHPersonalInformationActivity.this.X1(authGuideResponse);
            }
        });
    }

    public void T1(AuthOption authOption) {
        List<LabelBean> list = authOption.sex;
        this.H = list;
        this.I = authOption.education;
        this.K = authOption.marryStatus;
        this.L = authOption.loanUse;
        this.M = authOption.limitedNumbers;
        this.J = authOption.institutionType;
        ((ActivityPersonalInformationBinding) this.o).f.setGenderList(list);
    }

    @Nullable
    private LabelBean U0(@NonNull final String str, @Nullable LabelBean labelBean) {
        LabelBean labelBean2 = (LabelBean) CollectionsKt.U(this.N, new Function1() {
            public final Object invoke(Object obj) {
                Boolean e1;
                e1 = PHPersonalInformationActivity.e1(str, (LabelBean) obj);
                return e1;
            }
        });
        return labelBean2 != null ? labelBean2 : labelBean;
    }

    public void U1(UploadIdentityInfoResponse uploadIdentityInfoResponse) {
        MMKVUtil.c(getMMKVPagePrefix());
        this.userSession.c().userName = this.q + " " + this.r;
        this.authUtil.h(this, new AuthUtils.DefaultAuthCallBack(this));
    }

    private static List<String> V0(int i, int i2) {
        ArrayList arrayList = new ArrayList();
        Calendar calendar = Calendar.getInstance();
        calendar.set(1, i);
        calendar.set(2, i2 - 1);
        int actualMaximum = calendar.getActualMaximum(5);
        for (int i3 = 1; i3 <= actualMaximum; i3++) {
            arrayList.add(String.format("%02d", Integer.valueOf(i3)));
        }
        return arrayList;
    }

    private void V1() {
        showLoadingDialog();
        HashMap<String, Object> c = this.Q.c();
        IApiRoutes a = this.apiHelper.a();
        String t2 = this.gson.t(c);
        AppsFlyerUtil.Companion companion = AppsFlyerUtil.b;
        a.j(t2, companion.b().f(this), companion.b().e(this)).w(AndroidSchedulers.a()).a(new AnonymousClass3(this));
    }

    private void W0(final boolean z2) {
        if (this.G != null) {
            return;
        }
        showLoadingDialog();
        new AreaStandardTreeUtil(this, new AreaStandardTreeUtil.AreaStandardTreeEvent() {
            @Override
            public final void a(ArrayList arrayList) {
                PHPersonalInformationActivity.this.f1(z2, arrayList);
            }
        }, new Runnable() {
            @Override
            public final void run() {
                PHPersonalInformationActivity.this.g1();
            }
        }).f();
    }

    private void W1(InputContentView inputContentView, final String str) {
        ComponentExtensionsKt.g(inputContentView, new Function0() {
            public final Object invoke() {
                Unit B1;
                B1 = PHPersonalInformationActivity.this.B1(str);
                return B1;
            }
        });
    }

    private void X0() {
        showLoadingDialog();
        this.apiHelper.a().A("SEX,MARRY_STATUS,EDUCATION,LOAN_USE,LENGTH_OF_RESIDENCE,LIMITED_NUMBERS,INSTITUTION_TYPE").w(AndroidSchedulers.a()).j(new Action() {
            public final void run() {
                PHPersonalInformationActivity.this.i1();
            }
        }).a(new ECObserver<MultiAuthOptionListResponse>(this) {
            @Override
            public void e(Throwable th, MultiAuthOptionListResponse multiAuthOptionListResponse) {
                super.e(th, multiAuthOptionListResponse);
                PHPersonalInformationActivity.this.Q();
            }

            @Override
            public void c(MultiAuthOptionListResponse multiAuthOptionListResponse) {
                AuthOption authOption = multiAuthOptionListResponse.body;
                if (authOption != null) {
                    PHPersonalInformationActivity.this.T1(authOption);
                }
                PHPersonalInformationActivity.this.Q();
            }
        });
    }

    public void X1(AuthGuideResponse authGuideResponse) {
        BaseAlertDialog authPersonalInformationAlertDialog = new AuthPersonalInformationAlertDialog(this, TrackingEvents.PH_AUTH_PERSONAL_INFORMATION_DIALOG, authGuideResponse.body);
        authPersonalInformationAlertDialog.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialogInterface) {
                TrackingUtil.j(PHPersonalInformationActivity.this, TrackingEvents.AUTH_PERSONAL_INFORMATION_DIALOG_SHOW, "");
            }
        });
        authPersonalInformationAlertDialog.show();
    }

    private void Y0() {
        AuthUtils authUtils = this.authUtil;
        T t2 = this.o;
        authUtils.q(this, ((ActivityPersonalInformationBinding) t2).g, R.drawable.ic_auth_personal_info, ((ActivityPersonalInformationBinding) t2).h.d, ((ActivityPersonalInformationBinding) t2).h.c);
    }

    private void Z0() {
        if (TextUtils.isEmpty(this.p)) {
            this.p = "A";
        }
        if ("B".equals(this.p)) {
            this.Q = new AuthPersonalExperimentB(this, (ActivityPersonalInformationBinding) this.o);
        } else {
            this.Q = new AuthPersonalExperimentA(this, (ActivityPersonalInformationBinding) this.o);
        }
    }

    private void Z1(ArrayList<LabelBean> arrayList) {
        if (CollectionUtils.a(this.N) || CollectionUtils.b(this.O) || CollectionUtils.b(this.P)) {
            P0(arrayList);
        }
        List<LabelBean> list = this.N;
        Map<LabelBean, List<LabelBean>> map = this.O;
        Map<LabelBean, List<LabelBean>> map2 = this.P;
        GeocoderLocationInfo geocoderLocationInfo = this.F;
        LabelBean U0 = geocoderLocationInfo != null ? U0(geocoderLocationInfo.a, this.f140y) : this.f140y;
        GeocoderLocationInfo geocoderLocationInfo2 = this.F;
        LabelBean U02 = geocoderLocationInfo2 != null ? U0(geocoderLocationInfo2.b, this.f141z) : this.f141z;
        GeocoderLocationInfo geocoderLocationInfo3 = this.F;
        BottomSheetDialogHelper.d(this, list, map, map2, TrackingEvents.PH_AUTH_PERSONAL_INFO_AREA_DIALOG, R.string.residential_address, U0, U02, geocoderLocationInfo3 != null ? U0(geocoderLocationInfo3.c, this.A) : this.A, new Bottom3ColumnsSelectDialog.OnSelectedListener() {
            @Override
            public final void a(Object obj, Object obj2, Object obj3) {
                PHPersonalInformationActivity.this.D1((LabelBean) obj, (LabelBean) obj2, (LabelBean) obj3);
            }
        }).show();
    }

    private void a1() {
        InputNameFilter inputNameFilter = new InputNameFilter();
        ((ActivityPersonalInformationBinding) this.o).d.setFilters(new InputFilter[]{inputNameFilter});
        ((ActivityPersonalInformationBinding) this.o).e.setFilters(new InputFilter[]{inputNameFilter});
        ((ActivityPersonalInformationBinding) this.o).d.setOnFocusChangedListener(new InputContentView.OnFocusChangedListener() {
            public final void a(boolean z2) {
                PHPersonalInformationActivity.this.l1(z2);
            }
        });
        ((ActivityPersonalInformationBinding) this.o).e.setOnFocusChangedListener(new InputContentView.OnFocusChangedListener() {
            public final void a(boolean z2) {
                PHPersonalInformationActivity.this.m1(z2);
            }
        });
        ((ActivityPersonalInformationBinding) this.o).c.setOnFocusChangedListener(new InputContentView.OnFocusChangedListener() {
            public final void a(boolean z2) {
                PHPersonalInformationActivity.this.n1(z2);
            }
        });
    }

    private void a2() {
        BaseBottomSheetDialog singleBottomSheetDialog = new SingleBottomSheetDialog(this, this.I, TrackingEvents.PH_EDUCATION_LEVEL_SELECT_DIALOG, new SingleBottomSheetDialog.OnItemSelectListener() {
            @Override
            public final void a(View view, int i, Object obj) {
                PHPersonalInformationActivity.this.E1(view, i, (LabelBean) obj);
            }
        }, new SingleBottomSheetDialog.InitCallback() {
            @Override
            public final boolean a(Object obj) {
                boolean F1;
                F1 = PHPersonalInformationActivity.this.F1((LabelBean) obj);
                return F1;
            }
        });
        singleBottomSheetDialog.l(R.string.education_lavel);
        singleBottomSheetDialog.show();
    }

    private void b1() {
        ((ActivityPersonalInformationBinding) this.o).f.setOnGenderSelectedListener(new GenderSelectView.OnGenderSelectedListener() {
            @Override
            public final void a(LabelBean labelBean) {
                PHPersonalInformationActivity.this.z1(labelBean);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).j, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.o1(view);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).k, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.p1(view);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).l, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.q1(view);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).m, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.r1(view);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).o, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.s1(view);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).n, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.t1(view);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).p, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.u1(view);
            }
        });
        V(((ActivityPersonalInformationBinding) this.o).b, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHPersonalInformationActivity.this.v1(view);
            }
        });
        W1(((ActivityPersonalInformationBinding) this.o).d, "evFirstName");
        W1(((ActivityPersonalInformationBinding) this.o).e, "evLastName");
        W1(((ActivityPersonalInformationBinding) this.o).c, "evDetailedAddress");
        ((ActivityPersonalInformationBinding) this.o).d.setDelIconClickListener(new BaseContentView.DelIconClickListener() {
            public final void a() {
                PHPersonalInformationActivity.this.w1();
            }
        });
        ((ActivityPersonalInformationBinding) this.o).e.setDelIconClickListener(new BaseContentView.DelIconClickListener() {
            public final void a() {
                PHPersonalInformationActivity.this.x1();
            }
        });
        ((ActivityPersonalInformationBinding) this.o).c.setDelIconClickListener(new BaseContentView.DelIconClickListener() {
            public final void a() {
                PHPersonalInformationActivity.this.y1();
            }
        });
    }

    private void b2() {
        BaseBottomSheetDialog singleBottomSheetDialog = new SingleBottomSheetDialog(this, this.K, TrackingEvents.PH_MARITAL_STATUS_SELECT_DIALOG, new SingleBottomSheetDialog.OnItemSelectListener() {
            @Override
            public final void a(View view, int i, Object obj) {
                PHPersonalInformationActivity.this.G1(view, i, (LabelBean) obj);
            }
        }, new SingleBottomSheetDialog.InitCallback() {
            @Override
            public final boolean a(Object obj) {
                boolean H1;
                H1 = PHPersonalInformationActivity.this.H1((LabelBean) obj);
                return H1;
            }
        });
        singleBottomSheetDialog.l(R.string.marital_status);
        singleBottomSheetDialog.show();
    }

    private boolean c1() {
        return "B".equals(this.p);
    }

    private void c2() {
        BaseBottomSheetDialog singleBottomSheetDialog = new SingleBottomSheetDialog(this, this.M, TrackingEvents.PH_NUMBER_OF_CREDIT_CARDS_SELECT_DIALOG, new SingleBottomSheetDialog.OnItemSelectListener() {
            @Override
            public final void a(View view, int i, Object obj) {
                PHPersonalInformationActivity.this.I1(view, i, (LabelBean) obj);
            }
        }, new SingleBottomSheetDialog.InitCallback() {
            @Override
            public final boolean a(Object obj) {
                boolean J1;
                J1 = PHPersonalInformationActivity.this.J1((LabelBean) obj);
                return J1;
            }
        });
        singleBottomSheetDialog.l(R.string.number_of_credit_cards);
        singleBottomSheetDialog.show();
    }

    public static void d1() {
        V.clear();
        T.clear();
        U.clear();
        int i = Calendar.getInstance().get(1);
        for (int i2 = 0; i2 < 100; i2++) {
            int i3 = i - i2;
            String valueOf = String.valueOf(i3);
            V.add(valueOf);
            ArrayList arrayList = new ArrayList();
            for (int i4 = 1; i4 <= 12; i4++) {
                String format = String.format("%02d", Integer.valueOf(i4));
                arrayList.add(format);
                List<String> V0 = V0(i3, i4);
                U.put(valueOf + format, V0);
            }
            T.put(valueOf, arrayList);
        }
    }

    private void d2() {
        BaseBottomSheetDialog singleBottomSheetDialog = new SingleBottomSheetDialog(this, this.L, TrackingEvents.PH_PURPOSE_OF_LOAN_SELECT_DIALOG, new SingleBottomSheetDialog.OnItemSelectListener() {
            @Override
            public final void a(View view, int i, Object obj) {
                PHPersonalInformationActivity.this.K1(view, i, (LabelBean) obj);
            }
        }, new SingleBottomSheetDialog.InitCallback() {
            @Override
            public final boolean a(Object obj) {
                boolean L1;
                L1 = PHPersonalInformationActivity.this.L1((LabelBean) obj);
                return L1;
            }
        });
        singleBottomSheetDialog.l(R.string.purpose_of_loan);
        singleBottomSheetDialog.show();
    }

    public static Boolean e1(String str, LabelBean labelBean) {
        return Boolean.valueOf(labelBean.label.equals(str));
    }

    private void e2() {
        BaseBottomSheetDialog singleBottomSheetDialog = new SingleBottomSheetDialog(this, this.J, TrackingEvents.PH_INSTITUTION_TYPE_SELECT_DIALOG, new SingleBottomSheetDialog.OnItemSelectListener() {
            @Override
            public final void a(View view, int i, Object obj) {
                PHPersonalInformationActivity.this.M1(view, i, (LabelBean) obj);
            }
        }, new SingleBottomSheetDialog.InitCallback() {
            @Override
            public final boolean a(Object obj) {
                boolean N1;
                N1 = PHPersonalInformationActivity.this.N1((LabelBean) obj);
                return N1;
            }
        });
        singleBottomSheetDialog.l(R.string.institution_type);
        singleBottomSheetDialog.show();
    }

    public void f1(boolean z2, ArrayList arrayList) {
        this.G = arrayList;
        if (!z2 || CollectionUtils.a(arrayList)) {
            return;
        }
        Z1(this.G);
    }

    private void f2(final String str) {
        ThirdPartTrackLib.d(this, "auth_b38_d40_click", new TrackEventParamsConfigurator() {
            @Override
            public final void a(Map map) {
                PHPersonalInformationActivity.O1(str, map);
            }
        });
    }

    public void g1() {
        dismissLoadingDialog();
    }

    private void g2(String str) {
        TrackingUtil.j(this, str, new JsonParamsBuilder().c("mergeStrategyABType").a(this.p).c("showGuideDialog").b(this.R).b());
    }

    public static void h1(Map map) {
        map.put("requirement_id", 18);
        map.put("track_sign", "aauth.b38.pageview.auth_b38_pageview");
    }

    private void h2(String str) {
        this.f136u = null;
        MMKVUtil.d(getMMKVKey("institution_type"));
        if (!c1()) {
            ((ActivityPersonalInformationBinding) this.o).l.setVisibility(8);
            return;
        }
        if (CollectionUtils.a(this.J) || str == null) {
            return;
        }
        if (!needShowInstitutionType(str)) {
            ((ActivityPersonalInformationBinding) this.o).l.setVisibility(8);
        } else {
            ((ActivityPersonalInformationBinding) this.o).l.setVisibility(0);
            ((ActivityPersonalInformationBinding) this.o).l.setContentText("");
        }
    }

    public void i1() throws Exception {
        this.Q.f();
        dismissLoadingDialog();
        ThirdPartTrackLib.d(this, "auth_b38_pageview", new TrackEventParamsConfigurator() {
            @Override
            public final void a(Map map) {
                PHPersonalInformationActivity.h1(map);
            }
        });
    }

    public static void j1(GeocoderLocationInfo geocoderLocationInfo, Map map) {
        map.put("requirement_id", 18);
        map.put("track_sign", "aauth.result.auth_personal_info_location_auto_input_result.531");
        map.put("text_name", geocoderLocationInfo.a + "," + geocoderLocationInfo.b + "," + geocoderLocationInfo.c + "," + geocoderLocationInfo.d);
    }

    public void k1(final GeocoderLocationInfo geocoderLocationInfo) {
        this.F = geocoderLocationInfo;
        if (geocoderLocationInfo != null) {
            ThirdPartTrackLib.d(this, "auth_personal_info_location_auto_input_result", new TrackEventParamsConfigurator() {
                @Override
                public final void a(Map map) {
                    PHPersonalInformationActivity.j1(GeocoderLocationInfo.this, map);
                }
            });
        }
    }

    public void l1(boolean z2) {
        Logger.c().a("evFirstName onFocusChangedListener: %s" + z2);
        if (z2) {
            return;
        }
        saveDataToLocal("first_name", ((ActivityPersonalInformationBinding) this.o).d.getContentTrim());
    }

    public void m1(boolean z2) {
        if (z2) {
            return;
        }
        saveDataToLocal("last_name", ((ActivityPersonalInformationBinding) this.o).e.getContentTrim());
    }

    public void n1(boolean z2) {
        if (z2) {
            return;
        }
        saveDataToLocal("detailed_address", ((ActivityPersonalInformationBinding) this.o).c.getContentTrim());
    }

    public void o1(View view) {
        f2("svDateOfBirth");
        Y1();
    }

    public void p1(View view) {
        f2("svEducation");
        P1();
    }

    public void q1(View view) {
        f2("svInstitutionType");
        preShowInstitutionTypePickView();
    }

    public void r1(View view) {
        f2("svMaritalStatus");
        R1();
    }

    public void s1(View view) {
        f2("svPurposeOfLoan");
        preShowPurposeOfLoanPickView();
    }

    public static void start(Activity activity, @Nullable Bundle bundle, String str) {
        Intent intent = new Intent(activity, (Class<?>) PHPersonalInformationActivity.class);
        if (bundle != null) {
            intent.putExtra("extra_auth_args", bundle);
        }
        intent.putExtra("extra_auth_ab_type", str);
        activity.startActivity(intent);
    }

    public void t1(View view) {
        f2("svNumberOfCreditCards");
        preShowNumberOfCreditCardsSelectDialog();
    }

    public void u1(View view) {
        f2("svResidentialAddress");
        Q1();
    }

    public void v1(View view) {
        S1();
    }

    public void w1() {
        saveDataToLocal("first_name", "");
    }

    public void x1() {
        saveDataToLocal("last_name", "");
    }

    public void y1() {
        saveDataToLocal("detailed_address", "");
    }

    public void z1(LabelBean labelBean) {
        if (this.s != labelBean) {
            AuthUtils.i(((ActivityPersonalInformationBinding) this.o).f);
        }
        saveDataToLocal("gender", this.gson.t(labelBean));
        TrackingUtil.j(this, TrackingEvents.PH_PERSONAL_INFO_SELECTED_GENDER, new JsonParamsBuilder().c("gender").a(labelBean.value).c("showGuideDialog").b(this.R).c("mergeStrategyABType").a(this.p).b());
        this.s = labelBean;
        ((ActivityPersonalInformationBinding) this.o).b.setEnabled(S0());
        f2("genderSelectView");
    }

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

    void P1() {
        if (CollectionUtils.a(this.I)) {
            X0();
        } else {
            a2();
        }
    }

    void Q1() {
        ArrayList<LabelBean> arrayList = this.G;
        if (arrayList == null || arrayList.isEmpty()) {
            W0(true);
        } else {
            Z1(this.G);
        }
    }

    void R1() {
        if (CollectionUtils.a(this.K)) {
            X0();
        } else {
            b2();
        }
    }

    void Y1() {
        List<String> list = V;
        if (CollectionUtils.a(list) || CollectionUtils.b(T) || CollectionUtils.b(U)) {
            Q0();
        }
        BottomSheetDialogHelper.c(this, list, T, U, TrackingEvents.PH_AUTH_PERSONAL_INFO_AREA_DIALOG, R.string.birthday, TextUtils.isEmpty(this.C) ? S : this.C, TextUtils.isEmpty(this.D) ? "07" : this.D, TextUtils.isEmpty(this.E) ? "15" : this.E, new BottomBirthdaySelectDialog.OnSelectedListener() {
            @Override
            public final void a(Object obj, Object obj2, Object obj3) {
                PHPersonalInformationActivity.this.C1((String) obj, (String) obj2, (String) obj3);
            }
        }).show();
    }

    public String buildBirthday(String str, String str2, String str3) {
        return (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || TextUtils.isEmpty(str3)) ? "" : String.format("%s-%s-%s", str2, str3, str);
    }

    public String buildBirthdayForServer(String str, String str2, String str3) {
        return (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || TextUtils.isEmpty(str3)) ? "" : String.format("%s%s%s", str, str2, str3);
    }

    protected boolean d() {
        return true;
    }

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

    @Override
    @NonNull
    public String getMMKVPagePrefix() {
        return "personal_info";
    }

    protected void init() {
        super.init();
        Z0();
    }

    protected void j() {
        super.j();
        showLoadingDialog();
        W0(false);
        X0();
        T0();
        LocationHelper.j().i(this, new CashLocationManager.GeocoderLocationInfoListener() {
            @Override
            public final void a(GeocoderLocationInfo geocoderLocationInfo) {
                PHPersonalInformationActivity.this.k1(geocoderLocationInfo);
            }
        });
    }

    @Override
    protected void k(@NonNull Bundle bundle) {
        super.k(bundle);
        this.p = bundle.getString("extra_auth_ab_type");
        this.q = bundle.getString("first_name");
        this.r = bundle.getString("last_name");
        this.s = (LabelBean) bundle.getSerializable("gender");
        this.C = bundle.getString("year_of_birthday");
        this.D = bundle.getString("month_of_birthday");
        this.E = bundle.getString("day_of_birthday");
        this.f140y = (LabelBean) bundle.getSerializable("identity_region");
        this.f141z = (LabelBean) bundle.getSerializable("identity_city");
        this.A = (LabelBean) bundle.getSerializable("identity_brgy");
        this.f135t = (LabelBean) bundle.getSerializable("education");
        this.f136u = (LabelBean) bundle.getSerializable("institution_type");
        this.f137v = (LabelBean) bundle.getSerializable("marry_status");
        this.f138w = (LabelBean) bundle.getSerializable("purpose_of_loan");
        this.f139x = (LabelBean) bundle.getSerializable("number_of_credit_cards");
        this.B = bundle.getString("detailed_address");
    }

    public boolean needShowInstitutionType(String str) {
        return c1() && (str.equalsIgnoreCase("PHI_BACHELORS_DEGREE") || str.equalsIgnoreCase("PHI_MASTER_DEGREE") || str.equalsIgnoreCase("PHI_DOCTORATE"));
    }

    protected void o() {
        super.o();
        R0();
        Y0();
        a1();
        b1();
        this.Q.d();
        this.Q.b();
    }

    @Override
    public void onBackPressed() {
        QuitAuthHelper.o(this);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        ThirdPartTrackLib.c(this, "auth_identity_enter");
        businessTransaction("UserAuthOrder");
        super.onCreate(bundle);
        g2(TrackingEvents.PH_PERSONAL_INFO_PAGE_OPEN);
    }

    public void onEditContentChanged(final BaseContentView baseContentView) {
        int id = baseContentView.getId();
        if (id == 2131362075) {
            this.B = ((ActivityPersonalInformationBinding) this.o).c.getContentTrim();
        } else if (id == 2131362078) {
            this.q = ((ActivityPersonalInformationBinding) this.o).d.getContentTrim();
        } else if (id == 2131362080) {
            this.r = ((ActivityPersonalInformationBinding) this.o).e.getContentTrim();
        }
        ThirdPartTrackLib.d(this, "auth_b38_d40_input", new TrackEventParamsConfigurator() {
            @Override
            public final void a(Map map) {
                PHPersonalInformationActivity.A1(baseContentView, map);
            }
        });
        ((ActivityPersonalInformationBinding) this.o).b.setEnabled(S0());
    }

    public void parseBirthday(String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        String[] split = str.split("-");
        if (split.length == 3) {
            this.D = split[0];
            this.E = split[1];
            this.C = split[2];
        }
    }

    public void preShowInstitutionTypePickView() {
        if (CollectionUtils.a(this.J)) {
            X0();
        } else {
            e2();
        }
    }

    public void preShowNumberOfCreditCardsSelectDialog() {
        if (CollectionUtils.a(this.M)) {
            X0();
        } else {
            c2();
        }
    }

    public void preShowPurposeOfLoanPickView() {
        if (CollectionUtils.a(this.L)) {
            X0();
        } else {
            d2();
        }
    }

    protected void s(@NonNull Bundle bundle) {
        super.s(bundle);
        bundle.putString("extra_auth_ab_type", this.p);
        bundle.putString("first_name", this.q);
        bundle.putString("last_name", this.r);
        bundle.putSerializable("gender", this.s);
        bundle.putString("year_of_birthday", this.C);
        bundle.putString("month_of_birthday", this.D);
        bundle.putString("day_of_birthday", this.E);
        bundle.putSerializable("identity_region", this.f140y);
        bundle.putSerializable("identity_city", this.f141z);
        bundle.putSerializable("identity_brgy", this.A);
        bundle.putSerializable("education", this.f135t);
        bundle.putSerializable("institution_type", this.f136u);
        bundle.putSerializable("marry_status", this.f137v);
        bundle.putSerializable("purpose_of_loan", this.f138w);
        bundle.putSerializable("number_of_credit_cards", this.f139x);
        bundle.putString("detailed_address", this.B);
        try {
            saveDataToLocal("first_name", this.q);
            saveDataToLocal("last_name", this.r);
            saveDataToLocal("detailed_address", this.B);
        } catch (Exception e) {
            CrashReporter.a(e);
        }
    }

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

    void showErrorToast(int i) {
        try {
            ToastCompat.e(this, getResources().getString(i));
        } catch (Resources.NotFoundException unused) {
        }
    }
}