package d3;

import P2.C0253j;
import android.app.AlarmManager;
import android.app.BroadcastOptions;
import android.app.Service;
import android.app.job.JobInfo;
import android.app.job.JobScheduler;
import android.content.ComponentName;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
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.os.PersistableBundle;
import android.os.SystemClock;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import com.google.android.gms.internal.measurement.C0613b1;
import com.google.android.gms.internal.measurement.C0618c1;
import com.google.android.gms.internal.measurement.C0623d1;
import com.google.android.gms.internal.measurement.C0628e1;
import com.google.android.gms.internal.measurement.C0635f3;
import com.google.android.gms.internal.measurement.C0654j2;
import com.google.android.gms.internal.measurement.C0658k1;
import com.google.android.gms.internal.measurement.C0663l1;
import com.google.android.gms.internal.measurement.C0668m1;
import com.google.android.gms.internal.measurement.C0673n1;
import com.google.android.gms.internal.measurement.C0727y1;
import com.google.android.gms.internal.measurement.C0731z0;
import com.google.android.gms.internal.measurement.J3;
import com.google.android.gms.internal.measurement.Q2;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
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.Charset;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.zip.GZIPInputStream;

/* JADX INFO: loaded from: classes.dex */
public final class Q1 implements B0 {

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public static volatile Q1 f11657a0;

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public C0791i0 f11658A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final C0817r0 f11659B;
    public boolean D;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public long f11661E;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public ArrayList f11662F;
    public int H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public int f11664I;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public boolean f11665J;

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public boolean f11666K;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public boolean f11667L;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public FileLock f11668M;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    public FileChannel f11669N;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    public ArrayList f11670O;

    /* JADX INFO: renamed from: P, reason: collision with root package name */
    public ArrayList f11671P;

    /* JADX INFO: renamed from: R, reason: collision with root package name */
    public final HashMap f11673R;

    /* JADX INFO: renamed from: S, reason: collision with root package name */
    public final HashMap f11674S;

    /* JADX INFO: renamed from: T, reason: collision with root package name */
    public final HashMap f11675T;

    /* JADX INFO: renamed from: V, reason: collision with root package name */
    public C0786g1 f11677V;

    /* JADX INFO: renamed from: W, reason: collision with root package name */
    public String f11678W;
    public z1 X;

    /* JADX INFO: renamed from: Y, reason: collision with root package name */
    public long f11679Y;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final C0803m0 f11681q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final C0773c0 f11682r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public C0805n f11683s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public C0776d0 f11684t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public F1 f11685u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public C0772c f11686v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final C0773c0 f11687w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public C0773c0 f11688x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public C0830v1 f11689y;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public final AtomicBoolean f11660C = new AtomicBoolean(false);

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public final LinkedList f11663G = new LinkedList();

    /* JADX INFO: renamed from: U, reason: collision with root package name */
    public final HashMap f11676U = new HashMap();

    /* JADX INFO: renamed from: Z, reason: collision with root package name */
    public final N1 f11680Z = new N1(this);

    /* JADX INFO: renamed from: Q, reason: collision with root package name */
    public long f11672Q = -1;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public final M1 f11690z = new M1(this);

    public Q1(I0.j jVar) {
        this.f11659B = C0817r0.q(jVar.f3229q, null, null);
        C0773c0 c0773c0 = new C0773c0(this, 2);
        c0773c0.G();
        this.f11687w = c0773c0;
        C0773c0 c0773c02 = new C0773c0(this, 0);
        c0773c02.G();
        this.f11682r = c0773c02;
        C0803m0 c0803m0 = new C0803m0(this);
        c0803m0.G();
        this.f11681q = c0803m0;
        this.f11673R = new HashMap();
        this.f11674S = new HashMap();
        this.f11675T = new HashMap();
        c().O(new M4.k(this, jVar));
    }

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

    public static final boolean K(X1 x12) {
        return (TextUtils.isEmpty(x12.f11832r) && TextUtils.isEmpty(x12.f11814F)) ? false : true;
    }

    public static final void L(K1 k12) {
        if (k12 == null) {
            throw new IllegalStateException("Upload Component not created");
        }
        if (!k12.f11615s) {
            throw new IllegalStateException("Component not initialized: ".concat(String.valueOf(k12.getClass())));
        }
    }

    public static final Boolean M(X1 x12) {
        Boolean bool = x12.f11815G;
        String str = x12.f11828U;
        if (!TextUtils.isEmpty(str)) {
            int iOrdinal = ((C0) P.g.w(str).f5246r).ordinal();
            if (iOrdinal == 0 || iOrdinal == 1) {
                return null;
            }
            if (iOrdinal == 2) {
                return Boolean.TRUE;
            }
            if (iOrdinal == 3) {
                return Boolean.FALSE;
            }
        }
        return bool;
    }

    public static Q1 o0(Service service) {
        P2.w.f(service);
        P2.w.f(service.getApplicationContext());
        if (f11657a0 == null) {
            synchronized (Q1.class) {
                try {
                    if (f11657a0 == null) {
                        I0.j jVar = new I0.j();
                        P2.w.f(service);
                        Context applicationContext = service.getApplicationContext();
                        P2.w.f(applicationContext);
                        jVar.f3229q = applicationContext;
                        f11657a0 = new Q1(jVar);
                    }
                } finally {
                }
            }
        }
        return f11657a0;
    }

    public static final void w(com.google.android.gms.internal.measurement.V0 v02, int i, String str) {
        List listR = v02.r();
        for (int i5 = 0; i5 < listR.size(); i5++) {
            if ("_err".equals(((com.google.android.gms.internal.measurement.Z0) listR.get(i5)).s())) {
                return;
            }
        }
        com.google.android.gms.internal.measurement.Y0 y0R = com.google.android.gms.internal.measurement.Z0.r();
        y0R.m("_err");
        y0R.l(i);
        com.google.android.gms.internal.measurement.Z0 z02 = (com.google.android.gms.internal.measurement.Z0) y0R.h();
        com.google.android.gms.internal.measurement.Y0 y0R2 = com.google.android.gms.internal.measurement.Z0.r();
        y0R2.m("_ev");
        y0R2.n(str);
        com.google.android.gms.internal.measurement.Z0 z03 = (com.google.android.gms.internal.measurement.Z0) y0R2.h();
        v02.o(z02);
        v02.o(z03);
    }

    public static final void x(com.google.android.gms.internal.measurement.V0 v02, String str) {
        List listR = v02.r();
        for (int i = 0; i < listR.size(); i++) {
            if (str.equals(((com.google.android.gms.internal.measurement.Z0) listR.get(i)).s())) {
                v02.k();
                com.google.android.gms.internal.measurement.W0.y((com.google.android.gms.internal.measurement.W0) v02.f9801r, i);
                return;
            }
        }
    }

    public final Boolean A(V v7) {
        try {
            long jS = v7.S();
            C0817r0 c0817r0 = this.f11659B;
            if (jS != -2147483648L) {
                if (v7.S() == U2.b.a(c0817r0.f12142q).c(0, v7.c()).versionCode) {
                    return Boolean.TRUE;
                }
            } else {
                String str = U2.b.a(c0817r0.f12142q).c(0, v7.c()).versionName;
                String strE = v7.e();
                if (strE != null && strE.equals(str)) {
                    return Boolean.TRUE;
                }
            }
            return Boolean.FALSE;
        } catch (PackageManager.NameNotFoundException unused) {
            return null;
        }
    }

    public final void C() {
        c().E();
        if (this.f11665J || this.f11666K || this.f11667L) {
            Z zE = e();
            zE.D.e("Not stopping services. fetch, network, upload", Boolean.valueOf(this.f11665J), Boolean.valueOf(this.f11666K), Boolean.valueOf(this.f11667L));
            return;
        }
        e().D.b("Stopping uploading service(s)");
        ArrayList arrayList = this.f11662F;
        if (arrayList == null) {
            return;
        }
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayList.get(i);
            i++;
            ((Runnable) obj).run();
        }
        ArrayList arrayList2 = this.f11662F;
        P2.w.f(arrayList2);
        arrayList2.clear();
    }

    public final void D(C0623d1 c0623d1, long j8, boolean z8) {
        U1 u12;
        Object obj;
        String str = true != z8 ? "_lte" : "_se";
        C0805n c0805n = this.f11683s;
        L(c0805n);
        U1 u1K0 = c0805n.K0(c0623d1.B(), str);
        if (u1K0 == null || (obj = u1K0.f11739e) == null) {
            String strB = c0623d1.B();
            d().getClass();
            u12 = new U1(strB, "auto", str, System.currentTimeMillis(), Long.valueOf(j8));
        } else {
            String strB2 = c0623d1.B();
            d().getClass();
            u12 = new U1(strB2, "auto", str, System.currentTimeMillis(), Long.valueOf(((Long) obj).longValue() + j8));
        }
        C0668m1 c0668m1R = C0673n1.r();
        c0668m1R.k();
        C0673n1.z((C0673n1) c0668m1R.f9801r, str);
        d().getClass();
        long jCurrentTimeMillis = System.currentTimeMillis();
        c0668m1R.k();
        C0673n1.A((C0673n1) c0668m1R.f9801r, jCurrentTimeMillis);
        Object obj2 = u12.f11739e;
        long jLongValue = ((Long) obj2).longValue();
        c0668m1R.k();
        C0673n1.y((C0673n1) c0668m1R.f9801r, jLongValue);
        C0673n1 c0673n1 = (C0673n1) c0668m1R.h();
        int iY = C0773c0.Y(c0623d1, str);
        if (iY >= 0) {
            c0623d1.k();
            C0628e1.D1((C0628e1) c0623d1.f9801r, iY, c0673n1);
        } else {
            c0623d1.k();
            C0628e1.r0((C0628e1) c0623d1.f9801r, c0673n1);
        }
        if (j8 > 0) {
            C0805n c0805n2 = this.f11683s;
            L(c0805n2);
            c0805n2.s0(u12);
            e().D.d("Updated engagement user property. scope, value", true != z8 ? "lifetime" : "session-scoped", obj2);
        }
    }

    public final void E() {
        c().E();
        if (this.f11663G.isEmpty()) {
            return;
        }
        if (this.X == null) {
            this.X = new z1(this, this.f11659B, 2);
        }
        if (this.X.f12079c != 0) {
            return;
        }
        d().getClass();
        long jMax = Math.max(0L, ((long) ((Integer) I.f11490B0.a(null)).intValue()) - (SystemClock.elapsedRealtime() - this.f11679Y));
        Z zE = e();
        zE.D.c(Long.valueOf(jMax), "Scheduling notify next app runnable, delay in ms");
        if (this.X == null) {
            this.X = new z1(this, this.f11659B, 2);
        }
        this.X.c(jMax);
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0086  */
    /* JADX WARN: Removed duplicated region for block: B:95:0x0329  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void F() {
        boolean z8;
        long jMax;
        long jMax2;
        Integer num;
        int iIntValue;
        I1.a.u(this);
        if (this.f11661E > 0) {
            d().getClass();
            long jAbs = 3600000 - Math.abs(SystemClock.elapsedRealtime() - this.f11661E);
            if (jAbs > 0) {
                e().D.c(Long.valueOf(jAbs), "Upload has been suspended. Will update scheduling later in approximately ms");
                l0().a();
                F1 f12 = this.f11685u;
                L(f12);
                f12.I();
                return;
            }
            this.f11661E = 0L;
        }
        if (!this.f11659B.g() || !H()) {
            e().D.b("Nothing to upload or uploading impossible");
            l0().a();
            F1 f13 = this.f11685u;
            L(f13);
            f13.I();
            return;
        }
        d().getClass();
        long jCurrentTimeMillis = System.currentTimeMillis();
        h0();
        long jMax3 = Math.max(0L, ((Long) I.f11512O.a(null)).longValue());
        C0805n c0805n = this.f11683s;
        L(c0805n);
        if (c0805n.v0("select count(1) > 0 from raw_events where realtime = 1", null) != 0) {
            z8 = true;
        } else {
            C0805n c0805n2 = this.f11683s;
            L(c0805n2);
            if (c0805n2.v0("select count(1) > 0 from queue where has_realtime = 1", null) == 0) {
                z8 = false;
            }
        }
        if (z8) {
            String strI = h0().I("debug.firebase.analytics.app");
            if (TextUtils.isEmpty(strI) || ".none.".equals(strI)) {
                h0();
                jMax = Math.max(0L, ((Long) I.f11501I.a(null)).longValue());
            } else {
                h0();
                jMax = Math.max(0L, ((Long) I.f11503J.a(null)).longValue());
            }
        } else {
            h0();
            jMax = Math.max(0L, ((Long) I.H.a(null)).longValue());
        }
        long jG = this.f11689y.f12207x.g();
        long jG2 = this.f11689y.f12208y.g();
        C0805n c0805n3 = this.f11683s;
        L(c0805n3);
        long jW0 = c0805n3.w0(0L, "select max(bundle_end_timestamp) from queue", null);
        C0805n c0805n4 = this.f11683s;
        L(c0805n4);
        long jMax4 = Math.max(jW0, c0805n4.w0(0L, "select max(timestamp) from raw_events", null));
        C0773c0 c0773c0 = this.f11687w;
        if (jMax4 == 0) {
            jMax2 = 0;
        } else {
            long jAbs2 = jCurrentTimeMillis - Math.abs(jMax4 - jCurrentTimeMillis);
            long jAbs3 = jCurrentTimeMillis - Math.abs(jG - jCurrentTimeMillis);
            long jAbs4 = jCurrentTimeMillis - Math.abs(jG2 - jCurrentTimeMillis);
            long jMin = jMax3 + jAbs2;
            long jMax5 = Math.max(jAbs3, jAbs4);
            if (z8 && jMax5 > 0) {
                jMin = Math.min(jAbs2, jMax5) + jMax;
            }
            L(c0773c0);
            jMax2 = !c0773c0.t0(jMax5, jMax) ? jMax5 + jMax : jMin;
            if (jAbs4 != 0 && jAbs4 >= jAbs2) {
                int i = 0;
                while (true) {
                    h0();
                    if (i >= Math.min(20, Math.max(0, ((Integer) I.f11516Q.a(null)).intValue()))) {
                        break;
                    }
                    h0();
                    jMax2 += Math.max(0L, ((Long) I.f11514P.a(null)).longValue()) * (1 << i);
                    if (jMax2 > jAbs4) {
                        break;
                    } else {
                        i++;
                    }
                }
            }
        }
        if (jMax2 == 0) {
            e().D.b("Next upload time is 0");
            l0().a();
            F1 f14 = this.f11685u;
            L(f14);
            f14.I();
            return;
        }
        C0773c0 c0773c02 = this.f11682r;
        L(c0773c02);
        if (!c0773c02.d0()) {
            e().D.b("No network");
            C0776d0 c0776d0L0 = l0();
            Q1 q12 = c0776d0L0.f11913a;
            q12.k();
            q12.c().E();
            if (!c0776d0L0.f11914b) {
                q12.f11659B.f12142q.registerReceiver(c0776d0L0, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
                C0773c0 c0773c03 = q12.f11682r;
                L(c0773c03);
                c0776d0L0.f11915c = c0773c03.d0();
                q12.e().D.c(Boolean.valueOf(c0776d0L0.f11915c), "Registering connectivity change receiver. Network connected");
                c0776d0L0.f11914b = true;
            }
            F1 f15 = this.f11685u;
            L(f15);
            f15.I();
            return;
        }
        long jG3 = this.f11689y.f12206w.g();
        h0();
        long jMax6 = Math.max(0L, ((Long) I.f11496F.a(null)).longValue());
        L(c0773c0);
        if (!c0773c0.t0(jG3, jMax6)) {
            jMax2 = Math.max(jMax2, jG3 + jMax6);
        }
        l0().a();
        d().getClass();
        long jCurrentTimeMillis2 = jMax2 - System.currentTimeMillis();
        if (jCurrentTimeMillis2 <= 0) {
            h0();
            jCurrentTimeMillis2 = Math.max(0L, ((Long) I.f11505K.a(null)).longValue());
            B0.s0 s0Var = this.f11689y.f12207x;
            d().getClass();
            s0Var.h(System.currentTimeMillis());
        }
        e().D.c(Long.valueOf(jCurrentTimeMillis2), "Upload scheduled in approximately ms");
        F1 f16 = this.f11685u;
        L(f16);
        f16.F();
        C0817r0 c0817r0 = (C0817r0) f16.f5146q;
        c0817r0.getClass();
        Context context = c0817r0.f12142q;
        boolean zA0 = W1.A0(context);
        Z z9 = c0817r0.f12150y;
        if (!zA0) {
            C0817r0.k(z9);
            z9.f11871C.b("Receiver not registered/enabled");
        }
        if (!W1.C0(context)) {
            C0817r0.k(z9);
            z9.f11871C.b("Service not registered/enabled");
        }
        f16.I();
        C0817r0.k(z9);
        z9.D.c(Long.valueOf(jCurrentTimeMillis2), "Scheduling upload, millis");
        c0817r0.D.getClass();
        long jElapsedRealtime = SystemClock.elapsedRealtime() + jCurrentTimeMillis2;
        if (jCurrentTimeMillis2 < Math.max(0L, ((Long) I.f11506L.a(null)).longValue()) && f16.L().f12079c == 0) {
            f16.L().c(jCurrentTimeMillis2);
        }
        if (Build.VERSION.SDK_INT < 24) {
            AlarmManager alarmManager = f16.f11460t;
            if (alarmManager != null) {
                alarmManager.setInexactRepeating(2, jElapsedRealtime, Math.max(((Long) I.f11498G.a(null)).longValue(), jCurrentTimeMillis2), f16.K());
                return;
            }
            return;
        }
        ComponentName componentName = new ComponentName(context, "com.google.android.gms.measurement.AppMeasurementJobService");
        int iJ = f16.J();
        PersistableBundle persistableBundle = new PersistableBundle();
        persistableBundle.putString("action", "com.google.android.gms.measurement.UPLOAD");
        JobInfo jobInfoBuild = new JobInfo.Builder(iJ, componentName).setMinimumLatency(jCurrentTimeMillis2).setOverrideDeadline(jCurrentTimeMillis2 + jCurrentTimeMillis2).setExtras(persistableBundle).build();
        Method method = com.google.android.gms.internal.measurement.F.f9587a;
        JobScheduler jobScheduler = (JobScheduler) context.getSystemService("jobscheduler");
        jobScheduler.getClass();
        Method method2 = com.google.android.gms.internal.measurement.F.f9587a;
        if (method2 == null || context.checkSelfPermission("android.permission.UPDATE_DEVICE_STATS") != 0) {
            jobScheduler.schedule(jobInfoBuild);
            return;
        }
        Method method3 = com.google.android.gms.internal.measurement.F.f9588b;
        if (method3 != null) {
            try {
                num = (Integer) method3.invoke(UserHandle.class, null);
            } catch (IllegalAccessException | InvocationTargetException e8) {
                if (Log.isLoggable("JobSchedulerCompat", 6)) {
                    Log.e("JobSchedulerCompat", "myUserId invocation illegal", e8);
                }
            }
            iIntValue = num != null ? num.intValue() : 0;
        }
        try {
        } catch (IllegalAccessException | InvocationTargetException e9) {
            Log.e("UploadAlarm", "error calling scheduleAsPackage", e9);
            jobScheduler.schedule(jobInfoBuild);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:117:0x0416 A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:118:0x0435 A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:120:0x0450 A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:151:0x051a A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:162:0x055a A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:176:0x05ac A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:205:0x06ce  */
    /* JADX WARN: Removed duplicated region for block: B:215:0x0724 A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:333:0x0b40 A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:334:0x0b63 A[Catch: all -> 0x0117, TryCatch #3 {all -> 0x0117, blocks: (B:3:0x0012, B:5:0x002a, B:8:0x0033, B:9:0x0052, B:12:0x0070, B:15:0x009a, B:17:0x00d7, B:20:0x00f0, B:22:0x00fa, B:207:0x06ea, B:27:0x012f, B:29:0x0141, B:32:0x0151, B:34:0x0157, B:38:0x0161, B:40:0x016e, B:42:0x017c, B:44:0x0182, B:48:0x018d, B:49:0x019b, B:51:0x01ad, B:54:0x01d4, B:56:0x01de, B:58:0x01ee, B:60:0x01fc, B:62:0x020c, B:63:0x0217, B:64:0x021a, B:67:0x0232, B:76:0x0263, B:79:0x0271, B:81:0x027f, B:86:0x02db, B:82:0x02a3, B:84:0x02b3, B:90:0x02ea, B:92:0x0314, B:93:0x033c, B:95:0x0371, B:97:0x0377, B:100:0x0383, B:102:0x03b8, B:103:0x03d5, B:105:0x03df, B:107:0x03ed, B:111:0x0401, B:108:0x03f5, B:114:0x0408, B:117:0x0416, B:118:0x0435, B:120:0x0450, B:121:0x045c, B:124:0x0466, B:130:0x0489, B:127:0x0478, B:133:0x0490, B:135:0x049c, B:137:0x04a8, B:148:0x04f1, B:140:0x04c9, B:143:0x04db, B:145:0x04e1, B:147:0x04eb, B:149:0x050e, B:151:0x051a, B:154:0x052b, B:156:0x053c, B:158:0x0548, B:174:0x05a2, B:176:0x05ac, B:177:0x05b8, B:179:0x05c2, B:181:0x05d2, B:183:0x05dc, B:184:0x05ef, B:186:0x05f5, B:187:0x0610, B:189:0x0616, B:190:0x0634, B:191:0x0643, B:195:0x066e, B:192:0x064b, B:194:0x0659, B:196:0x0676, B:197:0x0695, B:199:0x069b, B:201:0x06ae, B:202:0x06bb, B:204:0x06c2, B:206:0x06d2, B:162:0x055a, B:164:0x0568, B:167:0x057b, B:169:0x058c, B:171:0x0598, B:210:0x0703, B:212:0x0715, B:214:0x071e, B:225:0x074d, B:215:0x0724, B:217:0x072d, B:219:0x0733, B:222:0x073f, B:224:0x0747, B:226:0x0750, B:227:0x075c, B:230:0x0764, B:232:0x0776, B:233:0x0781, B:235:0x0789, B:239:0x07b8, B:241:0x07d4, B:243:0x07e9, B:245:0x0805, B:247:0x081a, B:248:0x0836, B:250:0x083c, B:252:0x0854, B:253:0x0862, B:255:0x0872, B:256:0x0880, B:257:0x0885, B:259:0x08cf, B:261:0x08d5, B:267:0x0900, B:269:0x0908, B:270:0x0926, B:272:0x092c, B:273:0x0940, B:275:0x0957, B:277:0x0968, B:279:0x097a, B:281:0x0984, B:282:0x0987, B:284:0x09e2, B:285:0x09f5, B:288:0x09fd, B:291:0x0a1c, B:293:0x0a35, B:295:0x0a4a, B:297:0x0a4f, B:299:0x0a53, B:301:0x0a57, B:303:0x0a61, B:304:0x0a67, B:306:0x0a6b, B:308:0x0a71, B:309:0x0a7d, B:310:0x0a86, B:375:0x0cf7, B:312:0x0a91, B:314:0x0aa9, B:319:0x0ad1, B:321:0x0af8, B:322:0x0b00, B:324:0x0b06, B:326:0x0b16, B:333:0x0b40, B:334:0x0b63, B:336:0x0b6f, B:338:0x0b85, B:339:0x0bc5, B:345:0x0bdf, B:347:0x0bea, B:349:0x0bee, B:351:0x0bf2, B:353:0x0bf6, B:354:0x0c02, B:355:0x0c07, B:357:0x0c0d, B:359:0x0c23, B:360:0x0c28, B:374:0x0cf2, B:361:0x0c66, B:363:0x0c6a, B:367:0x0c7e, B:369:0x0ca0, B:370:0x0ca7, B:373:0x0ce6, B:364:0x0c6f, B:331:0x0b2a, B:317:0x0ab5, B:376:0x0cff, B:378:0x0d0d, B:379:0x0d21, B:380:0x0d29, B:382:0x0d2f, B:384:0x0d47, B:386:0x0d59, B:406:0x0e08, B:408:0x0e0e, B:410:0x0e25, B:413:0x0e2c, B:418:0x0e6d, B:420:0x0e75, B:422:0x0e8e, B:424:0x0eb0, B:427:0x0ee4, B:428:0x0ee8, B:429:0x0ef2, B:431:0x0f33, B:432:0x0f40, B:434:0x0f4f, B:437:0x0f66, B:439:0x0f7d, B:426:0x0ec3, B:440:0x0f93, B:441:0x0f98, B:414:0x0e3b, B:416:0x0e49, B:417:0x0e54, B:442:0x0f99, B:443:0x0fac, B:447:0x0fcc, B:446:0x0fb7, B:387:0x0d74, B:389:0x0d7a, B:391:0x0d8a, B:393:0x0d91, B:399:0x0da7, B:401:0x0dae, B:403:0x0df9, B:405:0x0e00, B:404:0x0dfd, B:400:0x0dab, B:392:0x0d8e, B:262:0x08e5, B:264:0x08eb, B:266:0x08f1, B:246:0x0817, B:242:0x07e6, B:236:0x078f, B:238:0x0795, B:448:0x0fd6), top: B:460:0x0012, inners: #0, #1, #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:37:0x015e  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x018b  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean G(long j8, String str) {
        boolean z8;
        int i;
        int i5;
        C0817r0 c0817r0;
        C0623d1 c0623d1;
        long j9;
        boolean z9;
        long j10;
        int iQ;
        long jL;
        String str2;
        int i8;
        boolean z10;
        String str3;
        String str4;
        String str5;
        String str6;
        int i9;
        int i10;
        int i11;
        int i12;
        String str7;
        Q1 q12 = this;
        String str8 = "1";
        String str9 = "_ai";
        String str10 = "purchase";
        String str11 = "items";
        q12.i0().P();
        try {
            C0782f0 c0782f0 = new C0782f0(q12);
            q12.i0().t0(str, j8, q12.f11672Q, c0782f0);
            ArrayList arrayList = (ArrayList) c0782f0.f11942d;
            if (arrayList == null || arrayList.isEmpty()) {
                i0().Z();
                z8 = false;
            } else {
                C0623d1 c0623d12 = (C0623d1) ((C0628e1) c0782f0.f11940b).f();
                c0623d12.k();
                C0628e1.w0((C0628e1) c0623d12.f9801r);
                int i13 = -1;
                int i14 = -1;
                int i15 = 0;
                int i16 = 0;
                boolean z11 = false;
                int i17 = 0;
                com.google.android.gms.internal.measurement.V0 v02 = null;
                com.google.android.gms.internal.measurement.V0 v03 = null;
                while (true) {
                    int size = ((ArrayList) c0782f0.f11942d).size();
                    i = i16;
                    String str12 = "_et";
                    boolean z12 = z11;
                    i5 = i17;
                    com.google.android.gms.internal.measurement.V0 v04 = v02;
                    c0817r0 = q12.f11659B;
                    String str13 = str11;
                    c0623d1 = c0623d12;
                    if (i15 >= size) {
                        break;
                    }
                    com.google.android.gms.internal.measurement.V0 v05 = (com.google.android.gms.internal.measurement.V0) ((com.google.android.gms.internal.measurement.W0) ((ArrayList) c0782f0.f11942d).get(i15)).f();
                    if (q12.m0().X(((C0628e1) c0782f0.f11940b).r(), v05.q())) {
                        q12.e().L().d("Dropping blocked raw event. appId", Z.M(((C0628e1) c0782f0.f11940b).r()), c0817r0.p().d(v05.q()));
                        if (!str8.equals(q12.m0().k(((C0628e1) c0782f0.f11940b).r(), "measurement.upload.blacklist_internal")) && !str8.equals(q12.m0().k(((C0628e1) c0782f0.f11940b).r(), "measurement.upload.blacklist_public")) && !"_err".equals(v05.q())) {
                            q12.g();
                            W1.Y(q12.f11680Z, ((C0628e1) c0782f0.f11940b).r(), 11, "_ev", v05.q(), 0);
                        }
                        i16 = i;
                        str2 = str8;
                        str5 = str9;
                        str4 = str10;
                        i10 = i15;
                        v02 = v04;
                        str6 = str13;
                        c0623d12 = c0623d1;
                    } else {
                        Q2.a();
                        str2 = str8;
                        if (q12.h0().R(null, I.f11553g1)) {
                            String strQ = v05.q();
                            if (strQ.equals(str10) || strQ.equals("_iap") || strQ.equals("ecommerce_purchase")) {
                                com.google.android.gms.internal.measurement.Y0 y0R = com.google.android.gms.internal.measurement.Z0.r();
                                i8 = i15;
                                y0R.m("_cbs");
                                if (!z12) {
                                    String strR = ((C0628e1) c0782f0.f11940b).r();
                                    String str14 = (q12.I(strR, str10) && q12.I(strR, "_iap") && q12.I(strR, "ecommerce_purchase")) ? "new_buyer" : "returning_buyer";
                                    y0R.n(str14);
                                    v05.o((com.google.android.gms.internal.measurement.Z0) y0R.h());
                                    z12 = true;
                                }
                            } else {
                                i8 = i15;
                            }
                            if (v05.q().equals(G0.d(str9, G0.f11465c, G0.f11463a))) {
                                v05.k();
                                com.google.android.gms.internal.measurement.W0.z((com.google.android.gms.internal.measurement.W0) v05.f9801r, str9);
                                q12.e().K().b("Renaming ad_impression to _ai");
                                if (Log.isLoggable(q12.e().P(), 5)) {
                                    for (int i18 = 0; i18 < ((com.google.android.gms.internal.measurement.W0) v05.f9801r).o(); i18++) {
                                        if ("ad_platform".equals(v05.p(i18).s()) && !v05.p(i18).t().isEmpty() && "admob".equalsIgnoreCase(v05.p(i18).t())) {
                                            q12.e().f11869A.b("AdMob ad impression logged from app. Potentially duplicative.");
                                        }
                                    }
                                }
                            }
                            boolean zW = q12.m0().W(((C0628e1) c0782f0.f11940b).r(), v05.q());
                            if (zW) {
                                z10 = zW;
                            } else {
                                q12.f();
                                String strQ2 = v05.q();
                                P2.w.c(strQ2);
                                z10 = zW;
                                if (strQ2.hashCode() != 95027 || !strQ2.equals("_ui")) {
                                    str5 = str9;
                                    str4 = str10;
                                    str3 = "_et";
                                    z10 = false;
                                }
                                if (z10) {
                                    ArrayList arrayList2 = new ArrayList(v05.r());
                                    int i19 = -1;
                                    int i20 = -1;
                                    for (int i21 = 0; i21 < arrayList2.size(); i21++) {
                                        if ("value".equals(((com.google.android.gms.internal.measurement.Z0) arrayList2.get(i21)).s())) {
                                            i19 = i21;
                                        } else if ("currency".equals(((com.google.android.gms.internal.measurement.Z0) arrayList2.get(i21)).s())) {
                                            i20 = i21;
                                        }
                                    }
                                    if (i19 != -1) {
                                        if (((com.google.android.gms.internal.measurement.Z0) arrayList2.get(i19)).H() || ((com.google.android.gms.internal.measurement.Z0) arrayList2.get(i19)).F()) {
                                            if (i20 != -1) {
                                                String strT = ((com.google.android.gms.internal.measurement.Z0) arrayList2.get(i20)).t();
                                                if (strT.length() == 3) {
                                                    int iCharCount = 0;
                                                    while (iCharCount < strT.length()) {
                                                        int iCodePointAt = strT.codePointAt(iCharCount);
                                                        if (Character.isLetter(iCodePointAt)) {
                                                            iCharCount += Character.charCount(iCodePointAt);
                                                        }
                                                    }
                                                }
                                            }
                                            q12.e().f11869A.b("Value parameter discarded. You must also supply a 3-letter ISO_4217 currency code in the currency parameter.");
                                            v05.k();
                                            com.google.android.gms.internal.measurement.W0.y((com.google.android.gms.internal.measurement.W0) v05.f9801r, i19);
                                            x(v05, "_c");
                                            w(v05, 19, "currency");
                                            break;
                                        }
                                        q12.e().f11869A.b("Value must be specified with a numeric type.");
                                        v05.k();
                                        com.google.android.gms.internal.measurement.W0.y((com.google.android.gms.internal.measurement.W0) v05.f9801r, i19);
                                        x(v05, "_c");
                                        w(v05, 18, "value");
                                    }
                                }
                                if ("_e".equals(v05.q())) {
                                    c0623d12 = c0623d1;
                                    if ("_vs".equals(v05.q())) {
                                        q12.f();
                                        if (C0773c0.N((com.google.android.gms.internal.measurement.W0) v05.h(), str3) == null) {
                                            if (v04 != null && Math.abs(v04.m() - v05.m()) <= 1000) {
                                                com.google.android.gms.internal.measurement.V0 v06 = (com.google.android.gms.internal.measurement.V0) v04.clone();
                                                if (q12.J(v06, v05)) {
                                                    c0623d12.E(i13, v06);
                                                    v02 = null;
                                                    v03 = null;
                                                }
                                            }
                                            i14 = i;
                                            v03 = v05;
                                        }
                                    }
                                    v02 = v04;
                                } else {
                                    q12.f();
                                    if (C0773c0.N((com.google.android.gms.internal.measurement.W0) v05.h(), "_fr") == null) {
                                        if (v03 != null && Math.abs(v03.m() - v05.m()) <= 1000) {
                                            com.google.android.gms.internal.measurement.V0 v07 = (com.google.android.gms.internal.measurement.V0) v03.clone();
                                            if (q12.J(v05, v07)) {
                                                c0623d12 = c0623d1;
                                                c0623d12.E(i14, v07);
                                                v02 = null;
                                                v03 = null;
                                            }
                                        }
                                        c0623d12 = c0623d1;
                                        i13 = i;
                                        v02 = v05;
                                    } else {
                                        c0623d12 = c0623d1;
                                        v02 = v04;
                                    }
                                }
                                if (((com.google.android.gms.internal.measurement.W0) v05.f9801r).o() == 0) {
                                    q12.f();
                                    Bundle bundleM = C0773c0.M(v05.r());
                                    int i22 = 0;
                                    while (i22 < ((com.google.android.gms.internal.measurement.W0) v05.f9801r).o()) {
                                        com.google.android.gms.internal.measurement.Z0 z0P = v05.p(i22);
                                        String str15 = str13;
                                        if (!z0P.s().equals(str15) || z0P.u().isEmpty()) {
                                            i11 = i13;
                                            i12 = i22;
                                            if (!z0P.s().equals(str15)) {
                                                q12.a0(v05.q(), (com.google.android.gms.internal.measurement.Y0) z0P.f(), bundleM, ((C0628e1) c0782f0.f11940b).r());
                                            }
                                        } else {
                                            String strR2 = ((C0628e1) c0782f0.f11940b).r();
                                            List listU = z0P.u();
                                            Bundle[] bundleArr = new Bundle[listU.size()];
                                            int i23 = 0;
                                            while (i23 < listU.size()) {
                                                com.google.android.gms.internal.measurement.Z0 z02 = (com.google.android.gms.internal.measurement.Z0) listU.get(i23);
                                                q12.f();
                                                int i24 = i13;
                                                Bundle bundleM2 = C0773c0.M(z02.u());
                                                Iterator it = z02.u().iterator();
                                                while (it.hasNext()) {
                                                    q12.a0(v05.q(), (com.google.android.gms.internal.measurement.Y0) ((com.google.android.gms.internal.measurement.Z0) it.next()).f(), bundleM2, strR2);
                                                    i22 = i22;
                                                    listU = listU;
                                                }
                                                bundleArr[i23] = bundleM2;
                                                i23++;
                                                i13 = i24;
                                                i22 = i22;
                                                listU = listU;
                                            }
                                            i11 = i13;
                                            i12 = i22;
                                            bundleM.putParcelableArray(str15, bundleArr);
                                        }
                                        i22 = i12 + 1;
                                        i13 = i11;
                                        str13 = str15;
                                    }
                                    str6 = str13;
                                    i9 = i13;
                                    v05.k();
                                    com.google.android.gms.internal.measurement.W0.x((com.google.android.gms.internal.measurement.W0) v05.f9801r);
                                    C0773c0 c0773c0F = q12.f();
                                    ArrayList arrayList3 = new ArrayList();
                                    for (String str16 : bundleM.keySet()) {
                                        com.google.android.gms.internal.measurement.Y0 y0R2 = com.google.android.gms.internal.measurement.Z0.r();
                                        y0R2.m(str16);
                                        Object obj = bundleM.get(str16);
                                        if (obj != null) {
                                            c0773c0F.q0(y0R2, obj);
                                            arrayList3.add((com.google.android.gms.internal.measurement.Z0) y0R2.h());
                                        }
                                    }
                                    int size2 = arrayList3.size();
                                    int i25 = 0;
                                    while (i25 < size2) {
                                        Object obj2 = arrayList3.get(i25);
                                        i25++;
                                        v05.o((com.google.android.gms.internal.measurement.Z0) obj2);
                                    }
                                } else {
                                    str6 = str13;
                                    i9 = i13;
                                }
                                i10 = i8;
                                ((ArrayList) c0782f0.f11942d).set(i10, (com.google.android.gms.internal.measurement.W0) v05.h());
                                c0623d12.W(v05);
                                i16 = i + 1;
                                i13 = i9;
                            }
                            str5 = str9;
                            int i26 = 0;
                            boolean z13 = false;
                            boolean z14 = false;
                            while (true) {
                                str4 = str10;
                                if (i26 >= ((com.google.android.gms.internal.measurement.W0) v05.f9801r).o()) {
                                    break;
                                }
                                if ("_c".equals(v05.p(i26).s())) {
                                    com.google.android.gms.internal.measurement.Y0 y02 = (com.google.android.gms.internal.measurement.Y0) v05.p(i26).f();
                                    str7 = str12;
                                    y02.l(1L);
                                    com.google.android.gms.internal.measurement.Z0 z03 = (com.google.android.gms.internal.measurement.Z0) y02.h();
                                    v05.k();
                                    com.google.android.gms.internal.measurement.W0.A((com.google.android.gms.internal.measurement.W0) v05.f9801r, i26, z03);
                                    z13 = true;
                                } else {
                                    str7 = str12;
                                    if ("_r".equals(v05.p(i26).s())) {
                                        com.google.android.gms.internal.measurement.Y0 y03 = (com.google.android.gms.internal.measurement.Y0) v05.p(i26).f();
                                        y03.l(1L);
                                        com.google.android.gms.internal.measurement.Z0 z04 = (com.google.android.gms.internal.measurement.Z0) y03.h();
                                        v05.k();
                                        com.google.android.gms.internal.measurement.W0.A((com.google.android.gms.internal.measurement.W0) v05.f9801r, i26, z04);
                                        z14 = true;
                                        z13 = z13;
                                    }
                                }
                                i26++;
                                str10 = str4;
                                str12 = str7;
                            }
                            str3 = str12;
                            if (!z13 && z10) {
                                q12.e().K().c(c0817r0.p().d(v05.q()), "Marking event as conversion");
                                com.google.android.gms.internal.measurement.Y0 y0R3 = com.google.android.gms.internal.measurement.Z0.r();
                                y0R3.m("_c");
                                y0R3.l(1L);
                                v05.n(y0R3);
                            }
                            if (!z14) {
                                q12.e().K().c(c0817r0.p().d(v05.q()), "Marking event as real-time");
                                com.google.android.gms.internal.measurement.Y0 y0R4 = com.google.android.gms.internal.measurement.Z0.r();
                                y0R4.m("_r");
                                y0R4.l(1L);
                                v05.n(y0R4);
                            }
                            if (q12.i0().E0(q12.v(), ((C0628e1) c0782f0.f11940b).r(), false, true, false, false).f12012e > q12.h0().K(((C0628e1) c0782f0.f11940b).r(), I.f11577p)) {
                                x(v05, "_r");
                            } else {
                                i5 = 1;
                            }
                            if (W1.z0(v05.q()) && z10 && q12.i0().E0(q12.v(), ((C0628e1) c0782f0.f11940b).r(), true, false, false, false).f12010c > q12.h0().K(((C0628e1) c0782f0.f11940b).r(), I.f11574o)) {
                                q12.e().L().c(Z.M(((C0628e1) c0782f0.f11940b).r()), "Too many conversions. Not logging as conversion. appId");
                                int i27 = -1;
                                com.google.android.gms.internal.measurement.Y0 y04 = null;
                                boolean z15 = false;
                                for (int i28 = 0; i28 < ((com.google.android.gms.internal.measurement.W0) v05.f9801r).o(); i28++) {
                                    com.google.android.gms.internal.measurement.Z0 z0P2 = v05.p(i28);
                                    if ("_c".equals(z0P2.s())) {
                                        y04 = (com.google.android.gms.internal.measurement.Y0) z0P2.f();
                                        i27 = i28;
                                    } else if ("_err".equals(z0P2.s())) {
                                        z15 = true;
                                    }
                                }
                                if (z15) {
                                    if (y04 != null) {
                                        v05.k();
                                        com.google.android.gms.internal.measurement.W0.y((com.google.android.gms.internal.measurement.W0) v05.f9801r, i27);
                                    } else {
                                        y04 = null;
                                        if (y04 == null) {
                                        }
                                    }
                                } else if (y04 == null) {
                                    com.google.android.gms.internal.measurement.Y0 y05 = (com.google.android.gms.internal.measurement.Y0) y04.clone();
                                    y05.m("_err");
                                    y05.l(10L);
                                    com.google.android.gms.internal.measurement.Z0 z05 = (com.google.android.gms.internal.measurement.Z0) y05.h();
                                    v05.k();
                                    com.google.android.gms.internal.measurement.W0.A((com.google.android.gms.internal.measurement.W0) v05.f9801r, i27, z05);
                                } else {
                                    q12.e().J().c(Z.M(((C0628e1) c0782f0.f11940b).r()), "Did not find conversion parameter. appId");
                                }
                            }
                            if (z10) {
                            }
                            if ("_e".equals(v05.q())) {
                            }
                            if (((com.google.android.gms.internal.measurement.W0) v05.f9801r).o() == 0) {
                            }
                            i10 = i8;
                            ((ArrayList) c0782f0.f11942d).set(i10, (com.google.android.gms.internal.measurement.W0) v05.h());
                            c0623d12.W(v05);
                            i16 = i + 1;
                            i13 = i9;
                        }
                    }
                    z11 = z12;
                    i17 = i5;
                    int i29 = i10 + 1;
                    str11 = str6;
                    str9 = str5;
                    str10 = str4;
                    i15 = i29;
                    str8 = str2;
                }
                long j11 = 0;
                int i30 = i;
                long jLongValue = 0;
                int i31 = 0;
                while (i31 < i30) {
                    com.google.android.gms.internal.measurement.W0 w0J2 = ((C0628e1) c0623d1.f9801r).j2(i31);
                    if ("_e".equals(w0J2.t())) {
                        q12.f();
                        if (C0773c0.N(w0J2, "_fr") != null) {
                            c0623d1.m(i31);
                            i30--;
                            i31--;
                        } else {
                            q12.f();
                            com.google.android.gms.internal.measurement.Z0 z0N = C0773c0.N(w0J2, "_et");
                            if (z0N != null) {
                                Long lValueOf = z0N.H() ? Long.valueOf(z0N.q()) : null;
                                if (lValueOf != null && lValueOf.longValue() > 0) {
                                    jLongValue += lValueOf.longValue();
                                }
                            }
                        }
                    }
                    i31++;
                }
                q12.D(c0623d1, jLongValue, false);
                Iterator it2 = c0623d1.C().iterator();
                while (true) {
                    if (!it2.hasNext()) {
                        break;
                    }
                    if ("_s".equals(((com.google.android.gms.internal.measurement.W0) it2.next()).t())) {
                        q12.i0().X(c0623d1.B(), "_se");
                        break;
                    }
                }
                if (C0773c0.Y(c0623d1, "_sid") >= 0) {
                    q12.D(c0623d1, jLongValue, true);
                } else {
                    int iY = C0773c0.Y(c0623d1, "_se");
                    if (iY >= 0) {
                        c0623d1.k();
                        C0628e1.G0((C0628e1) c0623d1.f9801r, iY);
                        q12.e().J().c(Z.M(((C0628e1) c0782f0.f11940b).r()), "Session engagement user property is in the bundle without session ID. appId");
                    }
                }
                String strR3 = ((C0628e1) c0782f0.f11940b).r();
                q12.c().E();
                q12.k();
                V vB0 = q12.i0().B0(strR3);
                if (vB0 == null) {
                    q12.e().J().c(Z.M(strR3), "Cannot fix consent fields without appInfo. appId");
                } else {
                    q12.o(vB0, c0623d1);
                }
                String strR4 = ((C0628e1) c0782f0.f11940b).r();
                q12.c().E();
                q12.k();
                V vB02 = q12.i0().B0(strR4);
                if (vB02 == null) {
                    q12.e().L().c(Z.M(strR4), "Cannot populate ad_campaign_info without appInfo. appId");
                } else {
                    q12.N(vB02, c0623d1);
                }
                c0623d1.k();
                C0628e1.y1((C0628e1) c0623d1.f9801r, Long.MAX_VALUE);
                c0623d1.k();
                C0628e1.e0((C0628e1) c0623d1.f9801r, Long.MIN_VALUE);
                for (int i32 = 0; i32 < c0623d1.T(); i32++) {
                    com.google.android.gms.internal.measurement.W0 w0J22 = ((C0628e1) c0623d1.f9801r).j2(i32);
                    if (w0J22.q() < ((C0628e1) c0623d1.f9801r).d2()) {
                        long jQ = w0J22.q();
                        c0623d1.k();
                        C0628e1.y1((C0628e1) c0623d1.f9801r, jQ);
                    }
                    if (w0J22.q() > ((C0628e1) c0623d1.f9801r).Z1()) {
                        long jQ2 = w0J22.q();
                        c0623d1.k();
                        C0628e1.e0((C0628e1) c0623d1.f9801r, jQ2);
                    }
                }
                c0623d1.l();
                F0 f02 = F0.f11457c;
                F0 f0F = q12.n0(((C0628e1) c0782f0.f11940b).r()).f(F0.e(100, ((C0628e1) c0782f0.f11940b).w()));
                F0 f0H0 = q12.i0().H0(((C0628e1) c0782f0.f11940b).r());
                q12.i0().b0(((C0628e1) c0782f0.f11940b).r(), f0F);
                E0 e02 = E0.f11448s;
                if (!f0F.k(e02) && f0H0.k(e02)) {
                    q12.i0().Q(((C0628e1) c0782f0.f11940b).r());
                } else if (f0F.k(e02) && !f0H0.k(e02)) {
                    q12.i0().Y(((C0628e1) c0782f0.f11940b).r());
                }
                E0 e03 = E0.f11447r;
                if (!f0F.k(e03)) {
                    c0623d1.k();
                    C0628e1.B0((C0628e1) c0623d1.f9801r);
                    c0623d1.k();
                    C0628e1.y0((C0628e1) c0623d1.f9801r);
                    c0623d1.k();
                    C0628e1.v0((C0628e1) c0623d1.f9801r);
                }
                if (!f0F.k(e02)) {
                    c0623d1.k();
                    C0628e1.s0((C0628e1) c0623d1.f9801r);
                    c0623d1.k();
                    C0628e1.C0((C0628e1) c0623d1.f9801r);
                }
                J3.b();
                if (q12.h0().R(((C0628e1) c0782f0.f11940b).r(), I.W0)) {
                    q12.g();
                    if (W1.m0(((C0628e1) c0782f0.f11940b).r()) && q12.n0(((C0628e1) c0782f0.f11940b).r()).k(e03) && ((C0628e1) c0782f0.f11940b).F1()) {
                        q12.p(c0623d1, c0782f0);
                    }
                }
                c0623d1.k();
                C0628e1.t0((C0628e1) c0623d1.f9801r);
                c0623d1.U(q12.g0().I(c0623d1.B(), c0623d1.C(), Collections.unmodifiableList(((C0628e1) c0623d1.f9801r).K()), Long.valueOf(((C0628e1) c0623d1.f9801r).d2()), Long.valueOf(((C0628e1) c0623d1.f9801r).Z1()), !f0F.k(e02)));
                if (q12.h0().G(((C0628e1) c0782f0.f11940b).r())) {
                    HashMap map = new HashMap();
                    ArrayList arrayList4 = new ArrayList();
                    SecureRandom secureRandomQ = q12.g().Q();
                    int i33 = 0;
                    while (i33 < c0623d1.T()) {
                        com.google.android.gms.internal.measurement.V0 v08 = (com.google.android.gms.internal.measurement.V0) ((C0628e1) c0623d1.f9801r).j2(i33).f();
                        if (v08.q().equals("_ep")) {
                            q12.f();
                            String str17 = (String) C0773c0.O((com.google.android.gms.internal.measurement.W0) v08.h(), "_en");
                            C0819s c0819sG0 = (C0819s) map.get(str17);
                            if (c0819sG0 == null) {
                                C0805n c0805nI0 = q12.i0();
                                String strR5 = ((C0628e1) c0782f0.f11940b).r();
                                P2.w.f(str17);
                                c0819sG0 = c0805nI0.g0("events", strR5, str17);
                                if (c0819sG0 != null) {
                                    map.put(str17, c0819sG0);
                                }
                            }
                            if (c0819sG0 != null && c0819sG0.i == null) {
                                Long l8 = c0819sG0.f12163j;
                                if (l8 != null && l8.longValue() > 1) {
                                    q12.f();
                                    C0773c0.L(v08, "_sr", l8);
                                }
                                Boolean bool = c0819sG0.f12164k;
                                if (bool != null && bool.booleanValue()) {
                                    q12.f();
                                    C0773c0.L(v08, "_efs", 1L);
                                }
                                arrayList4.add((com.google.android.gms.internal.measurement.W0) v08.h());
                            }
                            c0623d1.E(i33, v08);
                            j10 = j11;
                        } else {
                            C0803m0 c0803m0M0 = q12.m0();
                            String strR6 = ((C0628e1) c0782f0.f11940b).r();
                            String strK = c0803m0M0.k(strR6, "measurement.account.time_zone_offset_minutes");
                            if (TextUtils.isEmpty(strK)) {
                                j10 = j11;
                            } else {
                                try {
                                    j10 = j11;
                                    j11 = Long.parseLong(strK);
                                } catch (NumberFormatException e8) {
                                    j10 = j11;
                                    ((C0817r0) c0803m0M0.f5146q).e().L().d("Unable to parse timezone offset. appId", Z.M(strR6), e8);
                                    j11 = j10;
                                }
                            }
                            q12.g();
                            long j12 = j11 * 60000;
                            long jM = (j12 + v08.m()) / 86400000;
                            com.google.android.gms.internal.measurement.W0 w02 = (com.google.android.gms.internal.measurement.W0) v08.h();
                            Long l9 = 1L;
                            if (TextUtils.isEmpty("_dbg")) {
                                iQ = m0().Q(((C0628e1) c0782f0.f11940b).r(), v08.q());
                                if (iQ > 0) {
                                }
                            } else {
                                Iterator it3 = w02.u().iterator();
                                while (true) {
                                    if (!it3.hasNext()) {
                                        break;
                                    }
                                    com.google.android.gms.internal.measurement.Z0 z06 = (com.google.android.gms.internal.measurement.Z0) it3.next();
                                    if ("_dbg".equals(z06.s())) {
                                        if (l9.equals(Long.valueOf(z06.q()))) {
                                            iQ = 1;
                                        }
                                    }
                                }
                                iQ = m0().Q(((C0628e1) c0782f0.f11940b).r(), v08.q());
                                if (iQ > 0) {
                                    e().L().d("Sample rate must be positive. event, rate", v08.q(), Integer.valueOf(iQ));
                                    arrayList4.add((com.google.android.gms.internal.measurement.W0) v08.h());
                                    c0623d1.E(i33, v08);
                                } else {
                                    C0819s c0819sA = (C0819s) map.get(v08.q());
                                    if (c0819sA == null && (c0819sA = i0().g0("events", ((C0628e1) c0782f0.f11940b).r(), v08.q())) == null) {
                                        e().L().d("Event being bundled has no eventAggregate. appId, eventName", ((C0628e1) c0782f0.f11940b).r(), v08.q());
                                        c0819sA = new C0819s(((C0628e1) c0782f0.f11940b).r(), v08.q(), 1L, 1L, 1L, v08.m(), 0L, null, null, null, null);
                                    }
                                    f();
                                    Long l10 = (Long) C0773c0.O((com.google.android.gms.internal.measurement.W0) v08.h(), "_eid");
                                    boolean z16 = l10 != null;
                                    if (iQ == 1) {
                                        arrayList4.add((com.google.android.gms.internal.measurement.W0) v08.h());
                                        if (z16 && (c0819sA.i != null || c0819sA.f12163j != null || c0819sA.f12164k != null)) {
                                            map.put(v08.q(), c0819sA.a(null, null, null));
                                        }
                                        c0623d1.E(i33, v08);
                                    } else {
                                        if (secureRandomQ.nextInt(iQ) == 0) {
                                            f();
                                            Long lValueOf2 = Long.valueOf(iQ);
                                            C0773c0.L(v08, "_sr", lValueOf2);
                                            arrayList4.add((com.google.android.gms.internal.measurement.W0) v08.h());
                                            if (z16) {
                                                c0819sA = c0819sA.a(null, lValueOf2, null);
                                            }
                                            map.put(v08.q(), new C0819s(c0819sA.f12155a, c0819sA.f12156b, c0819sA.f12157c, c0819sA.f12158d, c0819sA.f12159e, c0819sA.f12160f, v08.m(), Long.valueOf(jM), c0819sA.i, c0819sA.f12163j, c0819sA.f12164k));
                                        } else {
                                            Long l11 = c0819sA.f12162h;
                                            if (l11 != null) {
                                                jL = l11.longValue();
                                            } else {
                                                g();
                                                jL = (j12 + v08.l()) / 86400000;
                                            }
                                            if (jL != jM) {
                                                f();
                                                C0773c0.L(v08, "_efs", 1L);
                                                f();
                                                Long lValueOf3 = Long.valueOf(iQ);
                                                C0773c0.L(v08, "_sr", lValueOf3);
                                                arrayList4.add((com.google.android.gms.internal.measurement.W0) v08.h());
                                                if (z16) {
                                                    c0819sA = c0819sA.a(null, lValueOf3, Boolean.TRUE);
                                                }
                                                map.put(v08.q(), new C0819s(c0819sA.f12155a, c0819sA.f12156b, c0819sA.f12157c, c0819sA.f12158d, c0819sA.f12159e, c0819sA.f12160f, v08.m(), Long.valueOf(jM), c0819sA.i, c0819sA.f12163j, c0819sA.f12164k));
                                            } else if (z16) {
                                                map.put(v08.q(), c0819sA.a(l10, null, null));
                                            }
                                        }
                                        c0623d1.E(i33, v08);
                                    }
                                }
                            }
                            i33++;
                            q12 = this;
                            j11 = j10;
                        }
                        i33++;
                        q12 = this;
                        j11 = j10;
                    }
                    j9 = j11;
                    z9 = true;
                    if (arrayList4.size() < c0623d1.T()) {
                        c0623d1.k();
                        C0628e1.w0((C0628e1) c0623d1.f9801r);
                        c0623d1.k();
                        C0628e1.n0((C0628e1) c0623d1.f9801r, arrayList4);
                    }
                    Iterator it4 = map.entrySet().iterator();
                    while (it4.hasNext()) {
                        i0().l0("events", (C0819s) ((Map.Entry) it4.next()).getValue());
                    }
                } else {
                    j9 = 0;
                    z9 = true;
                }
                String strR7 = ((C0628e1) c0782f0.f11940b).r();
                V vB03 = i0().B0(strR7);
                if (vB03 == null) {
                    e().J().c(Z.M(((C0628e1) c0782f0.f11940b).r()), "Bundling raw events w/o app info. appId");
                } else if (c0623d1.T() > 0) {
                    C0815q0 c0815q0 = vB03.f11758a.f12151z;
                    C0817r0.k(c0815q0);
                    c0815q0.E();
                    long j13 = vB03.i;
                    if (j13 != j9) {
                        c0623d1.M(j13);
                    } else {
                        c0623d1.Z();
                    }
                    C0815q0 c0815q02 = vB03.f11758a.f12151z;
                    C0817r0.k(c0815q02);
                    c0815q02.E();
                    long j14 = vB03.f11765h;
                    if (j14 != j9) {
                        j13 = j14;
                    }
                    if (j13 != j9) {
                        c0623d1.N(j13);
                    } else {
                        c0623d1.a0();
                    }
                    vB03.j(c0623d1.T());
                    C0815q0 c0815q03 = vB03.f11758a.f12151z;
                    C0817r0.k(c0815q03);
                    c0815q03.E();
                    int i34 = (int) vB03.f11745G;
                    c0623d1.k();
                    C0628e1.Y((C0628e1) c0623d1.f9801r, i34);
                    C0815q0 c0815q04 = vB03.f11758a.f12151z;
                    C0817r0.k(c0815q04);
                    c0815q04.E();
                    c0623d1.v((int) vB03.f11764g);
                    vB03.N(((C0628e1) c0623d1.f9801r).d2());
                    vB03.L(((C0628e1) c0623d1.f9801r).Z1());
                    String strB = vB03.b();
                    if (strB != null) {
                        c0623d1.J(strB);
                    } else {
                        c0623d1.Y();
                    }
                    i0().a0(vB03, false);
                }
                if (c0623d1.T() > 0) {
                    c0817r0.getClass();
                    com.google.android.gms.internal.measurement.G0 g0T = m0().T(((C0628e1) c0782f0.f11940b).r());
                    if (g0T != null && g0T.H()) {
                        long jP = g0T.p();
                        c0623d1.k();
                        C0628e1.U((C0628e1) c0623d1.f9801r, jP);
                    } else if (((C0628e1) c0782f0.f11940b).B().isEmpty()) {
                        c0623d1.k();
                        C0628e1.U((C0628e1) c0623d1.f9801r, -1L);
                    } else {
                        e().L().c(Z.M(((C0628e1) c0782f0.f11940b).r()), "Did not find measurement config or missing version info. appId");
                    }
                    C0805n c0805nI02 = i0();
                    C0817r0 c0817r02 = (C0817r0) c0805nI02.f5146q;
                    C0628e1 c0628e1 = (C0628e1) c0623d1.h();
                    c0805nI02.E();
                    c0805nI02.F();
                    P2.w.c(c0628e1.r());
                    if (!c0628e1.X0()) {
                        throw new IllegalStateException();
                    }
                    c0805nI02.W();
                    long jA = c0817r02.d().a();
                    long jZ1 = c0628e1.Z1();
                    H h8 = I.f11518R;
                    if (jZ1 < jA - ((Long) h8.a(null)).longValue() || c0628e1.Z1() > ((Long) h8.a(null)).longValue() + jA) {
                        c0817r02.e().L().e("Storing bundle outside of the max uploading time span. appId, now, timestamp", Z.M(c0628e1.r()), Long.valueOf(jA), Long.valueOf(c0628e1.Z1()));
                    }
                    try {
                        byte[] bArrJ = c0805nI02.f11473r.f().J(c0628e1.c());
                        c0817r02.e().K().c(Integer.valueOf(bArrJ.length), "Saving bundle, size");
                        ContentValues contentValues = new ContentValues();
                        contentValues.put("app_id", c0628e1.r());
                        contentValues.put("bundle_end_timestamp", Long.valueOf(c0628e1.Z1()));
                        contentValues.put("data", bArrJ);
                        contentValues.put("has_realtime", Integer.valueOf(i5));
                        if (c0628e1.e1()) {
                            contentValues.put("retry_count", Integer.valueOf(c0628e1.S1()));
                        }
                        try {
                            if (c0805nI02.A0().insert("queue", null, contentValues) == -1) {
                                c0817r02.e().J().c(Z.M(c0628e1.r()), "Failed to insert bundle (got -1). appId");
                            }
                        } catch (SQLiteException e9) {
                            c0817r02.e().J().d("Error storing bundle. appId", Z.M(c0628e1.r()), e9);
                        }
                    } catch (IOException e10) {
                        c0817r02.e().J().d("Data loss. Failed to serialize bundle. appId", Z.M(c0628e1.r()), e10);
                    }
                }
                i0().R((ArrayList) c0782f0.f11941c);
                C0805n c0805nI03 = i0();
                try {
                    c0805nI03.A0().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[]{strR7, strR7});
                } catch (SQLiteException e11) {
                    ((C0817r0) c0805nI03.f5146q).e().J().d("Failed to remove unused event metadata. appId", Z.M(strR7), e11);
                }
                i0().Z();
                z8 = z9;
            }
            i0().T();
            return z8;
        } catch (Throwable th) {
            i0().T();
            throw th;
        }
    }

    public final boolean H() {
        I1.a.u(this);
        C0805n c0805n = this.f11683s;
        L(c0805n);
        if (c0805n.v0("select count(1) > 0 from raw_events", null) != 0) {
            return true;
        }
        C0805n c0805n2 = this.f11683s;
        L(c0805n2);
        return !TextUtils.isEmpty(c0805n2.I());
    }

    public final boolean I(String str, String str2) {
        C0805n c0805n = this.f11683s;
        L(c0805n);
        C0819s c0819sG0 = c0805n.g0("events", str, str2);
        return c0819sG0 == null || c0819sG0.f12157c < 1;
    }

    public final boolean J(com.google.android.gms.internal.measurement.V0 v02, com.google.android.gms.internal.measurement.V0 v03) {
        P2.w.a("_e".equals(v02.q()));
        f();
        com.google.android.gms.internal.measurement.Z0 z0N = C0773c0.N((com.google.android.gms.internal.measurement.W0) v02.h(), "_sc");
        String strT = z0N == null ? null : z0N.t();
        f();
        com.google.android.gms.internal.measurement.Z0 z0N2 = C0773c0.N((com.google.android.gms.internal.measurement.W0) v03.h(), "_pc");
        String strT2 = z0N2 != null ? z0N2.t() : null;
        if (strT2 == null || !strT2.equals(strT)) {
            return false;
        }
        P2.w.a("_e".equals(v02.q()));
        f();
        com.google.android.gms.internal.measurement.Z0 z0N3 = C0773c0.N((com.google.android.gms.internal.measurement.W0) v02.h(), "_et");
        if (z0N3 == null || !z0N3.H() || z0N3.q() <= 0) {
            return true;
        }
        long jQ = z0N3.q();
        f();
        com.google.android.gms.internal.measurement.Z0 z0N4 = C0773c0.N((com.google.android.gms.internal.measurement.W0) v03.h(), "_et");
        if (z0N4 != null && z0N4.q() > 0) {
            jQ += z0N4.q();
        }
        f();
        C0773c0.L(v03, "_et", Long.valueOf(jQ));
        f();
        C0773c0.L(v02, "_fr", 1L);
        return true;
    }

    public final void N(V v7, C0623d1 c0623d1) {
        c().E();
        k();
        com.google.android.gms.internal.measurement.M0 m0X = com.google.android.gms.internal.measurement.N0.x();
        C0817r0 c0817r0 = v7.f11758a;
        C0815q0 c0815q0 = c0817r0.f12151z;
        C0817r0.k(c0815q0);
        c0815q0.E();
        byte[] bArr = v7.f11746I;
        if (bArr != null) {
            try {
                m0X = (com.google.android.gms.internal.measurement.M0) C0773c0.k0(m0X, bArr);
            } catch (C0654j2 unused) {
                e().f11878y.c(Z.M(v7.c()), "Failed to parse locally stored ad campaign info. appId");
            }
        }
        for (com.google.android.gms.internal.measurement.W0 w02 : c0623d1.C()) {
            if (w02.t().equals("_cmp")) {
                Serializable serializableO = C0773c0.O(w02, "gclid");
                if (serializableO == null) {
                    serializableO = "";
                }
                String str = (String) serializableO;
                Serializable serializableO2 = C0773c0.O(w02, "gbraid");
                if (serializableO2 == null) {
                    serializableO2 = "";
                }
                String str2 = (String) serializableO2;
                Serializable serializableO3 = C0773c0.O(w02, "gad_source");
                String str3 = (String) (serializableO3 != null ? serializableO3 : "");
                if (!str.isEmpty() || !str2.isEmpty()) {
                    Serializable serializableO4 = C0773c0.O(w02, "click_timestamp");
                    long jLongValue = ((Long) (serializableO4 != null ? serializableO4 : 0L)).longValue();
                    if (jLongValue <= 0) {
                        jLongValue = w02.q();
                    }
                    if ("referrer API v2".equals(C0773c0.O(w02, "_cis"))) {
                        if (jLongValue > ((com.google.android.gms.internal.measurement.N0) m0X.f9801r).w()) {
                            if (str.isEmpty()) {
                                m0X.k();
                                com.google.android.gms.internal.measurement.N0.K((com.google.android.gms.internal.measurement.N0) m0X.f9801r);
                            } else {
                                m0X.k();
                                com.google.android.gms.internal.measurement.N0.S((com.google.android.gms.internal.measurement.N0) m0X.f9801r, str);
                            }
                            if (str2.isEmpty()) {
                                m0X.k();
                                com.google.android.gms.internal.measurement.N0.J((com.google.android.gms.internal.measurement.N0) m0X.f9801r);
                            } else {
                                m0X.k();
                                com.google.android.gms.internal.measurement.N0.R((com.google.android.gms.internal.measurement.N0) m0X.f9801r, str2);
                            }
                            if (str3.isEmpty()) {
                                m0X.k();
                                com.google.android.gms.internal.measurement.N0.I((com.google.android.gms.internal.measurement.N0) m0X.f9801r);
                            } else {
                                m0X.k();
                                com.google.android.gms.internal.measurement.N0.Q((com.google.android.gms.internal.measurement.N0) m0X.f9801r, str3);
                            }
                            m0X.k();
                            com.google.android.gms.internal.measurement.N0.P((com.google.android.gms.internal.measurement.N0) m0X.f9801r, jLongValue);
                        }
                    } else if (jLongValue > ((com.google.android.gms.internal.measurement.N0) m0X.f9801r).v()) {
                        if (str.isEmpty()) {
                            m0X.k();
                            com.google.android.gms.internal.measurement.N0.H((com.google.android.gms.internal.measurement.N0) m0X.f9801r);
                        } else {
                            m0X.k();
                            com.google.android.gms.internal.measurement.N0.N((com.google.android.gms.internal.measurement.N0) m0X.f9801r, str);
                        }
                        if (str2.isEmpty()) {
                            m0X.k();
                            com.google.android.gms.internal.measurement.N0.G((com.google.android.gms.internal.measurement.N0) m0X.f9801r);
                        } else {
                            m0X.k();
                            com.google.android.gms.internal.measurement.N0.M((com.google.android.gms.internal.measurement.N0) m0X.f9801r, str2);
                        }
                        if (str3.isEmpty()) {
                            m0X.k();
                            com.google.android.gms.internal.measurement.N0.F((com.google.android.gms.internal.measurement.N0) m0X.f9801r);
                        } else {
                            m0X.k();
                            com.google.android.gms.internal.measurement.N0.L((com.google.android.gms.internal.measurement.N0) m0X.f9801r, str3);
                        }
                        m0X.k();
                        com.google.android.gms.internal.measurement.N0.O((com.google.android.gms.internal.measurement.N0) m0X.f9801r, jLongValue);
                    }
                }
            }
        }
        if (!((com.google.android.gms.internal.measurement.N0) m0X.h()).equals(com.google.android.gms.internal.measurement.N0.y())) {
            com.google.android.gms.internal.measurement.N0 n02 = (com.google.android.gms.internal.measurement.N0) m0X.h();
            c0623d1.k();
            C0628e1.H0((C0628e1) c0623d1.f9801r, n02);
        }
        byte[] bArrC = ((com.google.android.gms.internal.measurement.N0) m0X.h()).c();
        C0815q0 c0815q02 = c0817r0.f12151z;
        C0817r0.k(c0815q02);
        c0815q02.E();
        v7.f11755R |= v7.f11746I != bArrC;
        v7.f11746I = bArrC;
        if (v7.s()) {
            C0805n c0805n = this.f11683s;
            L(c0805n);
            c0805n.a0(v7, false);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:140:0x0341  */
    /* JADX WARN: Removed duplicated region for block: B:161:0x03f0 A[Catch: all -> 0x00cc, TryCatch #5 {all -> 0x00cc, blocks: (B:24:0x00aa, B:26:0x00bb, B:34:0x00d3, B:38:0x00e3, B:40:0x00f0, B:46:0x0106, B:48:0x0113, B:50:0x011c, B:53:0x0123, B:56:0x013e, B:60:0x0158, B:63:0x017c, B:66:0x0189, B:68:0x018d, B:71:0x019d, B:110:0x0278, B:112:0x02a4, B:113:0x02a9, B:115:0x02c4, B:155:0x0384, B:156:0x0387, B:164:0x0410, B:117:0x02d7, B:122:0x02f4, B:124:0x02fc, B:126:0x0302, B:130:0x0315, B:134:0x0328, B:138:0x0334, B:141:0x0342, B:146:0x0365, B:148:0x036d, B:150:0x0375, B:152:0x037b, B:144:0x0353, B:132:0x0320, B:120:0x02e2, B:74:0x01ac, B:76:0x01d4, B:77:0x01df, B:79:0x01e6, B:81:0x01ec, B:83:0x01f8, B:85:0x0200, B:87:0x0206, B:89:0x020c, B:90:0x0211, B:92:0x0223, B:94:0x0229, B:100:0x0239, B:106:0x0243, B:107:0x0252, B:108:0x025e, B:109:0x026c, B:157:0x039e, B:159:0x03d7, B:160:0x03da, B:161:0x03f0, B:163:0x03f6, B:54:0x0130, B:49:0x0119, B:42:0x00fa, B:45:0x0103), top: B:179:0x00aa, inners: #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:48:0x0113 A[Catch: all -> 0x00cc, TryCatch #5 {all -> 0x00cc, blocks: (B:24:0x00aa, B:26:0x00bb, B:34:0x00d3, B:38:0x00e3, B:40:0x00f0, B:46:0x0106, B:48:0x0113, B:50:0x011c, B:53:0x0123, B:56:0x013e, B:60:0x0158, B:63:0x017c, B:66:0x0189, B:68:0x018d, B:71:0x019d, B:110:0x0278, B:112:0x02a4, B:113:0x02a9, B:115:0x02c4, B:155:0x0384, B:156:0x0387, B:164:0x0410, B:117:0x02d7, B:122:0x02f4, B:124:0x02fc, B:126:0x0302, B:130:0x0315, B:134:0x0328, B:138:0x0334, B:141:0x0342, B:146:0x0365, B:148:0x036d, B:150:0x0375, B:152:0x037b, B:144:0x0353, B:132:0x0320, B:120:0x02e2, B:74:0x01ac, B:76:0x01d4, B:77:0x01df, B:79:0x01e6, B:81:0x01ec, B:83:0x01f8, B:85:0x0200, B:87:0x0206, B:89:0x020c, B:90:0x0211, B:92:0x0223, B:94:0x0229, B:100:0x0239, B:106:0x0243, B:107:0x0252, B:108:0x025e, B:109:0x026c, B:157:0x039e, B:159:0x03d7, B:160:0x03da, B:161:0x03f0, B:163:0x03f6, B:54:0x0130, B:49:0x0119, B:42:0x00fa, B:45:0x0103), top: B:179:0x00aa, inners: #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:49:0x0119 A[Catch: all -> 0x00cc, TryCatch #5 {all -> 0x00cc, blocks: (B:24:0x00aa, B:26:0x00bb, B:34:0x00d3, B:38:0x00e3, B:40:0x00f0, B:46:0x0106, B:48:0x0113, B:50:0x011c, B:53:0x0123, B:56:0x013e, B:60:0x0158, B:63:0x017c, B:66:0x0189, B:68:0x018d, B:71:0x019d, B:110:0x0278, B:112:0x02a4, B:113:0x02a9, B:115:0x02c4, B:155:0x0384, B:156:0x0387, B:164:0x0410, B:117:0x02d7, B:122:0x02f4, B:124:0x02fc, B:126:0x0302, B:130:0x0315, B:134:0x0328, B:138:0x0334, B:141:0x0342, B:146:0x0365, B:148:0x036d, B:150:0x0375, B:152:0x037b, B:144:0x0353, B:132:0x0320, B:120:0x02e2, B:74:0x01ac, B:76:0x01d4, B:77:0x01df, B:79:0x01e6, B:81:0x01ec, B:83:0x01f8, B:85:0x0200, B:87:0x0206, B:89:0x020c, B:90:0x0211, B:92:0x0223, B:94:0x0229, B:100:0x0239, B:106:0x0243, B:107:0x0252, B:108:0x025e, B:109:0x026c, B:157:0x039e, B:159:0x03d7, B:160:0x03da, B:161:0x03f0, B:163:0x03f6, B:54:0x0130, B:49:0x0119, B:42:0x00fa, B:45:0x0103), top: B:179:0x00aa, inners: #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:53:0x0123 A[Catch: all -> 0x00cc, TRY_ENTER, TryCatch #5 {all -> 0x00cc, blocks: (B:24:0x00aa, B:26:0x00bb, B:34:0x00d3, B:38:0x00e3, B:40:0x00f0, B:46:0x0106, B:48:0x0113, B:50:0x011c, B:53:0x0123, B:56:0x013e, B:60:0x0158, B:63:0x017c, B:66:0x0189, B:68:0x018d, B:71:0x019d, B:110:0x0278, B:112:0x02a4, B:113:0x02a9, B:115:0x02c4, B:155:0x0384, B:156:0x0387, B:164:0x0410, B:117:0x02d7, B:122:0x02f4, B:124:0x02fc, B:126:0x0302, B:130:0x0315, B:134:0x0328, B:138:0x0334, B:141:0x0342, B:146:0x0365, B:148:0x036d, B:150:0x0375, B:152:0x037b, B:144:0x0353, B:132:0x0320, B:120:0x02e2, B:74:0x01ac, B:76:0x01d4, B:77:0x01df, B:79:0x01e6, B:81:0x01ec, B:83:0x01f8, B:85:0x0200, B:87:0x0206, B:89:0x020c, B:90:0x0211, B:92:0x0223, B:94:0x0229, B:100:0x0239, B:106:0x0243, B:107:0x0252, B:108:0x025e, B:109:0x026c, B:157:0x039e, B:159:0x03d7, B:160:0x03da, B:161:0x03f0, B:163:0x03f6, B:54:0x0130, B:49:0x0119, B:42:0x00fa, B:45:0x0103), top: B:179:0x00aa, inners: #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:54:0x0130 A[Catch: all -> 0x00cc, TryCatch #5 {all -> 0x00cc, blocks: (B:24:0x00aa, B:26:0x00bb, B:34:0x00d3, B:38:0x00e3, B:40:0x00f0, B:46:0x0106, B:48:0x0113, B:50:0x011c, B:53:0x0123, B:56:0x013e, B:60:0x0158, B:63:0x017c, B:66:0x0189, B:68:0x018d, B:71:0x019d, B:110:0x0278, B:112:0x02a4, B:113:0x02a9, B:115:0x02c4, B:155:0x0384, B:156:0x0387, B:164:0x0410, B:117:0x02d7, B:122:0x02f4, B:124:0x02fc, B:126:0x0302, B:130:0x0315, B:134:0x0328, B:138:0x0334, B:141:0x0342, B:146:0x0365, B:148:0x036d, B:150:0x0375, B:152:0x037b, B:144:0x0353, B:132:0x0320, B:120:0x02e2, B:74:0x01ac, B:76:0x01d4, B:77:0x01df, B:79:0x01e6, B:81:0x01ec, B:83:0x01f8, B:85:0x0200, B:87:0x0206, B:89:0x020c, B:90:0x0211, B:92:0x0223, B:94:0x0229, B:100:0x0239, B:106:0x0243, B:107:0x0252, B:108:0x025e, B:109:0x026c, B:157:0x039e, B:159:0x03d7, B:160:0x03da, B:161:0x03f0, B:163:0x03f6, B:54:0x0130, B:49:0x0119, B:42:0x00fa, B:45:0x0103), top: B:179:0x00aa, inners: #2, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:56:0x013e A[Catch: all -> 0x00cc, TRY_LEAVE, TryCatch #5 {all -> 0x00cc, blocks: (B:24:0x00aa, B:26:0x00bb, B:34:0x00d3, B:38:0x00e3, B:40:0x00f0, B:46:0x0106, B:48:0x0113, B:50:0x011c, B:53:0x0123, B:56:0x013e, B:60:0x0158, B:63:0x017c, B:66:0x0189, B:68:0x018d, B:71:0x019d, B:110:0x0278, B:112:0x02a4, B:113:0x02a9, B:115:0x02c4, B:155:0x0384, B:156:0x0387, B:164:0x0410, B:117:0x02d7, B:122:0x02f4, B:124:0x02fc, B:126:0x0302, B:130:0x0315, B:134:0x0328, B:138:0x0334, B:141:0x0342, B:146:0x0365, B:148:0x036d, B:150:0x0375, B:152:0x037b, B:144:0x0353, B:132:0x0320, B:120:0x02e2, B:74:0x01ac, B:76:0x01d4, B:77:0x01df, B:79:0x01e6, B:81:0x01ec, B:83:0x01f8, B:85:0x0200, B:87:0x0206, B:89:0x020c, B:90:0x0211, B:92:0x0223, B:94:0x0229, B:100:0x0239, B:106:0x0243, B:107:0x0252, B:108:0x025e, B:109:0x026c, B:157:0x039e, B:159:0x03d7, B:160:0x03da, B:161:0x03f0, B:163:0x03f6, B:54:0x0130, B:49:0x0119, B:42:0x00fa, B:45:0x0103), top: B:179:0x00aa, inners: #2, #4 }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void O(X1 x12) {
        long j8;
        long j9;
        boolean z8;
        C0819s c0819sG0;
        boolean z9;
        boolean z10;
        String str;
        PackageInfo packageInfoC;
        ApplicationInfo applicationInfo;
        ApplicationInfo applicationInfo2;
        long j10;
        boolean z11;
        c().E();
        k();
        P2.w.f(x12);
        String str2 = x12.f11831q;
        P2.w.c(str2);
        if (K(x12)) {
            C0805n c0805n = this.f11683s;
            L(c0805n);
            V vB0 = c0805n.B0(str2);
            if (vB0 != null && TextUtils.isEmpty(vB0.g()) && !TextUtils.isEmpty(x12.f11832r)) {
                vB0.u(0L);
                C0805n c0805n2 = this.f11683s;
                L(c0805n2);
                c0805n2.a0(vB0, false);
                C0803m0 c0803m0 = this.f11681q;
                L(c0803m0);
                c0803m0.E();
                c0803m0.f12056x.remove(str2);
            }
            if (!x12.f11838x) {
                f0(x12);
                return;
            }
            long jCurrentTimeMillis = x12.f11811B;
            if (jCurrentTimeMillis == 0) {
                d().getClass();
                jCurrentTimeMillis = System.currentTimeMillis();
            }
            long j11 = jCurrentTimeMillis;
            C0817r0 c0817r0 = this.f11659B;
            C0814q c0814qM = c0817r0.m();
            Context context = c0817r0.f12142q;
            c0814qM.E();
            int i = x12.f11812C;
            if (i != 0 && i != 1) {
                e().f11878y.d("Incorrect app type, assuming installed app. appId, appType", Z.M(str2), Integer.valueOf(i));
                i = 0;
            }
            C0805n c0805n3 = this.f11683s;
            L(c0805n3);
            c0805n3.P();
            try {
                C0805n c0805n4 = this.f11683s;
                L(c0805n4);
                U1 u1K0 = c0805n4.K0(str2, "_npa");
                Boolean boolM = M(x12);
                int i5 = i;
                if (u1K0 != null) {
                    j8 = 1;
                    if (!"auto".equals(u1K0.f11736b)) {
                        j9 = j11;
                        z8 = true;
                        if (h0().R(null, I.f11570m1)) {
                            n(x12, j9);
                        } else {
                            n(x12, x12.f11829V);
                        }
                        f0(x12);
                        if (i5 != 0) {
                            C0805n c0805n5 = this.f11683s;
                            L(c0805n5);
                            c0819sG0 = c0805n5.g0("events", str2, "_f");
                            z9 = false;
                        } else {
                            C0805n c0805n6 = this.f11683s;
                            L(c0805n6);
                            c0819sG0 = c0805n6.g0("events", str2, "_v");
                            z9 = z8;
                        }
                        if (c0819sG0 != null) {
                            long j12 = ((j9 / 3600000) + j8) * 3600000;
                            boolean z12 = x12.f11813E;
                            if (z9) {
                                long j13 = j9;
                                W(new T1(j13, Long.valueOf(j12), "_fvt", "auto"), x12);
                                c().E();
                                k();
                                Bundle bundle = new Bundle();
                                bundle.putLong("_c", 1L);
                                bundle.putLong("_r", 1L);
                                bundle.putLong("_et", 1L);
                                if (z12) {
                                    bundle.putLong("_dac", 1L);
                                }
                                s(new C0828v("_v", new C0825u(bundle), "auto", j13), x12);
                            } else {
                                long j14 = j9;
                                W(new T1(j14, Long.valueOf(j12), "_fot", "auto"), x12);
                                c().E();
                                C0791i0 c0791i0 = this.f11658A;
                                P2.w.f(c0791i0);
                                C0817r0 c0817r02 = c0791i0.f12005r;
                                if (str2 == null || str2.isEmpty()) {
                                    z10 = z12;
                                    str = "_et";
                                    Z z13 = c0817r02.f12150y;
                                    C0817r0.k(z13);
                                    z13.f11879z.b("Install Referrer Reporter was called with invalid app package name");
                                } else {
                                    C0815q0 c0815q0 = c0817r02.f12151z;
                                    Context context2 = c0817r02.f12142q;
                                    C0817r0.k(c0815q0);
                                    c0815q0.E();
                                    boolean zB = c0791i0.b();
                                    z10 = z12;
                                    Z z14 = c0817r02.f12150y;
                                    if (zB) {
                                        ServiceConnectionC0788h0 serviceConnectionC0788h0 = new ServiceConnectionC0788h0(c0791i0, str2);
                                        C0815q0 c0815q02 = c0817r02.f12151z;
                                        C0817r0.k(c0815q02);
                                        c0815q02.E();
                                        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 = context2.getPackageManager();
                                        if (packageManager == null) {
                                            C0817r0.k(z14);
                                            z14.f11879z.b("Failed to obtain Package Manager to verify binding conditions for Install Referrer");
                                        } else {
                                            List<ResolveInfo> listQueryIntentServices = packageManager.queryIntentServices(intent, 0);
                                            if (listQueryIntentServices == null || listQueryIntentServices.isEmpty()) {
                                                str = "_et";
                                                C0817r0.k(z14);
                                                z14.f11870B.b("Play Service for fetching Install Referrer is unavailable on device");
                                            } else {
                                                str = "_et";
                                                ServiceInfo serviceInfo = listQueryIntentServices.get(0).serviceInfo;
                                                if (serviceInfo != null) {
                                                    String str3 = serviceInfo.packageName;
                                                    if (serviceInfo.name != null && "com.android.vending".equals(str3) && c0791i0.b()) {
                                                        try {
                                                            try {
                                                                boolean zC = S2.a.a().c(context2, context2.getClass().getName(), new Intent(intent), serviceConnectionC0788h0, 1, null);
                                                                try {
                                                                    C0817r0.k(z14);
                                                                    z14.D.c(zC ? "available" : "not available", "Install Referrer Service is");
                                                                } catch (RuntimeException e8) {
                                                                    e = e8;
                                                                    C0817r0.k(z14);
                                                                    z14.f11875v.c(e.getMessage(), "Exception occurred while binding to Install Referrer Service");
                                                                }
                                                            } catch (RuntimeException e9) {
                                                                e = e9;
                                                            }
                                                        } catch (RuntimeException e10) {
                                                            e = e10;
                                                        }
                                                    } else {
                                                        C0817r0.k(z14);
                                                        z14.f11878y.b("Play Store version 8.3.73 or higher required for Install Referrer");
                                                    }
                                                }
                                            }
                                        }
                                    } else {
                                        C0817r0.k(z14);
                                        z14.f11870B.b("Install Referrer Reporter is not available");
                                    }
                                    str = "_et";
                                }
                                c().E();
                                k();
                                Bundle bundle2 = new Bundle();
                                long j15 = j8;
                                bundle2.putLong("_c", j15);
                                bundle2.putLong("_r", j15);
                                bundle2.putLong("_uwa", 0L);
                                bundle2.putLong("_pfo", 0L);
                                bundle2.putLong("_sys", 0L);
                                bundle2.putLong("_sysu", 0L);
                                bundle2.putLong(str, j15);
                                if (z10) {
                                    bundle2.putLong("_dac", j15);
                                }
                                P2.w.f(str2);
                                C0805n c0805n7 = this.f11683s;
                                L(c0805n7);
                                P2.w.c(str2);
                                c0805n7.E();
                                c0805n7.F();
                                long jY0 = c0805n7.y0(str2);
                                if (context.getPackageManager() == null) {
                                    e().f11875v.c(Z.M(str2), "PackageManager is null, first open report might be inaccurate. appId");
                                } else {
                                    try {
                                        packageInfoC = U2.b.a(context).c(0, str2);
                                    } catch (PackageManager.NameNotFoundException e11) {
                                        e().f11875v.d("Package info is null, first open report might be inaccurate. appId", Z.M(str2), e11);
                                        packageInfoC = null;
                                    }
                                    if (packageInfoC != null) {
                                        long j16 = packageInfoC.firstInstallTime;
                                        if (j16 != 0) {
                                            if (j16 != packageInfoC.lastUpdateTime) {
                                                applicationInfo = null;
                                                if (!h0().R(null, I.f11502I0)) {
                                                    bundle2.putLong("_uwa", 1L);
                                                } else if (jY0 == 0) {
                                                    bundle2.putLong("_uwa", 1L);
                                                    z11 = false;
                                                    jY0 = 0;
                                                }
                                                z11 = false;
                                            } else {
                                                applicationInfo = null;
                                                z11 = true;
                                            }
                                            W(new T1(j14, Long.valueOf(true != z11 ? 0L : 1L), "_fi", "auto"), x12);
                                        } else {
                                            applicationInfo = null;
                                        }
                                        try {
                                            applicationInfo2 = U2.b.a(context).f3229q.getPackageManager().getApplicationInfo(str2, 0);
                                        } catch (PackageManager.NameNotFoundException e12) {
                                            e().f11875v.d("Application info is null, first open report might be inaccurate. appId", Z.M(str2), e12);
                                            applicationInfo2 = applicationInfo;
                                        }
                                        if (applicationInfo2 != null) {
                                            if ((applicationInfo2.flags & 1) != 0) {
                                                j10 = 1;
                                                bundle2.putLong("_sys", 1L);
                                            } else {
                                                j10 = 1;
                                            }
                                            if ((applicationInfo2.flags & 128) != 0) {
                                                bundle2.putLong("_sysu", j10);
                                            }
                                        }
                                    }
                                }
                                if (jY0 >= 0) {
                                    bundle2.putLong("_pfo", jY0);
                                }
                                s(new C0828v("_f", new C0825u(bundle2), "auto", j14), x12);
                            }
                        } else {
                            long j17 = j9;
                            if (x12.f11839y) {
                                s(new C0828v("_cd", new C0825u(new Bundle()), "auto", j17), x12);
                            }
                        }
                        C0805n c0805n8 = this.f11683s;
                        L(c0805n8);
                        c0805n8.Z();
                        C0805n c0805n9 = this.f11683s;
                        L(c0805n9);
                        c0805n9.T();
                    }
                } else {
                    j8 = 1;
                }
                if (boolM != null) {
                    boolean zBooleanValue = boolM.booleanValue();
                    z8 = true;
                    T1 t12 = new T1(j11, Long.valueOf(true != zBooleanValue ? 0L : j8), "_npa", "auto");
                    j9 = j11;
                    if (u1K0 == null || !u1K0.f11739e.equals(t12.f11725t)) {
                        W(t12, x12);
                    }
                } else {
                    j9 = j11;
                    z8 = true;
                    if (u1K0 != null) {
                        Q("_npa", x12);
                    }
                }
                if (h0().R(null, I.f11570m1)) {
                }
                f0(x12);
                if (i5 != 0) {
                }
                if (c0819sG0 != null) {
                }
                C0805n c0805n82 = this.f11683s;
                L(c0805n82);
                c0805n82.Z();
                C0805n c0805n92 = this.f11683s;
                L(c0805n92);
                c0805n92.T();
            } catch (Throwable th) {
                C0805n c0805n10 = this.f11683s;
                L(c0805n10);
                c0805n10.T();
                throw th;
            }
        }
    }

    public final void P(C0778e c0778e, X1 x12) {
        P2.w.c(c0778e.f11918q);
        P2.w.f(c0778e.f11920s);
        P2.w.c(c0778e.f11920s.f11723r);
        c().E();
        k();
        if (K(x12)) {
            if (!x12.f11838x) {
                f0(x12);
                return;
            }
            C0805n c0805n = this.f11683s;
            L(c0805n);
            c0805n.P();
            try {
                f0(x12);
                String str = c0778e.f11918q;
                P2.w.f(str);
                C0805n c0805n2 = this.f11683s;
                L(c0805n2);
                C0778e c0778eC0 = c0805n2.C0(str, c0778e.f11920s.f11723r);
                C0817r0 c0817r0 = this.f11659B;
                if (c0778eC0 != null) {
                    e().f11871C.d("Removing conditional user property", c0778e.f11918q, c0817r0.f12123C.f(c0778e.f11920s.f11723r));
                    C0805n c0805n3 = this.f11683s;
                    L(c0805n3);
                    c0805n3.f0(str, c0778e.f11920s.f11723r);
                    if (c0778eC0.f11922u) {
                        C0805n c0805n4 = this.f11683s;
                        L(c0805n4);
                        c0805n4.X(str, c0778e.f11920s.f11723r);
                    }
                    C0828v c0828v = c0778e.f11917A;
                    if (c0828v != null) {
                        C0825u c0825u = c0828v.f12194r;
                        C0828v c0828vK = g().K(c0828v.f12193q, c0825u != null ? c0825u.a() : null, c0778eC0.f11919r, c0828v.f12196t, true);
                        P2.w.f(c0828vK);
                        b0(c0828vK, x12);
                    }
                } else {
                    e().f11878y.d("Conditional user property doesn't exist", Z.M(c0778e.f11918q), c0817r0.f12123C.f(c0778e.f11920s.f11723r));
                }
                C0805n c0805n5 = this.f11683s;
                L(c0805n5);
                c0805n5.Z();
                C0805n c0805n6 = this.f11683s;
                L(c0805n6);
                c0805n6.T();
            } catch (Throwable th) {
                C0805n c0805n7 = this.f11683s;
                L(c0805n7);
                c0805n7.T();
                throw th;
            }
        }
    }

    public final void Q(String str, X1 x12) {
        c().E();
        k();
        if (K(x12)) {
            if (!x12.f11838x) {
                f0(x12);
                return;
            }
            Boolean boolM = M(x12);
            if ("_npa".equals(str) && boolM != null) {
                e().f11871C.b("Falling back to manifest metadata value for ad personalization");
                d().getClass();
                W(new T1(System.currentTimeMillis(), Long.valueOf(true != boolM.booleanValue() ? 0L : 1L), "_npa", "auto"), x12);
                return;
            }
            Z zE = e();
            C0817r0 c0817r0 = this.f11659B;
            zE.f11871C.c(c0817r0.f12123C.f(str), "Removing user property");
            C0805n c0805n = this.f11683s;
            L(c0805n);
            c0805n.P();
            try {
                f0(x12);
                boolean zEquals = "_id".equals(str);
                String str2 = x12.f11831q;
                if (zEquals) {
                    C0805n c0805n2 = this.f11683s;
                    L(c0805n2);
                    P2.w.f(str2);
                    c0805n2.X(str2, "_lair");
                }
                C0805n c0805n3 = this.f11683s;
                L(c0805n3);
                P2.w.f(str2);
                c0805n3.X(str2, str);
                C0805n c0805n4 = this.f11683s;
                L(c0805n4);
                c0805n4.Z();
                e().f11871C.c(c0817r0.f12123C.f(str), "User property removed");
                C0805n c0805n5 = this.f11683s;
                L(c0805n5);
                c0805n5.T();
            } catch (Throwable th) {
                C0805n c0805n6 = this.f11683s;
                L(c0805n6);
                c0805n6.T();
                throw th;
            }
        }
    }

    public final void R(X1 x12) {
        I1.a.u(this);
        String str = x12.f11831q;
        P2.w.c(str);
        C0811p c0811pB = C0811p.b(x12.f11824Q);
        e().D.d("Setting DMA consent for package", str, c0811pB);
        c().E();
        k();
        C0 c0C = C0811p.a(100, d0(str)).c();
        this.f11674S.put(str, c0811pB);
        C0805n c0805n = this.f11683s;
        L(c0805n);
        P2.w.f(str);
        P2.w.f(c0811pB);
        c0805n.E();
        c0805n.F();
        F0 f0I0 = c0805n.I0(str);
        F0 f02 = F0.f11457c;
        if (f0I0 == f02) {
            c0805n.c0(str, f02);
        }
        ContentValues contentValues = new ContentValues();
        contentValues.put("app_id", str);
        contentValues.put("dma_consent_settings", c0811pB.f12091b);
        c0805n.m0(contentValues);
        C0 c0C2 = C0811p.a(100, d0(str)).c();
        I1.a.u(this);
        C0 c02 = C0.f11433t;
        C0 c03 = C0.f11434u;
        boolean z8 = c0C == c02 && c0C2 == c03;
        boolean z9 = c0C == c03 && c0C2 == c02;
        if (z8 || z9) {
            e().D.c(str, "Generated _dcu event for");
            Bundle bundle = new Bundle();
            C0805n c0805n2 = this.f11683s;
            L(c0805n2);
            if (c0805n2.E0(v(), str, false, false, false, false).f12013f < h0().K(str, I.f11569m0)) {
                bundle.putLong("_r", 1L);
                C0805n c0805n3 = this.f11683s;
                L(c0805n3);
                e().D.d("_dcu realtime event count", str, Long.valueOf(c0805n3.E0(v(), str, false, false, true, false).f12013f));
            }
            this.f11680Z.b(str, "_dcu", bundle);
        }
    }

    public final void S(X1 x12) {
        I1.a.u(this);
        String str = x12.f11831q;
        P2.w.c(str);
        F0 f0E = F0.e(x12.f11823P, x12.f11818K);
        n0(str);
        e().D.d("Setting storage consent for package", str, f0E);
        c().E();
        k();
        this.f11673R.put(str, f0E);
        C0805n c0805n = this.f11683s;
        L(c0805n);
        c0805n.c0(str, f0E);
    }

    public final void T(ArrayList arrayList) {
        P2.w.a(!arrayList.isEmpty());
        if (this.f11670O != null) {
            e().f11875v.b("Set uploading progress before finishing the previous upload");
        } else {
            this.f11670O = new ArrayList(arrayList);
        }
    }

    public final void U(C0778e c0778e, X1 x12) {
        C0828v c0828v;
        P2.w.c(c0778e.f11918q);
        P2.w.f(c0778e.f11919r);
        P2.w.f(c0778e.f11920s);
        P2.w.c(c0778e.f11920s.f11723r);
        c().E();
        k();
        if (K(x12)) {
            if (!x12.f11838x) {
                f0(x12);
                return;
            }
            C0778e c0778e2 = new C0778e(c0778e);
            boolean z8 = false;
            c0778e2.f11922u = false;
            C0805n c0805n = this.f11683s;
            L(c0805n);
            c0805n.P();
            try {
                C0805n c0805n2 = this.f11683s;
                L(c0805n2);
                String str = c0778e2.f11918q;
                P2.w.f(str);
                C0778e c0778eC0 = c0805n2.C0(str, c0778e2.f11920s.f11723r);
                C0817r0 c0817r0 = this.f11659B;
                if (c0778eC0 != null && !c0778eC0.f11919r.equals(c0778e2.f11919r)) {
                    e().f11878y.e("Updating a conditional user property with different origin. name, origin, origin (from DB)", c0817r0.f12123C.f(c0778e2.f11920s.f11723r), c0778e2.f11919r, c0778eC0.f11919r);
                }
                if (c0778eC0 != null && c0778eC0.f11922u) {
                    c0778e2.f11919r = c0778eC0.f11919r;
                    c0778e2.f11921t = c0778eC0.f11921t;
                    c0778e2.f11925x = c0778eC0.f11925x;
                    c0778e2.f11923v = c0778eC0.f11923v;
                    c0778e2.f11926y = c0778eC0.f11926y;
                    c0778e2.f11922u = true;
                    T1 t12 = c0778e2.f11920s;
                    c0778e2.f11920s = new T1(c0778eC0.f11920s.f11724s, t12.a(), t12.f11723r, c0778eC0.f11920s.f11727v);
                } else if (TextUtils.isEmpty(c0778e2.f11923v)) {
                    T1 t13 = c0778e2.f11920s;
                    c0778e2.f11920s = new T1(c0778e2.f11921t, t13.a(), t13.f11723r, c0778e2.f11920s.f11727v);
                    c0778e2.f11922u = true;
                    z8 = true;
                }
                if (c0778e2.f11922u) {
                    T1 t14 = c0778e2.f11920s;
                    String str2 = c0778e2.f11918q;
                    P2.w.f(str2);
                    String str3 = c0778e2.f11919r;
                    String str4 = t14.f11723r;
                    long j8 = t14.f11724s;
                    Object objA = t14.a();
                    P2.w.f(objA);
                    U1 u12 = new U1(str2, str3, str4, j8, objA);
                    Object obj = u12.f11739e;
                    String str5 = u12.f11737c;
                    C0805n c0805n3 = this.f11683s;
                    L(c0805n3);
                    if (c0805n3.s0(u12)) {
                        e().f11871C.e("User property updated immediately", c0778e2.f11918q, c0817r0.f12123C.f(str5), obj);
                    } else {
                        e().f11875v.e("(2)Too many active user properties, ignoring", Z.M(c0778e2.f11918q), c0817r0.f12123C.f(str5), obj);
                    }
                    if (z8 && (c0828v = c0778e2.f11926y) != null) {
                        b0(new C0828v(c0828v, c0778e2.f11921t), x12);
                    }
                }
                C0805n c0805n4 = this.f11683s;
                L(c0805n4);
                if (c0805n4.r0(c0778e2)) {
                    e().f11871C.e("Conditional property added", c0778e2.f11918q, c0817r0.f12123C.f(c0778e2.f11920s.f11723r), c0778e2.f11920s.a());
                } else {
                    e().f11875v.e("Too many conditional properties, ignoring", Z.M(c0778e2.f11918q), c0817r0.f12123C.f(c0778e2.f11920s.f11723r), c0778e2.f11920s.a());
                }
                C0805n c0805n5 = this.f11683s;
                L(c0805n5);
                c0805n5.Z();
                C0805n c0805n6 = this.f11683s;
                L(c0805n6);
                c0805n6.T();
            } catch (Throwable th) {
                C0805n c0805n7 = this.f11683s;
                L(c0805n7);
                c0805n7.T();
                throw th;
            }
        }
    }

    public final void V(String str, boolean z8, Long l8, Long l9) {
        C0805n c0805n = this.f11683s;
        L(c0805n);
        V vB0 = c0805n.B0(str);
        if (vB0 != null) {
            C0817r0 c0817r0 = vB0.f11758a;
            C0815q0 c0815q0 = c0817r0.f12151z;
            C0817r0.k(c0815q0);
            c0815q0.E();
            vB0.f11755R |= vB0.f11782z != z8;
            vB0.f11782z = z8;
            C0815q0 c0815q02 = c0817r0.f12151z;
            C0817r0.k(c0815q02);
            c0815q02.E();
            vB0.f11755R |= !Objects.equals(vB0.f11740A, l8);
            vB0.f11740A = l8;
            C0815q0 c0815q03 = c0817r0.f12151z;
            C0817r0.k(c0815q03);
            c0815q03.E();
            vB0.f11755R |= !Objects.equals(vB0.f11741B, l9);
            vB0.f11741B = l9;
            if (vB0.s()) {
                C0805n c0805n2 = this.f11683s;
                L(c0805n2);
                c0805n2.a0(vB0, false);
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:38:0x00cd  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void W(T1 t12, X1 x12) {
        long jLongValue;
        c().E();
        k();
        if (K(x12)) {
            if (!x12.f11838x) {
                f0(x12);
                return;
            }
            W1 w1G = g();
            String str = t12.f11723r;
            int iL0 = w1G.L0(str);
            N1 n12 = this.f11680Z;
            if (iL0 != 0) {
                g();
                h0();
                int length = 0;
                String strO = W1.O(24, str, true);
                if (str != null) {
                    length = str.length();
                }
                g();
                W1.Y(n12, x12.f11831q, iL0, "_ev", strO, length);
                return;
            }
            int iH0 = g().H0(t12.a(), str);
            if (iH0 != 0) {
                g();
                h0();
                String strO2 = W1.O(24, str, true);
                Object objA = t12.a();
                int length2 = (objA == null || !((objA instanceof String) || (objA instanceof CharSequence))) ? 0 : objA.toString().length();
                g();
                W1.Y(n12, x12.f11831q, iH0, "_ev", strO2, length2);
                return;
            }
            Object objM = g().M(t12.a(), str);
            if (objM != null) {
                boolean zEquals = "_sid".equals(str);
                String str2 = x12.f11831q;
                if (zEquals) {
                    P2.w.f(str2);
                    C0805n c0805n = this.f11683s;
                    L(c0805n);
                    U1 u1K0 = c0805n.K0(str2, "_sno");
                    if (u1K0 != null) {
                        Object obj = u1K0.f11739e;
                        if (obj instanceof Long) {
                            jLongValue = ((Long) obj).longValue();
                        } else {
                            if (u1K0 != null) {
                                e().f11878y.c(u1K0.f11739e, "Retrieved last session number from database does not contain a valid (long) value");
                            }
                            C0805n c0805n2 = this.f11683s;
                            L(c0805n2);
                            C0819s c0819sG0 = c0805n2.g0("events", str2, "_s");
                            if (c0819sG0 != null) {
                                Z zE = e();
                                long j8 = c0819sG0.f12157c;
                                zE.D.c(Long.valueOf(j8), "Backfill the session number. Last used session number");
                                jLongValue = j8;
                            } else {
                                jLongValue = 0;
                            }
                        }
                        W(new T1(t12.f11724s, Long.valueOf(jLongValue + 1), "_sno", t12.f11727v), x12);
                    }
                }
                P2.w.f(str2);
                String str3 = t12.f11727v;
                P2.w.f(str3);
                U1 u12 = new U1(str2, str3, str, t12.f11724s, objM);
                Z zE2 = e();
                C0817r0 c0817r0 = this.f11659B;
                T t6 = c0817r0.f12123C;
                String str4 = u12.f11737c;
                zE2.D.d("Setting user property", t6.f(str4), objM);
                C0805n c0805n3 = this.f11683s;
                L(c0805n3);
                c0805n3.P();
                try {
                    boolean zEquals2 = "_id".equals(str4);
                    Object obj2 = u12.f11739e;
                    if (zEquals2) {
                        C0805n c0805n4 = this.f11683s;
                        L(c0805n4);
                        U1 u1K02 = c0805n4.K0(str2, "_id");
                        if (u1K02 != null && !obj2.equals(u1K02.f11739e)) {
                            C0805n c0805n5 = this.f11683s;
                            L(c0805n5);
                            c0805n5.X(str2, "_lair");
                        }
                    }
                    f0(x12);
                    C0805n c0805n6 = this.f11683s;
                    L(c0805n6);
                    boolean zS0 = c0805n6.s0(u12);
                    if ("_sid".equals(str)) {
                        C0773c0 c0773c0 = this.f11687w;
                        L(c0773c0);
                        String str5 = x12.f11820M;
                        long jE0 = TextUtils.isEmpty(str5) ? 0L : c0773c0.e0(str5.getBytes(Charset.forName("UTF-8")));
                        C0805n c0805n7 = this.f11683s;
                        L(c0805n7);
                        V vB0 = c0805n7.B0(str2);
                        if (vB0 != null) {
                            vB0.q(jE0);
                            if (vB0.s()) {
                                C0805n c0805n8 = this.f11683s;
                                L(c0805n8);
                                c0805n8.a0(vB0, false);
                            }
                        }
                    }
                    C0805n c0805n9 = this.f11683s;
                    L(c0805n9);
                    c0805n9.Z();
                    if (!zS0) {
                        e().f11875v.d("Too many unique user properties are set. Ignoring user property", c0817r0.f12123C.f(str4), obj2);
                        g();
                        W1.Y(n12, str2, 9, null, null, 0);
                    }
                    C0805n c0805n10 = this.f11683s;
                    L(c0805n10);
                    c0805n10.T();
                } catch (Throwable th) {
                    C0805n c0805n11 = this.f11683s;
                    L(c0805n11);
                    c0805n11.T();
                    throw th;
                }
            }
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:73:0x01a4 A[Catch: all -> 0x0021, TryCatch #1 {all -> 0x0021, blocks: (B:3:0x0007, B:5:0x0014, B:8:0x0024, B:10:0x002a, B:11:0x0037, B:13:0x003f, B:14:0x0044, B:16:0x004f, B:17:0x005c, B:19:0x0067, B:20:0x0077, B:22:0x00a1, B:24:0x00a7, B:25:0x00aa, B:27:0x00c3, B:28:0x00d8, B:30:0x00e9, B:32:0x00ef, B:35:0x0104, B:45:0x0123, B:47:0x0128, B:48:0x012b, B:49:0x012c, B:50:0x0131, B:55:0x0176, B:71:0x019e, B:73:0x01a4, B:75:0x01af, B:79:0x01ba, B:80:0x01bd, B:33:0x00f4, B:37:0x0108, B:42:0x0110), top: B:83:0x0007, inners: #6 }] */
    /* JADX WARN: Type inference failed for: r11v0, types: [d3.Q1] */
    /* JADX WARN: Type inference failed for: r1v12, types: [long] */
    /* JADX WARN: Type inference failed for: r1v13 */
    /* JADX WARN: Type inference failed for: r1v17 */
    /* JADX WARN: Type inference failed for: r1v18 */
    /* JADX WARN: Type inference failed for: r1v22, types: [android.database.Cursor] */
    /* JADX WARN: Type inference failed for: r1v25, types: [android.database.Cursor] */
    /* JADX WARN: Type inference failed for: r7v0 */
    /* JADX WARN: Type inference failed for: r7v1 */
    /* JADX WARN: Type inference failed for: r7v2, types: [android.database.Cursor] */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$UnknownArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void X() {
        C0805n c0805n;
        long jLongValue;
        SQLiteException e8;
        I1.a.u(this);
        this.f11667L = true;
        try {
            C0817r0 c0817r0 = this.f11659B;
            c0817r0.getClass();
            Boolean bool = c0817r0.r().f12180u;
            if (bool == null) {
                e().f11878y.b("Upload data called on the client side before use of service was decided");
            } else if (bool.booleanValue()) {
                e().f11875v.b("Upload called in the client side when service should be used");
            } else if (this.f11661E > 0) {
                F();
            } else {
                c().E();
                if (this.f11670O != null) {
                    e().D.b("Uploading requested multiple times");
                } else {
                    C0773c0 c0773c0 = this.f11682r;
                    L(c0773c0);
                    if (c0773c0.d0()) {
                        d().getClass();
                        ?? CurrentTimeMillis = System.currentTimeMillis();
                        ?? r72 = 0;
                        cursorRawQuery = null;
                        Cursor cursorRawQuery = null;
                        string = null;
                        string = null;
                        String string = null;
                        int iK = h0().K(null, I.f11557i0);
                        h0();
                        long jLongValue2 = CurrentTimeMillis - ((Long) I.f11545e.a(null)).longValue();
                        for (int i = 0; i < iK && G(jLongValue2, null); i++) {
                        }
                        J3.b();
                        c().E();
                        E();
                        long jG = this.f11689y.f12207x.g();
                        if (jG != 0) {
                            e().f11871C.c(Long.valueOf(Math.abs(CurrentTimeMillis - jG)), "Uploading events. Elapsed time since last upload attempt (ms)");
                        }
                        C0805n c0805n2 = this.f11683s;
                        L(c0805n2);
                        String strI = c0805n2.I();
                        long j8 = -1;
                        if (TextUtils.isEmpty(strI)) {
                            try {
                                this.f11672Q = -1L;
                                c0805n = this.f11683s;
                                L(c0805n);
                                h0();
                                jLongValue = CurrentTimeMillis - ((Long) I.f11545e.a(null)).longValue();
                                c0805n.E();
                                c0805n.F();
                            } catch (Throwable th) {
                                th = th;
                                r72 = CurrentTimeMillis;
                            }
                            try {
                                CurrentTimeMillis = c0805n.A0().rawQuery("select app_id from apps where app_id in (select distinct app_id from raw_events) and config_fetched_time < ? order by failed_config_fetch_time limit 1;", new String[]{String.valueOf(jLongValue)});
                                try {
                                    if (CurrentTimeMillis.moveToFirst()) {
                                        string = CurrentTimeMillis.getString(0);
                                    } else {
                                        Z z8 = ((C0817r0) c0805n.f5146q).f12150y;
                                        C0817r0.k(z8);
                                        z8.D.b("No expired configs for apps with pending events");
                                    }
                                } catch (SQLiteException e9) {
                                    e8 = e9;
                                    Z z9 = ((C0817r0) c0805n.f5146q).f12150y;
                                    C0817r0.k(z9);
                                    z9.f11875v.c(e8, "Error selecting expired configs");
                                    if (CurrentTimeMillis != 0) {
                                    }
                                    if (!TextUtils.isEmpty(string)) {
                                    }
                                    this.f11667L = false;
                                    C();
                                }
                            } catch (SQLiteException e10) {
                                e8 = e10;
                                CurrentTimeMillis = 0;
                            } catch (Throwable th2) {
                                th = th2;
                                throw th;
                            }
                            CurrentTimeMillis.close();
                            if (!TextUtils.isEmpty(string)) {
                                C0805n c0805n3 = this.f11683s;
                                L(c0805n3);
                                V vB0 = c0805n3.B0(string);
                                if (vB0 != null) {
                                    m(vB0);
                                }
                            }
                        } else {
                            if (this.f11672Q == -1) {
                                C0805n c0805n4 = this.f11683s;
                                L(c0805n4);
                                try {
                                    try {
                                        cursorRawQuery = c0805n4.A0().rawQuery("select rowid from raw_events order by rowid desc limit 1;", null);
                                        if (cursorRawQuery.moveToFirst()) {
                                            j8 = cursorRawQuery.getLong(0);
                                        }
                                    } catch (SQLiteException e11) {
                                        Z z10 = ((C0817r0) c0805n4.f5146q).f12150y;
                                        C0817r0.k(z10);
                                        z10.f11875v.c(e11, "Error querying raw events");
                                        if (cursorRawQuery != null) {
                                        }
                                        this.f11672Q = j8;
                                        Y(CurrentTimeMillis, strI);
                                        this.f11667L = false;
                                        C();
                                    }
                                    cursorRawQuery.close();
                                    this.f11672Q = j8;
                                } finally {
                                    if (cursorRawQuery != null) {
                                        cursorRawQuery.close();
                                    }
                                }
                            }
                            Y(CurrentTimeMillis, strI);
                        }
                    } else {
                        e().D.b("Network not connected, ignoring upload request");
                        F();
                    }
                }
            }
            this.f11667L = false;
            C();
        } catch (Throwable th3) {
            this.f11667L = false;
            C();
            throw th3;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:32:0x00bc, code lost:
    
        r22 = r11;
     */
    /* JADX WARN: Removed duplicated region for block: B:108:0x0231  */
    /* JADX WARN: Removed duplicated region for block: B:111:0x023a  */
    /* JADX WARN: Removed duplicated region for block: B:131:0x029c  */
    /* JADX WARN: Removed duplicated region for block: B:179:0x049d  */
    /* JADX WARN: Removed duplicated region for block: B:180:0x04a0  */
    /* JADX WARN: Removed duplicated region for block: B:190:0x04ed  */
    /* JADX WARN: Removed duplicated region for block: B:213:0x0575  */
    /* JADX WARN: Removed duplicated region for block: B:214:0x0578  */
    /* JADX WARN: Removed duplicated region for block: B:288:0x07b4  */
    /* JADX WARN: Removed duplicated region for block: B:294:0x07e4  */
    /* JADX WARN: Removed duplicated region for block: B:297:0x07fd  */
    /* JADX WARN: Removed duplicated region for block: B:301:0x081a A[LOOP:5: B:299:0x0814->B:301:0x081a, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:304:0x0859  */
    /* JADX WARN: Removed duplicated region for block: B:309:0x0876  */
    /* JADX WARN: Removed duplicated region for block: B:317:0x08cf A[LOOP:6: B:315:0x08c9->B:317:0x08cf, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:320:0x091f  */
    /* JADX WARN: Removed duplicated region for block: B:324:0x095f  */
    /* JADX WARN: Removed duplicated region for block: B:330:0x097b  */
    /* JADX WARN: Removed duplicated region for block: B:340:0x0a10  */
    /* JADX WARN: Removed duplicated region for block: B:352:0x0a76  */
    /* JADX WARN: Removed duplicated region for block: B:385:0x07c9 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:404:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void Y(long j8, String str) throws Throwable {
        Cursor cursor;
        Cursor cursor2;
        List listSubList;
        boolean z8;
        int i;
        ArrayList arrayList;
        L1 l12;
        C0663l1 c0663l1;
        L1 l13;
        L1 l14;
        L1 l15;
        C0773c0 c0773c0;
        C0817r0 c0817r0;
        Iterator it;
        String string;
        String strU;
        Iterator it2;
        C0784g c0784gH0;
        H h8;
        boolean zIsEmpty;
        L1 l16;
        String strL0;
        List list;
        int i5;
        C0613b1 c0613b1;
        C0663l1 c0663l12;
        L1 l17;
        com.google.android.gms.internal.measurement.G0 g02;
        String strF;
        Cursor cursorQuery;
        C0805n c0805n;
        C0773c0 c0773c02;
        ByteArrayInputStream byteArrayInputStream;
        GZIPInputStream gZIPInputStream;
        ByteArrayOutputStream byteArrayOutputStream;
        long jP;
        C0628e1 c0628e1;
        long jP2;
        long j9;
        int iK = h0().K(str, I.f11554h);
        int i8 = 0;
        int iMax = Math.max(0, h0().K(str, I.i));
        C0805n c0805n2 = this.f11683s;
        L(c0805n2);
        C0817r0 c0817r02 = (C0817r0) c0805n2.f5146q;
        c0805n2.E();
        c0805n2.F();
        int i9 = 1;
        P2.w.a(iK > 0);
        P2.w.a(iMax > 0);
        P2.w.c(str);
        try {
            try {
                cursorQuery = c0805n2.A0().query("queue", new String[]{"rowid", "data", "retry_count"}, "app_id=?", new String[]{str}, null, null, "rowid", String.valueOf(iK));
            } catch (Throwable th) {
                th = th;
            }
            try {
                if (cursorQuery.moveToFirst()) {
                    ArrayList arrayList2 = new ArrayList();
                    int length = 0;
                    while (true) {
                        long j10 = cursorQuery.getLong(i8);
                        try {
                            byte[] blob = cursorQuery.getBlob(i9);
                            c0773c02 = c0805n2.f11473r.f11687w;
                            L(c0773c02);
                            try {
                                byteArrayInputStream = new ByteArrayInputStream(blob);
                                gZIPInputStream = new GZIPInputStream(byteArrayInputStream);
                                byteArrayOutputStream = new ByteArrayOutputStream();
                                c0805n = c0805n2;
                            } catch (IOException e8) {
                                e = e8;
                                c0805n = c0805n2;
                            }
                        } catch (IOException e9) {
                            e = e9;
                            c0805n = c0805n2;
                            cursor2 = cursorQuery;
                        }
                        try {
                            byte[] bArr = new byte[1024];
                            while (true) {
                                int i10 = gZIPInputStream.read(bArr);
                                if (i10 <= 0) {
                                    break;
                                }
                                cursor2 = cursorQuery;
                                try {
                                    try {
                                        byteArrayOutputStream.write(bArr, 0, i10);
                                        cursorQuery = cursor2;
                                    } catch (IOException e10) {
                                        e = e10;
                                        try {
                                            Z z9 = ((C0817r0) c0773c02.f5146q).f12150y;
                                            C0817r0.k(z9);
                                            z9.f11875v.c(e, "Failed to ungzip content");
                                            throw e;
                                        } catch (IOException e11) {
                                            e = e11;
                                            Z z10 = c0817r02.f12150y;
                                            C0817r0.k(z10);
                                            z10.f11875v.d("Failed to unzip queued bundle. appId", Z.M(str), e);
                                            if (cursor2.moveToNext()) {
                                                break;
                                            } else {
                                                break;
                                            }
                                            cursor2.close();
                                            listSubList = arrayList2;
                                            if (listSubList.isEmpty()) {
                                            }
                                        }
                                    }
                                } catch (SQLiteException e12) {
                                    e = e12;
                                    Z z11 = c0817r02.f12150y;
                                    C0817r0.k(z11);
                                    z11.f11875v.d("Error querying bundles. appId", Z.M(str), e);
                                    listSubList = Collections.EMPTY_LIST;
                                    if (cursor2 != null) {
                                        cursor2.close();
                                    }
                                    if (listSubList.isEmpty()) {
                                    }
                                }
                            }
                            gZIPInputStream.close();
                            byteArrayInputStream.close();
                            byte[] byteArray = byteArrayOutputStream.toByteArray();
                            if (!arrayList2.isEmpty() && byteArray.length + length > iMax) {
                                break;
                            }
                            try {
                                C0623d1 c0623d1 = (C0623d1) C0773c0.k0(C0628e1.k2(), byteArray);
                                if (!arrayList2.isEmpty()) {
                                    C0628e1 c0628e12 = (C0628e1) ((Pair) arrayList2.get(0)).first;
                                    C0628e1 c0628e13 = (C0628e1) c0623d1.h();
                                    if (!c0628e12.w().equals(c0628e13.w()) || !c0628e12.v().equals(c0628e13.v()) || c0628e12.G1() != c0628e13.G1() || !c0628e12.x().equals(c0628e13.x())) {
                                        break;
                                    }
                                    Iterator it3 = c0628e12.K().iterator();
                                    while (true) {
                                        jP = -1;
                                        Iterator it4 = it3;
                                        if (!it3.hasNext()) {
                                            c0628e1 = c0628e13;
                                            jP2 = -1;
                                            break;
                                        }
                                        C0673n1 c0673n1 = (C0673n1) it4.next();
                                        c0628e1 = c0628e13;
                                        if ("_npa".equals(c0673n1.s())) {
                                            jP2 = c0673n1.p();
                                            break;
                                        } else {
                                            it3 = it4;
                                            c0628e13 = c0628e1;
                                        }
                                    }
                                    Iterator it5 = c0628e1.K().iterator();
                                    while (true) {
                                        if (!it5.hasNext()) {
                                            j9 = jP2;
                                            break;
                                        }
                                        C0673n1 c0673n12 = (C0673n1) it5.next();
                                        j9 = jP2;
                                        if ("_npa".equals(c0673n12.s())) {
                                            jP = c0673n12.p();
                                            break;
                                        }
                                        jP2 = j9;
                                    }
                                    if (j9 != jP) {
                                        break;
                                    }
                                }
                                if (!cursorQuery.isNull(2)) {
                                    int i11 = cursorQuery.getInt(2);
                                    c0623d1.k();
                                    C0628e1.u1((C0628e1) c0623d1.f9801r, i11);
                                }
                                length += byteArray.length;
                                arrayList2.add(Pair.create((C0628e1) c0623d1.h(), Long.valueOf(j10)));
                            } catch (IOException e13) {
                                Z z12 = c0817r02.f12150y;
                                C0817r0.k(z12);
                                z12.f11875v.d("Failed to merge queued bundle. appId", Z.M(str), e13);
                            }
                            cursor2 = cursorQuery;
                            if (cursor2.moveToNext() || length > iMax) {
                                break;
                                break;
                            }
                            c0805n2 = c0805n;
                            cursorQuery = cursor2;
                            i8 = 0;
                            i9 = 1;
                        } catch (IOException e14) {
                            e = e14;
                            cursor2 = cursorQuery;
                            Z z92 = ((C0817r0) c0773c02.f5146q).f12150y;
                            C0817r0.k(z92);
                            z92.f11875v.c(e, "Failed to ungzip content");
                            throw e;
                        }
                    }
                    cursor2.close();
                    listSubList = arrayList2;
                } else {
                    listSubList = Collections.EMPTY_LIST;
                    cursorQuery.close();
                }
            } catch (SQLiteException e15) {
                e = e15;
                cursor2 = cursorQuery;
                Z z112 = c0817r02.f12150y;
                C0817r0.k(z112);
                z112.f11875v.d("Error querying bundles. appId", Z.M(str), e);
                listSubList = Collections.EMPTY_LIST;
                if (cursor2 != null) {
                }
            } catch (Throwable th2) {
                th = th2;
                Cursor cursor3 = cursorQuery;
                cursor = cursor3;
                if (cursor != null) {
                    cursor.close();
                }
                throw th;
            }
        } catch (SQLiteException e16) {
            e = e16;
            cursor2 = null;
        } catch (Throwable th3) {
            th = th3;
            cursor = null;
            if (cursor != null) {
            }
            throw th;
        }
        if (listSubList.isEmpty()) {
            return;
        }
        F0 f0N0 = n0(str);
        E0 e02 = E0.f11447r;
        if (f0N0.k(e02)) {
            Iterator it6 = listSubList.iterator();
            while (true) {
                if (!it6.hasNext()) {
                    strF = null;
                    break;
                }
                C0628e1 c0628e14 = (C0628e1) ((Pair) it6.next()).first;
                if (!c0628e14.F().isEmpty()) {
                    strF = c0628e14.F();
                    break;
                }
            }
            if (strF != null) {
                for (int i12 = 0; i12 < listSubList.size(); i12++) {
                    C0628e1 c0628e15 = (C0628e1) ((Pair) listSubList.get(i12)).first;
                    if (!c0628e15.F().isEmpty() && !c0628e15.F().equals(strF)) {
                        z8 = false;
                        listSubList = listSubList.subList(0, i12);
                        break;
                    }
                }
                z8 = false;
            } else {
                z8 = false;
            }
        }
        C0613b1 c0613b1O = C0618c1.o();
        int size = listSubList.size();
        ArrayList arrayList3 = new ArrayList(listSubList.size());
        boolean z13 = ("1".equals(h0().f11954t.k(str, "gaia_collection_enabled")) && n0(str).k(e02)) ? true : z8;
        boolean zK = n0(str).k(e02);
        boolean zK2 = n0(str).k(E0.f11448s);
        boolean zR = h0().R(str, I.f11509M0);
        M1 m12 = this.f11690z;
        C0817r0 c0817r03 = (C0817r0) m12.f5146q;
        C0784g c0784g = c0817r03.f12148w;
        H h9 = I.f11517Q0;
        boolean zR2 = c0784g.R(null, h9);
        EnumC0783f1 enumC0783f1 = EnumC0783f1.f11946t;
        boolean z14 = z13;
        EnumC0783f1 enumC0783f12 = EnumC0783f1.f11944r;
        EnumC0783f1 enumC0783f13 = EnumC0783f1.f11947u;
        Q1 q12 = m12.f11473r;
        C0613b1 c0613b12 = c0613b1O;
        Z z15 = c0817r03.f12150y;
        if (zR2) {
            C0805n c0805n3 = q12.f11683s;
            L(c0805n3);
            V vB0 = c0805n3.B0(str);
            if (vB0 == null || !vB0.t()) {
                i = size;
                arrayList = arrayList3;
                l12 = new L1(m12.F(str), Collections.EMPTY_MAP, enumC0783f12, null);
            } else {
                C0658k1 c0658k1N = C0663l1.n();
                c0658k1N.k();
                arrayList = arrayList3;
                C0663l1.u((C0663l1) c0658k1N.f9801r, 2);
                int iD = I1.a.d(vB0.R());
                I1.a.s(iD);
                c0658k1N.l(iD);
                if (m12.G(str, vB0.d())) {
                    String strC = vB0.c();
                    c0658k1N.k();
                    i = size;
                    C0663l1.u((C0663l1) c0658k1N.f9801r, 2);
                    C0803m0 c0803m0 = q12.f11681q;
                    L(c0803m0);
                    com.google.android.gms.internal.measurement.G0 g0T = c0803m0.T(vB0.c());
                    if (g0T == null || !g0T.G()) {
                        C0817r0.k(z15);
                        z15.D.c(strC, "[sgtm] Missing sgtm_setting in remote config. appId");
                        c0658k1N.k();
                        C0663l1.t((C0663l1) c0658k1N.f9801r, 4);
                    } else {
                        HashMap map = new HashMap();
                        if (TextUtils.isEmpty(vB0.i())) {
                            g02 = g0T;
                        } else {
                            g02 = g0T;
                            map.put("x-gtm-server-preview", vB0.i());
                        }
                        String strQ = g02.u().q();
                        int iD2 = I1.a.d(vB0.R());
                        if (iD2 != 0 && iD2 != 2) {
                            c0658k1N.l(iD2);
                        } else if (!c0817r03.f12148w.R(null, h9)) {
                            c0658k1N.l(10);
                        } else if (M1.H(vB0.c())) {
                            c0658k1N.l(11);
                        } else if (TextUtils.isEmpty(strQ)) {
                            c0658k1N.l(12);
                        } else {
                            C0817r0.k(z15);
                            z15.D.c(strC, "[sgtm] Eligible for client side upload. appId");
                            c0658k1N.k();
                            C0663l1.u((C0663l1) c0658k1N.f9801r, 3);
                            c0658k1N.l(2);
                            l17 = new L1(strQ, map, enumC0783f13, (C0663l1) c0658k1N.h());
                            if (l17 != null) {
                                l15 = l17;
                            } else {
                                l12 = new L1(m12.F(str), Collections.EMPTY_MAP, enumC0783f12, (C0663l1) c0658k1N.h());
                            }
                        }
                        g02.u().getClass();
                        g02.u().getClass();
                        if (TextUtils.isEmpty(strQ)) {
                            c0658k1N.k();
                            C0663l1.t((C0663l1) c0658k1N.f9801r, 6);
                            C0817r0.k(z15);
                            z15.D.c(vB0.c(), "[sgtm] Local service, missing sgtm_server_url");
                        } else {
                            C0817r0.k(z15);
                            z15.D.c(strC, "[sgtm] Eligible for local service direct upload. appId");
                            c0658k1N.k();
                            C0663l1.u((C0663l1) c0658k1N.f9801r, 5);
                            c0658k1N.k();
                            C0663l1.t((C0663l1) c0658k1N.f9801r, 2);
                            l17 = new L1(strQ, map, enumC0783f1, (C0663l1) c0658k1N.h());
                            if (l17 != null) {
                            }
                        }
                    }
                    l17 = null;
                    if (l17 != null) {
                    }
                } else {
                    c0658k1N.k();
                    C0663l1.t((C0663l1) c0658k1N.f9801r, 3);
                    l15 = new L1(m12.F(str), Collections.EMPTY_MAP, enumC0783f12, (C0663l1) c0658k1N.h());
                    i = size;
                }
            }
            l15 = l12;
        } else {
            i = size;
            arrayList = arrayList3;
            C0805n c0805n4 = q12.f11683s;
            L(c0805n4);
            V vB02 = c0805n4.B0(str);
            if (vB02 == null || !m12.G(str, vB02.d())) {
                l12 = new L1(m12.F(str), Collections.EMPTY_MAP, enumC0783f12, null);
            } else if (vB02.t()) {
                C0817r0.k(z15);
                X x8 = z15.D;
                x8.b("sgtm upload enabled in manifest.");
                C0803m0 c0803m02 = q12.f11681q;
                L(c0803m02);
                com.google.android.gms.internal.measurement.G0 g0T2 = c0803m02.T(vB02.c());
                if (g0T2 == null) {
                    c0663l1 = null;
                    l13 = null;
                } else if (g0T2.G()) {
                    String strR = g0T2.u().r();
                    if (!TextUtils.isEmpty(strR)) {
                        String strP = g0T2.u().p();
                        C0817r0.k(z15);
                        x8.d("sgtm configured with upload_url, server_info", strR, true != TextUtils.isEmpty(strP) ? "N" : "Y");
                        if (TextUtils.isEmpty(strP)) {
                            c0663l1 = null;
                            l14 = new L1(strR, Collections.EMPTY_MAP, enumC0783f1, null);
                        } else {
                            HashMap map2 = new HashMap();
                            map2.put("x-sgtm-server-info", strP);
                            if (!TextUtils.isEmpty(vB02.i())) {
                                map2.put("x-gtm-server-preview", vB02.i());
                            }
                            c0663l1 = null;
                            l14 = new L1(strR, map2, enumC0783f1, null);
                        }
                        l13 = l14;
                    }
                }
                if (l13 == null) {
                }
            } else {
                c0663l1 = null;
                l13 = null;
                if (l13 == null) {
                    l15 = l13;
                } else {
                    l12 = new L1(m12.F(str), Collections.EMPTY_MAP, enumC0783f12, c0663l1);
                }
            }
            l15 = l12;
        }
        int i13 = 0;
        while (true) {
            c0773c0 = this.f11687w;
            c0817r0 = this.f11659B;
            int i14 = i;
            if (i13 >= i14) {
                break;
            }
            C0623d1 c0623d12 = (C0623d1) ((C0628e1) ((Pair) listSubList.get(i13)).first).f();
            ArrayList arrayList4 = arrayList;
            arrayList4.add((Long) ((Pair) listSubList.get(i13)).second);
            h0().L();
            c0623d12.k();
            C0628e1.C1((C0628e1) c0623d12.f9801r);
            c0623d12.k();
            C0628e1.B1((C0628e1) c0623d12.f9801r, j8);
            c0817r0.getClass();
            c0623d12.k();
            C0628e1.v1((C0628e1) c0623d12.f9801r);
            if (!z14) {
                c0623d12.k();
                C0628e1.v0((C0628e1) c0623d12.f9801r);
            }
            if (!zK) {
                c0623d12.k();
                C0628e1.B0((C0628e1) c0623d12.f9801r);
                c0623d12.k();
                C0628e1.y0((C0628e1) c0623d12.f9801r);
            }
            if (!zK2) {
                c0623d12.k();
                C0628e1.s0((C0628e1) c0623d12.f9801r);
            }
            l(c0623d12, str);
            if (!zR) {
                c0623d12.k();
                C0628e1.C0((C0628e1) c0623d12.f9801r);
            }
            if (!zK2) {
                c0623d12.k();
                C0628e1.t0((C0628e1) c0623d12.f9801r);
            }
            String strF2 = ((C0628e1) c0623d12.f9801r).F();
            if (TextUtils.isEmpty(strF2) || strF2.equals("00000000-0000-0000-0000-000000000000")) {
                ArrayList arrayList5 = new ArrayList(c0623d12.C());
                Iterator it7 = arrayList5.iterator();
                list = listSubList;
                i = i14;
                Long lValueOf = null;
                Long lValueOf2 = null;
                boolean z16 = false;
                boolean z17 = false;
                while (it7.hasNext()) {
                    int i15 = i13;
                    com.google.android.gms.internal.measurement.W0 w02 = (com.google.android.gms.internal.measurement.W0) it7.next();
                    Iterator it8 = it7;
                    if ("_fx".equals(w02.t())) {
                        it8.remove();
                        it7 = it8;
                        i13 = i15;
                        z16 = true;
                    } else if ("_f".equals(w02.t())) {
                        f();
                        com.google.android.gms.internal.measurement.Z0 z0N = C0773c0.N(w02, "_pfo");
                        if (z0N != null) {
                            lValueOf = Long.valueOf(z0N.q());
                        }
                        f();
                        com.google.android.gms.internal.measurement.Z0 z0N2 = C0773c0.N(w02, "_uwa");
                        if (z0N2 != null) {
                            lValueOf2 = Long.valueOf(z0N2.q());
                        }
                        it7 = it8;
                        i13 = i15;
                    } else {
                        it7 = it8;
                        i13 = i15;
                    }
                    z17 = true;
                }
                i5 = i13;
                if (z16) {
                    c0623d12.k();
                    C0628e1.w0((C0628e1) c0623d12.f9801r);
                    c0623d12.k();
                    C0628e1.n0((C0628e1) c0623d12.f9801r, arrayList5);
                }
                if (z17) {
                    V(c0623d12.B(), true, lValueOf, lValueOf2);
                }
            } else {
                list = listSubList;
                i = i14;
                i5 = i13;
            }
            if (c0623d12.T() == 0) {
                c0613b1 = c0613b12;
            } else {
                if (h0().R(str, I.f11492C0)) {
                    byte[] bArrC = ((C0628e1) c0623d12.h()).c();
                    L(c0773c0);
                    long jE0 = c0773c0.e0(bArrC);
                    c0623d12.k();
                    C0628e1.T((C0628e1) c0623d12.f9801r, jE0);
                }
                if (h0().R(null, I.f11517Q0) && (c0663l12 = l15.f11622d) != null) {
                    c0623d12.k();
                    C0628e1.x1((C0628e1) c0623d12.f9801r, c0663l12);
                }
                c0613b12.k();
                c0613b1 = c0613b12;
                C0618c1.v((C0618c1) c0613b1.f9801r, (C0628e1) c0623d12.h());
            }
            i13 = i5 + 1;
            c0613b12 = c0613b1;
            arrayList = arrayList4;
            listSubList = list;
        }
        C0613b1 c0613b13 = c0613b12;
        ArrayList arrayList6 = arrayList;
        if (((C0618c1) c0613b13.f9801r).n() == 0) {
            T(arrayList6);
            u(false, 204, null, null, str, Collections.EMPTY_LIST);
            return;
        }
        C0618c1 c0618c1 = (C0618c1) c0613b13.h();
        ArrayList arrayList7 = new ArrayList();
        boolean zR3 = h0().R(null, I.f11517Q0);
        EnumC0783f1 enumC0783f14 = l15.f11621c;
        boolean z18 = zR3 && enumC0783f14 == enumC0783f13;
        if (enumC0783f14 == enumC0783f1) {
            it = ((C0618c1) c0613b13.h()).t().iterator();
            while (true) {
                if (!it.hasNext()) {
                    if (((C0628e1) it.next()).V0()) {
                        string = UUID.randomUUID().toString();
                        break;
                    }
                } else {
                    string = null;
                    break;
                }
            }
            C0618c1 c0618c12 = (C0618c1) c0613b13.h();
            c().E();
            k();
            C0613b1 c0613b1P = C0618c1.p(c0618c12);
            if (!TextUtils.isEmpty(string)) {
                c0613b1P.k();
                C0618c1.y((C0618c1) c0613b1P.f9801r, string);
            }
            C0803m0 c0803m03 = this.f11681q;
            L(c0803m03);
            strU = c0803m03.U(str);
            if (!TextUtils.isEmpty(strU)) {
                c0613b1P.k();
                C0618c1.z((C0618c1) c0613b1P.f9801r, strU);
            }
            ArrayList arrayList8 = new ArrayList();
            it2 = c0618c12.t().iterator();
            while (it2.hasNext()) {
                C0623d1 c0623d1N = C0628e1.n((C0628e1) it2.next());
                c0623d1N.k();
                C0628e1.v0((C0628e1) c0623d1N.f9801r);
                arrayList8.add((C0628e1) c0623d1N.h());
            }
            c0613b1P.k();
            C0618c1.w((C0618c1) c0613b1P.f9801r);
            c0613b1P.k();
            C0618c1.u((C0618c1) c0613b1P.f9801r, arrayList8);
            c0784gH0 = h0();
            h8 = I.f11513O0;
            if (c0784gH0.R(null, h8)) {
                e().D.b("[sgtm] Processed MeasurementBatch for sGTM.");
            } else {
                e().D.c(TextUtils.isEmpty(string) ? "null" : ((C0618c1) c0613b1P.f9801r).r(), "[sgtm] Processed MeasurementBatch for sGTM with sgtmJoinId: ");
            }
            C0618c1 c0618c13 = (C0618c1) c0613b1P.h();
            if (!TextUtils.isEmpty(string) && h0().R(null, h8)) {
                C0618c1 c0618c14 = (C0618c1) c0613b13.h();
                c().E();
                k();
                C0613b1 c0613b1O2 = C0618c1.o();
                e().D.c(string, "[sgtm] Processing Google Signal, sgtmJoinId:");
                c0613b1O2.k();
                C0618c1.y((C0618c1) c0613b1O2.f9801r, string);
                for (C0628e1 c0628e16 : c0618c14.t()) {
                    C0623d1 c0623d1K2 = C0628e1.k2();
                    String strZ = c0628e16.z();
                    c0623d1K2.k();
                    C0628e1.b0((C0628e1) c0623d1K2.f9801r, strZ);
                    int iP1 = c0628e16.P1();
                    c0623d1K2.k();
                    C0628e1.Y((C0628e1) c0623d1K2.f9801r, iP1);
                    c0613b1O2.k();
                    C0618c1.v((C0618c1) c0613b1O2.f9801r, (C0628e1) c0623d1K2.h());
                }
                C0618c1 c0618c15 = (C0618c1) c0613b1O2.h();
                C0803m0 c0803m04 = q12.f11681q;
                L(c0803m04);
                String strU2 = c0803m04.U(str);
                zIsEmpty = TextUtils.isEmpty(strU2);
                EnumC0783f1 enumC0783f15 = EnumC0783f1.f11945s;
                EnumC0783f1 enumC0783f16 = EnumC0783f1.f11948v;
                if (zIsEmpty) {
                    Uri uri = Uri.parse((String) I.f11584s.a(null));
                    Uri.Builder builderBuildUpon = uri.buildUpon();
                    builderBuildUpon.authority(strU2 + "." + uri.getAuthority());
                    String string2 = builderBuildUpon.build().toString();
                    if (z18) {
                        enumC0783f15 = enumC0783f16;
                    }
                    l16 = new L1(string2, Collections.EMPTY_MAP, enumC0783f15, null);
                } else {
                    String str2 = (String) I.f11584s.a(null);
                    if (z18) {
                        enumC0783f15 = enumC0783f16;
                    }
                    l16 = new L1(str2, Collections.EMPTY_MAP, enumC0783f15, null);
                }
                arrayList7.add(Pair.create(c0618c15, l16));
            }
            if (!z18) {
                C0613b1 c0613b14 = (C0613b1) c0618c13.f();
                for (int i16 = 0; i16 < c0618c13.n(); i16++) {
                    C0623d1 c0623d13 = (C0623d1) c0618c13.q(i16).f();
                    c0623d13.k();
                    C0628e1.E0((C0628e1) c0623d13.f9801r);
                    c0623d13.k();
                    C0628e1.R((C0628e1) c0623d13.f9801r, j8);
                    c0613b14.k();
                    C0618c1.x((C0618c1) c0613b14.f9801r, i16, (C0628e1) c0623d13.h());
                }
                arrayList7.add(Pair.create((C0618c1) c0613b14.h(), l15));
                T(arrayList6);
                u(false, 204, null, null, str, arrayList7);
                if (c0(str, l15.f11619a)) {
                    e().D.c(str, "[sgtm] Sending sgtm batches available notification to app");
                    Intent intent = new Intent();
                    intent.setAction("com.google.android.gms.measurement.BATCHES_AVAILABLE");
                    intent.setPackage(str);
                    Context context = c0817r0.f12142q;
                    if (Build.VERSION.SDK_INT < 34) {
                        context.sendBroadcast(intent);
                        return;
                    } else {
                        context.sendBroadcast(intent, null, BroadcastOptions.makeBasic().setShareIdentityEnabled(true).toBundle());
                        return;
                    }
                }
                return;
            }
            c0618c1 = c0618c13;
        } else if (z18) {
            z18 = true;
            it = ((C0618c1) c0613b13.h()).t().iterator();
            while (true) {
                if (!it.hasNext()) {
                }
            }
            C0618c1 c0618c122 = (C0618c1) c0613b13.h();
            c().E();
            k();
            C0613b1 c0613b1P2 = C0618c1.p(c0618c122);
            if (!TextUtils.isEmpty(string)) {
            }
            C0803m0 c0803m032 = this.f11681q;
            L(c0803m032);
            strU = c0803m032.U(str);
            if (!TextUtils.isEmpty(strU)) {
            }
            ArrayList arrayList82 = new ArrayList();
            it2 = c0618c122.t().iterator();
            while (it2.hasNext()) {
            }
            c0613b1P2.k();
            C0618c1.w((C0618c1) c0613b1P2.f9801r);
            c0613b1P2.k();
            C0618c1.u((C0618c1) c0613b1P2.f9801r, arrayList82);
            c0784gH0 = h0();
            h8 = I.f11513O0;
            if (c0784gH0.R(null, h8)) {
            }
            C0618c1 c0618c132 = (C0618c1) c0613b1P2.h();
            if (!TextUtils.isEmpty(string)) {
                C0618c1 c0618c142 = (C0618c1) c0613b13.h();
                c().E();
                k();
                C0613b1 c0613b1O22 = C0618c1.o();
                e().D.c(string, "[sgtm] Processing Google Signal, sgtmJoinId:");
                c0613b1O22.k();
                C0618c1.y((C0618c1) c0613b1O22.f9801r, string);
                while (r0.hasNext()) {
                }
                C0618c1 c0618c152 = (C0618c1) c0613b1O22.h();
                C0803m0 c0803m042 = q12.f11681q;
                L(c0803m042);
                String strU22 = c0803m042.U(str);
                zIsEmpty = TextUtils.isEmpty(strU22);
                EnumC0783f1 enumC0783f152 = EnumC0783f1.f11945s;
                EnumC0783f1 enumC0783f162 = EnumC0783f1.f11948v;
                if (zIsEmpty) {
                }
                arrayList7.add(Pair.create(c0618c152, l16));
            }
            if (!z18) {
            }
        }
        boolean zR4 = h0().R(null, I.f11515P0);
        C0773c0 c0773c03 = this.f11682r;
        if (zR4) {
            L(c0773c03);
            if (!c0773c03.d0()) {
                return;
            }
        }
        if (Log.isLoggable(e().P(), 2)) {
            L(c0773c0);
            strL0 = c0773c0.l0(c0618c1);
        } else {
            strL0 = null;
        }
        f();
        byte[] bArrC2 = c0618c1.c();
        T(arrayList6);
        this.f11689y.f12208y.h(j8);
        e().D.e("Uploading data. app, uncompressed size, data", str, Integer.valueOf(bArrC2.length), strL0);
        this.f11666K = true;
        L(c0773c03);
        c0773c03.c0(str, l15, c0618c1, new com.google.android.material.datepicker.c(this, str, (Object) arrayList7, 4));
    }

    public final void Z(String str) {
        I1.a.u(this);
        this.f11667L = true;
        try {
            C0817r0 c0817r0 = this.f11659B;
            c0817r0.getClass();
            Boolean bool = c0817r0.r().f12180u;
            if (bool == null) {
                e().f11878y.b("Upload data called on the client side before use of service was decided");
            } else if (bool.booleanValue()) {
                e().f11875v.b("Upload called in the client side when service should be used");
            } else if (this.f11661E > 0) {
                F();
            } else {
                C0773c0 c0773c0 = this.f11682r;
                L(c0773c0);
                if (c0773c0.d0()) {
                    C0805n c0805n = this.f11683s;
                    L(c0805n);
                    if (c0805n.d0(str)) {
                        C0805n c0805n2 = this.f11683s;
                        L(c0805n2);
                        R1 r1J0 = c0805n2.J0(str);
                        if (r1J0 != null) {
                            C0618c1 c0618c1 = r1J0.f11695b;
                            e().D.e("[sgtm] Uploading data from upload queue. appId, type, url", str, r1J0.f11698e, r1J0.f11696c);
                            byte[] bArrC = c0618c1.c();
                            if (Log.isLoggable(e().P(), 2)) {
                                C0773c0 c0773c02 = this.f11687w;
                                L(c0773c02);
                                e().D.e("[sgtm] Uploading data from upload queue. appId, uncompressed size, data", str, Integer.valueOf(bArrC.length), c0773c02.l0(c0618c1));
                            }
                            this.f11666K = true;
                            C0773c0 c0773c03 = this.f11682r;
                            L(c0773c03);
                            c0773c03.c0(str, new L1(r1J0.f11696c, r1J0.f11697d, r1J0.f11698e, null), c0618c1, new com.google.android.material.datepicker.c(this, str, (Object) r1J0, 5));
                        }
                    } else {
                        e().D.c(str, "[sgtm] Upload queue has no batches for appId");
                    }
                } else {
                    e().D.b("Network not connected, ignoring upload request");
                    F();
                }
            }
            this.f11667L = false;
            C();
        } catch (Throwable th) {
            this.f11667L = false;
            C();
            throw th;
        }
    }

    @Override // d3.B0
    public final Context a() {
        return this.f11659B.f12142q;
    }

    public final void a0(String str, com.google.android.gms.internal.measurement.Y0 y02, Bundle bundle, String str2) {
        int iMax;
        List listUnmodifiableList = Collections.unmodifiableList(Arrays.asList("_o", "_sn", "_sc", "_si"));
        if (W1.y0(((com.google.android.gms.internal.measurement.Z0) y02.f9801r).s()) || W1.y0(str)) {
            C0784g c0784gH0 = h0();
            c0784gH0.getClass();
            iMax = Math.max(Math.max(Math.min(c0784gH0.K(str2, I.f11555h0), 500), 100), 256);
        } else {
            C0784g c0784gH02 = h0();
            c0784gH02.getClass();
            iMax = Math.max(Math.min(c0784gH02.K(str2, I.f11555h0), 500), 100);
        }
        long j8 = iMax;
        long jCodePointCount = ((com.google.android.gms.internal.measurement.Z0) y02.f9801r).t().codePointCount(0, ((com.google.android.gms.internal.measurement.Z0) y02.f9801r).t().length());
        g();
        String strS = ((com.google.android.gms.internal.measurement.Z0) y02.f9801r).s();
        h0();
        String strO = W1.O(40, strS, true);
        if (jCodePointCount <= j8 || listUnmodifiableList.contains(((com.google.android.gms.internal.measurement.Z0) y02.f9801r).s())) {
            return;
        }
        if ("_ev".equals(((com.google.android.gms.internal.measurement.Z0) y02.f9801r).s())) {
            g();
            String strT = ((com.google.android.gms.internal.measurement.Z0) y02.f9801r).t();
            C0784g c0784gH03 = h0();
            c0784gH03.getClass();
            bundle.putString("_ev", W1.O(Math.max(Math.max(Math.min(c0784gH03.K(str2, I.f11555h0), 500), 100), 256), strT, true));
            return;
        }
        e().f11869A.d("Param value is too long; discarded. Name, value length", strO, Long.valueOf(jCodePointCount));
        if (bundle.getLong("_err") == 0) {
            bundle.putLong("_err", 4L);
            if (bundle.getString("_ev") == null) {
                bundle.putString("_ev", strO);
                bundle.putLong("_el", jCodePointCount);
            }
        }
        bundle.remove(((com.google.android.gms.internal.measurement.Z0) y02.f9801r).s());
    }

    @Override // d3.B0
    public final C0253j b() {
        return this.f11659B.f12147v;
    }

    /* JADX WARN: Can't wrap try/catch for region: R(71:123|(2:125|(3:127|(1:129)|130))(1:131)|132|133|(1:135)|136|(2:140|(1:142))|143|(2:398|153)|154|155|156|402|157|158|161|(1:163)|164|(2:166|(2:172|173)(1:169))(1:174)|175|(1:177)|178|(1:180)(1:181)|182|(1:184)(1:185)|186|(1:188)(1:190)|191|(2:193|194)|195|(1:197)(1:198)|199|(1:203)|204|205|(2:207|(6:209|(1:213)|214|(1:216)(1:217)|218|(1:220)(15:221|(1:223)(1:224)|225|(1:227)(1:228)|229|(1:231)(1:232)|233|(1:235)(1:236)|237|(1:239)(1:240)|241|(1:243)(1:244)|245|(1:247)(1:248)|249))(1:251))(0)|252|(1:254)|255|(1:257)(1:258)|(1:262)(33:264|(2:265|(3:267|(3:396|269|(2:271|(2:273|417)(1:420))(1:419))(1:418)|277)(2:416|279))|280|(1:282)|(1:284)|285|(1:287)|288|(1:318)(4:292|(1:294)(1:295)|296|(4:298|(1:300)|301|(0)(3:307|308|(5:310|(1:312)(1:313)|314|(1:316)|317)(0)))(0))|319|(2:321|(1:323)(2:324|325))|326|(3:328|(1:330)|331)(1:332)|333|(1:337)|338|(1:340)|341|(4:344|(2:346|(4:348|(1:350)(1:351)|352|(2:354|424)(1:423))(2:356|422))(0)|357|342)|408|358|404|359|360|(2:361|(2:363|(1:426)(1:427))(3:425|366|(1:370)))|365|371|406|372|(1:374)(2:378|379)|388|389|390)|263|(0)|285|(0)|288|(2:290|318)(0)|319|(0)|326|(0)(0)|333|(2:335|337)|338|(0)|341|(1:342)|408|358|404|359|360|(3:361|(0)(0)|427)|365|371|406|372|(0)(0)|388|389|390) */
    /* JADX WARN: Code restructure failed: missing block: B:376:0x0c2d, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:380:0x0c34, code lost:
    
        ((d3.C0817r0) r2.f5146q).e().J().d("Error storing raw event. appId", d3.Z.M(r15.f12115a), r0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:382:0x0c4c, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:387:0x0c69, code lost:
    
        e().J().d("Data loss. Failed to insert raw event metadata. appId", d3.Z.M(r3.B()), r0);
     */
    /* JADX WARN: Removed duplicated region for block: B:100:0x035a  */
    /* JADX WARN: Removed duplicated region for block: B:102:0x035f A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:111:0x03cc A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:115:0x03f1  */
    /* JADX WARN: Removed duplicated region for block: B:123:0x0445  */
    /* JADX WARN: Removed duplicated region for block: B:251:0x07af  */
    /* JADX WARN: Removed duplicated region for block: B:284:0x088b A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:287:0x089b A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:318:0x096b  */
    /* JADX WARN: Removed duplicated region for block: B:321:0x09b1 A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:328:0x09d1 A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:332:0x0a33  */
    /* JADX WARN: Removed duplicated region for block: B:340:0x0a5a A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:344:0x0a73 A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:356:0x0b09  */
    /* JADX WARN: Removed duplicated region for block: B:363:0x0b74 A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:374:0x0c17 A[Catch: all -> 0x01cf, SQLiteException -> 0x0c2d, TRY_LEAVE, TryCatch #6 {SQLiteException -> 0x0c2d, blocks: (B:372:0x0c06, B:374:0x0c17), top: B:406:0x0c06, outer: #8 }] */
    /* JADX WARN: Removed duplicated region for block: B:378:0x0c2f  */
    /* JADX WARN: Removed duplicated region for block: B:425:0x0b82 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:55:0x01ea A[PHI: r42 r43
      0x01ea: PHI (r42v9 java.lang.String) = (r42v0 java.lang.String), (r42v0 java.lang.String), (r42v10 java.lang.String) binds: [B:74:0x025b, B:76:0x0269, B:54:0x01e6] A[DONT_GENERATE, DONT_INLINE]
      0x01ea: PHI (r43v8 java.lang.String) = (r43v1 java.lang.String), (r43v1 java.lang.String), (r43v9 java.lang.String) binds: [B:74:0x025b, B:76:0x0269, B:54:0x01e6] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:60:0x01fa A[Catch: all -> 0x01cf, TRY_ENTER, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:72:0x0251 A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:75:0x025d A[Catch: all -> 0x01cf, TryCatch #8 {all -> 0x01cf, blocks: (B:38:0x01b0, B:41:0x01bd, B:43:0x01c5, B:49:0x01d2, B:98:0x034d, B:109:0x038b, B:111:0x03cc, B:113:0x03d1, B:114:0x03e8, B:116:0x03f3, B:118:0x040d, B:120:0x0413, B:121:0x042a, B:125:0x044b, B:129:0x0472, B:130:0x0489, B:132:0x0494, B:135:0x04b1, B:136:0x04c5, B:138:0x04cd, B:140:0x04d7, B:142:0x04dd, B:143:0x04e4, B:145:0x04f1, B:147:0x04f9, B:149:0x0501, B:151:0x0507, B:153:0x050b, B:154:0x0517, B:156:0x051f, B:157:0x0528, B:163:0x0568, B:164:0x057d, B:166:0x05a6, B:169:0x05ce, B:173:0x061c, B:175:0x0649, B:177:0x0676, B:178:0x0679, B:180:0x067f, B:182:0x0687, B:184:0x068d, B:186:0x0695, B:188:0x069b, B:194:0x06ad, B:195:0x06b0, B:197:0x06bb, B:199:0x06c7, B:201:0x06f3, B:203:0x06f9, B:204:0x06fe, B:207:0x070f, B:209:0x0718, B:213:0x072d, B:218:0x073a, B:254:0x07b7, B:255:0x07ba, B:257:0x07e5, B:260:0x07ee, B:264:0x07f9, B:265:0x0813, B:267:0x0819, B:269:0x0833, B:271:0x083f, B:273:0x084c, B:280:0x0881, B:284:0x088b, B:285:0x088e, B:287:0x089b, B:288:0x089e, B:290:0x08b2, B:292:0x08b6, B:294:0x08c1, B:296:0x08cf, B:298:0x08d9, B:300:0x08e4, B:301:0x08ed, B:303:0x08f7, B:305:0x0903, B:308:0x090f, B:310:0x091b, B:312:0x0931, B:314:0x094b, B:316:0x0957, B:317:0x0960, B:319:0x0970, B:321:0x09b1, B:324:0x09bc, B:325:0x09c6, B:326:0x09c7, B:328:0x09d1, B:330:0x09f1, B:331:0x09fc, B:333:0x0a34, B:335:0x0a3c, B:337:0x0a46, B:338:0x0a50, B:340:0x0a5a, B:341:0x0a64, B:342:0x0a6d, B:344:0x0a73, B:346:0x0abd, B:348:0x0acf, B:352:0x0aee, B:354:0x0afe, B:351:0x0ade, B:358:0x0b11, B:359:0x0b53, B:360:0x0b5e, B:361:0x0b6e, B:363:0x0b74, B:371:0x0bba, B:372:0x0c06, B:374:0x0c17, B:388:0x0c7e, B:379:0x0c31, B:380:0x0c34, B:366:0x0b82, B:368:0x0ba8, B:385:0x0c4f, B:386:0x0c68, B:387:0x0c69, B:295:0x08c6, B:278:0x086d, B:258:0x07e8, B:221:0x0743, B:225:0x0750, B:229:0x075e, B:233:0x076c, B:237:0x077a, B:241:0x0788, B:245:0x0794, B:249:0x07a2, B:174:0x0639, B:160:0x0551, B:102:0x035f, B:103:0x036b, B:105:0x0371, B:107:0x037f, B:57:0x01f0, B:60:0x01fa, B:62:0x020f, B:68:0x0227, B:73:0x0257, B:75:0x025d, B:77:0x026b, B:79:0x027b, B:82:0x0285, B:94:0x030a, B:96:0x0314, B:83:0x02aa, B:84:0x02c3, B:86:0x02c9, B:93:0x02f1, B:92:0x02dc, B:71:0x0233, B:72:0x0251), top: B:410:0x01b0, inners: #1, #4, #6, #7 }] */
    /* JADX WARN: Removed duplicated region for block: B:81:0x0281  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void b0(C0828v c0828v, X1 x12) {
        String strA;
        String str;
        String str2;
        long jRound;
        long j8;
        U1 u12;
        String str3;
        String str4;
        N1 n12;
        long length;
        long jIntValue;
        N1 n13;
        long jDelete;
        N1 n14;
        r rVar;
        C0819s c0819sB;
        String str5;
        String str6;
        String str7;
        String str8;
        String str9;
        long j9;
        String str10;
        ArrayList arrayList;
        F0 f0F;
        String str11;
        r rVar2;
        E0 e02;
        V vB0;
        int i;
        List listM;
        int i5;
        C0805n c0805nI0;
        C0628e1 c0628e1;
        C0805n c0805nI02;
        Iterator<String> it;
        ContentValues contentValues;
        String str12;
        long jE0;
        V vB02;
        Object obj;
        U1 u1K0;
        P2.w.f(x12);
        long j10 = x12.H;
        String str13 = x12.f11818K;
        long j11 = x12.f11835u;
        String str14 = x12.f11820M;
        String str15 = x12.f11833s;
        String str16 = x12.f11834t;
        String str17 = x12.f11831q;
        P2.w.c(str17);
        long jNanoTime = System.nanoTime();
        c().E();
        k();
        f();
        String str18 = x12.f11832r;
        boolean zIsEmpty = TextUtils.isEmpty(str18);
        String str19 = x12.f11814F;
        if (zIsEmpty && TextUtils.isEmpty(str19)) {
            return;
        }
        boolean z8 = x12.f11838x;
        if (!z8) {
            f0(x12);
            return;
        }
        C0803m0 c0803m0M0 = m0();
        String str20 = c0828v.f12193q;
        boolean zX = c0803m0M0.X(str17, str20);
        C0817r0 c0817r0 = this.f11659B;
        N1 n15 = this.f11680Z;
        if (zX) {
            e().L().d("Dropping blocked event. appId", Z.M(str17), c0817r0.p().d(str20));
            if (!"1".equals(m0().k(str17, "measurement.upload.blacklist_internal")) && !"1".equals(m0().k(str17, "measurement.upload.blacklist_public"))) {
                if ("_err".equals(str20)) {
                    return;
                }
                g();
                W1.Y(n15, str17, 11, "_ev", str20, 0);
                return;
            }
            V vB03 = i0().B0(str17);
            if (vB03 != null) {
                C0817r0 c0817r02 = vB03.f11758a;
                C0815q0 c0815q0 = c0817r02.f12151z;
                C0817r0.k(c0815q0);
                c0815q0.E();
                long j12 = vB03.f11757T;
                C0815q0 c0815q02 = c0817r02.f12151z;
                C0817r0.k(c0815q02);
                c0815q02.E();
                long jAbs = Math.abs(d().a() - Math.max(j12, vB03.f11756S));
                h0();
                if (jAbs > ((Long) I.f11510N.a(null)).longValue()) {
                    e().I().b("Fetching config for blocked app");
                    m(vB03);
                    return;
                }
                return;
            }
            return;
        }
        R0.m mVarN = R0.m.n(c0828v);
        W1 w1G = g();
        C0784g c0784gH0 = h0();
        c0784gH0.getClass();
        w1G.X(mVarN, Math.max(Math.min(c0784gH0.K(str17, I.X), 100), 25));
        int iMax = Math.max(Math.min(h0().K(str17, I.f11552g0), 35), 10);
        Bundle bundle = (Bundle) mVarN.f5955e;
        for (String str21 : new TreeSet(bundle.keySet())) {
            if ("items".equals(str21)) {
                g().W(bundle.getParcelableArray(str21), iMax);
            }
        }
        C0828v c0828vM = mVarN.m();
        String str22 = c0828vM.f12193q;
        if (Log.isLoggable(e().P(), 2)) {
            e().K().c(c0817r0.p().c(c0828vM), "Logging event");
        }
        i0().P();
        try {
            f0(x12);
            boolean z9 = "ecommerce_purchase".equals(str22) || "purchase".equals(str22) || "refund".equals(str22);
            boolean zEquals = "_iap".equals(str22);
            C0825u c0825u = c0828vM.f12194r;
            if (zEquals) {
                strA = c0825u.A();
                str = str15;
                Bundle bundle2 = c0825u.f12186q;
                if (z9) {
                    str2 = str16;
                    jRound = bundle2.getLong("value");
                } else {
                    double dDoubleValue = c0825u.y().doubleValue() * 1000000.0d;
                    if (dDoubleValue == 0.0d) {
                        str2 = str16;
                        dDoubleValue = bundle2.getLong("value") * 1000000.0d;
                    } else {
                        str2 = str16;
                    }
                    if (dDoubleValue > 9.223372036854776E18d || dDoubleValue < -9.223372036854776E18d) {
                        e().L().d("Data lost. Currency value is too big. appId", Z.M(str17), Double.valueOf(dDoubleValue));
                        i0().Z();
                    } else {
                        jRound = Math.round(dDoubleValue);
                        if ("refund".equals(str22)) {
                            jRound = -jRound;
                        }
                    }
                }
                if (TextUtils.isEmpty(strA)) {
                    String upperCase = strA.toUpperCase(Locale.US);
                    if (upperCase.matches("[A-Z]{3}")) {
                        String strConcat = "_ltv_".concat(upperCase);
                        U1 u1K02 = i0().K0(str17, strConcat);
                        if (u1K02 != null) {
                            Object obj2 = u1K02.f11739e;
                            if (obj2 instanceof Long) {
                                long jLongValue = ((Long) obj2).longValue();
                                String str23 = c0828vM.f12195s;
                                long jA = d().a();
                                Long lValueOf = Long.valueOf(jLongValue + jRound);
                                str3 = str18;
                                u12 = new U1(str17, str23, strConcat, jA, lValueOf);
                            } else {
                                C0805n c0805nI03 = i0();
                                int iK = h0().K(str17, I.f11522T) - 1;
                                P2.w.c(str17);
                                c0805nI03.E();
                                c0805nI03.F();
                                try {
                                    j8 = jRound;
                                    try {
                                        c0805nI03.A0().execSQL("delete from user_attributes where app_id=? and name in (select name from user_attributes where app_id=? and name like '!_ltv!_%' escape '!'order by set_timestamp desc limit ?,10);", new String[]{str17, str17, String.valueOf(iK)});
                                    } catch (SQLiteException e8) {
                                        e = e8;
                                        ((C0817r0) c0805nI03.f5146q).e().J().d("Error pruning currencies. appId", Z.M(str17), e);
                                    }
                                } catch (SQLiteException e9) {
                                    e = e9;
                                    j8 = jRound;
                                }
                                str3 = str18;
                                u12 = new U1(str17, c0828vM.f12195s, strConcat, d().a(), Long.valueOf(j8));
                            }
                            if (i0().s0(u12)) {
                                str4 = str3;
                            } else {
                                str4 = str3;
                                e().J().e("Too many unique user properties are set. Ignoring user property. appId", Z.M(str17), c0817r0.p().f(u12.f11737c), u12.f11739e);
                                g();
                                str17 = str17;
                                W1.Y(n15, str17, 9, null, null, 0);
                                n12 = n15;
                                boolean zZ0 = W1.z0(str22);
                                boolean zEquals2 = "_err".equals(str22);
                                g();
                                if (c0825u == null) {
                                    length = 0;
                                } else {
                                    Iterator<String> it2 = c0825u.f12186q.keySet().iterator();
                                    length = 0;
                                    while (it2.hasNext()) {
                                        Object objZ = c0825u.z(it2.next());
                                        if (objZ instanceof Parcelable[]) {
                                            length += (long) ((Parcelable[]) objZ).length;
                                        }
                                    }
                                }
                                String str24 = str17;
                                C0793j c0793jF0 = i0().F0(v(), str24, length + 1, true, zZ0, false, zEquals2, false, false, false);
                                long j13 = c0793jF0.f12009b;
                                h0();
                                N1 n16 = n12;
                                jIntValue = j13 - ((long) ((Integer) I.f11565l.a(null)).intValue());
                                if (jIntValue > 0) {
                                    if (jIntValue % 1000 == 1) {
                                        e().J().d("Data loss. Too many events logged. appId, count", Z.M(str24), Long.valueOf(c0793jF0.f12009b));
                                    }
                                    i0().Z();
                                } else if (zZ0) {
                                    long j14 = c0793jF0.f12008a;
                                    h0();
                                    long jIntValue2 = j14 - ((long) ((Integer) I.f11571n.a(null)).intValue());
                                    if (jIntValue2 > 0) {
                                        if (jIntValue2 % 1000 == 1) {
                                            e().J().d("Data loss. Too many public events logged. appId, count", Z.M(str24), Long.valueOf(c0793jF0.f12008a));
                                        }
                                        g();
                                        W1.Y(n16, str24, 16, "_ev", c0828vM.f12193q, 0);
                                        i0().Z();
                                    } else {
                                        String str25 = x12.f11831q;
                                        if (zEquals2) {
                                            n13 = n16;
                                            long jMax = c0793jF0.f12011d - ((long) Math.max(0, Math.min(1000000, h0().K(str25, I.f11568m))));
                                            if (jMax > 0) {
                                                if (jMax == 1) {
                                                    e().J().d("Too many error events logged. appId, count", Z.M(str24), Long.valueOf(c0793jF0.f12011d));
                                                }
                                                i0().Z();
                                            }
                                        } else {
                                            n13 = n16;
                                        }
                                        Bundle bundleA = c0825u.a();
                                        W1 w1G2 = g();
                                        String str26 = c0828vM.f12195s;
                                        w1G2.Z(bundleA, "_o", str26);
                                        if (g().u0(str24, x12.f11827T)) {
                                            g().Z(bundleA, "_dbg", 1L);
                                            g().Z(bundleA, "_r", 1L);
                                        }
                                        if ("_s".equals(str22) && (u1K0 = i0().K0(str25, "_sno")) != null) {
                                            Object obj3 = u1K0.f11739e;
                                            if (obj3 instanceof Long) {
                                                g().Z(bundleA, "_sno", obj3);
                                            }
                                        }
                                        if (h0().R(null, I.f11556h1) && Objects.equals(str26, "am") && str22.equals("_ai") && (obj = bundleA.get("value")) != null && (obj instanceof String)) {
                                            try {
                                                double d8 = Double.parseDouble((String) obj);
                                                bundleA.remove("value");
                                                bundleA.putDouble("value", d8);
                                            } catch (NumberFormatException unused) {
                                            }
                                        }
                                        C0805n c0805nI04 = i0();
                                        C0817r0 c0817r03 = (C0817r0) c0805nI04.f5146q;
                                        P2.w.c(str24);
                                        c0805nI04.E();
                                        c0805nI04.F();
                                        try {
                                            jDelete = c0805nI04.A0().delete("raw_events", "rowid in (select rowid from raw_events where app_id=? order by rowid desc limit -1 offset ?)", new String[]{str24, String.valueOf(Math.max(0, Math.min(1000000, c0817r03.f12148w.K(str24, I.f11579q))))});
                                        } catch (SQLiteException e10) {
                                            c0817r03.e().J().d("Error deleting over the limit events. appId", Z.M(str24), e10);
                                            jDelete = 0;
                                        }
                                        if (jDelete > 0) {
                                            e().L().d("Data lost. Too many events stored on disk, deleted. appId", Z.M(str24), Long.valueOf(jDelete));
                                        }
                                        C0817r0 c0817r04 = this.f11659B;
                                        r rVar3 = new r(c0817r04, c0828vM.f12195s, str24, c0828vM.f12193q, c0828vM.f12196t, 0L, bundleA);
                                        C0805n c0805nI05 = i0();
                                        String str27 = rVar3.f12116b;
                                        C0819s c0819sG0 = c0805nI05.g0("events", str24, str27);
                                        if (c0819sG0 == null) {
                                            long jZ0 = i0().z0(str24);
                                            h0().getClass();
                                            H h8 = I.f11528W;
                                            if (jZ0 < Math.max(Math.min(r6.K(str24, h8), 2000), 500) || !zZ0) {
                                                n14 = n13;
                                                c0819sB = new C0819s(str24, str27, 0L, 0L, 0L, rVar3.f12118d, 0L, null, null, null, null);
                                                rVar = rVar3;
                                            } else {
                                                X xJ = e().J();
                                                Y yM = Z.M(str24);
                                                String strD = c0817r04.p().d(str27);
                                                C0784g c0784gH02 = h0();
                                                c0784gH02.getClass();
                                                xJ.e("Too many event names used, ignoring event. appId, name, supported count", yM, strD, Integer.valueOf(Math.max(Math.min(c0784gH02.K(str24, h8), 2000), 500)));
                                                g();
                                                W1.Y(n13, str24, 8, null, null, 0);
                                            }
                                        } else {
                                            n14 = n13;
                                            r rVarA = rVar3.a(c0817r04, c0819sG0.f12160f);
                                            rVar = rVarA;
                                            c0819sB = c0819sG0.b(rVarA.f12118d);
                                        }
                                        i0().l0("events", c0819sB);
                                        c().E();
                                        k();
                                        String str28 = rVar.f12115a;
                                        P2.w.c(str28);
                                        P2.w.a(str28.equals(str25));
                                        C0623d1 c0623d1K2 = C0628e1.k2();
                                        c0623d1K2.O();
                                        c0623d1K2.L();
                                        if (!TextUtils.isEmpty(str25)) {
                                            c0623d1K2.p(str25);
                                        }
                                        if (TextUtils.isEmpty(str2)) {
                                            str5 = str2;
                                        } else {
                                            str5 = str2;
                                            c0623d1K2.r(str5);
                                        }
                                        if (TextUtils.isEmpty(str)) {
                                            str6 = str;
                                        } else {
                                            str6 = str;
                                            c0623d1K2.s(str6);
                                        }
                                        if (TextUtils.isEmpty(str14)) {
                                            str7 = str14;
                                        } else {
                                            str7 = str14;
                                            c0623d1K2.Q(str7);
                                        }
                                        long j15 = x12.f11840z;
                                        if (j15 != -2147483648L) {
                                            c0623d1K2.t((int) j15);
                                        }
                                        c0623d1K2.I(j11);
                                        if (TextUtils.isEmpty(str4)) {
                                            str8 = "raw_events";
                                            str9 = str4;
                                        } else {
                                            str8 = "raw_events";
                                            str9 = str4;
                                            c0623d1K2.H(str9);
                                        }
                                        P2.w.f(str25);
                                        String str29 = str7;
                                        F0 f0F2 = n0(str25).f(F0.e(100, str13));
                                        c0623d1K2.w(f0F2.i());
                                        if (((C0628e1) c0623d1K2.f9801r).B().isEmpty() && !TextUtils.isEmpty(str19)) {
                                            c0623d1K2.o(str19);
                                        }
                                        J3.b();
                                        boolean zR = h0().R(str25, I.W0);
                                        E0 e03 = E0.f11447r;
                                        if (zR) {
                                            g();
                                            if (W1.m0(str25)) {
                                                c0623d1K2.n(x12.f11825R);
                                                j9 = j15;
                                                long j16 = x12.f11826S;
                                                if (!f0F2.k(e03) && j16 != 0) {
                                                    j16 = (j16 & (-2)) | 32;
                                                }
                                                c0623d1K2.D(j16 == 1);
                                                if (j16 != 0) {
                                                    com.google.android.gms.internal.measurement.P0 p0N = com.google.android.gms.internal.measurement.Q0.n();
                                                    p0N.n((j16 & 1) != 0);
                                                    p0N.p((j16 & 2) != 0);
                                                    p0N.q((j16 & 4) != 0);
                                                    p0N.r((j16 & 8) != 0);
                                                    p0N.m((j16 & 16) != 0);
                                                    p0N.l((j16 & 32) != 0);
                                                    p0N.o((j16 & 64) != 0);
                                                    c0623d1K2.u((com.google.android.gms.internal.measurement.Q0) p0N.h());
                                                }
                                            } else {
                                                j9 = j15;
                                            }
                                        }
                                        long j17 = x12.f11836v;
                                        if (j17 != 0) {
                                            c0623d1K2.x(j17);
                                        }
                                        c0623d1K2.z(j10);
                                        C0773c0 c0773c0F = f();
                                        String str30 = str5;
                                        C0727y1 c0727y1A = C0727y1.a(c0773c0F.f11473r.f11659B.a().getContentResolver(), com.google.android.gms.internal.measurement.E1.a(), new O2.p(2));
                                        Map mapB = c0727y1A == null ? Collections.EMPTY_MAP : c0727y1A.b();
                                        try {
                                            if (mapB != null && !mapB.isEmpty()) {
                                                arrayList = new ArrayList();
                                                int iIntValue = ((Integer) I.f11549f0.a(null)).intValue();
                                                Iterator it3 = mapB.entrySet().iterator();
                                                while (true) {
                                                    if (!it3.hasNext()) {
                                                        str10 = str6;
                                                        break;
                                                    }
                                                    Map.Entry entry = (Map.Entry) it3.next();
                                                    Iterator it4 = it3;
                                                    str10 = str6;
                                                    if (((String) entry.getKey()).startsWith("measurement.id.")) {
                                                        try {
                                                            int i8 = Integer.parseInt((String) entry.getValue());
                                                            if (i8 != 0) {
                                                                arrayList.add(Integer.valueOf(i8));
                                                                if (arrayList.size() >= iIntValue) {
                                                                    ((C0817r0) c0773c0F.f5146q).e().L().c(Integer.valueOf(arrayList.size()), "Too many experiment IDs. Number of IDs");
                                                                    break;
                                                                }
                                                                continue;
                                                            } else {
                                                                continue;
                                                            }
                                                        } catch (NumberFormatException e11) {
                                                            ((C0817r0) c0773c0F.f5146q).e().L().c(e11, "Experiment ID NumberFormatException");
                                                        }
                                                    }
                                                    it3 = it4;
                                                    str6 = str10;
                                                }
                                                if (arrayList.isEmpty()) {
                                                }
                                                if (arrayList != null) {
                                                    c0623d1K2.V(arrayList);
                                                }
                                                if (h0().R(null, I.f11567l1)) {
                                                    c0623d1K2.F();
                                                }
                                                f0F = n0(str25).f(F0.e(100, str13));
                                                if (f0F.k(e03) || !x12.D) {
                                                    str11 = str9;
                                                    rVar2 = rVar;
                                                    e02 = e03;
                                                } else {
                                                    C0830v1 c0830v1 = this.f11689y;
                                                    c0830v1.getClass();
                                                    Pair pairI = f0F.k(e03) ? c0830v1.I(str25) : new Pair("", Boolean.FALSE);
                                                    if (!TextUtils.isEmpty((CharSequence) pairI.first)) {
                                                        c0623d1K2.P((String) pairI.first);
                                                        Object obj4 = pairI.second;
                                                        if (obj4 != null) {
                                                            c0623d1K2.K(((Boolean) obj4).booleanValue());
                                                        }
                                                        if (!rVar.f12116b.equals("_fx") && !((String) pairI.first).equals("00000000-0000-0000-0000-000000000000") && (vB02 = i0().B0(str25)) != null) {
                                                            C0817r0 c0817r05 = vB02.f11758a;
                                                            C0815q0 c0815q03 = c0817r05.f12151z;
                                                            C0817r0.k(c0815q03);
                                                            c0815q03.E();
                                                            if (vB02.f11782z) {
                                                                V(str25, false, null, null);
                                                                Bundle bundle3 = new Bundle();
                                                                C0815q0 c0815q04 = c0817r05.f12151z;
                                                                C0817r0.k(c0815q04);
                                                                c0815q04.E();
                                                                Long l8 = vB02.f11740A;
                                                                if (l8 != null) {
                                                                    e02 = e03;
                                                                    str11 = str9;
                                                                    rVar2 = rVar;
                                                                    bundle3.putLong("_pfo", Math.max(0L, l8.longValue()));
                                                                } else {
                                                                    str11 = str9;
                                                                    rVar2 = rVar;
                                                                    e02 = e03;
                                                                }
                                                                C0815q0 c0815q05 = c0817r05.f12151z;
                                                                C0817r0.k(c0815q05);
                                                                c0815q05.E();
                                                                Long l9 = vB02.f11741B;
                                                                if (l9 != null) {
                                                                    bundle3.putLong("_uwa", l9.longValue());
                                                                }
                                                                bundle3.putLong("_r", 1L);
                                                                n14.b(str25, "_fx", bundle3);
                                                            }
                                                        }
                                                    }
                                                }
                                                c0817r0.m().G();
                                                String str31 = Build.MODEL;
                                                c0623d1K2.y();
                                                c0817r0.m().G();
                                                String str32 = Build.VERSION.RELEASE;
                                                c0623d1K2.k();
                                                C0628e1.o1((C0628e1) c0623d1K2.f9801r, str32);
                                                c0623d1K2.S((int) c0817r0.m().I());
                                                c0623d1K2.A(c0817r0.m().J());
                                                c0623d1K2.R(x12.f11822O);
                                                if (c0817r0.f()) {
                                                    c0623d1K2.B();
                                                    if (!TextUtils.isEmpty(null)) {
                                                        c0623d1K2.k();
                                                        C0628e1.b0((C0628e1) c0623d1K2.f9801r, null);
                                                        throw null;
                                                    }
                                                }
                                                vB0 = i0().B0(str25);
                                                if (vB0 != null) {
                                                    vB0 = new V(c0817r0, str25);
                                                    vB0.l(h(f0F));
                                                    vB0.G(x12.f11810A);
                                                    vB0.H(str11);
                                                    if (f0F.k(e02)) {
                                                        vB0.P(this.f11689y.J(str25, x12.D));
                                                    }
                                                    vB0.M(0L);
                                                    vB0.N(0L);
                                                    vB0.L(0L);
                                                    vB0.n(str10);
                                                    vB0.o(j9);
                                                    vB0.m(str30);
                                                    vB0.I(j11);
                                                    vB0.C(j17);
                                                    vB0.O(z8);
                                                    vB0.E(j10);
                                                    i = 0;
                                                    i0().a0(vB0, false);
                                                } else {
                                                    i = 0;
                                                }
                                                if (f0F.k(E0.f11448s) && !TextUtils.isEmpty(vB0.d())) {
                                                    String strD2 = vB0.d();
                                                    P2.w.f(strD2);
                                                    c0623d1K2.q(strD2);
                                                }
                                                if (!TextUtils.isEmpty(vB0.f())) {
                                                    String strF = vB0.f();
                                                    P2.w.f(strF);
                                                    c0623d1K2.G(strF);
                                                }
                                                listM = i0().M(str25);
                                                i5 = i;
                                                while (i5 < listM.size()) {
                                                    C0668m1 c0668m1R = C0673n1.r();
                                                    String str33 = ((U1) listM.get(i5)).f11737c;
                                                    c0668m1R.k();
                                                    C0673n1.z((C0673n1) c0668m1R.f9801r, str33);
                                                    long j18 = ((U1) listM.get(i5)).f11738d;
                                                    c0668m1R.k();
                                                    C0673n1.A((C0673n1) c0668m1R.f9801r, j18);
                                                    f().r0(c0668m1R, ((U1) listM.get(i5)).f11739e);
                                                    c0623d1K2.X(c0668m1R);
                                                    if ("_sid".equals(((U1) listM.get(i5)).f11737c)) {
                                                        C0815q0 c0815q06 = vB0.f11758a.f12151z;
                                                        C0817r0.k(c0815q06);
                                                        c0815q06.E();
                                                        if (vB0.f11780x != 0) {
                                                            C0773c0 c0773c0F2 = f();
                                                            if (TextUtils.isEmpty(str29)) {
                                                                str12 = str29;
                                                                jE0 = 0;
                                                            } else {
                                                                str12 = str29;
                                                                jE0 = c0773c0F2.e0(str12.getBytes(Charset.forName("UTF-8")));
                                                            }
                                                            C0815q0 c0815q07 = vB0.f11758a.f12151z;
                                                            C0817r0.k(c0815q07);
                                                            c0815q07.E();
                                                            if (jE0 != vB0.f11780x) {
                                                                c0623d1K2.k();
                                                                C0628e1.C0((C0628e1) c0623d1K2.f9801r);
                                                            }
                                                        } else {
                                                            str12 = str29;
                                                        }
                                                    }
                                                    i5++;
                                                    str29 = str12;
                                                }
                                                c0805nI0 = i0();
                                                c0628e1 = (C0628e1) c0623d1K2.h();
                                                c0805nI0.E();
                                                c0805nI0.F();
                                                P2.w.c(c0628e1.r());
                                                byte[] bArrC = c0628e1.c();
                                                long jE02 = c0805nI0.f11473r.f().e0(bArrC);
                                                ContentValues contentValues2 = new ContentValues();
                                                contentValues2.put("app_id", c0628e1.r());
                                                contentValues2.put("metadata_fingerprint", Long.valueOf(jE02));
                                                contentValues2.put("metadata", bArrC);
                                                c0805nI0.A0().insertWithOnConflict("raw_events_metadata", null, contentValues2, 4);
                                                c0805nI02 = i0();
                                                it = rVar2.f12120f.f12186q.keySet().iterator();
                                                while (true) {
                                                    if (!it.hasNext()) {
                                                        if ("_r".equals(it.next())) {
                                                            break;
                                                        }
                                                    } else {
                                                        C0803m0 c0803m0M02 = m0();
                                                        String str34 = rVar2.f12115a;
                                                        boolean zW = c0803m0M02.W(str34, rVar2.f12116b);
                                                        C0793j c0793jE0 = i0().E0(v(), str34, false, false, false, false);
                                                        if (zW && c0793jE0.f12012e < h0().K(str34, I.f11577p)) {
                                                        }
                                                    }
                                                }
                                                i = 1;
                                                c0805nI02.E();
                                                c0805nI02.F();
                                                String str35 = rVar2.f12115a;
                                                P2.w.c(str35);
                                                byte[] bArrC2 = c0805nI02.f11473r.f().j0(rVar2).c();
                                                contentValues = new ContentValues();
                                                contentValues.put("app_id", str35);
                                                contentValues.put("name", rVar2.f12116b);
                                                contentValues.put("timestamp", Long.valueOf(rVar2.f12118d));
                                                contentValues.put("metadata_fingerprint", Long.valueOf(jE02));
                                                contentValues.put("data", bArrC2);
                                                contentValues.put("realtime", Integer.valueOf(i));
                                                if (c0805nI02.A0().insert(str8, null, contentValues) != -1) {
                                                    ((C0817r0) c0805nI02.f5146q).e().J().c(Z.M(str35), "Failed to insert raw event (got -1). appId");
                                                } else {
                                                    this.f11661E = 0L;
                                                }
                                                i0().Z();
                                                i0().T();
                                                F();
                                                e().K().c(Long.valueOf(((System.nanoTime() - jNanoTime) + 500000) / 1000000), "Background event processing time, ms");
                                                return;
                                            }
                                            str10 = str6;
                                            c0805nI0.A0().insertWithOnConflict("raw_events_metadata", null, contentValues2, 4);
                                            c0805nI02 = i0();
                                            it = rVar2.f12120f.f12186q.keySet().iterator();
                                            while (true) {
                                                if (!it.hasNext()) {
                                                }
                                            }
                                            i = 1;
                                            c0805nI02.E();
                                            c0805nI02.F();
                                            String str352 = rVar2.f12115a;
                                            P2.w.c(str352);
                                            byte[] bArrC22 = c0805nI02.f11473r.f().j0(rVar2).c();
                                            contentValues = new ContentValues();
                                            contentValues.put("app_id", str352);
                                            contentValues.put("name", rVar2.f12116b);
                                            contentValues.put("timestamp", Long.valueOf(rVar2.f12118d));
                                            contentValues.put("metadata_fingerprint", Long.valueOf(jE02));
                                            contentValues.put("data", bArrC22);
                                            contentValues.put("realtime", Integer.valueOf(i));
                                            if (c0805nI02.A0().insert(str8, null, contentValues) != -1) {
                                            }
                                            i0().Z();
                                            i0().T();
                                            F();
                                            e().K().c(Long.valueOf(((System.nanoTime() - jNanoTime) + 500000) / 1000000), "Background event processing time, ms");
                                            return;
                                        } catch (SQLiteException e12) {
                                            ((C0817r0) c0805nI0.f5146q).e().J().d("Error storing raw event metadata. appId", Z.M(c0628e1.r()), e12);
                                            throw e12;
                                        }
                                        arrayList = null;
                                        if (arrayList != null) {
                                        }
                                        if (h0().R(null, I.f11567l1)) {
                                        }
                                        f0F = n0(str25).f(F0.e(100, str13));
                                        if (f0F.k(e03)) {
                                            str11 = str9;
                                            rVar2 = rVar;
                                            e02 = e03;
                                        }
                                        c0817r0.m().G();
                                        String str312 = Build.MODEL;
                                        c0623d1K2.y();
                                        c0817r0.m().G();
                                        String str322 = Build.VERSION.RELEASE;
                                        c0623d1K2.k();
                                        C0628e1.o1((C0628e1) c0623d1K2.f9801r, str322);
                                        c0623d1K2.S((int) c0817r0.m().I());
                                        c0623d1K2.A(c0817r0.m().J());
                                        c0623d1K2.R(x12.f11822O);
                                        if (c0817r0.f()) {
                                        }
                                        vB0 = i0().B0(str25);
                                        if (vB0 != null) {
                                        }
                                        if (f0F.k(E0.f11448s)) {
                                            String strD22 = vB0.d();
                                            P2.w.f(strD22);
                                            c0623d1K2.q(strD22);
                                        }
                                        if (!TextUtils.isEmpty(vB0.f())) {
                                        }
                                        listM = i0().M(str25);
                                        i5 = i;
                                        while (i5 < listM.size()) {
                                        }
                                        c0805nI0 = i0();
                                        c0628e1 = (C0628e1) c0623d1K2.h();
                                        c0805nI0.E();
                                        c0805nI0.F();
                                        P2.w.c(c0628e1.r());
                                        byte[] bArrC3 = c0628e1.c();
                                        long jE022 = c0805nI0.f11473r.f().e0(bArrC3);
                                        ContentValues contentValues22 = new ContentValues();
                                        contentValues22.put("app_id", c0628e1.r());
                                        contentValues22.put("metadata_fingerprint", Long.valueOf(jE022));
                                        contentValues22.put("metadata", bArrC3);
                                    }
                                }
                            }
                        }
                    } else {
                        str4 = str18;
                    }
                    n12 = n15;
                    boolean zZ02 = W1.z0(str22);
                    boolean zEquals22 = "_err".equals(str22);
                    g();
                    if (c0825u == null) {
                    }
                    String str242 = str17;
                    C0793j c0793jF02 = i0().F0(v(), str242, length + 1, true, zZ02, false, zEquals22, false, false, false);
                    long j132 = c0793jF02.f12009b;
                    h0();
                    N1 n162 = n12;
                    jIntValue = j132 - ((long) ((Integer) I.f11565l.a(null)).intValue());
                    if (jIntValue > 0) {
                    }
                }
            } else if (z9) {
                z9 = true;
                strA = c0825u.A();
                str = str15;
                Bundle bundle22 = c0825u.f12186q;
                if (z9) {
                }
                if (TextUtils.isEmpty(strA)) {
                }
            } else {
                str = str15;
                str2 = str16;
                str4 = str18;
                n12 = n15;
                boolean zZ022 = W1.z0(str22);
                boolean zEquals222 = "_err".equals(str22);
                g();
                if (c0825u == null) {
                }
                String str2422 = str17;
                C0793j c0793jF022 = i0().F0(v(), str2422, length + 1, true, zZ022, false, zEquals222, false, false, false);
                long j1322 = c0793jF022.f12009b;
                h0();
                N1 n1622 = n12;
                jIntValue = j1322 - ((long) ((Integer) I.f11565l.a(null)).intValue());
                if (jIntValue > 0) {
                }
            }
            i0().T();
        } catch (Throwable th) {
            i0().T();
            throw th;
        }
    }

    @Override // d3.B0
    public final C0815q0 c() {
        C0817r0 c0817r0 = this.f11659B;
        P2.w.f(c0817r0);
        C0815q0 c0815q0 = c0817r0.f12151z;
        C0817r0.k(c0815q0);
        return c0815q0;
    }

    public final boolean c0(String str, String str2) {
        C0805n c0805n = this.f11683s;
        L(c0805n);
        V vB0 = c0805n.B0(str);
        HashMap map = this.f11676U;
        if (vB0 != null && g().u0(str, vB0.i())) {
            map.remove(str2);
            return true;
        }
        P1 p1 = (P1) map.get(str2);
        if (p1 != null) {
            p1.f11649a.d().getClass();
            if (System.currentTimeMillis() < p1.f11651c) {
                return false;
            }
        }
        return true;
    }

    @Override // d3.B0
    public final T2.a d() {
        C0817r0 c0817r0 = this.f11659B;
        P2.w.f(c0817r0);
        return c0817r0.D;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r12v2 */
    /* JADX WARN: Type inference failed for: r12v6 */
    /* JADX WARN: Type inference failed for: r12v7 */
    public final Bundle d0(String str) {
        I1.a.u(this);
        C0803m0 c0803m0 = this.f11681q;
        L(c0803m0);
        if (c0803m0.S(str) == null) {
            return null;
        }
        Bundle bundle = new Bundle();
        F0 f0N0 = n0(str);
        Bundle bundle2 = new Bundle();
        Iterator it = f0N0.f11458a.entrySet().iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            Map.Entry entry = (Map.Entry) it.next();
            int iOrdinal = ((C0) entry.getValue()).ordinal();
            String str2 = iOrdinal != 2 ? iOrdinal != 3 ? null : "granted" : "denied";
            if (str2 != null) {
                bundle2.putString(((E0) entry.getKey()).f11452q, str2);
            }
        }
        bundle.putAll(bundle2);
        C0811p c0811pJ0 = j0(str, k0(str), f0N0, new P.g(26));
        Bundle bundle3 = new Bundle();
        for (Map.Entry entry2 : c0811pJ0.f12094e.entrySet()) {
            int iOrdinal2 = ((C0) entry2.getValue()).ordinal();
            String str3 = iOrdinal2 != 2 ? iOrdinal2 != 3 ? null : "granted" : "denied";
            if (str3 != null) {
                bundle3.putString(((E0) entry2.getKey()).f11452q, str3);
            }
        }
        Boolean bool = c0811pJ0.f12092c;
        if (bool != null) {
            bundle3.putString("is_dma_region", bool.toString());
        }
        String str4 = c0811pJ0.f12093d;
        if (str4 != null) {
            bundle3.putString("cps_display_str", str4);
        }
        bundle.putAll(bundle3);
        C0805n c0805n = this.f11683s;
        L(c0805n);
        U1 u1K0 = c0805n.K0(str, "_npa");
        bundle.putString("ad_personalization", 1 != (u1K0 != null ? u1K0.f11739e.equals(1L) : y(str, new P.g(26))) ? "granted" : "denied");
        return bundle;
    }

    @Override // d3.B0
    public final Z e() {
        C0817r0 c0817r0 = this.f11659B;
        P2.w.f(c0817r0);
        Z z8 = c0817r0.f12150y;
        C0817r0.k(z8);
        return z8;
    }

    public final Bundle e0(C0828v c0828v, String str) {
        Bundle bundle = new Bundle();
        bundle.putLong("_sid", c0828v.f12194r.f12186q.getLong("_sid"));
        C0805n c0805n = this.f11683s;
        L(c0805n);
        U1 u1K0 = c0805n.K0(str, "_sno");
        if (u1K0 != null) {
            Object obj = u1K0.f11739e;
            if (obj instanceof Long) {
                bundle.putLong("_sno", ((Long) obj).longValue());
            }
        }
        return bundle;
    }

    public final C0773c0 f() {
        C0773c0 c0773c0 = this.f11687w;
        L(c0773c0);
        return c0773c0;
    }

    /* JADX WARN: Removed duplicated region for block: B:103:0x02ab  */
    /* JADX WARN: Removed duplicated region for block: B:106:0x02af  */
    /* JADX WARN: Removed duplicated region for block: B:46:0x012d  */
    /* JADX WARN: Removed duplicated region for block: B:53:0x0158  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x0163  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x016e  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x017a  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x018f  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x01a2  */
    /* JADX WARN: Removed duplicated region for block: B:69:0x01a4  */
    /* JADX WARN: Removed duplicated region for block: B:72:0x01f4  */
    /* JADX WARN: Removed duplicated region for block: B:73:0x01fa  */
    /* JADX WARN: Removed duplicated region for block: B:78:0x021f  */
    /* JADX WARN: Removed duplicated region for block: B:79:0x0221  */
    /* JADX WARN: Removed duplicated region for block: B:82:0x0237  */
    /* JADX WARN: Removed duplicated region for block: B:83:0x0239  */
    /* JADX WARN: Removed duplicated region for block: B:86:0x024e  */
    /* JADX WARN: Removed duplicated region for block: B:93:0x027b  */
    /* JADX WARN: Removed duplicated region for block: B:94:0x027d  */
    /* JADX WARN: Removed duplicated region for block: B:97:0x028f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final V f0(X1 x12) {
        boolean z8;
        String str;
        long j8;
        String str2;
        String str3;
        String str4;
        c().E();
        k();
        P2.w.f(x12);
        String str5 = x12.f11831q;
        P2.w.c(str5);
        String str6 = x12.f11819L;
        if (!str6.isEmpty()) {
            this.f11675T.put(str5, new O1(this, str6));
        }
        C0805n c0805n = this.f11683s;
        L(c0805n);
        V vB0 = c0805n.B0(str5);
        F0 f0F = n0(str5).f(F0.e(100, x12.f11818K));
        E0 e02 = E0.f11447r;
        boolean zK = f0F.k(e02);
        boolean z9 = x12.D;
        String strJ = zK ? this.f11689y.J(str5, z9) : "";
        E0 e03 = E0.f11448s;
        boolean z10 = true;
        if (vB0 != null) {
            if (f0F.k(e02) && strJ != null) {
                C0817r0 c0817r0 = vB0.f11758a;
                C0815q0 c0815q0 = c0817r0.f12151z;
                C0817r0.k(c0815q0);
                c0815q0.E();
                if (!strJ.equals(vB0.f11762e)) {
                    C0815q0 c0815q02 = c0817r0.f12151z;
                    C0817r0.k(c0815q02);
                    c0815q02.E();
                    boolean zIsEmpty = TextUtils.isEmpty(vB0.f11762e);
                    vB0.P(strJ);
                    if (z9) {
                        C0830v1 c0830v1 = this.f11689y;
                        c0830v1.getClass();
                        if (!"00000000-0000-0000-0000-000000000000".equals((f0F.k(e02) ? c0830v1.I(str5) : new Pair("", Boolean.FALSE)).first) && !zIsEmpty) {
                            if (f0F.k(e03)) {
                                vB0.l(h(f0F));
                                z8 = false;
                            } else {
                                z8 = true;
                            }
                            C0805n c0805n2 = this.f11683s;
                            L(c0805n2);
                            if (c0805n2.K0(str5, "_id") != null) {
                                C0805n c0805n3 = this.f11683s;
                                L(c0805n3);
                                if (c0805n3.K0(str5, "_lair") == null) {
                                    d().getClass();
                                    U1 u12 = new U1(str5, "auto", "_lair", System.currentTimeMillis(), 1L);
                                    C0805n c0805n4 = this.f11683s;
                                    L(c0805n4);
                                    c0805n4.s0(u12);
                                }
                            }
                        }
                    }
                    if (TextUtils.isEmpty(vB0.d()) && f0F.k(e03)) {
                        vB0.l(h(f0F));
                    }
                }
            } else if (TextUtils.isEmpty(vB0.d()) && f0F.k(e03)) {
                vB0.l(h(f0F));
            }
            vB0.H(x12.f11832r);
            vB0.k(x12.f11814F);
            str = x12.f11810A;
            if (!TextUtils.isEmpty(str)) {
                vB0.G(str);
            }
            j8 = x12.f11835u;
            if (j8 != 0) {
                vB0.I(j8);
            }
            str2 = x12.f11833s;
            if (!TextUtils.isEmpty(str2)) {
                vB0.n(str2);
            }
            vB0.o(x12.f11840z);
            str3 = x12.f11834t;
            if (str3 != null) {
                vB0.m(str3);
            }
            vB0.C(x12.f11836v);
            vB0.O(x12.f11838x);
            str4 = x12.f11837w;
            if (!TextUtils.isEmpty(str4)) {
                vB0.J(str4);
            }
            C0817r0 c0817r02 = vB0.f11758a;
            C0815q0 c0815q03 = c0817r02.f12151z;
            C0817r0.k(c0815q03);
            c0815q03.E();
            vB0.f11755R |= vB0.f11772p == z9;
            vB0.f11772p = z9;
            C0815q0 c0815q04 = c0817r02.f12151z;
            C0817r0.k(c0815q04);
            c0815q04.E();
            boolean z11 = vB0.f11755R;
            Boolean bool = vB0.f11774r;
            Boolean bool2 = x12.f11815G;
            vB0.f11755R = z11 | (!Objects.equals(bool, bool2));
            vB0.f11774r = bool2;
            vB0.E(x12.H);
            C0815q0 c0815q05 = c0817r02.f12151z;
            C0817r0.k(c0815q05);
            c0815q05.E();
            boolean z12 = vB0.f11755R;
            String str7 = vB0.f11777u;
            String str8 = x12.f11820M;
            vB0.f11755R = z12 | (!Objects.equals(str7, str8));
            vB0.f11777u = str8;
            C0635f3 c0635f3 = C0635f3.f9857r;
            if (h0().R(null, I.f11507L0)) {
                if (h0().R(null, I.K0)) {
                    vB0.Q(null);
                }
            } else {
                vB0.Q(x12.f11816I);
            }
            C0815q0 c0815q06 = c0817r02.f12151z;
            C0817r0.k(c0815q06);
            c0815q06.E();
            boolean z13 = vB0.f11755R;
            boolean z14 = vB0.f11778v;
            boolean z15 = x12.f11821N;
            vB0.f11755R = z13 | (z14 == z15);
            vB0.f11778v = z15;
            C0815q0 c0815q07 = c0817r02.f12151z;
            C0817r0.k(c0815q07);
            c0815q07.E();
            boolean z16 = vB0.f11755R;
            String str9 = vB0.D;
            String str10 = x12.f11827T;
            vB0.f11755R = z16 | (str9 == str10);
            vB0.D = str10;
            J3.b();
            if (h0().R(null, I.W0)) {
                C0815q0 c0815q08 = c0817r02.f12151z;
                C0817r0.k(c0815q08);
                c0815q08.E();
                boolean z17 = vB0.f11755R;
                int i = vB0.f11781y;
                int i5 = x12.f11825R;
                vB0.f11755R = z17 | (i != i5);
                vB0.f11781y = i5;
            }
            vB0.r(x12.f11822O);
            C0815q0 c0815q09 = c0817r02.f12151z;
            C0817r0.k(c0815q09);
            c0815q09.E();
            boolean z18 = vB0.f11755R;
            String str11 = vB0.H;
            String str12 = x12.f11828U;
            vB0.f11755R = z18 | (str11 == str12);
            vB0.H = str12;
            if (h0().R(null, I.f11517Q0)) {
                C0815q0 c0815q010 = c0817r02.f12151z;
                C0817r0.k(c0815q010);
                c0815q010.E();
                boolean z19 = vB0.f11755R;
                int i8 = vB0.f11747J;
                int i9 = x12.f11830W;
                vB0.f11755R = z19 | (i8 != i9);
                vB0.f11747J = i9;
            }
            if (!vB0.s()) {
                z10 = z8;
            } else if (!z8) {
                return vB0;
            }
            C0805n c0805n5 = this.f11683s;
            L(c0805n5);
            c0805n5.a0(vB0, z10);
            return vB0;
        }
        vB0 = new V(this.f11659B, str5);
        if (f0F.k(e03)) {
            vB0.l(h(f0F));
        }
        if (f0F.k(e02)) {
            vB0.P(strJ);
        }
        z8 = false;
        vB0.H(x12.f11832r);
        vB0.k(x12.f11814F);
        str = x12.f11810A;
        if (!TextUtils.isEmpty(str)) {
        }
        j8 = x12.f11835u;
        if (j8 != 0) {
        }
        str2 = x12.f11833s;
        if (!TextUtils.isEmpty(str2)) {
        }
        vB0.o(x12.f11840z);
        str3 = x12.f11834t;
        if (str3 != null) {
        }
        vB0.C(x12.f11836v);
        vB0.O(x12.f11838x);
        str4 = x12.f11837w;
        if (!TextUtils.isEmpty(str4)) {
        }
        C0817r0 c0817r022 = vB0.f11758a;
        C0815q0 c0815q032 = c0817r022.f12151z;
        C0817r0.k(c0815q032);
        c0815q032.E();
        vB0.f11755R |= vB0.f11772p == z9;
        vB0.f11772p = z9;
        C0815q0 c0815q042 = c0817r022.f12151z;
        C0817r0.k(c0815q042);
        c0815q042.E();
        boolean z112 = vB0.f11755R;
        Boolean bool3 = vB0.f11774r;
        Boolean bool22 = x12.f11815G;
        vB0.f11755R = z112 | (!Objects.equals(bool3, bool22));
        vB0.f11774r = bool22;
        vB0.E(x12.H);
        C0815q0 c0815q052 = c0817r022.f12151z;
        C0817r0.k(c0815q052);
        c0815q052.E();
        boolean z122 = vB0.f11755R;
        String str72 = vB0.f11777u;
        String str82 = x12.f11820M;
        vB0.f11755R = z122 | (!Objects.equals(str72, str82));
        vB0.f11777u = str82;
        C0635f3 c0635f32 = C0635f3.f9857r;
        if (h0().R(null, I.f11507L0)) {
        }
        C0815q0 c0815q062 = c0817r022.f12151z;
        C0817r0.k(c0815q062);
        c0815q062.E();
        boolean z132 = vB0.f11755R;
        boolean z142 = vB0.f11778v;
        boolean z152 = x12.f11821N;
        vB0.f11755R = z132 | (z142 == z152);
        vB0.f11778v = z152;
        C0815q0 c0815q072 = c0817r022.f12151z;
        C0817r0.k(c0815q072);
        c0815q072.E();
        boolean z162 = vB0.f11755R;
        String str92 = vB0.D;
        String str102 = x12.f11827T;
        vB0.f11755R = z162 | (str92 == str102);
        vB0.D = str102;
        J3.b();
        if (h0().R(null, I.W0)) {
        }
        vB0.r(x12.f11822O);
        C0815q0 c0815q092 = c0817r022.f12151z;
        C0817r0.k(c0815q092);
        c0815q092.E();
        boolean z182 = vB0.f11755R;
        String str112 = vB0.H;
        String str122 = x12.f11828U;
        vB0.f11755R = z182 | (str112 == str122);
        vB0.H = str122;
        if (h0().R(null, I.f11517Q0)) {
        }
        if (!vB0.s()) {
        }
        C0805n c0805n52 = this.f11683s;
        L(c0805n52);
        c0805n52.a0(vB0, z10);
        return vB0;
    }

    public final W1 g() {
        C0817r0 c0817r0 = this.f11659B;
        P2.w.f(c0817r0);
        W1 w12 = c0817r0.f12122B;
        C0817r0.i(w12);
        return w12;
    }

    public final C0772c g0() {
        C0772c c0772c = this.f11686v;
        L(c0772c);
        return c0772c;
    }

    public final String h(F0 f02) {
        if (!f02.k(E0.f11448s)) {
            return null;
        }
        byte[] bArr = new byte[16];
        g().Q().nextBytes(bArr);
        return String.format(Locale.US, "%032x", new BigInteger(1, bArr));
    }

    public final C0784g h0() {
        C0817r0 c0817r0 = this.f11659B;
        P2.w.f(c0817r0);
        return c0817r0.f12148w;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v3, types: [java.util.ArrayList] */
    /* JADX WARN: Type inference failed for: r0v5, types: [java.util.List] */
    /* JADX WARN: Type inference failed for: r0v7, types: [java.util.List] */
    public final List i(Bundle bundle, X1 x12) {
        c().E();
        J3.b();
        C0784g c0784gH0 = h0();
        String str = x12.f11831q;
        if (!c0784gH0.R(str, I.W0) || str == null) {
            return new ArrayList();
        }
        if (bundle != null) {
            int[] intArray = bundle.getIntArray("uriSources");
            long[] longArray = bundle.getLongArray("uriTimestamps");
            if (intArray != null) {
                if (longArray == null || longArray.length != intArray.length) {
                    e().f11875v.b("Uri sources and timestamps do not match");
                } else {
                    for (int i = 0; i < intArray.length; i++) {
                        C0805n c0805n = this.f11683s;
                        L(c0805n);
                        C0817r0 c0817r0 = (C0817r0) c0805n.f5146q;
                        int i5 = intArray[i];
                        long j8 = longArray[i];
                        P2.w.c(str);
                        c0805n.E();
                        c0805n.F();
                        try {
                            int iDelete = c0805n.A0().delete("trigger_uris", "app_id=? and source=? and timestamp_millis<=?", new String[]{str, String.valueOf(i5), String.valueOf(j8)});
                            Z z8 = c0817r0.f12150y;
                            C0817r0.k(z8);
                            z8.D.e("Pruned " + iDelete + " trigger URIs. appId, source, timestamp", str, Integer.valueOf(i5), Long.valueOf(j8));
                        } catch (SQLiteException e8) {
                            Z z9 = c0817r0.f12150y;
                            C0817r0.k(z9);
                            z9.f11875v.d("Error pruning trigger URIs. appId", Z.M(str), e8);
                        }
                    }
                }
            }
        }
        C0805n c0805n2 = this.f11683s;
        L(c0805n2);
        String str2 = x12.f11831q;
        P2.w.c(str2);
        c0805n2.E();
        c0805n2.F();
        ?? arrayList = new ArrayList();
        Cursor cursorQuery = null;
        try {
            try {
                cursorQuery = c0805n2.A0().query("trigger_uris", new String[]{"trigger_uri", "timestamp_millis", "source"}, "app_id=?", new String[]{str2}, null, null, "rowid", null);
                if (cursorQuery.moveToFirst()) {
                    do {
                        String string = cursorQuery.getString(0);
                        if (string == null) {
                            string = "";
                        }
                        arrayList.add(new E1(cursorQuery.getLong(1), string, cursorQuery.getInt(2)));
                    } while (cursorQuery.moveToNext());
                }
            } catch (SQLiteException e9) {
                Z z10 = ((C0817r0) c0805n2.f5146q).f12150y;
                C0817r0.k(z10);
                z10.f11875v.d("Error querying trigger uris. appId", Z.M(str2), e9);
                arrayList = Collections.EMPTY_LIST;
            }
            if (cursorQuery != null) {
                cursorQuery.close();
            }
            return arrayList;
        } finally {
        }
    }

    public final C0805n i0() {
        C0805n c0805n = this.f11683s;
        L(c0805n);
        return c0805n;
    }

    public final void j() {
        I1.a.u(this);
        if (this.D) {
            return;
        }
        this.D = true;
        c().E();
        FileLock fileLock = this.f11668M;
        C0817r0 c0817r0 = this.f11659B;
        if (fileLock == null || !fileLock.isValid()) {
            ((C0817r0) this.f11683s.f5146q).getClass();
            try {
                FileChannel channel = new RandomAccessFile(new File(new File(c0817r0.f12142q.getFilesDir(), "google_app_measurement.db").getPath()), "rw").getChannel();
                this.f11669N = channel;
                FileLock fileLockTryLock = channel.tryLock();
                this.f11668M = fileLockTryLock;
                if (fileLockTryLock == null) {
                    e().f11875v.b("Storage concurrent data access panic");
                    return;
                }
                e().D.b("Storage concurrent access okay");
            } catch (FileNotFoundException e8) {
                e().f11875v.c(e8, "Failed to acquire storage lock");
                return;
            } catch (IOException e9) {
                e().f11875v.c(e9, "Failed to access storage lock file");
                return;
            } catch (OverlappingFileLockException e10) {
                e().f11878y.c(e10, "Storage lock already acquired");
                return;
            }
        } else {
            e().D.b("Storage concurrent access okay");
        }
        FileChannel fileChannel = this.f11669N;
        c().E();
        int i = 0;
        if (fileChannel == null || !fileChannel.isOpen()) {
            e().f11875v.b("Bad channel to read from");
        } else {
            ByteBuffer byteBufferAllocate = ByteBuffer.allocate(4);
            try {
                fileChannel.position(0L);
                int i5 = fileChannel.read(byteBufferAllocate);
                if (i5 == 4) {
                    byteBufferAllocate.flip();
                    i = byteBufferAllocate.getInt();
                } else if (i5 != -1) {
                    e().f11878y.c(Integer.valueOf(i5), "Unexpected data length. Bytes read");
                }
            } catch (IOException e11) {
                e().f11875v.c(e11, "Failed to read from channel");
            }
        }
        P pN = c0817r0.n();
        pN.F();
        int i8 = pN.f11641u;
        c().E();
        if (i > i8) {
            Z zE = e();
            zE.f11875v.d("Panic: can't downgrade version. Previous, current version", Integer.valueOf(i), Integer.valueOf(i8));
            return;
        }
        if (i < i8) {
            FileChannel fileChannel2 = this.f11669N;
            c().E();
            if (fileChannel2 == null || !fileChannel2.isOpen()) {
                e().f11875v.b("Bad channel to read from");
            } else {
                ByteBuffer byteBufferAllocate2 = ByteBuffer.allocate(4);
                byteBufferAllocate2.putInt(i8);
                byteBufferAllocate2.flip();
                try {
                    fileChannel2.truncate(0L);
                    fileChannel2.write(byteBufferAllocate2);
                    fileChannel2.force(true);
                    if (fileChannel2.size() != 4) {
                        e().f11875v.c(Long.valueOf(fileChannel2.size()), "Error writing to channel. Bytes written");
                    }
                    Z zE2 = e();
                    zE2.D.d("Storage version upgraded. Previous, current version", Integer.valueOf(i), Integer.valueOf(i8));
                    return;
                } catch (IOException e12) {
                    e().f11875v.c(e12, "Failed to write to channel");
                }
            }
            Z zE3 = e();
            zE3.f11875v.d("Storage version upgrade failed. Previous, current version", Integer.valueOf(i), Integer.valueOf(i8));
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:32:0x0092  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x0097  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00a5  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:43:0x00b2  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final C0811p j0(String str, C0811p c0811p, F0 f02, P.g gVar) {
        E0 e0P;
        E0 e02;
        C0 c02;
        C0 c0R;
        C0803m0 c0803m0 = this.f11681q;
        L(c0803m0);
        com.google.android.gms.internal.measurement.B0 b0S = c0803m0.S(str);
        C0 c03 = C0.f11433t;
        E0 e03 = E0.f11449t;
        int i = 90;
        if (b0S == null) {
            if (c0811p.c() == c03) {
                i = c0811p.f12090a;
                gVar.y(e03, i);
            } else {
                gVar.z(e03, EnumC0787h.FAILSAFE);
            }
            return new C0811p(Boolean.FALSE, i, Boolean.TRUE, "-");
        }
        C0 c0C = c0811p.c();
        C0 c04 = C0.f11434u;
        if (c0C == c04 || c0C == c03) {
            i = c0811p.f12090a;
            gVar.y(e03, i);
        } else {
            C0 c05 = C0.f11432s;
            C0 c06 = C0.f11431r;
            if (c0C != c05 || (c0R = c0803m0.R(str, e03)) == c06) {
                c0803m0.E();
                c0803m0.M(str);
                com.google.android.gms.internal.measurement.B0 b0S2 = c0803m0.S(str);
                if (b0S2 == null) {
                    e0P = null;
                    e02 = E0.f11447r;
                    c02 = (C0) f02.f11458a.get(e02);
                    if (c02 != null) {
                        c06 = c02;
                    }
                    boolean z8 = c06 != c04 || c06 == c03;
                    if (e0P == e02 || !z8) {
                        gVar.z(e03, EnumC0787h.REMOTE_DEFAULT);
                        c0C = true == c0803m0.V(str, e03) ? c03 : c04;
                    } else {
                        gVar.z(e03, EnumC0787h.REMOTE_DELEGATION);
                        c0C = c06;
                    }
                } else {
                    for (C0731z0 c0731z0 : b0S2.q()) {
                        if (e03 == C0803m0.P(c0731z0.o())) {
                            e0P = C0803m0.P(c0731z0.n());
                            break;
                        }
                    }
                    e0P = null;
                    e02 = E0.f11447r;
                    c02 = (C0) f02.f11458a.get(e02);
                    if (c02 != null) {
                    }
                    if (c06 != c04) {
                        if (e0P == e02) {
                            gVar.z(e03, EnumC0787h.REMOTE_DEFAULT);
                            if (true == c0803m0.V(str, e03)) {
                            }
                        }
                    }
                }
            } else {
                gVar.z(e03, EnumC0787h.REMOTE_ENFORCED_DEFAULT);
                c0C = c0R;
            }
        }
        c0803m0.E();
        c0803m0.M(str);
        com.google.android.gms.internal.measurement.B0 b0S3 = c0803m0.S(str);
        boolean z9 = b0S3 == null || !b0S3.t() || b0S3.s();
        L(c0803m0);
        c0803m0.E();
        c0803m0.M(str);
        TreeSet treeSet = new TreeSet();
        com.google.android.gms.internal.measurement.B0 b0S4 = c0803m0.S(str);
        if (b0S4 != null) {
            Iterator it = b0S4.o().iterator();
            while (it.hasNext()) {
                treeSet.add(((com.google.android.gms.internal.measurement.A0) it.next()).n());
            }
        }
        if (c0C == c03 || treeSet.isEmpty()) {
            return new C0811p(Boolean.FALSE, i, Boolean.valueOf(z9), "-");
        }
        return new C0811p(Boolean.TRUE, i, Boolean.valueOf(z9), z9 ? TextUtils.join("", treeSet) : "");
    }

    public final void k() {
        if (!this.f11660C.get()) {
            throw new IllegalStateException("UploadController is not initialized");
        }
    }

    public final C0811p k0(String str) {
        I1.a.u(this);
        HashMap map = this.f11674S;
        C0811p c0811p = (C0811p) map.get(str);
        if (c0811p != null) {
            return c0811p;
        }
        C0805n c0805n = this.f11683s;
        L(c0805n);
        P2.w.f(str);
        c0805n.E();
        c0805n.F();
        C0811p c0811pB = C0811p.b(c0805n.j0("select dma_consent_settings from consent_settings where app_id=? limit 1;", new String[]{str}));
        map.put(str, c0811pB);
        return c0811pB;
    }

    /* JADX WARN: Removed duplicated region for block: B:40:0x011f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void l(C0623d1 c0623d1, String str) {
        int iY;
        int iIndexOf;
        C0803m0 c0803m0 = this.f11681q;
        L(c0803m0);
        c0803m0.E();
        c0803m0.M(str);
        q.e eVar = c0803m0.f12053u;
        Set set = (Set) eVar.get(str);
        if (set != null) {
            c0623d1.k();
            C0628e1.p0((C0628e1) c0623d1.f9801r, set);
        }
        L(c0803m0);
        c0803m0.E();
        c0803m0.M(str);
        if (eVar.get(str) != null && (((Set) eVar.get(str)).contains("device_model") || ((Set) eVar.get(str)).contains("device_info"))) {
            c0623d1.k();
            C0628e1.u0((C0628e1) c0623d1.f9801r);
        }
        L(c0803m0);
        if (c0803m0.J(str)) {
            String strD = ((C0628e1) c0623d1.f9801r).D();
            if (!TextUtils.isEmpty(strD) && (iIndexOf = strD.indexOf(".")) != -1) {
                String strSubstring = strD.substring(0, iIndexOf);
                c0623d1.k();
                C0628e1.o1((C0628e1) c0623d1.f9801r, strSubstring);
            }
        }
        L(c0803m0);
        c0803m0.E();
        c0803m0.M(str);
        if (eVar.get(str) != null && ((Set) eVar.get(str)).contains("user_id") && (iY = C0773c0.Y(c0623d1, "_id")) != -1) {
            c0623d1.k();
            C0628e1.G0((C0628e1) c0623d1.f9801r, iY);
        }
        L(c0803m0);
        c0803m0.E();
        c0803m0.M(str);
        if (eVar.get(str) != null && ((Set) eVar.get(str)).contains("google_signals")) {
            c0623d1.k();
            C0628e1.v0((C0628e1) c0623d1.f9801r);
        }
        L(c0803m0);
        if (c0803m0.I(str)) {
            c0623d1.k();
            C0628e1.s0((C0628e1) c0623d1.f9801r);
            if (n0(str).k(E0.f11448s)) {
                HashMap map = this.f11675T;
                O1 o12 = (O1) map.get(str);
                if (o12 != null) {
                    long jM = h0().M(str, I.f11563k0) + o12.f11632b;
                    d().getClass();
                    if (jM < SystemClock.elapsedRealtime()) {
                        o12 = new O1(this, g().N());
                        map.put(str, o12);
                    }
                    c0623d1.k();
                    C0628e1.f0((C0628e1) c0623d1.f9801r, o12.f11631a);
                }
            }
        }
        L(c0803m0);
        c0803m0.E();
        c0803m0.M(str);
        if (eVar.get(str) == null || !((Set) eVar.get(str)).contains("enhanced_user_id")) {
            return;
        }
        c0623d1.k();
        C0628e1.C0((C0628e1) c0623d1.f9801r);
    }

    public final C0776d0 l0() {
        C0776d0 c0776d0 = this.f11684t;
        if (c0776d0 != null) {
            return c0776d0;
        }
        throw new IllegalStateException("Network broadcast receiver not created");
    }

    public final void m(V v7) {
        q.e eVar;
        q.e eVar2;
        c().E();
        if (TextUtils.isEmpty(v7.g()) && TextUtils.isEmpty(v7.a())) {
            String strC = v7.c();
            P2.w.f(strC);
            t(strC, 204, null, null, null);
            return;
        }
        String strC2 = v7.c();
        P2.w.f(strC2);
        e().D.c(strC2, "Fetching remote configuration");
        C0803m0 c0803m0 = this.f11681q;
        L(c0803m0);
        com.google.android.gms.internal.measurement.G0 g0T = c0803m0.T(strC2);
        L(c0803m0);
        c0803m0.E();
        String str = (String) c0803m0.f12051C.get(strC2);
        if (g0T != null) {
            if (TextUtils.isEmpty(str)) {
                eVar2 = null;
            } else {
                eVar2 = new q.e(0);
                eVar2.put("If-Modified-Since", str);
            }
            L(c0803m0);
            c0803m0.E();
            String str2 = (String) c0803m0.D.get(strC2);
            if (!TextUtils.isEmpty(str2)) {
                if (eVar2 == null) {
                    eVar2 = new q.e(0);
                }
                eVar2.put("If-None-Match", str2);
            }
            eVar = eVar2;
        } else {
            eVar = null;
        }
        this.f11665J = true;
        C0773c0 c0773c0 = this.f11682r;
        L(c0773c0);
        N1 n12 = new N1(this);
        C0817r0 c0817r0 = (C0817r0) c0773c0.f5146q;
        c0773c0.E();
        c0773c0.F();
        M1 m12 = c0773c0.f11473r.f11690z;
        Uri.Builder builder = new Uri.Builder();
        String strG = v7.g();
        if (TextUtils.isEmpty(strG)) {
            strG = v7.a();
        }
        Uri.Builder builderAppendQueryParameter = builder.scheme((String) I.f11548f.a(null)).encodedAuthority((String) I.f11551g.a(null)).path("config/app/".concat(String.valueOf(strG))).appendQueryParameter("platform", "android");
        ((C0817r0) m12.f5146q).f12148w.L();
        builderAppendQueryParameter.appendQueryParameter("gmp_version", String.valueOf(119002L)).appendQueryParameter("runtime_version", "0");
        String string = builder.build().toString();
        try {
            URL url = new URI(string).toURL();
            C0815q0 c0815q0 = c0817r0.f12151z;
            C0817r0.k(c0815q0);
            c0815q0.N(new RunnableC0770b0(c0773c0, v7.c(), url, (byte[]) null, eVar, n12));
        } catch (IllegalArgumentException | MalformedURLException | URISyntaxException unused) {
            Z z8 = c0817r0.f12150y;
            C0817r0.k(z8);
            z8.f11875v.d("Failed to parse config URL. Not fetching. appId", Z.M(v7.c()), string);
        }
    }

    public final C0803m0 m0() {
        C0803m0 c0803m0 = this.f11681q;
        L(c0803m0);
        return c0803m0;
    }

    public final void n(X1 x12, long j8) throws Throwable {
        C0805n c0805n = this.f11683s;
        L(c0805n);
        String str = x12.f11831q;
        P2.w.f(str);
        V vB0 = c0805n.B0(str);
        if (vB0 != null) {
            if (g().D0(x12.f11832r, vB0.g(), x12.f11814F, vB0.a())) {
                e().f11878y.c(Z.M(vB0.c()), "New GMP App Id passed in. Removing cached database data. appId");
                C0805n c0805n2 = this.f11683s;
                L(c0805n2);
                C0817r0 c0817r0 = (C0817r0) c0805n2.f5146q;
                String strC = vB0.c();
                c0805n2.F();
                c0805n2.E();
                P2.w.c(strC);
                try {
                    SQLiteDatabase sQLiteDatabaseA0 = c0805n2.A0();
                    String[] strArr = {strC};
                    int iDelete = sQLiteDatabaseA0.delete("events", "app_id=?", strArr) + sQLiteDatabaseA0.delete("user_attributes", "app_id=?", strArr) + sQLiteDatabaseA0.delete("conditional_properties", "app_id=?", strArr) + sQLiteDatabaseA0.delete("apps", "app_id=?", strArr) + sQLiteDatabaseA0.delete("raw_events", "app_id=?", strArr) + sQLiteDatabaseA0.delete("raw_events_metadata", "app_id=?", strArr) + sQLiteDatabaseA0.delete("event_filters", "app_id=?", strArr) + sQLiteDatabaseA0.delete("property_filters", "app_id=?", strArr) + sQLiteDatabaseA0.delete("audience_filter_values", "app_id=?", strArr) + sQLiteDatabaseA0.delete("consent_settings", "app_id=?", strArr) + sQLiteDatabaseA0.delete("default_event_params", "app_id=?", strArr) + sQLiteDatabaseA0.delete("trigger_uris", "app_id=?", strArr);
                    if (iDelete > 0) {
                        Z z8 = c0817r0.f12150y;
                        C0817r0.k(z8);
                        z8.D.d("Deleted application data. app, records", strC, Integer.valueOf(iDelete));
                    }
                } catch (SQLiteException e8) {
                    Z z9 = c0817r0.f12150y;
                    C0817r0.k(z9);
                    z9.f11875v.d("Error deleting application data. appId, error", Z.M(strC), e8);
                }
                vB0 = null;
            }
        }
        if (vB0 != null) {
            boolean z10 = (vB0.S() == -2147483648L || vB0.S() == x12.f11840z) ? false : true;
            String strE = vB0.e();
            if (z10 || ((vB0.S() != -2147483648L || strE == null || strE.equals(x12.f11833s)) ? false : true)) {
                Bundle bundle = new Bundle();
                bundle.putString("_pv", strE);
                C0828v c0828v = new C0828v("_au", new C0825u(bundle), "auto", j8);
                if (h0().R(null, I.f11573n1)) {
                    s(c0828v, x12);
                } else {
                    q(c0828v, x12);
                }
            }
        }
    }

    public final F0 n0(String str) {
        F0 f02 = F0.f11457c;
        I1.a.u(this);
        HashMap map = this.f11673R;
        F0 f0I0 = (F0) map.get(str);
        if (f0I0 == null) {
            C0805n c0805n = this.f11683s;
            L(c0805n);
            f0I0 = c0805n.I0(str);
            if (f0I0 == null) {
                f0I0 = F0.f11457c;
            }
            c().E();
            k();
            map.put(str, f0I0);
            C0805n c0805n2 = this.f11683s;
            L(c0805n2);
            c0805n2.c0(str, f0I0);
        }
        return f0I0;
    }

    public final void o(V v7, C0623d1 c0623d1) {
        P.g gVar;
        C0673n1 c0673n1;
        EnumC0787h enumC0787h;
        I1.a.u(this);
        String strV = ((C0628e1) c0623d1.f9801r).v();
        EnumMap enumMap = new EnumMap(E0.class);
        int length = strV.length();
        int length2 = E0.values().length;
        EnumC0787h enumC0787h2 = EnumC0787h.UNSET;
        int i = 0;
        if (length < length2 || strV.charAt(0) != '1') {
            gVar = new P.g(26);
        } else {
            E0[] e0ArrValues = E0.values();
            int length3 = e0ArrValues.length;
            int i5 = 0;
            int i8 = 1;
            while (i5 < length3) {
                E0 e02 = e0ArrValues[i5];
                int i9 = i8 + 1;
                char cCharAt = strV.charAt(i8);
                EnumC0787h[] enumC0787hArrValues = EnumC0787h.values();
                int length4 = enumC0787hArrValues.length;
                int i10 = i;
                while (true) {
                    if (i10 >= length4) {
                        enumC0787h = enumC0787h2;
                        break;
                    }
                    enumC0787h = enumC0787hArrValues[i10];
                    if (enumC0787h.f11995q == cCharAt) {
                        break;
                    } else {
                        i10++;
                    }
                }
                enumMap.put(e02, enumC0787h);
                i5++;
                i8 = i9;
                i = 0;
            }
            gVar = new P.g(enumMap);
        }
        String strC = v7.c();
        c().E();
        k();
        F0 f0N0 = n0(strC);
        E0 e03 = E0.f11447r;
        EnumMap enumMap2 = f0N0.f11458a;
        C0 c02 = (C0) enumMap2.get(e03);
        C0 c03 = C0.f11431r;
        if (c02 == null) {
            c02 = c03;
        }
        int iOrdinal = c02.ordinal();
        EnumC0787h enumC0787h3 = EnumC0787h.REMOTE_ENFORCED_DEFAULT;
        EnumC0787h enumC0787h4 = EnumC0787h.FAILSAFE;
        int i11 = f0N0.f11459b;
        if (iOrdinal == 1) {
            gVar.z(e03, enumC0787h3);
        } else if (iOrdinal == 2 || iOrdinal == 3) {
            gVar.y(e03, i11);
        } else {
            gVar.z(e03, enumC0787h4);
        }
        E0 e04 = E0.f11448s;
        C0 c04 = (C0) enumMap2.get(e04);
        if (c04 != null) {
            c03 = c04;
        }
        int iOrdinal2 = c03.ordinal();
        if (iOrdinal2 == 1) {
            gVar.z(e04, enumC0787h3);
        } else if (iOrdinal2 == 2 || iOrdinal2 == 3) {
            gVar.y(e04, i11);
        } else {
            gVar.z(e04, enumC0787h4);
        }
        String strC2 = v7.c();
        c().E();
        k();
        C0811p c0811pJ0 = j0(strC2, k0(strC2), n0(strC2), gVar);
        Boolean bool = c0811pJ0.f12092c;
        P2.w.f(bool);
        boolean zBooleanValue = bool.booleanValue();
        c0623d1.k();
        C0628e1.m0((C0628e1) c0623d1.f9801r, zBooleanValue);
        String str = c0811pJ0.f12093d;
        if (!TextUtils.isEmpty(str)) {
            c0623d1.k();
            C0628e1.X((C0628e1) c0623d1.f9801r, str);
        }
        I1.a.u(this);
        Iterator it = Collections.unmodifiableList(((C0628e1) c0623d1.f9801r).K()).iterator();
        while (true) {
            if (it.hasNext()) {
                c0673n1 = (C0673n1) it.next();
                if ("_npa".equals(c0673n1.s())) {
                    break;
                }
            } else {
                c0673n1 = null;
                break;
            }
        }
        if (c0673n1 != null) {
            E0 e05 = E0.f11450u;
            EnumC0787h enumC0787h5 = (EnumC0787h) ((EnumMap) gVar.f5246r).get(e05);
            if (enumC0787h5 == null) {
                enumC0787h5 = enumC0787h2;
            }
            if (enumC0787h5 == enumC0787h2) {
                C0805n c0805n = this.f11683s;
                L(c0805n);
                U1 u1K0 = c0805n.K0(v7.c(), "_npa");
                EnumC0787h enumC0787h6 = EnumC0787h.MANIFEST;
                EnumC0787h enumC0787h7 = EnumC0787h.API;
                if (u1K0 != null) {
                    String str2 = u1K0.f11736b;
                    if ("tcf".equals(str2)) {
                        gVar.z(e05, EnumC0787h.TCF);
                    } else if ("app".equals(str2)) {
                        gVar.z(e05, enumC0787h7);
                    } else {
                        gVar.z(e05, enumC0787h6);
                    }
                } else {
                    Boolean boolU = v7.U();
                    if (boolU == null || ((boolU.booleanValue() && c0673n1.p() != 1) || !(boolU.booleanValue() || c0673n1.p() == 0))) {
                        gVar.z(e05, enumC0787h7);
                    } else {
                        gVar.z(e05, enumC0787h6);
                    }
                }
            }
        } else {
            int iY = y(v7.c(), gVar);
            C0668m1 c0668m1R = C0673n1.r();
            c0668m1R.k();
            C0673n1.z((C0673n1) c0668m1R.f9801r, "_npa");
            d().getClass();
            long jCurrentTimeMillis = System.currentTimeMillis();
            c0668m1R.k();
            C0673n1.A((C0673n1) c0668m1R.f9801r, jCurrentTimeMillis);
            c0668m1R.k();
            C0673n1.y((C0673n1) c0668m1R.f9801r, iY);
            C0673n1 c0673n12 = (C0673n1) c0668m1R.h();
            c0623d1.k();
            C0628e1.r0((C0628e1) c0623d1.f9801r, c0673n12);
            e().D.d("Setting user property", "non_personalized_ads(_npa)", Integer.valueOf(iY));
        }
        String string = gVar.toString();
        c0623d1.k();
        C0628e1.V((C0628e1) c0623d1.f9801r, string);
        String strC3 = v7.c();
        C0803m0 c0803m0 = this.f11681q;
        c0803m0.E();
        c0803m0.M(strC3);
        com.google.android.gms.internal.measurement.B0 b0S = c0803m0.S(strC3);
        boolean z8 = b0S == null || !b0S.t() || b0S.s();
        List listC = c0623d1.C();
        for (int i12 = 0; i12 < listC.size(); i12++) {
            if ("_tcf".equals(((com.google.android.gms.internal.measurement.W0) listC.get(i12)).t())) {
                com.google.android.gms.internal.measurement.V0 v02 = (com.google.android.gms.internal.measurement.V0) ((com.google.android.gms.internal.measurement.W0) listC.get(i12)).f();
                List listR = v02.r();
                int i13 = 0;
                while (true) {
                    if (i13 >= listR.size()) {
                        break;
                    }
                    if ("_tcfd".equals(((com.google.android.gms.internal.measurement.Z0) listR.get(i13)).s())) {
                        String strT = ((com.google.android.gms.internal.measurement.Z0) listR.get(i13)).t();
                        if (z8 && strT.length() > 4) {
                            char[] charArray = strT.toCharArray();
                            int i14 = 1;
                            while (true) {
                                if (i14 >= 64) {
                                    i14 = 0;
                                    break;
                                } else if (charArray[4] == "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_".charAt(i14)) {
                                    break;
                                } else {
                                    i14++;
                                }
                            }
                            charArray[4] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_".charAt(i14 | 1);
                            strT = String.valueOf(charArray);
                        }
                        com.google.android.gms.internal.measurement.Y0 y0R = com.google.android.gms.internal.measurement.Z0.r();
                        y0R.m("_tcfd");
                        y0R.n(strT);
                        v02.k();
                        com.google.android.gms.internal.measurement.W0.A((com.google.android.gms.internal.measurement.W0) v02.f9801r, i13, (com.google.android.gms.internal.measurement.Z0) y0R.h());
                    } else {
                        i13++;
                    }
                }
                c0623d1.E(i12, v02);
                return;
            }
        }
    }

    public final void p(C0623d1 c0623d1, C0782f0 c0782f0) {
        String strN;
        String strN2;
        for (int i = 0; i < c0623d1.T(); i++) {
            com.google.android.gms.internal.measurement.V0 v02 = (com.google.android.gms.internal.measurement.V0) ((C0628e1) c0623d1.f9801r).j2(i).f();
            Iterator it = v02.r().iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                if ("_c".equals(((com.google.android.gms.internal.measurement.Z0) it.next()).s())) {
                    if (((C0628e1) c0782f0.f11940b).M() >= h0().K(((C0628e1) c0782f0.f11940b).r(), I.f11566l0)) {
                        int iK = h0().K(((C0628e1) c0782f0.f11940b).r(), I.f11598y0);
                        LinkedList linkedList = this.f11663G;
                        C0773c0 c0773c0 = this.f11687w;
                        if (iK > 0) {
                            C0805n c0805n = this.f11683s;
                            L(c0805n);
                            if (c0805n.E0(v(), ((C0628e1) c0782f0.f11940b).r(), false, false, false, true).f12014g > iK) {
                                com.google.android.gms.internal.measurement.Y0 y0R = com.google.android.gms.internal.measurement.Z0.r();
                                y0R.m("_tnr");
                                y0R.l(1L);
                                v02.o((com.google.android.gms.internal.measurement.Z0) y0R.h());
                            } else {
                                if (h0().R(((C0628e1) c0782f0.f11940b).r(), I.f11531Y0)) {
                                    strN2 = g().N();
                                    com.google.android.gms.internal.measurement.Y0 y0R2 = com.google.android.gms.internal.measurement.Z0.r();
                                    y0R2.m("_tu");
                                    y0R2.n(strN2);
                                    v02.o((com.google.android.gms.internal.measurement.Z0) y0R2.h());
                                } else {
                                    strN2 = null;
                                }
                                com.google.android.gms.internal.measurement.Y0 y0R3 = com.google.android.gms.internal.measurement.Z0.r();
                                y0R3.m("_tr");
                                y0R3.l(1L);
                                v02.o((com.google.android.gms.internal.measurement.Z0) y0R3.h());
                                L(c0773c0);
                                E1 e1I0 = c0773c0.i0(((C0628e1) c0782f0.f11940b).r(), c0623d1, v02, strN2);
                                if (e1I0 != null) {
                                    e().D.d("Generated trigger URI. appId, uri", ((C0628e1) c0782f0.f11940b).r(), e1I0.f11453q);
                                    C0805n c0805n2 = this.f11683s;
                                    L(c0805n2);
                                    c0805n2.o0(((C0628e1) c0782f0.f11940b).r(), e1I0);
                                    if (!linkedList.contains(((C0628e1) c0782f0.f11940b).r())) {
                                        linkedList.add(((C0628e1) c0782f0.f11940b).r());
                                    }
                                }
                            }
                        } else {
                            if (h0().R(((C0628e1) c0782f0.f11940b).r(), I.f11531Y0)) {
                                strN = g().N();
                                com.google.android.gms.internal.measurement.Y0 y0R4 = com.google.android.gms.internal.measurement.Z0.r();
                                y0R4.m("_tu");
                                y0R4.n(strN);
                                v02.o((com.google.android.gms.internal.measurement.Z0) y0R4.h());
                            } else {
                                strN = null;
                            }
                            com.google.android.gms.internal.measurement.Y0 y0R5 = com.google.android.gms.internal.measurement.Z0.r();
                            y0R5.m("_tr");
                            y0R5.l(1L);
                            v02.o((com.google.android.gms.internal.measurement.Z0) y0R5.h());
                            L(c0773c0);
                            E1 e1I02 = c0773c0.i0(((C0628e1) c0782f0.f11940b).r(), c0623d1, v02, strN);
                            if (e1I02 != null) {
                                e().D.d("Generated trigger URI. appId, uri", ((C0628e1) c0782f0.f11940b).r(), e1I02.f11453q);
                                C0805n c0805n3 = this.f11683s;
                                L(c0805n3);
                                c0805n3.o0(((C0628e1) c0782f0.f11940b).r(), e1I02);
                                if (!linkedList.contains(((C0628e1) c0782f0.f11940b).r())) {
                                    linkedList.add(((C0628e1) c0782f0.f11940b).r());
                                }
                            }
                        }
                    }
                    com.google.android.gms.internal.measurement.W0 w02 = (com.google.android.gms.internal.measurement.W0) v02.h();
                    c0623d1.k();
                    C0628e1.g0((C0628e1) c0623d1.f9801r, i, w02);
                }
            }
        }
    }

    public final void q(C0828v c0828v, X1 x12) {
        List listK;
        C0817r0 c0817r0;
        List listK2;
        List<C0778e> listK3;
        String str;
        P2.w.f(x12);
        String str2 = x12.f11831q;
        P2.w.c(str2);
        c().E();
        k();
        R0.m mVarN = R0.m.n(c0828v);
        c().E();
        W1.U((this.f11677V == null || (str = this.f11678W) == null || !str.equals(str2)) ? null : this.f11677V, (Bundle) mVarN.f5955e, false);
        C0828v c0828vM = mVarN.m();
        f();
        if (TextUtils.isEmpty(x12.f11832r) && TextUtils.isEmpty(x12.f11814F)) {
            return;
        }
        if (!x12.f11838x) {
            f0(x12);
            return;
        }
        List list = x12.f11816I;
        if (list != null) {
            String str3 = c0828vM.f12193q;
            if (!list.contains(str3)) {
                e().f11871C.e("Dropping non-safelisted event. appId, event name, origin", str2, c0828vM.f12193q, c0828vM.f12195s);
                return;
            } else {
                Bundle bundleA = c0828vM.f12194r.a();
                bundleA.putLong("ga_safelisted", 1L);
                c0828vM = new C0828v(str3, new C0825u(bundleA), c0828vM.f12195s, c0828vM.f12196t);
            }
        }
        C0805n c0805n = this.f11683s;
        L(c0805n);
        c0805n.P();
        try {
            boolean zR = h0().R(null, I.f11561j1);
            String str4 = c0828vM.f12193q;
            if (zR && "_s".equals(str4)) {
                C0805n c0805n2 = this.f11683s;
                L(c0805n2);
                if (!c0805n2.e0(str2, "_s") && c0828vM.f12194r.f12186q.getLong("_sid") != 0) {
                    C0805n c0805n3 = this.f11683s;
                    L(c0805n3);
                    if (c0805n3.e0(str2, "_f")) {
                        C0805n c0805n4 = this.f11683s;
                        L(c0805n4);
                        c0805n4.O(str2, null, "_sid", e0(c0828vM, str2));
                    } else {
                        C0805n c0805n5 = this.f11683s;
                        L(c0805n5);
                        if (c0805n5.e0(str2, "_v")) {
                            C0805n c0805n42 = this.f11683s;
                            L(c0805n42);
                            c0805n42.O(str2, null, "_sid", e0(c0828vM, str2));
                        } else {
                            C0805n c0805n6 = this.f11683s;
                            L(c0805n6);
                            d().getClass();
                            c0805n6.O(str2, Long.valueOf(System.currentTimeMillis() - 15000), "_sid", e0(c0828vM, str2));
                        }
                    }
                }
            }
            C0805n c0805n7 = this.f11683s;
            L(c0805n7);
            P2.w.c(str2);
            c0805n7.E();
            c0805n7.F();
            long j8 = c0828v.f12196t;
            if (j8 < 0) {
                Z z8 = ((C0817r0) c0805n7.f5146q).f12150y;
                C0817r0.k(z8);
                z8.f11878y.d("Invalid time querying timed out conditional properties", Z.M(str2), Long.valueOf(j8));
                listK = Collections.EMPTY_LIST;
            } else {
                listK = c0805n7.K("active=0 and app_id=? and abs(? - creation_timestamp) > trigger_timeout", new String[]{str2, String.valueOf(j8)});
            }
            Iterator it = listK.iterator();
            while (true) {
                boolean zHasNext = it.hasNext();
                c0817r0 = this.f11659B;
                if (!zHasNext) {
                    break;
                }
                C0778e c0778e = (C0778e) it.next();
                if (c0778e != null) {
                    e().D.e("User property timed out", c0778e.f11918q, c0817r0.f12123C.f(c0778e.f11920s.f11723r), c0778e.f11920s.a());
                    C0828v c0828v2 = c0778e.f11924w;
                    if (c0828v2 != null) {
                        b0(new C0828v(c0828v2, j8), x12);
                    }
                    C0805n c0805n8 = this.f11683s;
                    L(c0805n8);
                    c0805n8.f0(str2, c0778e.f11920s.f11723r);
                }
            }
            C0805n c0805n9 = this.f11683s;
            L(c0805n9);
            P2.w.c(str2);
            c0805n9.E();
            c0805n9.F();
            if (j8 < 0) {
                Z z9 = ((C0817r0) c0805n9.f5146q).f12150y;
                C0817r0.k(z9);
                z9.f11878y.d("Invalid time querying expired conditional properties", Z.M(str2), Long.valueOf(j8));
                listK2 = Collections.EMPTY_LIST;
            } else {
                listK2 = c0805n9.K("active<>0 and app_id=? and abs(? - triggered_timestamp) > time_to_live", new String[]{str2, String.valueOf(j8)});
            }
            ArrayList arrayList = new ArrayList(listK2.size());
            Iterator it2 = listK2.iterator();
            while (it2.hasNext()) {
                C0778e c0778e2 = (C0778e) it2.next();
                if (c0778e2 != null) {
                    Iterator it3 = it2;
                    e().D.e("User property expired", c0778e2.f11918q, c0817r0.f12123C.f(c0778e2.f11920s.f11723r), c0778e2.f11920s.a());
                    C0805n c0805n10 = this.f11683s;
                    L(c0805n10);
                    c0805n10.X(str2, c0778e2.f11920s.f11723r);
                    C0828v c0828v3 = c0778e2.f11917A;
                    if (c0828v3 != null) {
                        arrayList.add(c0828v3);
                    }
                    C0805n c0805n11 = this.f11683s;
                    L(c0805n11);
                    c0805n11.f0(str2, c0778e2.f11920s.f11723r);
                    it2 = it3;
                }
            }
            int size = arrayList.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayList.get(i);
                i++;
                b0(new C0828v((C0828v) obj, j8), x12);
            }
            C0805n c0805n12 = this.f11683s;
            L(c0805n12);
            P2.w.c(str2);
            P2.w.c(str4);
            c0805n12.E();
            c0805n12.F();
            if (j8 < 0) {
                C0817r0 c0817r02 = (C0817r0) c0805n12.f5146q;
                Z z10 = c0817r02.f12150y;
                C0817r0.k(z10);
                z10.f11878y.e("Invalid time querying triggered conditional properties", Z.M(str2), c0817r02.f12123C.d(str4), Long.valueOf(j8));
                listK3 = Collections.EMPTY_LIST;
            } else {
                listK3 = c0805n12.K("active=0 and app_id=? and trigger_event_name=? and abs(? - creation_timestamp) <= trigger_timeout", new String[]{str2, str4, String.valueOf(j8)});
            }
            ArrayList arrayList2 = new ArrayList(listK3.size());
            for (C0778e c0778e3 : listK3) {
                if (c0778e3 != null) {
                    T1 t12 = c0778e3.f11920s;
                    String str5 = c0778e3.f11918q;
                    P2.w.f(str5);
                    String str6 = c0778e3.f11919r;
                    String str7 = t12.f11723r;
                    Object objA = t12.a();
                    P2.w.f(objA);
                    long j9 = j8;
                    U1 u12 = new U1(str5, str6, str7, j9, objA);
                    j8 = j9;
                    Object obj2 = u12.f11739e;
                    String str8 = u12.f11737c;
                    C0805n c0805n13 = this.f11683s;
                    L(c0805n13);
                    if (c0805n13.s0(u12)) {
                        e().D.e("User property triggered", c0778e3.f11918q, c0817r0.f12123C.f(str8), obj2);
                    } else {
                        e().f11875v.e("Too many active user properties, ignoring", Z.M(c0778e3.f11918q), c0817r0.f12123C.f(str8), obj2);
                    }
                    C0828v c0828v4 = c0778e3.f11926y;
                    if (c0828v4 != null) {
                        arrayList2.add(c0828v4);
                    }
                    c0778e3.f11920s = new T1(u12);
                    c0778e3.f11922u = true;
                    C0805n c0805n14 = this.f11683s;
                    L(c0805n14);
                    c0805n14.r0(c0778e3);
                }
            }
            b0(c0828vM, x12);
            int size2 = arrayList2.size();
            int i5 = 0;
            while (i5 < size2) {
                Object obj3 = arrayList2.get(i5);
                i5++;
                b0(new C0828v((C0828v) obj3, j8), x12);
            }
            C0805n c0805n15 = this.f11683s;
            L(c0805n15);
            c0805n15.Z();
            C0805n c0805n16 = this.f11683s;
            L(c0805n16);
            c0805n16.T();
        } catch (Throwable th) {
            C0805n c0805n17 = this.f11683s;
            L(c0805n17);
            c0805n17.T();
            throw th;
        }
    }

    public final void r(C0828v c0828v, String str) throws Throwable {
        C0805n c0805n = this.f11683s;
        L(c0805n);
        V vB0 = c0805n.B0(str);
        if (vB0 == null || TextUtils.isEmpty(vB0.e())) {
            e().f11871C.c(str, "No app data available; dropping event");
            return;
        }
        Boolean boolA = A(vB0);
        if (boolA == null) {
            if (!"_ui".equals(c0828v.f12193q)) {
                Z zE = e();
                zE.f11878y.c(Z.M(str), "Could not find package. appId");
            }
        } else if (!boolA.booleanValue()) {
            Z zE2 = e();
            zE2.f11875v.c(Z.M(str), "App version does not match; dropping event. appId");
            return;
        }
        String strG = vB0.g();
        String strE = vB0.e();
        long jS = vB0.S();
        C0817r0 c0817r0 = vB0.f11758a;
        C0815q0 c0815q0 = c0817r0.f12151z;
        C0817r0.k(c0815q0);
        c0815q0.E();
        String str2 = vB0.f11768l;
        C0815q0 c0815q02 = c0817r0.f12151z;
        C0817r0.k(c0815q02);
        c0815q02.E();
        long j8 = vB0.f11769m;
        C0815q0 c0815q03 = c0817r0.f12151z;
        C0817r0.k(c0815q03);
        c0815q03.E();
        long j9 = vB0.f11770n;
        C0815q0 c0815q04 = c0817r0.f12151z;
        C0817r0.k(c0815q04);
        c0815q04.E();
        boolean z8 = vB0.f11771o;
        String strF = vB0.f();
        C0815q0 c0815q05 = c0817r0.f12151z;
        C0817r0.k(c0815q05);
        c0815q05.E();
        boolean z9 = vB0.f11772p;
        String strA = vB0.a();
        Boolean boolU = vB0.U();
        long jT = vB0.T();
        C0815q0 c0815q06 = c0817r0.f12151z;
        C0817r0.k(c0815q06);
        c0815q06.E();
        ArrayList arrayList = vB0.f11776t;
        String strJ = n0(str).j();
        boolean zT = vB0.t();
        C0815q0 c0815q07 = c0817r0.f12151z;
        C0817r0.k(c0815q07);
        c0815q07.E();
        long j10 = vB0.f11779w;
        F0 f0N0 = n0(str);
        String str3 = k0(str).f12091b;
        C0815q0 c0815q08 = c0817r0.f12151z;
        C0817r0.k(c0815q08);
        c0815q08.E();
        int i = vB0.f11781y;
        C0815q0 c0815q09 = c0817r0.f12151z;
        C0817r0.k(c0815q09);
        c0815q09.E();
        s(c0828v, new X1(str, strG, strE, jS, str2, j8, j9, (String) null, z8, false, strF, 0L, 0, z9, false, strA, boolU, jT, (List) arrayList, (String) null, strJ, "", (String) null, zT, j10, f0N0.f11459b, str3, i, vB0.f11742C, vB0.i(), vB0.h(), 0L, vB0.R()));
    }

    /* JADX WARN: Not initialized variable reg: 5, insn: 0x007b: MOVE (r4 I:??[OBJECT, ARRAY]) = (r5 I:??[OBJECT, ARRAY]) (LINE:124), block:B:18:0x007b */
    /* JADX WARN: Removed duplicated region for block: B:29:0x00c9  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00fd  */
    /* JADX WARN: Removed duplicated region for block: B:44:? A[SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void s(C0828v c0828v, X1 x12) throws Throwable {
        Throwable th;
        Cursor cursorRawQuery;
        Cursor cursor;
        C0828v c0828vM;
        String str = x12.f11831q;
        P2.w.c(str);
        R0.m mVarN = R0.m.n(c0828v);
        W1 w1G = g();
        C0805n c0805n = this.f11683s;
        L(c0805n);
        C0817r0 c0817r0 = (C0817r0) c0805n.f5146q;
        c0805n.E();
        c0805n.F();
        Cursor cursor2 = null;
        bundleM = null;
        Bundle bundleM = null;
        try {
            try {
                cursorRawQuery = c0805n.A0().rawQuery("select parameters from default_event_params where app_id=?", new String[]{str});
                try {
                } catch (SQLiteException e8) {
                    e = e8;
                    Z z8 = c0817r0.f12150y;
                    C0817r0.k(z8);
                    z8.f11875v.c(e, "Error selecting default event parameters");
                }
            } catch (Throwable th2) {
                th = th2;
                cursor2 = cursor;
                if (cursor2 != null) {
                    throw th;
                }
                cursor2.close();
                throw th;
            }
        } catch (SQLiteException e9) {
            e = e9;
            cursorRawQuery = null;
        } catch (Throwable th3) {
            th = th3;
            if (cursor2 != null) {
            }
        }
        if (cursorRawQuery.moveToFirst()) {
            try {
                com.google.android.gms.internal.measurement.W0 w02 = (com.google.android.gms.internal.measurement.W0) ((com.google.android.gms.internal.measurement.V0) C0773c0.k0(com.google.android.gms.internal.measurement.W0.r(), cursorRawQuery.getBlob(0))).h();
                c0805n.f11473r.f();
                bundleM = C0773c0.M(w02.u());
            } catch (IOException e10) {
                Z z9 = c0817r0.f12150y;
                C0817r0.k(z9);
                z9.f11875v.d("Failed to retrieve default event parameters. appId", Z.M(str), e10);
                if (cursorRawQuery != null) {
                }
                w1G.V((Bundle) mVarN.f5955e, bundleM);
                W1 w1G2 = g();
                C0784g c0784gH0 = h0();
                c0784gH0.getClass();
                w1G2.X(mVarN, Math.max(Math.min(c0784gH0.K(str, I.X), 100), 25));
                c0828vM = mVarN.m();
                if ("_cmp".equals(c0828vM.f12193q)) {
                }
                q(c0828vM, x12);
            }
            cursorRawQuery.close();
            w1G.V((Bundle) mVarN.f5955e, bundleM);
            W1 w1G22 = g();
            C0784g c0784gH02 = h0();
            c0784gH02.getClass();
            w1G22.X(mVarN, Math.max(Math.min(c0784gH02.K(str, I.X), 100), 25));
            c0828vM = mVarN.m();
            if ("_cmp".equals(c0828vM.f12193q)) {
                C0825u c0825u = c0828vM.f12194r;
                if ("referrer API v2".equals(c0825u.f12186q.getString("_cis"))) {
                    String string = c0825u.f12186q.getString("gclid");
                    if (!TextUtils.isEmpty(string)) {
                        W(new T1(c0828vM.f12196t, string, "_lgclid", "auto"), x12);
                    }
                }
            }
            q(c0828vM, x12);
        }
        Z z10 = c0817r0.f12150y;
        C0817r0.k(z10);
        z10.D.b("Default event parameters not found");
        if (cursorRawQuery != null) {
            cursorRawQuery.close();
        }
        w1G.V((Bundle) mVarN.f5955e, bundleM);
        W1 w1G222 = g();
        C0784g c0784gH022 = h0();
        c0784gH022.getClass();
        w1G222.X(mVarN, Math.max(Math.min(c0784gH022.K(str, I.X), 100), 25));
        c0828vM = mVarN.m();
        if ("_cmp".equals(c0828vM.f12193q)) {
        }
        q(c0828vM, x12);
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x004b  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x0166 A[Catch: all -> 0x005f, TryCatch #1 {all -> 0x005f, blocks: (B:8:0x0030, B:18:0x004e, B:57:0x0169, B:26:0x006c, B:31:0x00c8, B:30:0x00b6, B:32:0x00cd, B:36:0x00de, B:40:0x00f4, B:42:0x010c, B:44:0x0127, B:46:0x0130, B:48:0x0136, B:49:0x013a, B:51:0x0146, B:53:0x014f, B:55:0x015e, B:56:0x0166, B:43:0x0118, B:37:0x00e5, B:39:0x00ee), top: B:66:0x0030, outer: #0 }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void t(String str, int i, IOException iOException, byte[] bArr, Map map) {
        boolean z8;
        C0773c0 c0773c0 = this.f11682r;
        c().E();
        k();
        P2.w.c(str);
        if (bArr == null) {
            try {
                bArr = new byte[0];
            } catch (Throwable th) {
                this.f11665J = false;
                C();
                throw th;
            }
        }
        X x8 = e().D;
        Integer numValueOf = Integer.valueOf(bArr.length);
        x8.c(numValueOf, "onConfigFetched. Response size");
        C0805n c0805n = this.f11683s;
        L(c0805n);
        c0805n.P();
        try {
            C0805n c0805n2 = this.f11683s;
            L(c0805n2);
            V vB0 = c0805n2.B0(str);
            if (i == 200 || i == 204) {
                z8 = iOException != null;
            } else {
                if (i == 304) {
                    i = 304;
                    if (iOException != null) {
                    }
                }
            }
            if (vB0 == null) {
                e().f11878y.c(Z.M(str), "App does not exist in onConfigFetched. appId");
            } else {
                C0803m0 c0803m0 = this.f11681q;
                if (z8 || i == 404) {
                    String strB = B("Last-Modified", map);
                    String strB2 = B("ETag", map);
                    if (i == 404 || i == 304) {
                        L(c0803m0);
                        if (c0803m0.T(str) == null) {
                            L(c0803m0);
                            c0803m0.Y(str, null, null, null);
                        }
                    } else {
                        L(c0803m0);
                        c0803m0.Y(str, strB, strB2, bArr);
                    }
                    d().getClass();
                    vB0.u(System.currentTimeMillis());
                    C0805n c0805n3 = this.f11683s;
                    L(c0805n3);
                    c0805n3.a0(vB0, false);
                    if (i == 404) {
                        e().f11869A.c(str, "Config not found. Using empty config. appId");
                    } else {
                        e().D.d("Successfully fetched config. Got network response. code, size", Integer.valueOf(i), numValueOf);
                    }
                    L(c0773c0);
                    if (c0773c0.d0() && H()) {
                        X();
                    } else if (h0().R(null, I.f11511N0)) {
                        L(c0773c0);
                        if (c0773c0.d0()) {
                            C0805n c0805n4 = this.f11683s;
                            L(c0805n4);
                            if (c0805n4.d0(vB0.c())) {
                                Z(vB0.c());
                            } else {
                                F();
                            }
                        }
                    }
                } else {
                    d().getClass();
                    vB0.F(System.currentTimeMillis());
                    C0805n c0805n5 = this.f11683s;
                    L(c0805n5);
                    c0805n5.a0(vB0, false);
                    e().D.d("Fetching config failed. code, error", Integer.valueOf(i), iOException);
                    L(c0803m0);
                    c0803m0.E();
                    c0803m0.f12051C.put(str, null);
                    B0.s0 s0Var = this.f11689y.f12208y;
                    d().getClass();
                    s0Var.h(System.currentTimeMillis());
                    if (i == 503 || i == 429) {
                        B0.s0 s0Var2 = this.f11689y.f12206w;
                        d().getClass();
                        s0Var2.h(System.currentTimeMillis());
                    }
                    F();
                }
            }
            C0805n c0805n6 = this.f11683s;
            L(c0805n6);
            c0805n6.Z();
            this.f11665J = false;
            C();
        } finally {
            C0805n c0805n7 = this.f11683s;
            L(c0805n7);
            c0805n7.T();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:106:0x026e A[Catch: SQLiteException -> 0x00b0, all -> 0x026b, TryCatch #3 {SQLiteException -> 0x00b0, blocks: (B:26:0x009d, B:30:0x00b3, B:32:0x00c1, B:35:0x00dd, B:96:0x023b, B:99:0x0253, B:101:0x025c, B:103:0x0267, B:112:0x0286, B:106:0x026e, B:108:0x0277, B:110:0x027d, B:111:0x0281, B:114:0x028a, B:115:0x0292, B:34:0x00d2), top: B:127:0x009d, outer: #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:21:0x0068 A[Catch: all -> 0x000f, TryCatch #5 {all -> 0x000f, blocks: (B:4:0x000c, B:17:0x002a, B:22:0x007a, B:21:0x0068, B:26:0x009d, B:32:0x00c1), top: B:129:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0088 A[Catch: all -> 0x026b, PHI: r0
      0x0088: PHI (r0v4 int) = (r0v0 int), (r0v37 int) binds: [B:10:0x001d, B:16:0x0028] A[DONT_GENERATE, DONT_INLINE], TRY_ENTER, TRY_LEAVE, TryCatch #4 {all -> 0x026b, blocks: (B:9:0x0015, B:24:0x0088, B:30:0x00b3, B:35:0x00dd, B:96:0x023b, B:99:0x0253, B:101:0x025c, B:103:0x0267, B:112:0x0286, B:106:0x026e, B:108:0x0277, B:110:0x027d, B:111:0x0281, B:114:0x028a, B:115:0x0292, B:34:0x00d2, B:116:0x0293, B:26:0x009d, B:32:0x00c1), top: B:128:0x0015, inners: #3 }] */
    /* JADX WARN: Removed duplicated region for block: B:32:0x00c1 A[Catch: all -> 0x000f, SQLiteException -> 0x00b0, TRY_ENTER, TRY_LEAVE, TryCatch #3 {SQLiteException -> 0x00b0, blocks: (B:26:0x009d, B:30:0x00b3, B:32:0x00c1, B:35:0x00dd, B:96:0x023b, B:99:0x0253, B:101:0x025c, B:103:0x0267, B:112:0x0286, B:106:0x026e, B:108:0x0277, B:110:0x027d, B:111:0x0281, B:114:0x028a, B:115:0x0292, B:34:0x00d2), top: B:127:0x009d, outer: #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:34:0x00d2 A[Catch: SQLiteException -> 0x00b0, all -> 0x026b, TRY_ENTER, TryCatch #3 {SQLiteException -> 0x00b0, blocks: (B:26:0x009d, B:30:0x00b3, B:32:0x00c1, B:35:0x00dd, B:96:0x023b, B:99:0x0253, B:101:0x025c, B:103:0x0267, B:112:0x0286, B:106:0x026e, B:108:0x0277, B:110:0x027d, B:111:0x0281, B:114:0x028a, B:115:0x0292, B:34:0x00d2), top: B:127:0x009d, outer: #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:38:0x00f3 A[Catch: all -> 0x0157, TryCatch #2 {all -> 0x0157, blocks: (B:36:0x00e5, B:38:0x00f3, B:40:0x00ff, B:41:0x0108, B:44:0x0110, B:46:0x0122, B:48:0x012d, B:50:0x0135, B:54:0x0141, B:56:0x014b, B:59:0x015a, B:60:0x015e, B:62:0x0164, B:64:0x0176, B:66:0x018d, B:67:0x018f, B:69:0x01a4, B:70:0x01a8, B:72:0x01ae, B:74:0x01c8, B:75:0x01ca, B:76:0x01d4, B:78:0x01db, B:79:0x01e3, B:80:0x01fe, B:83:0x020c, B:84:0x0213, B:86:0x0215, B:87:0x0225, B:89:0x0227, B:91:0x022b, B:94:0x0232, B:95:0x0233), top: B:126:0x00e5, inners: #1 }] */
    /* JADX WARN: Removed duplicated region for block: B:78:0x01db A[Catch: all -> 0x0157, TRY_LEAVE, TryCatch #2 {all -> 0x0157, blocks: (B:36:0x00e5, B:38:0x00f3, B:40:0x00ff, B:41:0x0108, B:44:0x0110, B:46:0x0122, B:48:0x012d, B:50:0x0135, B:54:0x0141, B:56:0x014b, B:59:0x015a, B:60:0x015e, B:62:0x0164, B:64:0x0176, B:66:0x018d, B:67:0x018f, B:69:0x01a4, B:70:0x01a8, B:72:0x01ae, B:74:0x01c8, B:75:0x01ca, B:76:0x01d4, B:78:0x01db, B:79:0x01e3, B:80:0x01fe, B:83:0x020c, B:84:0x0213, B:86:0x0215, B:87:0x0225, B:89:0x0227, B:91:0x022b, B:94:0x0232, B:95:0x0233), top: B:126:0x00e5, inners: #1 }] */
    /* JADX WARN: Removed duplicated region for block: B:99:0x0253 A[Catch: SQLiteException -> 0x00b0, all -> 0x026b, TRY_ENTER, TryCatch #3 {SQLiteException -> 0x00b0, blocks: (B:26:0x009d, B:30:0x00b3, B:32:0x00c1, B:35:0x00dd, B:96:0x023b, B:99:0x0253, B:101:0x025c, B:103:0x0267, B:112:0x0286, B:106:0x026e, B:108:0x0277, B:110:0x027d, B:111:0x0281, B:114:0x028a, B:115:0x0292, B:34:0x00d2), top: B:127:0x009d, outer: #4 }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void u(boolean z8, int i, IOException iOException, byte[] bArr, String str, List list) {
        boolean z9;
        byte[] bArr2;
        boolean z10;
        int size;
        int i5;
        boolean zR;
        C0773c0 c0773c0;
        EnumC0783f1 enumC0783f1;
        int i8 = i;
        I1.a.u(this);
        if (bArr == null) {
            try {
                bArr2 = new byte[0];
            } catch (Throwable th) {
                th = th;
                z9 = false;
                this.f11666K = z9;
                C();
                throw th;
            }
        } else {
            bArr2 = bArr;
        }
        try {
            ArrayList arrayList = this.f11670O;
            P2.w.f(arrayList);
            this.f11670O = null;
            if (!z8) {
                X x8 = e().D;
                Integer numValueOf = Integer.valueOf(i8);
                x8.d("Network upload successful with code, uploadAttempted", numValueOf, Boolean.valueOf(z8));
                if (z8) {
                    try {
                        B0.s0 s0Var = this.f11689y.f12207x;
                        d().getClass();
                        s0Var.h(System.currentTimeMillis());
                        this.f11689y.f12208y.h(0L);
                        F();
                        if (z8) {
                            e().D.b("Purged empty bundles");
                        } else {
                            e().D.d("Successful upload. Got network response. code, size", numValueOf, Integer.valueOf(bArr2.length));
                        }
                        C0805n c0805n = this.f11683s;
                        L(c0805n);
                        c0805n.P();
                        try {
                            if (h0().R(null, I.f11511N0)) {
                                if (h0().R(null, I.f11517Q0)) {
                                    HashMap map = new HashMap();
                                    Iterator it = list.iterator();
                                    while (true) {
                                        boolean zHasNext = it.hasNext();
                                        enumC0783f1 = EnumC0783f1.f11947u;
                                        if (!zHasNext) {
                                            break;
                                        }
                                        Pair pair = (Pair) it.next();
                                        C0618c1 c0618c1 = (C0618c1) pair.first;
                                        L1 l12 = (L1) pair.second;
                                        if (l12.f11621c != enumC0783f1) {
                                            C0805n c0805n2 = this.f11683s;
                                            L(c0805n2);
                                            String str2 = l12.f11619a;
                                            Map map2 = l12.f11620b;
                                            if (map2 == null) {
                                                map2 = Collections.EMPTY_MAP;
                                            }
                                            EnumC0783f1 enumC0783f12 = l12.f11621c;
                                            long jX0 = c0805n2.x0(str, c0618c1, str2, map2, enumC0783f12, null);
                                            if (enumC0783f12 == EnumC0783f1.f11948v && jX0 != -1 && !c0618c1.r().isEmpty()) {
                                                map.put(c0618c1.r(), Long.valueOf(jX0));
                                            }
                                        }
                                    }
                                    Iterator it2 = list.iterator();
                                    while (it2.hasNext()) {
                                        Pair pair2 = (Pair) it2.next();
                                        C0618c1 c0618c12 = (C0618c1) pair2.first;
                                        L1 l13 = (L1) pair2.second;
                                        if (l13.f11621c == enumC0783f1) {
                                            Long l8 = (Long) map.get(c0618c12.r());
                                            C0805n c0805n3 = this.f11683s;
                                            L(c0805n3);
                                            String str3 = l13.f11619a;
                                            Map map3 = l13.f11620b;
                                            if (map3 == null) {
                                                map3 = Collections.EMPTY_MAP;
                                            }
                                            c0805n3.x0(str, c0618c12, str3, map3, l13.f11621c, l8);
                                            enumC0783f1 = enumC0783f1;
                                        }
                                    }
                                } else {
                                    Iterator it3 = list.iterator();
                                    while (it3.hasNext()) {
                                        Pair pair3 = (Pair) it3.next();
                                        C0618c1 c0618c13 = (C0618c1) pair3.first;
                                        L1 l14 = (L1) pair3.second;
                                        C0805n c0805n4 = this.f11683s;
                                        L(c0805n4);
                                        String str4 = l14.f11619a;
                                        Map map4 = l14.f11620b;
                                        if (map4 == null) {
                                            map4 = Collections.EMPTY_MAP;
                                        }
                                        c0805n4.x0(str, c0618c13, str4, map4, l14.f11621c, null);
                                    }
                                }
                            }
                            size = arrayList.size();
                            i5 = 0;
                            while (i5 < size) {
                                int i9 = i5 + 1;
                                Long l9 = (Long) arrayList.get(i5);
                                try {
                                    C0805n c0805n5 = this.f11683s;
                                    L(c0805n5);
                                    long jLongValue = l9.longValue();
                                    c0805n5.E();
                                    c0805n5.F();
                                    try {
                                        if (c0805n5.A0().delete("queue", "rowid=?", new String[]{String.valueOf(jLongValue)}) != 1) {
                                            throw new SQLiteException("Deleted fewer rows from queue than expected");
                                        }
                                        continue;
                                    } catch (SQLiteException e8) {
                                        Z z11 = ((C0817r0) c0805n5.f5146q).f12150y;
                                        C0817r0.k(z11);
                                        z11.f11875v.c(e8, "Failed to delete a bundle in a queue table");
                                        throw e8;
                                    }
                                } catch (SQLiteException e9) {
                                    ArrayList arrayList2 = this.f11671P;
                                    if (arrayList2 == null || !arrayList2.contains(l9)) {
                                        throw e9;
                                    }
                                }
                                i5 = i9;
                            }
                            C0805n c0805n6 = this.f11683s;
                            L(c0805n6);
                            c0805n6.Z();
                            C0805n c0805n7 = this.f11683s;
                            L(c0805n7);
                            c0805n7.T();
                            this.f11671P = null;
                            zR = h0().R(null, I.f11511N0);
                            c0773c0 = this.f11682r;
                        } catch (Throwable th2) {
                            C0805n c0805n8 = this.f11683s;
                            L(c0805n8);
                            c0805n8.T();
                            throw th2;
                        }
                    } catch (SQLiteException e10) {
                        e().f11875v.c(e10, "Database error while trying to delete uploaded bundles");
                        d().getClass();
                        this.f11661E = SystemClock.elapsedRealtime();
                        e().D.c(Long.valueOf(this.f11661E), "Disable upload, time");
                    }
                    if (!zR) {
                        L(c0773c0);
                        if (c0773c0.d0()) {
                            C0805n c0805n9 = this.f11683s;
                            L(c0805n9);
                            if (c0805n9.d0(str)) {
                                Z(str);
                            } else {
                                L(c0773c0);
                                if (c0773c0.d0() && H()) {
                                    X();
                                } else {
                                    this.f11672Q = -1L;
                                    F();
                                }
                            }
                            this.f11661E = 0L;
                            z10 = false;
                        }
                    }
                } else {
                    this.f11689y.f12208y.h(0L);
                    F();
                    if (z8) {
                    }
                    C0805n c0805n10 = this.f11683s;
                    L(c0805n10);
                    c0805n10.P();
                    if (h0().R(null, I.f11511N0)) {
                    }
                    size = arrayList.size();
                    i5 = 0;
                    while (i5 < size) {
                    }
                    C0805n c0805n62 = this.f11683s;
                    L(c0805n62);
                    c0805n62.Z();
                    C0805n c0805n72 = this.f11683s;
                    L(c0805n72);
                    c0805n72.T();
                    this.f11671P = null;
                    zR = h0().R(null, I.f11511N0);
                    c0773c0 = this.f11682r;
                    if (!zR) {
                    }
                }
            } else if (i8 != 200) {
                if (i8 == 204) {
                    i8 = 204;
                    if (iOException == null) {
                    }
                }
                String str5 = new String(bArr2, StandardCharsets.UTF_8);
                e().f11869A.e("Network upload failed. Will retry later. code, error", Integer.valueOf(i8), iOException, str5.substring(0, Math.min(32, str5.length())));
                B0.s0 s0Var2 = this.f11689y.f12208y;
                d().getClass();
                s0Var2.h(System.currentTimeMillis());
                if (i8 != 503) {
                    B0.s0 s0Var3 = this.f11689y.f12206w;
                    d().getClass();
                    s0Var3.h(System.currentTimeMillis());
                    C0805n c0805n11 = this.f11683s;
                    L(c0805n11);
                    c0805n11.U(arrayList);
                    F();
                    z10 = false;
                }
            } else if (iOException == null) {
                String str52 = new String(bArr2, StandardCharsets.UTF_8);
                e().f11869A.e("Network upload failed. Will retry later. code, error", Integer.valueOf(i8), iOException, str52.substring(0, Math.min(32, str52.length())));
                B0.s0 s0Var22 = this.f11689y.f12208y;
                d().getClass();
                s0Var22.h(System.currentTimeMillis());
                if (i8 != 503 || i8 == 429) {
                    B0.s0 s0Var32 = this.f11689y.f12206w;
                    d().getClass();
                    s0Var32.h(System.currentTimeMillis());
                }
                C0805n c0805n112 = this.f11683s;
                L(c0805n112);
                c0805n112.U(arrayList);
                F();
                z10 = false;
            }
            this.f11666K = z10;
            C();
        } catch (Throwable th3) {
            th = th3;
            z9 = false;
            this.f11666K = z9;
            C();
            throw th;
        }
    }

    public final long v() {
        d().getClass();
        long jCurrentTimeMillis = System.currentTimeMillis();
        C0830v1 c0830v1 = this.f11689y;
        c0830v1.F();
        c0830v1.E();
        B0.s0 s0Var = c0830v1.f12209z;
        long jG = s0Var.g();
        if (jG == 0) {
            W1 w12 = ((C0817r0) c0830v1.f5146q).f12122B;
            C0817r0.i(w12);
            jG = ((long) w12.Q().nextInt(86400000)) + 1;
            s0Var.h(jG);
        }
        return ((((jCurrentTimeMillis + jG) / 1000) / 60) / 60) / 24;
    }

    /* JADX WARN: Removed duplicated region for block: B:15:0x003e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int y(String str, P.g gVar) {
        C0 c0R;
        C0803m0 c0803m0 = this.f11681q;
        com.google.android.gms.internal.measurement.B0 b0S = c0803m0.S(str);
        E0 e02 = E0.f11450u;
        if (b0S == null) {
            gVar.z(e02, EnumC0787h.FAILSAFE);
            return 1;
        }
        C0805n c0805n = this.f11683s;
        L(c0805n);
        V vB0 = c0805n.B0(str);
        if (vB0 != null) {
            if (((C0) P.g.w(vB0.h()).f5246r) != C0.f11432s || (c0R = c0803m0.R(str, e02)) == C0.f11431r) {
                gVar.z(e02, EnumC0787h.REMOTE_DEFAULT);
                if (c0803m0.V(str, e02)) {
                    return 0;
                }
            } else {
                gVar.z(e02, EnumC0787h.REMOTE_ENFORCED_DEFAULT);
                if (c0R == C0.f11434u) {
                    return 0;
                }
            }
        }
        return 1;
    }

    public final X1 z(String str) {
        C0805n c0805n = this.f11683s;
        L(c0805n);
        V vB0 = c0805n.B0(str);
        if (vB0 == null || TextUtils.isEmpty(vB0.e())) {
            e().f11871C.c(str, "No app data available; dropping");
            return null;
        }
        Boolean boolA = A(vB0);
        if (boolA != null && !boolA.booleanValue()) {
            Z zE = e();
            zE.f11875v.c(Z.M(str), "App version does not match; dropping. appId");
            return null;
        }
        String strG = vB0.g();
        String strE = vB0.e();
        long jS = vB0.S();
        C0817r0 c0817r0 = vB0.f11758a;
        C0815q0 c0815q0 = c0817r0.f12151z;
        C0817r0.k(c0815q0);
        c0815q0.E();
        String str2 = vB0.f11768l;
        C0815q0 c0815q02 = c0817r0.f12151z;
        C0817r0.k(c0815q02);
        c0815q02.E();
        long j8 = vB0.f11769m;
        C0815q0 c0815q03 = c0817r0.f12151z;
        C0817r0.k(c0815q03);
        c0815q03.E();
        long j9 = vB0.f11770n;
        C0815q0 c0815q04 = c0817r0.f12151z;
        C0817r0.k(c0815q04);
        c0815q04.E();
        boolean z8 = vB0.f11771o;
        String strF = vB0.f();
        C0815q0 c0815q05 = c0817r0.f12151z;
        C0817r0.k(c0815q05);
        c0815q05.E();
        boolean z9 = vB0.f11772p;
        String strA = vB0.a();
        Boolean boolU = vB0.U();
        long jT = vB0.T();
        C0815q0 c0815q06 = c0817r0.f12151z;
        C0817r0.k(c0815q06);
        c0815q06.E();
        ArrayList arrayList = vB0.f11776t;
        String strJ = n0(str).j();
        boolean zT = vB0.t();
        C0815q0 c0815q07 = c0817r0.f12151z;
        C0817r0.k(c0815q07);
        c0815q07.E();
        long j10 = vB0.f11779w;
        F0 f0N0 = n0(str);
        String str3 = k0(str).f12091b;
        C0815q0 c0815q08 = c0817r0.f12151z;
        C0817r0.k(c0815q08);
        c0815q08.E();
        int i = vB0.f11781y;
        C0815q0 c0815q09 = c0817r0.f12151z;
        C0817r0.k(c0815q09);
        c0815q09.E();
        return new X1(str, strG, strE, jS, str2, j8, j9, (String) null, z8, false, strF, 0L, 0, z9, false, strA, boolU, jT, (List) arrayList, (String) null, strJ, "", (String) null, zT, j10, f0N0.f11459b, str3, i, vB0.f11742C, vB0.i(), vB0.h(), 0L, vB0.R());
    }
}
