正在查看: Mabilis Cash v1.19.4 应用的 PHIDInformationOCRActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mabilis Cash v1.19.4 应用的 PHIDInformationOCRActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.loans.mabiliscash.auth.idcard;
import android.app.Activity;
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.generalconfig.GeneralConfigManager;
import com.fintopia.libCommon.widgets.input.BaseContentView;
import com.fintopia.libCommon.widgets.input.InputContentView;
import com.lingyue.supertoolkit.statistics.EventParamsConfigurator;
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.widgets.ToastCompat;
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.appconfig.AppSwitchConfigKey;
import com.loans.mabiliscash.auth.IAuthProcessTracker;
import com.loans.mabiliscash.auth.helper.AuthUtils;
import com.loans.mabiliscash.auth.helper.QuitAuthHelper;
import com.loans.mabiliscash.auth.idcard.PHIDInformationOCRActivity;
import com.loans.mabiliscash.auth.idcard.adapters.UploadImageTipsAdapter;
import com.loans.mabiliscash.auth.idcard.dialog.IDCardTypeBottomDialog;
import com.loans.mabiliscash.auth.idcard.dialog.PHIdInformationQuitDialog;
import com.loans.mabiliscash.auth.idcard.dialog.PHIdInformationSkipDialog;
import com.loans.mabiliscash.auth.idcard.scanv2.PHIdCardScanOCRV2Activity;
import com.loans.mabiliscash.common.BindClickCall;
import com.loans.mabiliscash.databinding.ActivityIdInformationOcrBinding;
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.sensorsdata.analytics.android.sdk.data.adapter.DbParams;
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 org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
public class PHIDInformationOCRActivity extends PHIDInformationBaseActivity<ActivityIdInformationOcrBinding> implements BaseContentView.OnContentChangedListener, ISentryBusinessEventAutoFinish, IMMKVPageController {
private String f96u;
private String f97v;
private ArrayList<DocumentsType> f98w = new ArrayList<>();
private UploadImageTipsAdapter f99x;
class AnonymousClass3 implements IDCardTypeBottomDialog.OnDialogCloseListener {
AnonymousClass3() {
}
public static void b(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.c372.click.auth_b47_c372_click");
map.put("button_name", "关闭");
}
@Override
public void onClose() {
ThirdPartTrackLib.d(PHIDInformationOCRActivity.this, "auth_b47_c372_click", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.AnonymousClass3.b(map);
}
});
}
}
class AnonymousClass4 extends ECObserver<UploadIdentityInfoResponse> {
AnonymousClass4(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(PHIDInformationOCRActivity.this, "auth_kyc_document_result", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.AnonymousClass4.h(UploadIdentityInfoResponse.this, map);
}
});
IAuthProcessTracker.c(PHIDInformationOCRActivity.this, "提交证件", false, th != null ? th.getMessage() : uploadIdentityInfoResponse != null ? uploadIdentityInfoResponse.getStatusCodeString() : "");
PHIDInformationOCRActivity.this.businessTransaction("UserAuthOrder").b(SpanStatus.INTERNAL_ERROR);
PHIDInformationOCRActivity.this.dismissLoadingDialog();
}
@Override
public void c(UploadIdentityInfoResponse uploadIdentityInfoResponse) {
MMKVUtil.c(PHIDInformationOCRActivity.this.getMMKVPagePrefix());
ThirdPartTrackLib.d(PHIDInformationOCRActivity.this, "auth_kyc_document_result", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.AnonymousClass4.i(map);
}
});
IAuthProcessTracker.b(PHIDInformationOCRActivity.this, "提交证件", true);
PHIDInformationOCRActivity.this.businessTransaction("UserAuthOrder").i(SpanStatus.OK);
PHIDInformationOCRActivity.this.B1();
}
}
public void A1(DocumentsTypeListResponse documentsTypeListResponse) {
this.f98w = documentsTypeListResponse.body.documentTypeVOList;
}
public void B1() {
this.authUtil.h(this, new AuthUtils.DefaultAuthCallBack(this));
}
private void C1() {
DocumentsType documentsType = this.f95t;
if (documentsType != null) {
x1(documentsType);
}
i0(((ActivityIdInformationOcrBinding) this.o).g, this.f97v);
if (TextUtils.isEmpty(this.f97v)) {
return;
}
ComponentExtensionsKt.o(((ActivityIdInformationOcrBinding) this.o).g, 0, new Function0() {
public final Object invoke() {
Unit p1;
p1 = PHIDInformationOCRActivity.this.p1();
return p1;
}
});
}
private void D1(final boolean z2) {
this.apiHelper.a().k0().w(AndroidSchedulers.a()).K(Schedulers.b()).j(new Action() {
public final void run() {
PHIDInformationOCRActivity.this.r1(z2);
}
}).a(new ECObserver<DocumentsTypeListResponse>(this) {
@Override
public void e(Throwable th, DocumentsTypeListResponse documentsTypeListResponse) {
super.e(th, documentsTypeListResponse);
PHIDInformationOCRActivity.this.dismissLoadingDialog();
PHIDInformationOCRActivity.this.Q();
if (z2) {
PHIDInformationOCRActivity.this.finish();
}
}
@Override
public void c(DocumentsTypeListResponse documentsTypeListResponse) {
PHIDInformationOCRActivity.this.dismissLoadingDialog();
PHIDInformationOCRActivity.this.A1(documentsTypeListResponse);
PHIDInformationOCRActivity.this.Q();
}
});
}
private void E1(@NonNull DocumentsType documentsType) {
showLoadingDialog();
HashMap hashMap = new HashMap();
hashMap.put("idNo", this.f97v);
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 AnonymousClass4(this));
}
private void F1() {
?? 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) {
?? r1 = PHIDInformationOCRActivity.this;
r1.saveDataToLocal(PHIDInformationBaseActivity.DOCUMENTS_TYPE, r1.gson.t(obj));
PHIDInformationOCRActivity.this.x1((DocumentsType) obj);
}
AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, obj);
}
}, new AnonymousClass3());
iDCardTypeBottomDialog.v(this.f98w);
iDCardTypeBottomDialog.show();
}
private void G1(@NonNull OCRResponse.Body body) {
if (TextUtils.isEmpty(body.idNo)) {
((ActivityIdInformationOcrBinding) this.o).getRoot().postDelayed(new Runnable() {
@Override
public final void run() {
PHIDInformationOCRActivity.this.s1();
}
}, 500L);
return;
}
if (this.f95t != null) {
String replaceAll = body.idNo.replaceAll("\\s", "");
boolean isIdNumberFormatDocumentType = DocumentsType.isIdNumberFormatDocumentType(replaceAll, this.f95t);
if (this.f95t.pureNumber) {
this.f97v = replaceAll.replaceAll("[^0-9 ]", "");
} else {
this.f97v = replaceAll;
}
i0(((ActivityIdInformationOcrBinding) this.o).g, this.f97v);
ThirdPartTrackLib.d(this, "auth_id_ocr_identity_idnumber_auto_input_result", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.t1(map);
}
});
if (isIdNumberFormatDocumentType) {
return;
}
((ActivityIdInformationOcrBinding) this.o).getRoot().postDelayed(new Runnable() {
@Override
public final void run() {
PHIDInformationOCRActivity.this.u1();
}
}, 500L);
}
}
private void H1(final List<String> list) {
if (CollectionUtils.a(list)) {
((ActivityIdInformationOcrBinding) this.o).f.getRoot().setVisibility(8);
return;
}
TrackingUtil.r(this, null, "auth_b47_d195_exposure", new EventParamsConfigurator() {
@Override
public final void a(JSONObject jSONObject) {
PHIDInformationOCRActivity.v1(list, jSONObject);
}
});
((ActivityIdInformationOcrBinding) this.o).f.getRoot().setVisibility(0);
UploadImageTipsAdapter uploadImageTipsAdapter = this.f99x;
if (uploadImageTipsAdapter == null) {
this.f99x = new UploadImageTipsAdapter(this, list);
} else {
uploadImageTipsAdapter.g(list);
}
((ActivityIdInformationOcrBinding) this.o).f.c.setAdapter(this.f99x);
((ActivityIdInformationOcrBinding) this.o).f.c.setLayoutManager(new LinearLayoutManager(this));
}
private void I1(final String str) {
ThirdPartTrackLib.d(this, "auth_b47_d93_click", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.w1(str, map);
}
});
}
private void J1() {
DocumentsType documentsType = this.f95t;
if (documentsType != null) {
((ActivityIdInformationOcrBinding) this.o).e.a(documentsType.frontUrl);
((ActivityIdInformationOcrBinding) this.o).d.a(this.f95t.backUrl);
}
}
private void K1(boolean z2) {
if (z2) {
((ActivityIdInformationOcrBinding) this.o).g.setContentText("");
this.f97v = "";
this.p = null;
this.r = null;
this.q = null;
this.s = null;
((ActivityIdInformationOcrBinding) this.o).e.c();
((ActivityIdInformationOcrBinding) this.o).d.c();
((ActivityIdInformationOcrBinding) this.o).f.getRoot().setVisibility(8);
J1();
}
}
private void Q0(@NonNull DocumentsType documentsType) {
IDCardTypeHelper.a(documentsType, ((ActivityIdInformationOcrBinding) this.o).g);
((ActivityIdInformationOcrBinding) this.o).g.setInputType(documentsType.pureNumber ? 2 : 1);
((ActivityIdInformationOcrBinding) this.o).g.setFilters(new InputFilter[]{new InputFilter.LengthFilter(documentsType.idLengthWithBlank)});
((ActivityIdInformationOcrBinding) this.o).d.setVisibility(documentsType.needBackCardPhoto ? 0 : 4);
ThirdPartTrackLib.d(this, "auth_b47_d93_exposure", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.Y0(map);
}
});
if (documentsType.needBackCardPhoto) {
ThirdPartTrackLib.d(this, "auth_b47_d93_exposure", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.Z0(map);
}
});
}
((ActivityIdInformationOcrBinding) this.o).m.setVisibility(0);
((ActivityIdInformationOcrBinding) this.o).c.setVisibility(0);
int visibility = ((ActivityIdInformationOcrBinding) this.o).k.getVisibility();
((ActivityIdInformationOcrBinding) this.o).k.setVisibility(0);
if (visibility != 0) {
TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_SKIP_ENTRY_SHOW, a0().b());
}
}
private void S0() {
((ActivityIdInformationOcrBinding) this.o).b.setEnabled(this.f95t != null);
}
private void T0(boolean z2, @Nullable String str, @NotNull OCRResponse.Body body) {
if (z2) {
this.r = str;
this.p = body.imageKey;
H1(body.prompts);
} else {
this.s = str;
this.q = body.imageKey;
}
j0(z2, str);
if (z2) {
G1(body);
}
ComponentExtensionsKt.o(((ActivityIdInformationOcrBinding) this.o).g, 0, new Function0() {
public final Object invoke() {
Unit b1;
b1 = PHIDInformationOCRActivity.this.b1();
return b1;
}
});
S0();
}
public Unit U0(String str) {
ComponentExtensionsKt.o(((ActivityIdInformationOcrBinding) this.o).g, 0, new Function0() {
public final Object invoke() {
Unit d1;
d1 = PHIDInformationOCRActivity.this.d1();
return d1;
}
});
((ActivityIdInformationOcrBinding) this.o).g.setContentText(str);
return Unit.a;
}
private void V0() {
int i = ("C".equals(this.f96u) || "D".equals(this.f96u)) ? R.drawable.ico_auth_step_two : R.drawable.ic_auth_id_info;
AuthUtils authUtils = this.authUtil;
T t2 = this.o;
authUtils.q(this, ((ActivityIdInformationOcrBinding) t2).h, i, ((ActivityIdInformationOcrBinding) t2).i.d, ((ActivityIdInformationOcrBinding) t2).i.c);
}
private void W0() {
((ActivityIdInformationOcrBinding) this.o).g.setOnContentChangedListener(this);
((ActivityIdInformationOcrBinding) this.o).l.setOnContentChangedListener(this);
}
private void X0() {
V(((ActivityIdInformationOcrBinding) this.o).l, new BindClickCall() {
@Override
public final void onClick(View view) {
PHIDInformationOCRActivity.this.f1(view);
}
});
V(((ActivityIdInformationOcrBinding) this.o).e, new BindClickCall() {
@Override
public final void onClick(View view) {
PHIDInformationOCRActivity.this.h1(view);
}
});
V(((ActivityIdInformationOcrBinding) this.o).d, new BindClickCall() {
@Override
public final void onClick(View view) {
PHIDInformationOCRActivity.this.j1(view);
}
});
V(((ActivityIdInformationOcrBinding) this.o).b, new BindClickCall() {
@Override
public final void onClick(View view) {
PHIDInformationOCRActivity.this.k1(view);
}
});
V(((ActivityIdInformationOcrBinding) this.o).k, new BindClickCall() {
@Override
public final void onClick(View view) {
PHIDInformationOCRActivity.this.l1(view);
}
});
((ActivityIdInformationOcrBinding) this.o).g.setOnFocusChangedListener(new InputContentView.OnFocusChangedListener() {
public final void a(boolean z2) {
PHIDInformationOCRActivity.this.n1(z2);
}
});
}
public static void Y0(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d93.exposure.auth_b47_d93_exposure");
map.put("number", DbParams.GZIP_DATA_EVENT);
}
public static void Z0(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d93.exposure.auth_b47_d93_exposure");
map.put("number", "2");
}
public static void a1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d327.exposure.auth_b47_d327_exposure");
}
public Unit b1() {
ThirdPartTrackLib.d(this, "auth_b47_d327_exposure", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.a1(map);
}
});
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) {
PHIDInformationOCRActivity.c1(map);
}
});
return Unit.a;
}
public void e1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d326.click.auth_b47_d326_click");
DocumentsType documentsType = this.f95t;
map.put("type", documentsType != null ? documentsType.label : "");
}
public void f1(View view) {
TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_ID_TYPE_PICK, a0().b());
ThirdPartTrackLib.d(this, "auth_b47_d326_click", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.this.e1(map);
}
});
y1();
I1("svIdType");
}
public static void g1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d93.click.auth_b47_d93_click");
map.put("button_name", "cardSelectFront");
map.put("number", DbParams.GZIP_DATA_EVENT);
}
public void h1(View view) {
ThirdPartTrackLib.d(this, "auth_b47_d93_click", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.g1(map);
}
});
if (this.f95t == null) {
ToastCompat.g(this, getString(R.string.no_select_id_type_alert));
} else {
TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_UPLOAD_IMAGE_CLICK, a0().c("isFront").b(true).b());
k0(true);
}
I1("cardSelectFront");
}
public static void i1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d93.click.auth_b47_d93_click");
map.put("button_name", "cardSelectBack");
map.put("number", "2");
}
public void j1(View view) {
ThirdPartTrackLib.d(this, "auth_b47_d93_click", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.i1(map);
}
});
if (this.f95t == null) {
ToastCompat.g(this, getString(R.string.no_select_id_type_alert));
} else {
TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_UPLOAD_IMAGE_CLICK, a0().c("isFront").b(false).b());
k0(false);
}
I1("cardSelectBack");
}
public void k1(View view) {
TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_NEXT_CLICK, a0().c("idNumber").a(this.f97v).c("photoUploadCount").a(b0()).c("mergeStrategyABType").a(this.f96u).b());
z1();
}
public void l1(View view) {
JsonParamsBuilder jsonParamsBuilder = new JsonParamsBuilder();
if (this.f95t != null) {
jsonParamsBuilder.c("idType").a(this.f95t.value);
}
jsonParamsBuilder.c("idNumber").a(this.f97v);
jsonParamsBuilder.c("haveFrontIdCard").b(this.p != null);
jsonParamsBuilder.c("haveBackIdCard").b(this.q != null);
TrackingUtil.j(this, TrackingEvents.PH_SKIP_ID_CARD_OCR_CLICK, jsonParamsBuilder.b());
TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_SKIP_ENTRY_CLICK, a0().c("idNumber").a(this.f97v).c("photoUploadCount").a(b0()).b());
if (this.f95t != null) {
new PHIdInformationSkipDialog(this, this.f95t, this.f97v, this.p, this.q, "skip", new e4(this)).show();
}
}
public static void m1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d327.click.auth_b47_d327_click");
}
public void n1(boolean z2) {
if (z2) {
I1("evIdNumber");
ThirdPartTrackLib.d(this, "auth_b47_d327_click", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.m1(map);
}
});
}
}
public static void o1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d327.input.auth_b47_d327_input");
}
public Unit p1() {
ThirdPartTrackLib.d(this, "auth_b47_d327_exposure", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.q1(map);
}
});
return Unit.a;
}
public static void q1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.b47.d327.exposure.auth_b47_d327_exposure");
}
public void r1(boolean z2) throws Exception {
if (z2) {
return;
}
readLocalStorage();
}
private void readLocalStorage() {
try {
DocumentsType documentsType = (DocumentsType) this.gson.k(MMKVUtil.b(getMMKVKey(PHIDInformationBaseActivity.DOCUMENTS_TYPE), ""), DocumentsType.class);
if (documentsType != null) {
x1(documentsType);
}
} catch (Throwable th) {
CrashReporter.a(th);
}
}
public void s1() {
((ActivityIdInformationOcrBinding) this.o).g.A();
}
public static void start(Activity activity, String str) {
Intent intent = new Intent(activity, (Class<?>) PHIDInformationOCRActivity.class);
intent.putExtra("extra_auth_ab_type", str);
activity.startActivity(intent);
}
public static void t1(Map map) {
map.put("requirement_id", 18);
map.put("track_sign", "aauth.result.auth_id_ocr_identity_idnumber_auto_input_result.540");
}
public void u1() {
((ActivityIdInformationOcrBinding) this.o).g.A();
}
public static void v1(List list, JSONObject jSONObject) throws Exception {
jSONObject.put("requirement_id", 8);
jSONObject.put("track_sign", "aauth.b47.d195.exposure.auth_b47_d195_exposure");
jSONObject.put("tips_content", d4.a(",", list));
}
public static void w1(String str, Map map) {
map.put("requirement_id", 9);
map.put("track_sign", "aauth.b47.d93.click.auth_b47_d93_click");
map.put("button_name", str);
}
public void x1(@NonNull DocumentsType documentsType) {
DocumentsType documentsType2 = this.f95t;
boolean z2 = documentsType2 == null || !documentsType2.value.equals(documentsType.value);
Iterator<DocumentsType> it = this.f98w.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
DocumentsType next = it.next();
if (documentsType.value.equals(next.value)) {
this.f95t = next;
break;
}
}
K1(z2);
Q0(this.f95t);
((ActivityIdInformationOcrBinding) this.o).l.setContentText(documentsType.label);
}
private void y1() {
if (CollectionUtils.a(this.f98w)) {
D1(true);
} else {
F1();
}
}
private void z1() {
DocumentsType documentsType = this.f95t;
if (documentsType == null) {
showErrorToast(R.string.please_select_documents_type);
} else if (Y()) {
E1(documentsType);
} else {
new PHIdInformationSkipDialog(this, documentsType, this.f97v, this.p, this.q, "next", new e4(this)).show();
}
}
@Override
public ActivityIdInformationOcrBinding bindingInflater() {
return ActivityIdInformationOcrBinding.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(final boolean z2) {
new GeneralConfigManager().c(this, new GeneralConfigManager.FetchGeneralConfigCallback() {
public void a(@NotNull HashMap<String, String> hashMap) {
boolean z3;
int i;
int i2;
try {
z3 = Boolean.parseBoolean(hashMap.get(AppSwitchConfigKey.PHI_PHOTO_METHOD_AB));
} catch (Exception unused) {
z3 = false;
}
if (z3) {
BaseContentView.OnContentChangedListener onContentChangedListener = PHIDInformationOCRActivity.this;
boolean z4 = z2;
i = z4 ? 10030 : 10031;
i2 = z4 ? 1 : 11;
DocumentsType documentsType = onContentChangedListener.f95t;
PHIdCardScanOCRV2Activity.startForResult(onContentChangedListener, i, i2, documentsType != null ? documentsType.value : "");
return;
}
BaseContentView.OnContentChangedListener onContentChangedListener2 = PHIDInformationOCRActivity.this;
boolean z5 = z2;
i = z5 ? 10030 : 10031;
i2 = z5 ? 1 : 11;
DocumentsType documentsType2 = onContentChangedListener2.f95t;
PHIdCardScanOCRActivity.startForResult(onContentChangedListener2, i, i2, documentsType2 != null ? documentsType2.value : "");
}
public void onError(@Nullable String str) {
BaseContentView.OnContentChangedListener onContentChangedListener = PHIDInformationOCRActivity.this;
boolean z3 = z2;
int i = z3 ? 10030 : 10031;
int i2 = z3 ? 1 : 11;
DocumentsType documentsType = onContentChangedListener.f95t;
PHIdCardScanOCRActivity.startForResult(onContentChangedListener, i, i2, documentsType != null ? documentsType.value : "");
}
public void onFinish() {
}
}, new String[]{AppSwitchConfigKey.PHI_PHOTO_METHOD_AB});
}
protected void j() {
super.j();
showLoadingDialog();
D1(false);
}
@Override
protected void j0(boolean z2, @Nullable String str) {
S0();
(z2 ? ((ActivityIdInformationOcrBinding) this.o).e : ((ActivityIdInformationOcrBinding) this.o).d).b(str);
}
@Override
protected void k(@NonNull Bundle bundle) {
super.k(bundle);
this.f97v = bundle.getString("id_card_number");
this.f96u = getIntent().getStringExtra("extra_auth_ab_type");
}
@Override
protected void o() {
super.o();
W0();
V0();
c0(((ActivityIdInformationOcrBinding) this.o).g);
C1();
X0();
J1();
((ActivityIdInformationOcrBinding) this.o).m.setText(R.string.certificate_photo_optional);
}
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;
}
T0(true, intent.getStringExtra(PHBaseIdCardScanActivity.FILE_PATH), body2);
return;
}
if (i != 10031 || (body = (OCRResponse.Body) intent.getSerializableExtra(PHIdCardScanOCRActivity.OCR_RESULT)) == null) {
return;
}
T0(false, intent.getStringExtra(PHBaseIdCardScanActivity.FILE_PATH), body);
}
@Override
public void onBackPressed() {
if (this.f95t == null) {
QuitAuthHelper.o(this);
} else {
new PHIdInformationQuitDialog(this, this.f95t, this.f97v, this.p, this.q, new e4(this)).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.f96u).b());
}
public void onEditContentChanged(BaseContentView baseContentView) {
if (baseContentView.getId() == 2131362079) {
this.f97v = ((ActivityIdInformationOcrBinding) this.o).g.getContent();
TrackingUtil.j(this, TrackingEvents.PH_ID_INFORMATION_ID_NUMBER_CHANGE, a0().b());
ThirdPartTrackLib.d(this, "auth_b47_d327_input", new TrackEventParamsConfigurator() {
@Override
public final void a(Map map) {
PHIDInformationOCRActivity.o1(map);
}
});
}
S0();
}
@Override
protected void s(@NonNull Bundle bundle) {
super.s(bundle);
bundle.putString("id_card_number", this.f97v);
bundle.putString("extra_auth_ab_type", this.f96u);
}
public void saveDataToLocal(@NotNull String str, @Nullable String str2) {
IMMKVPageController.DefaultImpls.b(this, str, str2);
}
}