package com.google.android.gms.ads.identifier; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.ImageFormat; import android.graphics.drawable.Drawable; import android.os.RemoteException; import android.os.SystemClock; import android.text.TextUtils; import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.widget.ExpandableListView; import com.airbnb.deeplinkdispatch.UrlTreeKt; import com.google.android.gms.common.BlockingServiceConnection; import com.google.android.gms.common.GoogleApiAvailabilityLight; import com.google.android.gms.common.GooglePlayServicesNotAvailableException; import com.google.android.gms.common.GooglePlayServicesRepairableException; import com.google.android.gms.common.GooglePlayServicesUtilLight; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.common.stats.ConnectionTracker; import com.google.android.gms.internal.ads_identifier.zze; import com.google.android.gms.internal.ads_identifier.zzf; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import java.io.IOException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.concurrent.TimeUnit; import net.sf.scuba.smartcards.ISO7816; import net.sf.scuba.smartcards.ISOFileInfo; import o.C3614bBe; import o.xzZ; /* loaded from: classes.dex */ public class AdvertisingIdClient { BlockingServiceConnection zza; zzf zzb; boolean zzc; final Object zzd; zzb zze; final long zzf; private final Context zzg; private static final byte[] $$a = {75, ISO7816.INS_UPDATE_RECORD, 11, 77}; private static final int $$b = 204; private static int $10 = 0; private static int $11 = 1; private static int e = 0; private static int h = 1; private static char[] a = {15993, 15992}; private static int c = 1934310952; private static boolean d = true; private static boolean b = true; public AdvertisingIdClient(Context context) { this(context, 30000L, false, false); } /* JADX WARN: Removed duplicated region for block: B:10:0x0026 */ /* JADX WARN: Removed duplicated region for block: B:7:0x001e */ /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0026 -> B:4:0x002c). 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(byte r7, int r8, int r9, java.lang.Object[] r10) { /* byte[] r0 = com.google.android.gms.ads.identifier.AdvertisingIdClient.$$a int r8 = r8 * 57 int r8 = 122 - r8 int r7 = r7 * 4 int r7 = 1 - r7 int r9 = r9 * 4 int r9 = 4 - r9 byte[] r1 = new byte[r7] r2 = 0 if (r0 != 0) goto L16 r3 = r9 r4 = r2 goto L2c L16: r3 = r2 L17: int r4 = r3 + 1 byte r5 = (byte) r8 r1[r3] = r5 if (r4 != r7) goto L26 java.lang.String r7 = new java.lang.String r7.(r1, r2) r10[r2] = r7 return L26: r3 = r0[r9] r6 = r9 r9 = r8 r8 = r3 r3 = r6 L2c: int r8 = r8 + r9 int r9 = r3 + 1 r3 = r4 goto L17 */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.ads.identifier.AdvertisingIdClient.g(byte, int, int, java.lang.Object[]):void"); } public static boolean getIsAdIdFakeForDebugLogging(Context context) throws IOException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException { boolean zzd; AdvertisingIdClient advertisingIdClient = new AdvertisingIdClient(context, -1L, false, false); try { advertisingIdClient.zzb(false); Preconditions.checkNotMainThread("Calling this from your main thread can lead to deadlock"); synchronized (advertisingIdClient) { if (!advertisingIdClient.zzc) { synchronized (advertisingIdClient.zzd) { zzb zzbVar = advertisingIdClient.zze; if (zzbVar == null || !zzbVar.zzb) { throw new IOException("AdvertisingIdClient is not connected."); } } try { advertisingIdClient.zzb(false); if (!advertisingIdClient.zzc) { throw new IOException("AdvertisingIdClient cannot reconnect."); } } catch (Exception e2) { throw new IOException("AdvertisingIdClient cannot reconnect.", e2); } } Preconditions.checkNotNull(advertisingIdClient.zza); Preconditions.checkNotNull(advertisingIdClient.zzb); try { zzd = advertisingIdClient.zzb.zzd(); } catch (RemoteException unused) { throw new IOException("Remote exception"); } } advertisingIdClient.zze(); return zzd; } finally { advertisingIdClient.zza(); } } private final Info zzd(int i) throws IOException { Info info; Preconditions.checkNotMainThread("Calling this from your main thread can lead to deadlock"); synchronized (this) { if (!this.zzc) { synchronized (this.zzd) { zzb zzbVar = this.zze; if (zzbVar == null || !zzbVar.zzb) { throw new IOException("AdvertisingIdClient is not connected."); } } try { zzb(false); if (!this.zzc) { throw new IOException("AdvertisingIdClient cannot reconnect."); } } catch (Exception e2) { throw new IOException("AdvertisingIdClient cannot reconnect.", e2); } } Preconditions.checkNotNull(this.zza); Preconditions.checkNotNull(this.zzb); try { info = new Info(this.zzb.zzc(), this.zzb.zze(true)); } catch (RemoteException unused) { throw new IOException("Remote exception"); } } zze(); return info; } private final void zze() { synchronized (this.zzd) { zzb zzbVar = this.zze; if (zzbVar != null) { zzbVar.zza.countDown(); try { this.zze.join(); } catch (InterruptedException unused) { } } long j = this.zzf; if (j > 0) { this.zze = new zzb(this, j); } } } public Info getInfo() throws IOException { int i = 2 % 2; int i2 = h + 59; e = i2 % 128; int i3 = i2 % 2; Info zzd = zzd(-1); if (i3 != 0) { int i4 = 7 / 0; } return zzd; } public void start() throws IOException, IllegalStateException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException { int i = 2 % 2; int i2 = h + 67; e = i2 % 128; int i3 = i2 % 2; zzb(true); } public final void zza() { Preconditions.checkNotMainThread("Calling this from your main thread can lead to deadlock"); synchronized (this) { if (this.zzg == null || this.zza == null) { return; } try { if (this.zzc) { ConnectionTracker.getInstance().unbindService(this.zzg, this.zza); } } catch (Throwable unused) { } this.zzc = false; this.zzb = null; this.zza = null; } } protected final void zzb(boolean z) throws IOException, IllegalStateException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException { Preconditions.checkNotMainThread("Calling this from your main thread can lead to deadlock"); synchronized (this) { if (this.zzc) { zza(); } Context context = this.zzg; try { context.getPackageManager().getPackageInfo("com.android.vending", 0); int isGooglePlayServicesAvailable = GoogleApiAvailabilityLight.getInstance().isGooglePlayServicesAvailable(context, GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE); if (isGooglePlayServicesAvailable != 0 && isGooglePlayServicesAvailable != 2) { throw new IOException("Google Play services not available"); } BlockingServiceConnection blockingServiceConnection = new BlockingServiceConnection(); Intent intent = new Intent("com.google.android.gms.ads.identifier.service.START"); intent.setPackage("com.google.android.gms"); try { if (!ConnectionTracker.getInstance().bindService(context, intent, blockingServiceConnection, 1)) { throw new IOException("Connection failure"); } this.zza = blockingServiceConnection; try { this.zzb = zze.zza(blockingServiceConnection.getServiceWithTimeout(10000L, TimeUnit.MILLISECONDS)); this.zzc = true; if (z) { zze(); } } catch (InterruptedException unused) { throw new IOException("Interrupted exception"); } catch (Throwable th) { throw new IOException(th); } } finally { IOException iOException = new IOException(th); } } catch (PackageManager.NameNotFoundException unused2) { throw new GooglePlayServicesNotAvailableException(9); } } } public AdvertisingIdClient(Context context, long j, boolean z, boolean z2) { Context applicationContext; this.zzd = new Object(); Preconditions.checkNotNull(context); if (z && (applicationContext = context.getApplicationContext()) != null) { int i = e + 9; h = i % 128; if (i % 2 == 0) { Object obj = null; obj.hashCode(); throw null; } int i2 = 2 % 2; context = applicationContext; } this.zzg = context; this.zzc = false; this.zzf = j; int i3 = h + 109; e = i3 % 128; int i4 = i3 % 2; } protected final void finalize() throws Throwable { int i = 2 % 2; int i2 = e + 3; h = i2 % 128; int i3 = i2 % 2; zza(); super.finalize(); int i4 = e + 117; h = i4 % 128; int i5 = i4 % 2; } public static Info getAdvertisingIdInfo(Context context) throws IOException, IllegalStateException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException { int i = 2 % 2; AdvertisingIdClient advertisingIdClient = new AdvertisingIdClient(context, -1L, true, false); try { long elapsedRealtime = SystemClock.elapsedRealtime(); advertisingIdClient.zzb(false); Info zzd = advertisingIdClient.zzd(-1); advertisingIdClient.zzc(zzd, true, BitmapDescriptorFactory.HUE_RED, SystemClock.elapsedRealtime() - elapsedRealtime, "", null); advertisingIdClient.zza(); int i2 = h + 85; e = i2 % 128; if (i2 % 2 == 0) { return zzd; } Object obj = null; obj.hashCode(); throw null; } finally { } } final boolean zzc(Info info, boolean z, float f, long j, String str, Throwable th) { int i = 2 % 2; int i2 = h + 111; e = i2 % 128; int i3 = i2 % 2; if (Math.random() > 0.0d) { return false; } HashMap hashMap = new HashMap(); Object[] objArr = new Object[1]; Object obj = null; f(null, new byte[]{ISOFileInfo.DATA_BYTES2}, null, MotionEvent.axisFromString("") + 128, objArr); String intern = ((String) objArr[0]).intern(); Object[] objArr2 = new Object[1]; f(null, new byte[]{ISOFileInfo.DATA_BYTES2}, null, 126 - ExpandableListView.getPackedPositionChild(0L), objArr2); hashMap.put("app_context", ((String) objArr2[0]).intern()); if (info != null) { int i4 = h + 105; e = i4 % 128; if (i4 % 2 == 0 ? true != info.isLimitAdTrackingEnabled() : true != info.isLimitAdTrackingEnabled()) { Object[] objArr3 = new Object[1]; f(null, new byte[]{-126}, null, 127 - (ViewConfiguration.getJumpTapTimeout() >> 16), objArr3); intern = ((String) objArr3[0]).intern(); int i5 = h + 101; e = i5 % 128; int i6 = i5 % 2; } hashMap.put("limit_ad_tracking", intern); String id = info.getId(); if (id != null) { hashMap.put("ad_id_size", Integer.toString(id.length())); } } if (th != null) { int i7 = e + 63; h = i7 % 128; if (i7 % 2 == 0) { hashMap.put("error", th.getClass().getName()); obj.hashCode(); throw null; } hashMap.put("error", th.getClass().getName()); } hashMap.put("tag", "AdvertisingIdClient"); hashMap.put("time_spent", Long.toString(j)); new zza(this, hashMap).start(); return true; } private static void f(char[] cArr, byte[] bArr, int[] iArr, int i, Object[] objArr) { char[] cArr2; int i2 = 2 % 2; C3614bBe c3614bBe = new C3614bBe(); char[] cArr3 = a; long j = 0; if (cArr3 != null) { int length = cArr3.length; char[] cArr4 = new char[length]; int i3 = 0; while (i3 < length) { try { Object[] objArr2 = {Integer.valueOf(cArr3[i3])}; Object obj = xzZ.y.get(-950481649); if (obj == null) { Class cls = (Class) xzZ.c((ViewConfiguration.getScrollBarFadeDuration() >> 16) + 337, (ViewConfiguration.getMinimumFlingVelocity() >> 16) + 5, (char) ((ViewConfiguration.getZoomControlsTimeout() > j ? 1 : (ViewConfiguration.getZoomControlsTimeout() == j ? 0 : -1)) - 1)); byte b2 = (byte) 0; byte b3 = (byte) (b2 + 1); Object[] objArr3 = new Object[1]; g(b2, b3, (byte) (b3 - 1), objArr3); obj = cls.getMethod((String) objArr3[0], Integer.TYPE); xzZ.y.put(-950481649, obj); } cArr4[i3] = ((Character) ((Method) obj).invoke(null, objArr2)).charValue(); i3++; j = 0; } catch (Throwable th) { Throwable cause = th.getCause(); if (cause == null) { throw th; } throw cause; } } cArr3 = cArr4; } Object[] objArr4 = {Integer.valueOf(c)}; Object obj2 = xzZ.y.get(-1521625011); if (obj2 == null) { Class cls2 = (Class) xzZ.c((TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 283, TextUtils.indexOf("", "", 0, 0) + 5, (char) ((SystemClock.uptimeMillis() > 0L ? 1 : (SystemClock.uptimeMillis() == 0L ? 0 : -1)) + 39812)); byte b4 = (byte) 0; byte b5 = b4; Object[] objArr5 = new Object[1]; g(b4, b5, b5, objArr5); obj2 = cls2.getMethod((String) objArr5[0], Integer.TYPE); xzZ.y.put(-1521625011, obj2); } int intValue = ((Integer) ((Method) obj2).invoke(null, objArr4)).intValue(); if (b) { int i4 = $11 + 113; $10 = i4 % 128; if (i4 % 2 != 0) { c3614bBe.c = bArr.length; cArr2 = new char[c3614bBe.c]; c3614bBe.a = 1; } else { c3614bBe.c = bArr.length; cArr2 = new char[c3614bBe.c]; c3614bBe.a = 0; } while (c3614bBe.a < c3614bBe.c) { cArr2[c3614bBe.a] = (char) (cArr3[bArr[(c3614bBe.c - 1) - c3614bBe.a] + i] - intValue); Object[] objArr6 = {c3614bBe, c3614bBe}; Object obj3 = xzZ.y.get(1779759091); if (obj3 == null) { obj3 = ((Class) xzZ.c(40 - (ViewConfiguration.getKeyRepeatDelay() >> 16), Drawable.resolveOpacity(0, 0) + 5, (char) ((-1) - ImageFormat.getBitsPerPixel(0)))).getMethod("D", Object.class, Object.class); xzZ.y.put(1779759091, obj3); } ((Method) obj3).invoke(null, objArr6); } objArr[0] = new String(cArr2); return; } if (!d) { c3614bBe.c = iArr.length; char[] cArr5 = new char[c3614bBe.c]; c3614bBe.a = 0; while (c3614bBe.a < c3614bBe.c) { cArr5[c3614bBe.a] = (char) (cArr3[iArr[(c3614bBe.c - 1) - c3614bBe.a] - i] - intValue); c3614bBe.a++; } objArr[0] = new String(cArr5); return; } c3614bBe.c = cArr.length; char[] cArr6 = new char[c3614bBe.c]; c3614bBe.a = 0; while (c3614bBe.a < c3614bBe.c) { int i5 = $11 + 77; $10 = i5 % 128; if (i5 % 2 != 0) { cArr6[c3614bBe.a] = (char) (cArr3[cArr[(c3614bBe.c % 1) + c3614bBe.a] - i] << intValue); Object[] objArr7 = {c3614bBe, c3614bBe}; Object obj4 = xzZ.y.get(1779759091); if (obj4 == null) { obj4 = ((Class) xzZ.c(41 - (SystemClock.elapsedRealtime() > 0L ? 1 : (SystemClock.elapsedRealtime() == 0L ? 0 : -1)), (ViewConfiguration.getEdgeSlop() >> 16) + 5, (char) (TextUtils.lastIndexOf("", '0') + 1))).getMethod("D", Object.class, Object.class); xzZ.y.put(1779759091, obj4); } ((Method) obj4).invoke(null, objArr7); } else { cArr6[c3614bBe.a] = (char) (cArr3[cArr[(c3614bBe.c - 1) - c3614bBe.a] - i] - intValue); try { Object[] objArr8 = {c3614bBe, c3614bBe}; Object obj5 = xzZ.y.get(1779759091); if (obj5 == null) { obj5 = ((Class) xzZ.c(40 - (ViewConfiguration.getScrollBarSize() >> 8), 5 - View.MeasureSpec.getMode(0), (char) ((-1) - TextUtils.lastIndexOf("", '0', 0)))).getMethod("D", Object.class, Object.class); xzZ.y.put(1779759091, obj5); } ((Method) obj5).invoke(null, objArr8); } catch (Throwable th2) { Throwable cause2 = th2.getCause(); if (cause2 == null) { throw th2; } throw cause2; } } } String str = new String(cArr6); int i6 = $10 + 109; $11 = i6 % 128; if (i6 % 2 != 0) { objArr[0] = str; } else { Object obj6 = null; obj6.hashCode(); throw null; } } /* loaded from: classes.dex */ public static final class Info { private final String zza; private final boolean zzb; public final String toString() { String str = this.zza; boolean z = this.zzb; StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 7); sb.append(UrlTreeKt.componentParamPrefix); sb.append(str); sb.append(UrlTreeKt.componentParamSuffix); sb.append(z); return sb.toString(); } public final boolean isLimitAdTrackingEnabled() { return this.zzb; } public final String getId() { return this.zza; } @Deprecated public Info(String str, boolean z) { this.zza = str; this.zzb = z; } } public static void setShouldSkipGmsCoreVersionCheck(boolean z) { int i = 2 % 2; int i2 = e + 125; h = i2 % 128; if (i2 % 2 != 0) { return; } Object obj = null; obj.hashCode(); throw null; } }