package org.bouncycastle.crypto.tls; import android.graphics.Color; import android.graphics.ImageFormat; import android.media.AudioTrack; import android.text.TextUtils; import android.util.TypedValue; import android.view.KeyEvent; import android.view.ViewConfiguration; import android.widget.ExpandableListView; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.huawei.hms.framework.network.grs.GrsBaseInfo; import java.lang.reflect.Method; import o.TVH; import o.xzZ; /* loaded from: classes6.dex */ public class HashAlgorithm { public static final short md5 = 1; public static final short none = 0; public static final short sha1 = 2; public static final short sha224 = 3; public static final short sha256 = 4; public static final short sha384 = 5; public static final short sha512 = 6; private static final byte[] $$a = {46, -23, 1, -23}; private static final int $$b = 115; private static int $10 = 0; private static int $11 = 1; private static int a = 0; private static int e = 1; private static char[] c = {40063, 40163, 40161, 40201, 40208, 40239, 40043, 40112, 40121, 40083, 40072, 40079, 39999, 40047, 40002, 39992, 39998, 40031, 40004, 40082, 40091, 40062, 40021, 40020}; /* JADX WARN: Removed duplicated region for block: B:10:0x0027 */ /* JADX WARN: Removed duplicated region for block: B:7:0x001f */ /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0027 -> B:4:0x0029). 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(short r5, byte r6, int r7, java.lang.Object[] r8) { /* byte[] r0 = org.bouncycastle.crypto.tls.HashAlgorithm.$$a int r7 = r7 * 3 int r7 = r7 + 1 int r6 = r6 * 4 int r6 = 4 - r6 int r5 = r5 * 2 int r5 = r5 + 71 byte[] r1 = new byte[r7] r2 = 0 if (r0 != 0) goto L17 r4 = r5 r5 = r7 r3 = r2 goto L29 L17: r3 = r2 L18: byte r4 = (byte) r5 r1[r3] = r4 int r3 = r3 + 1 if (r3 != r7) goto L27 java.lang.String r5 = new java.lang.String r5.(r1, r2) r8[r2] = r5 return L27: r4 = r0[r6] L29: int r5 = r5 + r4 int r6 = r6 + 1 goto L18 */ throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.crypto.tls.HashAlgorithm.f(short, byte, int, java.lang.Object[]):void"); } private static void d(byte[] bArr, int[] iArr, boolean z, Object[] objArr) { int i; char[] cArr; char c2 = 2; int i2 = 2 % 2; TVH tvh = new TVH(); int i3 = 0; int i4 = iArr[0]; int i5 = iArr[1]; int i6 = iArr[2]; int i7 = iArr[3]; char[] cArr2 = c; if (cArr2 != null) { int i8 = $10 + 95; $11 = i8 % 128; int i9 = i8 % 2; int length = cArr2.length; char[] cArr3 = new char[length]; int i10 = 0; while (i10 < length) { try { Object[] objArr2 = new Object[1]; objArr2[i3] = Integer.valueOf(cArr2[i10]); Object obj = xzZ.y.get(1645349359); if (obj != null) { cArr = cArr2; } else { Class cls = (Class) xzZ.c(222 - ImageFormat.getBitsPerPixel(i3), TextUtils.lastIndexOf("", '0', i3, i3) + 6, (char) ((-16735239) - Color.rgb(i3, i3, i3))); byte b = (byte) ($$a[c2] - 1); byte b2 = b; cArr = cArr2; Object[] objArr3 = new Object[1]; f(b, b2, b2, objArr3); obj = cls.getMethod((String) objArr3[0], Integer.TYPE); xzZ.y.put(1645349359, obj); } cArr3[i10] = ((Character) ((Method) obj).invoke(null, objArr2)).charValue(); i10++; int i11 = $10 + 83; $11 = i11 % 128; int i12 = i11 % 2; cArr2 = cArr; c2 = 2; i3 = 0; } catch (Throwable th) { Throwable cause = th.getCause(); if (cause == null) { throw th; } throw cause; } } cArr2 = cArr3; } char[] cArr4 = new char[i5]; System.arraycopy(cArr2, i4, cArr4, 0, i5); if (bArr != null) { int i13 = $11 + 113; $10 = i13 % 128; int i14 = i13 % 2; char[] cArr5 = new char[i5]; tvh.c = 0; char c3 = 0; while (tvh.c < i5) { if (bArr[tvh.c] == 1) { int i15 = $11 + 77; $10 = i15 % 128; if (i15 % 2 != 0) { int i16 = tvh.c; Object[] objArr4 = {Integer.valueOf(cArr4[tvh.c]), Integer.valueOf(c3)}; Object obj2 = xzZ.y.get(850398076); if (obj2 == null) { obj2 = ((Class) xzZ.c((TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 502, 5 - (ViewConfiguration.getMinimumFlingVelocity() >> 16), (char) (54 - (ViewConfiguration.getScrollDefaultDelay() >> 16)))).getMethod("F", Integer.TYPE, Integer.TYPE); xzZ.y.put(850398076, obj2); } cArr5[i16] = ((Character) ((Method) obj2).invoke(null, objArr4)).charValue(); int i17 = 34 / 0; } else { int i18 = tvh.c; Object[] objArr5 = {Integer.valueOf(cArr4[tvh.c]), Integer.valueOf(c3)}; Object obj3 = xzZ.y.get(850398076); if (obj3 == null) { obj3 = ((Class) xzZ.c(501 - ImageFormat.getBitsPerPixel(0), 5 - TextUtils.getOffsetBefore("", 0), (char) (54 - TextUtils.indexOf("", "", 0)))).getMethod("F", Integer.TYPE, Integer.TYPE); xzZ.y.put(850398076, obj3); } cArr5[i18] = ((Character) ((Method) obj3).invoke(null, objArr5)).charValue(); } } else { int i19 = tvh.c; Object[] objArr6 = {Integer.valueOf(cArr4[tvh.c]), Integer.valueOf(c3)}; Object obj4 = xzZ.y.get(1084521042); if (obj4 == null) { obj4 = ((Class) xzZ.c(((byte) KeyEvent.getModifierMetaStateMask()) + 16, 5 - (ExpandableListView.getPackedPositionForGroup(0) > 0L ? 1 : (ExpandableListView.getPackedPositionForGroup(0) == 0L ? 0 : -1)), (char) (Color.green(0) + 58134))).getMethod("H", Integer.TYPE, Integer.TYPE); xzZ.y.put(1084521042, obj4); } cArr5[i19] = ((Character) ((Method) obj4).invoke(null, objArr6)).charValue(); } c3 = cArr5[tvh.c]; Object[] objArr7 = {tvh, tvh}; Object obj5 = xzZ.y.get(1698744941); if (obj5 == null) { Class cls2 = (Class) xzZ.c((ViewConfiguration.getWindowTouchSlop() >> 8) + 402, 6 - (AudioTrack.getMaxVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMaxVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), (char) ((-16755608) - Color.rgb(0, 0, 0))); byte b3 = $$a[2]; byte b4 = (byte) (b3 - 1); Object[] objArr8 = new Object[1]; f(b3, b4, b4, objArr8); obj5 = cls2.getMethod((String) objArr8[0], Object.class, Object.class); xzZ.y.put(1698744941, obj5); } ((Method) obj5).invoke(null, objArr7); } cArr4 = cArr5; } if (i7 > 0) { int i20 = $10 + 5; $11 = i20 % 128; if (i20 % 2 == 0) { char[] cArr6 = new char[i5]; i = 0; System.arraycopy(cArr4, 0, cArr6, 0, i5); System.arraycopy(cArr6, 0, cArr4, i5 << i7, i7); System.arraycopy(cArr6, i7, cArr4, 1, i5 - i7); } else { i = 0; char[] cArr7 = new char[i5]; System.arraycopy(cArr4, 0, cArr7, 0, i5); int i21 = i5 - i7; System.arraycopy(cArr7, 0, cArr4, i21, i7); System.arraycopy(cArr7, i7, cArr4, 0, i21); } } else { i = 0; } if (z) { char[] cArr8 = new char[i5]; while (true) { tvh.c = i; if (tvh.c >= i5) { break; } int i22 = $10 + 117; $11 = i22 % 128; int i23 = i22 % 2; cArr8[tvh.c] = cArr4[(i5 - tvh.c) - 1]; i = tvh.c + 1; } cArr4 = cArr8; } if (i6 > 0) { int i24 = 0; while (true) { tvh.c = i24; if (tvh.c >= i5) { break; } cArr4[tvh.c] = (char) (cArr4[tvh.c] - iArr[2]); i24 = tvh.c + 1; } } objArr[0] = new String(cArr4); } public static boolean isPrivate(short s) { int i = 2 % 2; int i2 = e; int i3 = i2 + 99; a = i3 % 128; if (i3 % 2 == 0 ? 224 <= s : 20707 <= s) { int i4 = i2 + 93; a = i4 % 128; if (i4 % 2 == 0 ? s <= 255 : s <= 4116) { return true; } } return false; } public static String getText(short s) { int i = 2 % 2; StringBuilder sb = new StringBuilder(); sb.append(getName(s)); sb.append("("); sb.append((int) s); sb.append(")"); String obj = sb.toString(); int i2 = e + 113; a = i2 % 128; int i3 = i2 % 2; return obj; } /* JADX WARN: Failed to find 'out' block for switch in B:4:0x0011. Please report as an issue. */ public static String getName(short s) { Object obj; int i = 2 % 2; int i2 = e + 35; a = i2 % 128; if (i2 % 2 != 0) { Object obj2 = null; obj2.hashCode(); throw null; } switch (s) { case 0: return "none"; case 1: return "md5"; case 2: return "sha1"; case 3: Object[] objArr = new Object[1]; d(new byte[]{1, 1, 1, 1, 0, 0}, new int[]{18, 6, 44, 0}, false, objArr); obj = objArr[0]; return ((String) obj).intern(); case 4: Object[] objArr2 = new Object[1]; d(new byte[]{0, 1, 1, 1, 1, 1}, new int[]{12, 6, 0, 5}, false, objArr2); String intern = ((String) objArr2[0]).intern(); int i3 = a + 115; e = i3 % 128; int i4 = i3 % 2; return intern; case 5: Object[] objArr3 = new Object[1]; d(new byte[]{1, 1, 1, 0, 1, 0}, new int[]{6, 6, 78, 0}, false, objArr3); String intern2 = ((String) objArr3[0]).intern(); int i5 = e + 43; a = i5 % 128; int i6 = i5 % 2; return intern2; case 6: Object[] objArr4 = new Object[1]; d(new byte[]{1, 1, 0, 0, 1, 1}, new int[]{0, 6, CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, 0}, true, objArr4); obj = objArr4[0]; return ((String) obj).intern(); default: return GrsBaseInfo.CountryCodeSource.UNKNOWN; } } }