what-the-bank/sources/org/jmrtd/cert/CVCPrincipal.java

408 lines
14 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.jmrtd.cert;
import android.graphics.Color;
import android.media.AudioTrack;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.ExpandableListView;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.security.Principal;
import net.sf.scuba.data.Country;
import o.C4403bZM;
import o.xzZ;
import org.jmrtd.lds.CVCAFile;
/* loaded from: classes6.dex */
public class CVCPrincipal implements Principal, Serializable {
private static final long serialVersionUID = -4905647207367309688L;
private Country country;
private String mnemonic;
private String seqNumber;
private static final byte[] $$a = {94, -37, CVCAFile.CAR_TAG, -43};
private static final int $$b = 3;
private static int $10 = 0;
private static int $11 = 1;
private static int a = 0;
private static int d = 1;
private static int[] b = {616574886, -2057620383, 681971084, -622587236, -239217490, -1646062571, 1247386951, 1635574579, -1342438197, -1837109661, 758066643, -110787795, 581945607, -1012633592, 564596538, 62824148, 1065444366, -1536479298};
/* JADX WARN: Removed duplicated region for block: B:10:0x002e */
/* JADX WARN: Removed duplicated region for block: B:7:0x0026 */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x002e -> B:4:0x0030). 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 f(byte r6, byte r7, byte r8, java.lang.Object[] r9) {
/*
byte[] r0 = org.jmrtd.cert.CVCPrincipal.$$a
int r7 = r7 * 3
int r1 = 1 - r7
int r6 = r6 * 3
int r6 = 3 - r6
int r8 = r8 * 2
int r8 = r8 + 102
byte[] r1 = new byte[r1]
r2 = 0
int r7 = 0 - r7
if (r0 != 0) goto L19
r8 = r6
r3 = r7
r4 = r2
goto L30
L19:
r3 = r2
r5 = r8
r8 = r6
r6 = r5
L1d:
byte r4 = (byte) r6
r1[r3] = r4
int r8 = r8 + 1
int r4 = r3 + 1
if (r3 != r7) goto L2e
java.lang.String r6 = new java.lang.String
r6.<init>(r1, r2)
r9[r2] = r6
return
L2e:
r3 = r0[r8]
L30:
int r6 = r6 + r3
r3 = r4
goto L1d
*/
throw new UnsupportedOperationException("Method not decompiled: org.jmrtd.cert.CVCPrincipal.f(byte, byte, byte, java.lang.Object[]):void");
}
public CVCPrincipal(String str) {
String obj;
if (str == null || str.length() < 7 || str.length() > 16) {
if ("Name should be <Country (2F)><Mnemonic (9V)><SeqNum (5F)> formatted, found ".concat(String.valueOf(str)) == null) {
int i = a + 55;
d = i % 128;
int i2 = i % 2;
Object[] objArr = new Object[1];
e(new int[]{1510285430, 1716848664}, 3 - ExpandableListView.getPackedPositionChild(0L), objArr);
obj = ((String) objArr[0]).intern();
} else {
StringBuilder sb = new StringBuilder("\"");
sb.append(str);
sb.append("\"");
obj = sb.toString();
}
int i3 = 2 % 2;
throw new IllegalArgumentException(obj);
}
int i4 = d + 35;
a = i4 % 128;
int i5 = i4 % 2;
this.country = Country.getInstance(str.substring(0, 2).toUpperCase());
this.mnemonic = str.substring(2, str.length() - 5);
this.seqNumber = str.substring(str.length() - 5, str.length());
}
public CVCPrincipal(Country country, String str, String str2) {
if (str == null || str.length() > 9) {
throw new IllegalArgumentException("Wrong length mnemonic");
}
if (str2 != null && str2.length() == 5) {
int i = a + 81;
int i2 = i % 128;
d = i2;
int i3 = i % 2;
this.country = country;
this.mnemonic = str;
this.seqNumber = str2;
int i4 = i2 + 115;
a = i4 % 128;
int i5 = i4 % 2;
return;
}
throw new IllegalArgumentException("Wrong length seqNumber");
}
@Override // java.security.Principal
public String getName() {
int i = 2 % 2;
StringBuilder sb = new StringBuilder();
sb.append(this.country.toAlpha2Code());
sb.append(this.mnemonic);
sb.append(this.seqNumber);
String obj = sb.toString();
int i2 = d + 123;
a = i2 % 128;
int i3 = i2 % 2;
return obj;
}
@Override // java.security.Principal
public String toString() {
int i = 2 % 2;
StringBuilder sb = new StringBuilder();
sb.append(this.country.toAlpha2Code());
sb.append("/");
sb.append(this.mnemonic);
sb.append("/");
sb.append(this.seqNumber);
String obj = sb.toString();
int i2 = a + 81;
d = i2 % 128;
int i3 = i2 % 2;
return obj;
}
@Override // java.security.Principal
public boolean equals(Object obj) {
int i = 2 % 2;
if (obj == null) {
int i2 = d + 107;
a = i2 % 128;
int i3 = i2 % 2;
return false;
}
if (obj == this) {
return true;
}
if (!obj.getClass().equals(getClass())) {
return false;
}
CVCPrincipal cVCPrincipal = (CVCPrincipal) obj;
if (!cVCPrincipal.country.equals(this.country)) {
return false;
}
int i4 = a + 37;
d = i4 % 128;
if (i4 % 2 == 0) {
if (!cVCPrincipal.mnemonic.equals(this.mnemonic)) {
return false;
}
} else if (!cVCPrincipal.mnemonic.equals(this.mnemonic)) {
return false;
}
if (!cVCPrincipal.seqNumber.equals(this.seqNumber)) {
return false;
}
int i5 = d + 123;
a = i5 % 128;
int i6 = i5 % 2;
return true;
}
private static void e(int[] iArr, int i, Object[] objArr) {
int length;
int[] iArr2;
int i2;
int i3;
int i4 = 2 % 2;
C4403bZM c4403bZM = new C4403bZM();
char[] cArr = new char[4];
char[] cArr2 = new char[iArr.length * 2];
int[] iArr3 = b;
char c = '0';
int i5 = 1;
int i6 = 0;
if (iArr3 != null) {
int length2 = iArr3.length;
int[] iArr4 = new int[length2];
int i7 = 0;
while (i7 < length2) {
try {
Object[] objArr2 = new Object[i5];
objArr2[0] = Integer.valueOf(iArr3[i7]);
Object obj = xzZ.y.get(729798706);
if (obj == null) {
obj = ((Class) xzZ.c(14 - TextUtils.indexOf("", c, 0, 0), (SystemClock.elapsedRealtime() > 0L ? 1 : (SystemClock.elapsedRealtime() == 0L ? 0 : -1)) + 4, (char) (58134 - Color.alpha(0)))).getMethod("i", Integer.TYPE);
xzZ.y.put(729798706, obj);
}
iArr4[i7] = ((Integer) ((Method) obj).invoke(null, objArr2)).intValue();
i7++;
c = '0';
i5 = 1;
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
iArr3 = iArr4;
}
int length3 = iArr3.length;
int[] iArr5 = new int[length3];
int[] iArr6 = b;
if (iArr6 != null) {
int i8 = $10 + 19;
$11 = i8 % 128;
if (i8 % 2 == 0) {
length = iArr6.length;
iArr2 = new int[length];
i2 = 1;
} else {
length = iArr6.length;
iArr2 = new int[length];
i2 = 0;
}
while (i2 < length) {
int i9 = $10 + 27;
$11 = i9 % 128;
if (i9 % 2 == 0) {
Object[] objArr3 = new Object[1];
objArr3[i6] = Integer.valueOf(iArr6[i2]);
Object obj2 = xzZ.y.get(729798706);
if (obj2 != null) {
i3 = length;
} else {
obj2 = ((Class) xzZ.c(Color.green(0) + 15, 4 - ExpandableListView.getPackedPositionChild(0L), (char) (58133 - TextUtils.indexOf((CharSequence) "", '0')))).getMethod("i", Integer.TYPE);
i3 = length;
xzZ.y.put(729798706, obj2);
}
iArr2[i2] = ((Integer) ((Method) obj2).invoke(null, objArr3)).intValue();
} else {
i3 = length;
Object[] objArr4 = {Integer.valueOf(iArr6[i2])};
Object obj3 = xzZ.y.get(729798706);
if (obj3 == null) {
obj3 = ((Class) xzZ.c(15 - (ViewConfiguration.getScrollBarSize() >> 8), 5 - View.resolveSize(0, 0), (char) ((AudioTrack.getMinVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMinVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 58134))).getMethod("i", Integer.TYPE);
xzZ.y.put(729798706, obj3);
}
iArr2[i2] = ((Integer) ((Method) obj3).invoke(null, objArr4)).intValue();
i2++;
}
length = i3;
i6 = 0;
}
iArr6 = iArr2;
}
System.arraycopy(iArr6, i6, iArr5, i6, length3);
c4403bZM.b = i6;
int i10 = $11 + 121;
$10 = i10 % 128;
if (i10 % 2 != 0) {
int i11 = 5 / 4;
}
while (c4403bZM.b < iArr.length) {
int i12 = $11 + 91;
$10 = i12 % 128;
int i13 = i12 % 2;
cArr[0] = (char) (iArr[c4403bZM.b] >> 16);
cArr[1] = (char) iArr[c4403bZM.b];
cArr[2] = (char) (iArr[c4403bZM.b + 1] >> 16);
cArr[3] = (char) iArr[c4403bZM.b + 1];
c4403bZM.e = (cArr[0] << 16) + cArr[1];
c4403bZM.a = (cArr[2] << 16) + cArr[3];
C4403bZM.d(iArr5);
int i14 = 0;
for (int i15 = 16; i14 < i15; i15 = 16) {
c4403bZM.e ^= iArr5[i14];
Object[] objArr5 = {c4403bZM, Integer.valueOf(C4403bZM.d(c4403bZM.e)), c4403bZM, c4403bZM};
Object obj4 = xzZ.y.get(-1196964548);
if (obj4 == null) {
Class cls = (Class) xzZ.c((ViewConfiguration.getFadingEdgeLength() >> i15) + 118, TextUtils.indexOf("", "", 0) + 5, (char) Color.argb(0, 0, 0, 0));
byte b2 = (byte) ($$b - 3);
byte b3 = b2;
Object[] objArr6 = new Object[1];
f(b2, b3, (byte) (b3 + 1), objArr6);
obj4 = cls.getMethod((String) objArr6[0], Object.class, Integer.TYPE, Object.class, Object.class);
xzZ.y.put(-1196964548, obj4);
}
int intValue = ((Integer) ((Method) obj4).invoke(null, objArr5)).intValue();
c4403bZM.e = c4403bZM.a;
c4403bZM.a = intValue;
i14++;
}
int i16 = c4403bZM.e;
c4403bZM.e = c4403bZM.a;
c4403bZM.a = i16;
c4403bZM.a ^= iArr5[16];
c4403bZM.e ^= iArr5[17];
int i17 = c4403bZM.e;
int i18 = c4403bZM.a;
cArr[0] = (char) (c4403bZM.e >>> 16);
cArr[1] = (char) c4403bZM.e;
cArr[2] = (char) (c4403bZM.a >>> 16);
cArr[3] = (char) c4403bZM.a;
C4403bZM.d(iArr5);
cArr2[c4403bZM.b * 2] = cArr[0];
cArr2[(c4403bZM.b * 2) + 1] = cArr[1];
cArr2[(c4403bZM.b * 2) + 2] = cArr[2];
cArr2[(c4403bZM.b * 2) + 3] = cArr[3];
Object[] objArr7 = {c4403bZM, c4403bZM};
Object obj5 = xzZ.y.get(1914371176);
if (obj5 == null) {
Class cls2 = (Class) xzZ.c(99 - (ViewConfiguration.getScrollFriction() > BitmapDescriptorFactory.HUE_RED ? 1 : (ViewConfiguration.getScrollFriction() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), KeyEvent.keyCodeFromString("") + 5, (char) (ViewConfiguration.getMaximumDrawingCacheSize() >> 24));
byte b4 = (byte) ($$b - 3);
byte b5 = b4;
Object[] objArr8 = new Object[1];
f(b4, b5, b5, objArr8);
obj5 = cls2.getMethod((String) objArr8[0], Object.class, Object.class);
xzZ.y.put(1914371176, obj5);
}
((Method) obj5).invoke(null, objArr7);
}
objArr[0] = new String(cArr2, 0, i);
}
@Override // java.security.Principal
public int hashCode() {
int i = 2 % 2;
int i2 = d + 31;
a = i2 % 128;
int i3 = i2 % 2;
return (getName().hashCode() << 1) + 1231211;
}
public String getSeqNumber() {
int i = 2 % 2;
int i2 = d;
int i3 = i2 + 89;
a = i3 % 128;
if (i3 % 2 != 0) {
Object obj = null;
obj.hashCode();
throw null;
}
String str = this.seqNumber;
int i4 = i2 + 9;
a = i4 % 128;
int i5 = i4 % 2;
return str;
}
public String getMnemonic() {
int i = 2 % 2;
int i2 = d;
int i3 = i2 + 123;
a = i3 % 128;
if (i3 % 2 != 0) {
throw null;
}
String str = this.mnemonic;
int i4 = i2 + 73;
a = i4 % 128;
if (i4 % 2 == 0) {
return str;
}
throw null;
}
public Country getCountry() {
int i = 2 % 2;
int i2 = d + 15;
int i3 = i2 % 128;
a = i3;
int i4 = i2 % 2;
Country country = this.country;
int i5 = i3 + 81;
d = i5 % 128;
int i6 = i5 % 2;
return country;
}
}