package com.google.android.gms.measurement.internal; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabaseLockedException; import android.database.sqlite.SQLiteException; import android.database.sqlite.SQLiteFullException; import android.os.Parcel; import android.os.SystemClock; /* loaded from: classes.dex */ public final class zzem extends zzf { private final zzel zza; private boolean zzb; zzem(zzgd zzgdVar) { super(zzgdVar); Context zzaw = this.zzt.zzaw(); this.zzt.zzf(); this.zza = new zzel(this, zzaw, "google_app_measurement_local.db"); } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Removed duplicated region for block: B:36:0x0124 */ /* JADX WARN: Removed duplicated region for block: B:38:0x0129 */ /* JADX WARN: Type inference failed for: r10v0 */ /* JADX WARN: Type inference failed for: r10v10, types: [android.database.Cursor] */ /* JADX WARN: Type inference failed for: r10v12 */ /* JADX WARN: Type inference failed for: r10v2 */ /* JADX WARN: Type inference failed for: r10v3, types: [android.database.Cursor] */ /* JADX WARN: Type inference failed for: r10v6 */ /* JADX WARN: Type inference failed for: r10v7 */ /* JADX WARN: Type inference failed for: r10v8 */ /* JADX WARN: Type inference failed for: r10v9 */ /* JADX WARN: Type inference failed for: r2v0 */ /* JADX WARN: Type inference failed for: r2v1, types: [boolean, int] */ /* JADX WARN: Type inference failed for: r2v13 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ private final boolean zzq(int r18, byte[] r19) { /* Method dump skipped, instructions count: 318 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.measurement.internal.zzem.zzq(int, byte[]):boolean"); } @Override // com.google.android.gms.measurement.internal.zzf protected final boolean zzf() { return false; } final SQLiteDatabase zzh() { if (this.zzb) { return null; } SQLiteDatabase writableDatabase = this.zza.getWritableDatabase(); if (writableDatabase != null) { return writableDatabase; } this.zzb = true; return null; } /* JADX WARN: Removed duplicated region for block: B:194:0x01da A[EXC_TOP_SPLITTER, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:22:0x0229 */ /* JADX WARN: Removed duplicated region for block: B:27:0x024c A[SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:34:0x0246 */ /* JADX WARN: Removed duplicated region for block: B:36:0x024c A[SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:44:0x0219 */ /* JADX WARN: Removed duplicated region for block: B:46:0x024c A[SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:47:0x01ff A[EXC_TOP_SPLITTER, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:55:0x0255 */ /* JADX WARN: Removed duplicated region for block: B:57:0x025a */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public final java.util.List zzi(int r23) { /* Method dump skipped, instructions count: 623 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.measurement.internal.zzem.zzi(int):java.util.List"); } public final void zzj() { int delete; zzg(); try { SQLiteDatabase zzh = zzh(); if (zzh == null || (delete = zzh.delete("messages", null, null)) <= 0) { return; } this.zzt.zzaA().zzj().zzb("Reset local analytics data. records", Integer.valueOf(delete)); } catch (SQLiteException e10) { this.zzt.zzaA().zzd().zzb("Error resetting local analytics data. error", e10); } } public final boolean zzk() { return zzq(3, new byte[0]); } final boolean zzl() { Context zzaw = this.zzt.zzaw(); this.zzt.zzf(); return zzaw.getDatabasePath("google_app_measurement_local.db").exists(); } public final boolean zzm() { int i10; zzg(); if (!this.zzb && zzl()) { int i11 = 5; while (i10 < 5) { SQLiteDatabase sQLiteDatabase = null; try { SQLiteDatabase zzh = zzh(); if (zzh == null) { this.zzb = true; return false; } zzh.beginTransaction(); zzh.delete("messages", "type == ?", new String[]{Integer.toString(3)}); zzh.setTransactionSuccessful(); zzh.endTransaction(); zzh.close(); return true; } catch (SQLiteDatabaseLockedException unused) { SystemClock.sleep(i11); i11 += 20; i10 = 0 == 0 ? i10 + 1 : 0; sQLiteDatabase.close(); } catch (SQLiteFullException e10) { this.zzt.zzaA().zzd().zzb("Error deleting app launch break from local database", e10); this.zzb = true; if (0 == 0) { } sQLiteDatabase.close(); } catch (SQLiteException e11) { if (0 != 0) { try { if (sQLiteDatabase.inTransaction()) { sQLiteDatabase.endTransaction(); } } catch (Throwable th) { if (0 != 0) { sQLiteDatabase.close(); } throw th; } } this.zzt.zzaA().zzd().zzb("Error deleting app launch break from local database", e11); this.zzb = true; if (0 != 0) { sQLiteDatabase.close(); } } } this.zzt.zzaA().zzk().zza("Error deleting app launch break from local database in reasonable time"); } return false; } public final boolean zzn(zzac zzacVar) { byte[] zzap = this.zzt.zzv().zzap(zzacVar); if (zzap.length <= 131072) { return zzq(2, zzap); } this.zzt.zzaA().zzh().zza("Conditional user property too long for local database. Sending directly to service"); return false; } public final boolean zzo(zzau zzauVar) { Parcel obtain = Parcel.obtain(); zzav.zza(zzauVar, obtain, 0); byte[] marshall = obtain.marshall(); obtain.recycle(); if (marshall.length <= 131072) { return zzq(0, marshall); } this.zzt.zzaA().zzh().zza("Event is too long for local database. Sending event directly to service"); return false; } public final boolean zzp(zzlk zzlkVar) { Parcel obtain = Parcel.obtain(); zzll.zza(zzlkVar, obtain, 0); byte[] marshall = obtain.marshall(); obtain.recycle(); if (marshall.length <= 131072) { return zzq(1, marshall); } this.zzt.zzaA().zzh().zza("User property too long for local database. Sending directly to service"); return false; } }