package com.google.firebase.messaging; import android.content.res.Resources; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.SystemClock; import android.telephony.cdma.CdmaCellLocation; import android.text.TextUtils; import android.util.Base64; import android.util.TypedValue; import android.view.MotionEvent; import android.view.ViewConfiguration; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import java.lang.reflect.Method; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Iterator; import java.util.MissingFormatArgumentException; import o.C4593bdB; import o.xzZ; import org.json.JSONArray; import org.json.JSONException; /* loaded from: classes2.dex */ public final class zzt { private static byte b; private static long d; private static int e; private final Bundle zza; private static final byte[] $$a = {13, 13, 103, -97}; private static final int $$b = 15; private static int $10 = 0; private static int $11 = 1; private static int c = 0; public zzt(Bundle bundle) { if (bundle == null) { throw new NullPointerException("data"); } this.zza = new Bundle(bundle); int i = c + 41; e = i % 128; if (i % 2 == 0) { int i2 = 22 / 0; } } /* JADX WARN: Removed duplicated region for block: B:10:0x0025 */ /* JADX WARN: Removed duplicated region for block: B:7:0x001d */ /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0025 -> 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 g(short r6, int r7, byte r8, java.lang.Object[] r9) { /* byte[] r0 = com.google.firebase.messaging.zzt.$$a int r8 = r8 * 4 int r1 = r8 + 1 int r6 = r6 + 4 int r7 = r7 + 77 byte[] r1 = new byte[r1] r2 = 0 if (r0 != 0) goto L12 r3 = r6 r4 = r2 goto L2d L12: r3 = r2 r5 = r7 r7 = r6 r6 = r5 L16: byte r4 = (byte) r6 int r7 = r7 + 1 r1[r3] = r4 if (r3 != r8) goto L25 java.lang.String r6 = new java.lang.String r6.(r1, r2) r9[r2] = r6 return L25: int r3 = r3 + 1 r4 = r0[r7] r5 = r3 r3 = r7 r7 = r4 r4 = r5 L2d: int r6 = r6 + r7 r7 = r3 r3 = r4 goto L16 */ throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.zzt.g(short, int, byte, java.lang.Object[]):void"); } public final String zza(String str) { int i = 2 % 2; Bundle bundle = this.zza; if (!bundle.containsKey(str)) { int i2 = c + 111; e = i2 % 128; if (i2 % 2 == 0) { str.startsWith("gcm.n."); throw null; } if (str.startsWith("gcm.n.")) { String zzi = zzi(str); if (this.zza.containsKey(zzi)) { int i3 = e + 83; c = i3 % 128; int i4 = i3 % 2; str = zzi; } } } return bundle.getString(str); } public final boolean zzb(String str) { int i = 2 % 2; int i2 = c + 45; e = i2 % 128; int i3 = i2 % 2; String zza = zza(str); Object[] objArr = new Object[1]; a(new char[]{27025}, 64747 - (TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), objArr); if (((String) objArr[0]).intern().equals(zza) || !(!Boolean.parseBoolean(zza))) { return true; } int i4 = c + 119; e = i4 % 128; int i5 = i4 % 2; return false; } public final Integer zzc(String str) { int i = 2 % 2; String zza = zza(str); if (!TextUtils.isEmpty(zza)) { int i2 = c + 79; e = i2 % 128; try { if (i2 % 2 != 0) { return Integer.valueOf(Integer.parseInt(zza)); } Integer.valueOf(Integer.parseInt(zza)); throw null; } catch (NumberFormatException unused) { zzh(str); } } int i3 = c + 49; e = i3 % 128; int i4 = i3 % 2; return null; } public final Long zzd(String str) { int i = 2 % 2; int i2 = e + 13; c = i2 % 128; int i3 = i2 % 2; String zza = zza(str); if (!TextUtils.isEmpty(zza)) { int i4 = e + 17; c = i4 % 128; try { if (i4 % 2 == 0) { return Long.valueOf(Long.parseLong(zza)); } Long.valueOf(Long.parseLong(zza)); throw null; } catch (NumberFormatException unused) { zzh(str); } } return null; } public final String zze(String str) { int i = 2 % 2; int i2 = c + 107; e = i2 % 128; int i3 = i2 % 2; String zza = zza(String.valueOf(str).concat("_loc_key")); if (i3 == 0) { int i4 = 30 / 0; } int i5 = c + 11; e = i5 % 128; if (i5 % 2 != 0) { return zza; } throw null; } private void f(String str, Object[] objArr) { byte[] decode; int length; int i = 2 % 2; int i2 = e + 85; c = i2 % 128; if (i2 % 2 != 0) { decode = Base64.decode(str, 1); length = decode.length; } else { decode = Base64.decode(str, 0); length = decode.length; } byte[] bArr = new byte[length]; for (int i3 = 0; i3 < decode.length; i3++) { int i4 = c + 55; e = i4 % 128; int i5 = i4 % 2; bArr[i3] = (byte) (decode[(decode.length - i3) - 1] ^ b); } String str2 = new String(bArr, StandardCharsets.UTF_8); int i6 = c + 13; e = i6 % 128; if (i6 % 2 != 0) { objArr[0] = str2; } else { int i7 = 98 / 0; objArr[0] = str2; } } public final Object[] zzf(String str) { int i = 2 % 2; int i2 = c + 91; e = i2 % 128; if (i2 % 2 != 0) { JSONArray zzg = zzg(String.valueOf(str).concat("_loc_args")); if (zzg != null) { int length = zzg.length(); String[] strArr = new String[length]; for (int i3 = 0; i3 < length; i3++) { strArr[i3] = zzg.optString(i3); } return strArr; } int i4 = c + 95; e = i4 % 128; int i5 = i4 % 2; return null; } zzg(String.valueOf(str).concat("_loc_args")); throw null; } private final JSONArray zzg(String str) { int i = 2 % 2; int i2 = e + 51; c = i2 % 128; Object obj = null; if (i2 % 2 == 0) { String zza = zza(str); if (!TextUtils.isEmpty(zza)) { try { JSONArray jSONArray = new JSONArray(zza); int i3 = c + 9; e = i3 % 128; if (i3 % 2 == 0) { int i4 = 21 / 0; } return jSONArray; } catch (JSONException unused) { zzh(str); } } return null; } TextUtils.isEmpty(zza(str)); obj.hashCode(); throw null; } /* JADX WARN: Code restructure failed: missing block: B:10:0x0021, code lost: r1 = com.google.firebase.messaging.zzt.c + 33; com.google.firebase.messaging.zzt.e = r1 % 128; */ /* JADX WARN: Code restructure failed: missing block: B:11:0x002a, code lost: if ((r1 % 2) != 0) goto L12; */ /* JADX WARN: Code restructure failed: missing block: B:12:0x002c, code lost: r1 = 102; */ /* JADX WARN: Code restructure failed: missing block: B:13:0x0030, code lost: r3 = r3.substring(r1); */ /* JADX WARN: Code restructure failed: missing block: B:14:0x002f, code lost: r1 = 6; */ /* JADX WARN: Code restructure failed: missing block: B:16:0x001f, code lost: if (r3.startsWith("gcm.n.") != false) goto L9; */ /* JADX WARN: Code restructure failed: missing block: B:4:0x0018, code lost: if (r3.startsWith("gcm.n.") != false) goto L9; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static java.lang.String zzh(java.lang.String r3) { /* r0 = 2 int r1 = r0 % r0 int r1 = com.google.firebase.messaging.zzt.c int r1 = r1 + 1 int r2 = r1 % 128 com.google.firebase.messaging.zzt.e = r2 int r1 = r1 % r0 java.lang.String r2 = "gcm.n." if (r1 != 0) goto L1b boolean r1 = r3.startsWith(r2) r2 = 98 int r2 = r2 / 0 if (r1 == 0) goto L34 goto L21 L1b: boolean r1 = r3.startsWith(r2) if (r1 == 0) goto L34 L21: int r1 = com.google.firebase.messaging.zzt.c int r1 = r1 + 33 int r2 = r1 % 128 com.google.firebase.messaging.zzt.e = r2 int r1 = r1 % r0 if (r1 != 0) goto L2f r1 = 102(0x66, float:1.43E-43) goto L30 L2f: r1 = 6 L30: java.lang.String r3 = r3.substring(r1) L34: int r1 = com.google.firebase.messaging.zzt.e int r1 = r1 + 77 int r2 = r1 % 128 com.google.firebase.messaging.zzt.c = r2 int r1 = r1 % r0 if (r1 == 0) goto L43 r0 = 64 int r0 = r0 / 0 L43: return r3 */ throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.zzt.zzh(java.lang.String):java.lang.String"); } public final Uri zza() { int i = 2 % 2; String zza = zza("gcm.n.link_android"); Object obj = null; if (TextUtils.isEmpty(zza)) { int i2 = c + 61; e = i2 % 128; if (i2 % 2 != 0) { zza = zza("gcm.n.link"); } else { zza("gcm.n.link"); obj.hashCode(); throw null; } } if (TextUtils.isEmpty(zza)) { return null; } Uri parse = Uri.parse(zza); int i3 = c + 7; e = i3 % 128; int i4 = i3 % 2; return parse; } public final String zzb() { int i = 2 % 2; String zza = zza("gcm.n.sound2"); if (!TextUtils.isEmpty(zza)) { return zza; } int i2 = e + 35; c = i2 % 128; if (i2 % 2 != 0) { zza("gcm.n.sound"); throw null; } String zza2 = zza("gcm.n.sound"); int i3 = c + 73; e = i3 % 128; int i4 = i3 % 2; return zza2; } public final long[] zzc() { int i = 2 % 2; JSONArray zzg = zzg("gcm.n.vibrate_timings"); if (zzg == null) { int i2 = c + 19; e = i2 % 128; int i3 = i2 % 2; return null; } try { if (zzg.length() <= 1) { throw new JSONException("vibrateTimings have invalid length"); } int i4 = c + 95; e = i4 % 128; int i5 = i4 % 2; int length = zzg.length(); long[] jArr = new long[length]; int i6 = 0; while (i6 < length) { int i7 = c + 17; e = i7 % 128; int i8 = i7 % 2; jArr[i6] = zzg.optLong(i6); i6++; int i9 = e + 103; c = i9 % 128; if (i9 % 2 != 0) { int i10 = 2 / 4; } } return jArr; } catch (NumberFormatException | JSONException unused) { return null; } } private static void a(char[] cArr, int i, Object[] objArr) { int i2 = 2 % 2; C4593bdB c4593bdB = new C4593bdB(); c4593bdB.a = i; int length = cArr.length; long[] jArr = new long[length]; c4593bdB.e = 0; while (c4593bdB.e < cArr.length) { int i3 = $10 + 9; $11 = i3 % 128; int i4 = i3 % 2; int i5 = c4593bdB.e; try { Object[] objArr2 = {Integer.valueOf(cArr[c4593bdB.e]), c4593bdB, c4593bdB}; Object obj = xzZ.y.get(-1229953068); if (obj == null) { Class cls = (Class) xzZ.c(403 - (SystemClock.currentThreadTimeMillis() > (-1L) ? 1 : (SystemClock.currentThreadTimeMillis() == (-1L) ? 0 : -1)), 4 - TextUtils.lastIndexOf("", '0', 0), (char) (21607 - MotionEvent.axisFromString(""))); byte b2 = (byte) (-1); byte b3 = (byte) (b2 + 1); Object[] objArr3 = new Object[1]; g(b2, b3, b3, objArr3); obj = cls.getMethod((String) objArr3[0], Integer.TYPE, Object.class, Object.class); xzZ.y.put(-1229953068, obj); } jArr[i5] = ((Long) ((Method) obj).invoke(null, objArr2)).longValue() ^ (d ^ (-6958928035870403642L)); Object[] objArr4 = {c4593bdB, c4593bdB}; Object obj2 = xzZ.y.get(-1143917229); if (obj2 == null) { Class cls2 = (Class) xzZ.c(Color.rgb(0, 0, 0) + 16777454, 5 - (CdmaCellLocation.convertQuartSecToDecDegrees(0) > 0.0d ? 1 : (CdmaCellLocation.convertQuartSecToDecDegrees(0) == 0.0d ? 0 : -1)), (char) Drawable.resolveOpacity(0, 0)); byte b4 = (byte) (-1); byte b5 = (byte) (-b4); Object[] objArr5 = new Object[1]; g(b4, b5, (byte) (b5 - 1), objArr5); obj2 = cls2.getMethod((String) objArr5[0], Object.class, Object.class); xzZ.y.put(-1143917229, obj2); } ((Method) obj2).invoke(null, objArr4); int i6 = $10 + 91; $11 = i6 % 128; int i7 = i6 % 2; } catch (Throwable th) { Throwable cause = th.getCause(); if (cause == null) { throw th; } throw cause; } } char[] cArr2 = new char[length]; c4593bdB.e = 0; while (c4593bdB.e < cArr.length) { int i8 = $11 + 21; $10 = i8 % 128; int i9 = i8 % 2; cArr2[c4593bdB.e] = (char) jArr[c4593bdB.e]; Object[] objArr6 = {c4593bdB, c4593bdB}; Object obj3 = xzZ.y.get(-1143917229); if (obj3 == null) { Class cls3 = (Class) xzZ.c(Color.alpha(0) + 238, 5 - Color.blue(0), (char) (ViewConfiguration.getScrollDefaultDelay() >> 16)); byte b6 = (byte) (-1); byte b7 = (byte) (-b6); Object[] objArr7 = new Object[1]; g(b6, b7, (byte) (b7 - 1), objArr7); obj3 = cls3.getMethod((String) objArr7[0], Object.class, Object.class); xzZ.y.put(-1143917229, obj3); } ((Method) obj3).invoke(null, objArr6); } objArr[0] = new String(cArr2); } /* JADX INFO: Access modifiers changed from: package-private */ /* JADX WARN: Removed duplicated region for block: B:23:0x005d A[RETURN] */ /* JADX WARN: Removed duplicated region for block: B:24:0x005e */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final int[] zzd() { /* r7 = this; r0 = 2 int r1 = r0 % r0 int r1 = com.google.firebase.messaging.zzt.c int r1 = r1 + 89 int r2 = r1 % 128 com.google.firebase.messaging.zzt.e = r2 int r1 = r1 % r0 java.lang.String r2 = "gcm.n.light_settings" r3 = 0 if (r1 == 0) goto L5f org.json.JSONArray r1 = r7.zzg(r2) if (r1 != 0) goto L18 return r3 L18: r2 = 3 int[] r4 = new int[r2] int r5 = r1.length() // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 if (r5 != r2) goto L46 r2 = 0 java.lang.String r5 = r1.optString(r2) // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 int r5 = android.graphics.Color.parseColor(r5) // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 r6 = -16777216(0xffffffffff000000, float:-1.7014118E38) if (r5 == r6) goto L3e r4[r2] = r5 // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 r2 = 1 int r5 = r1.optInt(r2) // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 r4[r2] = r5 // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 int r1 = r1.optInt(r0) // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 r4[r0] = r1 // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 return r4 L3e: java.lang.IllegalArgumentException r1 = new java.lang.IllegalArgumentException // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 java.lang.String r2 = "Transparent color is invalid" r1.(r2) // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 throw r1 // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 L46: org.json.JSONException r1 = new org.json.JSONException // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 java.lang.String r2 = "lightSettings don't have all three fields" r1.(r2) // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 throw r1 // Catch: java.lang.IllegalArgumentException -> L4e org.json.JSONException -> L52 L4e: r1 = move-exception r1.getMessage() L52: int r1 = com.google.firebase.messaging.zzt.c int r1 = r1 + 41 int r2 = r1 % 128 com.google.firebase.messaging.zzt.e = r2 int r1 = r1 % r0 if (r1 == 0) goto L5e return r3 L5e: throw r3 L5f: r7.zzg(r2) throw r3 */ throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.zzt.zzd():int[]"); } public final Bundle zze() { int i = 2 % 2; Bundle bundle = new Bundle(this.zza); for (String str : this.zza.keySet()) { int i2 = c + 113; e = i2 % 128; int i3 = i2 % 2; if (!str.startsWith("google.c.") && !str.startsWith("gcm.n.")) { int i4 = c + 17; e = i4 % 128; int i5 = i4 % 2; if (!(!str.startsWith("gcm.notification."))) { } } bundle.remove(str); } return bundle; } public final Bundle zzf() { int i = 2 % 2; Bundle bundle = new Bundle(this.zza); Iterator it = this.zza.keySet().iterator(); while (it.hasNext()) { int i2 = e + 51; c = i2 % 128; if (i2 % 2 == 0) { String next = it.next(); if (!next.startsWith("google.c.a.") && !next.equals("from")) { int i3 = c + 81; e = i3 % 128; if (i3 % 2 == 0) { bundle.remove(next); int i4 = 61 / 0; } else { bundle.remove(next); } } } else { it.next().startsWith("google.c.a."); throw null; } } return bundle; } private final String zzb(Resources resources, String str, String str2) { int i = 2 % 2; String zze = zze(str2); Object obj = null; if (TextUtils.isEmpty(zze)) { int i2 = c + 83; e = i2 % 128; if (i2 % 2 != 0) { return null; } throw null; } int identifier = resources.getIdentifier(zze, "string", str); if (identifier == 0) { zzh(String.valueOf(str2).concat("_loc_key")); return null; } Object[] zzf = zzf(str2); if (zzf != null) { try { return resources.getString(identifier, zzf); } catch (MissingFormatArgumentException unused) { zzh(str2); Arrays.toString(zzf); return null; } } int i3 = e + 97; c = i3 % 128; if (i3 % 2 != 0) { resources.getString(identifier).startsWith(",*,)"); obj.hashCode(); throw null; } String string = resources.getString(identifier); if (string.startsWith(",*,)")) { Object[] objArr = new Object[1]; f(string.substring(4), objArr); string = ((String) objArr[0]).intern(); int i4 = c + 53; e = i4 % 128; int i5 = i4 % 2; } int i6 = c + 101; e = i6 % 128; if (i6 % 2 != 0) { return string; } throw null; } public final String zza(Resources resources, String str, String str2) { int i = 2 % 2; int i2 = c + 121; e = i2 % 128; int i3 = i2 % 2; String zza = zza(str2); if (!TextUtils.isEmpty(zza)) { int i4 = c + 117; e = i4 % 128; int i5 = i4 % 2; return zza; } String zzb = zzb(resources, str, str2); int i6 = e + 41; c = i6 % 128; if (i6 % 2 == 0) { return zzb; } Object obj = null; obj.hashCode(); throw null; } /* JADX WARN: Removed duplicated region for block: B:7:0x0090 A[RETURN] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public static boolean zza(android.os.Bundle r7) { /* r0 = 2 int r1 = r0 % r0 int r1 = com.google.firebase.messaging.zzt.c int r1 = r1 + 7 int r2 = r1 % 128 com.google.firebase.messaging.zzt.e = r2 int r1 = r1 % r0 r1 = 1 char[] r2 = new char[r1] r3 = 0 r4 = 27025(0x6991, float:3.787E-41) r2[r3] = r4 r5 = 64747(0xfceb, float:9.073E-41) int r6 = android.graphics.Color.blue(r3) int r6 = r6 + r5 java.lang.Object[] r5 = new java.lang.Object[r1] a(r2, r6, r5) r2 = r5[r3] java.lang.String r2 = (java.lang.String) r2 java.lang.String r2 = r2.intern() java.lang.String r5 = "gcm.n.e" java.lang.String r6 = r7.getString(r5) boolean r2 = r2.equals(r6) r2 = r2 ^ r1 if (r2 == r1) goto L37 goto L91 L37: int r2 = com.google.firebase.messaging.zzt.e int r2 = r2 + 85 int r6 = r2 % 128 com.google.firebase.messaging.zzt.c = r6 int r2 = r2 % r0 r0 = 64746(0xfcea, float:9.0728E-41) if (r2 == 0) goto L6b char[] r2 = new char[r1] r2[r3] = r4 int r4 = android.view.KeyEvent.getModifierMetaStateMask() byte r4 = (byte) r4 int r0 = r0 - r4 java.lang.Object[] r4 = new java.lang.Object[r1] a(r2, r0, r4) r0 = r4[r3] java.lang.String r0 = (java.lang.String) r0 java.lang.String r0 = r0.intern() java.lang.String r2 = zzi(r5) java.lang.String r7 = r7.getString(r2) boolean r7 = r0.equals(r7) if (r7 != 0) goto L91 goto L90 L6b: char[] r2 = new char[r1] r2[r3] = r4 int r4 = android.view.KeyEvent.getModifierMetaStateMask() byte r4 = (byte) r4 int r0 = r0 - r4 java.lang.Object[] r4 = new java.lang.Object[r1] a(r2, r0, r4) r0 = r4[r3] java.lang.String r0 = (java.lang.String) r0 java.lang.String r0 = r0.intern() java.lang.String r2 = zzi(r5) java.lang.String r7 = r7.getString(r2) boolean r7 = r0.equals(r7) if (r7 != 0) goto L91 L90: return r3 L91: return r1 */ throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.zzt.zza(android.os.Bundle):boolean"); } private static String zzi(String str) { int i = 2 % 2; if (str.startsWith("gcm.n.")) { String replace = str.replace("gcm.n.", "gcm.notification."); int i2 = e + 15; c = i2 % 128; if (i2 % 2 == 0) { return replace; } Object obj = null; obj.hashCode(); throw null; } int i3 = c + 25; e = i3 % 128; int i4 = i3 % 2; return str; } static void c() { d = -7271308817582818714L; } static { e = 1; c(); b = (byte) 6; int i = c + 97; e = i % 128; if (i % 2 == 0) { throw null; } } }