what-the-bank/sources/io/beid/beidk/processor/FaceProcessor.java

495 lines
16 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package io.beid.beidk.processor;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import io.beid.beidk.BEIDConfigurationFactory;
import io.beid.beidk.activity.FaceCaptureActivity;
import io.beid.beidk.definitions.BeIDParams;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import o.fQP;
import org.xmlpull.v1.XmlPullParserException;
/* loaded from: classes5.dex */
public class FaceProcessor {
public static final Integer FACE_CAPTURE = 65281;
private FaceProcessorParameter b;
private Intent d;
private Activity e;
/* loaded from: classes5.dex */
public static final class BiometricOperation {
public static final String VERIFICATION = "VERIFICATION";
}
/* loaded from: classes5.dex */
public static final class LivenessActivity {
public static final Integer STRAIGHT = 0;
public static final Integer SMILE = 1;
public static final Integer BLINK = 2;
public static final Integer TILT_HEAD_LEFT = 3;
public static final Integer TILT_HEAD_RIGHT = 4;
public static final Integer CLOSE_LEFT_EYE = 5;
public static final Integer CLOSE_RIGHT_EYE = 6;
public static final Integer TURN_FACE_LEFT = 7;
public static final Integer TURN_FACE_RIGHT = 8;
}
public void startActivityForResult() {
if (this.b.getCertificate() != null) {
new FaceCaptureActivity();
this.b.getCertificate();
FaceCaptureActivity.a();
}
this.d = new Intent(this.e, (Class<?>) FaceCaptureActivity.class);
if (this.b.getConfig() != null) {
this.d.putExtra("_config", this.b.getConfig());
}
this.d.putExtra("ContinuousSuccess", this.b.getContinuousSuccess());
this.d.putExtra("SubjectID", this.b.getSubjectID());
this.d.putExtra("JPEGQuality", this.b.getJPEGQuality());
this.d.putExtra("Timer", this.b.getTimer());
this.d.putExtra("institution", this.b.getInstitution());
this.d.putExtra("workstation", this.b.getWorkstation());
this.d.putExtra("BiometricOperation", this.b.getBiometricOperation());
this.d.putExtra("isCaptureAutomatic", this.b.getCaptureAutomatic());
this.d.putExtra("getActionVideo", this.b.getGetActionVideo());
this.d.putExtra("getActionImage", this.b.getGetActionImage());
this.d.putExtra("isFace_Spoof_Detection", this.b.getFaceSpoofDetection());
this.d.putExtra("isIncludeImage", this.b.getIncludeImage());
this.d.putExtra("isIncludeVoice", this.b.getIncludeVoice());
this.d.putExtra("isFaceFirst", this.b.getFaceFirst());
this.d.putExtra("isKonyMobileFabric", this.b.getKonyMobileFabric());
this.d.putExtra("isCaptureOnly", this.b.getCaptureOnly());
this.d.putExtra("URLServer", this.b.getUrlServer());
this.d.putExtra("firstName", this.b.getFirstName());
this.d.putExtra("lastName", this.b.getLastName());
this.d.putExtra("middleName", this.b.getMiddleName());
this.d.putExtra("dob", this.b.getDateOfBirth());
this.d.putExtra(BeIDParams.BEID_TRANSACTION_ID, this.b.getTransactionId());
this.d.putExtra("params", this.b.getParams());
this.d.putExtra("language", this.b.getLanguage());
this.d.putExtra("livenessAcceptance", this.b.getLivenessAcceptance());
fQP.b().k.clear();
fQP.b().r.clear();
fQP.b().f9105o.clear();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
if (this.b.getLivenessActivities() != null) {
Iterator<Integer> it = this.b.getLivenessActivities().iterator();
while (it.hasNext()) {
byteArrayOutputStream.write(it.next().intValue());
}
}
this.d.putExtra("livenessActivityLength", byteArrayOutputStream.size());
this.d.putExtra("livenessActivity", byteArrayOutputStream.toByteArray());
this.e.startActivityForResult(this.d, FACE_CAPTURE.intValue());
}
/* loaded from: classes5.dex */
public static class FaceProcessorParameter {
private HashMap<String, String> B;
private String D;
private Integer a;
private String b;
private Integer c;
private String d;
private BEIDConfigurationFactory e;
private Boolean f;
private Boolean g;
private String h;
private String i;
private String j;
private Boolean k;
private Boolean l;
private Boolean m;
private Boolean n;
/* renamed from: o, reason: collision with root package name */
private Boolean f8093o;
private Integer p;
private List<Integer> q;
private Integer r;
private Boolean s;
private Boolean t;
private String u;
private String v;
private String w;
private String x;
private String y;
private InputStream z;
public String getWorkstation() {
return this.j;
}
public String getUrlServer() {
return this.u;
}
public String getTransactionId() {
return this.D;
}
public Integer getTimer() {
return this.a;
}
public String getSubjectID() {
return this.d;
}
public HashMap<String, String> getParams() {
return this.B;
}
public String getMiddleName() {
return this.w;
}
public List<Integer> getLivenessActivities() {
return this.q;
}
public Integer getLivenessAcceptance() {
return this.p;
}
public String getLastName() {
return this.x;
}
public String getLanguage() {
return this.b;
}
public Boolean getKonyMobileFabric() {
return this.t;
}
public Integer getJPEGQuality() {
return this.c;
}
public String getInstitution() {
return this.i;
}
public Boolean getIncludeVoice() {
return this.m;
}
public Boolean getIncludeImage() {
return this.f8093o;
}
public Boolean getGetActionVideo() {
return this.f;
}
public Boolean getGetActionImage() {
return this.l;
}
public String getFirstName() {
return this.v;
}
public Boolean getFaceSpoofDetection() {
return this.n;
}
public Boolean getFaceFirst() {
return this.s;
}
public String getDateOfBirth() {
return this.y;
}
public Integer getContinuousSuccess() {
return this.r;
}
public BEIDConfigurationFactory getConfig() {
return this.e;
}
public InputStream getCertificate() {
return this.z;
}
public Boolean getCaptureOnly() {
return this.k;
}
public Boolean getCaptureAutomatic() {
return this.g;
}
public String getBiometricOperation() {
return this.h;
}
public static FaceProcessorParameterBuilder Builder() {
return new FaceProcessorParameterBuilder();
}
/* synthetic */ FaceProcessorParameter(String str, String str2, String str3, String str4, String str5, String str6, Boolean bool, Boolean bool2, Boolean bool3, Boolean bool4, Boolean bool5, Boolean bool6, Boolean bool7, Boolean bool8, Boolean bool9, Integer num, String str7, List list, Integer num2, Integer num3, String str8, String str9, Integer num4, InputStream inputStream, String str10, HashMap hashMap, String str11, BEIDConfigurationFactory bEIDConfigurationFactory, byte b) {
this(str, str2, str3, str4, str5, str6, bool, bool2, bool3, bool4, bool5, bool6, bool7, bool8, bool9, num, str7, list, num2, num3, str8, str9, num4, inputStream, str10, hashMap, str11, bEIDConfigurationFactory);
}
private FaceProcessorParameter(String str, String str2, String str3, String str4, String str5, String str6, Boolean bool, Boolean bool2, Boolean bool3, Boolean bool4, Boolean bool5, Boolean bool6, Boolean bool7, Boolean bool8, Boolean bool9, Integer num, String str7, List<Integer> list, Integer num2, Integer num3, String str8, String str9, Integer num4, InputStream inputStream, String str10, HashMap<String, String> hashMap, String str11, BEIDConfigurationFactory bEIDConfigurationFactory) {
this.u = str;
this.v = str2;
this.x = str3;
this.w = str4;
this.y = str5;
this.d = str7;
this.c = num2;
this.a = num3;
this.i = str8;
this.j = str6;
this.h = str9;
this.g = bool;
this.f = bool2;
this.l = bool3;
this.n = bool4;
this.f8093o = bool5;
this.m = bool6;
this.k = bool7;
this.s = bool8;
this.t = bool9;
this.r = num;
this.q = list;
this.p = num4;
this.z = inputStream;
this.D = str10;
this.B = hashMap;
this.b = str11;
this.e = bEIDConfigurationFactory;
}
}
/* loaded from: classes5.dex */
public static class FaceProcessorParameterBuilder {
private Integer B;
private InputStream D;
private BEIDConfigurationFactory a;
private String b;
private String c;
private String e;
private String f;
private String g;
private String h;
private String i;
private HashMap<String, String> j;
private Boolean p;
private Boolean q;
private Boolean r;
private Boolean s;
private Boolean t;
private Boolean u;
private Boolean v;
private Boolean w;
private Integer x;
private Boolean y;
private List<Integer> z;
private String d = "http://api.beid.io";
private Integer n = 100;
private Integer m = 6;
private String l = "MB";
private String k = "TestPassportReader";
/* renamed from: o, reason: collision with root package name */
private String f8094o = BiometricOperation.VERIFICATION;
public FaceProcessorParameterBuilder setUrlServer(String str) {
this.d = str;
return this;
}
public FaceProcessorParameterBuilder setTransactionId(String str) {
this.h = str;
return this;
}
public FaceProcessorParameterBuilder setSubjectID(String str) {
this.i = str;
return this;
}
public FaceProcessorParameterBuilder setParams(HashMap<String, String> hashMap) {
this.j = hashMap;
return this;
}
public FaceProcessorParameterBuilder setMiddleName(String str) {
this.f = str;
return this;
}
public FaceProcessorParameterBuilder setLivenessActivities(List<Integer> list) {
this.z = list;
return this;
}
public FaceProcessorParameterBuilder setLivenessAcceptance(Integer num) {
this.B = num;
return this;
}
public FaceProcessorParameterBuilder setLastName(String str) {
this.c = str;
return this;
}
public FaceProcessorParameterBuilder setLanguage(String str) {
this.e = str;
return this;
}
public FaceProcessorParameterBuilder setJpegQuality(Integer num) {
this.n = num;
return this;
}
public FaceProcessorParameterBuilder setIsIncludeVoice(Boolean bool) {
this.w = bool;
return this;
}
public FaceProcessorParameterBuilder setIsIncludeImage(Boolean bool) {
this.t = bool;
return this;
}
public FaceProcessorParameterBuilder setFirstName(String str) {
this.b = str;
return this;
}
public FaceProcessorParameterBuilder setDateOfBirth(String str) {
this.g = str;
return this;
}
public FaceProcessorParameterBuilder setConfig(BEIDConfigurationFactory bEIDConfigurationFactory) {
this.a = bEIDConfigurationFactory;
return this;
}
public FaceProcessorParameterBuilder setConfig(BEIDConfigurationFactory.Builder builder) {
this.a = builder.Build();
return this;
}
public FaceProcessorParameter createFaceProcessorParameter() {
return new FaceProcessorParameter(this.d, this.b, this.c, this.f, this.g, this.k, this.s, this.q, this.p, this.r, this.t, this.w, this.y, this.v, this.u, this.x, this.i, this.z, this.n, this.m, this.l, this.f8094o, this.B, this.D, this.h, this.j, this.e, this.a, (byte) 0);
}
public FaceProcessorParameterBuilder() {
Boolean bool = Boolean.FALSE;
this.s = bool;
Boolean bool2 = Boolean.TRUE;
this.q = bool2;
this.p = bool2;
this.r = bool2;
this.t = bool2;
this.w = bool;
this.v = bool2;
this.y = bool;
this.u = bool;
this.x = 1;
this.z = new ArrayList();
this.B = 3;
}
}
/* loaded from: classes5.dex */
public static class FaceProcessorResult {
private ArrayList<byte[]> b;
private byte[] c;
private ArrayList<byte[]> e;
private String h;
private String i;
private Boolean d = Boolean.FALSE;
private String a = "";
public Boolean getSuccess() {
return this.d;
}
public String getResponseStatus() {
return this.a;
}
public byte[] getImageCapture() {
return this.c;
}
public String getErrorText() {
return this.i;
}
public String getErrorCode() {
return this.h;
}
public ArrayList<byte[]> getActionVideos() {
return this.b;
}
public ArrayList<byte[]> getActionImages() {
return this.e;
}
public static FaceProcessorResult parse(Intent intent) throws IOException, XmlPullParserException {
Bundle extras = intent.getExtras();
FaceProcessorResult faceProcessorResult = new FaceProcessorResult();
faceProcessorResult.e = new ArrayList<>();
int i = 0;
while (true) {
byte[] byteArray = extras.getByteArray("livenessImage_".concat(String.valueOf(i)));
if (byteArray == null) {
break;
}
faceProcessorResult.e.add(byteArray);
i++;
}
faceProcessorResult.c = extras.getByteArray("imageCapture");
if (extras != null) {
faceProcessorResult.a = extras.getString("responseStatus");
faceProcessorResult.h = extras.getString("errorCode");
faceProcessorResult.i = extras.getString("errorText");
}
return faceProcessorResult;
}
private FaceProcessorResult() {
}
}
public static void startActivityForResult(Activity activity, FaceProcessorParameterBuilder faceProcessorParameterBuilder) {
new FaceProcessor(activity, faceProcessorParameterBuilder).startActivityForResult();
}
public static void startActivityForResult(Activity activity, FaceProcessorParameter faceProcessorParameter) {
new FaceProcessor(activity, faceProcessorParameter).startActivityForResult();
}
public FaceProcessor(Activity activity, FaceProcessorParameterBuilder faceProcessorParameterBuilder) {
this(activity, faceProcessorParameterBuilder.createFaceProcessorParameter());
}
public FaceProcessor(Activity activity, FaceProcessorParameter faceProcessorParameter) {
this.e = activity;
this.b = faceProcessorParameter;
}
}