what-the-bank/sources/com/scb/phone/view/fragment/ntb/ekyc/EkycFragment.java

332 lines
12 KiB
Java

package com.scb.phone.view.fragment.ntb.ekyc;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.ntb.ReviewInfoResultActivity;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.fragment.ntb.ekyc.EkycFragment;
import io.beid.beidk.BEIDConfigurationFactory;
import io.beid.beidk.PassportManager;
import io.beid.beidk.definitions.BeIDParams;
import io.beid.beidk.definitions.SCBHeader;
import io.beid.beidk.processor.FaceProcessor;
import java.net.URISyntaxException;
import java.security.Security;
import java.util.HashMap;
import java.util.List;
import o.C;
import o.C0997Th;
import o.C1176Xeu;
import o.C14309fql;
import o.C6811ccU;
import o.C6870cda;
import o.InterfaceC13391fZD;
import o.InterfaceC6658cZa;
import o.Pzh;
import o.QKH;
import o.SW;
import o.SY;
import o.cEC;
import o.fIY;
import o.fJC;
import o.gqX;
import o.guQ;
/* loaded from: classes5.dex */
public class EkycFragment extends Hilt_EkycFragment implements InterfaceC6658cZa {
@BindView
protected Button buttonNext;
private fIY.LWm c;
private QKH d = new QKH();
@InterfaceC13391fZD
public C6811ccU ekycPresenter;
@BindView
protected ImageView livenessCheckedIcon;
@BindView
protected ImageView livenessIcon;
@BindView
protected ImageView livenessIndicator;
@BindView
protected TextView livenessText;
@BindView
protected ImageView scanIdCheckedIcon;
@BindView
protected ImageView scanIdIcon;
@BindView
protected ImageView scanIdIndicator;
@BindView
protected TextView scanIdText;
@BindView
protected ImageView scanPassportCheckedIcon;
@BindView
protected ImageView scanPassportIcon;
@BindView
protected ImageView scanPassportIndicator;
@BindView
protected TextView scanPassportText;
protected int j() {
return R.string.ntb_pop_up_message_exit;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.ntb.ekyc.Hilt_EkycFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof fIY.LWm) {
this.c = (fIY.LWm) context;
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559632, viewGroup, false);
ButterKnife.c(this, inflate);
this.c.o();
Bundle arguments = getArguments();
String string = arguments != null ? arguments.getString(BeIDParams.BEID_TRANSACTION_ID) : "";
this.ekycPresenter.e((C6811ccU) this);
C6811ccU c6811ccU = this.ekycPresenter;
String string2 = getString(R.string.ekyc_next_button_text);
String string3 = getString(R.string.ekyc_submit_button_text);
c6811ccU.g = string2;
c6811ccU.k = string3;
C6811ccU c6811ccU2 = this.ekycPresenter;
c6811ccU2.n = string;
C1176Xeu c1176Xeu = c6811ccU2.c;
cEC h = c1176Xeu.a.h();
h.e = c1176Xeu.d.M();
c6811ccU2.i = h;
C6870cda c6870cda = new C6870cda(c6811ccU2);
if (c6811ccU2.f != 0) {
c6870cda.e(c6811ccU2.f);
}
this.d.d("feature", i());
QKH qkh = this.d;
if (getActivity() != null) {
qkh.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_landing");
}
return inflate;
}
public final void a(String str, cEC cec) {
try {
HashMap hashMap = new HashMap();
hashMap.put(BeIDParams.BEID_BASE_URL, cec.d);
hashMap.put(BeIDParams.BEID_TRANSACTION_ID, str);
hashMap.put(SCBHeader.SCB_REQ_HEADER_API_AUTH, cec.c);
hashMap.put(SCBHeader.SCB_REQ_HEADER_ACCEPT_LANGUAGE, cec.e);
hashMap.put(SCBHeader.SCB_REQ_HEADER_SESSION_ID, cec.b);
BEIDConfigurationFactory.Builder Builder = BEIDConfigurationFactory.Builder();
Builder.setBaseUrl(cec.d).setUseSSL(Boolean.valueOf(cec.j)).setSSLPublicKey(cec.a).setApiTimeOut(30000).setUserAgent(Pzh.e());
this.d.d("feature", i());
QKH qkh = this.d;
if (getActivity() != null) {
qkh.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_passport");
}
Security.insertProviderAt(new gqX(), 1);
PassportManager.startPassportScanner(getActivity(), 1, hashMap, Builder);
} catch (URISyntaxException e) {
guQ.e(e);
}
}
public final void d(String str, cEC cec) {
a(str, cec);
}
@Override // o.InterfaceC6658cZa
public final void c(C6811ccU.LWm lWm) {
String str;
this.scanIdText.setAlpha(lWm == C6811ccU.LWm.SCANNING_ID_STATE ? 1.0f : 0.4f);
this.scanPassportText.setAlpha(lWm == C6811ccU.LWm.SCANNING_PASSPORT_STATE ? 1.0f : 0.4f);
this.livenessText.setAlpha(lWm == C6811ccU.LWm.LIVENESS_CHECK_STATE ? 1.0f : 0.4f);
this.scanIdIcon.setAlpha(lWm == C6811ccU.LWm.SCANNING_ID_STATE ? 1.0f : 0.4f);
this.scanPassportIcon.setAlpha((lWm == C6811ccU.LWm.SCANNING_PASSPORT_STATE || lWm == C6811ccU.LWm.SCANNING_ID_STATE) ? 1.0f : 0.4f);
this.livenessIcon.setAlpha(lWm == C6811ccU.LWm.FINISHED_FLOW_STATE ? 0.4f : 1.0f);
ImageView imageView = this.scanIdIndicator;
C6811ccU.LWm lWm2 = C6811ccU.LWm.SCANNING_ID_STATE;
int i = R.drawable.circle_indicator_purple;
imageView.setImageResource(lWm == lWm2 ? R.drawable.circle_indicator_purple : R.drawable.shape_circle_white_purple_border);
this.scanPassportIndicator.setImageResource(lWm == C6811ccU.LWm.SCANNING_PASSPORT_STATE ? R.drawable.circle_indicator_purple : R.drawable.shape_circle_white_purple_border);
ImageView imageView2 = this.livenessIndicator;
if (lWm != C6811ccU.LWm.LIVENESS_CHECK_STATE) {
i = R.drawable.shape_circle_white_purple_border;
}
imageView2.setImageResource(i);
this.scanIdCheckedIcon.setVisibility(lWm != C6811ccU.LWm.SCANNING_ID_STATE ? 0 : 8);
this.scanPassportCheckedIcon.setVisibility((lWm == C6811ccU.LWm.SCANNING_PASSPORT_STATE || lWm == C6811ccU.LWm.SCANNING_ID_STATE) ? 8 : 0);
this.livenessCheckedIcon.setVisibility(lWm != C6811ccU.LWm.FINISHED_FLOW_STATE ? 8 : 0);
Button button = this.buttonNext;
if (lWm == C6811ccU.LWm.FINISHED_FLOW_STATE) {
str = this.ekycPresenter.k;
} else {
str = this.ekycPresenter.g;
}
button.setText(str);
}
@Override // o.InterfaceC6658cZa
public final void e() {
QKH qkh = new QKH();
qkh.e("ekyc");
qkh.d("feature", i());
if (getActivity() != null) {
qkh.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_verifysuccess");
}
this.c.k();
}
@Override // o.InterfaceC6658cZa
public final void d(String str, String str2, String str3, String str4, cEC cec, SW sw) {
try {
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put(SCBHeader.SCB_REQ_HEADER_API_AUTH, cec.c);
hashMap.put(SCBHeader.SCB_REQ_HEADER_ACCEPT_LANGUAGE, cec.e);
hashMap.put(SCBHeader.SCB_REQ_HEADER_SESSION_ID, cec.b);
List<Integer> list = sw.c;
int i = sw.b;
BEIDConfigurationFactory.Builder Builder = BEIDConfigurationFactory.Builder();
Builder.setBaseUrl(cec.d).setUseSSL(Boolean.valueOf(cec.j)).setSSLPublicKey(cec.a).setApiTimeOut(30000).setUserAgent(Pzh.e());
FaceProcessor.FaceProcessorParameterBuilder Builder2 = FaceProcessor.FaceProcessorParameter.Builder();
Builder2.setTransactionId(str4).setUrlServer(cec.d).setFirstName(str).setLastName(str2).setDateOfBirth(str3).setJpegQuality(80).setIsIncludeImage(Boolean.TRUE).setIsIncludeVoice(Boolean.FALSE).setLivenessActivities(list).setLivenessAcceptance(Integer.valueOf(i)).setParams(hashMap).setLanguage(cec.e).setConfig(Builder);
this.d.d("feature", i());
QKH qkh = this.d;
if (getActivity() != null) {
qkh.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_selfie");
}
FaceProcessor.startActivityForResult(getActivity(), Builder2);
} catch (URISyntaxException e) {
guQ.e(e);
}
}
@Override // o.InterfaceC6658cZa
public final void b() {
C0997Th c0997Th = new C0997Th();
c0997Th.h = R.drawable.ic_notice;
c0997Th.g = getString(R.string.ntb_ekyc_title);
c0997Th.f = getString(R.string.error_default_title);
c0997Th.c = getString(R.string.ekyc_user_exists_description);
c0997Th.d = getString(R.string.ekyc_register_scb_easy_app);
c0997Th.b = new fJC();
c0997Th.a = false;
startActivity(ReviewInfoResultActivity.ajz_(getContext(), c0997Th));
getActivity().finish();
}
@Override // o.InterfaceC6658cZa
public final void c() {
Intent intent = new Intent(getActivity(), (Class<?>) ReviewInfoResultActivity.class);
intent.putExtra("EXTRA_IMAGE_ID", R.drawable.ic_notice);
intent.putExtra("EXTRA_PAGE_TITLE", getString(R.string.ntb_ekyc_title));
intent.putExtra("EXTRA_TITLE", getString(R.string.error_default_title));
intent.putExtra("EXTRA_DESCRIPTION", getString(R.string.error_ekyc_passport_1004_text));
startActivity(intent);
getActivity().finish();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
if (i2 == -1 && i == 2) {
SY sy = (SY) intent.getParcelableExtra("idDisplay");
C6811ccU c6811ccU = this.ekycPresenter;
if (sy != null) {
c6811ccU.e = C6811ccU.LWm.SCANNING_PASSPORT_STATE;
C6870cda c6870cda = new C6870cda(c6811ccU);
if (c6811ccU.f != 0) {
c6870cda.e(c6811ccU.f);
}
}
}
}
public final void f() {
((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.ntb_pop_up_title_exit).d(j()), Integer.valueOf(R.string.cancel), new DialogInterface.OnClickListener() { // from class: o.fqk
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}})).aoT_(R.string.ok, new DialogInterface.OnClickListener(this) { // from class: o.fqj
private EkycFragment c;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
EkycFragment.awe_(this.c, dialogInterface);
}
{
this.c = this;
}
}).show();
}
@Override // androidx.fragment.app.Fragment
public void onResume() {
super.onResume();
this.ekycPresenter.a = true;
}
public static /* synthetic */ void awe_(EkycFragment ekycFragment, DialogInterface dialogInterface) {
dialogInterface.dismiss();
ekycFragment.getActivity().finish();
}
@OnClick
public void onNextButtonClick() {
this.ekycPresenter.b(C.DEFAULT);
}
public void d() {
if (getActivity() != null) {
if (BaseActivity.P()) {
C14309fql.a(this);
return;
}
}
C14309fql.e(this);
}
@Override // o.InterfaceC6658cZa
public final void b(String str, cEC cec) {
if (getActivity() != null) {
if (BaseActivity.P()) {
C14309fql.a(this, str, cec);
return;
}
}
C14309fql.c(this, str, cec);
}
protected String i() {
return "open_account";
}
}