what-the-bank/sources/scb/yek/NdidKey.java

541 lines
19 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package scb.yek;
import android.graphics.Color;
import android.graphics.ImageFormat;
import android.telephony.cdma.CdmaCellLocation;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.ViewConfiguration;
import com.google.common.base.Ascii;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Locale;
import java.util.UUID;
import net.sf.scuba.smartcards.ISO7816;
import net.sf.scuba.smartcards.ISOFileInfo;
import o.AbstractC14971gdc;
import o.Awr;
import o.C14881gav;
import o.C14957gcv;
import o.C14973gde;
import o.C14977gdi;
import o.C17133uFJ;
import o.GuL;
import o.TAC;
import o.gcH;
import o.gdP;
import o.gdZ;
import o.xzZ;
import org.bouncycastle.crypto.tls.CipherSuite;
import org.bouncycastle.pqc.jcajce.spec.McElieceCCA2KeyGenParameterSpec;
/* loaded from: classes6.dex */
public final class NdidKey extends GetKey {
private static int a;
private static long b;
private static int c;
private static byte d;
private static int e;
private static long g;
private static byte[] h;
private static long i;
private static short[] j;
private static int k;
private static final byte[] $$a = {15, Ascii.DC4, ISO7816.INS_MSE, -3};
private static final int $$b = CipherSuite.TLS_DH_DSS_WITH_AES_128_GCM_SHA256;
private static int $10 = 0;
private static int $11 = 1;
private static final byte[] n = {Ascii.CAN, -103, 8, 6, 47, -8, -47, 46, -6, -5, -7, 8, Ascii.SYN, -31, 5, -18, 15, -19, -9};
/* renamed from: o, reason: collision with root package name */
private static final int f9341o = 81;
private static int f = 0;
public static /* synthetic */ Object a(Object[] objArr, int i2, int i3, int i4) {
int i5 = (i2 * 69) + (i3 * (-67));
int i6 = ~i2;
int i7 = ~i3;
int i8 = ~i4;
return ((i5 + ((((~(i2 | i3)) | (~((i6 | i7) | i8))) | (~(i4 | i3))) * (-68))) + ((~((i6 | i8) | i3)) * (-68))) + (((~(i7 | i8)) | i6) * 68) != 1 ? e(objArr) : d(objArr);
}
/* JADX WARN: Removed duplicated region for block: B:10:0x002b */
/* JADX WARN: Removed duplicated region for block: B:7:0x0023 */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x002b -> B:4:0x0031). 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 v(int r6, int r7, byte r8, java.lang.Object[] r9) {
/*
byte[] r0 = scb.yek.NdidKey.$$a
int r6 = r6 * 2
int r6 = 3 - r6
int r8 = r8 * 2
int r1 = 1 - r8
int r7 = r7 * 2
int r7 = 121 - r7
byte[] r1 = new byte[r1]
r2 = 0
int r8 = 0 - r8
if (r0 != 0) goto L19
r3 = r7
r4 = r2
r7 = r6
goto L31
L19:
r3 = r2
L1a:
int r6 = r6 + 1
byte r4 = (byte) r7
r1[r3] = r4
int r4 = r3 + 1
if (r3 != r8) goto L2b
java.lang.String r6 = new java.lang.String
r6.<init>(r1, r2)
r9[r2] = r6
return
L2b:
r3 = r0[r6]
r5 = r7
r7 = r6
r6 = r3
r3 = r5
L31:
int r6 = r6 + r3
r3 = r4
r5 = r7
r7 = r6
r6 = r5
goto L1a
*/
throw new UnsupportedOperationException("Method not decompiled: scb.yek.NdidKey.v(int, int, byte, java.lang.Object[]):void");
}
public final native String ndidSecretKey(String str);
/* loaded from: classes6.dex */
public static final class IeS {
private IeS() {
}
public /* synthetic */ IeS(byte b) {
this();
}
}
static {
k = 1;
b();
a(new Object[0], 1447218262, -1447218262, (int) System.currentTimeMillis());
e();
new IeS((byte) 0);
byte b2 = (byte) (81 & 7);
byte b3 = b2;
Object[] objArr = new Object[1];
r(b2, b3, b3, objArr);
d((String) objArr[0]);
int i2 = f + 41;
k = i2 % 128;
int i3 = i2 % 2;
}
public final String e(String str, String str2) {
int i2 = 2 % 2;
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
String d2 = d(str, McElieceCCA2KeyGenParameterSpec.SHA1);
String j2 = j();
String str3 = (String) a(new Object[]{j2}, -790280246, 790280247, (int) System.currentTimeMillis());
StringBuilder sb = new StringBuilder();
sb.append(d2);
sb.append(str3);
String obj = sb.toString();
int g2 = g();
String d3 = d(obj, c(g2));
StringBuilder sb2 = new StringBuilder();
sb2.append(d3);
sb2.append(j2);
Object[] objArr = new Object[1];
s(new char[]{11856, 11872, 24965, 59390, 6009}, -TextUtils.indexOf((CharSequence) "", '0', 0), objArr);
sb2.append(((String) objArr[0]).intern());
sb2.append(g2);
String b2 = b(sb2.toString(), str2, ndidSecretKey(str2));
int i3 = k + 41;
f = i3 % 128;
int i4 = i3 % 2;
return b2;
}
private final String b(String str, String str2, String str3) {
int i2 = 2 % 2;
int i3 = k + 37;
f = i3 % 128;
int i4 = i3 % 2;
String c2 = c(str, str2, str3);
int i5 = k + 37;
f = i5 % 128;
int i6 = i5 % 2;
return c2;
}
private static int g() {
int i2 = 2 % 2;
int e2 = C14977gdi.e(new C14973gde(1, 5), AbstractC14971gdc.e);
int i3 = k + 109;
f = i3 % 128;
int i4 = i3 % 2;
return e2;
}
private static String c(int i2) {
String str;
int i3 = 2 % 2;
int i4 = k + 7;
f = i4 % 128;
int i5 = i4 % 2;
try {
str = (String) C14881gav.e("MD5", McElieceCCA2KeyGenParameterSpec.SHA1, McElieceCCA2KeyGenParameterSpec.SHA256, McElieceCCA2KeyGenParameterSpec.SHA384, McElieceCCA2KeyGenParameterSpec.SHA512).get(i2 - 1);
} catch (IndexOutOfBoundsException unused) {
str = null;
}
int i6 = f + 79;
k = i6 % 128;
int i7 = i6 % 2;
return str;
}
private static void s(char[] cArr, int i2, Object[] objArr) {
int i3 = 2 % 2;
GuL guL = new GuL();
char[] a2 = GuL.a(i ^ (-7538262848231253921L), cArr, i2);
guL.a = 4;
int i4 = $11 + 99;
$10 = i4 % 128;
int i5 = i4 % 2;
while (guL.a < a2.length) {
int i6 = $10 + 51;
$11 = i6 % 128;
int i7 = i6 % 2;
guL.c = guL.a - 4;
int i8 = guL.a;
try {
Object[] objArr2 = {Long.valueOf(a2[guL.a] ^ a2[guL.a % 4]), Long.valueOf(guL.c), Long.valueOf(i)};
Object obj = xzZ.y.get(428080616);
if (obj == null) {
Class cls = (Class) xzZ.c(208 - KeyEvent.keyCodeFromString(""), 5 - (CdmaCellLocation.convertQuartSecToDecDegrees(0) > 0.0d ? 1 : (CdmaCellLocation.convertQuartSecToDecDegrees(0) == 0.0d ? 0 : -1)), (char) (1706 - TextUtils.getCapsMode("", 0, 0)));
byte b2 = (byte) 0;
byte b3 = (byte) (b2 + 1);
Object[] objArr3 = new Object[1];
v(b2, b3, (byte) (b3 - 1), objArr3);
obj = cls.getMethod((String) objArr3[0], Long.TYPE, Long.TYPE, Long.TYPE);
xzZ.y.put(428080616, obj);
}
a2[i8] = ((Character) ((Method) obj).invoke(null, objArr2)).charValue();
Object[] objArr4 = {guL, guL};
Object obj2 = xzZ.y.get(-1875914398);
if (obj2 == null) {
Class cls2 = (Class) xzZ.c(Color.red(0) + 392, 4 - ImageFormat.getBitsPerPixel(0), (char) (ViewConfiguration.getScrollDefaultDelay() >> 16));
byte b4 = (byte) 0;
byte b5 = b4;
Object[] objArr5 = new Object[1];
v(b4, b5, b5, objArr5);
obj2 = cls2.getMethod((String) objArr5[0], Object.class, Object.class);
xzZ.y.put(-1875914398, obj2);
}
((Method) obj2).invoke(null, objArr4);
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
objArr[0] = new String(a2, 4, a2.length - 4);
}
private static void u(char[] cArr, int i2, Object[] objArr) {
int i3 = 2 % 2;
GuL guL = new GuL();
char[] a2 = GuL.a(g ^ (-7538262848231253921L), cArr, i2);
guL.a = 4;
while (guL.a < a2.length) {
int i4 = f + 65;
k = i4 % 128;
int i5 = i4 % 2;
guL.c = guL.a - 4;
a2[guL.a] = (char) ((a2[guL.a] ^ a2[guL.a % 4]) ^ (guL.c * (g ^ (-7538262848231253921L))));
guL.a++;
int i6 = f + 67;
k = i6 % 128;
if (i6 % 2 == 0) {
int i7 = 4 % 2;
}
}
objArr[0] = new String(a2, 4, a2.length - 4);
}
private static String d(String str, String str2) {
String b2;
int i2 = 2 % 2;
int i3 = k;
int i4 = i3 + 19;
f = i4 % 128;
String str3 = null;
if (i4 % 2 != 0) {
str3.hashCode();
throw null;
}
if (str2 == null) {
return null;
}
int i5 = i3 + 61;
f = i5 % 128;
try {
if (i5 % 2 != 0) {
MessageDigest messageDigest = MessageDigest.getInstance(str2);
byte[] bytes = str.getBytes(gdP.a);
C14957gcv.c(bytes, "");
messageDigest.update(bytes, 0, bytes.length);
byte[] digest = messageDigest.digest();
C14957gcv.c(digest, "");
b2 = b(digest);
} else {
MessageDigest messageDigest2 = MessageDigest.getInstance(str2);
byte[] bytes2 = str.getBytes(gdP.a);
C14957gcv.c(bytes2, "");
messageDigest2.update(bytes2, 0, bytes2.length);
byte[] digest2 = messageDigest2.digest();
C14957gcv.c(digest2, "");
b2 = b(digest2);
}
str3 = b2;
int i6 = k + 53;
f = i6 % 128;
int i7 = i6 % 2;
return str3;
} catch (UnsupportedEncodingException | NoSuchAlgorithmException unused) {
return str3;
}
}
private static String j() {
int i2 = 2 % 2;
int i3 = f + 67;
k = i3 % 128;
int i4 = i3 % 2;
String obj = UUID.randomUUID().toString();
C14957gcv.c((Object) obj, "");
String upperCase = gdZ.a(obj, "-", "").toUpperCase(Locale.ROOT);
C14957gcv.c((Object) upperCase, "");
int i5 = k + 19;
f = i5 % 128;
int i6 = i5 % 2;
return upperCase;
}
private static /* synthetic */ Object d(Object[] objArr) {
String str = (String) objArr[0];
int i2 = 2 % 2;
String substring = str.substring(0, 4);
C14957gcv.c((Object) substring, "");
C14957gcv.e(str, "");
C14957gcv.e(substring, "");
C14957gcv.e("NDID", "");
String str2 = str;
int e2 = gdZ.e((CharSequence) str2, substring, 0, false);
if (e2 >= 0) {
int i3 = k + 77;
f = i3 % 128;
int i4 = i3 % 2;
str = gdZ.d(str2, e2, substring.length() + e2, "NDID").toString();
int i5 = f + 21;
k = i5 % 128;
int i6 = i5 % 2;
}
String upperCase = str.toUpperCase(Locale.ROOT);
C14957gcv.c((Object) upperCase, "");
return upperCase;
}
private static String b(byte[] bArr) {
int i2 = 2 % 2;
StringBuffer stringBuffer = new StringBuffer();
for (byte b2 : bArr) {
int i3 = k + 1;
f = i3 % 128;
int i4 = i3 % 2;
gcH gch = gcH.d;
String format = String.format("%02x", Arrays.copyOf(new Object[]{Byte.valueOf(b2)}, 1));
C14957gcv.c((Object) format, "");
stringBuffer.append(format);
}
String obj = stringBuffer.toString();
C14957gcv.c((Object) obj, "");
String upperCase = obj.toUpperCase(Locale.ROOT);
C14957gcv.c((Object) upperCase, "");
int i5 = f + 119;
k = i5 % 128;
if (i5 % 2 == 0) {
int i6 = 35 / 0;
}
return upperCase;
}
private static InputStream c(InputStream inputStream, int i2, int i3, byte[] bArr) throws IOException {
int i4 = 2 % 2;
int length = bArr.length;
byte[] bArr2 = new byte[length];
System.arraycopy(bArr, 0, bArr2, 0, length);
TAC.c(bArr2, d, b);
C17133uFJ c17133uFJ = new C17133uFJ(inputStream, i3, bArr2, Awr.e(i2));
int i5 = k + 55;
f = i5 % 128;
int i6 = i5 % 2;
return c17133uFJ;
}
/* JADX WARN: Code restructure failed: missing block: B:19:0x0092, code lost:
if ((!r4) != true) goto L24;
*/
/* JADX WARN: Code restructure failed: missing block: B:20:0x00a2, code lost:
r4 = 0;
*/
/* JADX WARN: Code restructure failed: missing block: B:45:0x00a0, code lost:
r4 = 1;
*/
/* JADX WARN: Code restructure failed: missing block: B:47:0x009e, code lost:
if (r4 != false) goto L24;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static void t(short r14, byte r15, int r16, int r17, int r18, java.lang.Object[] r19) {
/*
Method dump skipped, instructions count: 321
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: scb.yek.NdidKey.t(short, byte, int, int, int, java.lang.Object[]):void");
}
private static /* synthetic */ Object e(Object[] objArr) {
int i2 = 2 % 2;
int i3 = k + 11;
f = i3 % 128;
int i4 = i3 % 2;
c = -1853951898;
a = 1406017026;
e = -1333874776;
if (i4 == 0) {
h = new byte[]{-13, -5, 3, -4, 70, -56, -5, -12, 65, -59, -6, 8, ISO7816.INS_DECREASE, ISO7816.INS_GET_DATA, -23, Ascii.ETB, -7, 49, ISO7816.INS_GET_DATA, -23, Ascii.ETB, -7, 49, 15, -11, 9, -27, Ascii.ETB, -13, 0, -112, -100, 109, -102, 96, -33, 38, -97, -94, 84, 114, ISOFileInfo.SECURITY_ATTR_COMPACT, 110, ISOFileInfo.FCI_EXT, 123, ISOFileInfo.LCS_BYTE, 121, -122, 92, ISOFileInfo.A1, ISO7816.INS_MANAGE_CHANNEL, ISOFileInfo.DATA_BYTES2, ISOFileInfo.SECURITY_ATTR_COMPACT, 76, -120, -102, 109, -66, 78, -102, -119, 110, 40, 40, 37, ISO7816.INS_GET_RESPONSE, 43, ISO7816.INS_WRITE_RECORD, 33, -84, Byte.MIN_VALUE, 122, 122, 85, ISO7816.INS_READ_BINARY2, 104, ISOFileInfo.CHANNEL_SECURITY, 87, -90, 119, ISO7816.INS_READ_RECORD2, -69, 89, ISOFileInfo.A1, 71, -89, -51, -31, 60, -51, -3, -3, 14, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK};
g = 2814074415215608964L;
return null;
}
h = new byte[]{-13, -5, 3, -4, 70, -56, -5, -12, 65, -59, -6, 8, ISO7816.INS_DECREASE, ISO7816.INS_GET_DATA, -23, Ascii.ETB, -7, 49, ISO7816.INS_GET_DATA, -23, Ascii.ETB, -7, 49, 15, -11, 9, -27, Ascii.ETB, -13, 0, -112, -100, 109, -102, 96, -33, 38, -97, -94, 84, 114, ISOFileInfo.SECURITY_ATTR_COMPACT, 110, ISOFileInfo.FCI_EXT, 123, ISOFileInfo.LCS_BYTE, 121, -122, 92, ISOFileInfo.A1, ISO7816.INS_MANAGE_CHANNEL, ISOFileInfo.DATA_BYTES2, ISOFileInfo.SECURITY_ATTR_COMPACT, 76, -120, -102, 109, -66, 78, -102, -119, 110, 40, 40, 37, ISO7816.INS_GET_RESPONSE, 43, ISO7816.INS_WRITE_RECORD, 33, -84, Byte.MIN_VALUE, 122, 122, 85, ISO7816.INS_READ_BINARY2, 104, ISOFileInfo.CHANNEL_SECURITY, 87, -90, 119, ISO7816.INS_READ_RECORD2, -69, 89, ISOFileInfo.A1, 71, -89, -51, -31, 60, -51, -3, -3, 14, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK, Ascii.NAK};
g = 2814074415215608964L;
throw null;
}
/* JADX WARN: Removed duplicated region for block: B:10:0x002a */
/* JADX WARN: Removed duplicated region for block: B:7:0x0022 */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x002a -> B:4:0x002f). 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 r(short r6, int r7, byte r8, java.lang.Object[] r9) {
/*
int r8 = r8 * 5
int r0 = 11 - r8
int r7 = r7 * 4
int r7 = 102 - r7
byte[] r1 = scb.yek.NdidKey.n
int r6 = r6 * 5
int r6 = 8 - r6
byte[] r0 = new byte[r0]
int r8 = 10 - r8
r2 = 0
if (r1 != 0) goto L18
r3 = r8
r4 = r2
goto L2f
L18:
r3 = r2
L19:
int r6 = r6 + 1
byte r4 = (byte) r7
r0[r3] = r4
int r4 = r3 + 1
if (r3 != r8) goto L2a
java.lang.String r6 = new java.lang.String
r6.<init>(r0, r2)
r9[r2] = r6
return
L2a:
r3 = r1[r6]
r5 = r3
r3 = r7
r7 = r5
L2f:
int r7 = -r7
int r3 = r3 + r7
int r7 = r3 + (-2)
r3 = r4
goto L19
*/
throw new UnsupportedOperationException("Method not decompiled: scb.yek.NdidKey.r(short, int, byte, java.lang.Object[]):void");
}
static void b() {
i = -7403838449275933046L;
}
static void d() {
a(new Object[0], 1447218262, -1447218262, (int) System.currentTimeMillis());
}
static void e() {
int i2 = 2 % 2;
int i3 = f + 83;
int i4 = i3 % 128;
k = i4;
int i5 = i3 % 2;
b = -5460580109075031448L;
d = ISO7816.INS_PUT_DATA;
int i6 = i4 + 79;
f = i6 % 128;
if (i6 % 2 != 0) {
throw null;
}
}
/* JADX WARN: Removed duplicated region for block: B:120:0x0674 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:40:0x041e A[EXC_TOP_SPLITTER, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static void d(java.lang.String r24) {
/*
Method dump skipped, instructions count: 2010
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: scb.yek.NdidKey.d(java.lang.String):void");
}
private static String b(String str) {
return (String) a(new Object[]{str}, -790280246, 790280247, (int) System.currentTimeMillis());
}
}