package com.google.android.gms.measurement.internal;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Pair;
import androidx.collection.a;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.stats.ConnectionTracker;
import com.google.android.gms.common.util.Clock;
import com.google.android.gms.common.util.CollectionUtils;
import com.google.android.gms.common.wrappers.Wrappers;
import com.google.android.gms.internal.measurement.zzfr;
import com.google.android.gms.internal.measurement.zzfy;
import com.google.android.gms.internal.measurement.zzjt;
import com.google.android.gms.internal.measurement.zzov;
import com.google.android.gms.internal.measurement.zzow;
import com.google.android.gms.internal.measurement.zzpb;
import com.google.android.gms.internal.measurement.zzpn;
import com.google.android.gms.internal.measurement.zzpo;
import com.google.android.gms.internal.measurement.zzpu;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.google.android.gms.measurement.internal.zzje;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.messaging.Constants;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.channels.OverlappingFileLockException;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/* loaded from: classes3.dex */
public class zznv implements zzjc {
    private static volatile zznv zza;
    private List<Long> zzaa;
    private long zzab;
    private final Map<String, zzje> zzac;
    private final Map<String, zzax> zzad;
    private final Map<String, zzb> zzae;
    private zzlk zzaf;
    private String zzag;
    private final zzor zzah;
    private zzhl zzb;
    private zzgr zzc;
    private zzal zzd;
    private zzgy zze;
    private zznq zzf;
    private zzt zzg;
    private final zzoo zzh;
    private zzli zzi;
    private zzmw zzj;
    private final zznu zzk;
    private zzhf zzl;
    private final zzhy zzm;
    private boolean zzn;
    private boolean zzo;
    private long zzp;
    private List<Runnable> zzq;
    private final Set<String> zzr;
    private int zzs;
    private int zzt;
    private boolean zzu;
    private boolean zzv;
    private boolean zzw;
    private FileLock zzx;
    private FileChannel zzy;
    private List<Long> zzz;

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes3.dex */
    public class zza implements zzas {
        zzfy.zzk zza;
        List<Long> zzb;
        List<zzfy.zzf> zzc;
        private long zzd;

        private static long zza(zzfy.zzf zzfVar) {
            return ((zzfVar.zzd() / 1000) / 60) / 60;
        }

        private zza() {
        }

        @Override // com.google.android.gms.measurement.internal.zzas
        public final void zza(zzfy.zzk zzkVar) {
            Preconditions.checkNotNull(zzkVar);
            this.zza = zzkVar;
        }

        @Override // com.google.android.gms.measurement.internal.zzas
        public final boolean zza(long j10, zzfy.zzf zzfVar) {
            Preconditions.checkNotNull(zzfVar);
            if (this.zzc == null) {
                this.zzc = new ArrayList();
            }
            if (this.zzb == null) {
                this.zzb = new ArrayList();
            }
            if (!this.zzc.isEmpty() && zza(this.zzc.get(0)) != zza(zzfVar)) {
                return false;
            }
            long zzcb = this.zzd + zzfVar.zzcb();
            zznv.this.zze();
            if (zzcb >= Math.max(0, zzbh.zzi.zza(null).intValue())) {
                return false;
            }
            this.zzd = zzcb;
            this.zzc.add(zzfVar);
            this.zzb.add(Long.valueOf(j10));
            int size = this.zzc.size();
            zznv.this.zze();
            return size < Math.max(1, zzbh.zzj.zza(null).intValue());
        }
    }

    private zznv(zzok zzokVar) {
        this(zzokVar, null);
    }

    private final void zzaa() {
        zzl().zzt();
        if (this.zzu || this.zzv || this.zzw) {
            zzj().zzp().zza("Not stopping services. fetch, network, upload", Boolean.valueOf(this.zzu), Boolean.valueOf(this.zzv), Boolean.valueOf(this.zzw));
            return;
        }
        zzj().zzp().zza("Stopping uploading service(s)");
        List<Runnable> list = this.zzq;
        if (list == null) {
            return;
        }
        Iterator<Runnable> it = list.iterator();
        while (it.hasNext()) {
            it.next().run();
        }
        ((List) Preconditions.checkNotNull(this.zzq)).clear();
    }

    private final void zzab() {
        zzl().zzt();
        for (String str : this.zzr) {
            if (zzpn.zza() && zze().zze(str, zzbh.zzch)) {
                zzj().zzc().zza("Notifying app that trigger URIs are available. App ID", str);
                Intent intent = new Intent();
                intent.setAction("com.google.android.gms.measurement.TRIGGERS_AVAILABLE");
                intent.setPackage(str);
                this.zzm.zza().sendBroadcast(intent);
            }
        }
        this.zzr.clear();
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x0191  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x01ad  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final void zzac() {
        long max;
        long j10;
        zzl().zzt();
        zzs();
        if (this.zzp > 0) {
            long abs = 3600000 - Math.abs(zzb().elapsedRealtime() - this.zzp);
            if (abs > 0) {
                zzj().zzp().zza("Upload has been suspended. Will update scheduling later in approximately ms", Long.valueOf(abs));
                zzy().zzb();
                zzz().zzu();
                return;
            }
            this.zzp = 0L;
        }
        if (!this.zzm.zzaf() || !zzad()) {
            zzj().zzp().zza("Nothing to upload or uploading impossible");
            zzy().zzb();
            zzz().zzu();
            return;
        }
        long currentTimeMillis = zzb().currentTimeMillis();
        zze();
        long max2 = Math.max(0L, zzbh.zzab.zza(null).longValue());
        boolean z10 = zzf().zzz() || zzf().zzy();
        if (z10) {
            String zzo = zze().zzo();
            if (TextUtils.isEmpty(zzo) || ".none.".equals(zzo)) {
                zze();
                max = Math.max(0L, zzbh.zzv.zza(null).longValue());
            } else {
                zze();
                max = Math.max(0L, zzbh.zzw.zza(null).longValue());
            }
        } else {
            zze();
            max = Math.max(0L, zzbh.zzu.zza(null).longValue());
        }
        long zza2 = this.zzj.zzd.zza();
        long zza3 = this.zzj.zze.zza();
        long j11 = max;
        long max3 = Math.max(zzf().c_(), zzf().d_());
        if (max3 != 0) {
            long abs2 = currentTimeMillis - Math.abs(max3 - currentTimeMillis);
            long abs3 = currentTimeMillis - Math.abs(zza2 - currentTimeMillis);
            long abs4 = currentTimeMillis - Math.abs(zza3 - currentTimeMillis);
            long max4 = Math.max(abs3, abs4);
            j10 = abs2 + max2;
            if (z10 && max4 > 0) {
                j10 = Math.min(abs2, max4) + j11;
            }
            if (!zzp().zza(max4, j11)) {
                j10 = max4 + j11;
            }
            if (abs4 != 0 && abs4 >= abs2) {
                int i10 = 0;
                while (true) {
                    zze();
                    if (i10 >= Math.min(20, Math.max(0, zzbh.zzad.zza(null).intValue()))) {
                        break;
                    }
                    zze();
                    j10 += Math.max(0L, zzbh.zzac.zza(null).longValue()) * (1 << i10);
                    if (j10 > abs4) {
                        break;
                    } else {
                        i10++;
                    }
                }
            }
            if (j10 != 0) {
                zzj().zzp().zza("Next upload time is 0");
                zzy().zzb();
                zzz().zzu();
                return;
            }
            if (!zzh().zzu()) {
                zzj().zzp().zza("No network");
                zzy().zza();
                zzz().zzu();
                return;
            }
            long zza4 = this.zzj.zzc.zza();
            zze();
            long max5 = Math.max(0L, zzbh.zzs.zza(null).longValue());
            if (!zzp().zza(zza4, max5)) {
                j10 = Math.max(j10, zza4 + max5);
            }
            zzy().zzb();
            long currentTimeMillis2 = j10 - zzb().currentTimeMillis();
            if (currentTimeMillis2 <= 0) {
                zze();
                currentTimeMillis2 = Math.max(0L, zzbh.zzx.zza(null).longValue());
                this.zzj.zzd.zza(zzb().currentTimeMillis());
            }
            zzj().zzp().zza("Upload scheduled in approximately ms", Long.valueOf(currentTimeMillis2));
            zzz().zza(currentTimeMillis2);
            return;
        }
        j10 = 0;
        if (j10 != 0) {
        }
    }

    private final boolean zzad() {
        zzl().zzt();
        zzs();
        return zzf().zzx() || !TextUtils.isEmpty(zzf().f_());
    }

    private final boolean zzae() {
        zzl().zzt();
        FileLock fileLock = this.zzx;
        if (fileLock != null && fileLock.isValid()) {
            zzj().zzp().zza("Storage concurrent access okay");
            return true;
        }
        try {
            FileChannel channel = new RandomAccessFile(new File(com.google.android.gms.internal.measurement.zzcf.zza().zza(this.zzm.zza().getFilesDir(), "google_app_measurement.db")), "rw").getChannel();
            this.zzy = channel;
            FileLock tryLock = channel.tryLock();
            this.zzx = tryLock;
            if (tryLock != null) {
                zzj().zzp().zza("Storage concurrent access okay");
                return true;
            }
            zzj().zzg().zza("Storage concurrent data access panic");
            return false;
        } catch (FileNotFoundException e10) {
            zzj().zzg().zza("Failed to acquire storage lock", e10);
            return false;
        } catch (IOException e11) {
            zzj().zzg().zza("Failed to access storage lock file", e11);
            return false;
        } catch (OverlappingFileLockException e12) {
            zzj().zzu().zza("Storage lock already acquired", e12);
            return false;
        }
    }

    private final zzo zzc(String str) {
        zzg zze = zzf().zze(str);
        if (zze != null && !TextUtils.isEmpty(zze.zzaf())) {
            Boolean zza2 = zza(zze);
            if (zza2 != null && !zza2.booleanValue()) {
                zzj().zzg().zza("App version does not match; dropping. appId", zzgo.zza(str));
                return null;
            }
            return new zzo(str, zze.zzah(), zze.zzaf(), zze.zze(), zze.zzae(), zze.zzq(), zze.zzn(), (String) null, zze.zzar(), false, zze.zzag(), zze.zzd(), 0L, 0, zze.zzaq(), false, zze.zzaa(), zze.zzx(), zze.zzo(), zze.zzan(), (String) null, zzb(str).zzf(), "", (String) null, zze.zzat(), zze.zzw(), zzb(str).zza(), zzd(str).zzf(), zze.zza(), zze.zzf(), zze.zzam(), zze.zzak());
        }
        zzj().zzc().zza("No app data available; dropping", str);
        return null;
    }

    private final long zzx() {
        long currentTimeMillis = zzb().currentTimeMillis();
        zzmw zzmwVar = this.zzj;
        zzmwVar.zzal();
        zzmwVar.zzt();
        long zza2 = zzmwVar.zzf.zza();
        if (zza2 == 0) {
            zza2 = zzmwVar.zzq().zzv().nextInt(86400000) + 1;
            zzmwVar.zzf.zza(zza2);
        }
        return ((((currentTimeMillis + zza2) / 1000) / 60) / 60) / 24;
    }

    private final zzgy zzy() {
        zzgy zzgyVar = this.zze;
        if (zzgyVar != null) {
            return zzgyVar;
        }
        throw new IllegalStateException("Network broadcast receiver not created");
    }

    private final zznq zzz() {
        return (zznq) zza(this.zzf);
    }

    @Override // com.google.android.gms.measurement.internal.zzjc
    public final Clock zzb() {
        return ((zzhy) Preconditions.checkNotNull(this.zzm)).zzb();
    }

    @Override // com.google.android.gms.measurement.internal.zzjc
    public final zzab zzd() {
        return this.zzm.zzd();
    }

    public final zzag zze() {
        return ((zzhy) Preconditions.checkNotNull(this.zzm)).zzf();
    }

    public final zzal zzf() {
        return (zzal) zza(this.zzd);
    }

    public final zzgh zzg() {
        return this.zzm.zzk();
    }

    public final zzgr zzh() {
        return (zzgr) zza(this.zzc);
    }

    public final zzhl zzi() {
        return (zzhl) zza(this.zzb);
    }

    @Override // com.google.android.gms.measurement.internal.zzjc
    public final zzgo zzj() {
        return ((zzhy) Preconditions.checkNotNull(this.zzm)).zzj();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final zzhy zzk() {
        return this.zzm;
    }

    @Override // com.google.android.gms.measurement.internal.zzjc
    public final zzhv zzl() {
        return ((zzhy) Preconditions.checkNotNull(this.zzm)).zzl();
    }

    public final zzli zzm() {
        return (zzli) zza(this.zzi);
    }

    public final zzmw zzn() {
        return this.zzj;
    }

    public final zznu zzo() {
        return this.zzk;
    }

    public final zzoo zzp() {
        return (zzoo) zza(this.zzh);
    }

    public final zzos zzq() {
        return ((zzhy) Preconditions.checkNotNull(this.zzm)).zzt();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzr() {
        zzl().zzt();
        zzs();
        if (this.zzo) {
            return;
        }
        this.zzo = true;
        if (zzae()) {
            int zza2 = zza(this.zzy);
            int zzab = this.zzm.zzh().zzab();
            zzl().zzt();
            if (zza2 > zzab) {
                zzj().zzg().zza("Panic: can't downgrade version. Previous, current version", Integer.valueOf(zza2), Integer.valueOf(zzab));
            } else if (zza2 < zzab) {
                if (zza(zzab, this.zzy)) {
                    zzj().zzp().zza("Storage version upgraded. Previous, current version", Integer.valueOf(zza2), Integer.valueOf(zzab));
                } else {
                    zzj().zzg().zza("Storage version upgrade failed. Previous, current version", Integer.valueOf(zza2), Integer.valueOf(zzab));
                }
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzs() {
        if (!this.zzn) {
            throw new IllegalStateException("UploadController is not initialized");
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzt() {
        this.zzt++;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzu() {
        this.zzs++;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public final void zzv() {
        int delete;
        zzl().zzt();
        zzf().zzv();
        zzal zzf = zzf();
        zzf.zzt();
        zzf.zzal();
        if (zzf.zzaa()) {
            zzfz<Long> zzfzVar = zzbh.zzbh;
            if (zzfzVar.zza(null).longValue() != 0 && (delete = zzf.e_().delete("trigger_uris", "abs(timestamp_millis - ?) > cast(? as integer)", new String[]{String.valueOf(zzf.zzb().currentTimeMillis()), String.valueOf(zzfzVar.zza(null))})) > 0) {
                zzf.zzj().zzp().zza("Deleted stale trigger uris. rowsDeleted", Integer.valueOf(delete));
            }
        }
        if (this.zzj.zzd.zza() == 0) {
            this.zzj.zzd.zza(zzb().currentTimeMillis());
        }
        zzac();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Can't wrap try/catch for region: R(15:164|165|(3:(2:167|(21:171|(2:172|(2:174|(2:176|177)(1:249))(2:250|251))|(1:179)(1:248)|180|(1:182)|183|(1:185)|186|(2:189|187)|190|191|(3:193|(1:195)(1:246)|196)(1:247)|197|(1:245)(6:201|(2:204|202)|205|206|(1:208)(1:244)|209)|210|211|(1:213)(1:243)|214|215|216|(7:226|227|(3:229|230|231)|232|233|234|235)(3:220|(3:222|223|224)|225)))|234|235)|252|211|(0)(0)|214|215|216|(1:218)|226|227|(0)|232|233) */
    /* JADX WARN: Code restructure failed: missing block: B:240:0x05f5, code lost:
    
        r1 = r15;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:117:0x0318 A[Catch: all -> 0x0638, TryCatch #4 {all -> 0x0638, blocks: (B:90:0x01ff, B:95:0x0220, B:97:0x0225, B:99:0x022d, B:100:0x0230, B:102:0x0235, B:103:0x0238, B:105:0x023e, B:108:0x024c, B:109:0x024f, B:111:0x0259, B:115:0x0312, B:117:0x0318, B:119:0x0324, B:120:0x033b, B:122:0x033e, B:124:0x026e, B:125:0x0285, B:127:0x028b, B:145:0x02a5, B:130:0x02b3, B:132:0x02bf, B:134:0x02cb, B:136:0x02d6, B:137:0x02de, B:139:0x02e9, B:150:0x0302, B:152:0x030a, B:159:0x0354, B:161:0x035c, B:165:0x0378, B:167:0x0391, B:169:0x039a, B:171:0x03a2, B:172:0x03b2, B:174:0x03b8, B:179:0x03c9, B:180:0x03d3, B:182:0x03ef, B:183:0x03f2, B:185:0x0400, B:186:0x0403, B:187:0x0410, B:189:0x0416, B:191:0x042f, B:193:0x0441, B:196:0x0458, B:197:0x0469, B:199:0x0477, B:201:0x0481, B:202:0x04af, B:204:0x04b5, B:206:0x04d3, B:208:0x04eb, B:209:0x0538, B:211:0x0544, B:213:0x054f, B:214:0x0559, B:218:0x056a, B:220:0x0576, B:224:0x0587, B:225:0x058b, B:227:0x05ac, B:231:0x05bd, B:232:0x05c5, B:235:0x05f1, B:238:0x05f6, B:244:0x0528, B:246:0x0454, B:247:0x045c, B:257:0x060c, B:259:0x0624, B:261:0x062e), top: B:44:0x00fe }] */
    /* JADX WARN: Removed duplicated region for block: B:123:0x033e A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:213:0x054f A[Catch: all -> 0x0638, TryCatch #4 {all -> 0x0638, blocks: (B:90:0x01ff, B:95:0x0220, B:97:0x0225, B:99:0x022d, B:100:0x0230, B:102:0x0235, B:103:0x0238, B:105:0x023e, B:108:0x024c, B:109:0x024f, B:111:0x0259, B:115:0x0312, B:117:0x0318, B:119:0x0324, B:120:0x033b, B:122:0x033e, B:124:0x026e, B:125:0x0285, B:127:0x028b, B:145:0x02a5, B:130:0x02b3, B:132:0x02bf, B:134:0x02cb, B:136:0x02d6, B:137:0x02de, B:139:0x02e9, B:150:0x0302, B:152:0x030a, B:159:0x0354, B:161:0x035c, B:165:0x0378, B:167:0x0391, B:169:0x039a, B:171:0x03a2, B:172:0x03b2, B:174:0x03b8, B:179:0x03c9, B:180:0x03d3, B:182:0x03ef, B:183:0x03f2, B:185:0x0400, B:186:0x0403, B:187:0x0410, B:189:0x0416, B:191:0x042f, B:193:0x0441, B:196:0x0458, B:197:0x0469, B:199:0x0477, B:201:0x0481, B:202:0x04af, B:204:0x04b5, B:206:0x04d3, B:208:0x04eb, B:209:0x0538, B:211:0x0544, B:213:0x054f, B:214:0x0559, B:218:0x056a, B:220:0x0576, B:224:0x0587, B:225:0x058b, B:227:0x05ac, B:231:0x05bd, B:232:0x05c5, B:235:0x05f1, B:238:0x05f6, B:244:0x0528, B:246:0x0454, B:247:0x045c, B:257:0x060c, B:259:0x0624, B:261:0x062e), top: B:44:0x00fe }] */
    /* JADX WARN: Removed duplicated region for block: B:229:0x05b8  */
    /* JADX WARN: Removed duplicated region for block: B:243:0x0558  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void zzw() {
        boolean z10;
        zzg zze;
        Object obj;
        Object zza2;
        byte[] zzca;
        zznw zznwVar;
        boolean z11;
        zznw zznwVar2;
        List<Pair<zzfy.zzk, Long>> list;
        boolean z12;
        boolean z13;
        boolean z14;
        boolean z15;
        String str;
        zzl().zzt();
        zzs();
        this.zzw = true;
        try {
            Boolean zzab = this.zzm.zzr().zzab();
            if (zzab == null) {
                zzj().zzu().zza("Upload data called on the client side before use of service was decided");
                this.zzw = false;
                zzaa();
                return;
            }
            if (zzab.booleanValue()) {
                zzj().zzg().zza("Upload called in the client side when service should be used");
                this.zzw = false;
                zzaa();
                return;
            }
            if (this.zzp > 0) {
                zzac();
                this.zzw = false;
                zzaa();
                return;
            }
            zzl().zzt();
            if (this.zzz != null) {
                zzj().zzp().zza("Uploading requested multiple times");
                this.zzw = false;
                zzaa();
                return;
            }
            if (!zzh().zzu()) {
                zzj().zzp().zza("Network not connected, ignoring upload request");
                zzac();
                this.zzw = false;
                zzaa();
                return;
            }
            long currentTimeMillis = zzb().currentTimeMillis();
            int zzb2 = zze().zzb((String) null, zzbh.zzau);
            zze();
            long zzg = currentTimeMillis - zzag.zzg();
            for (int i10 = 0; i10 < zzb2 && zza((String) null, zzg); i10++) {
            }
            if (zzpn.zza()) {
                zzab();
            }
            long zza3 = this.zzj.zzd.zza();
            if (zza3 != 0) {
                zzj().zzc().zza("Uploading events. Elapsed time since last upload attempt (ms)", Long.valueOf(Math.abs(currentTimeMillis - zza3)));
            }
            String f_ = zzf().f_();
            try {
                if (TextUtils.isEmpty(f_)) {
                    this.zzab = -1L;
                    zzal zzf = zzf();
                    zze();
                    String zza4 = zzf.zza(currentTimeMillis - zzag.zzg());
                    if (!TextUtils.isEmpty(zza4) && (zze = zzf().zze(zza4)) != null) {
                        zzb(zze);
                    }
                } else {
                    if (this.zzab == -1) {
                        this.zzab = zzf().b_();
                    }
                    List<Pair<zzfy.zzk, Long>> zza5 = zzf().zza(f_, zze().zzb(f_, zzbh.zzg), Math.max(0, zze().zzb(f_, zzbh.zzh)));
                    if (!zza5.isEmpty()) {
                        if (zzb(f_).zzg()) {
                            Iterator<Pair<zzfy.zzk, Long>> it = zza5.iterator();
                            while (true) {
                                if (!it.hasNext()) {
                                    str = null;
                                    break;
                                }
                                zzfy.zzk zzkVar = (zzfy.zzk) it.next().first;
                                if (!zzkVar.zzan().isEmpty()) {
                                    str = zzkVar.zzan();
                                    break;
                                }
                            }
                            if (str != null) {
                                int i11 = 0;
                                while (true) {
                                    if (i11 >= zza5.size()) {
                                        break;
                                    }
                                    zzfy.zzk zzkVar2 = (zzfy.zzk) zza5.get(i11).first;
                                    if (!zzkVar2.zzan().isEmpty() && !zzkVar2.zzan().equals(str)) {
                                        zza5 = zza5.subList(0, i11);
                                        break;
                                    }
                                    i11++;
                                }
                            }
                        }
                        zzfy.zzj.zza zzb3 = zzfy.zzj.zzb();
                        int size = zza5.size();
                        List<Long> arrayList = new ArrayList<>(zza5.size());
                        boolean z16 = zze().zzj(f_) && zzb(f_).zzg();
                        boolean zzg2 = zzb(f_).zzg();
                        boolean zzh = zzb(f_).zzh();
                        boolean z17 = zzpo.zza() && zze().zze(f_, zzbh.zzbw);
                        zznw zza6 = this.zzk.zza(f_);
                        int i12 = 0;
                        while (i12 < size) {
                            zzfy.zzk.zza zzcd = ((zzfy.zzk) zza5.get(i12).first).zzcd();
                            arrayList.add((Long) zza5.get(i12).second);
                            zze();
                            List<Long> list2 = arrayList;
                            try {
                                zzcd.zzl(106000L).zzk(currentTimeMillis).zzd(false);
                                if (!z16) {
                                    zzcd.zzk();
                                }
                                if (!zzg2) {
                                    zzcd.zzq();
                                    zzcd.zzn();
                                }
                                if (!zzh) {
                                    zzcd.zzh();
                                }
                                zza(f_, zzcd);
                                if (!z17) {
                                    zzcd.zzr();
                                }
                                if (com.google.android.gms.internal.measurement.zznm.zza() && zze().zza(zzbh.zzcz) && !zzh) {
                                    zzcd.zzi();
                                }
                                String zzz = zzcd.zzz();
                                if (!TextUtils.isEmpty(zzz) && !zzz.equals("00000000-0000-0000-0000-000000000000")) {
                                    list = zza5;
                                    z12 = z16;
                                    z13 = zzg2;
                                    z14 = zzh;
                                    z15 = z17;
                                    if (zzcd.zzc() != 0) {
                                        if (zze().zze(f_, zzbh.zzbm)) {
                                            zzcd.zza(zzp().zza(((zzfy.zzk) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai())).zzca()));
                                        }
                                        zzb3.zza(zzcd);
                                    }
                                    i12++;
                                    arrayList = list2;
                                    zza5 = list;
                                    z16 = z12;
                                    zzh = z14;
                                    zzg2 = z13;
                                    z17 = z15;
                                }
                                ArrayList arrayList2 = new ArrayList(zzcd.zzaa());
                                Iterator it2 = arrayList2.iterator();
                                list = zza5;
                                z12 = z16;
                                Long l10 = null;
                                Long l11 = null;
                                boolean z18 = false;
                                boolean z19 = false;
                                while (it2.hasNext()) {
                                    boolean z20 = zzg2;
                                    zzfy.zzf zzfVar = (zzfy.zzf) it2.next();
                                    boolean z21 = zzh;
                                    boolean z22 = z17;
                                    if ("_fx".equals(zzfVar.zzg())) {
                                        it2.remove();
                                        zzh = z21;
                                        zzg2 = z20;
                                        z17 = z22;
                                        z18 = true;
                                        z19 = true;
                                    } else {
                                        if ("_f".equals(zzfVar.zzg())) {
                                            if (zze().zza(zzbh.zzcw)) {
                                                zzp();
                                                zzfy.zzh zza7 = zzoo.zza(zzfVar, "_pfo");
                                                if (zza7 != null) {
                                                    l10 = Long.valueOf(zza7.zzd());
                                                }
                                                zzp();
                                                zzfy.zzh zza8 = zzoo.zza(zzfVar, "_uwa");
                                                if (zza8 != null) {
                                                    l11 = Long.valueOf(zza8.zzd());
                                                }
                                            }
                                            z19 = true;
                                        }
                                        zzh = z21;
                                        zzg2 = z20;
                                        z17 = z22;
                                    }
                                }
                                z13 = zzg2;
                                z14 = zzh;
                                z15 = z17;
                                if (z18) {
                                    zzcd.zzl();
                                    zzcd.zzb(arrayList2);
                                }
                                if (z19) {
                                    zza(zzcd.zzt(), true, l10, l11);
                                }
                                if (zzcd.zzc() != 0) {
                                }
                                i12++;
                                arrayList = list2;
                                zza5 = list;
                                z16 = z12;
                                zzh = z14;
                                zzg2 = z13;
                                z17 = z15;
                            } catch (Throwable th2) {
                                th = th2;
                                z10 = false;
                                this.zzw = z10;
                                zzaa();
                                throw th;
                            }
                        }
                        List<Long> list3 = arrayList;
                        if (zzb3.zza() == 0) {
                            zza(list3);
                            zza(false, 204, null, null, f_, Collections.emptyList());
                            this.zzw = false;
                            zzaa();
                            return;
                        }
                        zzfy.zzj zzjVar = (zzfy.zzj) ((com.google.android.gms.internal.measurement.zzjt) zzb3.zzai());
                        ArrayList arrayList3 = new ArrayList();
                        try {
                            try {
                                if (zze().zza(zzbh.zzbx)) {
                                    zzq();
                                    if (zzos.zzf(f_) && zza6.zza() == zznt.SGTM) {
                                        Iterator<zzfy.zzk> it3 = ((zzfy.zzj) ((com.google.android.gms.internal.measurement.zzjt) zzb3.zzai())).zzf().iterator();
                                        while (true) {
                                            if (it3.hasNext()) {
                                                if (it3.next().zzbh()) {
                                                    z11 = true;
                                                    break;
                                                }
                                            } else {
                                                z11 = false;
                                                break;
                                            }
                                        }
                                        String uuid = z11 ? UUID.randomUUID().toString() : null;
                                        zzfy.zzj zzjVar2 = (zzfy.zzj) ((com.google.android.gms.internal.measurement.zzjt) zzb3.zzai());
                                        zzl().zzt();
                                        zzs();
                                        zzfy.zzj.zza zza9 = zzfy.zzj.zza(zzjVar2);
                                        if (!TextUtils.isEmpty(uuid)) {
                                            zza9.zza(uuid);
                                        }
                                        String zzf2 = zzi().zzf(f_);
                                        if (!TextUtils.isEmpty(zzf2)) {
                                            zza9.zzb(zzf2);
                                        }
                                        ArrayList arrayList4 = new ArrayList();
                                        Iterator<zzfy.zzk> it4 = zzjVar2.zzf().iterator();
                                        while (it4.hasNext()) {
                                            zzfy.zzk.zza zza10 = zzfy.zzk.zza(it4.next());
                                            zza10.zzk();
                                            arrayList4.add((zzfy.zzk) ((com.google.android.gms.internal.measurement.zzjt) zza10.zzai()));
                                        }
                                        zza9.zzb();
                                        zza9.zza(arrayList4);
                                        zzag zze2 = zze();
                                        zzfz<Boolean> zzfzVar = zzbh.zzcc;
                                        if (zze2.zza(zzfzVar)) {
                                            zzj().zzp().zza("Processed MeasurementBatch for sGTM with sgtmJoinId: ", TextUtils.isEmpty(uuid) ? "null" : zza9.zzc());
                                        } else {
                                            zzj().zzp().zza("Processed MeasurementBatch for sGTM.");
                                        }
                                        zzfy.zzj zzjVar3 = (zzfy.zzj) ((com.google.android.gms.internal.measurement.zzjt) zza9.zzai());
                                        if (TextUtils.isEmpty(uuid) || !zze().zza(zzfzVar)) {
                                            obj = null;
                                        } else {
                                            zzfy.zzj zzjVar4 = (zzfy.zzj) ((com.google.android.gms.internal.measurement.zzjt) zzb3.zzai());
                                            zzl().zzt();
                                            zzs();
                                            zzfy.zzj.zza zzb4 = zzfy.zzj.zzb();
                                            zzj().zzp().zza("Processing Google Signal, sgtmJoinId:", uuid);
                                            zzb4.zza(uuid);
                                            for (zzfy.zzk zzkVar3 : zzjVar4.zzf()) {
                                                zzb4.zza(zzfy.zzk.zzw().zzj(zzkVar3.zzah()).zzg(zzkVar3.zzd()));
                                            }
                                            zzfy.zzj zzjVar5 = (zzfy.zzj) ((com.google.android.gms.internal.measurement.zzjt) zzb4.zzai());
                                            String zzf3 = this.zzk.zzm().zzf(f_);
                                            if (TextUtils.isEmpty(zzf3)) {
                                                obj = null;
                                                zznwVar2 = new zznw(zzbh.zzr.zza(null), zznt.GOOGLE_SIGNAL);
                                            } else {
                                                Uri parse = Uri.parse(zzbh.zzr.zza(null));
                                                Uri.Builder buildUpon = parse.buildUpon();
                                                buildUpon.authority(zzf3 + "." + parse.getAuthority());
                                                zznwVar2 = new zznw(buildUpon.build().toString(), zznt.GOOGLE_SIGNAL);
                                                obj = null;
                                            }
                                            arrayList3.add(Pair.create(zzjVar5, zznwVar2));
                                        }
                                        zzjVar = zzjVar3;
                                        zza2 = !zzj().zza(2) ? zzp().zza(zzjVar) : obj;
                                        zzp();
                                        zzca = zzjVar.zzca();
                                        if (zzpb.zza() || !zze().zza(zzbh.zzcf)) {
                                            zza(list3);
                                            this.zzj.zze.zza(currentTimeMillis);
                                            zzj().zzp().zza("Uploading data. app, uncompressed size, data", size > 0 ? zzb3.zza(0).zzz() : "?", Integer.valueOf(zzca.length), zza2);
                                            this.zzv = true;
                                            zznwVar = zza6;
                                            zzh().zza(f_, new URL(zza6.zzb()), zzca, zza6.zzc(), new zzoc(this, f_, arrayList3));
                                        } else {
                                            zza(list3);
                                            this.zzj.zze.zza(currentTimeMillis);
                                            zzj().zzp().zza("Uploading data. app, uncompressed size, data", size > 0 ? zzb3.zza(0).zzz() : "?", Integer.valueOf(zzca.length), zza2);
                                            this.zzv = true;
                                            zzh().zza(f_, zza6, zzjVar, new zznz(this, f_, arrayList3));
                                        }
                                    }
                                }
                                zzh().zza(f_, new URL(zza6.zzb()), zzca, zza6.zzc(), new zzoc(this, f_, arrayList3));
                            } catch (MalformedURLException unused) {
                                zzj().zzg().zza("Failed to parse upload URL. Not uploading. appId", zzgo.zza(f_), zznwVar.zzb());
                                this.zzw = false;
                                zzaa();
                            }
                            if (zzpb.zza()) {
                            }
                            zza(list3);
                            this.zzj.zze.zza(currentTimeMillis);
                            zzj().zzp().zza("Uploading data. app, uncompressed size, data", size > 0 ? zzb3.zza(0).zzz() : "?", Integer.valueOf(zzca.length), zza2);
                            this.zzv = true;
                            zznwVar = zza6;
                        } catch (Throwable th3) {
                            th = th3;
                            z10 = currentTimeMillis;
                            this.zzw = z10;
                            zzaa();
                            throw th;
                        }
                        obj = null;
                        if (!zzj().zza(2)) {
                        }
                        zzp();
                        zzca = zzjVar.zzca();
                    }
                }
                this.zzw = false;
                zzaa();
            } catch (Throwable th4) {
                th = th4;
                z10 = false;
            }
        } catch (Throwable th5) {
            th = th5;
            z10 = false;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes3.dex */
    public class zzb {
        final String zza;
        long zzb;

        private zzb(zznv zznvVar) {
            this(zznvVar, zznvVar.zzq().zzp());
        }

        private zzb(zznv zznvVar, String str) {
            this.zza = str;
            this.zzb = zznvVar.zzb().elapsedRealtime();
        }
    }

    private zznv(zzok zzokVar, zzhy zzhyVar) {
        this.zzn = false;
        this.zzr = new HashSet();
        this.zzah = new zzof(this);
        Preconditions.checkNotNull(zzokVar);
        this.zzm = zzhy.zza(zzokVar.zza, null, null);
        this.zzab = -1L;
        this.zzk = new zznu(this);
        zzoo zzooVar = new zzoo(this);
        zzooVar.zzam();
        this.zzh = zzooVar;
        zzgr zzgrVar = new zzgr(this);
        zzgrVar.zzam();
        this.zzc = zzgrVar;
        zzhl zzhlVar = new zzhl(this);
        zzhlVar.zzam();
        this.zzb = zzhlVar;
        this.zzac = new HashMap();
        this.zzad = new HashMap();
        this.zzae = new HashMap();
        zzl().zzb(new zznx(this, zzokVar));
    }

    private final int zza(String str, zzah zzahVar) {
        if (this.zzb.zzb(str) == null) {
            zzahVar.zza(zzje.zza.AD_PERSONALIZATION, zzak.FAILSAFE);
            return 1;
        }
        zzg zze = zzf().zze(str);
        if (zze != null && zzf.zza(zze.zzak()).zza() == zzjh.POLICY) {
            zzhl zzhlVar = this.zzb;
            zzje.zza zzaVar = zzje.zza.AD_PERSONALIZATION;
            zzjh zza2 = zzhlVar.zza(str, zzaVar);
            if (zza2 != zzjh.UNINITIALIZED) {
                zzahVar.zza(zzaVar, zzak.REMOTE_ENFORCED_DEFAULT);
                return zza2 == zzjh.GRANTED ? 0 : 1;
            }
        }
        zzje.zza zzaVar2 = zzje.zza.AD_PERSONALIZATION;
        zzahVar.zza(zzaVar2, zzak.REMOTE_DEFAULT);
        return this.zzb.zzc(str, zzaVar2) ? 0 : 1;
    }

    private final zzax zzd(String str) {
        zzl().zzt();
        zzs();
        zzax zzaxVar = this.zzad.get(str);
        if (zzaxVar != null) {
            return zzaxVar;
        }
        zzax zzg = zzf().zzg(str);
        this.zzad.put(str, zzg);
        return zzg;
    }

    private static Boolean zzh(zzo zzoVar) {
        Boolean bool = zzoVar.zzq;
        if (TextUtils.isEmpty(zzoVar.zzad)) {
            return bool;
        }
        int i10 = zzoa.zza[zzf.zza(zzoVar.zzad).zza().ordinal()];
        if (i10 != 1) {
            if (i10 == 2) {
                return Boolean.FALSE;
            }
            if (i10 == 3) {
                return Boolean.TRUE;
            }
            if (i10 != 4) {
                return bool;
            }
        }
        return null;
    }

    private static boolean zzi(zzo zzoVar) {
        return (TextUtils.isEmpty(zzoVar.zzb) && TextUtils.isEmpty(zzoVar.zzp)) ? false : true;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final zzje zzb(String str) {
        zzl().zzt();
        zzs();
        zzje zzjeVar = this.zzac.get(str);
        if (zzjeVar == null) {
            zzjeVar = zzf().zzi(str);
            if (zzjeVar == null) {
                zzjeVar = zzje.zza;
            }
            zza(str, zzjeVar);
        }
        return zzjeVar;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zze(zzo zzoVar) {
        if (this.zzz != null) {
            ArrayList arrayList = new ArrayList();
            this.zzaa = arrayList;
            arrayList.addAll(this.zzz);
        }
        zzal zzf = zzf();
        String str = (String) Preconditions.checkNotNull(zzoVar.zza);
        Preconditions.checkNotEmpty(str);
        zzf.zzt();
        zzf.zzal();
        try {
            SQLiteDatabase e_ = zzf.e_();
            String[] strArr = {str};
            int delete = e_.delete("apps", "app_id=?", strArr) + 0 + e_.delete("events", "app_id=?", strArr) + e_.delete("events_snapshot", "app_id=?", strArr) + e_.delete("user_attributes", "app_id=?", strArr) + e_.delete("conditional_properties", "app_id=?", strArr) + e_.delete("raw_events", "app_id=?", strArr) + e_.delete("raw_events_metadata", "app_id=?", strArr) + e_.delete("queue", "app_id=?", strArr) + e_.delete("audience_filter_values", "app_id=?", strArr) + e_.delete("main_event_params", "app_id=?", strArr) + e_.delete("default_event_params", "app_id=?", strArr) + e_.delete("trigger_uris", "app_id=?", strArr) + e_.delete("upload_queue", "app_id=?", strArr);
            if (delete > 0) {
                zzf.zzj().zzp().zza("Reset analytics data. app, records", str, Integer.valueOf(delete));
            }
        } catch (SQLiteException e10) {
            zzf.zzj().zzg().zza("Error resetting analytics data. appId, error", zzgo.zza(str), e10);
        }
        if (zzoVar.zzh) {
            zzd(zzoVar);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzf(zzo zzoVar) {
        zzl().zzt();
        zzs();
        Preconditions.checkNotEmpty(zzoVar.zza);
        zzax zza2 = zzax.zza(zzoVar.zzz);
        zzj().zzp().zza("Setting DMA consent for package", zzoVar.zza, zza2);
        String str = zzoVar.zza;
        zzl().zzt();
        zzs();
        zzjh zzc = zzax.zza(zza(str), 100).zzc();
        this.zzad.put(str, zza2);
        zzf().zza(str, zza2);
        zzjh zzc2 = zzax.zza(zza(str), 100).zzc();
        zzl().zzt();
        zzs();
        zzjh zzjhVar = zzjh.DENIED;
        boolean z10 = true;
        boolean z11 = zzc == zzjhVar && zzc2 == zzjh.GRANTED;
        boolean z12 = zzc == zzjh.GRANTED && zzc2 == zzjhVar;
        if (zze().zza(zzbh.zzcq)) {
            if (!z11 && !z12) {
                z10 = false;
            }
            z11 = z10;
        }
        if (z11) {
            zzj().zzp().zza("Generated _dcu event for", str);
            Bundle bundle = new Bundle();
            if (zzf().zza(zzx(), str, false, false, false, false, false, false, false).zzf < zze().zzb(str, zzbh.zzay)) {
                bundle.putLong("_r", 1L);
                zzj().zzp().zza("_dcu realtime event count", str, Long.valueOf(zzf().zza(zzx(), str, false, false, false, false, false, true, false).zzf));
            }
            this.zzah.zza(str, "_dcu", bundle);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzg(zzo zzoVar) {
        zzl().zzt();
        zzs();
        Preconditions.checkNotEmpty(zzoVar.zza);
        zzje zza2 = zzje.zza(zzoVar.zzt, zzoVar.zzy);
        zzje zzb2 = zzb(zzoVar.zza);
        zzj().zzp().zza("Setting storage consent for package", zzoVar.zza, zza2);
        zza(zzoVar.zza, zza2);
        if (!(com.google.android.gms.internal.measurement.zznm.zza() && zze().zza(zzbh.zzcy)) && zza2.zzc(zzb2)) {
            zze(zzoVar);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Code restructure failed: missing block: B:171:0x00cf, code lost:
    
        if (r12.booleanValue() == false) goto L34;
     */
    /* JADX WARN: Code restructure failed: missing block: B:172:0x00d1, code lost:
    
        r3 = 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:173:0x00d6, code lost:
    
        r0 = new com.google.android.gms.measurement.internal.zzon("_npa", r13, java.lang.Long.valueOf(r3), "auto");
     */
    /* JADX WARN: Code restructure failed: missing block: B:174:0x00e3, code lost:
    
        if (r11 == null) goto L39;
     */
    /* JADX WARN: Code restructure failed: missing block: B:176:0x00ed, code lost:
    
        if (r11.zze.equals(r0.zzc) != false) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:177:0x00ef, code lost:
    
        zza(r0, r25);
     */
    /* JADX WARN: Code restructure failed: missing block: B:178:0x00d4, code lost:
    
        r3 = 0;
     */
    /* JADX WARN: Removed duplicated region for block: B:162:0x0516 A[Catch: all -> 0x0544, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:165:0x0232  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x010b A[Catch: all -> 0x0544, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:45:0x01cb A[Catch: all -> 0x0544, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:63:0x0225 A[Catch: all -> 0x0544, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:65:0x0245 A[Catch: all -> 0x0544, TRY_LEAVE, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:78:0x03ae A[Catch: all -> 0x0544, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:81:0x03d9 A[Catch: all -> 0x0544, TRY_LEAVE, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:86:0x04ac A[Catch: all -> 0x0544, TryCatch #2 {all -> 0x0544, blocks: (B:25:0x00a4, B:27:0x00b8, B:31:0x00f9, B:33:0x010b, B:35:0x0120, B:37:0x0146, B:39:0x01a4, B:43:0x01b7, B:45:0x01cb, B:47:0x01d6, B:50:0x01e3, B:53:0x01f1, B:56:0x01fc, B:58:0x0200, B:61:0x0220, B:63:0x0225, B:65:0x0245, B:68:0x0258, B:70:0x0280, B:73:0x0288, B:75:0x0297, B:76:0x037c, B:78:0x03ae, B:79:0x03b1, B:81:0x03d9, B:86:0x04ac, B:87:0x04af, B:88:0x0535, B:93:0x03ef, B:95:0x0414, B:97:0x0421, B:99:0x0427, B:103:0x0439, B:105:0x0447, B:108:0x0452, B:110:0x043f, B:113:0x0467, B:123:0x0478, B:115:0x048c, B:117:0x0492, B:118:0x0499, B:120:0x049f, B:127:0x0400, B:128:0x02a8, B:130:0x02d3, B:131:0x02e4, B:133:0x02eb, B:135:0x02f1, B:137:0x02fb, B:139:0x0301, B:141:0x0307, B:143:0x030d, B:145:0x0312, B:148:0x0334, B:152:0x0339, B:153:0x034d, B:154:0x035d, B:155:0x036d, B:158:0x04cb, B:160:0x04fc, B:161:0x04ff, B:162:0x0516, B:164:0x051a, B:167:0x0235, B:170:0x00c7, B:173:0x00d6, B:175:0x00e5, B:177:0x00ef, B:181:0x00f6), top: B:24:0x00a4, inners: #0, #1, #3, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:92:0x03ef A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void zzd(zzo zzoVar) {
        zzg zze;
        zzbb zzd;
        long zzb2;
        PackageInfo packageInfo;
        String str;
        String str2;
        String str3;
        ApplicationInfo applicationInfo;
        boolean z10;
        zzl().zzt();
        zzs();
        Preconditions.checkNotNull(zzoVar);
        Preconditions.checkNotEmpty(zzoVar.zza);
        if (zzi(zzoVar)) {
            zzg zze2 = zzf().zze(zzoVar.zza);
            if (zze2 != null && TextUtils.isEmpty(zze2.zzah()) && !TextUtils.isEmpty(zzoVar.zzb)) {
                zze2.zzd(0L);
                zzf().zza(zze2, false, false);
                zzi().zzj(zzoVar.zza);
            }
            if (!zzoVar.zzh) {
                zza(zzoVar);
                return;
            }
            long j10 = zzoVar.zzl;
            if (j10 == 0) {
                j10 = zzb().currentTimeMillis();
            }
            this.zzm.zzg().zzt();
            int i10 = zzoVar.zzm;
            if (i10 != 0 && i10 != 1) {
                zzj().zzu().zza("Incorrect app type, assuming installed app. appId, appType", zzgo.zza(zzoVar.zza), Integer.valueOf(i10));
                i10 = 0;
            }
            zzf().zzp();
            try {
                zzop zze3 = zzf().zze(zzoVar.zza, "_npa");
                Boolean zzh = zzh(zzoVar);
                if (zze3 != null && !"auto".equals(zze3.zzb)) {
                    zze = zzf().zze((String) Preconditions.checkNotNull(zzoVar.zza));
                    if (zze != null) {
                        zzq();
                        if (zzos.zza(zzoVar.zzb, zze.zzah(), zzoVar.zzp, zze.zzaa())) {
                            zzj().zzu().zza("New GMP App Id passed in. Removing cached database data. appId", zzgo.zza(zze.zzac()));
                            zzal zzf = zzf();
                            String zzac = zze.zzac();
                            zzf.zzal();
                            zzf.zzt();
                            Preconditions.checkNotEmpty(zzac);
                            try {
                                SQLiteDatabase e_ = zzf.e_();
                                String[] strArr = {zzac};
                                int delete = e_.delete("events", "app_id=?", strArr) + 0 + e_.delete("user_attributes", "app_id=?", strArr) + e_.delete("conditional_properties", "app_id=?", strArr) + e_.delete("apps", "app_id=?", strArr) + e_.delete("raw_events", "app_id=?", strArr) + e_.delete("raw_events_metadata", "app_id=?", strArr) + e_.delete("event_filters", "app_id=?", strArr) + e_.delete("property_filters", "app_id=?", strArr) + e_.delete("audience_filter_values", "app_id=?", strArr) + e_.delete("consent_settings", "app_id=?", strArr) + e_.delete("default_event_params", "app_id=?", strArr) + e_.delete("trigger_uris", "app_id=?", strArr);
                                if (delete > 0) {
                                    zzf.zzj().zzp().zza("Deleted application data. app, records", zzac, Integer.valueOf(delete));
                                }
                            } catch (SQLiteException e10) {
                                zzf.zzj().zzg().zza("Error deleting application data. appId, error", zzgo.zza(zzac), e10);
                            }
                            zze = null;
                        }
                    }
                    if (zze != null) {
                        boolean z11 = (zze.zze() == -2147483648L || zze.zze() == zzoVar.zzj) ? false : true;
                        String zzaf = zze.zzaf();
                        if (z11 | ((zze.zze() != -2147483648L || zzaf == null || zzaf.equals(zzoVar.zzc)) ? false : true)) {
                            Bundle bundle = new Bundle();
                            bundle.putString("_pv", zzaf);
                            zza(new zzbf("_au", new zzbe(bundle), "auto", j10), zzoVar);
                        }
                    }
                    zza(zzoVar);
                    if (i10 != 0) {
                        zzd = zzf().zzd(zzoVar.zza, "_f");
                    } else {
                        zzd = i10 == 1 ? zzf().zzd(zzoVar.zza, "_v") : null;
                    }
                    if (zzd != null) {
                        long j11 = ((j10 / 3600000) + 1) * 3600000;
                        if (i10 == 0) {
                            zza(new zzon("_fot", j10, Long.valueOf(j11), "auto"), zzoVar);
                            zzl().zzt();
                            zzhf zzhfVar = (zzhf) Preconditions.checkNotNull(this.zzl);
                            String str4 = zzoVar.zza;
                            if (str4 != null && !str4.isEmpty()) {
                                zzhfVar.zza.zzl().zzt();
                                if (!zzhfVar.zza()) {
                                    zzhfVar.zza.zzj().zzo().zza("Install Referrer Reporter is not available");
                                } else {
                                    zzhi zzhiVar = new zzhi(zzhfVar, str4);
                                    zzhfVar.zza.zzl().zzt();
                                    Intent intent = new Intent("com.google.android.finsky.BIND_GET_INSTALL_REFERRER_SERVICE");
                                    intent.setComponent(new ComponentName("com.android.vending", "com.google.android.finsky.externalreferrer.GetInstallReferrerService"));
                                    PackageManager packageManager = zzhfVar.zza.zza().getPackageManager();
                                    if (packageManager == null) {
                                        zzhfVar.zza.zzj().zzw().zza("Failed to obtain Package Manager to verify binding conditions for Install Referrer");
                                    } else {
                                        List<ResolveInfo> queryIntentServices = packageManager.queryIntentServices(intent, 0);
                                        if (queryIntentServices != null && !queryIntentServices.isEmpty()) {
                                            ServiceInfo serviceInfo = queryIntentServices.get(0).serviceInfo;
                                            if (serviceInfo != null) {
                                                String str5 = serviceInfo.packageName;
                                                if (serviceInfo.name != null && "com.android.vending".equals(str5) && zzhfVar.zza()) {
                                                    try {
                                                        zzhfVar.zza.zzj().zzp().zza("Install Referrer Service is", ConnectionTracker.getInstance().bindService(zzhfVar.zza.zza(), new Intent(intent), zzhiVar, 1) ? "available" : "not available");
                                                    } catch (RuntimeException e11) {
                                                        zzhfVar.zza.zzj().zzg().zza("Exception occurred while binding to Install Referrer Service", e11.getMessage());
                                                    }
                                                } else {
                                                    zzhfVar.zza.zzj().zzu().zza("Play Store version 8.3.73 or higher required for Install Referrer");
                                                }
                                            }
                                        } else {
                                            zzhfVar.zza.zzj().zzo().zza("Play Service for fetching Install Referrer is unavailable on device");
                                        }
                                    }
                                }
                                zzl().zzt();
                                zzs();
                                Bundle bundle2 = new Bundle();
                                bundle2.putLong("_c", 1L);
                                bundle2.putLong("_r", 1L);
                                bundle2.putLong("_uwa", 0L);
                                bundle2.putLong("_pfo", 0L);
                                bundle2.putLong("_sys", 0L);
                                bundle2.putLong("_sysu", 0L);
                                bundle2.putLong("_et", 1L);
                                if (zzoVar.zzo) {
                                    bundle2.putLong("_dac", 1L);
                                }
                                String str6 = (String) Preconditions.checkNotNull(zzoVar.zza);
                                zzal zzf2 = zzf();
                                Preconditions.checkNotEmpty(str6);
                                zzf2.zzt();
                                zzf2.zzal();
                                zzb2 = zzf2.zzb(str6, "first_open_count");
                                if (this.zzm.zza().getPackageManager() != null) {
                                    zzj().zzg().zza("PackageManager is null, first open report might be inaccurate. appId", zzgo.zza(str6));
                                    str = "_pfo";
                                } else {
                                    try {
                                        packageInfo = Wrappers.packageManager(this.zzm.zza()).getPackageInfo(str6, 0);
                                    } catch (PackageManager.NameNotFoundException e12) {
                                        zzj().zzg().zza("Package info is null, first open report might be inaccurate. appId", zzgo.zza(str6), e12);
                                        packageInfo = null;
                                    }
                                    if (packageInfo != null) {
                                        str = "_pfo";
                                        long j12 = packageInfo.firstInstallTime;
                                        str2 = "_sys";
                                        str3 = "_sysu";
                                        if (j12 != 0) {
                                            if (j12 != packageInfo.lastUpdateTime) {
                                                if (!zze().zza(zzbh.zzbs)) {
                                                    bundle2.putLong("_uwa", 1L);
                                                } else if (zzb2 == 0) {
                                                    bundle2.putLong("_uwa", 1L);
                                                }
                                                z10 = false;
                                            } else {
                                                z10 = true;
                                            }
                                            zza(new zzon("_fi", j10, Long.valueOf(z10 ? 1L : 0L), "auto"), zzoVar);
                                        }
                                    } else {
                                        str = "_pfo";
                                        str2 = "_sys";
                                        str3 = "_sysu";
                                    }
                                    try {
                                        applicationInfo = Wrappers.packageManager(this.zzm.zza()).getApplicationInfo(str6, 0);
                                    } catch (PackageManager.NameNotFoundException e13) {
                                        zzj().zzg().zza("Application info is null, first open report might be inaccurate. appId", zzgo.zza(str6), e13);
                                        applicationInfo = null;
                                    }
                                    if (applicationInfo != null) {
                                        if ((applicationInfo.flags & 1) != 0) {
                                            bundle2.putLong(str2, 1L);
                                        }
                                        if ((applicationInfo.flags & 128) != 0) {
                                            bundle2.putLong(str3, 1L);
                                        }
                                    }
                                }
                                if (zzb2 >= 0) {
                                    bundle2.putLong(str, zzb2);
                                }
                                zzb(new zzbf("_f", new zzbe(bundle2), "auto", j10), zzoVar);
                            }
                            zzhfVar.zza.zzj().zzw().zza("Install Referrer Reporter was called with invalid app package name");
                            zzl().zzt();
                            zzs();
                            Bundle bundle22 = new Bundle();
                            bundle22.putLong("_c", 1L);
                            bundle22.putLong("_r", 1L);
                            bundle22.putLong("_uwa", 0L);
                            bundle22.putLong("_pfo", 0L);
                            bundle22.putLong("_sys", 0L);
                            bundle22.putLong("_sysu", 0L);
                            bundle22.putLong("_et", 1L);
                            if (zzoVar.zzo) {
                            }
                            String str62 = (String) Preconditions.checkNotNull(zzoVar.zza);
                            zzal zzf22 = zzf();
                            Preconditions.checkNotEmpty(str62);
                            zzf22.zzt();
                            zzf22.zzal();
                            zzb2 = zzf22.zzb(str62, "first_open_count");
                            if (this.zzm.zza().getPackageManager() != null) {
                            }
                            if (zzb2 >= 0) {
                            }
                            zzb(new zzbf("_f", new zzbe(bundle22), "auto", j10), zzoVar);
                        } else if (i10 == 1) {
                            zza(new zzon("_fvt", j10, Long.valueOf(j11), "auto"), zzoVar);
                            zzl().zzt();
                            zzs();
                            Bundle bundle3 = new Bundle();
                            bundle3.putLong("_c", 1L);
                            bundle3.putLong("_r", 1L);
                            bundle3.putLong("_et", 1L);
                            if (zzoVar.zzo) {
                                bundle3.putLong("_dac", 1L);
                            }
                            zzb(new zzbf("_v", new zzbe(bundle3), "auto", j10), zzoVar);
                        }
                    } else if (zzoVar.zzi) {
                        zzb(new zzbf("_cd", new zzbe(new Bundle()), "auto", j10), zzoVar);
                    }
                    zzf().zzw();
                }
                if (zze3 != null) {
                    zza("_npa", zzoVar);
                }
                zze = zzf().zze((String) Preconditions.checkNotNull(zzoVar.zza));
                if (zze != null) {
                }
                if (zze != null) {
                }
                zza(zzoVar);
                if (i10 != 0) {
                }
                if (zzd != null) {
                }
                zzf().zzw();
            } finally {
                zzf().zzu();
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final String zzb(zzo zzoVar) {
        try {
            return (String) zzl().zza(new zzog(this, zzoVar)).get(30000L, TimeUnit.MILLISECONDS);
        } catch (InterruptedException | ExecutionException | TimeoutException e10) {
            zzj().zzg().zza("Failed to get app instance id. appId", zzgo.zza(zzoVar.zza), e10);
            return null;
        }
    }

    private final int zza(FileChannel fileChannel) {
        zzl().zzt();
        if (fileChannel != null && fileChannel.isOpen()) {
            ByteBuffer allocate = ByteBuffer.allocate(4);
            try {
                fileChannel.position(0L);
                int read = fileChannel.read(allocate);
                if (read == 4) {
                    allocate.flip();
                    return allocate.getInt();
                }
                if (read != -1) {
                    zzj().zzu().zza("Unexpected data length. Bytes read", Integer.valueOf(read));
                }
                return 0;
            } catch (IOException e10) {
                zzj().zzg().zza("Failed to read from channel", e10);
                return 0;
            }
        }
        zzj().zzg().zza("Bad channel to read from");
        return 0;
    }

    private final void zzb(zzg zzgVar) {
        zzl().zzt();
        if (TextUtils.isEmpty(zzgVar.zzah()) && TextUtils.isEmpty(zzgVar.zzaa())) {
            zza((String) Preconditions.checkNotNull(zzgVar.zzac()), 204, null, null, null);
            return;
        }
        a aVar = null;
        if (zzpb.zza() && zze().zza(zzbh.zzcf)) {
            String str = (String) Preconditions.checkNotNull(zzgVar.zzac());
            zzj().zzp().zza("Fetching remote configuration", str);
            zzfr.zzd zzc = zzi().zzc(str);
            String zze = zzi().zze(str);
            if (zzc != null) {
                if (!TextUtils.isEmpty(zze)) {
                    aVar = new a();
                    aVar.put("If-Modified-Since", zze);
                }
                String zzd = zzi().zzd(str);
                if (!TextUtils.isEmpty(zzd)) {
                    if (aVar == null) {
                        aVar = new a();
                    }
                    aVar.put("If-None-Match", zzd);
                }
            }
            a aVar2 = aVar;
            this.zzu = true;
            zzgr zzh = zzh();
            zzgu zzguVar = new zzgu() { // from class: com.google.android.gms.measurement.internal.zzny
                @Override // com.google.android.gms.measurement.internal.zzgu
                public final void zza(String str2, int i10, Throwable th2, byte[] bArr, Map map) {
                    zznv.this.zza(str2, i10, th2, bArr, map);
                }
            };
            zzh.zzt();
            zzh.zzal();
            Preconditions.checkNotNull(zzgVar);
            Preconditions.checkNotNull(zzguVar);
            String zza2 = zzh.zzo().zza(zzgVar);
            try {
                zzh.zzl().zza(new zzgw(zzh, zzgVar.zzac(), new URI(zza2).toURL(), null, aVar2, zzguVar));
                return;
            } catch (IllegalArgumentException | MalformedURLException | URISyntaxException unused) {
                zzh.zzj().zzg().zza("Failed to parse config URL. Not fetching. appId", zzgo.zza(zzgVar.zzac()), zza2);
                return;
            }
        }
        String zza3 = this.zzk.zza(zzgVar);
        try {
            String str2 = (String) Preconditions.checkNotNull(zzgVar.zzac());
            URL url = new URL(zza3);
            zzj().zzp().zza("Fetching remote configuration", str2);
            zzfr.zzd zzc2 = zzi().zzc(str2);
            String zze2 = zzi().zze(str2);
            if (zzc2 != null) {
                if (!TextUtils.isEmpty(zze2)) {
                    aVar = new a();
                    aVar.put("If-Modified-Since", zze2);
                }
                String zzd2 = zzi().zzd(str2);
                if (!TextUtils.isEmpty(zzd2)) {
                    if (aVar == null) {
                        aVar = new a();
                    }
                    aVar.put("If-None-Match", zzd2);
                }
            }
            this.zzu = true;
            zzgr zzh2 = zzh();
            zzod zzodVar = new zzod(this);
            zzh2.zzt();
            zzh2.zzal();
            Preconditions.checkNotNull(url);
            Preconditions.checkNotNull(zzodVar);
            zzh2.zzl().zza(new zzgw(zzh2, str2, url, null, aVar, zzodVar));
        } catch (MalformedURLException unused2) {
            zzj().zzg().zza("Failed to parse config URL. Not fetching. appId", zzgo.zza(zzgVar.zzac()), zza3);
        }
    }

    @Override // com.google.android.gms.measurement.internal.zzjc
    public final Context zza() {
        return this.zzm.zza();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Multi-variable type inference failed */
    public final Bundle zza(String str) {
        int i10;
        zzl().zzt();
        zzs();
        if (zzi().zzb(str) == null) {
            return null;
        }
        Bundle bundle = new Bundle();
        zzje zzb2 = zzb(str);
        bundle.putAll(zzb2.zzb());
        bundle.putAll(zza(str, zzd(str), zzb2, new zzah()).zzb());
        zzop zze = zzf().zze(str, "_npa");
        if (zze != null) {
            i10 = zze.zze.equals(1L);
        } else {
            i10 = zza(str, new zzah());
        }
        bundle.putString("ad_personalization", i10 == 1 ? "denied" : "granted");
        return bundle;
    }

    private final void zze(String str) {
        zzl().zzt();
        zzs();
        this.zzw = true;
        try {
            Boolean zzab = this.zzm.zzr().zzab();
            if (zzab == null) {
                zzj().zzu().zza("Upload data called on the client side before use of service was decided");
                return;
            }
            if (zzab.booleanValue()) {
                zzj().zzg().zza("Upload called in the client side when service should be used");
                return;
            }
            if (this.zzp > 0) {
                zzac();
                return;
            }
            if (!zzh().zzu()) {
                zzj().zzp().zza("Network not connected, ignoring upload request");
                zzac();
                return;
            }
            if (!zzf().zzs(str)) {
                zzj().zzp().zza("Upload queue has no batches for appId", str);
                return;
            }
            zzoj zzj = zzf().zzj(str);
            if (zzj == null) {
                return;
            }
            zzfy.zzj zzc = zzj.zzc();
            if (zzc == null) {
                return;
            }
            String zza2 = zzp().zza(zzc);
            byte[] zzca = zzc.zzca();
            zzj().zzp().zza("Uploading data from upload queue. appId, uncompressed size, data", str, Integer.valueOf(zzca.length), zza2);
            if (zzpb.zza() && zze().zza(zzbh.zzcf)) {
                this.zzv = true;
                zzh().zza(str, zzj.zzb(), zzc, new zzob(this, str, zzj));
            } else {
                try {
                    this.zzv = true;
                    zzh().zza(str, new URL(zzj.zzd()), zzca, zzj.zze(), new zzoe(this, str, zzj));
                } catch (MalformedURLException unused) {
                    zzj().zzg().zza("Failed to parse URL. Not uploading MeasurementBatch. appId", zzgo.zza(str), zzj.zzd());
                }
            }
        } finally {
            this.zzw = false;
            zzaa();
        }
    }

    public final zzt zzc() {
        return (zzt) zza(this.zzg);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzc(zzo zzoVar) {
        zzl().zzt();
        zzs();
        Preconditions.checkNotNull(zzoVar);
        Preconditions.checkNotEmpty(zzoVar.zza);
        if (zze().zza(zzbh.zzdc)) {
            int i10 = 0;
            if (zze().zza(zzbh.zzbj)) {
                long currentTimeMillis = zzb().currentTimeMillis();
                int zzb2 = zze().zzb((String) null, zzbh.zzau);
                zze();
                long zzg = currentTimeMillis - zzag.zzg();
                while (i10 < zzb2 && zza((String) null, zzg)) {
                    i10++;
                }
            } else {
                zze();
                long zzh = zzag.zzh();
                while (i10 < zzh && zza(zzoVar.zza, 0L)) {
                    i10++;
                }
            }
            if (zze().zza(zzbh.zzbk)) {
                zzab();
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0151  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x015e  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0169  */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0177  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x018c  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x01f1  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x0250  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final zzg zza(zzo zzoVar) {
        boolean z10;
        long j10;
        String str;
        zzl().zzt();
        zzs();
        Preconditions.checkNotNull(zzoVar);
        Preconditions.checkNotEmpty(zzoVar.zza);
        if (!zzoVar.zzu.isEmpty()) {
            this.zzae.put(zzoVar.zza, new zzb(zzoVar.zzu));
        }
        zzg zze = zzf().zze(zzoVar.zza);
        zzje zza2 = zzb(zzoVar.zza).zza(zzje.zzb(zzoVar.zzt));
        String zza3 = zza2.zzg() ? this.zzj.zza(zzoVar.zza, zzoVar.zzn) : "";
        if (zze == null) {
            zze = new zzg(this.zzm, zzoVar.zza);
            if (zza2.zzh()) {
                zze.zzb(zza(zza2));
            }
            if (zza2.zzg()) {
                zze.zzh(zza3);
            }
        } else if (zza2.zzg() && zza3 != null && !zza3.equals(zze.zzaj())) {
            boolean isEmpty = TextUtils.isEmpty(zze.zzaj());
            zze.zzh(zza3);
            if (zzoVar.zzn && !"00000000-0000-0000-0000-000000000000".equals(this.zzj.zza(zzoVar.zza, zza2).first) && !isEmpty) {
                if (com.google.android.gms.internal.measurement.zznm.zza() && zze().zza(zzbh.zzcy) && !zza2.zzh()) {
                    z10 = true;
                } else {
                    zze.zzb(zza(zza2));
                    z10 = false;
                }
                if (zzf().zze(zzoVar.zza, "_id") != null && zzf().zze(zzoVar.zza, "_lair") == null) {
                    zzf().zza(new zzop(zzoVar.zza, "auto", "_lair", zzb().currentTimeMillis(), 1L));
                }
                zze.zzf(zzoVar.zzb);
                zze.zza(zzoVar.zzp);
                if (!TextUtils.isEmpty(zzoVar.zzk)) {
                    zze.zze(zzoVar.zzk);
                }
                j10 = zzoVar.zze;
                if (j10 != 0) {
                    zze.zzn(j10);
                }
                if (!TextUtils.isEmpty(zzoVar.zzc)) {
                    zze.zzd(zzoVar.zzc);
                }
                zze.zzb(zzoVar.zzj);
                str = zzoVar.zzd;
                if (str != null) {
                    zze.zzc(str);
                }
                zze.zzk(zzoVar.zzf);
                zze.zzb(zzoVar.zzh);
                if (!TextUtils.isEmpty(zzoVar.zzg)) {
                    zze.zzg(zzoVar.zzg);
                }
                zze.zza(zzoVar.zzn);
                zze.zza(zzoVar.zzq);
                zze.zzl(zzoVar.zzr);
                zze.zzj(zzoVar.zzv);
                if (!com.google.android.gms.internal.measurement.zzny.zza() && zze().zza(zzbh.zzbv)) {
                    zze.zza(zzoVar.zzs);
                } else if (com.google.android.gms.internal.measurement.zzny.zza() && zze().zza(zzbh.zzbu)) {
                    zze.zza((List<String>) null);
                }
                if (zzpu.zza() && zze().zza(zzbh.zzbx)) {
                    zzq();
                    if (zzos.zzf(zze.zzac())) {
                        zze.zzc(zzoVar.zzw);
                        if (zze().zza(zzbh.zzby)) {
                            zze.zzk(zzoVar.zzac);
                        }
                    }
                }
                if (zzpn.zza() && zze().zza(zzbh.zzch)) {
                    zze.zza(zzoVar.zzaa);
                }
                zze.zzt(zzoVar.zzx);
                zze.zzi(zzoVar.zzad);
                if (!com.google.android.gms.internal.measurement.zznm.zza() && zze().zza(zzbh.zzcy)) {
                    if (zze.zzas() || z10) {
                        zzf().zza(zze, z10, false);
                    }
                } else if (zze.zzas()) {
                    zzf().zza(zze, false, false);
                }
                return zze;
            }
            if (TextUtils.isEmpty(zze.zzad()) && zza2.zzh()) {
                zze.zzb(zza(zza2));
            }
        } else if (TextUtils.isEmpty(zze.zzad()) && zza2.zzh()) {
            zze.zzb(zza(zza2));
        }
        z10 = false;
        zze.zzf(zzoVar.zzb);
        zze.zza(zzoVar.zzp);
        if (!TextUtils.isEmpty(zzoVar.zzk)) {
        }
        j10 = zzoVar.zze;
        if (j10 != 0) {
        }
        if (!TextUtils.isEmpty(zzoVar.zzc)) {
        }
        zze.zzb(zzoVar.zzj);
        str = zzoVar.zzd;
        if (str != null) {
        }
        zze.zzk(zzoVar.zzf);
        zze.zzb(zzoVar.zzh);
        if (!TextUtils.isEmpty(zzoVar.zzg)) {
        }
        zze.zza(zzoVar.zzn);
        zze.zza(zzoVar.zzq);
        zze.zzl(zzoVar.zzr);
        zze.zzj(zzoVar.zzv);
        if (!com.google.android.gms.internal.measurement.zzny.zza()) {
        }
        if (com.google.android.gms.internal.measurement.zzny.zza()) {
            zze.zza((List<String>) null);
        }
        if (zzpu.zza()) {
            zzq();
            if (zzos.zzf(zze.zzac())) {
            }
        }
        if (zzpn.zza()) {
            zze.zza(zzoVar.zzaa);
        }
        zze.zzt(zzoVar.zzx);
        zze.zzi(zzoVar.zzad);
        if (!com.google.android.gms.internal.measurement.zznm.zza()) {
        }
        if (zze.zzas()) {
        }
        return zze;
    }

    /* JADX WARN: Can't wrap try/catch for region: R(18:82|(2:84|(1:86)(5:87|88|(1:90)|91|(0)))|334|335|336|(1:338)(1:355)|339|340|341|342|343|344|345|346|88|(0)|91|(0)) */
    /* JADX WARN: Can't wrap try/catch for region: R(56:(2:105|(5:107|(1:109)|110|111|112))(1:333)|(2:114|(5:116|(1:118)|119|120|121))|122|123|(1:125)|126|(1:132)|133|(2:143|144)|147|(1:149)|150|(2:152|(1:158)(3:155|156|157))(1:332)|159|(1:161)|162|(1:164)|165|(1:167)|168|(1:170)|171|(1:173)|174|(1:176)|177|(1:181)|182|(2:186|(32:188|(1:192)|193|(1:195)(1:330)|196|(15:198|(1:200)(1:226)|201|(1:203)(1:225)|204|(1:206)(1:224)|207|(1:209)(1:223)|210|(1:212)(1:222)|213|(1:215)(1:221)|216|(1:218)(1:220)|219)|227|(1:229)|230|(1:232)|233|(4:243|(1:245)|246|(4:254|255|(4:257|(1:259)|260|(1:262))(2:264|(1:266))|263))|267|(2:269|(1:271))|272|(3:274|(1:276)|277)(1:329)|278|(1:282)|283|(1:285)|286|(4:289|(2:295|296)|297|287)|301|302|303|(2:305|(2:306|(2:308|(1:310)(1:318))(3:319|320|(1:324))))|325|312|(1:314)|315|316|317))|331|227|(0)|230|(0)|233|(8:235|237|239|241|243|(0)|246|(7:248|250|252|254|255|(0)(0)|263))|267|(0)|272|(0)(0)|278|(2:280|282)|283|(0)|286|(1:287)|301|302|303|(0)|325|312|(0)|315|316|317) */
    /* JADX WARN: Code restructure failed: missing block: B:311:0x09e9, code lost:
    
        r13 = true;
     */
    /* JADX WARN: Code restructure failed: missing block: B:327:0x0a35, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:328:0x0a36, code lost:
    
        zzj().zzg().zza("Data loss. Failed to insert raw event metadata. appId", com.google.android.gms.measurement.internal.zzgo.zza(r4.zzt()), r0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:348:0x02dc, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Code restructure failed: missing block: B:350:0x02e5, code lost:
    
        r11.zzj().zzg().zza("Error pruning currencies. appId", com.google.android.gms.measurement.internal.zzgo.zza(r8), r0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:352:0x02de, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Code restructure failed: missing block: B:353:0x02e3, code lost:
    
        r15 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:356:0x02e0, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Code restructure failed: missing block: B:357:0x02e1, code lost:
    
        r27 = "_fx";
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:104:0x03e6  */
    /* JADX WARN: Removed duplicated region for block: B:229:0x0760 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:232:0x0772 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:245:0x07b8 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:257:0x0802 A[Catch: all -> 0x0a7d, TRY_ENTER, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:264:0x0823 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:269:0x0898 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:274:0x08b1 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:285:0x093d A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:289:0x095b A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:305:0x09d3 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:314:0x0a30 A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:329:0x0915  */
    /* JADX WARN: Removed duplicated region for block: B:362:0x0362  */
    /* JADX WARN: Removed duplicated region for block: B:66:0x01a6 A[Catch: all -> 0x0a7d, TRY_ENTER, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:90:0x031a A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:93:0x0353 A[Catch: all -> 0x0a7d, TRY_LEAVE, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:98:0x03ba A[Catch: all -> 0x0a7d, TryCatch #4 {all -> 0x0a7d, blocks: (B:51:0x016d, B:54:0x017c, B:56:0x0186, B:60:0x0192, B:66:0x01a6, B:68:0x01b0, B:70:0x01c7, B:75:0x01e3, B:78:0x021b, B:80:0x0221, B:82:0x022f, B:84:0x0247, B:87:0x024e, B:88:0x0310, B:90:0x031a, B:93:0x0353, B:96:0x036a, B:98:0x03ba, B:100:0x03c0, B:101:0x03d7, B:105:0x03e8, B:107:0x0400, B:109:0x0408, B:110:0x041f, B:114:0x0441, B:118:0x0467, B:119:0x047e, B:122:0x048d, B:125:0x04ac, B:126:0x04c6, B:128:0x04d0, B:130:0x04dc, B:132:0x04e2, B:133:0x04eb, B:135:0x04f7, B:137:0x0501, B:139:0x050b, B:141:0x0513, B:144:0x0517, B:147:0x0523, B:149:0x052f, B:150:0x0544, B:152:0x0567, B:155:0x057e, B:158:0x05bd, B:159:0x05e7, B:161:0x0625, B:162:0x062a, B:164:0x0632, B:165:0x0637, B:167:0x063f, B:168:0x0644, B:170:0x064c, B:171:0x0651, B:173:0x065a, B:174:0x065e, B:176:0x066b, B:177:0x0670, B:179:0x0697, B:181:0x069f, B:182:0x06a4, B:184:0x06aa, B:186:0x06b8, B:188:0x06c3, B:192:0x06d8, B:196:0x06e7, B:198:0x06ee, B:201:0x06fd, B:204:0x070a, B:207:0x0717, B:210:0x0724, B:213:0x0731, B:216:0x073c, B:219:0x0749, B:227:0x075a, B:229:0x0760, B:230:0x0763, B:232:0x0772, B:233:0x0775, B:235:0x0791, B:237:0x0795, B:239:0x079f, B:241:0x07a9, B:243:0x07ad, B:245:0x07b8, B:246:0x07c1, B:248:0x07cb, B:250:0x07d7, B:252:0x07e3, B:254:0x07e9, B:257:0x0802, B:259:0x0808, B:260:0x0813, B:262:0x0819, B:263:0x0845, B:264:0x0823, B:266:0x082f, B:267:0x0851, B:269:0x0898, B:271:0x08a2, B:272:0x08a5, B:274:0x08b1, B:276:0x08d1, B:277:0x08de, B:278:0x0916, B:280:0x091c, B:282:0x0926, B:283:0x0933, B:285:0x093d, B:286:0x094a, B:287:0x0955, B:289:0x095b, B:291:0x0999, B:293:0x09a3, B:295:0x09b5, B:302:0x09bb, B:303:0x09cb, B:305:0x09d3, B:306:0x09d7, B:308:0x09dd, B:312:0x0a2a, B:314:0x0a30, B:315:0x0a4c, B:320:0x09eb, B:322:0x0a17, B:328:0x0a36, B:332:0x05d9, B:334:0x027e, B:336:0x029c, B:339:0x02b1, B:342:0x02b5, B:345:0x02ca, B:346:0x02f6, B:350:0x02e5, B:359:0x01f1, B:361:0x0211), top: B:50:0x016d, inners: #0 }] */
    /* JADX WARN: Type inference failed for: r12v10 */
    /* JADX WARN: Type inference failed for: r12v11, types: [int] */
    /* JADX WARN: Type inference failed for: r12v44 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final void zzc(zzbf zzbfVar, zzo zzoVar) {
        boolean z10;
        String str;
        long j10;
        String str2;
        String str3;
        long zzh;
        zzbb zza2;
        long j11;
        long j12;
        List<Integer> zzu;
        zzje zza3;
        zzg zze;
        boolean z11;
        List<zzop> zzl;
        ?? r12;
        long zza4;
        zzal zzf;
        zzbe zzbeVar;
        boolean z12;
        Pair<String, Boolean> zza5;
        Object obj;
        String str4;
        zzg zze2;
        Object obj2;
        zzop zze3;
        long longValue;
        boolean z13;
        zzop zzopVar;
        String str5;
        Long l10;
        zzg zze4;
        Preconditions.checkNotNull(zzoVar);
        Preconditions.checkNotEmpty(zzoVar.zza);
        long nanoTime = System.nanoTime();
        zzl().zzt();
        zzs();
        String str6 = zzoVar.zza;
        zzp();
        if (!zzoo.zza(zzbfVar, zzoVar)) {
            return;
        }
        if (!zzoVar.zzh) {
            zza(zzoVar);
            return;
        }
        if (zzi().zzd(str6, zzbfVar.zza)) {
            zzj().zzu().zza("Dropping blocked event. appId", zzgo.zza(str6), this.zzm.zzk().zza(zzbfVar.zza));
            boolean z14 = zzi().zzl(str6) || zzi().zzn(str6);
            if (z14 || "_err".equals(zzbfVar.zza)) {
                l10 = null;
            } else {
                zzq();
                l10 = null;
                zzos.zza(this.zzah, str6, 11, "_ev", zzbfVar.zza, 0);
            }
            if (!z14 || (zze4 = zzf().zze(str6)) == null) {
                return;
            }
            long abs = Math.abs(zzb().currentTimeMillis() - Math.max(zze4.zzp(), zze4.zzg()));
            zze();
            if (abs > zzbh.zzaa.zza(l10).longValue()) {
                zzj().zzc().zza("Fetching config for blocked app");
                zzb(zze4);
                return;
            }
            return;
        }
        zzgs zza6 = zzgs.zza(zzbfVar);
        zzq().zza(zza6, zze().zzb(str6));
        int zza7 = zze().zza(str6, zzbh.zzas, 10, 35);
        for (String str7 : new TreeSet(zza6.zzc.keySet())) {
            if ("items".equals(str7)) {
                zzq().zza(zza6.zzc.getParcelableArray(str7), zza7);
            }
        }
        zzbf zza8 = zza6.zza();
        if (zzj().zza(2)) {
            zzj().zzp().zza("Logging event", this.zzm.zzk().zza(zza8));
        }
        if (zzow.zza()) {
            zze().zza(zzbh.zzcd);
        }
        zzf().zzp();
        try {
            zza(zzoVar);
            if (!"ecommerce_purchase".equals(zza8.zza) && !FirebaseAnalytics.Event.PURCHASE.equals(zza8.zza) && !FirebaseAnalytics.Event.REFUND.equals(zza8.zza)) {
                z10 = false;
                if (!"_iap".equals(zza8.zza) || z10) {
                    str = "_fx";
                    j10 = nanoTime;
                    str2 = "value";
                    str3 = "_err";
                } else {
                    String zzd = zza8.zzb.zzd(FirebaseAnalytics.Param.CURRENCY);
                    if (z10) {
                        double doubleValue = zza8.zzb.zza("value").doubleValue() * 1000000.0d;
                        if (doubleValue == 0.0d) {
                            Long zzb2 = zza8.zzb.zzb("value");
                            str5 = FirebaseAnalytics.Event.REFUND;
                            doubleValue = zzb2.longValue() * 1000000.0d;
                        } else {
                            str5 = FirebaseAnalytics.Event.REFUND;
                        }
                        if (doubleValue <= 9.223372036854776E18d && doubleValue >= -9.223372036854776E18d) {
                            longValue = Math.round(doubleValue);
                            if (str5.equals(zza8.zza)) {
                                longValue = -longValue;
                            }
                        } else {
                            zzj().zzu().zza("Data lost. Currency value is too big. appId", zzgo.zza(str6), Double.valueOf(doubleValue));
                            str = "_fx";
                            j10 = nanoTime;
                            str2 = "value";
                            str3 = "_err";
                            z13 = false;
                            if (!z13) {
                                zzf().zzw();
                                return;
                            }
                        }
                    } else {
                        longValue = zza8.zzb.zzb("value").longValue();
                    }
                    if (!TextUtils.isEmpty(zzd)) {
                        String upperCase = zzd.toUpperCase(Locale.US);
                        if (upperCase.matches("[A-Z]{3}")) {
                            String str8 = "_ltv_" + upperCase;
                            zzop zze5 = zzf().zze(str6, str8);
                            if (zze5 != null) {
                                Object obj3 = zze5.zze;
                                if (obj3 instanceof Long) {
                                    j10 = nanoTime;
                                    str2 = "value";
                                    str3 = "_err";
                                    str = "_fx";
                                    zzopVar = new zzop(str6, zza8.zzc, str8, zzb().currentTimeMillis(), Long.valueOf(((Long) obj3).longValue() + longValue));
                                    if (!zzf().zza(zzopVar)) {
                                        zzj().zzg().zza("Too many unique user properties are set. Ignoring user property. appId", zzgo.zza(str6), this.zzm.zzk().zzc(zzopVar.zzc), zzopVar.zze);
                                        zzq();
                                        zzos.zza(this.zzah, str6, 9, (String) null, (String) null, 0);
                                    }
                                    z13 = true;
                                    if (!z13) {
                                    }
                                }
                            }
                            j10 = nanoTime;
                            str2 = "value";
                            str3 = "_err";
                            zzal zzf2 = zzf();
                            int zzb3 = zze().zzb(str6, zzbh.zzag) - 1;
                            Preconditions.checkNotEmpty(str6);
                            zzf2.zzt();
                            zzf2.zzal();
                            SQLiteDatabase e_ = zzf2.e_();
                            str = "_fx";
                            String str9 = "delete from user_attributes where app_id=? and name in (select name from user_attributes where app_id=? " + (zzf2.zze().zza(zzbh.zzdl) ? "and name like '!_ltv!_%' escape '!'" : "and name like '_ltv_%' ") + "order by set_timestamp desc limit ?,10);";
                            String[] strArr = new String[3];
                            boolean z15 = false;
                            strArr[0] = str6;
                            strArr[1] = str6;
                            strArr[2] = String.valueOf(zzb3);
                            e_.execSQL(str9, strArr);
                            zzopVar = new zzop(str6, zza8.zzc, str8, zzb().currentTimeMillis(), Long.valueOf(longValue));
                            if (!zzf().zza(zzopVar)) {
                            }
                            z13 = true;
                            if (!z13) {
                            }
                        }
                    }
                    str = "_fx";
                    j10 = nanoTime;
                    str2 = "value";
                    str3 = "_err";
                    z13 = true;
                    if (!z13) {
                    }
                }
                boolean zzh2 = zzos.zzh(zza8.zza);
                boolean equals = str3.equals(zza8.zza);
                zzq();
                String str10 = str2;
                zzaq zza9 = zzf().zza(zzx(), str6, zzos.zza(zza8.zzb) + 1, true, zzh2, false, equals, false, false, false);
                long j13 = zza9.zzb;
                zze();
                zzh = j13 - zzag.zzh();
                if (zzh <= 0) {
                    if (zzh % 1000 == 1) {
                        zzj().zzg().zza("Data loss. Too many events logged. appId, count", zzgo.zza(str6), Long.valueOf(zza9.zzb));
                    }
                    zzf().zzw();
                    return;
                }
                if (zzh2) {
                    long j14 = zza9.zza;
                    zze();
                    long intValue = j14 - zzbh.zzm.zza(null).intValue();
                    if (intValue > 0) {
                        if (intValue % 1000 == 1) {
                            zzj().zzg().zza("Data loss. Too many public events logged. appId, count", zzgo.zza(str6), Long.valueOf(zza9.zza));
                        }
                        zzq();
                        zzos.zza(this.zzah, str6, 16, "_ev", zza8.zza, 0);
                        zzf().zzw();
                        return;
                    }
                }
                if (equals) {
                    long max = zza9.zzd - Math.max(0, Math.min(1000000, zze().zzb(zzoVar.zza, zzbh.zzl)));
                    if (max > 0) {
                        if (max == 1) {
                            zzj().zzg().zza("Too many error events logged. appId, count", zzgo.zza(str6), Long.valueOf(zza9.zzd));
                        }
                        zzf().zzw();
                        return;
                    }
                }
                Bundle zzb4 = zza8.zzb.zzb();
                zzq().zza(zzb4, "_o", zza8.zzc);
                if (zzq().zzd(str6, zzoVar.zzac)) {
                    zzq().zza(zzb4, "_dbg", (Object) 1L);
                    zzq().zza(zzb4, "_r", (Object) 1L);
                }
                if ("_s".equals(zza8.zza) && (zze3 = zzf().zze(zzoVar.zza, "_sno")) != null && (zze3.zze instanceof Long)) {
                    zzq().zza(zzb4, "_sno", zze3.zze);
                }
                if (zze().zza(zzbh.zzdj) && Objects.equals(zza8.zzc, "am") && Objects.equals(zza8.zza, "_ai") && (obj2 = zzb4.get(str10)) != null && (obj2 instanceof String)) {
                    try {
                        double parseDouble = Double.parseDouble((String) obj2);
                        zzb4.remove(str10);
                        zzb4.putDouble(str10, parseDouble);
                    } catch (NumberFormatException unused) {
                    }
                }
                long zza10 = zzf().zza(str6);
                if (zza10 > 0) {
                    zzj().zzu().zza("Data lost. Too many events stored on disk, deleted. appId", zzgo.zza(str6), Long.valueOf(zza10));
                }
                zzbc zzbcVar = new zzbc(this.zzm, zza8.zzc, str6, zza8.zza, zza8.zzd, 0L, zzb4);
                zzbb zzd2 = zzf().zzd(str6, zzbcVar.zzb);
                if (zzd2 == null) {
                    if (zzf().zzc(str6) >= zze().zza(str6) && zzh2) {
                        zzj().zzg().zza("Too many event names used, ignoring event. appId, name, supported count", zzgo.zza(str6), this.zzm.zzk().zza(zzbcVar.zzb), Integer.valueOf(zze().zza(str6)));
                        zzq();
                        zzos.zza(this.zzah, str6, 8, (String) null, (String) null, 0);
                        return;
                    }
                    zza2 = new zzbb(str6, zzbcVar.zzb, 0L, 0L, zzbcVar.zzd, 0L, null, null, null, null);
                } else {
                    zzbcVar = zzbcVar.zza(this.zzm, zzd2.zzf);
                    zza2 = zzd2.zza(zzbcVar.zzd);
                }
                zzf().zza(zza2);
                zzl().zzt();
                zzs();
                Preconditions.checkNotNull(zzbcVar);
                Preconditions.checkNotNull(zzoVar);
                Preconditions.checkNotEmpty(zzbcVar.zza);
                Preconditions.checkArgument(zzbcVar.zza.equals(zzoVar.zza));
                zzfy.zzk.zza zzp = zzfy.zzk.zzw().zzh(1).zzp("android");
                if (!TextUtils.isEmpty(zzoVar.zza)) {
                    zzp.zzb(zzoVar.zza);
                }
                if (!TextUtils.isEmpty(zzoVar.zzd)) {
                    zzp.zzd(zzoVar.zzd);
                }
                if (!TextUtils.isEmpty(zzoVar.zzc)) {
                    zzp.zze(zzoVar.zzc);
                }
                if (!TextUtils.isEmpty(zzoVar.zzv)) {
                    zzp.zzr(zzoVar.zzv);
                }
                long j15 = zzoVar.zzj;
                if (j15 != -2147483648L) {
                    zzp.zze((int) j15);
                }
                zzp.zzf(zzoVar.zze);
                if (!TextUtils.isEmpty(zzoVar.zzb)) {
                    zzp.zzm(zzoVar.zzb);
                }
                zzje zza11 = zzb((String) Preconditions.checkNotNull(zzoVar.zza)).zza(zzje.zzb(zzoVar.zzt));
                zzp.zzg(zza11.zze());
                if (zzp.zzx().isEmpty() && !TextUtils.isEmpty(zzoVar.zzp)) {
                    zzp.zza(zzoVar.zzp);
                }
                if (zzpn.zza() && zze().zze(zzoVar.zza, zzbh.zzch)) {
                    zzq();
                    if (zzos.zzd(zzoVar.zza)) {
                        zzp.zzd(zzoVar.zzaa);
                        long j16 = zzoVar.zzab;
                        j11 = 0;
                        if (!zza11.zzg() && j16 != 0) {
                            j16 = (j16 & (-2)) | 32;
                        }
                        zzp.zza(j16 == 1);
                        if (j16 != 0) {
                            zzfy.zzc.zza zza12 = zzfy.zzc.zza();
                            zza12.zzc((j16 & 1) != 0);
                            zza12.zze((2 & j16) != 0);
                            zza12.zzf((4 & j16) != 0);
                            zza12.zzg((8 & j16) != 0);
                            zza12.zzb((16 & j16) != 0);
                            zza12.zza((32 & j16) != 0);
                            zza12.zzd((j16 & 64) != 0);
                            zzp.zza((zzfy.zzc) ((com.google.android.gms.internal.measurement.zzjt) zza12.zzai()));
                        }
                        j12 = zzoVar.zzf;
                        if (j12 != j11) {
                            zzp.zzc(j12);
                        }
                        zzp.zzd(zzoVar.zzr);
                        zzu = zzp().zzu();
                        if (zzu != null) {
                            zzp.zzc(zzu);
                        }
                        zza3 = zzb((String) Preconditions.checkNotNull(zzoVar.zza)).zza(zzje.zzb(zzoVar.zzt));
                        if (zza3.zzg() && zzoVar.zzn && (zza5 = this.zzj.zza(zzoVar.zza, zza3)) != null && !TextUtils.isEmpty((CharSequence) zza5.first) && zzoVar.zzn) {
                            zzp.zzq((String) zza5.first);
                            obj = zza5.second;
                            if (obj != null) {
                                zzp.zzc(((Boolean) obj).booleanValue());
                            }
                            str4 = str;
                            if (!zzbcVar.zzb.equals(str4) && !((String) zza5.first).equals("00000000-0000-0000-0000-000000000000") && (zze2 = zzf().zze(zzoVar.zza)) != null && zze2.zzau()) {
                                zza(zzoVar.zza, false, (Long) null, (Long) null);
                                Bundle bundle = new Bundle();
                                if (!zze().zza(zzbh.zzcw)) {
                                    Long zzy = zze2.zzy();
                                    if (zzy != null) {
                                        bundle.putLong("_pfo", Math.max(j11, zzy.longValue()));
                                    }
                                    Long zzz = zze2.zzz();
                                    if (zzz != null) {
                                        bundle.putLong("_uwa", zzz.longValue());
                                    }
                                } else if (zze().zza(zzbh.zzcv)) {
                                    bundle.putLong("_pfo", Math.max(0L, zzf().zzb(zzoVar.zza) - 1));
                                }
                                bundle.putLong("_r", 1L);
                                this.zzah.zza(zzoVar.zza, str4, bundle);
                            }
                        }
                        this.zzm.zzg().zzac();
                        zzfy.zzk.zza zzi = zzp.zzi(Build.MODEL);
                        this.zzm.zzg().zzac();
                        zzi.zzo(Build.VERSION.RELEASE).zzj((int) this.zzm.zzg().zzc()).zzs(this.zzm.zzg().zzg());
                        zzp.zzj(zzoVar.zzx);
                        if (this.zzm.zzac()) {
                            zzp.zzt();
                            if (!TextUtils.isEmpty(null)) {
                                zzp.zzj((String) null);
                            }
                        }
                        zze = zzf().zze(zzoVar.zza);
                        if (zze != null) {
                            zze = new zzg(this.zzm, zzoVar.zza);
                            zze.zzb(zza(zza3));
                            zze.zze(zzoVar.zzk);
                            zze.zzf(zzoVar.zzb);
                            if (zza3.zzg()) {
                                zze.zzh(this.zzj.zza(zzoVar.zza, zzoVar.zzn));
                            }
                            zze.zzq(0L);
                            zze.zzr(0L);
                            zze.zzp(0L);
                            zze.zzd(zzoVar.zzc);
                            zze.zzb(zzoVar.zzj);
                            zze.zzc(zzoVar.zzd);
                            zze.zzn(zzoVar.zze);
                            zze.zzk(zzoVar.zzf);
                            zze.zzb(zzoVar.zzh);
                            zze.zzl(zzoVar.zzr);
                            z11 = false;
                            zzf().zza(zze, false, false);
                        } else {
                            z11 = false;
                        }
                        if (zza3.zzh() && !TextUtils.isEmpty(zze.zzad())) {
                            zzp.zzc((String) Preconditions.checkNotNull(zze.zzad()));
                        }
                        if (!TextUtils.isEmpty(zze.zzag())) {
                            zzp.zzl((String) Preconditions.checkNotNull(zze.zzag()));
                        }
                        zzl = zzf().zzl(zzoVar.zza);
                        for (r12 = z11; r12 < zzl.size(); r12++) {
                            zzfy.zzo.zza zzb5 = zzfy.zzo.zze().zza(zzl.get(r12).zzc).zzb(zzl.get(r12).zzd);
                            zzp().zza(zzb5, zzl.get(r12).zze);
                            zzp.zza(zzb5);
                            if ("_sid".equals(zzl.get(r12).zzc) && zze.zzv() != 0 && zzp().zza(zzoVar.zzv) != zze.zzv()) {
                                zzp.zzr();
                            }
                        }
                        zza4 = zzf().zza((zzfy.zzk) ((com.google.android.gms.internal.measurement.zzjt) zzp.zzai()));
                        zzf = zzf();
                        zzbeVar = zzbcVar.zzf;
                        if (zzbeVar != null) {
                            Iterator<String> it = zzbeVar.iterator();
                            while (true) {
                                if (it.hasNext()) {
                                    if ("_r".equals(it.next())) {
                                        break;
                                    }
                                } else {
                                    boolean zzc = zzi().zzc(zzbcVar.zza, zzbcVar.zzb);
                                    zzaq zza13 = zzf().zza(zzx(), zzbcVar.zza, false, false, false, false, false, false, false);
                                    if (zzc && zza13.zze < zze().zzc(zzbcVar.zza)) {
                                    }
                                }
                            }
                        }
                        z12 = z11;
                        if (zzf.zza(zzbcVar, zza4, z12)) {
                            this.zzp = 0L;
                        }
                        zzf().zzw();
                        zzf().zzu();
                        zzac();
                        zzj().zzp().zza("Background event processing time, ms", Long.valueOf(((System.nanoTime() - j10) + 500000) / 1000000));
                        return;
                    }
                }
                j11 = 0;
                j12 = zzoVar.zzf;
                if (j12 != j11) {
                }
                zzp.zzd(zzoVar.zzr);
                zzu = zzp().zzu();
                if (zzu != null) {
                }
                zza3 = zzb((String) Preconditions.checkNotNull(zzoVar.zza)).zza(zzje.zzb(zzoVar.zzt));
                if (zza3.zzg()) {
                    zzp.zzq((String) zza5.first);
                    obj = zza5.second;
                    if (obj != null) {
                    }
                    str4 = str;
                    if (!zzbcVar.zzb.equals(str4)) {
                        zza(zzoVar.zza, false, (Long) null, (Long) null);
                        Bundle bundle2 = new Bundle();
                        if (!zze().zza(zzbh.zzcw)) {
                        }
                        bundle2.putLong("_r", 1L);
                        this.zzah.zza(zzoVar.zza, str4, bundle2);
                    }
                }
                this.zzm.zzg().zzac();
                zzfy.zzk.zza zzi2 = zzp.zzi(Build.MODEL);
                this.zzm.zzg().zzac();
                zzi2.zzo(Build.VERSION.RELEASE).zzj((int) this.zzm.zzg().zzc()).zzs(this.zzm.zzg().zzg());
                zzp.zzj(zzoVar.zzx);
                if (this.zzm.zzac()) {
                }
                zze = zzf().zze(zzoVar.zza);
                if (zze != null) {
                }
                if (zza3.zzh()) {
                    zzp.zzc((String) Preconditions.checkNotNull(zze.zzad()));
                }
                if (!TextUtils.isEmpty(zze.zzag())) {
                }
                zzl = zzf().zzl(zzoVar.zza);
                while (r12 < zzl.size()) {
                }
                zza4 = zzf().zza((zzfy.zzk) ((com.google.android.gms.internal.measurement.zzjt) zzp.zzai()));
                zzf = zzf();
                zzbeVar = zzbcVar.zzf;
                if (zzbeVar != null) {
                }
                z12 = z11;
                if (zzf.zza(zzbcVar, zza4, z12)) {
                }
                zzf().zzw();
                zzf().zzu();
                zzac();
                zzj().zzp().zza("Background event processing time, ms", Long.valueOf(((System.nanoTime() - j10) + 500000) / 1000000));
                return;
            }
            z10 = true;
            if (!"_iap".equals(zza8.zza) || z10) {
            }
            boolean zzh22 = zzos.zzh(zza8.zza);
            boolean equals2 = str3.equals(zza8.zza);
            zzq();
            String str102 = str2;
            zzaq zza92 = zzf().zza(zzx(), str6, zzos.zza(zza8.zzb) + 1, true, zzh22, false, equals2, false, false, false);
            long j132 = zza92.zzb;
            zze();
            zzh = j132 - zzag.zzh();
            if (zzh <= 0) {
            }
        } finally {
            zzf().zzu();
        }
    }

    private final void zzb(zzbf zzbfVar, zzo zzoVar) {
        Preconditions.checkNotEmpty(zzoVar.zza);
        zzgs zza2 = zzgs.zza(zzbfVar);
        zzq().zza(zza2.zzc, zzf().zzd(zzoVar.zza));
        zzq().zza(zza2, zze().zzb(zzoVar.zza));
        zzbf zza3 = zza2.zza();
        if (Constants.ScionAnalytics.EVENT_FIREBASE_CAMPAIGN.equals(zza3.zza) && "referrer API v2".equals(zza3.zzb.zzd("_cis"))) {
            String zzd = zza3.zzb.zzd("gclid");
            if (!TextUtils.isEmpty(zzd)) {
                zza(new zzon("_lgclid", zza3.zzd, zzd, "auto"), zzoVar);
            }
        }
        zza(zza3, zzoVar);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Code restructure failed: missing block: B:30:0x00a6, code lost:
    
        r8.zzj.zzc.zza(zzb().currentTimeMillis());
     */
    /* JADX WARN: Removed duplicated region for block: B:48:0x015f A[Catch: all -> 0x01da, TryCatch #1 {all -> 0x01da, blocks: (B:5:0x002b, B:12:0x0047, B:13:0x01c6, B:23:0x0061, B:30:0x00a6, B:31:0x00b5, B:32:0x00ba, B:35:0x00c5, B:37:0x00d1, B:41:0x0113, B:46:0x014b, B:48:0x015f, B:49:0x0183, B:51:0x018d, B:53:0x0193, B:54:0x0197, B:56:0x01a3, B:58:0x01ad, B:60:0x01bb, B:61:0x01c3, B:62:0x016d, B:63:0x012a, B:65:0x0134, B:71:0x00dc, B:73:0x00e6, B:75:0x00ec, B:77:0x00f6, B:79:0x0100, B:81:0x0106), top: B:4:0x002b, outer: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:62:0x016d A[Catch: all -> 0x01da, TryCatch #1 {all -> 0x01da, blocks: (B:5:0x002b, B:12:0x0047, B:13:0x01c6, B:23:0x0061, B:30:0x00a6, B:31:0x00b5, B:32:0x00ba, B:35:0x00c5, B:37:0x00d1, B:41:0x0113, B:46:0x014b, B:48:0x015f, B:49:0x0183, B:51:0x018d, B:53:0x0193, B:54:0x0197, B:56:0x01a3, B:58:0x01ad, B:60:0x01bb, B:61:0x01c3, B:62:0x016d, B:63:0x012a, B:65:0x0134, B:71:0x00dc, B:73:0x00e6, B:75:0x00ec, B:77:0x00f6, B:79:0x0100, B:81:0x0106), top: B:4:0x002b, outer: #0 }] */
    /* renamed from: zzb, reason: merged with bridge method [inline-methods] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void zza(String str, int i10, Throwable th2, byte[] bArr, Map<String, List<String>> map) {
        String str2;
        String str3;
        zzl().zzt();
        zzs();
        Preconditions.checkNotEmpty(str);
        if (bArr == null) {
            try {
                bArr = new byte[0];
            } finally {
                this.zzu = false;
                zzaa();
            }
        }
        zzj().zzp().zza("onConfigFetched. Response size", Integer.valueOf(bArr.length));
        zzf().zzp();
        try {
            zzg zze = zzf().zze(str);
            boolean z10 = true;
            boolean z11 = (i10 == 200 || i10 == 204 || i10 == 304) && th2 == null;
            if (zze == null) {
                zzj().zzu().zza("App does not exist in onConfigFetched. appId", zzgo.zza(str));
            } else {
                if (!z11 && i10 != 404) {
                    zze.zzm(zzb().currentTimeMillis());
                    zzf().zza(zze, false, false);
                    zzj().zzp().zza("Fetching config failed. code, error", Integer.valueOf(i10), th2);
                    zzi().zzi(str);
                    this.zzj.zze.zza(zzb().currentTimeMillis());
                    if (i10 != 503 && i10 != 429) {
                        z10 = false;
                    }
                    zzac();
                }
                if (zzpb.zza() && zze().zza(zzbh.zzcf)) {
                    str2 = zza(map, "Last-Modified");
                    str3 = zza(map, "ETag");
                } else {
                    List<String> list = map != null ? map.get("Last-Modified") : null;
                    str2 = (list == null || list.isEmpty()) ? null : list.get(0);
                    List<String> list2 = map != null ? map.get("ETag") : null;
                    str3 = (list2 == null || list2.isEmpty()) ? null : list2.get(0);
                }
                if (i10 != 404 && i10 != 304) {
                    if (!zzi().zza(str, bArr, str2, str3)) {
                        return;
                    }
                    zze.zzd(zzb().currentTimeMillis());
                    zzf().zza(zze, false, false);
                    if (i10 != 404) {
                        zzj().zzv().zza("Config not found. Using empty config. appId", str);
                    } else {
                        zzj().zzp().zza("Successfully fetched config. Got network response. code, size", Integer.valueOf(i10), Integer.valueOf(bArr.length));
                    }
                    if (!zzh().zzu() && zzad()) {
                        zzw();
                    } else if (!zze().zza(zzbh.zzcb) && zzh().zzu() && zzf().zzs(zze.zzac())) {
                        zze(zze.zzac());
                    } else {
                        zzac();
                    }
                }
                if (zzi().zzc(str) == null && !zzi().zza(str, null, null, null)) {
                    return;
                }
                zze.zzd(zzb().currentTimeMillis());
                zzf().zza(zze, false, false);
                if (i10 != 404) {
                }
                if (!zzh().zzu()) {
                }
                if (!zze().zza(zzbh.zzcb)) {
                }
                zzac();
            }
            zzf().zzw();
        } finally {
            zzf().zzu();
        }
    }

    private final zzax zza(String str, zzax zzaxVar, zzje zzjeVar, zzah zzahVar) {
        zzjh zzjhVar;
        int i10 = 90;
        if (zzi().zzb(str) == null) {
            if (zzaxVar.zzc() == zzjh.DENIED) {
                i10 = zzaxVar.zza();
                zzahVar.zza(zzje.zza.AD_USER_DATA, i10);
            } else {
                zzahVar.zza(zzje.zza.AD_USER_DATA, zzak.FAILSAFE);
            }
            return new zzax(Boolean.FALSE, i10, Boolean.TRUE, "-");
        }
        zzjh zzc = zzaxVar.zzc();
        zzjh zzjhVar2 = zzjh.GRANTED;
        if (zzc != zzjhVar2 && zzc != (zzjhVar = zzjh.DENIED)) {
            if (zzc == zzjh.POLICY) {
                zzhl zzhlVar = this.zzb;
                zzje.zza zzaVar = zzje.zza.AD_USER_DATA;
                zzjh zza2 = zzhlVar.zza(str, zzaVar);
                if (zza2 != zzjh.UNINITIALIZED) {
                    zzahVar.zza(zzaVar, zzak.REMOTE_ENFORCED_DEFAULT);
                    zzc = zza2;
                }
            }
            zzhl zzhlVar2 = this.zzb;
            zzje.zza zzaVar2 = zzje.zza.AD_USER_DATA;
            zzje.zza zzb2 = zzhlVar2.zzb(str, zzaVar2);
            zzjh zzc2 = zzjeVar.zzc();
            boolean z10 = zzc2 == zzjhVar2 || zzc2 == zzjhVar;
            if (zzb2 == zzje.zza.AD_STORAGE && z10) {
                zzahVar.zza(zzaVar2, zzak.REMOTE_DELEGATION);
                zzc = zzc2;
            } else {
                zzahVar.zza(zzaVar2, zzak.REMOTE_DEFAULT);
                zzc = this.zzb.zzc(str, zzaVar2) ? zzjhVar2 : zzjhVar;
            }
        } else {
            i10 = zzaxVar.zza();
            zzahVar.zza(zzje.zza.AD_USER_DATA, i10);
        }
        boolean zzm = this.zzb.zzm(str);
        SortedSet<String> zzh = zzi().zzh(str);
        if (zzc != zzjh.DENIED && !zzh.isEmpty()) {
            return new zzax(Boolean.TRUE, i10, Boolean.valueOf(zzm), zzm ? TextUtils.join("", zzh) : "");
        }
        return new zzax(Boolean.FALSE, i10, Boolean.valueOf(zzm), "-");
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzb(zzg zzgVar, zzfy.zzk.zza zzaVar) {
        zzl().zzt();
        zzs();
        zzfy.zza.C0298zza zzc = zzfy.zza.zzc();
        byte[] zzav = zzgVar.zzav();
        if (zzav != null) {
            try {
                zzc = (zzfy.zza.C0298zza) zzoo.zza(zzc, zzav);
            } catch (com.google.android.gms.internal.measurement.zzkb unused) {
                zzj().zzu().zza("Failed to parse locally stored ad campaign info. appId", zzgo.zza(zzgVar.zzac()));
            }
        }
        Iterator<zzfy.zzf> it = zzaVar.zzaa().iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            zzfy.zzf next = it.next();
            if (next.zzg().equals(Constants.ScionAnalytics.EVENT_FIREBASE_CAMPAIGN)) {
                String str = (String) zzoo.zza(next, "gclid", "");
                String str2 = (String) zzoo.zza(next, "gbraid", "");
                String str3 = (String) zzoo.zza(next, "gad_source", "");
                if (!str.isEmpty() || !str2.isEmpty()) {
                    long longValue = ((Long) zzoo.zza(next, "click_timestamp", (Object) 0L)).longValue();
                    if (longValue <= 0) {
                        longValue = next.zzd();
                    }
                    if ("referrer API v2".equals(zzoo.zzb(next, "_cis"))) {
                        if (longValue > zzc.zzb()) {
                            if (str.isEmpty()) {
                                zzc.zzh();
                            } else {
                                zzc.zzf(str);
                            }
                            if (str2.isEmpty()) {
                                zzc.zzg();
                            } else {
                                zzc.zze(str2);
                            }
                            if (str3.isEmpty()) {
                                zzc.zzf();
                            } else {
                                zzc.zzd(str3);
                            }
                            zzc.zzb(longValue);
                        }
                    } else {
                        if (longValue > zzc.zza()) {
                            if (str.isEmpty()) {
                                zzc.zze();
                            } else {
                                zzc.zzc(str);
                            }
                            if (str2.isEmpty()) {
                                zzc.zzd();
                            } else {
                                zzc.zzb(str2);
                            }
                            if (str3.isEmpty()) {
                                zzc.zzc();
                            } else {
                                zzc.zza(str3);
                            }
                            zzc.zza(longValue);
                        }
                    }
                }
            }
        }
        if (!((zzfy.zza) ((com.google.android.gms.internal.measurement.zzjt) zzc.zzai())).equals(zzfy.zza.zze())) {
            zzaVar.zza((zzfy.zza) ((com.google.android.gms.internal.measurement.zzjt) zzc.zzai()));
        }
        zzgVar.zza(((zzfy.zza) ((com.google.android.gms.internal.measurement.zzjt) zzc.zzai())).zzca());
        if (zzgVar.zzas()) {
            zzf().zza(zzgVar, false, false);
        }
    }

    private static zznr zza(zznr zznrVar) {
        if (zznrVar != null) {
            if (zznrVar.zzan()) {
                return zznrVar;
            }
            throw new IllegalStateException("Component not initialized: " + String.valueOf(zznrVar.getClass()));
        }
        throw new IllegalStateException("Upload Component not created");
    }

    public static zznv zza(Context context) {
        Preconditions.checkNotNull(context);
        Preconditions.checkNotNull(context.getApplicationContext());
        if (zza == null) {
            synchronized (zznv.class) {
                if (zza == null) {
                    zza = new zznv((zzok) Preconditions.checkNotNull(new zzok(context)));
                }
            }
        }
        return zza;
    }

    private final Boolean zza(zzg zzgVar) {
        try {
            if (zzgVar.zze() != -2147483648L) {
                if (zzgVar.zze() == Wrappers.packageManager(this.zzm.zza()).getPackageInfo(zzgVar.zzac(), 0).versionCode) {
                    return Boolean.TRUE;
                }
            } else {
                String str = Wrappers.packageManager(this.zzm.zza()).getPackageInfo(zzgVar.zzac(), 0).versionName;
                String zzaf = zzgVar.zzaf();
                if (zzaf != null && zzaf.equals(str)) {
                    return Boolean.TRUE;
                }
            }
            return Boolean.FALSE;
        } catch (PackageManager.NameNotFoundException unused) {
            return null;
        }
    }

    private final String zza(zzje zzjeVar) {
        if (!zzjeVar.zzh()) {
            return null;
        }
        byte[] bArr = new byte[16];
        zzq().zzv().nextBytes(bArr);
        return String.format(Locale.US, "%032x", new BigInteger(1, bArr));
    }

    private static String zza(Map<String, List<String>> map, String str) {
        if (map == null) {
            return null;
        }
        for (Map.Entry<String, List<String>> entry : map.entrySet()) {
            if (str.equalsIgnoreCase(entry.getKey())) {
                if (entry.getValue().isEmpty()) {
                    return null;
                }
                return entry.getValue().get(0);
            }
        }
        return null;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static /* synthetic */ void zza(zznv zznvVar, zzok zzokVar) {
        zznvVar.zzl().zzt();
        zznvVar.zzl = new zzhf(zznvVar);
        zzal zzalVar = new zzal(zznvVar);
        zzalVar.zzam();
        zznvVar.zzd = zzalVar;
        zznvVar.zze().zza((zzai) Preconditions.checkNotNull(zznvVar.zzb));
        zzmw zzmwVar = new zzmw(zznvVar);
        zzmwVar.zzam();
        zznvVar.zzj = zzmwVar;
        zzt zztVar = new zzt(zznvVar);
        zztVar.zzam();
        zznvVar.zzg = zztVar;
        zzli zzliVar = new zzli(zznvVar);
        zzliVar.zzam();
        zznvVar.zzi = zzliVar;
        zznq zznqVar = new zznq(zznvVar);
        zznqVar.zzam();
        zznvVar.zzf = zznqVar;
        zznvVar.zze = new zzgy(zznvVar);
        if (zznvVar.zzs != zznvVar.zzt) {
            zznvVar.zzj().zzg().zza("Not all upload components initialized", Integer.valueOf(zznvVar.zzs), Integer.valueOf(zznvVar.zzt));
        }
        zznvVar.zzn = true;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzb(zzae zzaeVar) {
        zzo zzc = zzc((String) Preconditions.checkNotNull(zzaeVar.zza));
        if (zzc != null) {
            zzb(zzaeVar, zzc);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zzb(zzae zzaeVar, zzo zzoVar) {
        boolean z10;
        Preconditions.checkNotNull(zzaeVar);
        Preconditions.checkNotEmpty(zzaeVar.zza);
        Preconditions.checkNotNull(zzaeVar.zzb);
        Preconditions.checkNotNull(zzaeVar.zzc);
        Preconditions.checkNotEmpty(zzaeVar.zzc.zza);
        zzl().zzt();
        zzs();
        if (zzi(zzoVar)) {
            if (!zzoVar.zzh) {
                zza(zzoVar);
                return;
            }
            zzae zzaeVar2 = new zzae(zzaeVar);
            boolean z11 = false;
            zzaeVar2.zze = false;
            zzf().zzp();
            try {
                zzae zzc = zzf().zzc((String) Preconditions.checkNotNull(zzaeVar2.zza), zzaeVar2.zzc.zza);
                if (zzc != null && !zzc.zzb.equals(zzaeVar2.zzb)) {
                    zzj().zzu().zza("Updating a conditional user property with different origin. name, origin, origin (from DB)", this.zzm.zzk().zzc(zzaeVar2.zzc.zza), zzaeVar2.zzb, zzc.zzb);
                }
                if (zzc != null && (z10 = zzc.zze)) {
                    zzaeVar2.zzb = zzc.zzb;
                    zzaeVar2.zzd = zzc.zzd;
                    zzaeVar2.zzh = zzc.zzh;
                    zzaeVar2.zzf = zzc.zzf;
                    zzaeVar2.zzi = zzc.zzi;
                    zzaeVar2.zze = z10;
                    zzon zzonVar = zzaeVar2.zzc;
                    zzaeVar2.zzc = new zzon(zzonVar.zza, zzc.zzc.zzb, zzonVar.zza(), zzc.zzc.zze);
                } else if (TextUtils.isEmpty(zzaeVar2.zzf)) {
                    zzon zzonVar2 = zzaeVar2.zzc;
                    zzaeVar2.zzc = new zzon(zzonVar2.zza, zzaeVar2.zzd, zzonVar2.zza(), zzaeVar2.zzc.zze);
                    z11 = true;
                    zzaeVar2.zze = true;
                }
                if (zzaeVar2.zze) {
                    zzon zzonVar3 = zzaeVar2.zzc;
                    zzop zzopVar = new zzop((String) Preconditions.checkNotNull(zzaeVar2.zza), zzaeVar2.zzb, zzonVar3.zza, zzonVar3.zzb, Preconditions.checkNotNull(zzonVar3.zza()));
                    if (zzf().zza(zzopVar)) {
                        zzj().zzc().zza("User property updated immediately", zzaeVar2.zza, this.zzm.zzk().zzc(zzopVar.zzc), zzopVar.zze);
                    } else {
                        zzj().zzg().zza("(2)Too many active user properties, ignoring", zzgo.zza(zzaeVar2.zza), this.zzm.zzk().zzc(zzopVar.zzc), zzopVar.zze);
                    }
                    if (z11 && zzaeVar2.zzi != null) {
                        zzc(new zzbf(zzaeVar2.zzi, zzaeVar2.zzd), zzoVar);
                    }
                }
                if (zzf().zza(zzaeVar2)) {
                    zzj().zzc().zza("Conditional property added", zzaeVar2.zza, this.zzm.zzk().zzc(zzaeVar2.zzc.zza), zzaeVar2.zzc.zza());
                } else {
                    zzj().zzg().zza("Too many conditional properties, ignoring", zzgo.zza(zzaeVar2.zza), this.zzm.zzk().zzc(zzaeVar2.zzc.zza), zzaeVar2.zzc.zza());
                }
                zzf().zzw();
            } finally {
                zzf().zzu();
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(Runnable runnable) {
        zzl().zzt();
        if (this.zzq == null) {
            this.zzq = new ArrayList();
        }
        this.zzq.add(runnable);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(String str, zzfy.zzk.zza zzaVar) {
        int zza2;
        int indexOf;
        Set<String> zzg = zzi().zzg(str);
        if (zzg != null) {
            zzaVar.zzd(zzg);
        }
        if (zzi().zzp(str)) {
            zzaVar.zzj();
        }
        if (zzi().zzs(str)) {
            String zzy = zzaVar.zzy();
            if (!TextUtils.isEmpty(zzy) && (indexOf = zzy.indexOf(".")) != -1) {
                zzaVar.zzo(zzy.substring(0, indexOf));
            }
        }
        if (zzi().zzt(str) && (zza2 = zzoo.zza(zzaVar, "_id")) != -1) {
            zzaVar.zzc(zza2);
        }
        if (zzi().zzr(str)) {
            zzaVar.zzk();
        }
        if (zzi().zzo(str)) {
            zzaVar.zzh();
            if (!com.google.android.gms.internal.measurement.zznm.zza() || !zze().zza(zzbh.zzcy) || zzb(str).zzh()) {
                zzb zzbVar = this.zzae.get(str);
                if (zzbVar == null || zzbVar.zzb + zze().zzc(str, zzbh.zzaw) < zzb().elapsedRealtime()) {
                    zzbVar = new zzb();
                    this.zzae.put(str, zzbVar);
                }
                zzaVar.zzk(zzbVar.zza);
            }
        }
        if (zzi().zzq(str)) {
            zzaVar.zzr();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(zzg zzgVar, zzfy.zzk.zza zzaVar) {
        zzfy.zzo zzoVar;
        zzl().zzt();
        zzs();
        zzah zza2 = zzah.zza(zzaVar.zzv());
        String zzac = zzgVar.zzac();
        zzl().zzt();
        zzs();
        zzje zzb2 = zzb(zzac);
        int[] iArr = zzoa.zza;
        int i10 = iArr[zzb2.zzc().ordinal()];
        if (i10 == 1) {
            zza2.zza(zzje.zza.AD_STORAGE, zzak.REMOTE_ENFORCED_DEFAULT);
        } else if (i10 != 2 && i10 != 3) {
            zza2.zza(zzje.zza.AD_STORAGE, zzak.FAILSAFE);
        } else {
            zza2.zza(zzje.zza.AD_STORAGE, zzb2.zza());
        }
        int i11 = iArr[zzb2.zzd().ordinal()];
        if (i11 == 1) {
            zza2.zza(zzje.zza.ANALYTICS_STORAGE, zzak.REMOTE_ENFORCED_DEFAULT);
        } else if (i11 != 2 && i11 != 3) {
            zza2.zza(zzje.zza.ANALYTICS_STORAGE, zzak.FAILSAFE);
        } else {
            zza2.zza(zzje.zza.ANALYTICS_STORAGE, zzb2.zza());
        }
        String zzac2 = zzgVar.zzac();
        zzl().zzt();
        zzs();
        zzax zza3 = zza(zzac2, zzd(zzac2), zzb(zzac2), zza2);
        zzaVar.zzb(((Boolean) Preconditions.checkNotNull(zza3.zzd())).booleanValue());
        if (!TextUtils.isEmpty(zza3.zze())) {
            zzaVar.zzh(zza3.zze());
        }
        zzl().zzt();
        zzs();
        Iterator<zzfy.zzo> it = zzaVar.zzab().iterator();
        while (true) {
            if (it.hasNext()) {
                zzoVar = it.next();
                if ("_npa".equals(zzoVar.zzg())) {
                    break;
                }
            } else {
                zzoVar = null;
                break;
            }
        }
        if (zzoVar != null) {
            zzje.zza zzaVar2 = zzje.zza.AD_PERSONALIZATION;
            if (zza2.zza(zzaVar2) == zzak.UNSET) {
                zzop zze = zzf().zze(zzgVar.zzac(), "_npa");
                if (zze != null) {
                    if ("tcf".equals(zze.zzb)) {
                        zza2.zza(zzaVar2, zzak.TCF);
                    } else if ("app".equals(zze.zzb)) {
                        zza2.zza(zzaVar2, zzak.API);
                    } else {
                        zza2.zza(zzaVar2, zzak.MANIFEST);
                    }
                } else {
                    Boolean zzx = zzgVar.zzx();
                    if (zzx != null && ((zzx != Boolean.TRUE || zzoVar.zzc() == 1) && (zzx != Boolean.FALSE || zzoVar.zzc() == 0))) {
                        zza2.zza(zzaVar2, zzak.MANIFEST);
                    } else {
                        zza2.zza(zzaVar2, zzak.API);
                    }
                }
            }
        } else {
            int zza4 = zza(zzgVar.zzac(), zza2);
            zzaVar.zza((zzfy.zzo) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzo.zze().zza("_npa").zzb(zzb().currentTimeMillis()).zza(zza4).zzai()));
            zzj().zzp().zza("Setting user property", "non_personalized_ads(_npa)", Integer.valueOf(zza4));
        }
        zzaVar.zzf(zza2.toString());
        boolean zzm = this.zzb.zzm(zzgVar.zzac());
        List<zzfy.zzf> zzaa = zzaVar.zzaa();
        int i12 = 0;
        for (int i13 = 0; i13 < zzaa.size(); i13++) {
            if ("_tcf".equals(zzaa.get(i13).zzg())) {
                zzfy.zzf.zza zzcd = zzaa.get(i13).zzcd();
                List<zzfy.zzh> zzf = zzcd.zzf();
                while (true) {
                    if (i12 >= zzf.size()) {
                        break;
                    }
                    if ("_tcfd".equals(zzf.get(i12).zzg())) {
                        zzcd.zza(i12, zzfy.zzh.zze().zza("_tcfd").zzb(zznm.zza(zzf.get(i12).zzh(), zzm)));
                        break;
                    }
                    i12++;
                }
                zzaVar.zza(i13, zzcd);
                return;
            }
        }
    }

    private static void zza(zzfy.zzf.zza zzaVar, int i10, String str) {
        List<zzfy.zzh> zzf = zzaVar.zzf();
        for (int i11 = 0; i11 < zzf.size(); i11++) {
            if ("_err".equals(zzf.get(i11).zzg())) {
                return;
            }
        }
        zzaVar.zza((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzh.zze().zza("_err").zza(Long.valueOf(i10).longValue()).zzai())).zza((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzh.zze().zza("_ev").zzb(str).zzai()));
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(zzbf zzbfVar, zzo zzoVar) {
        zzbf zzbfVar2;
        List<zzae> zza2;
        List<zzae> zza3;
        List<zzae> zza4;
        String str;
        Preconditions.checkNotNull(zzoVar);
        Preconditions.checkNotEmpty(zzoVar.zza);
        zzl().zzt();
        zzs();
        String str2 = zzoVar.zza;
        long j10 = zzbfVar.zzd;
        zzgs zza5 = zzgs.zza(zzbfVar);
        zzl().zzt();
        zzos.zza((this.zzaf == null || (str = this.zzag) == null || !str.equals(str2)) ? null : this.zzaf, zza5.zzc, false);
        zzbf zza6 = zza5.zza();
        zzp();
        if (zzoo.zza(zza6, zzoVar)) {
            if (!zzoVar.zzh) {
                zza(zzoVar);
                return;
            }
            List<String> list = zzoVar.zzs;
            if (list == null) {
                zzbfVar2 = zza6;
            } else if (list.contains(zza6.zza)) {
                Bundle zzb2 = zza6.zzb.zzb();
                zzb2.putLong("ga_safelisted", 1L);
                zzbfVar2 = new zzbf(zza6.zza, new zzbe(zzb2), zza6.zzc, zza6.zzd);
            } else {
                zzj().zzc().zza("Dropping non-safelisted event. appId, event name, origin", str2, zza6.zza, zza6.zzc);
                return;
            }
            zzf().zzp();
            try {
                zzal zzf = zzf();
                Preconditions.checkNotEmpty(str2);
                zzf.zzt();
                zzf.zzal();
                if (j10 < 0) {
                    zzf.zzj().zzu().zza("Invalid time querying timed out conditional properties", zzgo.zza(str2), Long.valueOf(j10));
                    zza2 = Collections.emptyList();
                } else {
                    zza2 = zzf.zza("active=0 and app_id=? and abs(? - creation_timestamp) > trigger_timeout", new String[]{str2, String.valueOf(j10)});
                }
                for (zzae zzaeVar : zza2) {
                    if (zzaeVar != null) {
                        zzj().zzp().zza("User property timed out", zzaeVar.zza, this.zzm.zzk().zzc(zzaeVar.zzc.zza), zzaeVar.zzc.zza());
                        if (zzaeVar.zzg != null) {
                            zzc(new zzbf(zzaeVar.zzg, j10), zzoVar);
                        }
                        zzf().zza(str2, zzaeVar.zzc.zza);
                    }
                }
                zzal zzf2 = zzf();
                Preconditions.checkNotEmpty(str2);
                zzf2.zzt();
                zzf2.zzal();
                if (j10 < 0) {
                    zzf2.zzj().zzu().zza("Invalid time querying expired conditional properties", zzgo.zza(str2), Long.valueOf(j10));
                    zza3 = Collections.emptyList();
                } else {
                    zza3 = zzf2.zza("active<>0 and app_id=? and abs(? - triggered_timestamp) > time_to_live", new String[]{str2, String.valueOf(j10)});
                }
                ArrayList arrayList = new ArrayList(zza3.size());
                for (zzae zzaeVar2 : zza3) {
                    if (zzaeVar2 != null) {
                        zzj().zzp().zza("User property expired", zzaeVar2.zza, this.zzm.zzk().zzc(zzaeVar2.zzc.zza), zzaeVar2.zzc.zza());
                        zzf().zzh(str2, zzaeVar2.zzc.zza);
                        zzbf zzbfVar3 = zzaeVar2.zzk;
                        if (zzbfVar3 != null) {
                            arrayList.add(zzbfVar3);
                        }
                        zzf().zza(str2, zzaeVar2.zzc.zza);
                    }
                }
                int size = arrayList.size();
                int i10 = 0;
                while (i10 < size) {
                    Object obj = arrayList.get(i10);
                    i10++;
                    zzc(new zzbf((zzbf) obj, j10), zzoVar);
                }
                zzal zzf3 = zzf();
                String str3 = zzbfVar2.zza;
                Preconditions.checkNotEmpty(str2);
                Preconditions.checkNotEmpty(str3);
                zzf3.zzt();
                zzf3.zzal();
                if (j10 < 0) {
                    zzf3.zzj().zzu().zza("Invalid time querying triggered conditional properties", zzgo.zza(str2), zzf3.zzi().zza(str3), Long.valueOf(j10));
                    zza4 = Collections.emptyList();
                } else {
                    zza4 = zzf3.zza("active=0 and app_id=? and trigger_event_name=? and abs(? - creation_timestamp) <= trigger_timeout", new String[]{str2, str3, String.valueOf(j10)});
                }
                ArrayList arrayList2 = new ArrayList(zza4.size());
                for (zzae zzaeVar3 : zza4) {
                    if (zzaeVar3 != null) {
                        zzon zzonVar = zzaeVar3.zzc;
                        zzop zzopVar = new zzop((String) Preconditions.checkNotNull(zzaeVar3.zza), zzaeVar3.zzb, zzonVar.zza, j10, Preconditions.checkNotNull(zzonVar.zza()));
                        if (zzf().zza(zzopVar)) {
                            zzj().zzp().zza("User property triggered", zzaeVar3.zza, this.zzm.zzk().zzc(zzopVar.zzc), zzopVar.zze);
                        } else {
                            zzj().zzg().zza("Too many active user properties, ignoring", zzgo.zza(zzaeVar3.zza), this.zzm.zzk().zzc(zzopVar.zzc), zzopVar.zze);
                        }
                        zzbf zzbfVar4 = zzaeVar3.zzi;
                        if (zzbfVar4 != null) {
                            arrayList2.add(zzbfVar4);
                        }
                        zzaeVar3.zzc = new zzon(zzopVar);
                        zzaeVar3.zze = true;
                        zzf().zza(zzaeVar3);
                    }
                }
                zzc(zzbfVar2, zzoVar);
                int size2 = arrayList2.size();
                int i11 = 0;
                while (i11 < size2) {
                    Object obj2 = arrayList2.get(i11);
                    i11++;
                    zzc(new zzbf((zzbf) obj2, j10), zzoVar);
                }
                zzf().zzw();
            } finally {
                zzf().zzu();
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(zzbf zzbfVar, String str) {
        zzg zze = zzf().zze(str);
        if (zze != null && !TextUtils.isEmpty(zze.zzaf())) {
            Boolean zza2 = zza(zze);
            if (zza2 == null) {
                if (!"_ui".equals(zzbfVar.zza)) {
                    zzj().zzu().zza("Could not find package. appId", zzgo.zza(str));
                }
            } else if (!zza2.booleanValue()) {
                zzj().zzg().zza("App version does not match; dropping event. appId", zzgo.zza(str));
                return;
            }
            zzb(zzbfVar, new zzo(str, zze.zzah(), zze.zzaf(), zze.zze(), zze.zzae(), zze.zzq(), zze.zzn(), (String) null, zze.zzar(), false, zze.zzag(), zze.zzd(), 0L, 0, zze.zzaq(), false, zze.zzaa(), zze.zzx(), zze.zzo(), zze.zzan(), (String) null, zzb(str).zzf(), "", (String) null, zze.zzat(), zze.zzw(), zzb(str).zza(), zzd(str).zzf(), zze.zza(), zze.zzf(), zze.zzam(), zze.zzak()));
            return;
        }
        zzj().zzc().zza("No app data available; dropping event", str);
    }

    private final void zza(zzfy.zzk.zza zzaVar, long j10, boolean z10) {
        zzop zzopVar;
        boolean z11;
        String str = z10 ? "_se" : "_lte";
        zzop zze = zzf().zze(zzaVar.zzt(), str);
        if (zze != null && zze.zze != null) {
            zzopVar = new zzop(zzaVar.zzt(), "auto", str, zzb().currentTimeMillis(), Long.valueOf(((Long) zze.zze).longValue() + j10));
        } else {
            zzopVar = new zzop(zzaVar.zzt(), "auto", str, zzb().currentTimeMillis(), Long.valueOf(j10));
        }
        zzfy.zzo zzoVar = (zzfy.zzo) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzo.zze().zza(str).zzb(zzb().currentTimeMillis()).zza(((Long) zzopVar.zze).longValue()).zzai());
        int zza2 = zzoo.zza(zzaVar, str);
        if (zza2 >= 0) {
            zzaVar.zza(zza2, zzoVar);
            z11 = true;
        } else {
            z11 = false;
        }
        if (!z11) {
            zzaVar.zza(zzoVar);
        }
        if (j10 > 0) {
            zzf().zza(zzopVar);
            zzj().zzp().zza("Updated engagement user property. scope, value", z10 ? "session-scoped" : "lifetime", zzopVar.zze);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(boolean z10) {
        zzac();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x0097, code lost:
    
        r15.zzj.zzc.zza(zzb().currentTimeMillis());
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void zza(boolean z10, int i10, Throwable th2, byte[] bArr, String str, List<Pair<zzfy.zzj, zznw>> list) {
        byte[] bArr2;
        zzal zzf;
        long longValue;
        zzl().zzt();
        zzs();
        if (bArr == null) {
            try {
                bArr2 = new byte[0];
            } finally {
                this.zzv = false;
                zzaa();
            }
        } else {
            bArr2 = bArr;
        }
        List<Long> list2 = (List) Preconditions.checkNotNull(this.zzz);
        this.zzz = null;
        boolean z11 = true;
        try {
            if (z10 && ((i10 != 200 && i10 != 204) || th2 != null)) {
                if (zzpb.zza() && zze().zza(zzbh.zzcf)) {
                    String str2 = new String(bArr2, StandardCharsets.UTF_8);
                    zzj().zzv().zza("Network upload failed. Will retry later. code, error", Integer.valueOf(i10), th2, str2.substring(0, Math.min(32, str2.length())));
                } else {
                    zzj().zzp().zza("Network upload failed. Will retry later. code, error", Integer.valueOf(i10), th2);
                }
                this.zzj.zze.zza(zzb().currentTimeMillis());
                if (i10 != 503 && i10 != 429) {
                    z11 = false;
                }
                zzf().zza(list2);
                zzac();
                return;
            }
            if (zze().zza(zzbh.zzcb)) {
                for (Pair<zzfy.zzj, zznw> pair : list) {
                    zzfy.zzj zzjVar = (zzfy.zzj) pair.first;
                    zznw zznwVar = (zznw) pair.second;
                    zzf().zza(str, zzjVar, zznwVar.zzb(), zznwVar.zzc(), zznwVar.zza());
                }
            }
            for (Long l10 : list2) {
                try {
                    zzf = zzf();
                    longValue = l10.longValue();
                    zzf.zzt();
                    zzf.zzal();
                    try {
                    } catch (SQLiteException e10) {
                        zzf.zzj().zzg().zza("Failed to delete a bundle in a queue table", e10);
                        throw e10;
                        break;
                    }
                } catch (SQLiteException e11) {
                    List<Long> list3 = this.zzaa;
                    if (list3 == null || !list3.contains(l10)) {
                        throw e11;
                    }
                }
                if (zzf.e_().delete("queue", "rowid=?", new String[]{String.valueOf(longValue)}) != 1) {
                    throw new SQLiteException("Deleted fewer rows from queue than expected");
                    break;
                }
            }
            zzf().zzw();
            zzf().zzu();
            this.zzaa = null;
            if (zzh().zzu() && zzad()) {
                zzw();
            } else if (zze().zza(zzbh.zzcb) && zzh().zzu() && zzf().zzs(str)) {
                zze(str);
            } else {
                this.zzab = -1L;
                zzac();
            }
            this.zzp = 0L;
            return;
        } catch (Throwable th3) {
            zzf().zzu();
            throw th3;
        }
        zzj().zzp().zza("Network upload successful with code", Integer.valueOf(i10));
        if (z10) {
            try {
                this.zzj.zzd.zza(zzb().currentTimeMillis());
            } catch (SQLiteException e12) {
                zzj().zzg().zza("Database error while trying to delete uploaded bundles", e12);
                this.zzp = zzb().elapsedRealtime();
                zzj().zzp().zza("Disable upload, time", Long.valueOf(this.zzp));
            }
        }
        this.zzj.zze.zza(0L);
        zzac();
        if (z10) {
            zzj().zzp().zza("Successful upload. Got network response. code, size", Integer.valueOf(i10), Integer.valueOf(bArr2.length));
        } else {
            zzj().zzp().zza("Purged empty bundles");
        }
        zzf().zzp();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r8v13, types: [java.lang.String] */
    public final void zza(String str, int i10, Throwable th2, byte[] bArr, zzoj zzojVar) {
        zzl().zzt();
        zzs();
        if (bArr == null) {
            try {
                bArr = new byte[0];
            } catch (Throwable th3) {
                this.zzv = false;
                zzaa();
                throw th3;
            }
        }
        if ((i10 == 200 || i10 == 204) && th2 == null) {
            if (zzojVar != null) {
                zzal zzf = zzf();
                Long valueOf = Long.valueOf(zzojVar.zza());
                zzf.zzt();
                zzf.zzal();
                Preconditions.checkNotNull(valueOf);
                if (!zzpu.zza() || zzf.zze().zza(zzbh.zzcb)) {
                    try {
                        if (zzf.e_().delete("upload_queue", "rowid=?", new String[]{String.valueOf(valueOf)}) != 1) {
                            zzf.zzj().zzu().zza("Deleted fewer rows from upload_queue than expected");
                        }
                    } catch (SQLiteException e10) {
                        zzf.zzj().zzg().zza("Failed to delete a MeasurementBatch in a upload_queue table", e10);
                        throw e10;
                    }
                }
            }
            zzj().zzp().zza("Successfully uploaded batch from upload queue. appId, status", str, Integer.valueOf(i10));
            if (zze().zza(zzbh.zzcb) && zzh().zzu() && zzf().zzs(str)) {
                zze(str);
            } else {
                zzac();
            }
        } else {
            String str2 = new String(bArr, StandardCharsets.UTF_8);
            ?? substring = str2.substring(0, Math.min(32, str2.length()));
            zzgq zzv = zzj().zzv();
            Integer valueOf2 = Integer.valueOf(i10);
            if (th2 == null) {
                th2 = substring;
            }
            zzv.zza("Network upload failed. Will retry later. appId, status, error", str, valueOf2, th2);
            if (zzojVar != null) {
                zzf().zza(Long.valueOf(zzojVar.zza()));
            }
            zzac();
        }
        this.zzv = false;
        zzaa();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(zzae zzaeVar) {
        zzo zzc = zzc((String) Preconditions.checkNotNull(zzaeVar.zza));
        if (zzc != null) {
            zza(zzaeVar, zzc);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(zzae zzaeVar, zzo zzoVar) {
        Preconditions.checkNotNull(zzaeVar);
        Preconditions.checkNotEmpty(zzaeVar.zza);
        Preconditions.checkNotNull(zzaeVar.zzc);
        Preconditions.checkNotEmpty(zzaeVar.zzc.zza);
        zzl().zzt();
        zzs();
        if (zzi(zzoVar)) {
            if (!zzoVar.zzh) {
                zza(zzoVar);
                return;
            }
            zzf().zzp();
            try {
                zza(zzoVar);
                String str = (String) Preconditions.checkNotNull(zzaeVar.zza);
                zzae zzc = zzf().zzc(str, zzaeVar.zzc.zza);
                if (zzc != null) {
                    zzj().zzc().zza("Removing conditional user property", zzaeVar.zza, this.zzm.zzk().zzc(zzaeVar.zzc.zza));
                    zzf().zza(str, zzaeVar.zzc.zza);
                    if (zzc.zze) {
                        zzf().zzh(str, zzaeVar.zzc.zza);
                    }
                    zzbf zzbfVar = zzaeVar.zzk;
                    if (zzbfVar != null) {
                        zzbe zzbeVar = zzbfVar.zzb;
                        zzc((zzbf) Preconditions.checkNotNull(zzq().zza(str, ((zzbf) Preconditions.checkNotNull(zzaeVar.zzk)).zza, zzbeVar != null ? zzbeVar.zzb() : null, zzc.zzb, zzaeVar.zzk.zzd, true, true)), zzoVar);
                    }
                } else {
                    zzj().zzu().zza("Conditional user property doesn't exist", zzgo.zza(zzaeVar.zza), this.zzm.zzk().zzc(zzaeVar.zzc.zza));
                }
                zzf().zzw();
            } finally {
                zzf().zzu();
            }
        }
    }

    private static void zza(zzfy.zzf.zza zzaVar, String str) {
        List<zzfy.zzh> zzf = zzaVar.zzf();
        for (int i10 = 0; i10 < zzf.size(); i10++) {
            if (str.equals(zzf.get(i10).zzg())) {
                zzaVar.zza(i10);
                return;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(String str, zzo zzoVar) {
        zzl().zzt();
        zzs();
        if (zzi(zzoVar)) {
            if (!zzoVar.zzh) {
                zza(zzoVar);
                return;
            }
            Boolean zzh = zzh(zzoVar);
            if ("_npa".equals(str) && zzh != null) {
                zzj().zzc().zza("Falling back to manifest metadata value for ad personalization");
                zza(new zzon("_npa", zzb().currentTimeMillis(), Long.valueOf(zzh.booleanValue() ? 1L : 0L), "auto"), zzoVar);
                return;
            }
            zzj().zzc().zza("Removing user property", this.zzm.zzk().zzc(str));
            zzf().zzp();
            try {
                zza(zzoVar);
                if ("_id".equals(str)) {
                    zzf().zzh((String) Preconditions.checkNotNull(zzoVar.zza), "_lair");
                }
                zzf().zzh((String) Preconditions.checkNotNull(zzoVar.zza), str);
                zzf().zzw();
                zzj().zzc().zza("User property removed", this.zzm.zzk().zzc(str));
            } finally {
                zzf().zzu();
            }
        }
    }

    public final void zza(String str, zzlk zzlkVar) {
        zzl().zzt();
        String str2 = this.zzag;
        if (str2 == null || str2.equals(str) || zzlkVar != null) {
            this.zzag = str;
            this.zzaf = zzlkVar;
        }
    }

    private final void zza(List<Long> list) {
        Preconditions.checkArgument(!list.isEmpty());
        if (this.zzz != null) {
            zzj().zzg().zza("Set uploading progress before finishing the previous upload");
        } else {
            this.zzz = new ArrayList(list);
        }
    }

    private final void zza(String str, zzje zzjeVar) {
        zzl().zzt();
        zzs();
        this.zzac.put(str, zzjeVar);
        zzf().zzb(str, zzjeVar);
    }

    private final void zza(String str, boolean z10, Long l10, Long l11) {
        zzg zze = zzf().zze(str);
        if (zze != null) {
            zze.zzd(z10);
            zze.zza(l10);
            zze.zzb(l11);
            if (zze.zzas()) {
                zzf().zza(zze, false, false);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void zza(zzon zzonVar, zzo zzoVar) {
        zzop zze;
        long j10;
        zzl().zzt();
        zzs();
        if (zzi(zzoVar)) {
            if (!zzoVar.zzh) {
                zza(zzoVar);
                return;
            }
            int zzb2 = zzq().zzb(zzonVar.zza);
            int i10 = 0;
            if (zzb2 != 0) {
                zzq();
                String str = zzonVar.zza;
                zze();
                String zza2 = zzos.zza(str, 24, true);
                String str2 = zzonVar.zza;
                int length = str2 != null ? str2.length() : 0;
                zzq();
                zzos.zza(this.zzah, zzoVar.zza, zzb2, "_ev", zza2, length);
                return;
            }
            int zza3 = zzq().zza(zzonVar.zza, zzonVar.zza());
            if (zza3 != 0) {
                zzq();
                String str3 = zzonVar.zza;
                zze();
                String zza4 = zzos.zza(str3, 24, true);
                Object zza5 = zzonVar.zza();
                if (zza5 != null && ((zza5 instanceof String) || (zza5 instanceof CharSequence))) {
                    i10 = String.valueOf(zza5).length();
                }
                zzq();
                zzos.zza(this.zzah, zzoVar.zza, zza3, "_ev", zza4, i10);
                return;
            }
            Object zzc = zzq().zzc(zzonVar.zza, zzonVar.zza());
            if (zzc == null) {
                return;
            }
            if ("_sid".equals(zzonVar.zza)) {
                long j11 = zzonVar.zzb;
                String str4 = zzonVar.zze;
                String str5 = (String) Preconditions.checkNotNull(zzoVar.zza);
                zzop zze2 = zzf().zze(str5, "_sno");
                if (zze2 != null) {
                    Object obj = zze2.zze;
                    if (obj instanceof Long) {
                        j10 = ((Long) obj).longValue();
                        zza(new zzon("_sno", j11, Long.valueOf(j10 + 1), str4), zzoVar);
                    }
                }
                if (zze2 != null) {
                    zzj().zzu().zza("Retrieved last session number from database does not contain a valid (long) value", zze2.zze);
                }
                zzbb zzd = zzf().zzd(str5, "_s");
                if (zzd != null) {
                    j10 = zzd.zzc;
                    zzj().zzp().zza("Backfill the session number. Last used session number", Long.valueOf(j10));
                } else {
                    j10 = 0;
                }
                zza(new zzon("_sno", j11, Long.valueOf(j10 + 1), str4), zzoVar);
            }
            zzop zzopVar = new zzop((String) Preconditions.checkNotNull(zzoVar.zza), (String) Preconditions.checkNotNull(zzonVar.zze), zzonVar.zza, zzonVar.zzb, zzc);
            zzj().zzp().zza("Setting user property", this.zzm.zzk().zzc(zzopVar.zzc), zzc);
            zzf().zzp();
            try {
                if ("_id".equals(zzopVar.zzc) && (zze = zzf().zze(zzoVar.zza, "_id")) != null && !zzopVar.zze.equals(zze.zze)) {
                    zzf().zzh(zzoVar.zza, "_lair");
                }
                zza(zzoVar);
                boolean zza6 = zzf().zza(zzopVar);
                if ("_sid".equals(zzonVar.zza)) {
                    long zza7 = zzp().zza(zzoVar.zzv);
                    zzg zze3 = zzf().zze(zzoVar.zza);
                    if (zze3 != null) {
                        zze3.zzs(zza7);
                        if (zze3.zzas()) {
                            zzf().zza(zze3, false, false);
                        }
                    }
                }
                zzf().zzw();
                if (!zza6) {
                    zzj().zzg().zza("Too many unique user properties are set. Ignoring user property", this.zzm.zzk().zzc(zzopVar.zzc), zzopVar.zze);
                    zzq();
                    zzos.zza(this.zzah, zzoVar.zza, 9, (String) null, (String) null, 0);
                }
            } finally {
                zzf().zzu();
            }
        }
    }

    private final void zza(String str, zzfy.zzh.zza zzaVar, Bundle bundle, String str2) {
        int zzb2;
        List listOf = CollectionUtils.listOf((Object[]) new String[]{"_o", "_sn", "_sc", "_si"});
        if (!zzos.zzg(zzaVar.zzf()) && !zzos.zzg(str)) {
            zzb2 = zze().zza(str2, true);
        } else {
            zzb2 = zze().zzb(str2, true);
        }
        long j10 = zzb2;
        long codePointCount = zzaVar.zzg().codePointCount(0, zzaVar.zzg().length());
        zzq();
        String zzf = zzaVar.zzf();
        zze();
        String zza2 = zzos.zza(zzf, 40, true);
        if (codePointCount <= j10 || listOf.contains(zzaVar.zzf())) {
            return;
        }
        if ("_ev".equals(zzaVar.zzf())) {
            zzq();
            bundle.putString("_ev", zzos.zza(zzaVar.zzg(), zze().zzb(str2, true), true));
            return;
        }
        zzj().zzv().zza("Param value is too long; discarded. Name, value length", zza2, Long.valueOf(codePointCount));
        if (bundle.getLong("_err") == 0) {
            bundle.putLong("_err", 4L);
            if (bundle.getString("_ev") == null) {
                bundle.putString("_ev", zza2);
                bundle.putLong("_el", codePointCount);
            }
        }
        bundle.remove(zzaVar.zzf());
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:127:0x05a2 A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:156:0x066b A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:167:0x0714 A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:210:0x082c  */
    /* JADX WARN: Removed duplicated region for block: B:214:0x06b5 A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:21:0x0237 A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:241:0x03c2  */
    /* JADX WARN: Removed duplicated region for block: B:242:0x03be  */
    /* JADX WARN: Removed duplicated region for block: B:26:0x0243 A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:562:0x10c6 A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:564:0x10ca A[Catch: all -> 0x11e8, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:580:0x11d0 A[Catch: all -> 0x11e8, TRY_ENTER, TRY_LEAVE, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:652:0x11e4 A[Catch: all -> 0x11e8, TRY_ENTER, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:654:? A[Catch: all -> 0x11e8, SYNTHETIC, TRY_LEAVE, TryCatch #5 {all -> 0x11e8, blocks: (B:3:0x000d, B:18:0x0071, B:19:0x0233, B:21:0x0237, B:26:0x0243, B:27:0x0256, B:30:0x026e, B:33:0x0294, B:35:0x02c9, B:40:0x02df, B:42:0x02e9, B:45:0x084c, B:47:0x0311, B:49:0x031f, B:52:0x033b, B:54:0x0341, B:56:0x0353, B:58:0x0361, B:60:0x0371, B:62:0x037e, B:67:0x0383, B:69:0x0399, B:78:0x03d2, B:81:0x03dc, B:83:0x03ea, B:85:0x0435, B:86:0x0409, B:88:0x0419, B:95:0x0442, B:97:0x0470, B:98:0x049c, B:100:0x04d2, B:101:0x04d8, B:104:0x04e4, B:106:0x051b, B:107:0x0536, B:109:0x053c, B:111:0x054a, B:113:0x055e, B:114:0x0553, B:122:0x0565, B:124:0x056b, B:125:0x0589, B:127:0x05a2, B:128:0x05ae, B:131:0x05b8, B:135:0x05db, B:136:0x05ca, B:144:0x05e1, B:146:0x05ed, B:148:0x05f9, B:153:0x0646, B:154:0x0661, B:156:0x066b, B:159:0x0680, B:161:0x0693, B:163:0x06a1, B:165:0x070e, B:167:0x0714, B:168:0x0720, B:170:0x0726, B:172:0x0736, B:174:0x0740, B:175:0x0753, B:177:0x0759, B:178:0x0774, B:180:0x077a, B:182:0x0798, B:184:0x07a3, B:186:0x07ca, B:187:0x07a9, B:189:0x07b7, B:193:0x07d6, B:194:0x07f0, B:196:0x07f6, B:199:0x080a, B:204:0x0819, B:206:0x0820, B:208:0x0832, B:214:0x06b5, B:216:0x06c3, B:219:0x06d8, B:221:0x06eb, B:223:0x06f9, B:225:0x0618, B:229:0x062c, B:231:0x0632, B:233:0x063d, B:243:0x03af, B:250:0x0862, B:252:0x0870, B:254:0x0879, B:256:0x08a9, B:257:0x0881, B:259:0x088a, B:261:0x0890, B:263:0x089c, B:265:0x08a4, B:272:0x08ac, B:273:0x08b8, B:275:0x08be, B:281:0x08d7, B:282:0x08e2, B:286:0x08ef, B:287:0x0914, B:289:0x092e, B:290:0x0943, B:292:0x0949, B:294:0x0955, B:296:0x096f, B:297:0x0981, B:298:0x0984, B:299:0x0993, B:301:0x0999, B:303:0x09a9, B:304:0x09b0, B:306:0x09bc, B:308:0x09c3, B:311:0x09c6, B:313:0x09d1, B:315:0x09dd, B:317:0x0a16, B:319:0x0a1c, B:320:0x0a43, B:322:0x0a49, B:323:0x0a52, B:325:0x0a58, B:326:0x0a2a, B:328:0x0a30, B:330:0x0a36, B:331:0x0a5e, B:333:0x0a64, B:335:0x0a76, B:337:0x0a85, B:339:0x0a95, B:342:0x0a9e, B:344:0x0aa4, B:345:0x0ab6, B:347:0x0abc, B:352:0x0ad1, B:354:0x0ae9, B:356:0x0afb, B:358:0x0b22, B:359:0x0b3f, B:361:0x0b51, B:362:0x0b74, B:364:0x0b9f, B:366:0x0bce, B:368:0x0be0, B:369:0x0c03, B:371:0x0c2e, B:373:0x0c5b, B:375:0x0c66, B:381:0x0c6a, B:383:0x0c70, B:385:0x0c7c, B:388:0x0ca9, B:389:0x0cdc, B:391:0x0cec, B:392:0x0cff, B:394:0x0d05, B:397:0x0d1d, B:399:0x0d38, B:401:0x0d4e, B:403:0x0d53, B:405:0x0d57, B:407:0x0d5b, B:409:0x0d65, B:410:0x0d6d, B:412:0x0d71, B:414:0x0d77, B:415:0x0d85, B:416:0x0d90, B:419:0x0fd9, B:420:0x0d9c, B:424:0x0dce, B:425:0x0dd6, B:427:0x0ddc, B:431:0x0dee, B:433:0x0dfc, B:435:0x0e00, B:437:0x0e0a, B:439:0x0e0e, B:443:0x0e24, B:445:0x0e3a, B:446:0x0e5f, B:448:0x0e6b, B:450:0x0e81, B:451:0x0ec0, B:454:0x0ed8, B:456:0x0edf, B:458:0x0ef0, B:460:0x0ef4, B:462:0x0ef8, B:464:0x0efc, B:465:0x0f08, B:466:0x0f0d, B:468:0x0f13, B:470:0x0f33, B:471:0x0f3c, B:472:0x0fd6, B:474:0x0f53, B:476:0x0f5b, B:479:0x0f77, B:481:0x0fa1, B:482:0x0fac, B:484:0x0fbe, B:486:0x0fc8, B:487:0x0f63, B:494:0x0fe6, B:496:0x0ff3, B:497:0x0ffa, B:498:0x1002, B:500:0x1008, B:503:0x1020, B:505:0x1030, B:506:0x10d5, B:508:0x10db, B:510:0x10eb, B:513:0x10f2, B:514:0x1123, B:515:0x10fa, B:517:0x1106, B:518:0x110c, B:519:0x1134, B:520:0x114b, B:523:0x1153, B:525:0x1158, B:528:0x1168, B:530:0x1182, B:531:0x119b, B:533:0x11a3, B:534:0x11c0, B:541:0x11af, B:542:0x1049, B:544:0x104f, B:546:0x1059, B:547:0x1060, B:552:0x1070, B:553:0x1077, B:555:0x107d, B:557:0x1089, B:559:0x1096, B:560:0x10aa, B:562:0x10c6, B:563:0x10cd, B:564:0x10ca, B:565:0x10a7, B:566:0x1074, B:568:0x105d, B:571:0x0cb1, B:572:0x0940, B:573:0x08f4, B:575:0x08fa, B:580:0x11d0, B:590:0x00ff, B:603:0x019c, B:616:0x01d3, B:613:0x01f1, B:626:0x0208, B:632:0x0230, B:652:0x11e4, B:653:0x11e7, B:643:0x00ba, B:593:0x0108), top: B:2:0x000d, inners: #4, #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:74:0x03bc  */
    /* JADX WARN: Removed duplicated region for block: B:76:0x03c1  */
    /* JADX WARN: Type inference failed for: r5v154 */
    /* JADX WARN: Type inference failed for: r5v156 */
    /* JADX WARN: Type inference failed for: r5v162, types: [android.database.Cursor] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final boolean zza(String str, long j10) {
        Throwable th2;
        String str2;
        Object obj;
        Cursor cursor;
        List<zzfy.zzf> list;
        boolean z10;
        boolean z11;
        int i10;
        boolean z12;
        zzfy.zzk.zza zzaVar;
        zza zzaVar2;
        String zzab;
        boolean z13;
        long j11;
        SecureRandom secureRandom;
        zza zzaVar3;
        HashMap hashMap;
        long zza2;
        HashMap hashMap2;
        zzfy.zzk.zza zzaVar4;
        boolean z14;
        String str3;
        String str4;
        String str5;
        String str6;
        String str7;
        zzfy.zzk.zza zzaVar5;
        int i11;
        zzfy.zzf.zza zzaVar6;
        zzfy.zzk.zza zzaVar7;
        zzfy.zzf.zza zzaVar8;
        zzfy.zzf.zza zzaVar9;
        zzfy.zzf.zza zzaVar10;
        String str8;
        int i12;
        zzfy.zzf.zza zzaVar11;
        zzfy.zzf.zza zzaVar12;
        zzfy.zzf.zza zzaVar13;
        boolean z15;
        String str9;
        char c10;
        boolean z16;
        SQLiteDatabase e_;
        Cursor cursor2;
        String string;
        String str10;
        String[] strArr;
        String str11 = "_ai";
        String str12 = "items";
        zzf().zzp();
        try {
            Cursor cursor3 = null;
            zza zzaVar14 = new zza();
            zzal zzf = zzf();
            long j12 = this.zzab;
            Preconditions.checkNotNull(zzaVar14);
            zzf.zzt();
            zzf.zzal();
            try {
                try {
                    e_ = zzf.e_();
                    cursor2 = 2;
                    try {
                    } catch (SQLiteException e10) {
                        e = e10;
                        str2 = str;
                    }
                } catch (Throwable th3) {
                    th2 = th3;
                    if (cursor3 == null) {
                        cursor3.close();
                        throw th2;
                    }
                    throw th2;
                }
            } catch (SQLiteException e11) {
                str2 = str;
                obj = e11;
                cursor = null;
            } catch (Throwable th4) {
                th2 = th4;
                cursor3 = null;
                if (cursor3 == null) {
                }
            }
            if (TextUtils.isEmpty(str)) {
                cursor2 = e_.rawQuery("select app_id, metadata_fingerprint from raw_events where " + (j12 != -1 ? "rowid <= ? and " : "") + "app_id in (select app_id from apps where config_fetched_time >= ?) order by rowid limit 1;", j12 != -1 ? new String[]{String.valueOf(j12), String.valueOf(j10)} : new String[]{String.valueOf(j10)});
                if (!cursor2.moveToFirst()) {
                    cursor2.close();
                    list = zzaVar14.zzc;
                    if (list != null && !list.isEmpty()) {
                        z10 = false;
                        if (z10) {
                            zzfy.zzk.zza zzl = zzaVar14.zza.zzcd().zzl();
                            int i13 = 0;
                            boolean z17 = false;
                            int i14 = 0;
                            zzfy.zzf.zza zzaVar15 = null;
                            zzfy.zzf.zza zzaVar16 = null;
                            int i15 = -1;
                            int i16 = -1;
                            while (true) {
                                String str13 = "_fr";
                                z11 = z17;
                                i10 = i14;
                                zzfy.zzf.zza zzaVar17 = zzaVar15;
                                if (i13 >= zzaVar14.zzc.size()) {
                                    break;
                                }
                                zzfy.zzf.zza zzcd = zzaVar14.zzc.get(i13).zzcd();
                                int i17 = i13;
                                if (zzi().zzd(zzaVar14.zza.zzz(), zzcd.zze())) {
                                    zzj().zzu().zza("Dropping blocked raw event. appId", zzgo.zza(zzaVar14.zza.zzz()), this.zzm.zzk().zza(zzcd.zze()));
                                    if (!zzi().zzl(zzaVar14.zza.zzz()) && !zzi().zzn(zzaVar14.zza.zzz())) {
                                        z16 = false;
                                        if (!z16 && !"_err".equals(zzcd.zze())) {
                                            zzq();
                                            zzos.zza(this.zzah, zzaVar14.zza.zzz(), 11, "_ev", zzcd.zze(), 0);
                                        }
                                        i14 = i10;
                                        str5 = str11;
                                        str8 = str12;
                                        zzaVar7 = zzl;
                                        z17 = z11;
                                        i12 = i17;
                                        zzaVar11 = zzaVar17;
                                    }
                                    z16 = true;
                                    if (!z16) {
                                        zzq();
                                        zzos.zza(this.zzah, zzaVar14.zza.zzz(), 11, "_ev", zzcd.zze(), 0);
                                    }
                                    i14 = i10;
                                    str5 = str11;
                                    str8 = str12;
                                    zzaVar7 = zzl;
                                    z17 = z11;
                                    i12 = i17;
                                    zzaVar11 = zzaVar17;
                                } else {
                                    if (zzcd.zze().equals(zzji.zza(str11))) {
                                        zzcd.zza(str11);
                                        zzj().zzp().zza("Renaming ad_impression to _ai");
                                        if (zzj().zza(5)) {
                                            int i18 = 0;
                                            while (i18 < zzcd.zza()) {
                                                String str14 = str11;
                                                if (FirebaseAnalytics.Param.AD_PLATFORM.equals(zzcd.zzb(i18).zzg()) && !zzcd.zzb(i18).zzh().isEmpty() && "admob".equalsIgnoreCase(zzcd.zzb(i18).zzh())) {
                                                    zzj().zzv().zza("AdMob ad impression logged from app. Potentially duplicative.");
                                                }
                                                i18++;
                                                str11 = str14;
                                            }
                                        }
                                    }
                                    str5 = str11;
                                    boolean zzc = zzi().zzc(zzaVar14.zza.zzz(), zzcd.zze());
                                    if (zzc) {
                                        str6 = str12;
                                    } else {
                                        zzp();
                                        String zze = zzcd.zze();
                                        Preconditions.checkNotEmpty(zze);
                                        str6 = str12;
                                        if (zze.hashCode() == 95027 && zze.equals("_ui")) {
                                            c10 = 0;
                                            if (c10 != 0) {
                                                zzaVar5 = zzl;
                                                zzaVar6 = zzaVar16;
                                                i11 = i15;
                                                str7 = "_fr";
                                                if (zzc) {
                                                    ArrayList arrayList = new ArrayList(zzcd.zzf());
                                                    int i19 = -1;
                                                    int i20 = -1;
                                                    for (int i21 = 0; i21 < arrayList.size(); i21++) {
                                                        if ("value".equals(((zzfy.zzh) arrayList.get(i21)).zzg())) {
                                                            i19 = i21;
                                                        } else if (FirebaseAnalytics.Param.CURRENCY.equals(((zzfy.zzh) arrayList.get(i21)).zzg())) {
                                                            i20 = i21;
                                                        }
                                                    }
                                                    if (i19 != -1) {
                                                        if (!((zzfy.zzh) arrayList.get(i19)).zzl() && !((zzfy.zzh) arrayList.get(i19)).zzj()) {
                                                            zzj().zzv().zza("Value must be specified with a numeric type.");
                                                            zzcd.zza(i19);
                                                            zza(zzcd, "_c");
                                                            zza(zzcd, 18, "value");
                                                        } else {
                                                            if (i20 != -1) {
                                                                String zzh = ((zzfy.zzh) arrayList.get(i20)).zzh();
                                                                if (zzh.length() == 3) {
                                                                    int i22 = 0;
                                                                    while (i22 < zzh.length()) {
                                                                        int codePointAt = zzh.codePointAt(i22);
                                                                        if (Character.isLetter(codePointAt)) {
                                                                            i22 += Character.charCount(codePointAt);
                                                                        }
                                                                    }
                                                                    z15 = false;
                                                                }
                                                                z15 = true;
                                                                break;
                                                            }
                                                            z15 = true;
                                                            if (z15) {
                                                                zzj().zzv().zza("Value parameter discarded. You must also supply a 3-letter ISO_4217 currency code in the currency parameter.");
                                                                zzcd.zza(i19);
                                                                zza(zzcd, "_c");
                                                                zza(zzcd, 19, FirebaseAnalytics.Param.CURRENCY);
                                                            }
                                                            if (!"_e".equals(zzcd.zze())) {
                                                                zzp();
                                                                if (zzoo.zza((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()), str7) == null) {
                                                                    if (zzaVar6 != null && Math.abs(zzaVar6.zzc() - zzcd.zzc()) <= 1000) {
                                                                        zzfy.zzf.zza zzaVar18 = (zzfy.zzf.zza) ((zzjt.zzb) zzaVar6.clone());
                                                                        if (zza(zzcd, zzaVar18)) {
                                                                            zzaVar7 = zzaVar5;
                                                                            zzaVar7.zza(i16, zzaVar18);
                                                                            i15 = i11;
                                                                            zzaVar8 = null;
                                                                            zzaVar6 = null;
                                                                            if (zzcd.zza() == 0) {
                                                                                zzp();
                                                                                Bundle zza3 = zzoo.zza(zzcd.zzf());
                                                                                int i23 = 0;
                                                                                while (i23 < zzcd.zza()) {
                                                                                    zzfy.zzh zzb2 = zzcd.zzb(i23);
                                                                                    String str15 = str6;
                                                                                    if (zzb2.zzg().equals(str15) && !zzb2.zzi().isEmpty()) {
                                                                                        String zzz = zzaVar14.zza.zzz();
                                                                                        List<zzfy.zzh> zzi = zzb2.zzi();
                                                                                        Parcelable[] parcelableArr = new Bundle[zzi.size()];
                                                                                        zzaVar12 = zzaVar8;
                                                                                        int i24 = 0;
                                                                                        while (i24 < zzi.size()) {
                                                                                            zzfy.zzh zzhVar = zzi.get(i24);
                                                                                            zzp();
                                                                                            zzfy.zzf.zza zzaVar19 = zzaVar6;
                                                                                            Bundle zza4 = zzoo.zza(zzhVar.zzi());
                                                                                            Iterator<zzfy.zzh> it = zzhVar.zzi().iterator();
                                                                                            while (it.hasNext()) {
                                                                                                zza(zzcd.zze(), it.next().zzcd(), zza4, zzz);
                                                                                                it = it;
                                                                                                zzi = zzi;
                                                                                            }
                                                                                            parcelableArr[i24] = zza4;
                                                                                            i24++;
                                                                                            zzaVar6 = zzaVar19;
                                                                                            zzi = zzi;
                                                                                        }
                                                                                        zzaVar13 = zzaVar6;
                                                                                        zza3.putParcelableArray(str15, parcelableArr);
                                                                                    } else {
                                                                                        zzaVar12 = zzaVar8;
                                                                                        zzaVar13 = zzaVar6;
                                                                                        if (!zzb2.zzg().equals(str15)) {
                                                                                            zza(zzcd.zze(), zzb2.zzcd(), zza3, zzaVar14.zza.zzz());
                                                                                        }
                                                                                    }
                                                                                    i23++;
                                                                                    zzaVar8 = zzaVar12;
                                                                                    str6 = str15;
                                                                                    zzaVar6 = zzaVar13;
                                                                                }
                                                                                zzaVar9 = zzaVar8;
                                                                                zzaVar10 = zzaVar6;
                                                                                str8 = str6;
                                                                                zzcd.zzd();
                                                                                zzoo zzp = zzp();
                                                                                ArrayList arrayList2 = new ArrayList();
                                                                                for (String str16 : zza3.keySet()) {
                                                                                    zzfy.zzh.zza zza5 = zzfy.zzh.zze().zza(str16);
                                                                                    Object obj2 = zza3.get(str16);
                                                                                    if (obj2 != null) {
                                                                                        zzp.zza(zza5, obj2);
                                                                                        arrayList2.add((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zza5.zzai()));
                                                                                    }
                                                                                }
                                                                                int size = arrayList2.size();
                                                                                int i25 = 0;
                                                                                while (i25 < size) {
                                                                                    Object obj3 = arrayList2.get(i25);
                                                                                    i25++;
                                                                                    zzcd.zza((zzfy.zzh) obj3);
                                                                                }
                                                                            } else {
                                                                                zzaVar9 = zzaVar8;
                                                                                zzaVar10 = zzaVar6;
                                                                                str8 = str6;
                                                                            }
                                                                            i12 = i17;
                                                                            zzaVar14.zzc.set(i12, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()));
                                                                            i14 = i10 + 1;
                                                                            zzaVar7.zza(zzcd);
                                                                            zzaVar11 = zzaVar9;
                                                                            z17 = z11;
                                                                            zzaVar16 = zzaVar10;
                                                                        }
                                                                    }
                                                                    zzaVar7 = zzaVar5;
                                                                    i15 = i10;
                                                                    zzaVar8 = zzcd;
                                                                    if (zzcd.zza() == 0) {
                                                                    }
                                                                    i12 = i17;
                                                                    zzaVar14.zzc.set(i12, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()));
                                                                    i14 = i10 + 1;
                                                                    zzaVar7.zza(zzcd);
                                                                    zzaVar11 = zzaVar9;
                                                                    z17 = z11;
                                                                    zzaVar16 = zzaVar10;
                                                                } else {
                                                                    zzaVar7 = zzaVar5;
                                                                    zzaVar8 = zzaVar17;
                                                                    i15 = i11;
                                                                    if (zzcd.zza() == 0) {
                                                                    }
                                                                    i12 = i17;
                                                                    zzaVar14.zzc.set(i12, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()));
                                                                    i14 = i10 + 1;
                                                                    zzaVar7.zza(zzcd);
                                                                    zzaVar11 = zzaVar9;
                                                                    z17 = z11;
                                                                    zzaVar16 = zzaVar10;
                                                                }
                                                            } else {
                                                                zzaVar7 = zzaVar5;
                                                                if ("_vs".equals(zzcd.zze())) {
                                                                    zzp();
                                                                    if (zzoo.zza((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()), "_et") == null) {
                                                                        if (zzaVar17 != null && Math.abs(zzaVar17.zzc() - zzcd.zzc()) <= 1000) {
                                                                            zzfy.zzf.zza zzaVar20 = (zzfy.zzf.zza) ((zzjt.zzb) zzaVar17.clone());
                                                                            if (zza(zzaVar20, zzcd)) {
                                                                                int i26 = i11;
                                                                                zzaVar7.zza(i26, zzaVar20);
                                                                                i15 = i26;
                                                                                zzaVar8 = null;
                                                                                zzaVar6 = null;
                                                                                if (zzcd.zza() == 0) {
                                                                                }
                                                                                i12 = i17;
                                                                                zzaVar14.zzc.set(i12, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()));
                                                                                i14 = i10 + 1;
                                                                                zzaVar7.zza(zzcd);
                                                                                zzaVar11 = zzaVar9;
                                                                                z17 = z11;
                                                                                zzaVar16 = zzaVar10;
                                                                            }
                                                                        }
                                                                        i16 = i10;
                                                                        zzaVar8 = zzaVar17;
                                                                        i15 = i11;
                                                                        zzaVar6 = zzcd;
                                                                        if (zzcd.zza() == 0) {
                                                                        }
                                                                        i12 = i17;
                                                                        zzaVar14.zzc.set(i12, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()));
                                                                        i14 = i10 + 1;
                                                                        zzaVar7.zza(zzcd);
                                                                        zzaVar11 = zzaVar9;
                                                                        z17 = z11;
                                                                        zzaVar16 = zzaVar10;
                                                                    }
                                                                }
                                                                zzaVar8 = zzaVar17;
                                                                i15 = i11;
                                                                if (zzcd.zza() == 0) {
                                                                }
                                                                i12 = i17;
                                                                zzaVar14.zzc.set(i12, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzai()));
                                                                i14 = i10 + 1;
                                                                zzaVar7.zza(zzcd);
                                                                zzaVar11 = zzaVar9;
                                                                z17 = z11;
                                                                zzaVar16 = zzaVar10;
                                                            }
                                                        }
                                                    }
                                                    if (!"_e".equals(zzcd.zze())) {
                                                    }
                                                }
                                                if (!"_e".equals(zzcd.zze())) {
                                                }
                                            }
                                        }
                                        c10 = 65535;
                                        if (c10 != 0) {
                                        }
                                    }
                                    i11 = i15;
                                    int i27 = 0;
                                    boolean z18 = false;
                                    boolean z19 = false;
                                    while (true) {
                                        zzaVar5 = zzl;
                                        if (i27 >= zzcd.zza()) {
                                            break;
                                        }
                                        if ("_c".equals(zzcd.zzb(i27).zzg())) {
                                            str9 = str13;
                                            zzcd.zza(i27, (zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzb(i27).zzcd().zza(1L).zzai()));
                                            z18 = true;
                                        } else {
                                            str9 = str13;
                                            if ("_r".equals(zzcd.zzb(i27).zzg())) {
                                                zzcd.zza(i27, (zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzcd.zzb(i27).zzcd().zza(1L).zzai()));
                                                z19 = true;
                                            }
                                        }
                                        i27++;
                                        zzl = zzaVar5;
                                        str13 = str9;
                                    }
                                    str7 = str13;
                                    if (!z18 && zzc) {
                                        zzj().zzp().zza("Marking event as conversion", this.zzm.zzk().zza(zzcd.zze()));
                                        zzcd.zza(zzfy.zzh.zze().zza("_c").zza(1L));
                                    }
                                    if (!z19) {
                                        zzj().zzp().zza("Marking event as real-time", this.zzm.zzk().zza(zzcd.zze()));
                                        zzcd.zza(zzfy.zzh.zze().zza("_r").zza(1L));
                                    }
                                    zzaVar6 = zzaVar16;
                                    if (zzf().zza(zzx(), zzaVar14.zza.zzz(), false, false, false, false, true, false, false).zze > zze().zzc(zzaVar14.zza.zzz())) {
                                        zza(zzcd, "_r");
                                    } else {
                                        z11 = true;
                                    }
                                    if (zzos.zzh(zzcd.zze()) && zzc && zzf().zza(zzx(), zzaVar14.zza.zzz(), false, false, true, false, false, false, false).zzc > zze().zzb(zzaVar14.zza.zzz(), zzbh.zzn)) {
                                        zzj().zzu().zza("Too many conversions. Not logging as conversion. appId", zzgo.zza(zzaVar14.zza.zzz()));
                                        int i28 = -1;
                                        zzfy.zzh.zza zzaVar21 = null;
                                        boolean z20 = false;
                                        for (int i29 = 0; i29 < zzcd.zza(); i29++) {
                                            zzfy.zzh zzb3 = zzcd.zzb(i29);
                                            if ("_c".equals(zzb3.zzg())) {
                                                zzaVar21 = zzb3.zzcd();
                                                i28 = i29;
                                            } else if ("_err".equals(zzb3.zzg())) {
                                                z20 = true;
                                            }
                                        }
                                        if (z20 && zzaVar21 != null) {
                                            zzcd.zza(i28);
                                        } else if (zzaVar21 != null) {
                                            zzcd.zza(i28, (zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) ((zzfy.zzh.zza) ((zzjt.zzb) zzaVar21.clone())).zza("_err").zza(10L).zzai()));
                                        } else {
                                            zzj().zzg().zza("Did not find conversion parameter. appId", zzgo.zza(zzaVar14.zza.zzz()));
                                        }
                                    }
                                    if (zzc) {
                                    }
                                    if (!"_e".equals(zzcd.zze())) {
                                    }
                                }
                                i13 = i12 + 1;
                                zzl = zzaVar7;
                                str12 = str8;
                                zzaVar15 = zzaVar11;
                                str11 = str5;
                            }
                            zzfy.zzk.zza zzaVar22 = zzl;
                            int i30 = i10;
                            long j13 = 0;
                            int i31 = 0;
                            while (i31 < i30) {
                                zzfy.zzf zza6 = zzaVar22.zza(i31);
                                if ("_e".equals(zza6.zzg())) {
                                    zzp();
                                    if (zzoo.zza(zza6, "_fr") != null) {
                                        zzaVar22.zzb(i31);
                                        i30--;
                                        i31--;
                                        i31++;
                                    }
                                }
                                zzp();
                                zzfy.zzh zza7 = zzoo.zza(zza6, "_et");
                                if (zza7 != null) {
                                    Long valueOf = zza7.zzl() ? Long.valueOf(zza7.zzd()) : null;
                                    if (valueOf != null && valueOf.longValue() > 0) {
                                        j13 += valueOf.longValue();
                                    }
                                }
                                i31++;
                            }
                            zza(zzaVar22, j13, false);
                            Iterator<zzfy.zzf> it2 = zzaVar22.zzaa().iterator();
                            while (true) {
                                if (!it2.hasNext()) {
                                    z12 = false;
                                    break;
                                }
                                if ("_s".equals(it2.next().zzg())) {
                                    z12 = true;
                                    break;
                                }
                            }
                            if (z12) {
                                zzf().zzh(zzaVar22.zzt(), "_se");
                            }
                            if (zzoo.zza(zzaVar22, "_sid") >= 0) {
                                zza(zzaVar22, j13, true);
                            } else {
                                int zza8 = zzoo.zza(zzaVar22, "_se");
                                if (zza8 >= 0) {
                                    zzaVar22.zzc(zza8);
                                    zzj().zzg().zza("Session engagement user property is in the bundle without session ID. appId", zzgo.zza(zzaVar14.zza.zzz()));
                                }
                            }
                            String zzz2 = zzaVar14.zza.zzz();
                            zzl().zzt();
                            zzs();
                            zzg zze2 = zzf().zze(zzz2);
                            if (zze2 == null) {
                                zzj().zzg().zza("Cannot fix consent fields without appInfo. appId", zzgo.zza(zzz2));
                            } else {
                                zza(zze2, zzaVar22);
                            }
                            if (zzov.zza() && zze().zza(zzbh.zzcu)) {
                                String zzz3 = zzaVar14.zza.zzz();
                                zzl().zzt();
                                zzs();
                                zzg zze3 = zzf().zze(zzz3);
                                if (zze3 == null) {
                                    zzj().zzu().zza("Cannot populate ad_campaign_info without appInfo. appId", zzgo.zza(zzz3));
                                } else {
                                    zzb(zze3, zzaVar22);
                                }
                            }
                            zzaVar22.zzi(Long.MAX_VALUE).zze(Long.MIN_VALUE);
                            for (int i32 = 0; i32 < zzaVar22.zzc(); i32++) {
                                zzfy.zzf zza9 = zzaVar22.zza(i32);
                                if (zza9.zzd() < zzaVar22.zzf()) {
                                    zzaVar22.zzi(zza9.zzd());
                                }
                                if (zza9.zzd() > zzaVar22.zze()) {
                                    zzaVar22.zze(zza9.zzd());
                                }
                            }
                            zzaVar22.zzs();
                            zzje zzjeVar = zzje.zza;
                            if (com.google.android.gms.internal.measurement.zznm.zza() && zze().zza(zzbh.zzcy)) {
                                zzjeVar = zzb(zzaVar14.zza.zzz()).zza(zzje.zzb(zzaVar14.zza.zzae()));
                                zzje zzh2 = zzf().zzh(zzaVar14.zza.zzz());
                                zzf().zza(zzaVar14.zza.zzz(), zzjeVar);
                                if (!zzjeVar.zzh() && zzh2.zzh()) {
                                    zzf().zzq(zzaVar14.zza.zzz());
                                } else if (zzjeVar.zzh() && !zzh2.zzh()) {
                                    zzf().zzr(zzaVar14.zza.zzz());
                                }
                                if (!zzjeVar.zzg()) {
                                    zzaVar22.zzq();
                                    zzaVar22.zzn();
                                    zzaVar22.zzk();
                                }
                                if (!zzjeVar.zzh()) {
                                    zzaVar22.zzh();
                                    zzaVar22.zzr();
                                }
                            }
                            if (zzpn.zza() && zze().zze(zzaVar14.zza.zzz(), zzbh.zzch)) {
                                zzq();
                                if (zzos.zzd(zzaVar14.zza.zzz()) && zzb(zzaVar14.zza.zzz()).zzg() && zzaVar14.zza.zzat()) {
                                    for (int i33 = 0; i33 < zzaVar22.zzc(); i33++) {
                                        zzfy.zzf.zza zzcd2 = zzaVar22.zza(i33).zzcd();
                                        Iterator<zzfy.zzh> it3 = zzcd2.zzf().iterator();
                                        while (true) {
                                            if (!it3.hasNext()) {
                                                z14 = false;
                                                break;
                                            }
                                            if ("_c".equals(it3.next().zzg())) {
                                                z14 = true;
                                                break;
                                            }
                                        }
                                        if (z14) {
                                            if (zzaVar14.zza.zza() >= zze().zzb(zzaVar14.zza.zzz(), zzbh.zzax)) {
                                                int zzb4 = zze().zzb(zzaVar14.zza.zzz(), zzbh.zzbi);
                                                if (zzb4 <= 0) {
                                                    if (zze().zze(zzaVar14.zza.zzz(), zzbh.zzcj)) {
                                                        str3 = zzq().zzp();
                                                        zzcd2.zza((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzh.zze().zza("_tu").zzb(str3).zzai()));
                                                    } else {
                                                        str3 = null;
                                                    }
                                                    zzcd2.zza((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzh.zze().zza("_tr").zza(1L).zzai()));
                                                    zzno zza10 = zzp().zza(zzaVar14.zza.zzz(), zzaVar22, zzcd2, str3);
                                                    if (zza10 != null) {
                                                        zzj().zzp().zza("Generated trigger URI. appId, uri", zzaVar14.zza.zzz(), zza10.zza);
                                                        zzf().zza(zzaVar14.zza.zzz(), zza10);
                                                        this.zzr.add(zzaVar14.zza.zzz());
                                                    }
                                                } else if (zzf().zza(zzx(), zzaVar14.zza.zzz(), false, false, false, false, false, false, true).zzg > zzb4) {
                                                    zzcd2.zza((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzh.zze().zza("_tnr").zza(1L).zzai()));
                                                } else {
                                                    if (zze().zze(zzaVar14.zza.zzz(), zzbh.zzcj)) {
                                                        str4 = zzq().zzp();
                                                        zzcd2.zza((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzh.zze().zza("_tu").zzb(str4).zzai()));
                                                    } else {
                                                        str4 = null;
                                                    }
                                                    zzcd2.zza((zzfy.zzh) ((com.google.android.gms.internal.measurement.zzjt) zzfy.zzh.zze().zza("_tr").zza(1L).zzai()));
                                                    zzno zza11 = zzp().zza(zzaVar14.zza.zzz(), zzaVar22, zzcd2, str4);
                                                    if (zza11 != null) {
                                                        zzj().zzp().zza("Generated trigger URI. appId, uri", zzaVar14.zza.zzz(), zza11.zza);
                                                        zzf().zza(zzaVar14.zza.zzz(), zza11);
                                                        this.zzr.add(zzaVar14.zza.zzz());
                                                    }
                                                }
                                            }
                                            zzaVar22.zza(i33, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd2.zzai()));
                                        }
                                    }
                                }
                            }
                            if (com.google.android.gms.internal.measurement.zznm.zza() && zze().zza(zzbh.zzcy)) {
                                zzaVar22.zzi().zza(zzc().zza(zzaVar22.zzt(), zzaVar22.zzaa(), zzaVar22.zzab(), Long.valueOf(zzaVar22.zzf()), Long.valueOf(zzaVar22.zze()), !zzjeVar.zzh()));
                            } else {
                                zzaVar22.zzi().zza(zzc().zza(zzaVar22.zzt(), zzaVar22.zzaa(), zzaVar22.zzab(), Long.valueOf(zzaVar22.zzf()), Long.valueOf(zzaVar22.zze())));
                            }
                            if (zze().zzk(zzaVar14.zza.zzz())) {
                                HashMap hashMap3 = new HashMap();
                                ArrayList arrayList3 = new ArrayList();
                                SecureRandom zzv = zzq().zzv();
                                int i34 = 0;
                                while (i34 < zzaVar22.zzc()) {
                                    zzfy.zzf.zza zzcd3 = zzaVar22.zza(i34).zzcd();
                                    if (zzcd3.zze().equals("_ep")) {
                                        zzp();
                                        String str17 = (String) zzoo.zzb((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai()), "_en");
                                        zzbb zzbbVar = (zzbb) hashMap3.get(str17);
                                        if (zzbbVar == null && (zzbbVar = zzf().zzd(zzaVar14.zza.zzz(), (String) Preconditions.checkNotNull(str17))) != null) {
                                            hashMap3.put(str17, zzbbVar);
                                        }
                                        if (zzbbVar != null && zzbbVar.zzi == null) {
                                            Long l10 = zzbbVar.zzj;
                                            if (l10 != null && l10.longValue() > 1) {
                                                zzp();
                                                zzoo.zza(zzcd3, "_sr", zzbbVar.zzj);
                                            }
                                            Boolean bool = zzbbVar.zzk;
                                            if (bool != null && bool.booleanValue()) {
                                                zzp();
                                                zzoo.zza(zzcd3, "_efs", (Object) 1L);
                                            }
                                            arrayList3.add((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai()));
                                        }
                                        zzaVar22.zza(i34, zzcd3);
                                    } else {
                                        long zza12 = zzi().zza(zzaVar14.zza.zzz());
                                        zzq();
                                        long zza13 = zzos.zza(zzcd3.zzc(), zza12);
                                        zzfy.zzf zzfVar = (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai());
                                        Long l11 = 1L;
                                        if (!TextUtils.isEmpty("_dbg") && l11 != null) {
                                            Iterator<zzfy.zzh> it4 = zzfVar.zzh().iterator();
                                            while (true) {
                                                if (!it4.hasNext()) {
                                                    break;
                                                }
                                                zzfy.zzh next = it4.next();
                                                Iterator<zzfy.zzh> it5 = it4;
                                                if (!"_dbg".equals(next.zzg())) {
                                                    it4 = it5;
                                                } else if (l11.equals(Long.valueOf(next.zzd())) || (((l11 instanceof String) && l11.equals(next.zzh())) || ((l11 instanceof Double) && l11.equals(Double.valueOf(next.zza()))))) {
                                                    z13 = true;
                                                }
                                            }
                                        }
                                        z13 = false;
                                        int zzb5 = !z13 ? zzi().zzb(zzaVar14.zza.zzz(), zzcd3.zze()) : 1;
                                        if (zzb5 <= 0) {
                                            zzj().zzu().zza("Sample rate must be positive. event, rate", zzcd3.zze(), Integer.valueOf(zzb5));
                                            arrayList3.add((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai()));
                                            zzaVar22.zza(i34, zzcd3);
                                        } else {
                                            zzbb zzbbVar2 = (zzbb) hashMap3.get(zzcd3.zze());
                                            if (zzbbVar2 == null) {
                                                j11 = zza12;
                                                zzbbVar2 = zzf().zzd(zzaVar14.zza.zzz(), zzcd3.zze());
                                                if (zzbbVar2 == null) {
                                                    zzj().zzu().zza("Event being bundled has no eventAggregate. appId, eventName", zzaVar14.zza.zzz(), zzcd3.zze());
                                                    zzbbVar2 = new zzbb(zzaVar14.zza.zzz(), zzcd3.zze(), 1L, 1L, 1L, zzcd3.zzc(), 0L, null, null, null, null);
                                                }
                                            } else {
                                                j11 = zza12;
                                            }
                                            zzp();
                                            Long l12 = (Long) zzoo.zzb((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai()), "_eid");
                                            Boolean valueOf2 = Boolean.valueOf(l12 != null);
                                            if (zzb5 == 1) {
                                                arrayList3.add((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai()));
                                                if (valueOf2.booleanValue() && (zzbbVar2.zzi != null || zzbbVar2.zzj != null || zzbbVar2.zzk != null)) {
                                                    hashMap3.put(zzcd3.zze(), zzbbVar2.zza(null, null, null));
                                                }
                                                zzaVar22.zza(i34, zzcd3);
                                            } else {
                                                if (zzv.nextInt(zzb5) == 0) {
                                                    zzp();
                                                    zzfy.zzk.zza zzaVar23 = zzaVar22;
                                                    secureRandom = zzv;
                                                    long j14 = zzb5;
                                                    zzoo.zza(zzcd3, "_sr", Long.valueOf(j14));
                                                    arrayList3.add((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai()));
                                                    if (valueOf2.booleanValue()) {
                                                        zzbbVar2 = zzbbVar2.zza(null, Long.valueOf(j14), null);
                                                    }
                                                    hashMap3.put(zzcd3.zze(), zzbbVar2.zza(zzcd3.zzc(), zza13));
                                                    zzaVar3 = zzaVar14;
                                                    hashMap2 = hashMap3;
                                                    zzaVar4 = zzaVar23;
                                                } else {
                                                    zzfy.zzk.zza zzaVar24 = zzaVar22;
                                                    secureRandom = zzv;
                                                    Long l13 = zzbbVar2.zzh;
                                                    if (l13 != null) {
                                                        zza2 = l13.longValue();
                                                        zzaVar3 = zzaVar14;
                                                        hashMap = hashMap3;
                                                    } else {
                                                        zzq();
                                                        zzaVar3 = zzaVar14;
                                                        hashMap = hashMap3;
                                                        zza2 = zzos.zza(zzcd3.zzb(), j11);
                                                    }
                                                    if (zza2 != zza13) {
                                                        zzp();
                                                        zzoo.zza(zzcd3, "_efs", (Object) 1L);
                                                        zzp();
                                                        long j15 = zzb5;
                                                        zzoo.zza(zzcd3, "_sr", Long.valueOf(j15));
                                                        arrayList3.add((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzcd3.zzai()));
                                                        if (valueOf2.booleanValue()) {
                                                            zzbbVar2 = zzbbVar2.zza(null, Long.valueOf(j15), Boolean.TRUE);
                                                        }
                                                        hashMap2 = hashMap;
                                                        hashMap2.put(zzcd3.zze(), zzbbVar2.zza(zzcd3.zzc(), zza13));
                                                    } else {
                                                        hashMap2 = hashMap;
                                                        if (valueOf2.booleanValue()) {
                                                            hashMap2.put(zzcd3.zze(), zzbbVar2.zza(l12, null, null));
                                                        }
                                                    }
                                                    zzaVar4 = zzaVar24;
                                                }
                                                zzaVar4.zza(i34, zzcd3);
                                                i34++;
                                                zzv = secureRandom;
                                                zzaVar22 = zzaVar4;
                                                hashMap3 = hashMap2;
                                                zzaVar14 = zzaVar3;
                                            }
                                        }
                                    }
                                    zzaVar3 = zzaVar14;
                                    hashMap2 = hashMap3;
                                    zzaVar4 = zzaVar22;
                                    secureRandom = zzv;
                                    i34++;
                                    zzv = secureRandom;
                                    zzaVar22 = zzaVar4;
                                    hashMap3 = hashMap2;
                                    zzaVar14 = zzaVar3;
                                }
                                zza zzaVar25 = zzaVar14;
                                HashMap hashMap4 = hashMap3;
                                zzaVar = zzaVar22;
                                if (arrayList3.size() < zzaVar.zzc()) {
                                    zzaVar.zzl().zzb(arrayList3);
                                }
                                Iterator it6 = hashMap4.entrySet().iterator();
                                while (it6.hasNext()) {
                                    zzf().zza((zzbb) ((Map.Entry) it6.next()).getValue());
                                }
                                zzaVar2 = zzaVar25;
                            } else {
                                zzaVar = zzaVar22;
                                zzaVar2 = zzaVar14;
                            }
                            String zzz4 = zzaVar2.zza.zzz();
                            zzg zze4 = zzf().zze(zzz4);
                            if (zze4 == null) {
                                zzj().zzg().zza("Bundling raw events w/o app info. appId", zzgo.zza(zzaVar2.zza.zzz()));
                            } else if (zzaVar.zzc() > 0) {
                                long zzs = zze4.zzs();
                                if (zzs != 0) {
                                    zzaVar.zzg(zzs);
                                } else {
                                    zzaVar.zzo();
                                }
                                long zzu = zze4.zzu();
                                if (zzu != 0) {
                                    zzs = zzu;
                                }
                                if (zzs != 0) {
                                    zzaVar.zzh(zzs);
                                } else {
                                    zzaVar.zzp();
                                }
                                if (zzpu.zza() && zze().zza(zzbh.zzbx)) {
                                    zzq();
                                    if (zzos.zzf(zze4.zzac())) {
                                        zze4.zza(zzaVar.zzc());
                                        zzaVar.zzg((int) zze4.zzr());
                                        zzaVar.zzf((int) zze4.zzt());
                                        zze4.zzr(zzaVar.zzf());
                                        zze4.zzp(zzaVar.zze());
                                        zzab = zze4.zzab();
                                        if (zzab == null) {
                                            zzaVar.zzn(zzab);
                                        } else {
                                            zzaVar.zzm();
                                        }
                                        zzf().zza(zze4, false, false);
                                    }
                                }
                                zze4.zzap();
                                zzaVar.zzf((int) zze4.zzt());
                                zze4.zzr(zzaVar.zzf());
                                zze4.zzp(zzaVar.zze());
                                zzab = zze4.zzab();
                                if (zzab == null) {
                                }
                                zzf().zza(zze4, false, false);
                            }
                            if (zzaVar.zzc() > 0) {
                                zzfr.zzd zzc2 = zzi().zzc(zzaVar2.zza.zzz());
                                if (zzc2 != null && zzc2.zzr()) {
                                    zzaVar.zzb(zzc2.zzc());
                                    zzf().zza((zzfy.zzk) ((com.google.android.gms.internal.measurement.zzjt) zzaVar.zzai()), z11);
                                }
                                if (zzaVar2.zza.zzaj().isEmpty()) {
                                    zzaVar.zzb(-1L);
                                } else {
                                    zzj().zzu().zza("Did not find measurement config or missing version info. appId", zzgo.zza(zzaVar2.zza.zzz()));
                                }
                                zzf().zza((zzfy.zzk) ((com.google.android.gms.internal.measurement.zzjt) zzaVar.zzai()), z11);
                            }
                            zzal zzf2 = zzf();
                            List<Long> list2 = zzaVar2.zzb;
                            Preconditions.checkNotNull(list2);
                            zzf2.zzt();
                            zzf2.zzal();
                            StringBuilder sb2 = new StringBuilder("rowid in (");
                            for (int i35 = 0; i35 < list2.size(); i35++) {
                                if (i35 != 0) {
                                    sb2.append(",");
                                }
                                sb2.append(list2.get(i35).longValue());
                            }
                            sb2.append(")");
                            int delete = zzf2.e_().delete("raw_events", sb2.toString(), null);
                            if (delete != list2.size()) {
                                zzf2.zzj().zzg().zza("Deleted fewer rows from raw events table than expected", Integer.valueOf(delete), Integer.valueOf(list2.size()));
                            }
                            zzal zzf3 = zzf();
                            try {
                                zzf3.e_().execSQL("delete from raw_events_metadata where app_id=? and metadata_fingerprint not in (select distinct metadata_fingerprint from raw_events where app_id=?)", new String[]{zzz4, zzz4});
                            } catch (SQLiteException e12) {
                                zzf3.zzj().zzg().zza("Failed to remove unused event metadata. appId", zzgo.zza(zzz4), e12);
                            }
                            zzf().zzw();
                            zzf().zzu();
                            return true;
                        }
                        zzf().zzw();
                        zzf().zzu();
                        return false;
                    }
                    z10 = true;
                    if (z10) {
                    }
                } else {
                    str2 = cursor2.getString(0);
                    try {
                        string = cursor2.getString(1);
                        cursor2.close();
                    } catch (SQLiteException e13) {
                        e = e13;
                        obj = e;
                        cursor = cursor2;
                        zzf.zzj().zzg().zza("Data loss. Error selecting raw event. appId", zzgo.zza(str2), obj);
                        if (cursor != null) {
                            cursor.close();
                        }
                        list = zzaVar14.zzc;
                        if (list != null) {
                        }
                        z10 = true;
                        if (z10) {
                        }
                    }
                }
            } else {
                Cursor rawQuery = e_.rawQuery("select metadata_fingerprint from raw_events where app_id = ?" + (j12 != -1 ? " and rowid <= ?" : "") + " order by rowid limit 1;", j12 != -1 ? new String[]{str, String.valueOf(j12)} : new String[]{str});
                if (!rawQuery.moveToFirst()) {
                    rawQuery.close();
                    list = zzaVar14.zzc;
                    if (list != null) {
                        z10 = false;
                        if (z10) {
                        }
                    }
                    z10 = true;
                    if (z10) {
                    }
                } else {
                    string = rawQuery.getString(0);
                    rawQuery.close();
                    str2 = str;
                }
            }
            cursor2 = e_.query("raw_events_metadata", new String[]{"metadata"}, "app_id = ? and metadata_fingerprint = ?", new String[]{str2, string}, null, null, "rowid", "2");
            if (!cursor2.moveToFirst()) {
                zzf.zzj().zzg().zza("Raw event metadata record is missing. appId", zzgo.zza(str2));
                cursor2.close();
            } else {
                try {
                    zzfy.zzk zzkVar = (zzfy.zzk) ((com.google.android.gms.internal.measurement.zzjt) ((zzfy.zzk.zza) zzoo.zza(zzfy.zzk.zzw(), cursor2.getBlob(0))).zzai());
                    if (cursor2.moveToNext()) {
                        zzf.zzj().zzu().zza("Get multiple raw event metadata records, expected one. appId", zzgo.zza(str2));
                    }
                    cursor2.close();
                    zzaVar14.zza(zzkVar);
                    if (j12 != -1) {
                        str10 = "app_id = ? and metadata_fingerprint = ? and rowid <= ?";
                        strArr = new String[]{str2, string, String.valueOf(j12)};
                    } else {
                        str10 = "app_id = ? and metadata_fingerprint = ?";
                        strArr = new String[]{str2, string};
                    }
                    Cursor query = e_.query("raw_events", new String[]{"rowid", AppMeasurementSdk.ConditionalUserProperty.NAME, "timestamp", Constants.ScionAnalytics.MessageType.DATA_MESSAGE}, str10, strArr, null, null, "rowid", null);
                    if (!query.moveToFirst()) {
                        zzf.zzj().zzu().zza("Raw event data disappeared while in transaction. appId", zzgo.zza(str2));
                        query.close();
                    }
                    while (true) {
                        long j16 = query.getLong(0);
                        try {
                            zzfy.zzf.zza zzaVar26 = (zzfy.zzf.zza) zzoo.zza(zzfy.zzf.zze(), query.getBlob(3));
                            zzaVar26.zza(query.getString(1)).zzb(query.getLong(2));
                            if (!zzaVar14.zza(j16, (zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzaVar26.zzai()))) {
                                query.close();
                                break;
                            }
                        } catch (IOException e14) {
                            zzf.zzj().zzg().zza("Data loss. Failed to merge raw event. appId", zzgo.zza(str2), e14);
                        }
                        if (!query.moveToNext()) {
                            query.close();
                            break;
                        }
                    }
                } catch (IOException e15) {
                    zzf.zzj().zzg().zza("Data loss. Failed to merge raw event metadata. appId", zzgo.zza(str2), e15);
                    cursor2.close();
                }
            }
            list = zzaVar14.zzc;
            if (list != null) {
            }
            z10 = true;
            if (z10) {
            }
        } catch (Throwable th5) {
            zzf().zzu();
            throw th5;
        }
    }

    private final boolean zza(zzfy.zzf.zza zzaVar, zzfy.zzf.zza zzaVar2) {
        Preconditions.checkArgument("_e".equals(zzaVar.zze()));
        zzp();
        zzfy.zzh zza2 = zzoo.zza((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzaVar.zzai()), "_sc");
        String zzh = zza2 == null ? null : zza2.zzh();
        zzp();
        zzfy.zzh zza3 = zzoo.zza((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzaVar2.zzai()), "_pc");
        String zzh2 = zza3 != null ? zza3.zzh() : null;
        if (zzh2 == null || !zzh2.equals(zzh)) {
            return false;
        }
        Preconditions.checkArgument("_e".equals(zzaVar.zze()));
        zzp();
        zzfy.zzh zza4 = zzoo.zza((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzaVar.zzai()), "_et");
        if (zza4 == null || !zza4.zzl() || zza4.zzd() <= 0) {
            return true;
        }
        long zzd = zza4.zzd();
        zzp();
        zzfy.zzh zza5 = zzoo.zza((zzfy.zzf) ((com.google.android.gms.internal.measurement.zzjt) zzaVar2.zzai()), "_et");
        if (zza5 != null && zza5.zzd() > 0) {
            zzd += zza5.zzd();
        }
        zzp();
        zzoo.zza(zzaVar2, "_et", Long.valueOf(zzd));
        zzp();
        zzoo.zza(zzaVar, "_fr", (Object) 1L);
        return true;
    }

    private final boolean zza(int i10, FileChannel fileChannel) {
        zzl().zzt();
        if (fileChannel != null && fileChannel.isOpen()) {
            ByteBuffer allocate = ByteBuffer.allocate(4);
            allocate.putInt(i10);
            allocate.flip();
            try {
                fileChannel.truncate(0L);
                fileChannel.write(allocate);
                fileChannel.force(true);
                if (fileChannel.size() != 4) {
                    zzj().zzg().zza("Error writing to channel. Bytes written", Long.valueOf(fileChannel.size()));
                }
                return true;
            } catch (IOException e10) {
                zzj().zzg().zza("Failed to write to channel", e10);
                return false;
            }
        }
        zzj().zzg().zza("Bad channel to read from");
        return false;
    }
}
