what-the-bank/sources/com/facetec/sdk/FaceTecSDK.java

303 lines
12 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.facetec.sdk;
import android.content.Context;
import java.util.Map;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class FaceTecSDK {
public static final String EXTRA_ID_SCAN_RESULTS = "facetecsdk.signup.idScanResult";
public static final String EXTRA_SESSION_RESULTS = "facetecsdk.signup.sessionResult";
public static final int REQUEST_CODE_SESSION = 1002;
private static final boolean isMinimalLibrary = bf.a();
static FaceTecCustomization c = new FaceTecCustomization();
static FaceTecCustomization b = null;
static FaceTecCustomization a = null;
static e d = e.NORMAL;
protected static int e = 0;
protected static int h = 0;
protected static int i = 0;
/* loaded from: classes.dex */
public static abstract class InitializeCallback {
public abstract void onCompletion(boolean z);
}
/* loaded from: classes.dex */
enum e {
NORMAL,
LOW_LIGHT,
LOW_LIGHT_FROM_SENSOR,
BRIGHT_LIGHT
}
/* loaded from: classes.dex */
public enum CameraPermissionStatus {
GRANTED("Authorized"),
NOT_YET_REQUESTED("Not Yet Requested"),
DENIED("Denied");
private final String d;
CameraPermissionStatus(String str) {
this.d = str;
}
@Override // java.lang.Enum
public final String toString() {
return this.d;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static boolean c() {
return (d == e.LOW_LIGHT || d == e.LOW_LIGHT_FROM_SENSOR) && b != null;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static boolean e() {
return d == e.BRIGHT_LIGHT && a != null;
}
private FaceTecSDK() {
}
public static void initializeInDevelopmentMode(Context context, String str, String str2, InitializeCallback initializeCallback) {
bf.a(context, str, str2, initializeCallback);
}
public static void initializeInProductionMode(Context context, String str, String str2, String str3, InitializeCallback initializeCallback) {
bf.d(context, str, str2, str3, initializeCallback);
}
public static void setCustomization(FaceTecCustomization faceTecCustomization) {
if (faceTecCustomization != null) {
for (int i2 = 0; i2 < de.b.length(); i2++) {
try {
JSONObject jSONObject = de.b.getJSONObject(i2);
String string = jSONObject.getString("overrideKey");
dc dcVar = (dc) jSONObject.get("type");
if (faceTecCustomization.p.get(string) != null && faceTecCustomization.p.get(string).equals(jSONObject.getString("overrideValue"))) {
int i3 = AnonymousClass3.d[dcVar.ordinal()];
if (i3 == 1) {
faceTecCustomization.a = true;
} else if (i3 == 2) {
faceTecCustomization.b = false;
} else if (i3 == 3) {
faceTecCustomization.c = true;
} else if (i3 == 4) {
faceTecCustomization.d = true;
} else if (i3 == 5) {
faceTecCustomization.e = true;
de.b(dcVar);
}
}
} catch (Exception unused) {
}
}
if (!d(faceTecCustomization.f.buttonBorderWidth)) {
faceTecCustomization.f.buttonBorderWidth = -1;
}
if (!d(faceTecCustomization.h.buttonBorderWidth)) {
faceTecCustomization.h.buttonBorderWidth = -1;
}
if (!d(faceTecCustomization.l.borderWidth)) {
faceTecCustomization.l.borderWidth = -1;
}
if (!d(faceTecCustomization.h.captureScreenTextBackgroundBorderWidth)) {
faceTecCustomization.h.captureScreenTextBackgroundBorderWidth = -1;
}
if (!d(faceTecCustomization.h.reviewScreenTextBackgroundBorderWidth)) {
faceTecCustomization.h.reviewScreenTextBackgroundBorderWidth = -1;
}
if (!d(faceTecCustomization.f.retryScreenImageBorderWidth)) {
faceTecCustomization.f.retryScreenImageBorderWidth = -1;
}
if (!d(faceTecCustomization.i.mainHeaderDividerLineWidth)) {
faceTecCustomization.i.mainHeaderDividerLineWidth = -1;
}
if (!d(faceTecCustomization.i.inputFieldBorderWidth)) {
faceTecCustomization.i.inputFieldBorderWidth = -1;
}
if (!c(faceTecCustomization.l.cornerRadius)) {
faceTecCustomization.l.cornerRadius = -1;
}
if (!b(faceTecCustomization.f6400o.cornerRadius)) {
faceTecCustomization.f6400o.cornerRadius = -1;
}
if (!b(faceTecCustomization.f.buttonCornerRadius)) {
faceTecCustomization.f.buttonCornerRadius = -1;
}
if (!b(faceTecCustomization.h.buttonCornerRadius)) {
faceTecCustomization.h.buttonCornerRadius = -1;
}
if (!b(faceTecCustomization.h.captureScreenTextBackgroundCornerRadius)) {
faceTecCustomization.h.captureScreenTextBackgroundCornerRadius = -1;
}
if (!b(faceTecCustomization.h.reviewScreenTextBackgroundCornerRadius)) {
faceTecCustomization.h.reviewScreenTextBackgroundCornerRadius = -1;
}
if (!b(faceTecCustomization.f.readyScreenTextBackgroundCornerRadius)) {
faceTecCustomization.f.readyScreenTextBackgroundCornerRadius = -1;
}
if (!b(faceTecCustomization.f.retryScreenImageCornerRadius)) {
faceTecCustomization.f.retryScreenImageCornerRadius = -1;
}
if (!b(faceTecCustomization.i.inputFieldCornerRadius)) {
faceTecCustomization.i.inputFieldCornerRadius = -1;
}
if (!a(faceTecCustomization.n.strokeWidth)) {
faceTecCustomization.n.strokeWidth = -1;
}
if (!a(faceTecCustomization.n.progressStrokeWidth)) {
faceTecCustomization.n.progressStrokeWidth = -1;
}
if (!e(faceTecCustomization.n.progressRadialOffset)) {
faceTecCustomization.n.progressRadialOffset = -1;
}
if (faceTecCustomization.f.retryScreenHeaderAttributedString != null && !faceTecCustomization.f.retryScreenHeaderAttributedString.isEmpty()) {
db.j(true);
}
if (faceTecCustomization.f.retryScreenSubtextAttributedString != null && !faceTecCustomization.f.retryScreenSubtextAttributedString.isEmpty()) {
db.i(true);
}
if (faceTecCustomization.f.readyScreenHeaderAttributedString != null && !faceTecCustomization.f.readyScreenHeaderAttributedString.isEmpty()) {
db.h(true);
}
if (faceTecCustomization.f.readyScreenSubtextAttributedString != null && !faceTecCustomization.f.readyScreenSubtextAttributedString.isEmpty()) {
db.f(true);
}
ba.a();
c = faceTecCustomization;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: com.facetec.sdk.FaceTecSDK$3, reason: invalid class name */
/* loaded from: classes.dex */
public static final /* synthetic */ class AnonymousClass3 {
static final int[] d;
static {
int[] iArr = new int[dc.values().length];
d = iArr;
try {
iArr[dc.CLICKABLE_READY_SCREEN_SUBTEXT.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
d[dc.DEV_MODE_TAG.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
d[dc.UNCONSTRAINED_GUIDANCE_STRING_LENGTHS.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
d[dc.STANDALONE_IDSCAN_WATERMARK_CUSTOMIZATION.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
d[dc.ENABLE_SCREEN_CAPTURING.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
private static boolean d(int i2) {
boolean z = (i2 >= 0 && i2 <= 20) || i2 == -1;
if (!z) {
ao.e("An error occurred while setting FaceTecCustomization due to a border width value set outside allowed range. Reverting border width value to default.");
}
return z;
}
private static boolean c(int i2) {
boolean z = (i2 >= 0 && i2 <= 30) || i2 == -1;
if (!z) {
ao.e("An error occurred while setting FaceTecCustomization due to a corner radius value set outside allowed range. Reverting corner radius value to default.");
}
return z;
}
private static boolean b(int i2) {
boolean z = (i2 >= 0 && i2 <= 40) || i2 == -1;
if (!z) {
ao.e("An error occurred while setting FaceTecCustomization due to a corner radius value set outside allowed range. Reverting corner radius value to default.");
}
return z;
}
private static boolean a(int i2) {
boolean z = (i2 >= 2 && i2 <= 20) || i2 == -1;
if (!z) {
ao.e("An error occurred while setting FaceTecCustomization due to a stroke width value set outside allowed range. Reverting stroke width value to default.");
}
return z;
}
private static boolean e(int i2) {
boolean z = (i2 >= 2 && i2 <= 20) || i2 == -1;
if (!z) {
ao.e("An error occurred while setting FaceTecCustomization due to a radial offset value set outside allowed range. Reverting radial offset value to default.");
}
return z;
}
public static FaceTecSDKStatus getStatus(Context context) {
return bf.b(context);
}
public static Long getLockoutEndTime(Context context) {
return bf.a(context);
}
public static boolean isLockedOut(Context context) {
return bf.d(context);
}
public static void preload(Context context) {
bf.e(context, false);
}
public static void unload() {
bf.c();
}
public static CameraPermissionStatus getCameraPermissionStatus(Context context) {
return bf.e(context);
}
public static void setAuditTrailType(FaceTecAuditTrailType faceTecAuditTrailType) {
bf.b(faceTecAuditTrailType);
}
public static void setMaxAuditTrailImages(FaceTecAuditTrailImagesToReturn faceTecAuditTrailImagesToReturn) {
bf.b = faceTecAuditTrailImagesToReturn;
}
public static String createFaceTecAPIUserAgentString(String str) {
return bf.b(str);
}
public static void setDynamicStrings(Map<Integer, String> map) {
cx.d(map);
}
public static void configureOCRLocalization(JSONObject jSONObject) {
bf.b(jSONObject);
}
public static String version() {
return "9.6.76";
}
public static void setLowLightCustomization(FaceTecCustomization faceTecCustomization) {
b = faceTecCustomization;
}
public static void setDynamicDimmingCustomization(FaceTecCustomization faceTecCustomization) {
a = faceTecCustomization;
}
}