package com.kofax.mobile.sdk.aa; import android.os.Process; import android.telephony.cdma.CdmaCellLocation; import android.text.AndroidCharacter; import android.text.TextUtils; import android.util.TypedValue; import android.view.View; import android.view.ViewConfiguration; import android.widget.ExpandableListView; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.common.primitives.UnsignedBytes; import com.kofax.kmc.kut.utilities.Licensing; import com.kofax.mobile.sdk._internal.k; import java.lang.reflect.Method; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.Map; import net.sf.scuba.smartcards.ISO7816; import net.sf.scuba.smartcards.ISOFileInfo; import o.C4403bZM; import o.xzZ; import org.bouncycastle.pqc.jcajce.spec.McElieceCCA2KeyGenParameterSpec; /* loaded from: classes3.dex */ public class e { private static final String TAG = "e"; public static final Map Th; public static final Map Ti; public static final Map Tj; private static int[] a; private static int c; private static final byte[] $$a = {67, -87, -63, ISOFileInfo.FCI_EXT}; private static final int $$b = 96; private static int $10 = 0; private static int $11 = 1; private static int e = 0; /* 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:0x002d). 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(int r6, byte r7, short r8, java.lang.Object[] r9) { /* byte[] r0 = com.kofax.mobile.sdk.aa.e.$$a int r7 = r7 * 3 int r7 = r7 + 4 int r6 = r6 * 4 int r1 = 1 - r6 int r8 = r8 * 2 int r8 = 104 - r8 byte[] r1 = new byte[r1] r2 = 0 int r6 = 0 - r6 r3 = -1 if (r0 != 0) goto L19 r4 = r6 r8 = r7 goto L2d L19: r5 = r8 r8 = r7 r7 = r5 L1c: int r3 = r3 + 1 byte r4 = (byte) r7 r1[r3] = r4 if (r3 != r6) goto L2b java.lang.String r6 = new java.lang.String r6.(r1, r2) r9[r2] = r6 return L2b: r4 = r0[r8] L2d: int r4 = -r4 int r7 = r7 + r4 int r8 = r8 + 1 goto L1c */ throw new UnsupportedOperationException("Method not decompiled: com.kofax.mobile.sdk.aa.e.f(int, byte, short, java.lang.Object[]):void"); } static { c = 1; d(); Th = new HashMap() { // from class: com.kofax.mobile.sdk.aa.e.1 { put(Licensing.LicenseServerType.RTTI.name(), 0); put(Licensing.LicenseServerType.TotalAgility.name(), 1); } }; Ti = new HashMap() { // from class: com.kofax.mobile.sdk.aa.e.2 { put(Licensing.LicenseType.IMAGE_CAPTURE.name(), 0); put(Licensing.LicenseType.IMAGE_PROCESSING.name(), 1); put(Licensing.LicenseType.BARCODE_CAPTURE.name(), 2); put(Licensing.LicenseType.LOGISTICS.name(), 3); put(Licensing.LicenseType.ID_EXTRACTION.name(), 4); } }; Tj = new HashMap() { // from class: com.kofax.mobile.sdk.aa.e.3 { put(Licensing.LicenseType.IMAGE_CAPTURE.name(), 5); put(Licensing.LicenseType.IMAGE_PROCESSING.name(), 6); put(Licensing.LicenseType.BARCODE_CAPTURE.name(), 7); put(Licensing.LicenseType.LOGISTICS.name(), 3); put(Licensing.LicenseType.ID_EXTRACTION.name(), 8); } }; int i = e + 55; c = i % 128; int i2 = i % 2; } /* JADX INFO: Access modifiers changed from: package-private */ public static String aE(String str) { int i = 2 % 2; try { MessageDigest messageDigest = MessageDigest.getInstance(McElieceCCA2KeyGenParameterSpec.SHA256); messageDigest.update(str.getBytes()); byte[] digest = messageDigest.digest(); StringBuilder sb = new StringBuilder(); int length = digest.length; int i2 = c + 119; e = i2 % 128; if (i2 % 2 != 0) { int i3 = 4 % 3; } for (int i4 = 0; i4 < length; i4++) { int i5 = e + 41; c = i5 % 128; String hexString = i5 % 2 == 0 ? Integer.toHexString(digest[i4] & ISO7816.INS_PSO) : Integer.toHexString(digest[i4] & UnsignedBytes.MAX_VALUE); while (hexString.length() < 2) { StringBuilder sb2 = new StringBuilder(); Object[] objArr = new Object[1]; b(new int[]{155489937, -534071093}, (ViewConfiguration.getGlobalActionKeyTimeout() > 0L ? 1 : (ViewConfiguration.getGlobalActionKeyTimeout() == 0L ? 0 : -1)), objArr); sb2.append(((String) objArr[0]).intern()); sb2.append(hexString); hexString = sb2.toString(); } sb.append(hexString); } return sb.toString(); } catch (NoSuchAlgorithmException e2) { String str2 = TAG; StringBuilder sb3 = new StringBuilder("Unable to get SHA-1 instance"); sb3.append(e2.getMessage()); k.e(str2, sb3.toString()); return ""; } } private static void b(int[] iArr, int i, Object[] objArr) { int[] iArr2; int i2 = 2; int i3 = 2 % 2; C4403bZM c4403bZM = new C4403bZM(); char[] cArr = new char[4]; char[] cArr2 = new char[iArr.length * 2]; int[] iArr3 = a; int i4 = 729798706; int i5 = 1; int i6 = 0; if (iArr3 != null) { int length = iArr3.length; int[] iArr4 = new int[length]; int i7 = 0; while (i7 < length) { int i8 = $10 + 1; $11 = i8 % 128; if (i8 % i2 == 0) { try { Object[] objArr2 = new Object[1]; objArr2[i6] = Integer.valueOf(iArr3[i7]); Object obj = xzZ.y.get(Integer.valueOf(i4)); if (obj == null) { Class cls = (Class) xzZ.c(((Process.getThreadPriority(i6) + 20) >> 6) + 15, (ViewConfiguration.getMaximumDrawingCacheSize() >> 24) + 5, (char) (AndroidCharacter.getMirror('0') + 58086)); Class[] clsArr = new Class[1]; clsArr[i6] = Integer.TYPE; obj = cls.getMethod("i", clsArr); xzZ.y.put(729798706, obj); } iArr4[i7] = ((Integer) ((Method) obj).invoke(null, objArr2)).intValue(); } catch (Throwable th) { Throwable cause = th.getCause(); if (cause == null) { throw th; } throw cause; } } else { try { Object[] objArr3 = {Integer.valueOf(iArr3[i7])}; Object obj2 = xzZ.y.get(729798706); if (obj2 == null) { obj2 = ((Class) xzZ.c(TextUtils.getCapsMode("", 0, 0) + 15, 5 - (ViewConfiguration.getScrollBarSize() >> 8), (char) (58133 - ExpandableListView.getPackedPositionChild(0L)))).getMethod("i", Integer.TYPE); xzZ.y.put(729798706, obj2); } iArr4[i7] = ((Integer) ((Method) obj2).invoke(null, objArr3)).intValue(); } catch (Throwable th2) { Throwable cause2 = th2.getCause(); if (cause2 == null) { throw th2; } throw cause2; } } i7++; i2 = 2; i4 = 729798706; i6 = 0; } int i9 = $10 + 93; $11 = i9 % 128; int i10 = i9 % 2; iArr3 = iArr4; } int length2 = iArr3.length; int[] iArr5 = new int[length2]; int[] iArr6 = a; if (iArr6 != null) { int i11 = $11 + 87; $10 = i11 % 128; int i12 = i11 % 2; int length3 = iArr6.length; int[] iArr7 = new int[length3]; int i13 = 0; while (i13 < length3) { try { Object[] objArr4 = new Object[i5]; objArr4[0] = Integer.valueOf(iArr6[i13]); Object obj3 = xzZ.y.get(729798706); if (obj3 != null) { iArr2 = iArr6; } else { iArr2 = iArr6; obj3 = ((Class) xzZ.c(15 - (TypedValue.complexToFraction(0, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFraction(0, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), 5 - (ViewConfiguration.getTapTimeout() >> 16), (char) (TextUtils.indexOf((CharSequence) "", '0', 0, 0) + 58135))).getMethod("i", Integer.TYPE); xzZ.y.put(729798706, obj3); } iArr7[i13] = ((Integer) ((Method) obj3).invoke(null, objArr4)).intValue(); i13++; iArr6 = iArr2; i5 = 1; } catch (Throwable th3) { Throwable cause3 = th3.getCause(); if (cause3 == null) { throw th3; } throw cause3; } } iArr6 = iArr7; } char c2 = 0; System.arraycopy(iArr6, 0, iArr5, 0, length2); c4403bZM.b = 0; while (c4403bZM.b < iArr.length) { cArr[c2] = (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 cls2 = (Class) xzZ.c((CdmaCellLocation.convertQuartSecToDecDegrees(0) > 0.0d ? 1 : (CdmaCellLocation.convertQuartSecToDecDegrees(0) == 0.0d ? 0 : -1)) + 118, (ViewConfiguration.getMinimumFlingVelocity() >> 16) + 5, (char) View.MeasureSpec.getSize(0)); byte b = (byte) 0; byte b2 = b; Object[] objArr6 = new Object[1]; f(b, b2, b2, objArr6); obj4 = cls2.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 cls3 = (Class) xzZ.c(98 - (ViewConfiguration.getTapTimeout() >> 16), AndroidCharacter.getMirror('0') - '+', (char) View.resolveSizeAndState(0, 0, 0)); byte b3 = (byte) 0; byte b4 = b3; Object[] objArr8 = new Object[1]; f(b3, b4, (byte) (b4 + 1), objArr8); obj5 = cls3.getMethod((String) objArr8[0], Object.class, Object.class); xzZ.y.put(1914371176, obj5); } ((Method) obj5).invoke(null, objArr7); c2 = 0; } objArr[0] = new String(cArr2, 0, i); } static void d() { a = new int[]{-319605375, -929811048, -2139873639, 6257082, -365160507, 1634839131, -42483906, -466090624, 613140821, 474523649, 835256865, 290883600, 1558922485, -93224820, -895177495, -1922316235, 64462816, 446324673}; } }