package com.google.firebase.messaging; import android.app.Service; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.media.AudioTrack; import android.os.Binder; import android.os.IBinder; import android.os.Process; import android.os.SystemClock; import android.telephony.cdma.CdmaCellLocation; import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.widget.ExpandableListView; import com.google.android.gms.common.util.concurrent.NamedThreadFactory; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.TaskCompletionSource; import com.google.android.gms.tasks.Tasks; import com.google.common.base.Ascii; import com.google.firebase.iid.zzbc; import com.google.firebase.iid.zzbd; import com.google.firebase.iid.zzbe; import java.lang.reflect.Method; import java.util.concurrent.ExecutorService; import net.sf.scuba.smartcards.ISO7816; import net.sf.scuba.smartcards.ISOFileInfo; import o.xzZ; import org.bouncycastle.crypto.signers.PSSSigner; /* loaded from: classes2.dex */ public abstract class zzf extends Service { private static short[] b; private Binder zzb; private int zzd; private static final byte[] $$d = {43, -33, 87, 81}; private static final int $$e = 40; private static int $10 = 0; private static int $11 = 1; private static int h = 0; private static int f = 1; private static int a = -973111993; private static int c = 1406017032; private static int e = -777011650; private static byte[] d = {ISO7816.INS_CREATE_FILE, 12, ISO7816.INS_INCREASE, 14, Ascii.CAN, 3, 46, 46, -63, 8, 79, -10, 1, 6, 3, ISO7816.INS_INCREASE, Ascii.SUB, 51, -3, 39, 94, 6, 86, 6, -63, 39, -49, 38, Ascii.DC4, Ascii.US, Ascii.DC2, ISO7816.INS_GET_RESPONSE, 16, Ascii.ETB, 17, 47, -21, 29, 28, 16, -57, 37, -50, 38, ISO7816.INS_ENVELOPE, 39, ISO7816.INS_GET_RESPONSE, 39, -56, 39, 19, Ascii.NAK, 30, 17, -61, 58, Ascii.US, -61, 33, ISO7816.INS_ENVELOPE, 33, -21, -55, 19, Ascii.NAK, 29, 32, -61, 38, Ascii.ETB, 30, 54, 69, 94, 109, 95, 70, 15, ISOFileInfo.FCP_BYTE, 55, 108, 92, ISO7816.INS_DECREASE_STAMPED, 109, 8, ISOFileInfo.FCI_BYTE, 53, 91, 109, ISO7816.INS_REHABILITATE_CHV, 93, 94, ISO7816.INS_DECREASE_STAMPED, 94, 109, 53, 89, 99, 90, 53, 109, 95, 89, 94, 65, 86, 70, 14, 106, 83, 90, 94, 10, ISOFileInfo.FCP_BYTE, 10, 104, 88, 92, 95, ISO7816.INS_REHABILITATE_CHV, 83, 88, 69, 93, 69, 92, 9, 109, ISO7816.INS_REHABILITATE_CHV, 11, 109, 8, 110, 53, 92, 54, 99, ISO7816.INS_LOAD_KEY_FILE, ISO7816.INS_READ_BINARY, 99, -120, -78, -58, 121, -51, ISOFileInfo.SECURITY_ATTR_COMPACT, ISO7816.INS_READ_BINARY, -75, -67, 122, ISO7816.INS_READ_BINARY, ISOFileInfo.LCS_BYTE, -60, 96, ISOFileInfo.LCS_BYTE, ISO7816.INS_GET_RESPONSE, -75, -78, -120, ISO7816.INS_READ_RECORD2, -73, ISO7816.INS_READ_BINARY_STAMPED, ISOFileInfo.LCS_BYTE, -73, 99, ISO7816.INS_READ_BINARY_STAMPED, -59, 103, ISO7816.INS_LOAD_KEY_FILE, ISO7816.INS_READ_BINARY, -75, 96, ISO7816.INS_READ_BINARY_STAMPED, -59, ISOFileInfo.FCP_BYTE, -58, -120, PSSSigner.TRAILER_IMPLICIT, ISO7816.INS_READ_BINARY_STAMPED, ISO7816.INS_READ_RECORD_STAMPED, 121, ISO7816.INS_READ_RECORD2, ISO7816.INS_READ_RECORD_STAMPED, -34, -65, ISOFileInfo.SECURITY_ATTR_EXP, 97, ISOFileInfo.LCS_BYTE, -63, -119, PSSSigner.TRAILER_IMPLICIT, 122, -73, -63, 97, -59, ISO7816.INS_READ_BINARY, -113, 108, 56, -49, -12, -15, -33, -7, 4, -51, -126, 55, ISOFileInfo.FILE_IDENTIFIER, -55, -4, -52, -63, -11, 0, ISO7816.INS_READ_BINARY_STAMPED, -63, -1, Ascii.CAN, -120, -52, -14, 5, ISO7816.INS_READ_BINARY2, -37, -7, ISO7816.INS_WRITE_RECORD, ISO7816.INS_GET_DATA, -52, -1, ISO7816.INS_LOAD_KEY_FILE, -7, ISO7816.INS_WRITE_RECORD, -4, 1, Byte.MIN_VALUE, -55, -8, -52, -33, -5, ISO7816.INS_ENVELOPE, -37, -16, ISO7816.INS_PUT_DATA, ISO7816.INS_DECREASE_STAMPED, ISOFileInfo.SECURITY_ATTR_EXP, -51, -3, -49, -60, -13, -58, -12, -39, -3, -58, -50, -52, -14, -60, -14, -58, -60, 10, -50, -59, -73, -53, ISO7816.INS_ENVELOPE, -50, -14, -3, 43, 39, 83, ISO7816.INS_CHANGE_CHV, Ascii.DC2, 96, 40, 87, 85, 6, ISO7816.INS_PSO, 122, 2, 101, 5, 103, 83, 30, ISO7816.INS_PSO, 81, 87, 96, 40, 84, 85, ISO7816.INS_PSO, 93, Ascii.EM, 43, 99, 46, 95, 43, 40, 41, 3, ISOFileInfo.FMD_BYTE, 86, 7, 40}; private final ExecutorService zza = com.google.android.gms.internal.firebase_messaging.zza.zza().zza(new NamedThreadFactory("Firebase-Messaging-Intent-Handle"), com.google.android.gms.internal.firebase_messaging.zzf.zzb); private final Object zzc = new Object(); private int zze = 0; /* 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:0x0030). 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 l(byte r6, int r7, int r8, java.lang.Object[] r9) { /* int r6 = r6 + 4 int r8 = r8 * 3 int r0 = 1 - r8 byte[] r1 = com.google.firebase.messaging.zzf.$$d int r7 = r7 * 2 int r7 = 110 - r7 byte[] r0 = new byte[r0] r2 = 0 int r8 = 0 - r8 if (r1 != 0) goto L17 r7 = r6 r3 = r8 r4 = r2 goto L30 L17: r3 = r2 L18: byte r4 = (byte) r7 int r6 = r6 + 1 r0[r3] = r4 if (r3 != r8) goto L27 java.lang.String r6 = new java.lang.String r6.(r0, r2) r9[r2] = r6 return L27: int r3 = r3 + 1 r4 = r1[r6] r5 = r7 r7 = r6 r6 = r4 r4 = r3 r3 = r5 L30: int r6 = r6 + r3 r3 = r4 r5 = r7 r7 = r6 r6 = r5 goto L18 */ throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.zzf.l(byte, int, int, java.lang.Object[]):void"); } public abstract void zzc(Intent intent); @Override // android.app.Service public final IBinder onBind(Intent intent) { Binder binder; synchronized (this) { if (this.zzb == null) { this.zzb = new zzbc(new zzbe(this) { // from class: com.google.firebase.messaging.zze private final zzf zza; @Override // com.google.firebase.iid.zzbe public final Task zza(Intent intent2) { return this.zza.zzd(intent2); } /* JADX INFO: Access modifiers changed from: package-private */ { this.zza = this; } }); } binder = this.zzb; } return binder; } private final Task zze(final Intent intent) { int i = 2 % 2; int i2 = h + 125; f = i2 % 128; if (i2 % 2 != 0) { if (zzb(intent)) { Task forResult = Tasks.forResult(null); int i3 = h + 95; f = i3 % 128; if (i3 % 2 != 0) { return forResult; } throw null; } final TaskCompletionSource taskCompletionSource = new TaskCompletionSource(); this.zza.execute(new Runnable(this, intent, taskCompletionSource) { // from class: com.google.firebase.messaging.zzh private final zzf zza; private final Intent zzb; private final TaskCompletionSource zzc; @Override // java.lang.Runnable public final void run() { zzf zzfVar = this.zza; Intent intent2 = this.zzb; TaskCompletionSource taskCompletionSource2 = this.zzc; try { zzfVar.zzc(intent2); } finally { taskCompletionSource2.setResult(null); } } /* JADX INFO: Access modifiers changed from: package-private */ { this.zza = this; this.zzb = intent; this.zzc = taskCompletionSource; } }); return taskCompletionSource.getTask(); } zzb(intent); throw null; } @Override // android.app.Service public final int onStartCommand(final Intent intent, int i, int i2) { synchronized (this.zzc) { this.zzd = i2; this.zze++; } Intent zza = zza(intent); if (zza == null) { zzf(intent); return 2; } Task zze = zze(zza); if (zze.isComplete()) { zzf(intent); return 2; } zze.addOnCompleteListener(zzg.zza, new OnCompleteListener(this, intent) { // from class: com.google.firebase.messaging.zzj private final zzf zza; private final Intent zzb; @Override // com.google.android.gms.tasks.OnCompleteListener public final void onComplete(Task task) { this.zza.zza(this.zzb, task); } /* JADX INFO: Access modifiers changed from: package-private */ { this.zza = this; this.zzb = intent; } }); return 3; } @Override // android.app.Service public void onDestroy() { int i = 2 % 2; int i2 = f + 91; h = i2 % 128; if (i2 % 2 == 0) { this.zza.shutdown(); super.onDestroy(); } else { this.zza.shutdown(); super.onDestroy(); throw null; } } private final void zzf(Intent intent) { if (intent != null) { zzbd.zza(intent); } synchronized (this.zzc) { int i = this.zze - 1; this.zze = i; if (i == 0) { stopSelfResult(this.zzd); } } } /* JADX INFO: Access modifiers changed from: package-private */ public final /* synthetic */ void zza(Intent intent, Task task) { int i = 2 % 2; int i2 = h + 27; f = i2 % 128; int i3 = i2 % 2; zzf(intent); if (i3 != 0) { return; } Object obj = null; obj.hashCode(); throw null; } @Override // android.app.Service, android.content.ContextWrapper public void attachBaseContext(Context context) { Context context2; int i = 2 % 2; super.attachBaseContext(context); Object[] objArr = new Object[1]; k((short) (Color.green(0) - 25), 1775148206 + (KeyEvent.getMaxKeyCode() >> 16), (-31) - MotionEvent.axisFromString(""), 2107531318 - (ViewConfiguration.getScrollBarSize() >> 8), (byte) View.getDefaultSize(0, 0), objArr); Class cls = Class.forName((String) objArr[0]); Object[] objArr2 = new Object[1]; k((short) (ExpandableListView.getPackedPositionChild(0L) - 54), TextUtils.indexOf("", "", 0) + 1775148224, (ViewConfiguration.getTapTimeout() >> 16) - 30, 2107531330 - View.getDefaultSize(0, 0), (byte) ((-1) - Process.getGidForName("")), objArr2); int intValue = ((Integer) cls.getDeclaredMethod((String) objArr2[0], new Class[0]).invoke(null, new Object[0])).intValue() % 100000; if (intValue < 99000 || intValue > 99999) { if (context != null) { context2 = context.getApplicationContext(); int i2 = f + 49; h = i2 % 128; int i3 = i2 % 2; } else { context2 = context; } if (context2 != null) { int i4 = f + 17; h = i4 % 128; int i5 = i4 % 2; try { Object obj = xzZ.y.get(125943855); if (obj == null) { obj = ((Class) xzZ.c((ViewConfiguration.getScrollFriction() > BitmapDescriptorFactory.HUE_RED ? 1 : (ViewConfiguration.getScrollFriction() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 491, (ViewConfiguration.getPressedStateDuration() >> 16) + 5, (char) (Process.myTid() >> 22))).getMethod("a", null); xzZ.y.put(125943855, obj); } Object invoke = ((Method) obj).invoke(null, null); Object[] objArr3 = new Object[1]; k((short) ((ViewConfiguration.getGlobalActionKeyTimeout() > 0L ? 1 : (ViewConfiguration.getGlobalActionKeyTimeout() == 0L ? 0 : -1)) - 6), View.resolveSizeAndState(0, 0, 0) + 1775148229, (ViewConfiguration.getTouchSlop() >> 8) - 30, (ViewConfiguration.getZoomControlsTimeout() > 0L ? 1 : (ViewConfiguration.getZoomControlsTimeout() == 0L ? 0 : -1)) + 2107531269, (byte) (TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), objArr3); String str = (String) objArr3[0]; Object[] objArr4 = new Object[1]; k((short) ((-76) - (ViewConfiguration.getPressedStateDuration() >> 16)), 1775148277 - (ViewConfiguration.getFadingEdgeLength() >> 16), (-31) - MotionEvent.axisFromString(""), 2107531322 - (ViewConfiguration.getLongPressTimeout() >> 16), (byte) (ViewConfiguration.getDoubleTapTimeout() >> 16), objArr4); String str2 = (String) objArr4[0]; Object[] objArr5 = new Object[1]; k((short) (94 - (ViewConfiguration.getDoubleTapTimeout() >> 16)), 1775148341 - TextUtils.indexOf("", ""), (ViewConfiguration.getScrollBarFadeDuration() >> 16) - 30, 2107531318 - (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)), (byte) ((ExpandableListView.getPackedPositionForChild(0, 0) > 0L ? 1 : (ExpandableListView.getPackedPositionForChild(0, 0) == 0L ? 0 : -1)) + 1), objArr5); String str3 = (String) objArr5[0]; Object[] objArr6 = new Object[1]; k((short) (37 - (ViewConfiguration.getJumpTapTimeout() >> 16)), 1775148404 + (AudioTrack.getMaxVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMaxVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), (-30) - View.resolveSizeAndState(0, 0, 0), (ViewConfiguration.getMaximumDrawingCacheSize() >> 24) + 2107531325, (byte) (Process.myTid() >> 22), objArr6); String str4 = (String) objArr6[0]; Object[] objArr7 = new Object[1]; k((short) (ExpandableListView.getPackedPositionChild(0L) - 59), 1775148479 + (ViewConfiguration.getEdgeSlop() >> 16), (-30) - View.resolveSize(0, 0), 2107531279 - (ViewConfiguration.getGlobalActionKeyTimeout() > 0L ? 1 : (ViewConfiguration.getGlobalActionKeyTimeout() == 0L ? 0 : -1)), (byte) (TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), objArr7); String str5 = (String) objArr7[0]; Object[] objArr8 = new Object[1]; k((short) (Gravity.getAbsoluteGravity(0, 0) - 65), 1775148484 - (CdmaCellLocation.convertQuartSecToDecDegrees(0) > 0.0d ? 1 : (CdmaCellLocation.convertQuartSecToDecDegrees(0) == 0.0d ? 0 : -1)), (-31) - TextUtils.indexOf((CharSequence) "", '0', 0), 2107531322 - View.resolveSize(0, 0), (byte) (ViewConfiguration.getMaximumDrawingCacheSize() >> 24), objArr8); Object[] objArr9 = {context2, str, str2, str3, str4, true, str5, (String) objArr8[0]}; Object obj2 = xzZ.y.get(1656189573); if (obj2 == null) { obj2 = ((Class) xzZ.c(View.combineMeasuredStates(0, 0) + 487, (ViewConfiguration.getScrollBarSize() >> 8) + 5, (char) (1 - (SystemClock.currentThreadTimeMillis() > (-1L) ? 1 : (SystemClock.currentThreadTimeMillis() == (-1L) ? 0 : -1))))).getMethod("e", Context.class, String.class, String.class, String.class, String.class, Boolean.TYPE, String.class, String.class); xzZ.y.put(1656189573, obj2); } ((Method) obj2).invoke(invoke, objArr9); } catch (Throwable th) { Throwable cause = th.getCause(); if (cause == null) { throw th; } throw cause; } } } int i6 = h + 31; f = i6 % 128; if (i6 % 2 == 0) { throw null; } } /* JADX WARN: Removed duplicated region for block: B:44:0x0245 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static void k(short r19, int r20, int r21, int r22, byte r23, java.lang.Object[] r24) { /* Method dump skipped, instructions count: 925 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.messaging.zzf.k(short, int, int, int, byte, java.lang.Object[]):void"); } @Override // android.app.Service public void onCreate() { int i = 2 % 2; int i2 = f + 91; h = i2 % 128; int i3 = i2 % 2; super.onCreate(); int i4 = f + 79; h = i4 % 128; int i5 = i4 % 2; } /* JADX INFO: Access modifiers changed from: package-private */ public final /* synthetic */ Task zzd(Intent intent) { int i = 2 % 2; int i2 = h + 99; f = i2 % 128; if (i2 % 2 == 0) { zze(intent); Object obj = null; obj.hashCode(); throw null; } Task zze = zze(intent); int i3 = f + 31; h = i3 % 128; int i4 = i3 % 2; return zze; } public boolean zzb(Intent intent) { int i = 2 % 2; int i2 = h + 103; f = i2 % 128; return i2 % 2 == 0; } protected Intent zza(Intent intent) { int i = 2 % 2; int i2 = h + 115; f = i2 % 128; if (i2 % 2 == 0) { int i3 = 81 / 0; } return intent; } }