477 lines
17 KiB
Java
477 lines
17 KiB
Java
package com.facetec.sdk;
|
|
|
|
import android.content.Context;
|
|
import android.content.SharedPreferences;
|
|
import android.media.MediaPlayer;
|
|
import android.os.Handler;
|
|
import android.speech.tts.TextToSpeech;
|
|
import android.util.Base64;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import com.facetec.sdk.FaceTecVocalGuidanceCustomization;
|
|
import com.facetec.sdk.bg;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes.dex */
|
|
public final class dp {
|
|
private static Handler a = null;
|
|
static SharedPreferences b = null;
|
|
private static Object c = null;
|
|
private static MediaPlayer d = null;
|
|
static boolean e = false;
|
|
private static MediaPlayer f = null;
|
|
private static MediaPlayer g = null;
|
|
private static MediaPlayer h = null;
|
|
private static MediaPlayer i = null;
|
|
private static MediaPlayer j = null;
|
|
private static int k = 0;
|
|
private static int l = 0;
|
|
private static TextToSpeech m = null;
|
|
private static boolean n = false;
|
|
|
|
/* renamed from: o, reason: collision with root package name */
|
|
private static byte f6437o = 0;
|
|
private static int r = 1;
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void a(int i2) {
|
|
}
|
|
|
|
dp() {
|
|
}
|
|
|
|
static {
|
|
j();
|
|
c = new Object();
|
|
}
|
|
|
|
private static void p(String str, Object[] objArr) {
|
|
byte[] decode = Base64.decode(str, 0);
|
|
byte[] bArr = new byte[decode.length];
|
|
for (int i2 = 0; i2 < decode.length; i2++) {
|
|
bArr[i2] = (byte) (decode[(decode.length - i2) - 1] ^ f6437o);
|
|
}
|
|
objArr[0] = new String(bArr, StandardCharsets.UTF_8);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes.dex */
|
|
public enum b {
|
|
GET_READY_PRESS_BUTTON_TAPPING("GET_READY_PRESS_BUTTON_TAPPING"),
|
|
GET_READY_FRAME_YOUR_FACE_TAPPING("GET_READY_FRAME_YOUR_FACE_TAPPING"),
|
|
GET_READY_PRESS_BUTTON_DELAYED("GET_READY_PRESS_BUTTON_DELAYED"),
|
|
GET_READY_FRAME_YOUR_FACE_AUTOMATIC("GET_READY_FRAME_YOUR_FACE_AUTOMATIC"),
|
|
RETRY_PRESS_BUTTON_TAPPING("RETRY_PRESS_BUTTON_TAPPING"),
|
|
FACE_CAPTURE_UNZOOMED_FRAME_YOUR_FACE_TAPPING("FACE_CAPTURE_UNZOOMED_FRAME_YOUR_FACE_TAPPING"),
|
|
FACE_CAPTURE_FRAME_YOUR_FACE_DELAYED("FACE_CAPTURE_FRAME_YOUR_FACE_DELAYED"),
|
|
FACE_CAPTURE_ZOOMED_MOVE_CLOSER_TAPPING("FACE_CAPTURE_ZOOMED_MOVE_CLOSER_TAPPING"),
|
|
FACE_CAPTURE_ZOOMED_PLEASE_FRAME_YOUR_FACE_TAPPING("FACE_CAPTURE_ZOOMED_PLEASE_FRAME_YOUR_FACE_TAPPING"),
|
|
FACE_CAPTURE_MOVE_CLOSER_AUTOMATIC("FACE_CAPTURE_MOVE_CLOSER_AUTOMATIC"),
|
|
FACE_CAPTURE_MOVE_CLOSER_DELAYED("FACE_CAPTURE_MOVE_CLOSER_DELAYED"),
|
|
BLIND_USER_ASSIST_TAP_PROMPT("BLIND_USER_ASSIST_TAP_PROMPT"),
|
|
BLIND_USER_ASSIST_FACESCAN_FEEDBACK("BLIND_USER_ASSIST_FACESCAN_FEEDBACK"),
|
|
SUCCESS("SUCCESS"),
|
|
UPLOADING("UPLOADING"),
|
|
RETRY("RETRY");
|
|
|
|
final String t;
|
|
|
|
b(String str) {
|
|
this.t = str;
|
|
}
|
|
}
|
|
|
|
private static boolean h() {
|
|
return d.isPlaying() || h.isPlaying() || j.isPlaying() || g.isPlaying() || f.isPlaying() || i.isPlaying();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void a() {
|
|
TextToSpeech textToSpeech = m;
|
|
if (textToSpeech == null || !textToSpeech.isSpeaking()) {
|
|
return;
|
|
}
|
|
m.stop();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void a(Context context, String str) {
|
|
try {
|
|
TextToSpeech textToSpeech = m;
|
|
if (textToSpeech != null) {
|
|
textToSpeech.speak(str, 0, null);
|
|
}
|
|
} catch (Throwable th) {
|
|
t.a(context, d.VG_PLAY_SOUND_ERROR, th.getMessage());
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: com.facetec.sdk.dp$4, reason: invalid class name */
|
|
/* loaded from: classes.dex */
|
|
public static final /* synthetic */ class AnonymousClass4 {
|
|
static final int[] d;
|
|
|
|
static {
|
|
int[] iArr = new int[b.values().length];
|
|
d = iArr;
|
|
try {
|
|
iArr[b.GET_READY_PRESS_BUTTON_TAPPING.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
d[b.GET_READY_PRESS_BUTTON_DELAYED.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
d[b.RETRY_PRESS_BUTTON_TAPPING.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
d[b.GET_READY_FRAME_YOUR_FACE_TAPPING.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
d[b.GET_READY_FRAME_YOUR_FACE_AUTOMATIC.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
d[b.FACE_CAPTURE_UNZOOMED_FRAME_YOUR_FACE_TAPPING.ordinal()] = 6;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
try {
|
|
d[b.FACE_CAPTURE_FRAME_YOUR_FACE_DELAYED.ordinal()] = 7;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
try {
|
|
d[b.FACE_CAPTURE_ZOOMED_PLEASE_FRAME_YOUR_FACE_TAPPING.ordinal()] = 8;
|
|
} catch (NoSuchFieldError unused8) {
|
|
}
|
|
try {
|
|
d[b.FACE_CAPTURE_ZOOMED_MOVE_CLOSER_TAPPING.ordinal()] = 9;
|
|
} catch (NoSuchFieldError unused9) {
|
|
}
|
|
try {
|
|
d[b.FACE_CAPTURE_MOVE_CLOSER_AUTOMATIC.ordinal()] = 10;
|
|
} catch (NoSuchFieldError unused10) {
|
|
}
|
|
try {
|
|
d[b.FACE_CAPTURE_MOVE_CLOSER_DELAYED.ordinal()] = 11;
|
|
} catch (NoSuchFieldError unused11) {
|
|
}
|
|
try {
|
|
d[b.SUCCESS.ordinal()] = 12;
|
|
} catch (NoSuchFieldError unused12) {
|
|
}
|
|
try {
|
|
d[b.UPLOADING.ordinal()] = 13;
|
|
} catch (NoSuchFieldError unused13) {
|
|
}
|
|
try {
|
|
d[b.RETRY.ordinal()] = 14;
|
|
} catch (NoSuchFieldError unused14) {
|
|
}
|
|
try {
|
|
d[b.BLIND_USER_ASSIST_TAP_PROMPT.ordinal()] = 15;
|
|
} catch (NoSuchFieldError unused15) {
|
|
}
|
|
try {
|
|
d[b.BLIND_USER_ASSIST_FACESCAN_FEEDBACK.ordinal()] = 16;
|
|
} catch (NoSuchFieldError unused16) {
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void b(Context context, b bVar) {
|
|
int i2 = 2 % 2;
|
|
if (!n) {
|
|
if (ah.d) {
|
|
return;
|
|
}
|
|
int i3 = k + 71;
|
|
r = i3 % 128;
|
|
int i4 = i3 % 2;
|
|
if (b()) {
|
|
return;
|
|
}
|
|
int i5 = k + 33;
|
|
r = i5 % 128;
|
|
int i6 = i5 % 2;
|
|
if (h() || FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.NO_VOCAL_GUIDANCE) {
|
|
return;
|
|
}
|
|
}
|
|
switch (AnonymousClass4.d[bVar.ordinal()]) {
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
a(context, i);
|
|
break;
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 8:
|
|
a(context, d);
|
|
break;
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
a(context, h);
|
|
break;
|
|
case 12:
|
|
a(context, f);
|
|
break;
|
|
case 13:
|
|
a(context, g);
|
|
break;
|
|
case 14:
|
|
a(context, j);
|
|
break;
|
|
case 15:
|
|
a(context, context.getString(R.string.FaceTec_accessibility_tap_guidance));
|
|
int i7 = k + 5;
|
|
r = i7 % 128;
|
|
int i8 = i7 % 2;
|
|
break;
|
|
case 16:
|
|
String string = context.getString(l);
|
|
if (string.startsWith(",*,)")) {
|
|
Object[] objArr = new Object[1];
|
|
p(string.substring(4), objArr);
|
|
string = ((String) objArr[0]).intern();
|
|
}
|
|
a(context, string);
|
|
break;
|
|
}
|
|
t.c(context, bVar);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void e(Context context) {
|
|
FaceTecVocalGuidanceCustomization faceTecVocalGuidanceCustomization = FaceTecSDK.c.vocalGuidanceCustomization;
|
|
Object systemService = context.getApplicationContext().getSystemService("accessibility");
|
|
if (systemService != null) {
|
|
try {
|
|
if (((Boolean) Class.forName("android.view.accessibility.AccessibilityManager").getMethod("isEnabled", null).invoke(systemService, null)).booleanValue()) {
|
|
Iterator it = ((List) Class.forName("android.view.accessibility.AccessibilityManager").getMethod("getEnabledAccessibilityServiceList", Integer.TYPE).invoke(systemService, 1)).iterator();
|
|
while (it.hasNext()) {
|
|
if (((String) Class.forName("android.accessibilityservice.AccessibilityServiceInfo").getMethod("getId", null).invoke(it.next(), null)).contains("TalkBackService")) {
|
|
n = true;
|
|
}
|
|
}
|
|
}
|
|
} catch (Throwable th) {
|
|
Throwable cause = th.getCause();
|
|
if (cause == null) {
|
|
throw th;
|
|
}
|
|
throw cause;
|
|
}
|
|
}
|
|
if (n) {
|
|
cg.W();
|
|
m = new TextToSpeech(context, new TextToSpeech.OnInitListener() { // from class: com.facetec.sdk.dp$$ExternalSyntheticLambda1
|
|
@Override // android.speech.tts.TextToSpeech.OnInitListener
|
|
public final void onInit(int i2) {
|
|
dp.a(i2);
|
|
}
|
|
});
|
|
}
|
|
d = d(context, faceTecVocalGuidanceCustomization.pleaseFrameYourFaceInTheOvalSoundFile);
|
|
h = d(context, faceTecVocalGuidanceCustomization.pleaseMoveCloserSoundFile);
|
|
j = d(context, faceTecVocalGuidanceCustomization.pleaseRetrySoundFile);
|
|
g = d(context, faceTecVocalGuidanceCustomization.uploadingSoundFile);
|
|
f = d(context, faceTecVocalGuidanceCustomization.facescanSuccessfulSoundFile);
|
|
i = d(context, faceTecVocalGuidanceCustomization.pleasePressTheButtonToStartSoundFile);
|
|
if (b()) {
|
|
FaceTecSDK.c.vocalGuidanceCustomization.mode = FaceTecVocalGuidanceCustomization.VocalGuidanceMode.NO_VOCAL_GUIDANCE;
|
|
}
|
|
SharedPreferences j2 = bf.j(context);
|
|
b = j2;
|
|
e = j2.getBoolean("facetecMoveCloserSoundHasBeenPlayed", false);
|
|
}
|
|
|
|
private static MediaPlayer d(Context context, int i2) {
|
|
if (i2 == -1) {
|
|
return null;
|
|
}
|
|
return MediaPlayer.create(context, i2);
|
|
}
|
|
|
|
private static void a(Context context, MediaPlayer mediaPlayer) {
|
|
if (e()) {
|
|
return;
|
|
}
|
|
try {
|
|
mediaPlayer.start();
|
|
} catch (Throwable th) {
|
|
t.a(context, d.VG_PLAY_SOUND_ERROR, th.getMessage());
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void c() {
|
|
MediaPlayer mediaPlayer = d;
|
|
if (mediaPlayer != null) {
|
|
mediaPlayer.release();
|
|
d = null;
|
|
}
|
|
MediaPlayer mediaPlayer2 = h;
|
|
if (mediaPlayer2 != null) {
|
|
mediaPlayer2.release();
|
|
h = null;
|
|
}
|
|
MediaPlayer mediaPlayer3 = j;
|
|
if (mediaPlayer3 != null) {
|
|
mediaPlayer3.release();
|
|
j = null;
|
|
}
|
|
MediaPlayer mediaPlayer4 = i;
|
|
if (mediaPlayer4 != null) {
|
|
mediaPlayer4.release();
|
|
i = null;
|
|
}
|
|
MediaPlayer mediaPlayer5 = g;
|
|
if (mediaPlayer5 != null) {
|
|
mediaPlayer5.release();
|
|
g = null;
|
|
}
|
|
MediaPlayer mediaPlayer6 = f;
|
|
if (mediaPlayer6 != null) {
|
|
mediaPlayer6.release();
|
|
f = null;
|
|
}
|
|
if (b != null) {
|
|
f = null;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void c(final Context context) {
|
|
a = new Handler();
|
|
Runnable runnable = new Runnable(context) { // from class: com.facetec.sdk.dp$$ExternalSyntheticLambda2
|
|
public final Context f$0;
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
dp.a(this.f$0);
|
|
}
|
|
|
|
{
|
|
this.f$0 = context;
|
|
}
|
|
};
|
|
if (FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.FULL_VOCAL_GUIDANCE) {
|
|
a.postDelayed(runnable, 4500L);
|
|
} else if (FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.MINIMAL_VOCAL_GUIDANCE) {
|
|
a.postDelayed(runnable, 15000L);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void a(Context context) {
|
|
if (cg.g() == ci.ZOOM_FAR) {
|
|
b(context, b.FACE_CAPTURE_FRAME_YOUR_FACE_DELAYED);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void d() {
|
|
synchronized (c) {
|
|
Handler handler = a;
|
|
if (handler != null) {
|
|
handler.removeCallbacksAndMessages(null);
|
|
a = null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void d(final Context context) {
|
|
final bg bgVar = (bg) context;
|
|
if (FaceTecSDK.c.vocalGuidanceCustomization.mode != FaceTecVocalGuidanceCustomization.VocalGuidanceMode.NO_VOCAL_GUIDANCE) {
|
|
bgVar.u.setOnTouchListener(new View.OnTouchListener(bgVar, context) { // from class: com.facetec.sdk.dp$$ExternalSyntheticLambda0
|
|
public final bg f$0;
|
|
public final Context f$1;
|
|
|
|
@Override // android.view.View.OnTouchListener
|
|
public final boolean onTouch(View view, MotionEvent motionEvent) {
|
|
boolean e2;
|
|
e2 = dp.e(this.f$0, this.f$1, view, motionEvent);
|
|
return e2;
|
|
}
|
|
|
|
{
|
|
this.f$0 = bgVar;
|
|
this.f$1 = context;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ boolean e(bg bgVar, Context context, View view, MotionEvent motionEvent) {
|
|
if (motionEvent.getAction() == 1) {
|
|
if (bgVar.getFragmentManager().findFragmentByTag("PreEnroll") != null) {
|
|
bb bbVar = (bb) bgVar.getFragmentManager().findFragmentByTag("PreEnroll");
|
|
if (bbVar.c == null || bp.k) {
|
|
return true;
|
|
}
|
|
if (bbVar.c.isEnabled()) {
|
|
b(context, b.GET_READY_PRESS_BUTTON_TAPPING);
|
|
} else {
|
|
b(context, b.FACE_CAPTURE_UNZOOMED_FRAME_YOUR_FACE_TAPPING);
|
|
}
|
|
} else if (bgVar.getFragmentManager().findFragmentByTag("RetryZoom") != null) {
|
|
bb bbVar2 = (bb) bgVar.getFragmentManager().findFragmentByTag("RetryZoom");
|
|
if (bbVar2.c == null || cn.n) {
|
|
return true;
|
|
}
|
|
if (bbVar2.c.isEnabled()) {
|
|
b(context, b.GET_READY_PRESS_BUTTON_TAPPING);
|
|
} else if (((cn) bbVar2).l == 1) {
|
|
b(context, b.FACE_CAPTURE_UNZOOMED_FRAME_YOUR_FACE_TAPPING);
|
|
}
|
|
} else if (bgVar.getFragmentManager().findFragmentByTag("Zoom") != null) {
|
|
if (bgVar.y != bg.a.FACESCAN_SESSION_STARTED) {
|
|
if (((ay) bgVar.getFragmentManager().findFragmentByTag("Zoom")).b == cj.FRAME_YOUR_FACE) {
|
|
b(context, b.FACE_CAPTURE_ZOOMED_PLEASE_FRAME_YOUR_FACE_TAPPING);
|
|
}
|
|
} else if (cg.g() == ci.ZOOM_CLOSE) {
|
|
if (cg.q() == ce.MOVE_FACE_CLOSER) {
|
|
b(context, b.FACE_CAPTURE_ZOOMED_MOVE_CLOSER_TAPPING);
|
|
} else if (cg.q() != ce.HOLD_STEADY) {
|
|
b(context, b.FACE_CAPTURE_ZOOMED_PLEASE_FRAME_YOUR_FACE_TAPPING);
|
|
}
|
|
} else if (cg.g() == ci.ZOOM_FAR && cg.q() != ce.HOLD_STEADY) {
|
|
b(context, b.FACE_CAPTURE_UNZOOMED_FRAME_YOUR_FACE_TAPPING);
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
static void j() {
|
|
f6437o = (byte) 6;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static boolean e() {
|
|
return n;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void e(int i2) {
|
|
l = i2;
|
|
}
|
|
|
|
private static boolean b() {
|
|
return d == null || h == null || j == null || g == null || f == null || i == null;
|
|
}
|
|
}
|