239 lines
7.3 KiB
Java
239 lines
7.3 KiB
Java
package com.facetec.sdk;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.os.Build;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.RelativeLayout;
|
|
import com.facetec.sdk.FaceTecSDK;
|
|
import java.util.Timer;
|
|
import java.util.TimerTask;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes.dex */
|
|
public abstract class ah {
|
|
static aj a = null;
|
|
protected static aj b = null;
|
|
static String c = "";
|
|
static boolean d = false;
|
|
private static aj f = null;
|
|
static float h = -1.0f;
|
|
static float i = -1.0f;
|
|
static int j = 0;
|
|
private static boolean l = true;
|
|
protected boolean e = false;
|
|
protected boolean g = true;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public abstract void a();
|
|
|
|
abstract void a(ViewGroup viewGroup);
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public abstract void b();
|
|
|
|
abstract void b(boolean z, ViewGroup viewGroup);
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public abstract View d();
|
|
|
|
abstract void d(boolean z);
|
|
|
|
abstract void e(boolean z);
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static ah c(ViewGroup viewGroup, Activity activity, boolean z) throws ae {
|
|
ah d2;
|
|
d = z;
|
|
if (!z) {
|
|
at.c(activity);
|
|
}
|
|
if (!ba.c) {
|
|
b(activity);
|
|
if (!l && b == null) {
|
|
throw new AssertionError();
|
|
}
|
|
} else {
|
|
a(activity);
|
|
if (!l && f == null) {
|
|
throw new AssertionError();
|
|
}
|
|
}
|
|
if (i().booleanValue()) {
|
|
d2 = new ag();
|
|
} else if (z) {
|
|
d2 = an.d(activity, true);
|
|
} else if (c(activity).booleanValue()) {
|
|
af afVar = new af(activity);
|
|
m.d = 2;
|
|
d2 = afVar;
|
|
} else {
|
|
d2 = an.d(activity, false);
|
|
m.d = 1;
|
|
}
|
|
View d3 = d2.d();
|
|
viewGroup.addView(d3);
|
|
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
|
|
layoutParams.addRule(13, -1);
|
|
d3.setLayoutParams(layoutParams);
|
|
return d2;
|
|
}
|
|
|
|
private static Boolean i() {
|
|
try {
|
|
return Boolean.FALSE;
|
|
} catch (Throwable unused) {
|
|
return Boolean.FALSE;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes.dex */
|
|
public static final class d {
|
|
static final String[] e = {"SM-J", "SM-G570", "SM-G611", "SM-G615", "SM-G532", "SM-G610", "SM-S767VL", "SM-A23", "SM-S236DL", "SM-C710", "SM-A105", "SM-A115", "SM-A205", "SM-A207", "SM-A236", "SM-A260", "SM-A305", "SM-A325", "SM-A730", "LM-G900", "220333QAG", "PRA-LA1", "23026RN54G", "23028RN4DG", "220733SG", "220733SI", "220733SL", "220743FI", "220733SH", "23028RNCAG", "RMX3710"};
|
|
static final String[] b = {"LM-X210", "LM-X410"};
|
|
static final String[] c = {"22111317PG", "LG-M250"};
|
|
|
|
d() {
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static boolean e(String[] strArr) {
|
|
for (String str : strArr) {
|
|
if (Build.MODEL.contains(str)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static Boolean c(Context context) throws ae {
|
|
for (String str : d.e) {
|
|
if (Build.MODEL.contains(str)) {
|
|
return Boolean.FALSE;
|
|
}
|
|
}
|
|
if (!ba.c) {
|
|
return Boolean.valueOf(af.e(context));
|
|
}
|
|
return Boolean.valueOf(af.d(context));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static float e() throws ae {
|
|
if (b != null) {
|
|
return r0.e / b.c;
|
|
}
|
|
return 1.7777778f;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void b(Context context) {
|
|
synchronized (ah.class) {
|
|
if (b == null) {
|
|
try {
|
|
if (c(context).booleanValue()) {
|
|
b = af.f(context);
|
|
} else {
|
|
if (bf.e(context) == FaceTecSDK.CameraPermissionStatus.GRANTED) {
|
|
b = an.i();
|
|
}
|
|
}
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void a(Context context) {
|
|
synchronized (ah.class) {
|
|
if (f == null) {
|
|
try {
|
|
f = c(context).booleanValue() ? af.g(context) : an.j();
|
|
} catch (Exception e) {
|
|
t.a(context, com.facetec.sdk.d.CAMERA_ERROR, e.toString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static aj c() {
|
|
aj ajVar;
|
|
synchronized (ah.class) {
|
|
ajVar = b;
|
|
}
|
|
return ajVar;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static aj h() {
|
|
aj ajVar;
|
|
synchronized (ah.class) {
|
|
ajVar = f;
|
|
}
|
|
return ajVar;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final void a(final Runnable runnable) {
|
|
final Timer timer = new Timer();
|
|
Handler handler = new Handler(Looper.getMainLooper());
|
|
final TimerTask timerTask = new TimerTask(this, timer, handler, runnable) { // from class: com.facetec.sdk.ah.5
|
|
private Runnable a;
|
|
private Handler b;
|
|
private ah c;
|
|
private Timer e;
|
|
|
|
{
|
|
this.c = this;
|
|
this.e = timer;
|
|
this.b = handler;
|
|
this.a = runnable;
|
|
}
|
|
|
|
@Override // java.util.TimerTask, java.lang.Runnable
|
|
public final void run() {
|
|
if (this.c.e) {
|
|
synchronized (this.e) {
|
|
cancel();
|
|
this.b.removeCallbacksAndMessages(null);
|
|
this.b.post(this.a);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
timer.scheduleAtFixedRate(timerTask, 0L, 100L);
|
|
handler.postDelayed(new Runnable(timer, timerTask, runnable) { // from class: com.facetec.sdk.ah$$ExternalSyntheticLambda0
|
|
public final Timer f$0;
|
|
public final TimerTask f$1;
|
|
public final Runnable f$2;
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ah.c(this.f$0, this.f$1, this.f$2);
|
|
}
|
|
|
|
{
|
|
this.f$0 = timer;
|
|
this.f$1 = timerTask;
|
|
this.f$2 = runnable;
|
|
}
|
|
}, 8000L);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void c(Timer timer, TimerTask timerTask, Runnable runnable) {
|
|
synchronized (timer) {
|
|
timerTask.cancel();
|
|
runnable.run();
|
|
}
|
|
}
|
|
}
|