package o; import com.google.common.base.Ascii; import com.google.common.primitives.SignedBytes; import com.kofax.kmc.kut.utilities.IpLibUtil; import net.sf.scuba.smartcards.ISO7816; import net.sf.scuba.smartcards.ISOFileInfo; import org.jmrtd.PassportService; /* renamed from: o.fKv, reason: case insensitive filesystem */ /* loaded from: classes5.dex */ public final class C12910fKv { private static boolean c; private static int d; private static final byte[] b = {88, ISOFileInfo.FCI_EXT, 86, 9, 2, -7, -1, 3, -8, -1, 4, -9, 4, -8, 5, -9, -1, 5, -10, 6, -10, -1, 6, -11, -1, 7, -12, 8, -12, 9, -13, 10, -14, -1, 8, -13, 3, -2, -7, -1, 9, -14, -1, 10, -15, -1, 2, -3, -6, -1, 2, -3, -6, -1, 7, -12, 3, 0, -9, 3, 1, -10, -1, 8, -13, 3, -2, -7, -1, 2, -2, -7, -1, 2, -1, -8, -1, 2, 0, -9, -1, 2, 0, -11, 19, -23, -53, 60, -13, 11, -9, -59, 35, Ascii.US, -4, -11, 3, -9, -5, -6, -5, 9, -11, 19, -23, -53, 60, -13, 11, -9, -59, Ascii.EM, 35, 4, -17, 0, -4, 11, -23, 9, 7, -18, -24, Ascii.NAK, 3, 4, ISO7816.INS_CREATE_FILE, 9, 9, 7, -18, 2, -7, 3, 2, -11, -1, 3, -8, -1, 4, -9, 4, -8, 5, -9, -1, 5, -10, 6, -10, -1, 6, -11, -1, 7, -12, 3, 3, -12, 3, 4, -13, 3, 5, -14, 3, 6, -15, -1, 8, -13, 3, -2, -7, -1, 9, -14, -1, 10, -15, -1, 2, -3, -6, -1, 2, -2, -7, 3, 2, -11, -1, 3, -8, 4, -3, -7, 5, -9, -1, 4, -9, -1, 2, -1, -8, 4, -1, -9, -1, 2, 0, -9, 4, 0, -10, -1, 2, 0, -9, -1, 2, -2, -7, -1, 2, -2, -11, 19, -23, -53, 60, -13, 11, -9, -59, Ascii.NAK, 49, -23, 0, 9, 2, -13, 4, -3, 2, -7, -1, 3, -8, -1, 4, -9, 4, 2, -12, 3, -2, -7, 5, -9, -1, 5, -10, 6, -10, -1, 6, -11, -1, 7, -12, 4, 3, -13, 4, 4, -14, 3, 6, -15, -1, 8, -13, 4, 2, -12, 10, -14, -1, 9, -14, -1, 10, -15, -1, 2, -3, -6, -1, 2, -3, -6, -1, 7, -12, 5, -5, -6, 5, -4, -7, 10, -14, -1, 8, -13, 4, 2, -12, 10, -14, -1, 2, -2, -7, -1, 2, -1, -8, -1, 2, 0, -9, -1, 2, 0, -9, -1, 2, 1, -10, -1, 2, 1, 2, -7, 5, -3, -8, -1, 3, -8, -1, 4, -9, 4, 2, -12, 3, -2, -7, 5, -9, -1, 5, -10, 6, -10, -1, 6, -11, -1, 7, -12, 5, -2, -9, 3, 1, -10, -1, 8, -13, 4, 2, -12, 10, -14, -1, 9, -14, -1, 10, -15, -1, 2, -3, -6, -1, 2, -3, -6, -1, 2, -2, -7, 5, -1, -10, 3, 5, -14, 3, 6, -15, -1, 2, -1, -8, 3, -2, -7, -1, 2, 0, -9, -1, 2, 1, -10, -1, 2, 2, -11, -1, 2, 2, -11, -1, 2, 3, -12, -1, 2, 3}; private static final int h = 4; private static int a = 0; public static final IeS e = new IeS(0); /* renamed from: o.fKv$IeS */ /* loaded from: classes5.dex */ public static final class IeS { private IeS() { } public /* synthetic */ IeS(byte b) { this(); } } /* JADX WARN: Failed to find 'out' block for switch in B:16:0x0145. Please report as an issue. */ public static final void c(long j, long j2) { int i; fKE fke = new fKE(j, j2); int i2 = h; Object[] objArr = new Object[1]; f((byte) 73, (byte) (i2 | 97), (short) (i2 | 338), objArr); String str = (String) objArr[0]; byte[] bArr = b; char c2 = '9'; byte b2 = bArr[57]; Object[] objArr2 = new Object[1]; f((byte) 74, b2, (short) (b2 | 79), objArr2); try { Object[] objArr3 = {(String) objArr2[0]}; char c3 = 26; byte b3 = (byte) (-bArr[26]); char c4 = ','; byte b4 = (byte) (-bArr[44]); Object[] objArr4 = new Object[1]; f(b3, b4, (short) (b4 | SignedBytes.MAX_POWER_OF_TWO), objArr4); Class cls = Class.forName((String) objArr4[0]); byte b5 = (byte) i2; Object[] objArr5 = new Object[1]; f(bArr[7], b5, (short) (b5 | 90), objArr5); String str2 = (String) objArr5[0]; byte b6 = (byte) (-bArr[26]); byte b7 = (byte) (-bArr[44]); Object[] objArr6 = new Object[1]; f(b6, b7, (short) (b7 | SignedBytes.MAX_POWER_OF_TWO), objArr6); Object[] objArr7 = (Object[]) cls.getMethod(str2, Class.forName((String) objArr6[0])).invoke(str, objArr3); int[] iArr = new int[objArr7.length]; int i3 = 0; while (i3 < objArr7.length) { Object[] objArr8 = {objArr7[i3]}; byte[] bArr2 = b; byte b8 = (byte) (-bArr2[c3]); short s = (short) 98; Object[] objArr9 = new Object[1]; f(b8, (byte) (b8 + 4), s, objArr9); Class cls2 = Class.forName((String) objArr9[0]); Object[] objArr10 = new Object[1]; f(bArr2[c2], bArr2[19], (short) 114, objArr10); String str3 = (String) objArr10[0]; byte b9 = (byte) (-bArr2[c3]); byte b10 = (byte) (-bArr2[c4]); Object[] objArr11 = new Object[1]; f(b9, b10, (short) (b10 | SignedBytes.MAX_POWER_OF_TWO), objArr11); Object invoke = cls2.getMethod(str3, Class.forName((String) objArr11[0])).invoke(null, objArr8); byte b11 = (byte) (-bArr2[26]); Object[] objArr12 = new Object[1]; f(b11, (byte) (b11 + 4), s, objArr12); Class cls3 = Class.forName((String) objArr12[0]); Object[] objArr13 = new Object[1]; f((byte) (-bArr2[30]), bArr2[25], (short) 120, objArr13); iArr[i3] = ((Integer) cls3.getMethod((String) objArr13[0], null).invoke(invoke, null)).intValue(); i3++; c2 = '9'; c3 = 26; c4 = ','; } int i4 = 0; while (true) { int i5 = i4 + 1; try { } catch (Throwable th) { byte[] bArr3 = b; byte b12 = (byte) (-bArr3[26]); byte b13 = (byte) (-bArr3[121]); short s2 = (short) PassportService.DEFAULT_MAX_BLOCKSIZE; Object[] objArr14 = new Object[1]; f(b12, b13, s2, objArr14); if (!Class.forName((String) objArr14[0]).isInstance(th) || i5 < 2 || i5 > 3) { Object[] objArr15 = new Object[1]; f((byte) (-bArr3[26]), (byte) (-bArr3[121]), s2, objArr15); if (!Class.forName((String) objArr15[0]).isInstance(th) || i5 < 20 || i5 > 29) { Object[] objArr16 = new Object[1]; f((byte) (-bArr3[26]), (byte) (-bArr3[121]), s2, objArr16); if (Class.forName((String) objArr16[0]).isInstance(th) && i5 >= 24) { i = 25; if (i5 <= 25) { i5 = 30; fke.g = th; fke.d(i); } } throw th; } i5 = 30; } else { i5 = 31; } i = 25; fke.g = th; fke.d(i); } switch (fke.d(iArr[i4])) { case IpLibUtil.KIPP_CANNOT_APPEND_TO_FILETYPE /* -16 */: fke.d(20); throw ((Throwable) fke.i); break; case IpLibUtil.KIPP_BAD_FILE_TO_APPEND_TO /* -15 */: i4 = 8; case IpLibUtil.KIPP_BAD_FILE_FORMAT_INTERNALS /* -14 */: i4 = 29; case IpLibUtil.KIPP_IMAGE_DOES_NOT_EXIST /* -13 */: fke.d(29); i4 = fke.c == 0 ? 28 : i5; case IpLibUtil.KIPP_UNKNOWN_FILETYPE /* -12 */: fke.a = 1; fke.d(9); fke.d(10); d = fke.c; case -11: fke.a = a; fke.d(1); case -10: i4 = 1; case -9: i4 = 19; case -8: fke.d(12); if (fke.c == 0) { i4 = 18; } case -7: fke.a = 1; fke.d(9); fke.d(10); a = fke.c; case -6: fke.a = d; fke.d(1); case -5: return; case -4: i4 = 10; case -3: i4 = 20; case -2: fke.a = 1; fke.d(9); fke.d(10); c(fke.c != 0); case -1: i4 = 4; default: } } } catch (Throwable th2) { Throwable cause = th2.getCause(); if (cause == null) { throw th2; } throw cause; } } private static void f(int i, short s, short s2, Object[] objArr) { int i2 = 118 - i; int i3 = s2 + 4; byte[] bArr = b; byte[] bArr2 = new byte[s + 1]; int i4 = -1; if (bArr == null) { i2 = i2 + s + 2; i3++; } while (true) { i4++; bArr2[i4] = (byte) i2; if (i4 == s) { objArr[0] = new String(bArr2, 0); return; } else { i2 = i2 + bArr[i3] + 2; i3++; } } } /* JADX WARN: Failed to find 'out' block for switch in B:32:0x0154. Please report as an issue. */ public static final boolean a() { fKE fke = new fKE(); int i = h; Object[] objArr = new Object[1]; f((byte) 73, (byte) (i | 96), (short) 242, objArr); String str = (String) objArr[0]; byte[] bArr = b; char c2 = '9'; byte b2 = bArr[57]; Object[] objArr2 = new Object[1]; f((byte) 74, b2, (short) (b2 | 79), objArr2); try { Object[] objArr3 = {(String) objArr2[0]}; char c3 = 26; byte b3 = (byte) (-bArr[26]); char c4 = ','; byte b4 = (byte) (-bArr[44]); Object[] objArr4 = new Object[1]; f(b3, b4, (short) (b4 | SignedBytes.MAX_POWER_OF_TWO), objArr4); Class cls = Class.forName((String) objArr4[0]); byte b5 = (byte) i; Object[] objArr5 = new Object[1]; f(bArr[7], b5, (short) (b5 | 90), objArr5); String str2 = (String) objArr5[0]; byte b6 = (byte) (-bArr[26]); byte b7 = (byte) (-bArr[44]); Object[] objArr6 = new Object[1]; f(b6, b7, (short) (b7 | SignedBytes.MAX_POWER_OF_TWO), objArr6); Object[] objArr7 = (Object[]) cls.getMethod(str2, Class.forName((String) objArr6[0])).invoke(str, objArr3); int[] iArr = new int[objArr7.length]; int i2 = 0; while (i2 < objArr7.length) { try { Object[] objArr8 = {objArr7[i2]}; byte[] bArr2 = b; byte b8 = (byte) (-bArr2[c3]); short s = (short) 98; Object[] objArr9 = new Object[1]; f(b8, (byte) (b8 + 4), s, objArr9); Class cls2 = Class.forName((String) objArr9[0]); Object[] objArr10 = new Object[1]; f(bArr2[c2], bArr2[19], (short) 114, objArr10); String str3 = (String) objArr10[0]; byte b9 = (byte) (-bArr2[c3]); byte b10 = (byte) (-bArr2[c4]); Object[] objArr11 = new Object[1]; f(b9, b10, (short) (b10 | SignedBytes.MAX_POWER_OF_TWO), objArr11); Object invoke = cls2.getMethod(str3, Class.forName((String) objArr11[0])).invoke(null, objArr8); try { byte b11 = (byte) (-bArr2[26]); Object[] objArr12 = new Object[1]; f(b11, (byte) (b11 + 4), s, objArr12); Class cls3 = Class.forName((String) objArr12[0]); Object[] objArr13 = new Object[1]; f((byte) (-bArr2[30]), bArr2[25], (short) 120, objArr13); iArr[i2] = ((Integer) cls3.getMethod((String) objArr13[0], null).invoke(invoke, null)).intValue(); i2++; c2 = '9'; c3 = 26; c4 = ','; } catch (Throwable th) { Throwable cause = th.getCause(); if (cause != null) { throw cause; } throw th; } } catch (Throwable th2) { Throwable cause2 = th2.getCause(); if (cause2 != null) { throw cause2; } throw th2; } } int i3 = 0; while (true) { int i4 = i3 + 1; try { } catch (Throwable th3) { byte[] bArr3 = b; byte b12 = (byte) (-bArr3[26]); byte b13 = (byte) (-bArr3[121]); short s2 = (short) PassportService.DEFAULT_MAX_BLOCKSIZE; Object[] objArr14 = new Object[1]; f(b12, b13, s2, objArr14); if (!Class.forName((String) objArr14[0]).isInstance(th3) || i4 < 9 || i4 > 10) { Object[] objArr15 = new Object[1]; f((byte) (-bArr3[26]), (byte) (-bArr3[121]), s2, objArr15); if (!Class.forName((String) objArr15[0]).isInstance(th3) || i4 < 13 || i4 > 19) { throw th3; } } fke.g = th3; fke.d(25); i3 = 31; } switch (fke.d(iArr[i3])) { case IpLibUtil.KIPP_BAD_FILE_FORMAT_INTERNALS /* -14 */: fke.d(20); throw ((Throwable) fke.i); case IpLibUtil.KIPP_IMAGE_DOES_NOT_EXIST /* -13 */: i3 = 1; case IpLibUtil.KIPP_UNKNOWN_FILETYPE /* -12 */: i3 = 30; case -11: fke.d(29); i3 = fke.c == 0 ? 29 : i4; case -10: i3 = 7; case -9: i3 = 19; case -8: fke.d(29); if (fke.c == 0) { i3 = 18; } case -7: fke.a = 1; fke.d(9); fke.d(10); d = fke.c; case -6: fke.a = a; fke.d(1); case -5: fke.d(5); return fke.c != 0; case -4: i3 = 20; case -3: i3 = 9; case -2: fke.a = b() ? 1 : 0; fke.d(1); case -1: i3 = 3; default: } } throw th3; } catch (Throwable th4) { Throwable cause3 = th4.getCause(); if (cause3 != null) { throw cause3; } throw th4; } } /* JADX WARN: Failed to find 'out' block for switch in B:16:0x0146. Please report as an issue. */ public static final /* synthetic */ void c(boolean z) { int i; fKE fke = new fKE(z ? 1 : 0); byte b2 = (byte) 97; Object[] objArr = new Object[1]; f((byte) 73, b2, (short) (b2 | 30), objArr); String str = (String) objArr[0]; byte[] bArr = b; char c2 = '9'; byte b3 = bArr[57]; Object[] objArr2 = new Object[1]; f((byte) 74, b3, (short) (b3 | 79), objArr2); try { Object[] objArr3 = {(String) objArr2[0]}; char c3 = 26; byte b4 = (byte) (-bArr[26]); char c4 = ','; byte b5 = (byte) (-bArr[44]); Object[] objArr4 = new Object[1]; f(b4, b5, (short) (b5 | SignedBytes.MAX_POWER_OF_TWO), objArr4); Class cls = Class.forName((String) objArr4[0]); byte b6 = bArr[7]; byte b7 = (byte) h; Object[] objArr5 = new Object[1]; f(b6, b7, (short) (b7 | 90), objArr5); String str2 = (String) objArr5[0]; byte b8 = (byte) (-bArr[26]); byte b9 = (byte) (-bArr[44]); Object[] objArr6 = new Object[1]; f(b8, b9, (short) (b9 | SignedBytes.MAX_POWER_OF_TWO), objArr6); Object[] objArr7 = (Object[]) cls.getMethod(str2, Class.forName((String) objArr6[0])).invoke(str, objArr3); int[] iArr = new int[objArr7.length]; int i2 = 0; while (i2 < objArr7.length) { Object[] objArr8 = {objArr7[i2]}; byte[] bArr2 = b; byte b10 = (byte) (-bArr2[c3]); short s = (short) 98; Object[] objArr9 = new Object[1]; f(b10, (byte) (b10 + 4), s, objArr9); Class cls2 = Class.forName((String) objArr9[0]); Object[] objArr10 = new Object[1]; f(bArr2[c2], bArr2[19], (short) 114, objArr10); String str3 = (String) objArr10[0]; byte b11 = (byte) (-bArr2[c3]); byte b12 = (byte) (-bArr2[c4]); Object[] objArr11 = new Object[1]; f(b11, b12, (short) (b12 | SignedBytes.MAX_POWER_OF_TWO), objArr11); Object invoke = cls2.getMethod(str3, Class.forName((String) objArr11[0])).invoke(null, objArr8); byte b13 = (byte) (-bArr2[26]); Object[] objArr12 = new Object[1]; f(b13, (byte) (b13 + 4), s, objArr12); Class cls3 = Class.forName((String) objArr12[0]); Object[] objArr13 = new Object[1]; f((byte) (-bArr2[30]), bArr2[25], (short) 120, objArr13); iArr[i2] = ((Integer) cls3.getMethod((String) objArr13[0], null).invoke(invoke, null)).intValue(); i2++; c2 = '9'; c3 = 26; c4 = ','; } int i3 = 0; while (true) { int i4 = i3 + 1; try { } catch (Throwable th) { byte[] bArr3 = b; byte b14 = (byte) (-bArr3[26]); byte b15 = (byte) (-bArr3[121]); short s2 = (short) PassportService.DEFAULT_MAX_BLOCKSIZE; Object[] objArr14 = new Object[1]; f(b14, b15, s2, objArr14); if (!Class.forName((String) objArr14[0]).isInstance(th) || i4 < 9 || i4 > 19) { Object[] objArr15 = new Object[1]; f((byte) (-bArr3[26]), (byte) (-bArr3[121]), s2, objArr15); if (!Class.forName((String) objArr15[0]).isInstance(th) || i4 < 14 || i4 > 15) { if (i4 >= 22) { i = 25; if (i4 <= 25) { i4 = 19; } } throw th; } i4 = 30; i = 25; } else { i4 = 31; i = 25; } fke.g = th; fke.d(i); } switch (fke.d(iArr[i3])) { case IpLibUtil.KIPP_IMAGE_DOES_NOT_EXIST /* -13 */: i3 = 25; case IpLibUtil.KIPP_UNKNOWN_FILETYPE /* -12 */: fke.d(22); int i5 = fke.c; i3 = (i5 == 12 || i5 != 36) ? 1 : 20; break; case -11: fke.d(20); throw ((Throwable) fke.i); break; case -10: i3 = 26; case -9: i3 = 28; case -8: fke.d(12); i3 = fke.c == 0 ? 18 : i4; case -7: fke.a = 1; fke.d(9); fke.d(10); a = fke.c; case -6: fke.a = d; fke.d(1); case -5: return; case -4: i3 = 9; case -3: i3 = 7; case -2: fke.a = 1; fke.d(9); fke.d(10); c = fke.c != 0; case -1: i3 = 4; default: } } throw th; } catch (Throwable th2) { Throwable cause = th2.getCause(); if (cause == null) { throw th2; } throw cause; } } /* JADX WARN: Failed to find 'out' block for switch in B:14:0x013b. Please report as an issue. */ /* JADX WARN: Multi-variable type inference failed */ public static final /* synthetic */ boolean b() { int i; fKE fke = new fKE(); byte b2 = (byte) 73; byte[] bArr = b; char c2 = '9'; Object[] objArr = new Object[1]; f(b2, (byte) (b2 | 6), bArr[57], objArr); String str = (String) objArr[0]; byte b3 = bArr[57]; Object[] objArr2 = new Object[1]; f((byte) 74, b3, (short) (b3 | 79), objArr2); try { Object[] objArr3 = {(String) objArr2[0]}; int i2 = 26; byte b4 = (byte) (-bArr[26]); char c3 = ','; byte b5 = (byte) (-bArr[44]); Object[] objArr4 = new Object[1]; f(b4, b5, (short) (b5 | SignedBytes.MAX_POWER_OF_TWO), objArr4); Class cls = Class.forName((String) objArr4[0]); byte b6 = bArr[7]; byte b7 = (byte) h; Object[] objArr5 = new Object[1]; f(b6, b7, (short) (b7 | 90), objArr5); String str2 = (String) objArr5[0]; byte b8 = (byte) (-bArr[26]); byte b9 = (byte) (-bArr[44]); Object[] objArr6 = new Object[1]; f(b8, b9, (short) (b9 | SignedBytes.MAX_POWER_OF_TWO), objArr6); Object[] objArr7 = (Object[]) cls.getMethod(str2, Class.forName((String) objArr6[0])).invoke(str, objArr3); int[] iArr = new int[objArr7.length]; int i3 = 0; while (i3 < objArr7.length) { Object[] objArr8 = {objArr7[i3]}; byte[] bArr2 = b; byte b10 = (byte) (-bArr2[i2]); short s = (short) 98; Object[] objArr9 = new Object[1]; f(b10, (byte) (b10 + 4), s, objArr9); Class cls2 = Class.forName((String) objArr9[0]); Object[] objArr10 = new Object[1]; f(bArr2[c2], bArr2[19], (short) 114, objArr10); String str3 = (String) objArr10[0]; byte b11 = (byte) (-bArr2[i2]); byte b12 = (byte) (-bArr2[c3]); Object[] objArr11 = new Object[1]; f(b11, b12, (short) (b12 | SignedBytes.MAX_POWER_OF_TWO), objArr11); Object invoke = cls2.getMethod(str3, Class.forName((String) objArr11[0])).invoke(null, objArr8); byte b13 = (byte) (-bArr2[26]); Object[] objArr12 = new Object[1]; f(b13, (byte) (b13 + 4), s, objArr12); Class cls3 = Class.forName((String) objArr12[0]); Object[] objArr13 = new Object[1]; f((byte) (-bArr2[30]), bArr2[25], (short) 120, objArr13); iArr[i3] = ((Integer) cls3.getMethod((String) objArr13[0], null).invoke(invoke, null)).intValue(); i3++; i2 = 26; c2 = '9'; c3 = ','; } int i4 = i2; int i5 = 0; while (true) { int i6 = i5 + 1; switch (fke.d(iArr[i5])) { case IpLibUtil.KIPP_IMAGE_DOES_NOT_EXIST /* -13 */: i5 = 6; case IpLibUtil.KIPP_UNKNOWN_FILETYPE /* -12 */: i5 = i4; case -11: fke.d(12); i5 = fke.c == 0 ? 25 : i6; case -10: i5 = 1; case -9: i5 = 17; case -8: fke.d(12); if (fke.c == 0) { i5 = 16; } case -7: fke.a = 1; fke.d(9); fke.d(10); a = fke.c; case -6: i = d; fke.a = i; fke.d(1); case -5: break; case -4: i5 = 8; case -3: i5 = 18; case -2: i = c; fke.a = i; fke.d(1); case -1: i5 = 3; default: } fke.d(5); return fke.c != 0; } } catch (Throwable th) { Throwable cause = th.getCause(); if (cause != null) { throw cause; } throw th; } } static { d = 1; int i = a + 9; d = i % 128; int i2 = i % 2; } }