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

134 lines
4.3 KiB
Java

package o;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import net.sf.scuba.smartcards.ISO7816;
import net.sf.scuba.smartcards.ISOFileInfo;
/* renamed from: o.kji, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C16051kji {
private static final byte[] c = {ISOFileInfo.FCP_BYTE, ISO7816.INS_MANAGE_CHANNEL, 108, 105, 115, 116, ISO7816.INS_DECREASE, ISO7816.INS_DECREASE};
public static boolean e(byte[] bArr) {
if (bArr.length < c.length) {
return false;
}
int i = 0;
while (true) {
byte[] bArr2 = c;
if (i >= bArr2.length) {
return true;
}
if (bArr[i] != bArr2[i]) {
return false;
}
i++;
}
}
public static Sts b(byte[] bArr) throws IOException {
if (!e(bArr)) {
throw new IllegalArgumentException("Input is not a bplist");
}
ArrayList arrayList = new ArrayList();
C0629LEh c0629LEh = new C0629LEh(bArr, bArr.length - 32);
c0629LEh.b(5L);
c0629LEh.b(1L);
LWm lWm = new LWm((byte) 0);
lWm.e = c0629LEh.b();
lWm.d = c0629LEh.b();
lWm.a = c0629LEh.g();
lWm.b = c0629LEh.g();
lWm.c = c0629LEh.g();
C0629LEh c0629LEh2 = new C0629LEh(bArr, (int) (lWm.c + lWm.b));
int i = (int) lWm.a;
int[] iArr = new int[i];
for (long j = 0; j < lWm.a; j++) {
if (lWm.e == 1) {
iArr[(int) j] = c0629LEh2.b();
} else if (lWm.e == 2) {
iArr[(int) j] = c0629LEh2.h();
}
}
for (int i2 = 0; i2 < i; i2++) {
C0629LEh c0629LEh3 = new C0629LEh(bArr, iArr[i2]);
byte b = c0629LEh3.b();
int i3 = (b >> 4) & 15;
if (i3 == 1) {
int pow = (int) Math.pow(2.0d, b & 15);
if (pow == 1) {
arrayList.add(i2, Byte.valueOf(c0629LEh3.b()));
} else if (pow == 2) {
arrayList.add(i2, Integer.valueOf(c0629LEh3.h()));
} else if (pow == 4) {
arrayList.add(i2, Long.valueOf(c0629LEh3.f()));
} else if (pow == 8) {
arrayList.add(i2, Long.valueOf(c0629LEh3.g()));
}
} else if (i3 == 13) {
LinkedHashMap linkedHashMap = new LinkedHashMap();
int i4 = b & 15;
byte[] bArr2 = new byte[i4];
for (int i5 = 0; i5 < i4; i5++) {
bArr2[i5] = c0629LEh3.b();
}
for (int i6 = 0; i6 < i4; i6++) {
linkedHashMap.put(Byte.valueOf(bArr2[i6]), Byte.valueOf(c0629LEh3.b()));
}
arrayList.add(i2, linkedHashMap);
} else if (i3 == 4) {
int i7 = b & 15;
if (i7 == 15) {
if (((c0629LEh3.b() >> 4) & 15) != 1) {
throw new IllegalArgumentException("Invalid size marker");
}
int pow2 = (int) Math.pow(2.0d, r6 & 15);
if (pow2 == 1) {
i7 = c0629LEh3.b();
} else if (pow2 == 2) {
i7 = c0629LEh3.h();
}
}
arrayList.add(i2, c0629LEh3.a(i7));
} else if (i3 == 5) {
arrayList.add(i2, new String(c0629LEh3.a(b & 15)));
} else {
throw new IOException("Un-handled objectFormat encountered");
}
}
return new Sts(arrayList, lWm);
}
/* renamed from: o.kji$Sts */
/* loaded from: classes.dex */
public static class Sts {
public final List<Object> a;
public final LWm d;
public Sts(List<Object> list, LWm lWm) {
this.a = list;
this.d = lWm;
}
}
/* renamed from: o.kji$LWm */
/* loaded from: classes.dex */
public static class LWm {
long a;
public long b;
long c;
byte d;
byte e;
private LWm() {
}
/* synthetic */ LWm(byte b) {
this();
}
}
}