what-the-bank/sources/o/C15602gz.java

615 lines
21 KiB
Java

package o;
import android.graphics.Color;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Base64;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.scb.phone.domain.errors.RetrofitException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Locale;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.threeten.bp.OffsetDateTime;
/* renamed from: o.gz */
/* loaded from: classes.dex */
public class C15602gz {
private static final byte[] $$a = {9, -71, 104, 33};
private static final int $$b = 50;
private static int $10 = 0;
private static int $11 = 1;
private static int a = 0;
private static int f = 1;
private static char[] d = {16299};
private static int e = 1934311323;
private static boolean b = true;
private static boolean c = true;
public static /* synthetic */ Object b(Object[] objArr, int i, int i2, int i3) {
int i4 = ~i2;
int i5 = ~i3;
int i6 = (i * (-830)) + (i2 * 832) + (((~(i4 | i5)) | (~(i | i2 | i3))) * (-831)) + ((~(i4 | i | i3)) * (-1662)) + (((~(i | i3)) | (~((~i) | i5)) | (~(i2 | i3))) * 831);
return i6 != 1 ? i6 != 2 ? e(objArr) : d(objArr) : a(objArr);
}
private static void i(int i, short s, int i2, Object[] objArr) {
int i3 = 3 - (i * 4);
int i4 = (s * 57) + 65;
int i5 = i2 * 4;
byte[] bArr = $$a;
byte[] bArr2 = new byte[1 - i5];
int i6 = 0 - i5;
int i7 = -1;
if (bArr == null) {
i7 = -1;
i4 = i3 + i4;
i3 = i3;
}
while (true) {
int i8 = i7 + 1;
bArr2[i8] = (byte) i4;
if (i8 == i6) {
objArr[0] = new String(bArr2, 0);
return;
}
int i9 = i3 + 1;
i7 = i8;
i4 = bArr[i9] + i4;
i3 = i9;
}
}
private C15602gz() {
}
public static long d() {
int i = 2 % 2;
int i2 = f + 17;
a = i2 % 128;
int i3 = i2 % 2;
long timeInMillis = Calendar.getInstance().getTimeInMillis();
int i4 = f + 11;
a = i4 % 128;
int i5 = i4 % 2;
return timeInMillis;
}
public static String e(double d2) {
int i = 2 % 2;
DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.getDefault());
decimalFormatSymbols.setDecimalSeparator('.');
decimalFormatSymbols.setGroupingSeparator(',');
String format = new DecimalFormat("0.00", decimalFormatSymbols).format(d2);
int i2 = f + 97;
a = i2 % 128;
if (i2 % 2 == 0) {
return format;
}
Object obj = null;
obj.hashCode();
throw null;
}
private static /* synthetic */ Object a(Object[] objArr) {
String str = (String) objArr[0];
int i = 2 % 2;
int i2 = f + 101;
a = i2 % 128;
try {
if (i2 % 2 != 0) {
Double.parseDouble(str.replace(",", ""));
Object obj = null;
obj.hashCode();
throw null;
}
double parseDouble = Double.parseDouble(str.replace(",", ""));
int i3 = a + 81;
f = i3 % 128;
int i4 = i3 % 2;
return Double.valueOf(parseDouble);
} catch (Exception unused) {
return Double.valueOf(0.0d);
}
}
private static /* synthetic */ Object d(Object[] objArr) {
boolean z = false;
int i = 2 % 2;
if (((String) objArr[0]).length() == 10) {
z = true;
} else {
int i2 = f + 15;
a = i2 % 128;
int i3 = i2 % 2;
}
int i4 = f + 65;
a = i4 % 128;
if (i4 % 2 == 0) {
return Boolean.valueOf(z);
}
Object obj = null;
obj.hashCode();
throw null;
}
public static boolean b(String str) {
int i = 2 % 2;
if (str.length() == 13) {
int i2 = a + 103;
f = i2 % 128;
int i3 = i2 % 2;
return true;
}
int i4 = a + 61;
f = i4 % 128;
int i5 = i4 % 2;
return false;
}
public static boolean e(String str) {
boolean z;
int i = 2 % 2;
int i2 = f + 73;
a = i2 % 128;
Object obj = null;
if (i2 % 2 != 0) {
b(str);
obj.hashCode();
throw null;
}
if (b(str) || ((Boolean) b(new Object[]{str}, -396693817, 396693819, (int) System.currentTimeMillis())).booleanValue()) {
z = true;
} else {
int i3 = a + 119;
f = i3 % 128;
int i4 = i3 % 2;
z = false;
}
int i5 = f + 53;
a = i5 % 128;
if (i5 % 2 == 0) {
return z;
}
obj.hashCode();
throw null;
}
/* JADX WARN: Code restructure failed: missing block: B:10:0x0032, code lost:
r1 = o.C15602gz.a + 29;
o.C15602gz.f = r1 % 128;
*/
/* JADX WARN: Code restructure failed: missing block: B:11:0x0041, code lost:
if ((r1 % 2) != 0) goto L37;
*/
/* JADX WARN: Code restructure failed: missing block: B:12:0x0043, code lost:
r4 = new java.lang.Object[1];
g(null, new byte[]{net.sf.scuba.smartcards.ISOFileInfo.DATA_BYTES2}, null, 64 % android.text.TextUtils.indexOf("", "", 0, 1), r4);
*/
/* JADX WARN: Code restructure failed: missing block: B:13:0x005f, code lost:
if (r7.startsWith(((java.lang.String) r4[0]).intern()) == false) goto L41;
*/
/* JADX WARN: Code restructure failed: missing block: B:14:0x0080, code lost:
r7 = o.C15602gz.a + 45;
o.C15602gz.f = r7 % 128;
r7 = r7 % 2;
*/
/* JADX WARN: Code restructure failed: missing block: B:15:?, code lost:
return true;
*/
/* JADX WARN: Code restructure failed: missing block: B:16:0x0062, code lost:
r4 = new java.lang.Object[1];
g(null, new byte[]{net.sf.scuba.smartcards.ISOFileInfo.DATA_BYTES2}, null, 127 - android.text.TextUtils.indexOf("", "", 0, 0), r4);
*/
/* JADX WARN: Code restructure failed: missing block: B:17:0x007d, code lost:
if (r7.startsWith(((java.lang.String) r4[0]).intern()) == true) goto L40;
*/
/* JADX WARN: Code restructure failed: missing block: B:18:0x0015, code lost:
if (r7 != null) goto L30;
*/
/* JADX WARN: Code restructure failed: missing block: B:4:0x0012, code lost:
if (r7 != null) goto L30;
*/
/* JADX WARN: Code restructure failed: missing block: B:9:0x0030, code lost:
if (((java.lang.Boolean) b(new java.lang.Object[]{r7}, -396693817, 396693819, (int) java.lang.System.currentTimeMillis())).booleanValue() == false) goto L41;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static boolean a(java.lang.String r7) {
/*
r0 = 2
int r1 = r0 % r0
int r1 = o.C15602gz.f
int r1 = r1 + 85
int r2 = r1 % 128
o.C15602gz.a = r2
int r1 = r1 % r0
r2 = 0
if (r1 == 0) goto L15
r1 = 73
int r1 = r1 / r2
if (r7 == 0) goto L8b
goto L17
L15:
if (r7 == 0) goto L8b
L17:
java.lang.Object[] r1 = new java.lang.Object[]{r7}
long r3 = java.lang.System.currentTimeMillis()
int r3 = (int) r3
r4 = -396693817(0xffffffffe85aeec7, float:-4.1355222E24)
r5 = 396693819(0x17a5113b, float:1.0667225E-24)
java.lang.Object r1 = b(r1, r4, r5, r3)
java.lang.Boolean r1 = (java.lang.Boolean) r1
boolean r1 = r1.booleanValue()
if (r1 == 0) goto L8b
int r1 = o.C15602gz.a
int r1 = r1 + 29
int r3 = r1 % 128
o.C15602gz.f = r3
int r1 = r1 % r0
r3 = -127(0xffffffffffffff81, float:NaN)
java.lang.String r4 = ""
r5 = 0
r6 = 1
if (r1 != 0) goto L62
byte[] r1 = new byte[r6]
r1[r2] = r3
r3 = 64
int r4 = android.text.TextUtils.indexOf(r4, r4, r2, r6)
int r3 = r3 % r4
java.lang.Object[] r4 = new java.lang.Object[r6]
g(r5, r1, r5, r3, r4)
r1 = r4[r2]
java.lang.String r1 = (java.lang.String) r1
java.lang.String r1 = r1.intern()
boolean r7 = r7.startsWith(r1)
if (r7 == 0) goto L8b
goto L80
L62:
byte[] r1 = new byte[r6]
r1[r2] = r3
int r3 = android.text.TextUtils.indexOf(r4, r4, r2, r2)
int r3 = 127 - r3
java.lang.Object[] r4 = new java.lang.Object[r6]
g(r5, r1, r5, r3, r4)
r1 = r4[r2]
java.lang.String r1 = (java.lang.String) r1
java.lang.String r1 = r1.intern()
boolean r7 = r7.startsWith(r1)
if (r7 == r6) goto L80
goto L8b
L80:
int r7 = o.C15602gz.a
int r7 = r7 + 45
int r1 = r7 % 128
o.C15602gz.f = r1
int r7 = r7 % r0
r2 = r6
goto L94
L8b:
int r7 = o.C15602gz.f
int r7 = r7 + 17
int r1 = r7 % 128
o.C15602gz.a = r1
int r7 = r7 % r0
L94:
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: o.C15602gz.a(java.lang.String):boolean");
}
public static String b(String str, String str2, String str3) {
String replaceAll;
synchronized (C15602gz.class) {
String replaceAll2 = str.replaceAll(str2, "");
char[] charArray = str3.toCharArray();
char[] charArray2 = replaceAll2.toCharArray();
StringBuilder sb = new StringBuilder();
int i = 0;
for (char c2 : charArray) {
if (i >= charArray2.length) {
break;
}
if (c2 != 'X') {
sb.append(c2);
} else {
sb.append(charArray2[i]);
i++;
}
}
replaceAll = sb.toString().replaceAll("X", "");
}
return replaceAll;
}
public static boolean e(Throwable th, RetrofitException.RVV... rvvArr) {
int i = 2 % 2;
int i2 = a + 95;
f = i2 % 128;
int i3 = i2 % 2;
boolean z = true;
if (!(!(th instanceof RetrofitException)) && Arrays.asList(rvvArr).contains(((RetrofitException) th).d)) {
int i4 = a + 55;
f = i4 % 128;
int i5 = i4 % 2;
} else {
z = false;
}
int i6 = a + 75;
f = i6 % 128;
if (i6 % 2 == 0) {
int i7 = 26 / 0;
}
return z;
}
public static boolean c(Throwable th, String... strArr) {
int i = 2 % 2;
VCl vCl = ((RetrofitException) th).e;
if ((th instanceof RetrofitException) && vCl != null) {
int i2 = f + 123;
a = i2 % 128;
if (i2 % 2 != 0) {
ggV ggv = vCl.c;
throw null;
}
if (vCl.c != null && Arrays.asList(strArr).contains(vCl.c.e)) {
int i3 = f + 27;
a = i3 % 128;
int i4 = i3 % 2;
return true;
}
}
return false;
}
public static OffsetDateTime d(String str, String str2) {
int i = 2 % 2;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(str);
Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(simpleDateFormat.parse(str2));
int i2 = f + 111;
a = i2 % 128;
int i3 = i2 % 2;
} catch (ParseException e2) {
guQ.e(e2);
}
return OffsetDateTime.ofInstant(C15517gsm.toInstant(calendar), AbstractC15502gsH.of("Asia/Bangkok"));
}
public static String a(String str, String str2) {
int i = 2 % 2;
int i2 = a + 111;
f = i2 % 128;
int i3 = i2 % 2;
Object[] objArr = {str.getBytes(), str2};
int currentTimeMillis = (int) System.currentTimeMillis();
if (i3 != 0) {
return (String) b(objArr, -1261224839, 1261224839, currentTimeMillis);
}
throw null;
}
public static String b(File file, String str) {
int i = 2 % 2;
try {
FileInputStream fileInputStream = new FileInputStream(file);
try {
byte[] bArr = new byte[(int) file.length()];
if (file.length() != fileInputStream.read(bArr)) {
int i2 = f + 45;
a = i2 % 128;
int i3 = i2 % 2;
fileInputStream.close();
return "";
}
fileInputStream.close();
String str2 = (String) b(new Object[]{Base64.encodeToString(bArr, 2).getBytes(), str}, -1261224839, 1261224839, (int) System.currentTimeMillis());
int i4 = f + 71;
a = i4 % 128;
if (i4 % 2 == 0) {
return str2;
}
throw null;
} finally {
}
} catch (IOException unused) {
return "";
}
}
private static /* synthetic */ Object e(Object[] objArr) {
byte[] bArr = (byte[]) objArr[0];
String str = (String) objArr[1];
int i = 2 % 2;
try {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(str.getBytes(), "HmacSHA256"));
String encodeToString = Base64.encodeToString(mac.doFinal(bArr), 2);
int i2 = f + 37;
a = i2 % 128;
if (i2 % 2 == 0) {
return encodeToString;
}
Object obj = null;
obj.hashCode();
throw null;
} catch (InvalidKeyException | NoSuchAlgorithmException unused) {
return "";
}
}
public static String h(String str) {
int i = 2 % 2;
int i2 = f + 19;
a = i2 % 128;
int i3 = i2 % 2;
String replaceAll = str.replaceAll("\\<.*?\\>", "");
int i4 = f + 13;
a = i4 % 128;
if (i4 % 2 != 0) {
int i5 = 84 / 0;
}
return replaceAll;
}
private static void g(char[] cArr, byte[] bArr, int[] iArr, int i, Object[] objArr) {
int i2 = 2;
int i3 = 2 % 2;
C3614bBe c3614bBe = new C3614bBe();
char[] cArr2 = d;
long j = 0;
if (cArr2 != null) {
int length = cArr2.length;
char[] cArr3 = new char[length];
int i4 = 0;
while (i4 < length) {
int i5 = $10 + 89;
$11 = i5 % 128;
int i6 = i5 % i2;
try {
Object[] objArr2 = {Integer.valueOf(cArr2[i4])};
Object obj = xzZ.y.get(-950481649);
if (obj == null) {
Class cls = (Class) xzZ.c(337 - View.resolveSizeAndState(0, 0, 0), 5 - (TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), (char) (1 - (SystemClock.uptimeMillis() > j ? 1 : (SystemClock.uptimeMillis() == j ? 0 : -1))));
byte b2 = (byte) 0;
byte b3 = b2;
Object[] objArr3 = new Object[1];
i(b2, b3, b3, objArr3);
obj = cls.getMethod((String) objArr3[0], Integer.TYPE);
xzZ.y.put(-950481649, obj);
}
cArr3[i4] = ((Character) ((Method) obj).invoke(null, objArr2)).charValue();
i4++;
i2 = 2;
j = 0;
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
cArr2 = cArr3;
}
try {
Object[] objArr4 = {Integer.valueOf(e)};
Object obj2 = xzZ.y.get(-1521625011);
if (obj2 == null) {
Class cls2 = (Class) xzZ.c(284 - (SystemClock.elapsedRealtime() > 0L ? 1 : (SystemClock.elapsedRealtime() == 0L ? 0 : -1)), (ViewConfiguration.getFadingEdgeLength() >> 16) + 5, (char) (Color.red(0) + 39813));
byte b4 = (byte) 0;
byte b5 = (byte) (b4 + 1);
Object[] objArr5 = new Object[1];
i(b4, b5, (byte) (b5 - 1), objArr5);
obj2 = cls2.getMethod((String) objArr5[0], Integer.TYPE);
xzZ.y.put(-1521625011, obj2);
}
int intValue = ((Integer) ((Method) obj2).invoke(null, objArr4)).intValue();
if (c) {
c3614bBe.c = bArr.length;
char[] cArr4 = new char[c3614bBe.c];
c3614bBe.a = 0;
int i7 = $11 + 53;
$10 = i7 % 128;
int i8 = i7 % 2;
while (c3614bBe.a < c3614bBe.c) {
cArr4[c3614bBe.a] = (char) (cArr2[bArr[(c3614bBe.c - 1) - c3614bBe.a] + i] - intValue);
Object[] objArr6 = {c3614bBe, c3614bBe};
Object obj3 = xzZ.y.get(1779759091);
if (obj3 == null) {
obj3 = ((Class) xzZ.c(TextUtils.lastIndexOf("", '0', 0, 0) + 41, KeyEvent.normalizeMetaState(0) + 5, (char) ((-1) - TextUtils.lastIndexOf("", '0', 0)))).getMethod("D", Object.class, Object.class);
xzZ.y.put(1779759091, obj3);
}
((Method) obj3).invoke(null, objArr6);
}
objArr[0] = new String(cArr4);
return;
}
if (b) {
c3614bBe.c = cArr.length;
char[] cArr5 = new char[c3614bBe.c];
c3614bBe.a = 0;
while (c3614bBe.a < c3614bBe.c) {
cArr5[c3614bBe.a] = (char) (cArr2[cArr[(c3614bBe.c - 1) - c3614bBe.a] - i] - intValue);
Object[] objArr7 = {c3614bBe, c3614bBe};
Object obj4 = xzZ.y.get(1779759091);
if (obj4 == null) {
obj4 = ((Class) xzZ.c(39 - MotionEvent.axisFromString(""), 5 - View.combineMeasuredStates(0, 0), (char) (ViewConfiguration.getLongPressTimeout() >> 16))).getMethod("D", Object.class, Object.class);
xzZ.y.put(1779759091, obj4);
}
((Method) obj4).invoke(null, objArr7);
}
objArr[0] = new String(cArr5);
return;
}
c3614bBe.c = iArr.length;
char[] cArr6 = new char[c3614bBe.c];
while (true) {
c3614bBe.a = 0;
while (c3614bBe.a < c3614bBe.c) {
int i9 = $11 + 61;
$10 = i9 % 128;
if (i9 % 2 != 0) {
break;
}
cArr6[c3614bBe.a] = (char) (cArr2[iArr[(c3614bBe.c - 1) - c3614bBe.a] - i] - intValue);
c3614bBe.a++;
}
objArr[0] = new String(cArr6);
return;
cArr6[c3614bBe.a] = (char) (cArr2[iArr[c3614bBe.c % c3614bBe.a] + i] >>> intValue);
int i10 = c3614bBe.a;
}
} catch (Throwable th2) {
Throwable cause2 = th2.getCause();
if (cause2 == null) {
throw th2;
}
throw cause2;
}
}
private static String e(byte[] bArr, String str) {
return (String) b(new Object[]{bArr, str}, -1261224839, 1261224839, (int) System.currentTimeMillis());
}
public static double d(String str) {
return ((Double) b(new Object[]{str}, 108298166, -108298165, (int) System.currentTimeMillis())).doubleValue();
}
public static boolean c(String str) {
return ((Boolean) b(new Object[]{str}, -396693817, 396693819, (int) System.currentTimeMillis())).booleanValue();
}
}