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

647 lines
22 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.facetec.sdk;
import android.content.Context;
import android.graphics.Color;
import android.media.AudioTrack;
import android.os.Process;
import android.os.SystemClock;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.ExpandableListView;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.common.base.Ascii;
import java.io.File;
import java.io.FileNotFoundException;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class bt {
private static final byte[] $$a = null;
private static final int $$b = 0;
private static int $10;
private static int $11;
public static boolean a;
private static String b;
private static String c;
private static boolean d;
private static boolean e;
private static LinkedList<Long> f;
private static boolean g;
private static long h;
private static long i;
private static int j;
private static int n;
private static void o(int i2, int i3, short s, Object[] objArr) {
int i4 = 108 - (i3 * 3);
int i5 = (s << 1) + 4;
int i6 = i2 * 3;
byte[] bArr = $$a;
byte[] bArr2 = new byte[i6 + 1];
int i7 = -1;
if (bArr == null) {
i5++;
i4 += i5;
}
while (true) {
i7++;
bArr2[i7] = (byte) i4;
if (i7 == i6) {
objArr[0] = new String(bArr2, 0);
return;
} else {
byte b2 = bArr[i5];
i5++;
i4 += b2;
}
}
}
bt() {
}
static {
init$0();
$10 = 0;
$11 = 1;
j = 0;
n = 1;
c();
c = "";
e = false;
d = false;
b = "";
a = false;
j = (n + 43) % 128;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void b(Context context) {
n = (j + 93) % 128;
if (e) {
return;
}
f = new LinkedList<>();
h = 0L;
g = false;
c = context.getPackageName();
b = Settings.Secure.getString(context.getContentResolver(), "android_id");
d = g(context);
e = true;
int i2 = j + 79;
n = i2 % 128;
if (i2 % 2 == 0) {
throw new ArithmeticException();
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void c(Context context) {
int i2 = j + 95;
int i3 = i2 % 128;
n = i3;
if (i2 % 2 == 0) {
throw null;
}
if (!e) {
int i4 = i3 + 5;
j = i4 % 128;
if (i4 % 2 != 0) {
throw null;
}
return;
}
f.add(Long.valueOf(new Date().getTime()));
h(context);
int i5 = n + 83;
j = i5 % 128;
if (i5 % 2 != 0) {
throw null;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void e(Context context) {
if (e) {
if (!f.isEmpty()) {
j = (n + 61) % 128;
f.removeLast();
}
c(context);
j = (n + 75) % 128;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void d(Context context) {
j = (n + 5) % 128;
if (g) {
return;
}
g = true;
while (f.size() > 3) {
int i2 = n + 41;
j = i2 % 128;
if (i2 % 2 != 0) {
f.removeFirst();
throw new ArithmeticException();
}
f.removeFirst();
}
h(context);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void e(Context context, int i2) {
int i3 = (n + 105) % 128;
j = i3;
if (!d) {
j = i3;
if (i2 > 0) {
long time = new Date().getTime();
for (int i4 = 0; i4 < i2; i4++) {
f.add(Long.valueOf(time));
}
h(context);
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void a(Context context) {
int i2 = j + 7;
n = i2 % 128;
if (i2 % 2 != 0) {
if (e && (!f.isEmpty())) {
int i3 = n + 75;
j = i3 % 128;
if (i3 % 2 == 0) {
f.removeLast();
h(context);
j = (n + 53) % 128;
return;
} else {
f.removeLast();
h(context);
throw null;
}
}
return;
}
throw new ArithmeticException();
}
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: Code restructure failed: missing block: B:10:0x0035, code lost:
return r0 + 300000;
*/
/* JADX WARN: Code restructure failed: missing block: B:12:0x003b, code lost:
throw new java.lang.ArithmeticException();
*/
/* JADX WARN: Code restructure failed: missing block: B:14:0x0021, code lost:
if (com.facetec.sdk.bt.h != 0) goto L9;
*/
/* JADX WARN: Code restructure failed: missing block: B:4:0x0017, code lost:
if (com.facetec.sdk.bt.h != 1) goto L9;
*/
/* JADX WARN: Code restructure failed: missing block: B:5:0x003c, code lost:
return 0;
*/
/* JADX WARN: Code restructure failed: missing block: B:7:0x0023, code lost:
r0 = com.facetec.sdk.bt.h;
r7 = com.facetec.sdk.bt.n + 63;
com.facetec.sdk.bt.j = r7 % 128;
*/
/* JADX WARN: Code restructure failed: missing block: B:8:0x002f, code lost:
if ((r7 % 2) != 0) goto L13;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static long i(android.content.Context r7) {
/*
int r0 = com.facetec.sdk.bt.j
int r0 = r0 + 11
int r1 = r0 % 128
com.facetec.sdk.bt.n = r1
int r0 = r0 % 2
r1 = 0
if (r0 != 0) goto L1a
f(r7)
long r3 = com.facetec.sdk.bt.h
r5 = 1
int r7 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))
if (r7 == 0) goto L3c
goto L23
L1a:
f(r7)
long r3 = com.facetec.sdk.bt.h
int r7 = (r3 > r1 ? 1 : (r3 == r1 ? 0 : -1))
if (r7 == 0) goto L3c
L23:
long r0 = com.facetec.sdk.bt.h
int r7 = com.facetec.sdk.bt.n
int r7 = r7 + 63
int r2 = r7 % 128
com.facetec.sdk.bt.j = r2
int r7 = r7 % 2
if (r7 != 0) goto L36
r2 = 300000(0x493e0, double:1.482197E-318)
long r0 = r0 + r2
return r0
L36:
java.lang.ArithmeticException r7 = new java.lang.ArithmeticException
r7.<init>()
throw r7
L3c:
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.facetec.sdk.bt.i(android.content.Context):long");
}
/* JADX ERROR: JadxRuntimeException in pass: IfRegionVisitor
jadx.core.utils.exceptions.JadxRuntimeException: Can't remove SSA var: r4v2 long, still in use, count: 2, list:
(r4v2 long) from 0x0020: PHI (r4v1 long) = (r4v0 long), (r4v2 long) binds: [B:17:0x001e, B:4:0x0015] A[DONT_GENERATE, DONT_INLINE]
(r4v2 long) from 0x0013: CMP_L (r4v2 long), (0 long) A[WRAPPED]
at jadx.core.utils.InsnRemover.removeSsaVar(InsnRemover.java:151)
at jadx.core.utils.InsnRemover.unbindResult(InsnRemover.java:116)
at jadx.core.dex.visitors.regions.TernaryMod.makeTernaryInsn(TernaryMod.java:114)
at jadx.core.dex.visitors.regions.TernaryMod.processRegion(TernaryMod.java:62)
at jadx.core.dex.visitors.regions.TernaryMod.enterRegion(TernaryMod.java:45)
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:67)
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverse(DepthRegionTraversal.java:19)
at jadx.core.dex.visitors.regions.TernaryMod.process(TernaryMod.java:35)
at jadx.core.dex.visitors.regions.IfRegionVisitor.process(IfRegionVisitor.java:34)
at jadx.core.dex.visitors.regions.IfRegionVisitor.visit(IfRegionVisitor.java:30)
*/
static boolean j(android.content.Context r6) {
/*
int r0 = com.facetec.sdk.bt.n
int r0 = r0 + 69
int r1 = r0 % 128
com.facetec.sdk.bt.j = r1
int r0 = r0 % 2
r1 = 0
r2 = 0
if (r0 == 0) goto L18
long r4 = i(r6)
int r6 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1))
if (r6 <= 0) goto L38
goto L20
L18:
long r4 = i(r6)
int r6 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1))
if (r6 <= 0) goto L38
L20:
java.util.Date r6 = new java.util.Date
r6.<init>()
long r2 = r6.getTime()
int r6 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))
if (r6 >= 0) goto L37
int r6 = com.facetec.sdk.bt.j
int r6 = r6 + 57
int r6 = r6 % 128
com.facetec.sdk.bt.n = r6
r6 = 1
return r6
L37:
return r1
L38:
int r6 = com.facetec.sdk.bt.n
int r6 = r6 + 89
int r0 = r6 % 128
com.facetec.sdk.bt.j = r0
int r6 = r6 % 2
if (r6 != 0) goto L45
return r1
L45:
java.lang.ArithmeticException r6 = new java.lang.ArithmeticException
r6.<init>()
throw r6
*/
throw new UnsupportedOperationException("Method not decompiled: com.facetec.sdk.bt.j(android.content.Context):boolean");
}
private static void f(Context context) {
j = (n + 115) % 128;
if (!f.isEmpty()) {
int i2 = n + 123;
j = i2 % 128;
if (i2 % 2 != 0) {
f.size();
f.peekLast();
throw null;
}
long size = f.size();
long longValue = f.peekLast().longValue();
long j2 = a ? 600000L : 300000L;
while (!f.isEmpty() && f.peekFirst().longValue() < longValue - j2) {
n = (j + 107) % 128;
f.removeFirst();
j = (n + 99) % 128;
}
if (f.size() >= (a ? 16L : 14L)) {
j = (n + 7) % 128;
h = longValue;
f.clear();
}
if (f.size() != size) {
j = (n + 79) % 128;
h(context);
}
}
}
private static boolean g(Context context) {
int i2 = n + 75;
j = i2 % 128;
boolean z = true;
if (i2 % 2 != 0) {
try {
m(context);
} catch (FileNotFoundException unused) {
} catch (Exception e2) {
e = e2;
av.e(e.getMessage());
e.getStackTrace();
}
n = (j + 35) % 128;
return z;
}
try {
m(context);
} catch (FileNotFoundException unused2) {
z = false;
} catch (Exception e3) {
e = e3;
z = false;
av.e(e.getMessage());
e.getStackTrace();
}
n = (j + 35) % 128;
return z;
}
private static void h(final Context context) {
int i2 = j;
int i3 = i2 + 109;
n = i3 % 128;
if (i3 % 2 == 0) {
throw new ArithmeticException();
}
if (context == null) {
n = (i2 + 37) % 128;
} else {
cy.c(new Runnable(context) { // from class: com.facetec.sdk.bt$$ExternalSyntheticLambda0
public final Context f$0;
@Override // java.lang.Runnable
public final void run() {
bt.l(this.f$0);
}
{
this.f$0 = context;
}
});
}
}
/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ void l(Context context) {
n = (j + 31) % 128;
try {
a(context.getCacheDir());
n = (j + 25) % 128;
} catch (Exception e2) {
av.e(e2.getMessage());
}
}
private static void m(Context context) throws Exception {
byte[] a2 = bh.a(new File(context.getCacheDir(), a()), b());
JSONObject jSONObject = new JSONObject(new String(a2, 0, a2.length, StandardCharsets.UTF_8));
f.clear();
Object[] objArr = new Object[1];
k("\uf7f9蚢", KeyEvent.getDeadChar(0, 0) + 29009, objArr);
JSONArray optJSONArray = jSONObject.optJSONArray(((String) objArr[0]).intern());
if (optJSONArray != null) {
j = (n + 33) % 128;
for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
j = (n + 115) % 128;
f.add(Long.valueOf(optJSONArray.getLong(i2)));
}
Collections.sort(f);
}
Object[] objArr2 = new Object[1];
k("\uf7f3鄦", 26318 - (SystemClock.currentThreadTimeMillis() > (-1L) ? 1 : (SystemClock.currentThreadTimeMillis() == (-1L) ? 0 : -1)), objArr2);
h = jSONObject.optLong(((String) objArr2[0]).intern(), 0L);
Object[] objArr3 = new Object[1];
k("\uf7f7宵", (TypedValue.complexToFraction(0, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFraction(0, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 44111, objArr3);
g = jSONObject.optBoolean(((String) objArr3[0]).intern(), false);
}
private static void a(File file) throws Exception {
JSONObject jSONObject = new JSONObject();
JSONArray jSONArray = new JSONArray();
Iterator<Long> it = f.iterator();
while (!(!it.hasNext())) {
int i2 = n + 37;
j = i2 % 128;
if (i2 % 2 == 0) {
jSONArray.put(it.next().longValue());
} else {
jSONArray.put(it.next().longValue());
throw null;
}
}
Object[] objArr = new Object[1];
k("\uf7f9蚢", 29009 - View.resolveSizeAndState(0, 0, 0), objArr);
jSONObject.put(((String) objArr[0]).intern(), jSONArray);
Object[] objArr2 = new Object[1];
k("\uf7f3鄦", 26317 - ExpandableListView.getPackedPositionGroup(0L), objArr2);
jSONObject.put(((String) objArr2[0]).intern(), h);
Object[] objArr3 = new Object[1];
k("\uf7f7宵", (AudioTrack.getMinVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMinVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 44111, objArr3);
jSONObject.put(((String) objArr3[0]).intern(), g);
Object[] objArr4 = new Object[1];
k("\uf7ed", 15889 - TextUtils.indexOf("", "", 0, 0), objArr4);
jSONObject.put(((String) objArr4[0]).intern(), av.c(16, 128));
bh.d(new File(file, a()), b(), jSONObject.toString().getBytes(StandardCharsets.UTF_8));
int i3 = j + 95;
n = i3 % 128;
if (i3 % 2 == 0) {
throw new ArithmeticException();
}
}
private static String a() throws Exception {
StringBuilder sb = new StringBuilder();
sb.append(c);
sb.append(b);
Object[] objArr = new Object[1];
k("\uf7f3ᬃ⸚ㄭ䐼坕穙赥遡ꍽ뚍\ud98b\ueca4ᄀʻᗖ㣊䯎廧懷甏", 60659 - TextUtils.indexOf("", ""), objArr);
sb.append(((String) objArr[0]).intern());
String e2 = bl.e(sb.toString());
int i2 = j + 9;
n = i2 % 128;
if (i2 % 2 != 0) {
return e2;
}
throw null;
}
private static byte[] b() throws Exception {
StringBuilder sb = new StringBuilder();
sb.append(c);
sb.append(b);
Object[] objArr = new Object[1];
k("\uf7f3渧쑒㩱邬\uf6d9泡쌡㥌齵\uf580", MotionEvent.axisFromString("") + 39384, objArr);
sb.append(((String) objArr[0]).intern());
byte[] d2 = bl.d(sb.toString());
int i2 = n + 23;
j = i2 % 128;
if (i2 % 2 == 0) {
return d2;
}
throw new ArithmeticException();
}
private static void k(String str, int i2, Object[] objArr) {
char[] cArr;
int i3 = $10 + 79;
$11 = i3 % 128;
if (i3 % 2 == 0) {
throw null;
}
if (str != null) {
cArr = str.toCharArray();
$10 = ($11 + 47) % 128;
} else {
cArr = str;
}
char[] cArr2 = cArr;
gl glVar = new gl();
glVar.a = i2;
int length = cArr2.length;
long[] jArr = new long[length];
glVar.d = 0;
while (glVar.d < cArr2.length) {
int i4 = glVar.d;
try {
Object[] objArr2 = {Integer.valueOf(cArr2[glVar.d]), glVar, glVar};
Object obj = bo.s.get(1148652602);
if (obj == null) {
obj = ((Class) bo.e((ViewConfiguration.getZoomControlsTimeout() > 0L ? 1 : (ViewConfiguration.getZoomControlsTimeout() == 0L ? 0 : -1)) + 99, (char) (ViewConfiguration.getFadingEdgeLength() >> 16), ExpandableListView.getPackedPositionGroup(0L) + 23)).getMethod("m", Integer.TYPE, Object.class, Object.class);
bo.s.put(1148652602, obj);
}
jArr[i4] = ((Long) ((Method) obj).invoke(null, objArr2)).longValue() ^ (i ^ 7407976259645312022L);
try {
Object[] objArr3 = {glVar, glVar};
Object obj2 = bo.s.get(-1890124950);
if (obj2 == null) {
Class cls = (Class) bo.e(766 - View.MeasureSpec.getMode(0), (char) (Process.getGidForName("") + 1), (ViewConfiguration.getScrollFriction() > BitmapDescriptorFactory.HUE_RED ? 1 : (ViewConfiguration.getScrollFriction() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 31);
Object[] objArr4 = new Object[1];
o(0, 0, (short) 0, objArr4);
obj2 = cls.getMethod((String) objArr4[0], Object.class, Object.class);
bo.s.put(-1890124950, obj2);
}
((Method) obj2).invoke(null, objArr3);
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
} catch (Throwable th2) {
Throwable cause2 = th2.getCause();
if (cause2 == null) {
throw th2;
}
throw cause2;
}
}
char[] cArr3 = new char[length];
glVar.d = 0;
while (glVar.d < cArr2.length) {
int i5 = $10 + 125;
$11 = i5 % 128;
if (i5 % 2 == 0) {
cArr3[glVar.d] = (char) jArr[glVar.d];
try {
Object[] objArr5 = {glVar, glVar};
Object obj3 = bo.s.get(-1890124950);
if (obj3 == null) {
Class cls2 = (Class) bo.e(View.resolveSizeAndState(0, 0, 0) + 766, (char) View.resolveSizeAndState(0, 0, 0), 32 - ExpandableListView.getPackedPositionGroup(0L));
Object[] objArr6 = new Object[1];
o(0, 0, (short) 0, objArr6);
obj3 = cls2.getMethod((String) objArr6[0], Object.class, Object.class);
bo.s.put(-1890124950, obj3);
}
((Method) obj3).invoke(null, objArr5);
throw null;
} catch (Throwable th3) {
Throwable cause3 = th3.getCause();
if (cause3 == null) {
throw th3;
}
throw cause3;
}
}
cArr3[glVar.d] = (char) jArr[glVar.d];
try {
Object[] objArr7 = {glVar, glVar};
Object obj4 = bo.s.get(-1890124950);
if (obj4 == null) {
Class cls3 = (Class) bo.e((-16776450) - Color.rgb(0, 0, 0), (char) (1 - (SystemClock.elapsedRealtimeNanos() > 0L ? 1 : (SystemClock.elapsedRealtimeNanos() == 0L ? 0 : -1))), 32 - View.resolveSizeAndState(0, 0, 0));
Object[] objArr8 = new Object[1];
o(0, 0, (short) 0, objArr8);
obj4 = cls3.getMethod((String) objArr8[0], Object.class, Object.class);
bo.s.put(-1890124950, obj4);
}
((Method) obj4).invoke(null, objArr7);
} catch (Throwable th4) {
Throwable cause4 = th4.getCause();
if (cause4 == null) {
throw th4;
}
throw cause4;
}
}
objArr[0] = new String(cArr3);
}
static void init$0() {
$$a = new byte[]{15, -39, Ascii.DC2, 6};
$$b = 28;
}
static void c() {
i = 2939658712754846601L;
}
}