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

761 lines
28 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.facetec.sdk;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.media.AudioTrack;
import android.os.Process;
import android.os.SystemClock;
import android.text.AndroidCharacter;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewConfiguration;
import com.facetec.sdk.ac;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.common.base.Ascii;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import net.sf.scuba.smartcards.ISO7816;
import org.bouncycastle.crypto.tls.CipherSuite;
import org.bouncycastle.i18n.LocalizedMessage;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
final class ac {
private static final byte[] $$a = null;
private static final int $$b = 0;
private static int $10;
private static int $11;
private static long g;
private static char[] j;
private static int k;
private static int n;
private Context b;
List<u> c = new ArrayList();
private int a = 1;
private int d = 0;
private int e = 0;
private int f = 0;
private boolean h = false;
private boolean i = false;
private static void m(int i, byte b2, short s, Object[] objArr) {
byte[] bArr = $$a;
int i2 = s * 3;
int i3 = b2 + 4;
int i4 = 114 - i;
byte[] bArr2 = new byte[1 - i2];
int i5 = 0 - i2;
int i6 = -1;
if (bArr == null) {
i4 += i3;
i3 = i3;
i6 = -1;
}
while (true) {
int i7 = i6 + 1;
int i8 = i3 + 1;
bArr2[i7] = (byte) i4;
if (i7 == i5) {
objArr[0] = new String(bArr2, 0);
return;
} else {
i4 += bArr[i8];
i3 = i8;
i6 = i7;
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
/* JADX WARN: Unknown enum class pattern. Please report as an issue! */
/* loaded from: classes.dex */
public static final class e {
private static final byte[] $$a = null;
private static final int $$b = 0;
private static int $10;
private static int $11;
public static final e a;
public static final e b;
public static final e c;
public static final e d;
public static final e e;
private static final e[] f;
public static final e g;
private static int h;
private static char[] j;
private static int k;
final String i;
/* JADX WARN: Removed duplicated region for block: B:10:0x0027 */
/* JADX WARN: Removed duplicated region for block: B:7:0x001f */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0027 -> B:4:0x002c). Please report as a decompilation issue!!! */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static void m(int r7, byte r8, byte r9, java.lang.Object[] r10) {
/*
int r7 = 104 - r7
int r9 = r9 << 1
int r9 = r9 + 1
int r8 = r8 << 2
int r8 = 3 - r8
byte[] r0 = com.facetec.sdk.ac.e.$$a
byte[] r1 = new byte[r9]
r2 = 0
if (r0 != 0) goto L15
r7 = r8
r3 = r9
r4 = r2
goto L2c
L15:
r3 = r2
L16:
int r4 = r3 + 1
int r8 = r8 + 1
byte r5 = (byte) r7
r1[r3] = r5
if (r4 != r9) goto L27
java.lang.String r7 = new java.lang.String
r7.<init>(r1, r2)
r10[r2] = r7
return
L27:
r3 = r0[r8]
r6 = r8
r8 = r7
r7 = r6
L2c:
int r8 = r8 + r3
r3 = r4
r6 = r8
r8 = r7
r7 = r6
goto L16
*/
throw new UnsupportedOperationException("Method not decompiled: com.facetec.sdk.ac.e.m(int, byte, byte, java.lang.Object[]):void");
}
private static /* synthetic */ e[] a() {
int i = (k + 71) % 128;
h = i;
e[] eVarArr = {d, e, a, c, b, g};
int i2 = i + 39;
k = i2 % 128;
if (i2 % 2 != 0) {
return eVarArr;
}
throw null;
}
public static e valueOf(String str) {
int i = k + 111;
h = i % 128;
e eVar = (e) Enum.valueOf(e.class, str);
if (i % 2 == 0) {
return eVar;
}
throw new ArithmeticException();
}
public static e[] values() {
int i = h + 45;
k = i % 128;
if (i % 2 == 0) {
throw new ArithmeticException();
}
e[] eVarArr = (e[]) f.clone();
h = (k + 41) % 128;
return eVarArr;
}
static {
init$0();
$10 = 0;
$11 = 1;
h = 0;
k = 1;
b();
d = new e("HASH_SET_ARRAY", 0, "haia");
e = new e("VERSION", 1, "v");
Object[] objArr = new Object[1];
l(true, new int[]{0, 1, CipherSuite.TLS_PSK_WITH_NULL_SHA256, 0}, "\u0000", objArr);
a = new e("REVISION", 2, ((String) objArr[0]).intern());
c = new e("SIZE", 3, "s");
b = new e("SESSION_COUNT", 4, "sc");
g = new e("TAMPERING_DETECTED", 5, "td");
f = a();
h = (k + 25) % 128;
}
private e(String str, int i, String str2) {
this.i = str2;
}
private static void l(boolean z, int[] iArr, String str, Object[] objArr) {
int length;
char[] cArr;
char[] cArr2;
String str2 = str;
byte[] bArr = str2;
if (str2 != null) {
bArr = str2.getBytes(LocalizedMessage.DEFAULT_ENCODING);
}
byte[] bArr2 = bArr;
gp gpVar = new gp();
int i = 0;
int i2 = iArr[0];
int i3 = 1;
int i4 = iArr[1];
int i5 = iArr[2];
int i6 = iArr[3];
char[] cArr3 = j;
char c2 = '0';
if (cArr3 != null) {
int i7 = $10 + 73;
$11 = i7 % 128;
if (i7 % 2 == 0) {
length = cArr3.length;
cArr = new char[length];
} else {
length = cArr3.length;
cArr = new char[length];
}
int i8 = 0;
while (i8 < length) {
try {
Object[] objArr2 = new Object[i3];
objArr2[i] = Integer.valueOf(cArr3[i8]);
Object obj = bo.s.get(-344240863);
if (obj == null) {
Class cls = (Class) bo.e(TextUtils.lastIndexOf("", c2, i, i) + 989, (char) (ViewConfiguration.getTouchSlop() >> 8), (ViewConfiguration.getFadingEdgeLength() >> 16) + 32);
byte length2 = (byte) $$a.length;
byte b2 = (byte) (length2 - 4);
cArr2 = cArr3;
Object[] objArr3 = new Object[1];
m(length2, b2, b2, objArr3);
obj = cls.getMethod((String) objArr3[0], Integer.TYPE);
bo.s.put(-344240863, obj);
} else {
cArr2 = cArr3;
}
cArr[i8] = ((Character) ((Method) obj).invoke(null, objArr2)).charValue();
i8++;
cArr3 = cArr2;
i = 0;
i3 = 1;
c2 = '0';
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
cArr3 = cArr;
}
char[] cArr4 = new char[i4];
System.arraycopy(cArr3, i2, cArr4, 0, i4);
if (bArr2 != null) {
char[] cArr5 = new char[i4];
gpVar.a = 0;
char c3 = 0;
while (gpVar.a < i4) {
if (bArr2[gpVar.a] == 1) {
$10 = ($11 + 15) % 128;
int i9 = gpVar.a;
try {
Object[] objArr4 = {Integer.valueOf(cArr4[gpVar.a]), Integer.valueOf(c3)};
Object obj2 = bo.s.get(69282466);
if (obj2 == null) {
Class cls2 = (Class) bo.e((ViewConfiguration.getEdgeSlop() >> 16) + 1570, (char) (11060 - (ViewConfiguration.getMinimumFlingVelocity() >> 16)), 23 - (ViewConfiguration.getMaximumFlingVelocity() >> 16));
Object[] objArr5 = new Object[1];
m(7, (byte) 0, (byte) 0, objArr5);
obj2 = cls2.getMethod((String) objArr5[0], Integer.TYPE, Integer.TYPE);
bo.s.put(69282466, obj2);
}
cArr5[i9] = ((Character) ((Method) obj2).invoke(null, objArr4)).charValue();
} catch (Throwable th2) {
Throwable cause2 = th2.getCause();
if (cause2 == null) {
throw th2;
}
throw cause2;
}
} else {
int i10 = gpVar.a;
try {
Object[] objArr6 = {Integer.valueOf(cArr4[gpVar.a]), Integer.valueOf(c3)};
Object obj3 = bo.s.get(-1063034112);
if (obj3 == null) {
obj3 = ((Class) bo.e(KeyEvent.normalizeMetaState(0) + 1877, (char) (TextUtils.lastIndexOf("", '0', 0) + 23953), (ViewConfiguration.getScrollBarSize() >> 8) + 23)).getMethod("g", Integer.TYPE, Integer.TYPE);
bo.s.put(-1063034112, obj3);
}
cArr5[i10] = ((Character) ((Method) obj3).invoke(null, objArr6)).charValue();
} catch (Throwable th3) {
Throwable cause3 = th3.getCause();
if (cause3 == null) {
throw th3;
}
throw cause3;
}
}
c3 = cArr5[gpVar.a];
try {
Object[] objArr7 = {gpVar, gpVar};
Object obj4 = bo.s.get(1322201006);
if (obj4 == null) {
Class cls3 = (Class) bo.e((ViewConfiguration.getKeyRepeatDelay() >> 16) + 734, (char) (((byte) KeyEvent.getModifierMetaStateMask()) + 1), View.resolveSize(0, 0) + 32);
Object[] objArr8 = new Object[1];
m(0, (byte) 0, (byte) 0, objArr8);
obj4 = cls3.getMethod((String) objArr8[0], Object.class, Object.class);
bo.s.put(1322201006, obj4);
}
((Method) obj4).invoke(null, objArr7);
} catch (Throwable th4) {
Throwable cause4 = th4.getCause();
if (cause4 == null) {
throw th4;
}
throw cause4;
}
}
cArr4 = cArr5;
}
if (i6 > 0) {
int i11 = $10 + 87;
$11 = i11 % 128;
if (i11 % 2 == 0) {
char[] cArr6 = new char[i4];
System.arraycopy(cArr4, 0, cArr6, 0, i4);
System.arraycopy(cArr6, 0, cArr4, i4 % i6, i6);
System.arraycopy(cArr6, i6, cArr4, 1, i4 / i6);
} else {
char[] cArr7 = new char[i4];
System.arraycopy(cArr4, 0, cArr7, 0, i4);
int i12 = i4 - i6;
System.arraycopy(cArr7, 0, cArr4, i12, i6);
System.arraycopy(cArr7, i6, cArr4, 0, i12);
}
}
if (z) {
char[] cArr8 = new char[i4];
int i13 = 0;
while (true) {
gpVar.a = i13;
if (gpVar.a >= i4) {
break;
}
cArr8[gpVar.a] = cArr4[(i4 - gpVar.a) - 1];
i13 = gpVar.a + 1;
}
$10 = ($11 + 57) % 128;
cArr4 = cArr8;
}
if (i5 > 0) {
gpVar.a = 0;
while (gpVar.a < i4) {
cArr4[gpVar.a] = (char) (cArr4[gpVar.a] - iArr[2]);
gpVar.a++;
$11 = ($10 + 1) % 128;
}
}
objArr[0] = new String(cArr4);
}
static void init$0() {
$$a = new byte[]{ISO7816.INS_REHABILITATE_CHV, -23, 65, 91};
$$b = CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256;
}
static void b() {
j = new char[]{38822};
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public static final class b {
int a;
int c;
b(int i, int i2) {
this.c = i;
this.a = i2;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public ac(Context context) {
this.b = context.getApplicationContext();
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void b() {
int i = n + 55;
k = i % 128;
if (i % 2 != 0) {
int c = ad.c(a().toString());
this.e = c;
if (c <= 16638) {
return;
}
} else {
int c2 = ad.c(a().toString());
this.e = c2;
if (c2 <= 4500) {
return;
}
}
this.c.remove(r0.size() - 1);
this.e = ad.c(a().toString());
List<b> d = d();
for (int size = d.size() - 1; size >= 0; size--) {
int i2 = n + 39;
k = i2 % 128;
if (i2 % 2 != 0) {
if (this.e <= 26724) {
return;
}
} else if (this.e <= 4500) {
return;
}
this.c.remove(d.get(size).c);
this.e = ad.c(a().toString());
}
k = (n + 31) % 128;
}
private List<b> d() {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.c.size(); i++) {
b bVar = new b(i, i);
if (this.c.get(i).d == x.DETECTED) {
n = (k + 15) % 128;
bVar.a -= this.c.size();
k = (n + 101) % 128;
}
if (this.c.get(i).b == x.DETECTED) {
k = (n + 43) % 128;
bVar.a -= this.c.size();
}
if (this.c.get(i).j == x.DETECTED) {
int i2 = n + 3;
k = i2 % 128;
bVar.a = i2 % 2 != 0 ? bVar.a + this.c.size() : bVar.a - this.c.size();
}
arrayList.add(bVar);
}
Arrays.sort((b[]) arrayList.toArray(), new Comparator() { // from class: com.facetec.sdk.ac$$ExternalSyntheticLambda0
@Override // java.util.Comparator
public final int compare(Object obj, Object obj2) {
int d;
d = ac.d((ac.b) obj, (ac.b) obj2);
return d;
}
});
return arrayList;
}
/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ int d(b bVar, b bVar2) {
int i = k + 11;
n = i % 128;
int i2 = bVar.a;
int i3 = bVar2.a;
return i % 2 == 0 ? i2 >>> i3 : i2 - i3;
}
/* JADX INFO: Access modifiers changed from: package-private */
public final JSONObject a() {
JSONObject jSONObject = new JSONObject();
JSONArray jSONArray = new JSONArray();
Iterator<u> it = this.c.iterator();
int i = k + 31;
while (true) {
n = i % 128;
if (it.hasNext()) {
k = (n + 65) % 128;
jSONArray.put(it.next().d());
i = k + 59;
} else {
try {
break;
} catch (JSONException e2) {
Context context = this.b;
d dVar = d.F2F_ERROR;
StringBuilder sb = new StringBuilder("Error 4470: ");
sb.append(e2.getMessage());
t.a(context, dVar, sb.toString());
}
}
}
e[] values = e.values();
int length = values.length;
for (int i2 = 0; i2 < length; i2++) {
int i3 = k + 107;
n = i3 % 128;
if (i3 % 2 == 0) {
int i4 = AnonymousClass2.b[values[i2].ordinal()];
throw new ArithmeticException();
}
e eVar = values[i2];
switch (AnonymousClass2.b[eVar.ordinal()]) {
case 1:
jSONObject.put(eVar.i, jSONArray);
break;
case 2:
jSONObject.put(eVar.i, this.a);
break;
case 3:
jSONObject.put(eVar.i, this.d);
break;
case 4:
jSONObject.put(eVar.i, this.e);
break;
case 5:
jSONObject.put(eVar.i, this.f);
break;
case 6:
jSONObject.put(eVar.i, this.h);
break;
}
}
return jSONObject;
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: com.facetec.sdk.ac$2, reason: invalid class name */
/* loaded from: classes.dex */
public static final /* synthetic */ class AnonymousClass2 {
static final int[] b;
static {
int[] iArr = new int[e.values().length];
b = iArr;
try {
iArr[e.d.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
b[e.e.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
b[e.a.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
b[e.c.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
b[e.b.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
b[e.g.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static ac a(Context context, String str) {
ac acVar = new ac(context);
if (str != null) {
k = (n + 105) % 128;
if (!str.isEmpty()) {
try {
JSONObject jSONObject = new JSONObject(str);
JSONArray jSONArray = jSONObject.getJSONArray(e.d.i);
ArrayList arrayList = new ArrayList();
for (int i = 0; i < jSONArray.length(); i++) {
n = (k + 75) % 128;
JSONObject jSONObject2 = jSONArray.getJSONObject(i);
Object[] objArr = new Object[1];
l(2 - View.resolveSizeAndState(0, 0, 0), ViewConfiguration.getPressedStateDuration() >> 16, (char) (44108 - (Process.getElapsedCpuTime() > 0L ? 1 : (Process.getElapsedCpuTime() == 0L ? 0 : -1))), objArr);
arrayList.add(u.a(jSONObject2.getJSONArray(((String) objArr[0]).intern()).toString()));
}
e[] values = e.values();
int length = values.length;
for (int i2 = 0; i2 < length; i2++) {
int i3 = n + 13;
k = i3 % 128;
if (i3 % 2 != 0) {
int i4 = AnonymousClass2.b[values[i2].ordinal()];
throw new NullPointerException();
}
e eVar = values[i2];
switch (AnonymousClass2.b[eVar.ordinal()]) {
case 1:
acVar.c = arrayList;
break;
case 2:
acVar.a = jSONObject.getInt(eVar.i);
n = (k + 123) % 128;
break;
case 3:
acVar.d = jSONObject.getInt(eVar.i);
break;
case 4:
acVar.e = jSONObject.getInt(eVar.i);
break;
case 5:
acVar.f = jSONObject.getInt(eVar.i);
break;
case 6:
acVar.h = jSONObject.getBoolean(eVar.i);
break;
}
}
acVar.i = true;
acVar.d++;
} catch (Exception e2) {
acVar.h = true;
d dVar = d.F2F_ERROR;
StringBuilder sb = new StringBuilder("Error 4471: ");
sb.append(e2.getMessage());
t.a(context, dVar, sb.toString());
}
}
}
return acVar;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static ac b(Context context, List<C0131r> list) {
ac acVar = new ac(context);
ArrayList arrayList = new ArrayList();
for (C0131r c0131r : list) {
u uVar = new u();
uVar.a = c0131r.a;
uVar.e = c0131r.a.size();
uVar.d = c0131r.j;
uVar.b = c0131r.i;
uVar.j = c0131r.f;
uVar.c = ad.c(uVar.d().toString());
arrayList.add(uVar);
}
acVar.c = arrayList;
acVar.f = list.size();
acVar.e = ad.c(acVar.a().toString());
k = (n + 33) % 128;
return acVar;
}
private static void l(int i, int i2, char c, Object[] objArr) {
gm gmVar = new gm();
long[] jArr = new long[i];
gmVar.e = 0;
while (gmVar.e < i) {
int i3 = gmVar.e;
try {
Object[] objArr2 = {Integer.valueOf(j[i2 + gmVar.e])};
Object obj = bo.s.get(1303494992);
if (obj == null) {
Class cls = (Class) bo.e((AudioTrack.getMinVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMinVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 314, (char) ((ViewConfiguration.getEdgeSlop() >> 16) + 48935), TextUtils.getOffsetAfter("", 0) + 32);
Object[] objArr3 = new Object[1];
m(7, (byte) -1, (short) 0, objArr3);
obj = cls.getMethod((String) objArr3[0], Integer.TYPE);
bo.s.put(1303494992, obj);
}
try {
Object[] objArr4 = {Long.valueOf(((Long) ((Method) obj).invoke(null, objArr2)).longValue()), Long.valueOf(gmVar.e), Long.valueOf(g), Integer.valueOf(c)};
Object obj2 = bo.s.get(274874058);
if (obj2 == null) {
Class cls2 = (Class) bo.e(TextUtils.getTrimmedLength("") + 1193, (char) ((-1) - TextUtils.indexOf((CharSequence) "", '0', 0, 0)), (ViewConfiguration.getKeyRepeatTimeout() >> 16) + 23);
byte b2 = (byte) ($$a[1] + 1);
byte b3 = (byte) (b2 - 4);
Object[] objArr5 = new Object[1];
m(b2, b3, (byte) (b3 + 1), objArr5);
obj2 = cls2.getMethod((String) objArr5[0], Long.TYPE, Long.TYPE, Long.TYPE, Integer.TYPE);
bo.s.put(274874058, obj2);
}
jArr[i3] = ((Long) ((Method) obj2).invoke(null, objArr4)).longValue();
try {
Object[] objArr6 = {gmVar, gmVar};
Object obj3 = bo.s.get(1574944044);
if (obj3 == null) {
Class cls3 = (Class) bo.e(1383 - (ViewConfiguration.getScrollFriction() > BitmapDescriptorFactory.HUE_RED ? 1 : (ViewConfiguration.getScrollFriction() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), (char) ((-1) - ((byte) KeyEvent.getModifierMetaStateMask())), 22 - Drawable.resolveOpacity(0, 0));
Object[] objArr7 = new Object[1];
m(0, (byte) -1, (short) 0, objArr7);
obj3 = cls3.getMethod((String) objArr7[0], Object.class, Object.class);
bo.s.put(1574944044, obj3);
}
((Method) obj3).invoke(null, objArr6);
$10 = ($11 + 1) % 128;
} 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;
}
} catch (Throwable th3) {
Throwable cause3 = th3.getCause();
if (cause3 == null) {
throw th3;
}
throw cause3;
}
}
char[] cArr = new char[i];
gmVar.e = 0;
while (gmVar.e < i) {
$11 = ($10 + 85) % 128;
cArr[gmVar.e] = (char) jArr[gmVar.e];
try {
Object[] objArr8 = {gmVar, gmVar};
Object obj4 = bo.s.get(1574944044);
if (obj4 == null) {
Class cls4 = (Class) bo.e((ViewConfiguration.getEdgeSlop() >> 16) + 1382, (char) ((SystemClock.uptimeMillis() > 0L ? 1 : (SystemClock.uptimeMillis() == 0L ? 0 : -1)) - 1), AndroidCharacter.getMirror('0') - 26);
Object[] objArr9 = new Object[1];
m(0, (byte) -1, (short) 0, objArr9);
obj4 = cls4.getMethod((String) objArr9[0], Object.class, Object.class);
bo.s.put(1574944044, obj4);
}
((Method) obj4).invoke(null, objArr8);
} catch (Throwable th4) {
Throwable cause4 = th4.getCause();
if (cause4 == null) {
throw th4;
}
throw cause4;
}
}
objArr[0] = new String(cArr);
}
static void init$0() {
$$a = new byte[]{Ascii.US, 2, Ascii.NAK, -84};
$$b = 213;
}
static {
init$0();
$10 = 0;
$11 = 1;
k = 0;
n = 1;
j = new char[]{37074, 61773};
g = 7747983839649029479L;
}
}