package p138.p176.p177.p242.p265.p266;

import android.app.job.JobInfo;
import android.content.ComponentName;
import android.content.Context;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
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.PersistableBundle;
import android.os.SystemClock;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Pair;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.MalformedURLException;
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.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeSet;
import p000.p001.p002.p003.p004.C0567;
import p037.p057.C1714;
import p138.p176.p177.p242.p246.p253.C4312;
import p138.p176.p177.p242.p246.p253.InterfaceC4311;
import p138.p176.p177.p242.p246.p255.C4322;
import p138.p176.p177.p242.p258.p263.AbstractC4421;
import p138.p176.p177.p242.p258.p263.C4378;
import p138.p176.p177.p242.p258.p263.C4473;
import p138.p176.p177.p242.p258.p263.C4523;
import p138.p176.p177.p242.p258.p263.C4538;
import p138.p176.p177.p242.p258.p263.C4602;
import p138.p176.p177.p242.p258.p263.C4606;
import p138.p176.p177.p242.p258.p263.C4634;
import p138.p176.p177.p242.p258.p263.C4638;
import p138.p176.p177.p242.p258.p263.C4640;
import p138.p176.p177.p242.p258.p263.C4642;
import p138.p176.p177.p242.p258.p263.C4665;
import p138.p176.p177.p242.p258.p263.InterfaceC4389;

/* JADX INFO: renamed from: ދ.ހ.֏.ހ.ބ.֏.ہ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C4889 implements InterfaceC4973 {

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public static volatile C4889 f14709;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C4816 f14710;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public C5039 f14711;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public C4900 f14712;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public C4799 f14713;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public C4866 f14714;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public C4957 f14715;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final C4833 f14716;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public C4946 f14717;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final C4974 f14718;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public boolean f14719 = false;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public boolean f14720;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public long f14721;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public List<Runnable> f14722;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public int f14723;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public int f14724;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public boolean f14725;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public boolean f14726;

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public boolean f14727;

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public FileLock f14728;

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public FileChannel f14729;

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public List<Long> f14730;

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public List<Long> f14731;

    /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
    public long f14732;

    /* JADX INFO: renamed from: ދ.ހ.֏.ހ.ބ.֏.ہ$֏, reason: contains not printable characters */
    public class C4890 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public C4642 f14733;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public List<Long> f14734;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public List<C4634> f14735;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public long f14736;

        public /* synthetic */ C4890(C4889 c4889, RunnableC4885 runnableC4885) {
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final void m8314(C4642 c4642) {
            C0567.m1910(c4642);
            this.f14733 = c4642;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final boolean m8315(long j, C4634 c4634) {
            C0567.m1910(c4634);
            if (this.f14735 == null) {
                this.f14735 = new ArrayList();
            }
            if (this.f14734 == null) {
                this.f14734 = new ArrayList();
            }
            if (this.f14735.size() > 0 && ((this.f14735.get(0).zzf / 1000) / 60) / 60 != ((c4634.zzf / 1000) / 60) / 60) {
                return false;
            }
            long jMo7364 = this.f14736 + ((long) c4634.mo7364());
            if (jMo7364 >= Math.max(0, C4915.f14836.m8054(null).intValue())) {
                return false;
            }
            this.f14736 = jMo7364;
            this.f14735.add(c4634);
            this.f14734.add(Long.valueOf(j));
            return this.f14735.size() < Math.max(1, C4915.f14837.m8054(null).intValue());
        }
    }

    public C4889(C4996 c4996) {
        C0567.m1910(c4996);
        this.f14718 = C4974.m8490(c4996.f15111, null, null);
        this.f14732 = -1L;
        C4833 c4833 = new C4833(this);
        c4833.m8156();
        this.f14716 = c4833;
        C5039 c5039 = new C5039(this);
        c5039.m8156();
        this.f14711 = c5039;
        C4816 c4816 = new C4816(this);
        c4816.m8156();
        this.f14710 = c4816;
        C4771 c4771Mo8163 = this.f14718.mo8163();
        RunnableC4885 runnableC4885 = new RunnableC4885(this, c4996);
        c4771Mo8163.m8482();
        C0567.m1910(runnableC4885);
        c4771Mo8163.m8005(new C4894<>(c4771Mo8163, runnableC4885, "Task exception on worker thread"));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C4889 m8276(Context context) {
        C0567.m1910(context);
        C0567.m1910(context.getApplicationContext());
        if (f14709 == null) {
            synchronized (C4889.class) {
                if (f14709 == null) {
                    f14709 = new C4889(new C4996(context));
                }
            }
        }
        return f14709;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m8277(C4634.C4635 c4635, int i, String str) {
        List<C4638> listM7658 = c4635.m7658();
        for (int i2 = 0; i2 < listM7658.size(); i2++) {
            if ("_err".equals(listM7658.get(i2).zzd)) {
                return;
            }
        }
        C4638.C4639 c4639M7674 = C4638.m7674();
        c4639M7674.m7686("_err");
        c4639M7674.m7684(Long.valueOf(i).longValue());
        C4638 c4638 = (C4638) ((AbstractC4421) c4639M7674.m7370());
        C4638.C4639 c4639M76742 = C4638.m7674();
        c4639M76742.m7686("_ev");
        c4639M76742.m7687(str);
        C4638 c46382 = (C4638) ((AbstractC4421) c4639M76742.m7370());
        if (c4635.f13775) {
            c4635.m7368();
            c4635.f13775 = false;
        }
        C4634.m7652((C4634) c4635.f13774, c4638);
        if (c4635.f13775) {
            c4635.m7368();
            c4635.f13775 = false;
        }
        C4634.m7652((C4634) c4635.f13774, c46382);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m8278(C4634.C4635 c4635, String str) {
        List<C4638> listM7658 = c4635.m7658();
        for (int i = 0; i < listM7658.size(); i++) {
            if (str.equals(listM7658.get(i).zzd)) {
                c4635.m7664(i);
                return;
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m8279(C4642.C4643 c4643) {
        c4643.m7732(Long.MAX_VALUE);
        c4643.m7736(Long.MIN_VALUE);
        for (int i = 0; i < c4643.m7763(); i++) {
            C4634 c4634M7720 = c4643.m7720(i);
            if (c4634M7720.zzf < c4643.m7769()) {
                c4643.m7732(c4634M7720.zzf);
            }
            if (c4634M7720.zzf > c4643.m7770()) {
                c4643.m7736(c4634M7720.zzf);
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m8280(AbstractC4843 abstractC4843) {
        if (abstractC4843 == null) {
            throw new IllegalStateException("Upload Component not created");
        }
        if (abstractC4843.f14568) {
            return;
        }
        String strValueOf = String.valueOf(abstractC4843.getClass());
        StringBuilder sb = new StringBuilder(strValueOf.length() + 27);
        sb.append("Component not initialized: ");
        sb.append(strValueOf);
        throw new IllegalStateException(sb.toString());
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final C4977 m8281(String str) throws Throwable {
        C4755 c4755M8343 = m8301().m8343(str);
        if (c4755M8343 == null || TextUtils.isEmpty(c4755M8343.m7955())) {
            this.f14718.mo8165().f14451.m8035("No app data available; dropping", str);
            return null;
        }
        Boolean boolM8292 = m8292(c4755M8343);
        if (boolM8292 == null || boolM8292.booleanValue()) {
            return new C4977(str, c4755M8343.m7945(), c4755M8343.m7955(), c4755M8343.m7956(), c4755M8343.m7957(), c4755M8343.m7958(), c4755M8343.m7959(), (String) null, c4755M8343.m7961(), false, c4755M8343.m7952(), c4755M8343.m7922(), 0L, 0, c4755M8343.m7929(), c4755M8343.m7932(), false, c4755M8343.m7948(), c4755M8343.m7933(), c4755M8343.m7960(), c4755M8343.m7936(), (C4538.m7580() && this.f14718.f15015.m8183(str, C4915.f14896)) ? c4755M8343.m7950() : null);
        }
        this.f14718.mo8165().f14444.m8035("App version does not match; dropping. appId", C4794.m8038(str));
        return null;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m8282() {
        m8310();
        if (this.f14725 || this.f14726 || this.f14727) {
            this.f14718.mo8165().f14452.m8037("Not stopping services. fetch, network, upload", Boolean.valueOf(this.f14725), Boolean.valueOf(this.f14726), Boolean.valueOf(this.f14727));
            return;
        }
        this.f14718.mo8165().f14452.m8034("Stopping uploading service(s)");
        List<Runnable> list = this.f14722;
        if (list == null) {
            return;
        }
        Iterator<Runnable> it = list.iterator();
        while (it.hasNext()) {
            it.next().run();
        }
        this.f14722.clear();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m8283(String str, int i, Throwable th, byte[] bArr, Map<String, List<String>> map) {
        m8310();
        m8305();
        C0567.m1926(str);
        if (bArr == null) {
            try {
                bArr = new byte[0];
            } finally {
                this.f14725 = false;
                m8282();
            }
        }
        this.f14718.mo8165().f14452.m8035("onConfigFetched. Response size", Integer.valueOf(bArr.length));
        m8301().m8358();
        try {
            C4755 c4755M8343 = m8301().m8343(str);
            boolean z = true;
            boolean z2 = (i == 200 || i == 204 || i == 304) && th == null;
            if (c4755M8343 == null) {
                this.f14718.mo8165().f14447.m8035("App does not exist in onConfigFetched. appId", C4794.m8038(str));
            } else if (z2 || i == 404) {
                List<String> list = map != null ? map.get("Last-Modified") : null;
                String str2 = (list == null || list.size() <= 0) ? null : list.get(0);
                if (i == 404 || i == 304) {
                    if (m8294().m8070(str) == null && !m8294().m8073(str, null, null)) {
                        return;
                    }
                } else if (!m8294().m8073(str, bArr, str2)) {
                    return;
                }
                if (((C4312) this.f14718.f15022) == null) {
                    throw null;
                }
                c4755M8343.m7943(System.currentTimeMillis());
                m8301().m8331(c4755M8343);
                if (i == 404) {
                    this.f14718.mo8165().f14449.m8035("Config not found. Using empty config. appId", str);
                } else {
                    this.f14718.mo8165().f14452.m8036("Successfully fetched config. Got network response. code, size", Integer.valueOf(i), Integer.valueOf(bArr.length));
                }
                if (m8299().m8534() && m8312()) {
                    m8306();
                } else {
                    m8313();
                }
            } else {
                if (((C4312) this.f14718.f15022) == null) {
                    throw null;
                }
                c4755M8343.m7946(System.currentTimeMillis());
                m8301().m8331(c4755M8343);
                this.f14718.mo8165().f14452.m8036("Fetching config failed. code, error", Integer.valueOf(i), th);
                C4816 c4816M8294 = m8294();
                c4816M8294.mo8008();
                c4816M8294.f14491.put(str, null);
                C4898 c4898 = this.f14718.m8501().f14649;
                if (((C4312) this.f14718.f15022) == null) {
                    throw null;
                }
                c4898.m8317(System.currentTimeMillis());
                if (i != 503 && i != 429) {
                    z = false;
                }
                if (z) {
                    C4898 c48982 = this.f14718.m8501().f14650;
                    if (((C4312) this.f14718.f15022) == null) {
                        throw null;
                    }
                    c48982.m8317(System.currentTimeMillis());
                }
                m8313();
            }
            m8301().m8353();
        } finally {
            m8301().m8359();
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m8284(C4642.C4643 c4643, long j, boolean z) throws Throwable {
        C5036 c5036;
        boolean z2;
        String str = z ? "_se" : "_lte";
        C5036 c5036M8346 = m8301().m8346(c4643.m7773(), str);
        if (c5036M8346 == null || c5036M8346.f15175 == null) {
            String strM7773 = c4643.m7773();
            if (((C4312) this.f14718.f15022) == null) {
                throw null;
            }
            c5036 = new C5036(strM7773, "auto", str, System.currentTimeMillis(), Long.valueOf(j));
        } else {
            String strM77732 = c4643.m7773();
            if (((C4312) this.f14718.f15022) == null) {
                throw null;
            }
            c5036 = new C5036(strM77732, "auto", str, System.currentTimeMillis(), Long.valueOf(((Long) c5036M8346.f15175).longValue() + j));
        }
        C4665.C4666 c4666M7799 = C4665.m7799();
        c4666M7799.m7802(str);
        if (((C4312) this.f14718.f15022) == null) {
            throw null;
        }
        c4666M7799.m7801(System.currentTimeMillis());
        c4666M7799.m7803(((Long) c5036.f15175).longValue());
        C4665 c4665 = (C4665) ((AbstractC4421) c4666M7799.m7370());
        int iM8117 = C4833.m8117(c4643, str);
        if (iM8117 >= 0) {
            if (c4643.f13775) {
                c4643.m7368();
                c4643.f13775 = false;
            }
            C4642.m7693((C4642) c4643.f13774, iM8117, c4665);
            z2 = true;
        } else {
            z2 = false;
        }
        if (!z2) {
            if (c4643.f13775) {
                c4643.m7368();
                c4643.f13775 = false;
            }
            C4642.m7697((C4642) c4643.f13774, c4665);
        }
        if (j > 0) {
            m8301().m8340(c5036);
            this.f14718.mo8165().f14452.m8036("Updated engagement user property. scope, value", z ? "session-scoped" : "lifetime", c5036.f15175);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:30:0x009d  */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m8285(C4755 c4755) throws Throwable {
        m8310();
        if (C4538.m7580() && this.f14718.f15015.m8183(c4755.m7939(), C4915.f14896)) {
            if (TextUtils.isEmpty(c4755.m7945()) && TextUtils.isEmpty(c4755.m7950()) && TextUtils.isEmpty(c4755.m7948())) {
                m8283(c4755.m7939(), 204, null, null, null);
                return;
            }
        } else if (TextUtils.isEmpty(c4755.m7945()) && TextUtils.isEmpty(c4755.m7948())) {
            m8283(c4755.m7939(), 204, null, null, null);
            return;
        }
        C4869 c4869 = this.f14718.f15015;
        C1714 c1714 = null;
        if (c4869 == null) {
            throw null;
        }
        Uri.Builder builder = new Uri.Builder();
        String strM7945 = c4755.m7945();
        if (TextUtils.isEmpty(strM7945)) {
            if (C4538.m7580() && c4869.f14588.f15015.m8183(c4755.m7939(), C4915.f14896)) {
                strM7945 = c4755.m7950();
                if (TextUtils.isEmpty(strM7945)) {
                }
            } else {
                strM7945 = c4755.m7948();
            }
        }
        Uri.Builder builderEncodedAuthority = builder.scheme(C4915.f14832.m8054(null)).encodedAuthority(C4915.f14833.m8054(null));
        String strValueOf = String.valueOf(strM7945);
        Uri.Builder builderAppendQueryParameter = builderEncodedAuthority.path(strValueOf.length() != 0 ? "config/app/".concat(strValueOf) : new String("config/app/")).appendQueryParameter("app_instance_id", c4755.m7942()).appendQueryParameter("platform", "android");
        c4869.m8186();
        builderAppendQueryParameter.appendQueryParameter("gmp_version", String.valueOf(28000L));
        String string = builder.build().toString();
        try {
            URL url = new URL(string);
            this.f14718.mo8165().f14452.m8035("Fetching remote configuration", c4755.m7939());
            C4602 c4602M8070 = m8294().m8070(c4755.m7939());
            C4816 c4816M8294 = m8294();
            String strM7939 = c4755.m7939();
            c4816M8294.mo8008();
            String str = c4816M8294.f14491.get(strM7939);
            if (c4602M8070 != null && !TextUtils.isEmpty(str)) {
                c1714 = new C1714();
                c1714.put("If-Modified-Since", str);
            }
            this.f14725 = true;
            C5039 c5039M8299 = m8299();
            String strM79392 = c4755.m7939();
            C4788 c4788 = new C4788(this);
            c5039M8299.mo8008();
            c5039M8299.m8155();
            C0567.m1910(url);
            C0567.m1910(c4788);
            c5039M8299.mo8163().m8007(new RunnableC4819(c5039M8299, strM79392, url, null, c1714, c4788));
        } catch (MalformedURLException unused) {
            this.f14718.mo8165().f14444.m8036("Failed to parse config URL. Not fetching. appId", C4794.m8038(c4755.m7939()), string);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m8286(C4891 c4891, C4977 c4977) throws Throwable {
        C0567.m1910(c4891);
        C0567.m1926(c4891.f14737);
        C0567.m1910(c4891.f14738);
        C0567.m1910(c4891.f14739);
        C0567.m1926(c4891.f14739.f15117);
        m8310();
        m8305();
        if (m8300(c4977)) {
            if (!c4977.f15056) {
                m8293(c4977);
                return;
            }
            C4891 c48912 = new C4891(c4891);
            boolean z = false;
            c48912.f14741 = false;
            m8301().m8358();
            try {
                C4891 c4891M8348 = m8301().m8348(c48912.f14737, c48912.f14739.f15117);
                if (c4891M8348 != null && !c4891M8348.f14738.equals(c48912.f14738)) {
                    this.f14718.mo8165().f14447.m8037("Updating a conditional user property with different origin. name, origin, origin (from DB)", this.f14718.m8505().m8114(c48912.f14739.f15117), c48912.f14738, c4891M8348.f14738);
                }
                if (c4891M8348 != null && c4891M8348.f14741) {
                    c48912.f14738 = c4891M8348.f14738;
                    c48912.f14740 = c4891M8348.f14740;
                    c48912.f14744 = c4891M8348.f14744;
                    c48912.f14742 = c4891M8348.f14742;
                    c48912.f14745 = c4891M8348.f14745;
                    c48912.f14741 = c4891M8348.f14741;
                    c48912.f14739 = new C4999(c48912.f14739.f15117, c4891M8348.f14739.f15118, c48912.f14739.m8527(), c4891M8348.f14739.f15121);
                } else if (TextUtils.isEmpty(c48912.f14742)) {
                    c48912.f14739 = new C4999(c48912.f14739.f15117, c48912.f14740, c48912.f14739.m8527(), c48912.f14739.f15121);
                    c48912.f14741 = true;
                    z = true;
                }
                if (c48912.f14741) {
                    C4999 c4999 = c48912.f14739;
                    C5036 c5036 = new C5036(c48912.f14737, c48912.f14738, c4999.f15117, c4999.f15118, c4999.m8527());
                    if (m8301().m8340(c5036)) {
                        this.f14718.mo8165().f14451.m8037("User property updated immediately", c48912.f14737, this.f14718.m8505().m8114(c5036.f15173), c5036.f15175);
                    } else {
                        this.f14718.mo8165().f14444.m8037("(2)Too many active user properties, ignoring", C4794.m8038(c48912.f14737), this.f14718.m8505().m8114(c5036.f15173), c5036.f15175);
                    }
                    if (z && c48912.f14745 != null) {
                        m8297(new C4913(c48912.f14745, c48912.f14740), c4977);
                    }
                }
                if (m8301().m8338(c48912)) {
                    this.f14718.mo8165().f14451.m8037("Conditional property added", c48912.f14737, this.f14718.m8505().m8114(c48912.f14739.f15117), c48912.f14739.m8527());
                } else {
                    this.f14718.mo8165().f14444.m8037("Too many conditional properties, ignoring", C4794.m8038(c48912.f14737), this.f14718.m8505().m8114(c48912.f14739.f15117), c48912.f14739.m8527());
                }
                m8301().m8353();
            } finally {
                m8301().m8359();
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m8287(C4913 c4913, C4977 c4977) throws Throwable {
        List<C4891> listM8326;
        List<C4891> listM83262;
        List<C4891> listM83263;
        List<String> list;
        C4913 c49132 = c4913;
        C0567.m1910(c4977);
        C0567.m1926(c4977.f15049);
        m8310();
        m8305();
        String str = c4977.f15049;
        long j = c49132.f14825;
        m8303();
        if (C4833.m8127(c4913, c4977)) {
            if (!c4977.f15056) {
                m8293(c4977);
                return;
            }
            if (this.f14718.f15015.m8183(str, C4915.f14884) && (list = c4977.f15069) != null) {
                if (!list.contains(c49132.f14822)) {
                    this.f14718.mo8165().f14451.m8037("Dropping non-safelisted event. appId, event name, origin", str, c49132.f14822, c49132.f14824);
                    return;
                } else {
                    Bundle bundleM8371 = c49132.f14823.m8371();
                    bundleM8371.putLong("ga_safelisted", 1L);
                    c49132 = new C4913(c49132.f14822, new C4908(bundleM8371), c49132.f14824, c49132.f14825);
                }
            }
            m8301().m8358();
            try {
                C4900 c4900M8301 = m8301();
                C0567.m1926(str);
                c4900M8301.mo8008();
                c4900M8301.m8155();
                if (j < 0) {
                    c4900M8301.mo8165().f14447.m8036("Invalid time querying timed out conditional properties", C4794.m8038(str), Long.valueOf(j));
                    listM8326 = Collections.emptyList();
                } else {
                    listM8326 = c4900M8301.m8326("active=0 and app_id=? and abs(? - creation_timestamp) > trigger_timeout", new String[]{str, String.valueOf(j)});
                }
                for (C4891 c4891 : listM8326) {
                    if (c4891 != null) {
                        this.f14718.mo8165().f14452.m8037("User property timed out", c4891.f14737, this.f14718.m8505().m8114(c4891.f14739.f15117), c4891.f14739.m8527());
                        if (c4891.f14743 != null) {
                            m8297(new C4913(c4891.f14743, j), c4977);
                        }
                        m8301().m8349(str, c4891.f14739.f15117);
                    }
                }
                C4900 c4900M83012 = m8301();
                C0567.m1926(str);
                c4900M83012.mo8008();
                c4900M83012.m8155();
                if (j < 0) {
                    c4900M83012.mo8165().f14447.m8036("Invalid time querying expired conditional properties", C4794.m8038(str), Long.valueOf(j));
                    listM83262 = Collections.emptyList();
                } else {
                    listM83262 = c4900M83012.m8326("active<>0 and app_id=? and abs(? - triggered_timestamp) > time_to_live", new String[]{str, String.valueOf(j)});
                }
                ArrayList arrayList = new ArrayList(listM83262.size());
                for (C4891 c48912 : listM83262) {
                    if (c48912 != null) {
                        this.f14718.mo8165().f14452.m8037("User property expired", c48912.f14737, this.f14718.m8505().m8114(c48912.f14739.f15117), c48912.f14739.m8527());
                        m8301().m8344(str, c48912.f14739.f15117);
                        if (c48912.f14747 != null) {
                            arrayList.add(c48912.f14747);
                        }
                        m8301().m8349(str, c48912.f14739.f15117);
                    }
                }
                int size = arrayList.size();
                int i = 0;
                while (i < size) {
                    Object obj = arrayList.get(i);
                    i++;
                    m8297(new C4913((C4913) obj, j), c4977);
                }
                C4900 c4900M83013 = m8301();
                String str2 = c49132.f14822;
                C0567.m1926(str);
                C0567.m1926(str2);
                c4900M83013.mo8008();
                c4900M83013.m8155();
                if (j < 0) {
                    c4900M83013.mo8165().f14447.m8037("Invalid time querying triggered conditional properties", C4794.m8038(str), c4900M83013.m8161().m8110(str2), Long.valueOf(j));
                    listM83263 = Collections.emptyList();
                } else {
                    listM83263 = c4900M83013.m8326("active=0 and app_id=? and trigger_event_name=? and abs(? - creation_timestamp) <= trigger_timeout", new String[]{str, str2, String.valueOf(j)});
                }
                ArrayList arrayList2 = new ArrayList(listM83263.size());
                for (C4891 c48913 : listM83263) {
                    if (c48913 != null) {
                        C4999 c4999 = c48913.f14739;
                        C5036 c5036 = new C5036(c48913.f14737, c48913.f14738, c4999.f15117, j, c4999.m8527());
                        if (m8301().m8340(c5036)) {
                            this.f14718.mo8165().f14452.m8037("User property triggered", c48913.f14737, this.f14718.m8505().m8114(c5036.f15173), c5036.f15175);
                        } else {
                            this.f14718.mo8165().f14444.m8037("Too many active user properties, ignoring", C4794.m8038(c48913.f14737), this.f14718.m8505().m8114(c5036.f15173), c5036.f15175);
                        }
                        if (c48913.f14745 != null) {
                            arrayList2.add(c48913.f14745);
                        }
                        c48913.f14739 = new C4999(c5036);
                        c48913.f14741 = true;
                        m8301().m8338(c48913);
                    }
                }
                m8297(c49132, c4977);
                int size2 = arrayList2.size();
                int i2 = 0;
                while (i2 < size2) {
                    Object obj2 = arrayList2.get(i2);
                    i2++;
                    m8297(new C4913((C4913) obj2, j), c4977);
                }
                m8301().m8353();
            } finally {
                m8301().m8359();
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:75:0x0209  */
    /* JADX WARN: Removed duplicated region for block: B:78:0x020d A[Catch: all -> 0x04a6, TryCatch #0 {all -> 0x04a6, blocks: (B:28:0x00ad, B:30:0x00bb, B:48:0x011d, B:50:0x0129, B:52:0x0140, B:53:0x0166, B:55:0x01b0, B:58:0x01c1, B:61:0x01d3, B:63:0x01de, B:68:0x01ed, B:70:0x01f5, B:72:0x01fb, B:76:0x020a, B:78:0x020d, B:80:0x0231, B:82:0x0236, B:88:0x0256, B:91:0x026a, B:93:0x028b, B:94:0x0297, B:96:0x02c8, B:98:0x02d0, B:100:0x02d4, B:101:0x02d7, B:103:0x02f6, B:142:0x03c6, B:143:0x03c9, B:154:0x0438, B:156:0x0446, B:158:0x045e, B:159:0x0465, B:163:0x0497, B:105:0x030d, B:110:0x0334, B:112:0x033c, B:114:0x0346, B:118:0x0358, B:122:0x0366, B:126:0x0371, B:129:0x0383, B:134:0x03aa, B:136:0x03b0, B:137:0x03b5, B:139:0x03bb, B:132:0x0394, B:119:0x035e, B:108:0x031e, B:146:0x03e1, B:148:0x0415, B:150:0x041d, B:152:0x0421, B:153:0x0424, B:160:0x047a, B:162:0x047e, B:85:0x0246, B:34:0x00ca, B:36:0x00ce, B:40:0x00df, B:42:0x00f9, B:44:0x0103, B:47:0x010d), top: B:169:0x00ad, inners: #1, #2, #3 }] */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m8288(C4977 c4977) throws Throwable {
        int i;
        String str;
        int i2;
        String str2;
        long j;
        long j2;
        PackageInfo packageInfoM7222;
        String str3;
        ApplicationInfo applicationInfoM7220;
        boolean z;
        boolean z2;
        m8310();
        m8305();
        C0567.m1910(c4977);
        C0567.m1926(c4977.f15049);
        if (m8300(c4977)) {
            C4755 c4755M8343 = m8301().m8343(c4977.f15049);
            if (c4755M8343 != null && TextUtils.isEmpty(c4755M8343.m7945()) && !TextUtils.isEmpty(c4977.f15050)) {
                c4755M8343.m7943(0L);
                m8301().m8331(c4755M8343);
                C4816 c4816M8294 = m8294();
                String str4 = c4977.f15049;
                c4816M8294.mo8008();
                c4816M8294.f14489.remove(str4);
            }
            if (!c4977.f15056) {
                m8293(c4977);
                return;
            }
            long jCurrentTimeMillis = c4977.f15061;
            if (jCurrentTimeMillis == 0) {
                if (((C4312) this.f14718.f15022) == null) {
                    throw null;
                }
                jCurrentTimeMillis = System.currentTimeMillis();
            }
            C4907 c4907M8509 = this.f14718.m8509();
            c4907M8509.mo8008();
            c4907M8509.f14806 = null;
            c4907M8509.f14807 = 0L;
            int i3 = c4977.f15062;
            if (i3 == 0 || i3 == 1) {
                i = i3;
            } else {
                this.f14718.mo8165().f14447.m8036("Incorrect app type, assuming installed app. appId, appType", C4794.m8038(c4977.f15049), Integer.valueOf(i3));
                i = 0;
            }
            m8301().m8358();
            try {
                C5036 c5036M8346 = m8301().m8346(c4977.f15049, "_npa");
                if (c5036M8346 != null && !"auto".equals(c5036M8346.f15172)) {
                    str = "_sysu";
                    i2 = 1;
                } else if (c4977.f15067 != null) {
                    str = "_sysu";
                    i2 = 1;
                    C4999 c4999 = new C4999("_npa", jCurrentTimeMillis, Long.valueOf(c4977.f15067.booleanValue() ? 1L : 0L), "auto");
                    if (c5036M8346 == null || !c5036M8346.f15175.equals(c4999.f15119)) {
                        m8289(c4999, c4977);
                    }
                } else {
                    str = "_sysu";
                    i2 = 1;
                    if (c5036M8346 != null) {
                        m8298(new C4999("_npa", jCurrentTimeMillis, null, "auto"), c4977);
                    }
                }
                C4755 c4755M83432 = m8301().m8343(c4977.f15049);
                if (c4755M83432 != null) {
                    this.f14718.m8504();
                    if (C4887.m8226(c4977.f15050, c4755M83432.m7945(), c4977.f15066, c4755M83432.m7948())) {
                        this.f14718.mo8165().f14447.m8035("New GMP App Id passed in. Removing cached database data. appId", C4794.m8038(c4755M83432.m7939()));
                        C4900 c4900M8301 = m8301();
                        String strM7939 = c4755M83432.m7939();
                        c4900M8301.m8155();
                        c4900M8301.mo8008();
                        C0567.m1926(strM7939);
                        try {
                            SQLiteDatabase sQLiteDatabaseM8354 = c4900M8301.m8354();
                            String[] strArr = new String[i2];
                            strArr[0] = strM7939;
                            int iDelete = sQLiteDatabaseM8354.delete("events", "app_id=?", strArr) + 0 + sQLiteDatabaseM8354.delete("user_attributes", "app_id=?", strArr) + sQLiteDatabaseM8354.delete("conditional_properties", "app_id=?", strArr) + sQLiteDatabaseM8354.delete("apps", "app_id=?", strArr) + sQLiteDatabaseM8354.delete("raw_events", "app_id=?", strArr) + sQLiteDatabaseM8354.delete("raw_events_metadata", "app_id=?", strArr) + sQLiteDatabaseM8354.delete("event_filters", "app_id=?", strArr) + sQLiteDatabaseM8354.delete("property_filters", "app_id=?", strArr) + sQLiteDatabaseM8354.delete("audience_filter_values", "app_id=?", strArr);
                            if (iDelete > 0) {
                                c4900M8301.mo8165().f14452.m8036("Deleted application data. app, records", strM7939, Integer.valueOf(iDelete));
                            }
                        } catch (SQLiteException e) {
                            c4900M8301.mo8165().f14444.m8036("Error deleting application data. appId, error", C4794.m8038(strM7939), e);
                        }
                        c4755M83432 = null;
                    }
                }
                if (c4755M83432 != null) {
                    if (c4755M83432.m7956() != -2147483648L) {
                        str2 = "_sys";
                        z2 = c4755M83432.m7956() != c4977.f15058;
                        if (z2 | ((c4755M83432.m7956() == -2147483648L || c4755M83432.m7955() == null || c4755M83432.m7955().equals(c4977.f15051)) ? false : true)) {
                            Bundle bundle = new Bundle();
                            bundle.putString("_pv", c4755M83432.m7955());
                            m8287(new C4913("_au", new C4908(bundle), "auto", jCurrentTimeMillis), c4977);
                        }
                    } else {
                        str2 = "_sys";
                    }
                    if (c4755M83432.m7956() == -2147483648L) {
                        if (z2 | ((c4755M83432.m7956() == -2147483648L || c4755M83432.m7955() == null || c4755M83432.m7955().equals(c4977.f15051)) ? false : true)) {
                        }
                    }
                } else {
                    str2 = "_sys";
                }
                m8293(c4977);
                if ((i == 0 ? m8301().m8329(c4977.f15049, "_f") : i == 1 ? m8301().m8329(c4977.f15049, "_v") : null) == null) {
                    long j3 = ((jCurrentTimeMillis / 3600000) + 1) * 3600000;
                    if (i == 0) {
                        m8289(new C4999("_fot", jCurrentTimeMillis, Long.valueOf(j3), "auto"), c4977);
                        if (this.f14718.f15015.m8183(c4977.f15050, C4915.f14872)) {
                            m8310();
                            this.f14718.f15031.m8206(c4977.f15049);
                        }
                        m8310();
                        m8305();
                        Bundle bundle2 = new Bundle();
                        bundle2.putLong("_c", 1L);
                        bundle2.putLong("_r", 1L);
                        bundle2.putLong("_uwa", 0L);
                        bundle2.putLong("_pfo", 0L);
                        bundle2.putLong(str2, 0L);
                        String str5 = str;
                        bundle2.putLong(str5, 0L);
                        if (this.f14718.f15015.m8183(c4977.f15049, C4915.f14874)) {
                            j2 = 1;
                            bundle2.putLong("_et", 1L);
                        } else {
                            j2 = 1;
                        }
                        if (c4977.f15065) {
                            bundle2.putLong("_dac", j2);
                        }
                        C4900 c4900M83012 = m8301();
                        String str6 = c4977.f15049;
                        C0567.m1926(str6);
                        c4900M83012.mo8008();
                        c4900M83012.m8155();
                        long jM8352 = c4900M83012.m8352(str6, "first_open_count");
                        if (this.f14718.f15009.getPackageManager() == null) {
                            this.f14718.mo8165().f14444.m8035("PackageManager is null, first open report might be inaccurate. appId", C4794.m8038(c4977.f15049));
                        } else {
                            try {
                                packageInfoM7222 = C4322.m7223(this.f14718.f15009).m7222(c4977.f15049, 0);
                            } catch (PackageManager.NameNotFoundException e2) {
                                this.f14718.mo8165().f14444.m8036("Package info is null, first open report might be inaccurate. appId", C4794.m8038(c4977.f15049), e2);
                                packageInfoM7222 = null;
                            }
                            if (packageInfoM7222 == null || packageInfoM7222.firstInstallTime == 0) {
                                str3 = str5;
                            } else {
                                if (packageInfoM7222.firstInstallTime != packageInfoM7222.lastUpdateTime) {
                                    if (!this.f14718.f15015.m8177(C4915.f14901) || jM8352 == 0) {
                                        bundle2.putLong("_uwa", 1L);
                                    }
                                    z = false;
                                } else {
                                    z = true;
                                }
                                str3 = str5;
                                m8289(new C4999("_fi", jCurrentTimeMillis, Long.valueOf(z ? 1L : 0L), "auto"), c4977);
                            }
                            try {
                                applicationInfoM7220 = C4322.m7223(this.f14718.f15009).m7220(c4977.f15049, 0);
                            } catch (PackageManager.NameNotFoundException e3) {
                                this.f14718.mo8165().f14444.m8036("Application info is null, first open report might be inaccurate. appId", C4794.m8038(c4977.f15049), e3);
                                applicationInfoM7220 = null;
                            }
                            if (applicationInfoM7220 != null) {
                                if ((applicationInfoM7220.flags & 1) != 0) {
                                    bundle2.putLong(str2, 1L);
                                }
                                if ((applicationInfoM7220.flags & 128) != 0) {
                                    bundle2.putLong(str3, 1L);
                                }
                            }
                        }
                        if (jM8352 >= 0) {
                            bundle2.putLong("_pfo", jM8352);
                        }
                        m8287(new C4913("_f", new C4908(bundle2), "auto", jCurrentTimeMillis), c4977);
                    } else if (i == 1) {
                        m8289(new C4999("_fvt", jCurrentTimeMillis, Long.valueOf(j3), "auto"), c4977);
                        m8310();
                        m8305();
                        Bundle bundle3 = new Bundle();
                        bundle3.putLong("_c", 1L);
                        bundle3.putLong("_r", 1L);
                        if (this.f14718.f15015.m8183(c4977.f15049, C4915.f14874)) {
                            j = 1;
                            bundle3.putLong("_et", 1L);
                        } else {
                            j = 1;
                        }
                        if (c4977.f15065) {
                            bundle3.putLong("_dac", j);
                        }
                        m8287(new C4913("_v", new C4908(bundle3), "auto", jCurrentTimeMillis), c4977);
                    }
                    if (!this.f14718.f15015.m8183(c4977.f15049, C4915.f14875)) {
                        Bundle bundle4 = new Bundle();
                        bundle4.putLong("_et", 1L);
                        if (this.f14718.f15015.m8183(c4977.f15049, C4915.f14874)) {
                            bundle4.putLong("_fr", 1L);
                        }
                        m8287(new C4913("_e", new C4908(bundle4), "auto", jCurrentTimeMillis), c4977);
                    }
                } else if (c4977.f15057) {
                    m8287(new C4913("_cd", new C4908(new Bundle()), "auto", jCurrentTimeMillis), c4977);
                }
                m8301().m8353();
            } finally {
                m8301().m8359();
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:37:0x00c1  */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m8289(C4999 c4999, C4977 c4977) throws Throwable {
        m8310();
        m8305();
        if (m8300(c4977)) {
            if (!c4977.f15056) {
                m8293(c4977);
                return;
            }
            int iM8262 = this.f14718.m8504().m8262(c4999.f15117);
            if (iM8262 != 0) {
                this.f14718.m8504();
                String strM8220 = C4887.m8220(c4999.f15117, 24, true);
                String str = c4999.f15117;
                this.f14718.m8504().m8244(iM8262, "_ev", strM8220, str != null ? str.length() : 0);
                return;
            }
            int iM8263 = this.f14718.m8504().m8263(c4999.f15117, c4999.m8527());
            if (iM8263 != 0) {
                this.f14718.m8504();
                String strM82202 = C4887.m8220(c4999.f15117, 24, true);
                Object objM8527 = c4999.m8527();
                if (objM8527 != null && ((objM8527 instanceof String) || (objM8527 instanceof CharSequence))) {
                    length = String.valueOf(objM8527).length();
                }
                this.f14718.m8504().m8244(iM8263, "_ev", strM82202, length);
                return;
            }
            Object objM8266 = this.f14718.m8504().m8266(c4999.f15117, c4999.m8527());
            if (objM8266 == null) {
                return;
            }
            if ("_sid".equals(c4999.f15117)) {
                long j = c4999.f15118;
                String str2 = c4999.f15121;
                long jLongValue = 0;
                C5036 c5036M8346 = m8301().m8346(c4977.f15049, "_sno");
                if (c5036M8346 != null) {
                    Object obj = c5036M8346.f15175;
                    if (obj instanceof Long) {
                        jLongValue = ((Long) obj).longValue();
                    } else {
                        if (c5036M8346 != null) {
                            this.f14718.mo8165().f14447.m8035("Retrieved last session number from database does not contain a valid (long) value", c5036M8346.f15175);
                        }
                        C4909 c4909M8329 = m8301().m8329(c4977.f15049, "_s");
                        if (c4909M8329 != null) {
                            jLongValue = c4909M8329.f14811;
                            this.f14718.mo8165().f14452.m8035("Backfill the session number. Last used session number", Long.valueOf(jLongValue));
                        }
                    }
                    m8289(new C4999("_sno", j, Long.valueOf(jLongValue + 1), str2), c4977);
                }
            }
            C5036 c5036 = new C5036(c4977.f15049, c4999.f15121, c4999.f15117, c4999.f15118, objM8266);
            this.f14718.mo8165().f14452.m8036("Setting user property", this.f14718.m8505().m8114(c5036.f15173), objM8266);
            m8301().m8358();
            try {
                m8293(c4977);
                boolean zM8340 = m8301().m8340(c5036);
                m8301().m8353();
                if (!zM8340) {
                    this.f14718.mo8165().f14444.m8036("Too many unique user properties are set. Ignoring user property", this.f14718.m8505().m8114(c5036.f15173), c5036.f15175);
                    this.f14718.m8504().m8244(9, (String) null, (String) null, 0);
                }
            } finally {
                m8301().m8359();
            }
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:128:0x02b7 A[Catch: all -> 0x0fc3, TRY_ENTER, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:131:0x02be A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:135:0x02c9  */
    /* JADX WARN: Removed duplicated region for block: B:137:0x02cc A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:175:0x0409  */
    /* JADX WARN: Removed duplicated region for block: B:177:0x040c  */
    /* JADX WARN: Removed duplicated region for block: B:182:0x0414  */
    /* JADX WARN: Removed duplicated region for block: B:184:0x0417  */
    /* JADX WARN: Removed duplicated region for block: B:185:0x0418  */
    /* JADX WARN: Removed duplicated region for block: B:231:0x05ea A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:265:0x06ab  */
    /* JADX WARN: Removed duplicated region for block: B:269:0x06c1 A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:322:0x0887  */
    /* JADX WARN: Removed duplicated region for block: B:325:0x0898 A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:329:0x08a8 A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:330:0x08c2 A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:345:0x0946 A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:443:0x0bf1 A[Catch: all -> 0x0fc3, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:444:0x0c04  */
    /* JADX WARN: Removed duplicated region for block: B:446:0x0c07 A[Catch: all -> 0x0fc3, TRY_LEAVE, TryCatch #3 {all -> 0x0fc3, blocks: (B:3:0x0013, B:27:0x0094, B:129:0x02ba, B:131:0x02be, B:137:0x02cc, B:138:0x02f2, B:141:0x0308, B:144:0x032e, B:146:0x0365, B:152:0x037b, B:154:0x0385, B:335:0x090e, B:156:0x03b1, B:159:0x03c9, B:188:0x042a, B:191:0x0434, B:193:0x0442, B:197:0x0489, B:194:0x045f, B:196:0x046e, B:201:0x0494, B:204:0x04c7, B:205:0x04f3, B:207:0x0520, B:209:0x0526, B:212:0x0532, B:214:0x0561, B:215:0x057e, B:217:0x0584, B:219:0x0592, B:223:0x05a6, B:220:0x059b, B:226:0x05ad, B:228:0x05b3, B:229:0x05cf, B:231:0x05ea, B:232:0x05f6, B:235:0x0600, B:241:0x0623, B:238:0x0612, B:244:0x0629, B:246:0x0635, B:248:0x0641, B:264:0x0690, B:267:0x06ad, B:269:0x06c1, B:271:0x06cd, B:274:0x06e0, B:276:0x06f1, B:278:0x06ff, B:325:0x0898, B:327:0x08a2, B:329:0x08a8, B:330:0x08c2, B:332:0x08d6, B:333:0x08f0, B:334:0x08f6, B:281:0x0732, B:283:0x0742, B:286:0x0757, B:288:0x0769, B:290:0x0777, B:294:0x079b, B:296:0x07b3, B:298:0x07bf, B:301:0x07d2, B:303:0x07e6, B:305:0x0835, B:307:0x083c, B:309:0x0842, B:312:0x0850, B:314:0x0857, B:316:0x085d, B:318:0x0866, B:319:0x0875, B:252:0x0662, B:256:0x0675, B:258:0x067b, B:261:0x0687, B:166:0x03eb, B:169:0x03f5, B:172:0x03ff, B:340:0x0927, B:342:0x0935, B:344:0x093e, B:355:0x0971, B:345:0x0946, B:347:0x094f, B:349:0x0955, B:352:0x0961, B:354:0x096b, B:356:0x0974, B:357:0x0982, B:359:0x0988, B:365:0x09a1, B:366:0x09ac, B:371:0x09b9, B:375:0x09e0, B:377:0x09ff, B:379:0x0a0d, B:381:0x0a13, B:383:0x0a1d, B:384:0x0a4c, B:386:0x0a52, B:388:0x0a60, B:392:0x0a6b, B:389:0x0a65, B:393:0x0a6e, B:395:0x0a80, B:396:0x0a83, B:404:0x0af4, B:406:0x0b10, B:407:0x0b21, B:409:0x0b25, B:411:0x0b31, B:412:0x0b3a, B:414:0x0b3e, B:416:0x0b46, B:417:0x0b53, B:418:0x0b5e, B:424:0x0b9b, B:425:0x0ba3, B:427:0x0ba9, B:429:0x0bbb, B:431:0x0bc9, B:433:0x0bcd, B:435:0x0bd7, B:437:0x0bdb, B:443:0x0bf1, B:446:0x0c07, B:372:0x09be, B:374:0x09c4, B:56:0x013a, B:81:0x01e8, B:89:0x021f, B:96:0x023d, B:128:0x02b7, B:103:0x025d, B:45:0x00ea, B:62:0x0150), top: B:580:0x0013, inners: #10 }] */
    /* JADX WARN: Removed duplicated region for block: B:448:0x0c2e A[Catch: all -> 0x0df8, TRY_ENTER, TryCatch #17 {all -> 0x0df8, blocks: (B:398:0x0abf, B:399:0x0ad4, B:401:0x0ada, B:491:0x0db8, B:420:0x0b63, B:448:0x0c2e, B:450:0x0c3a, B:452:0x0c4e, B:453:0x0c8c, B:457:0x0ca5, B:459:0x0cac, B:461:0x0cbd, B:463:0x0cc1, B:465:0x0cc5, B:467:0x0cc9, B:468:0x0cd5, B:470:0x0ce1, B:472:0x0ce7, B:474:0x0d07, B:475:0x0d10, B:490:0x0db5, B:476:0x0d28, B:478:0x0d2f, B:482:0x0d53, B:484:0x0d7f, B:485:0x0d8d, B:486:0x0d9d, B:488:0x0da5, B:479:0x0d3a, B:492:0x0dc3, B:494:0x0dd0, B:495:0x0dd6, B:496:0x0dde, B:498:0x0de4), top: B:597:0x0abf }] */
    /* JADX WARN: Removed duplicated region for block: B:560:0x0fa6  */
    /* JADX WARN: Removed duplicated region for block: B:590:0x0129 A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:60:0x014b  */
    /* JADX WARN: Type inference failed for: r2v160 */
    /* JADX WARN: Type inference failed for: r2v162 */
    /* JADX WARN: Type inference failed for: r2v172 */
    /* JADX WARN: Type inference failed for: r2v5 */
    /* JADX WARN: Type inference failed for: r2v6 */
    /* JADX WARN: Type inference failed for: r2v8, types: [android.database.Cursor] */
    /* JADX WARN: Type inference failed for: r44v0 */
    /* JADX WARN: Type inference failed for: r6v58 */
    /* JADX WARN: Type inference failed for: r6v59 */
    /* JADX WARN: Type inference failed for: r6v60 */
    /* JADX WARN: Type inference failed for: r6v62, types: [android.database.Cursor] */
    /* JADX WARN: Type inference failed for: r6v63 */
    /* JADX WARN: Type inference failed for: r6v67 */
    /* JADX WARN: Type inference failed for: r6v68 */
    /* JADX WARN: Type inference failed for: r8v0, types: [ދ.ހ.֏.ހ.ބ.֏.ڌ] */
    /* JADX WARN: Type inference failed for: r8v1 */
    /* JADX WARN: Type inference failed for: r8v104, types: [android.database.Cursor] */
    /* JADX WARN: Type inference failed for: r8v108 */
    /* JADX WARN: Type inference failed for: r8v109 */
    /* JADX WARN: Type inference failed for: r8v110 */
    /* JADX WARN: Type inference failed for: r8v111 */
    /* JADX WARN: Type inference failed for: r8v112 */
    /* JADX WARN: Type inference failed for: r8v113 */
    /* JADX WARN: Type inference failed for: r8v2 */
    /* JADX WARN: Type inference failed for: r8v6, types: [android.database.Cursor] */
    /* JADX WARN: Type inference failed for: r8v65 */
    /* JADX WARN: Type inference failed for: r8v67 */
    /* JADX WARN: Type inference failed for: r8v75 */
    /* JADX WARN: Type inference failed for: r8v76 */
    /* JADX WARN: Type inference failed for: r8v79 */
    /* JADX WARN: Type inference failed for: r8v80 */
    /* JADX WARN: Unreachable blocks removed: 2, instructions: 3 */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean m8290(long j) throws Throwable {
        Throwable th;
        ?? r8;
        Throwable th2;
        String str;
        String str2;
        String str3;
        SQLiteException sQLiteException;
        ?? r2;
        String string;
        ?? r22;
        boolean z;
        int i;
        boolean z2;
        C4890 c4890;
        C4642.C4643 c4643;
        boolean z3;
        int iM8078;
        SecureRandom secureRandom;
        C4890 c48902;
        C4642.C4643 c46432;
        long jM8216;
        int i2;
        C4642.C4643 c46433;
        C4755 c4755M8343;
        boolean z4;
        boolean z5;
        C4634.C4635 c4635;
        int i3;
        int i4;
        C4642.C4643 c46434;
        String str4;
        C4634.C4635 c46352;
        C4634.C4635 c46353;
        String str5;
        String str6;
        int i5;
        String str7;
        C4642.C4643 c46435;
        int i6;
        int i7;
        boolean z6;
        C4634.C4635 c46354;
        byte b;
        SQLiteDatabase sQLiteDatabaseM8354;
        String string2;
        ?? r82;
        ?? Query;
        ?? r6;
        String str8;
        String[] strArr;
        C4634.C4635 c46355;
        String[] strArr2;
        C4889 c4889 = this;
        String str9 = "_sc";
        String str10 = "_sn";
        m8301().m8358();
        try {
            ?? RawQuery = 0;
            RawQuery = 0;
            C4890 c48903 = new C4890(c4889, RawQuery);
            C4900 c4900M8301 = m8301();
            long j2 = c4889.f14732;
            C0567.m1910(c48903);
            c4900M8301.mo8008();
            c4900M8301.m8155();
            try {
                try {
                    try {
                        try {
                            sQLiteDatabaseM8354 = c4900M8301.m8354();
                        } catch (SQLiteException e) {
                            str = "_si";
                            str2 = "_npa";
                            str3 = "";
                            sQLiteException = e;
                        }
                        try {
                            try {
                            } catch (Throwable th3) {
                                th2 = th3;
                                r8 = RawQuery;
                            }
                        } catch (SQLiteException e2) {
                            str = "_si";
                            str2 = "_npa";
                            str3 = "";
                            ?? r44 = RawQuery;
                            sQLiteException = e2;
                            r2 = r44;
                            string = null;
                            r22 = r2;
                            c4900M8301.mo8165().m8046().m8036("Data loss. Error selecting raw event. appId", C4794.m8038(string), sQLiteException);
                            if (r22 != 0) {
                            }
                            m8301().m8359();
                            throw th;
                        }
                        if (TextUtils.isEmpty(null)) {
                            if (j2 != -1) {
                                try {
                                    strArr2 = new String[]{String.valueOf(j2), String.valueOf(j)};
                                } catch (SQLiteException e3) {
                                    sQLiteException = e3;
                                    str = "_si";
                                    str2 = "_npa";
                                    str3 = "";
                                    r2 = 0;
                                    string = null;
                                    r22 = r2;
                                    c4900M8301.mo8165().m8046().m8036("Data loss. Error selecting raw event. appId", C4794.m8038(string), sQLiteException);
                                    if (r22 != 0) {
                                    }
                                }
                            } else {
                                strArr2 = new String[]{String.valueOf(j)};
                            }
                            String str11 = j2 != -1 ? "rowid <= ? and " : "";
                            StringBuilder sb = new StringBuilder(str11.length() + 148);
                            sb.append("select app_id, metadata_fingerprint from raw_events where ");
                            sb.append(str11);
                            sb.append("app_id in (select app_id from apps where config_fetched_time >= ?) order by rowid limit 1;");
                            RawQuery = sQLiteDatabaseM8354.rawQuery(sb.toString(), strArr2);
                            if (!RawQuery.moveToFirst()) {
                                RawQuery.close();
                                str = "_si";
                                str2 = "_npa";
                                str3 = "";
                                if (!(c48903.f14735 != null || c48903.f14735.isEmpty())) {
                                    m8301().m8353();
                                    m8301().m8359();
                                    return false;
                                }
                                C4642.C4643 c4643M7363 = c48903.f14733.m7363();
                                c4643M7363.m7765();
                                boolean zM8184 = c4889.f14718.m8500().m8184(c48903.f14733.m7718(), C4915.f14875);
                                int i8 = -1;
                                boolean z7 = false;
                                int i9 = 0;
                                int i10 = 0;
                                C4634.C4635 c46356 = null;
                                C4634.C4635 c46357 = null;
                                int i11 = -1;
                                long jLongValue = 0;
                                while (true) {
                                    z = z7;
                                    i = i9;
                                    String str12 = str9;
                                    String str13 = str10;
                                    if (i10 >= c48903.f14735.size()) {
                                        break;
                                    }
                                    C4634.C4635 c4635M7363 = c48903.f14735.get(i10).m7363();
                                    int i12 = i10;
                                    if (m8294().m8075(c48903.f14733.m7718(), c4635M7363.m7667())) {
                                        c4889.f14718.mo8165().m8048().m8036("Dropping blacklisted raw event. appId", C4794.m8038(c48903.f14733.m7718()), c4889.f14718.m8505().m8110(c4635M7363.m7667()));
                                        if (!(m8294().m8079(c48903.f14733.m7718()) || m8294().m8080(c48903.f14733.m7718())) && !"_err".equals(c4635M7363.m7667())) {
                                            C4887 c4887M8504 = c4889.f14718.m8504();
                                            c48903.f14733.m7718();
                                            c4887M8504.m8244(11, "_ev", c4635M7363.m7667(), 0);
                                        }
                                        z5 = zM8184;
                                        i4 = i8;
                                        c46353 = c46357;
                                        z7 = z;
                                        i9 = i;
                                        str9 = str12;
                                        str5 = str13;
                                        str6 = str;
                                        i6 = i12;
                                        c46435 = c4643M7363;
                                    } else {
                                        z5 = zM8184;
                                        boolean zM8077 = m8294().m8077(c48903.f14733.m7718(), c4635M7363.m7667());
                                        if (zM8077) {
                                            c4635 = c46356;
                                            i3 = i11;
                                        } else {
                                            m8303();
                                            String strM7667 = c4635M7363.m7667();
                                            C0567.m1926(strM7667);
                                            i3 = i11;
                                            int iHashCode = strM7667.hashCode();
                                            c4635 = c46356;
                                            if (iHashCode == 94660) {
                                                if (strM7667.equals("_in")) {
                                                    b = 0;
                                                }
                                            } else if (iHashCode != 95025) {
                                                b = (iHashCode == 95027 && strM7667.equals("_ui")) ? (byte) 1 : (byte) -1;
                                                if (b == 0 || b == 1 || b == 2) {
                                                    c46434 = c4643M7363;
                                                    i4 = i8;
                                                    str4 = "_et";
                                                    c46352 = c46357;
                                                    if (zM8077) {
                                                        if (c4889.f14718.m8500().m8184(c48903.f14733.m7718(), C4915.f14874)) {
                                                        }
                                                        i11 = i5;
                                                        if (!z5) {
                                                        }
                                                        i6 = i12;
                                                        c48903.f14735.set(i6, (C4634) ((AbstractC4421) c4635M7363.m7370()));
                                                        i9 = i + 1;
                                                        c46435.m7727(c4635M7363);
                                                        z7 = z;
                                                        c46356 = c4635;
                                                    } else {
                                                        ArrayList arrayList = new ArrayList(c4635M7363.m7658());
                                                        int i13 = -1;
                                                        int i14 = -1;
                                                        for (int i15 = 0; i15 < arrayList.size(); i15++) {
                                                            if ("value".equals(((C4638) arrayList.get(i15)).m7675())) {
                                                                i13 = i15;
                                                            } else if ("currency".equals(((C4638) arrayList.get(i15)).m7675())) {
                                                                i14 = i15;
                                                            }
                                                        }
                                                        if (i13 != -1) {
                                                            if (((C4638) arrayList.get(i13)).m7678() || ((C4638) arrayList.get(i13)).m7680()) {
                                                                if (i14 != -1) {
                                                                    String strM7677 = ((C4638) arrayList.get(i14)).m7677();
                                                                    if (strM7677.length() == 3) {
                                                                        int iCharCount = 0;
                                                                        while (iCharCount < strM7677.length()) {
                                                                            int iCodePointAt = strM7677.codePointAt(iCharCount);
                                                                            if (Character.isLetter(iCodePointAt)) {
                                                                                iCharCount += Character.charCount(iCodePointAt);
                                                                            }
                                                                        }
                                                                        z6 = false;
                                                                    }
                                                                    z6 = true;
                                                                    break;
                                                                }
                                                                z6 = true;
                                                                if (z6) {
                                                                    c4889.f14718.mo8165().m8049().m8034("Value parameter discarded. You must also supply a 3-letter ISO_4217 currency code in the currency parameter.");
                                                                    c4635M7363.m7664(i13);
                                                                    m8278(c4635M7363, "_c");
                                                                    m8277(c4635M7363, 19, "currency");
                                                                }
                                                            } else {
                                                                c4889.f14718.mo8165().m8049().m8034("Value must be specified with a numeric type.");
                                                                c4635M7363.m7664(i13);
                                                                m8278(c4635M7363, "_c");
                                                                m8277(c4635M7363, 18, "value");
                                                            }
                                                        }
                                                        if (c4889.f14718.m8500().m8184(c48903.f14733.m7718(), C4915.f14874)) {
                                                            c46353 = c46352;
                                                            str9 = str12;
                                                            str5 = str13;
                                                            str6 = str;
                                                            i5 = i3;
                                                            str7 = str4;
                                                            c46435 = c46434;
                                                        } else if ("_e".equals(c4635M7363.m7667())) {
                                                            m8303();
                                                            if (C4833.m8128((C4634) ((AbstractC4421) c4635M7363.m7370()), "_fr") == null) {
                                                                if (c46352 != null && Math.abs(c46352.m7668() - c4635M7363.m7668()) <= 1000) {
                                                                    C4634.C4635 c46358 = (C4634.C4635) ((AbstractC4421.AbstractC4423) c46352.clone());
                                                                    if (c4889.m8291(c4635M7363, c46358)) {
                                                                        c46435 = c46434;
                                                                        i7 = i4;
                                                                        c46435.m7722(i7, c46358);
                                                                        i5 = i3;
                                                                        str7 = str4;
                                                                        i4 = i7;
                                                                        str9 = str12;
                                                                        str5 = str13;
                                                                        str6 = str;
                                                                        c46353 = null;
                                                                        i11 = i5;
                                                                        c4635 = null;
                                                                        if (!z5 && "_e".equals(c4635M7363.m7667())) {
                                                                            if (c4635M7363.m7666() != 0) {
                                                                                c4889.f14718.mo8165().m8048().m8035("Engagement event does not contain any parameters. appId", C4794.m8038(c48903.f14733.m7718()));
                                                                            } else {
                                                                                Long l = (Long) m8303().m8131((C4634) ((AbstractC4421) c4635M7363.m7370()), str7);
                                                                                if (l == null) {
                                                                                    c4889.f14718.mo8165().m8048().m8035("Engagement event does not include duration. appId", C4794.m8038(c48903.f14733.m7718()));
                                                                                } else {
                                                                                    jLongValue += l.longValue();
                                                                                }
                                                                            }
                                                                        }
                                                                        i6 = i12;
                                                                        c48903.f14735.set(i6, (C4634) ((AbstractC4421) c4635M7363.m7370()));
                                                                        i9 = i + 1;
                                                                        c46435.m7727(c4635M7363);
                                                                        z7 = z;
                                                                        c46356 = c4635;
                                                                    }
                                                                }
                                                                c46435 = c46434;
                                                                i4 = i4;
                                                                c4635 = c4635M7363;
                                                                c46353 = c46352;
                                                                i11 = i;
                                                                str9 = str12;
                                                                str5 = str13;
                                                                str6 = str;
                                                                str7 = str4;
                                                                if (!z5) {
                                                                    if (c4635M7363.m7666() != 0) {
                                                                    }
                                                                }
                                                                i6 = i12;
                                                                c48903.f14735.set(i6, (C4634) ((AbstractC4421) c4635M7363.m7370()));
                                                                i9 = i + 1;
                                                                c46435.m7727(c4635M7363);
                                                                z7 = z;
                                                                c46356 = c4635;
                                                            } else {
                                                                c46435 = c46434;
                                                                c46353 = c46352;
                                                                str9 = str12;
                                                                str5 = str13;
                                                                str6 = str;
                                                                i5 = i3;
                                                                str7 = str4;
                                                            }
                                                        } else {
                                                            c46435 = c46434;
                                                            i7 = i4;
                                                            if ("_vs".equals(c4635M7363.m7667())) {
                                                                m8303();
                                                                str7 = str4;
                                                                if (C4833.m8128((C4634) ((AbstractC4421) c4635M7363.m7370()), str7) == null) {
                                                                    if (c4635 != null && Math.abs(c4635.m7668() - c4635M7363.m7668()) <= 1000) {
                                                                        C4634.C4635 c46359 = (C4634.C4635) ((AbstractC4421.AbstractC4423) c4635.clone());
                                                                        if (c4889.m8291(c46359, c4635M7363)) {
                                                                            i5 = i3;
                                                                            c46435.m7722(i5, c46359);
                                                                            i4 = i7;
                                                                            str9 = str12;
                                                                            str5 = str13;
                                                                            str6 = str;
                                                                            c46353 = null;
                                                                            i11 = i5;
                                                                            c4635 = null;
                                                                            if (!z5) {
                                                                            }
                                                                            i6 = i12;
                                                                            c48903.f14735.set(i6, (C4634) ((AbstractC4421) c4635M7363.m7370()));
                                                                            i9 = i + 1;
                                                                            c46435.m7727(c4635M7363);
                                                                            z7 = z;
                                                                            c46356 = c4635;
                                                                        }
                                                                    }
                                                                    i11 = i3;
                                                                    c46353 = c4635M7363;
                                                                    i4 = i;
                                                                    str9 = str12;
                                                                    str5 = str13;
                                                                    str6 = str;
                                                                    if (!z5) {
                                                                    }
                                                                    i6 = i12;
                                                                    c48903.f14735.set(i6, (C4634) ((AbstractC4421) c4635M7363.m7370()));
                                                                    i9 = i + 1;
                                                                    c46435.m7727(c4635M7363);
                                                                    z7 = z;
                                                                    c46356 = c4635;
                                                                } else {
                                                                    i5 = i3;
                                                                }
                                                            } else {
                                                                i5 = i3;
                                                                str7 = str4;
                                                                if (c4889.f14718.m8500().m8184(c48903.f14733.m7718(), C4915.f14900) && "_ab".equals(c4635M7363.m7667())) {
                                                                    m8303();
                                                                    if (C4833.m8128((C4634) ((AbstractC4421) c4635M7363.m7370()), str7) == null && c4635 != null && Math.abs(c4635.m7668() - c4635M7363.m7668()) <= 4000) {
                                                                        C4634.C4635 c463510 = (C4634.C4635) ((AbstractC4421.AbstractC4423) c4635.clone());
                                                                        c4889.m8295(c463510, c4635M7363);
                                                                        C0567.m1920("_e".equals(c463510.m7667()));
                                                                        m8303();
                                                                        str5 = str13;
                                                                        C4638 c4638M8128 = C4833.m8128((C4634) ((AbstractC4421) c463510.m7370()), str5);
                                                                        m8303();
                                                                        str9 = str12;
                                                                        C4638 c4638M81282 = C4833.m8128((C4634) ((AbstractC4421) c463510.m7370()), str9);
                                                                        m8303();
                                                                        i4 = i7;
                                                                        str6 = str;
                                                                        C4638 c4638M81283 = C4833.m8128((C4634) ((AbstractC4421) c463510.m7370()), str6);
                                                                        String strM76772 = c4638M8128 != null ? c4638M8128.m7677() : str3;
                                                                        if (TextUtils.isEmpty(strM76772)) {
                                                                            c46353 = c46352;
                                                                        } else {
                                                                            c46353 = c46352;
                                                                            m8303().m8138(c4635M7363, str5, strM76772);
                                                                        }
                                                                        String strM76773 = c4638M81282 != null ? c4638M81282.m7677() : str3;
                                                                        if (!TextUtils.isEmpty(strM76773)) {
                                                                            m8303().m8138(c4635M7363, str9, strM76773);
                                                                        }
                                                                        if (c4638M81283 != null) {
                                                                            m8303().m8138(c4635M7363, str6, Long.valueOf(c4638M81283.m7679()));
                                                                        }
                                                                        c46435.m7722(i5, c463510);
                                                                        i11 = i5;
                                                                        c4635 = null;
                                                                        if (!z5) {
                                                                        }
                                                                        i6 = i12;
                                                                        c48903.f14735.set(i6, (C4634) ((AbstractC4421) c4635M7363.m7370()));
                                                                        i9 = i + 1;
                                                                        c46435.m7727(c4635M7363);
                                                                        z7 = z;
                                                                        c46356 = c4635;
                                                                    }
                                                                }
                                                            }
                                                            i4 = i7;
                                                            c46353 = c46352;
                                                            str9 = str12;
                                                            str5 = str13;
                                                            str6 = str;
                                                        }
                                                        i11 = i5;
                                                        if (!z5) {
                                                        }
                                                        i6 = i12;
                                                        c48903.f14735.set(i6, (C4634) ((AbstractC4421) c4635M7363.m7370()));
                                                        i9 = i + 1;
                                                        c46435.m7727(c4635M7363);
                                                        z7 = z;
                                                        c46356 = c4635;
                                                    }
                                                }
                                            } else {
                                                if (strM7667.equals("_ug")) {
                                                    b = 2;
                                                }
                                                if (b == 0) {
                                                    if (b == 0 || b == 1 || b == 2) {
                                                    }
                                                }
                                            }
                                        }
                                        str4 = "_et";
                                        int i16 = 0;
                                        boolean z8 = false;
                                        boolean z9 = false;
                                        while (true) {
                                            c46434 = c4643M7363;
                                            if (i16 >= c4635M7363.m7666()) {
                                                break;
                                            }
                                            if ("_c".equals(c4635M7363.m7663(i16).m7675())) {
                                                C4638.C4639 c4639M7363 = c4635M7363.m7663(i16).m7363();
                                                c46354 = c46357;
                                                c4639M7363.m7684(1L);
                                                c4635M7363.m7659(i16, (C4638) ((AbstractC4421) c4639M7363.m7370()));
                                                z8 = true;
                                            } else {
                                                c46354 = c46357;
                                                if ("_r".equals(c4635M7363.m7663(i16).m7675())) {
                                                    C4638.C4639 c4639M73632 = c4635M7363.m7663(i16).m7363();
                                                    c4639M73632.m7684(1L);
                                                    c4635M7363.m7659(i16, (C4638) ((AbstractC4421) c4639M73632.m7370()));
                                                    z9 = true;
                                                }
                                            }
                                            i16++;
                                            c46357 = c46354;
                                            c4643M7363 = c46434;
                                        }
                                        c46352 = c46357;
                                        if (z8 || !zM8077) {
                                            i4 = i8;
                                        } else {
                                            i4 = i8;
                                            c4889.f14718.mo8165().m8051().m8035("Marking event as conversion", c4889.f14718.m8505().m8110(c4635M7363.m7667()));
                                            C4638.C4639 c4639M7674 = C4638.m7674();
                                            c4639M7674.m7686("_c");
                                            c4639M7674.m7684(1L);
                                            c4635M7363.m7662(c4639M7674);
                                        }
                                        if (!z9) {
                                            c4889.f14718.mo8165().m8051().m8035("Marking event as real-time", c4889.f14718.m8505().m8110(c4635M7363.m7667()));
                                            C4638.C4639 c4639M76742 = C4638.m7674();
                                            c4639M76742.m7686("_r");
                                            c4639M76742.m7684(1L);
                                            c4635M7363.m7662(c4639M76742);
                                        }
                                        if (m8301().m8328(m8311(), c48903.f14733.m7718(), false, true).f14788 > c4889.f14718.m8500().m8178(c48903.f14733.m7718())) {
                                            m8278(c4635M7363, "_r");
                                        } else {
                                            z = true;
                                        }
                                        if (C4887.m8233(c4635M7363.m7667()) && zM8077 && m8301().m8328(m8311(), c48903.f14733.m7718(), true, false).f14786 > c4889.f14718.m8500().m8179(c48903.f14733.m7718(), C4915.f14841)) {
                                            c4889.f14718.mo8165().m8048().m8035("Too many conversions. Not logging as conversion. appId", C4794.m8038(c48903.f14733.m7718()));
                                            boolean z10 = false;
                                            int i17 = -1;
                                            C4638.C4639 c4639M73633 = null;
                                            for (int i18 = 0; i18 < c4635M7363.m7666(); i18++) {
                                                C4638 c4638M7663 = c4635M7363.m7663(i18);
                                                if ("_c".equals(c4638M7663.m7675())) {
                                                    c4639M73633 = c4638M7663.m7363();
                                                    i17 = i18;
                                                } else if ("_err".equals(c4638M7663.m7675())) {
                                                    z10 = true;
                                                }
                                            }
                                            if (z10 && c4639M73633 != null) {
                                                c4635M7363.m7664(i17);
                                            } else if (c4639M73633 != null) {
                                                C4638.C4639 c4639 = (C4638.C4639) ((AbstractC4421.AbstractC4423) c4639M73633.clone());
                                                c4639.m7686("_err");
                                                c4639.m7684(10L);
                                                c4635M7363.m7659(i17, (C4638) ((AbstractC4421) c4639.m7370()));
                                            } else {
                                                c4889.f14718.mo8165().m8046().m8035("Did not find conversion parameter. appId", C4794.m8038(c48903.f14733.m7718()));
                                            }
                                        }
                                        if (zM8077) {
                                        }
                                    }
                                    i10 = i6 + 1;
                                    str = str6;
                                    c4643M7363 = c46435;
                                    str10 = str5;
                                    c46357 = c46353;
                                    zM8184 = z5;
                                    i8 = i4;
                                }
                                C4642.C4643 c46436 = c4643M7363;
                                if (zM8184) {
                                    int i19 = i;
                                    int i20 = 0;
                                    while (i20 < i19) {
                                        C4634 c4634M7720 = c46436.m7720(i20);
                                        if ("_e".equals(c4634M7720.m7655())) {
                                            m8303();
                                            if (C4833.m8128(c4634M7720, "_fr") != null) {
                                                c46436.m7731(i20);
                                                i19--;
                                                i20--;
                                            } else {
                                                m8303();
                                                C4638 c4638M81284 = C4833.m8128(c4634M7720, "_et");
                                                if (c4638M81284 != null) {
                                                    Long lValueOf = c4638M81284.m7678() ? Long.valueOf(c4638M81284.m7679()) : null;
                                                    if (lValueOf != null && lValueOf.longValue() > 0) {
                                                        jLongValue += lValueOf.longValue();
                                                    }
                                                }
                                            }
                                        }
                                        i20++;
                                    }
                                }
                                long j3 = jLongValue;
                                c4889.m8284(c46436, j3, false);
                                Iterator<C4634> it = c46436.m7719().iterator();
                                while (true) {
                                    if (!it.hasNext()) {
                                        z2 = false;
                                        break;
                                    }
                                    if ("_s".equals(it.next().m7655())) {
                                        z2 = true;
                                        break;
                                    }
                                }
                                if (z2) {
                                    m8301().m8344(c46436.m7773(), "_se");
                                }
                                if (C4833.m8117(c46436, "_sid") >= 0) {
                                    c4889.m8284(c46436, j3, true);
                                } else {
                                    int iM8117 = C4833.m8117(c46436, "_se");
                                    if (iM8117 >= 0) {
                                        c46436.m7740(iM8117);
                                        c4889.f14718.mo8165().m8046().m8035("Session engagement user property is in the bundle without session ID. appId", C4794.m8038(c48903.f14733.m7718()));
                                    }
                                }
                                C4833 c4833M8303 = m8303();
                                c4833M8303.mo8165().m8051().m8034("Checking account type status for ad personalization signals");
                                if (c4833M8303.m8159().m8074(c46436.m7773()) && (c4755M8343 = c4833M8303.m8158().m8343(c46436.m7773())) != null && c4755M8343.m7929() && c4833M8303.m8160().m8369()) {
                                    c4833M8303.mo8165().m8050().m8034("Turning off ad personalization due to account type");
                                    C4665.C4666 c4666M7799 = C4665.m7799();
                                    String str14 = str2;
                                    c4666M7799.m7802(str14);
                                    c4666M7799.m7801(c4833M8303.m8160().m8368());
                                    c4666M7799.m7803(1L);
                                    C4665 c4665 = (C4665) ((AbstractC4421) c4666M7799.m7370());
                                    int i21 = 0;
                                    while (true) {
                                        if (i21 >= c46436.m7768()) {
                                            z4 = false;
                                            break;
                                        }
                                        if (str14.equals(c46436.m7739(i21).m7800())) {
                                            c46436.m7723(i21, c4665);
                                            z4 = true;
                                            break;
                                        }
                                        i21++;
                                    }
                                    if (!z4) {
                                        c46436.m7729(c4665);
                                    }
                                }
                                if (c4889.f14718.m8500().m8184(c46436.m7773(), C4915.f14895)) {
                                    m8279(c46436);
                                }
                                c46436.m7776();
                                c46436.m7733(m8302().m8486(c46436.m7773(), c46436.m7719(), c46436.m7767(), Long.valueOf(c46436.m7769()), Long.valueOf(c46436.m7770())));
                                if (c4889.f14718.m8500().m8182(c48903.f14733.m7718())) {
                                    try {
                                        HashMap map = new HashMap();
                                        ArrayList arrayList2 = new ArrayList();
                                        SecureRandom secureRandomM8273 = c4889.f14718.m8504().m8273();
                                        int i22 = 0;
                                        while (i22 < c46436.m7763()) {
                                            C4634.C4635 c4635M73632 = c46436.m7720(i22).m7363();
                                            if (c4635M73632.m7667().equals("_ep")) {
                                                String str15 = (String) m8303().m8131((C4634) ((AbstractC4421) c4635M73632.m7370()), "_en");
                                                C4909 c4909M8329 = (C4909) map.get(str15);
                                                if (c4909M8329 == null) {
                                                    c4909M8329 = m8301().m8329(c48903.f14733.m7718(), str15);
                                                    map.put(str15, c4909M8329);
                                                }
                                                if (c4909M8329.f14817 == null) {
                                                    if (c4909M8329.f14818.longValue() > 1) {
                                                        m8303().m8138(c4635M73632, "_sr", c4909M8329.f14818);
                                                    }
                                                    if (c4909M8329.f14819 != null && c4909M8329.f14819.booleanValue()) {
                                                        m8303().m8138(c4635M73632, "_efs", (Object) 1L);
                                                    }
                                                    arrayList2.add((C4634) ((AbstractC4421) c4635M73632.m7370()));
                                                }
                                                c46436.m7722(i22, c4635M73632);
                                            } else {
                                                long jM8076 = m8294().m8076(c48903.f14733.m7718());
                                                c4889.f14718.m8504();
                                                long jM82162 = C4887.m8216(c4635M73632.m7668(), jM8076);
                                                C4634 c4634 = (C4634) ((AbstractC4421) c4635M73632.m7370());
                                                Long l2 = 1L;
                                                if (TextUtils.isEmpty("_dbg") || l2 == null) {
                                                    iM8078 = z3 ? m8294().m8078(c48903.f14733.m7718(), c4635M73632.m7667()) : 1;
                                                    if (iM8078 > 0) {
                                                        c4889.f14718.mo8165().m8048().m8036("Sample rate must be positive. event, rate", c4635M73632.m7667(), Integer.valueOf(iM8078));
                                                        arrayList2.add((C4634) ((AbstractC4421) c4635M73632.m7370()));
                                                        c46436.m7722(i22, c4635M73632);
                                                    } else {
                                                        C4909 c4909M8377 = (C4909) map.get(c4635M73632.m7667());
                                                        if (c4909M8377 == null && (c4909M8377 = m8301().m8329(c48903.f14733.m7718(), c4635M73632.m7667())) == null) {
                                                            c4889.f14718.mo8165().m8048().m8036("Event being bundled has no eventAggregate. appId, eventName", c48903.f14733.m7718(), c4635M73632.m7667());
                                                            c4909M8377 = new C4909(c48903.f14733.m7718(), c4635M73632.m7667(), 1L, 1L, 1L, c4635M73632.m7668(), 0L, null, null, null, null);
                                                        }
                                                        Long l3 = (Long) m8303().m8131((C4634) ((AbstractC4421) c4635M73632.m7370()), "_eid");
                                                        Boolean boolValueOf = Boolean.valueOf(l3 != null);
                                                        if (iM8078 == 1) {
                                                            arrayList2.add((C4634) ((AbstractC4421) c4635M73632.m7370()));
                                                            if (boolValueOf.booleanValue() && (c4909M8377.f14817 != null || c4909M8377.f14818 != null || c4909M8377.f14819 != null)) {
                                                                map.put(c4635M73632.m7667(), c4909M8377.m8377(null, null, null));
                                                            }
                                                            c46436.m7722(i22, c4635M73632);
                                                        } else {
                                                            if (secureRandomM8273.nextInt(iM8078) == 0) {
                                                                secureRandom = secureRandomM8273;
                                                                int i23 = i22;
                                                                long j4 = iM8078;
                                                                m8303().m8138(c4635M73632, "_sr", Long.valueOf(j4));
                                                                arrayList2.add((C4634) ((AbstractC4421) c4635M73632.m7370()));
                                                                if (boolValueOf.booleanValue()) {
                                                                    c4909M8377 = c4909M8377.m8377(null, Long.valueOf(j4), null);
                                                                }
                                                                map.put(c4635M73632.m7667(), c4909M8377.m8376(c4635M73632.m7668(), jM82162));
                                                                c48902 = c48903;
                                                                c46433 = c46436;
                                                                i2 = i23;
                                                            } else {
                                                                secureRandom = secureRandomM8273;
                                                                int i24 = i22;
                                                                if (c4909M8377.f14816 != null) {
                                                                    jM8216 = c4909M8377.f14816.longValue();
                                                                    c48902 = c48903;
                                                                    c46432 = c46436;
                                                                } else {
                                                                    this.f14718.m8504();
                                                                    c48902 = c48903;
                                                                    c46432 = c46436;
                                                                    jM8216 = C4887.m8216(c4635M73632.m7669(), jM8076);
                                                                }
                                                                if (jM8216 != jM82162) {
                                                                    m8303().m8138(c4635M73632, "_efs", (Object) 1L);
                                                                    long j5 = iM8078;
                                                                    m8303().m8138(c4635M73632, "_sr", Long.valueOf(j5));
                                                                    arrayList2.add((C4634) ((AbstractC4421) c4635M73632.m7370()));
                                                                    if (boolValueOf.booleanValue()) {
                                                                        c4909M8377 = c4909M8377.m8377(null, Long.valueOf(j5), true);
                                                                    }
                                                                    map.put(c4635M73632.m7667(), c4909M8377.m8376(c4635M73632.m7668(), jM82162));
                                                                } else if (boolValueOf.booleanValue()) {
                                                                    map.put(c4635M73632.m7667(), c4909M8377.m8377(l3, null, null));
                                                                }
                                                                i2 = i24;
                                                                c46433 = c46432;
                                                            }
                                                            c46433.m7722(i2, c4635M73632);
                                                        }
                                                    }
                                                } else {
                                                    Iterator<C4638> it2 = c4634.m7654().iterator();
                                                    while (true) {
                                                        if (!it2.hasNext()) {
                                                            break;
                                                        }
                                                        C4638 next = it2.next();
                                                        Iterator<C4638> it3 = it2;
                                                        if ("_dbg".equals(next.m7675())) {
                                                            z3 = l2.equals(Long.valueOf(next.m7679())) || ((l2 instanceof String) && l2.equals(next.m7677())) || ((l2 instanceof Double) && l2.equals(Double.valueOf(next.m7681())));
                                                        } else {
                                                            it2 = it3;
                                                        }
                                                    }
                                                    if (z3) {
                                                    }
                                                    if (iM8078 > 0) {
                                                    }
                                                }
                                                c46436 = c46433;
                                                i22 = i2 + 1;
                                                secureRandomM8273 = secureRandom;
                                                c48903 = c48902;
                                                c4889 = this;
                                            }
                                            secureRandom = secureRandomM8273;
                                            c48902 = c48903;
                                            c46433 = c46436;
                                            i2 = i22;
                                            c46436 = c46433;
                                            i22 = i2 + 1;
                                            secureRandomM8273 = secureRandom;
                                            c48903 = c48902;
                                            c4889 = this;
                                        }
                                        c4890 = c48903;
                                        c4643 = c46436;
                                        if (arrayList2.size() < c4643.m7763()) {
                                            c4643.m7765();
                                            c4643.m7725(arrayList2);
                                        }
                                        Iterator it4 = map.entrySet().iterator();
                                        while (it4.hasNext()) {
                                            m8301().m8332((C4909) ((Map.Entry) it4.next()).getValue());
                                        }
                                    } catch (Throwable th4) {
                                        th = th4;
                                    }
                                } else {
                                    c4890 = c48903;
                                    c4643 = c46436;
                                }
                                if (!this.f14718.m8500().m8184(c4643.m7773(), C4915.f14895)) {
                                    m8279(c4643);
                                }
                                C4890 c48904 = c4890;
                                String strM7718 = c48904.f14733.m7718();
                                C4755 c4755M83432 = m8301().m8343(strM7718);
                                if (c4755M83432 == null) {
                                    this.f14718.mo8165().m8046().m8035("Bundling raw events w/o app info. appId", C4794.m8038(c48904.f14733.m7718()));
                                } else if (c4643.m7763() > 0) {
                                    long jM7954 = c4755M83432.m7954();
                                    if (jM7954 != 0) {
                                        c4643.m7744(jM7954);
                                    } else {
                                        c4643.m7772();
                                    }
                                    long jM7953 = c4755M83432.m7953();
                                    if (jM7953 != 0) {
                                        jM7954 = jM7953;
                                    }
                                    if (jM7954 != 0) {
                                        c4643.m7741(jM7954);
                                    } else {
                                        c4643.m7771();
                                    }
                                    c4755M83432.m7965();
                                    c4643.m7746((int) c4755M83432.m7962());
                                    c4755M83432.m7917(c4643.m7769());
                                    c4755M83432.m7923(c4643.m7770());
                                    String strM7916 = c4755M83432.m7916();
                                    if (strM7916 != null) {
                                        c4643.m7758(strM7916);
                                    } else {
                                        c4643.m7774();
                                    }
                                    m8301().m8331(c4755M83432);
                                }
                                if (c4643.m7763() > 0) {
                                    this.f14718.mo8162();
                                    C4602 c4602M8070 = m8294().m8070(c48904.f14733.m7718());
                                    if (c4602M8070 != null && c4602M8070.m7634()) {
                                        c4643.m7755(c4602M8070.m7635());
                                    } else if (TextUtils.isEmpty(c48904.f14733.m7715())) {
                                        c4643.m7755(-1L);
                                    } else {
                                        this.f14718.mo8165().m8048().m8035("Did not find measurement config or missing version info. appId", C4794.m8038(c48904.f14733.m7718()));
                                    }
                                    m8301().m8337((C4642) ((AbstractC4421) c4643.m7370()), z);
                                }
                                C4900 c4900M83012 = m8301();
                                List<Long> list = c48904.f14734;
                                C0567.m1910(list);
                                c4900M83012.mo8008();
                                c4900M83012.m8155();
                                StringBuilder sb2 = new StringBuilder("rowid in (");
                                for (int i25 = 0; i25 < list.size(); i25++) {
                                    if (i25 != 0) {
                                        sb2.append(",");
                                    }
                                    sb2.append(list.get(i25).longValue());
                                }
                                sb2.append(")");
                                int iDelete = c4900M83012.m8354().delete("raw_events", sb2.toString(), null);
                                if (iDelete != list.size()) {
                                    c4900M83012.mo8165().m8046().m8036("Deleted fewer rows from raw events table than expected", Integer.valueOf(iDelete), Integer.valueOf(list.size()));
                                }
                                C4900 c4900M83013 = m8301();
                                try {
                                    c4900M83013.m8354().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[]{strM7718, strM7718});
                                } catch (SQLiteException e4) {
                                    c4900M83013.mo8165().m8046().m8036("Failed to remove unused event metadata. appId", C4794.m8038(strM7718), e4);
                                }
                                m8301().m8353();
                                m8301().m8359();
                                return true;
                            }
                            string = RawQuery.getString(0);
                            try {
                                string2 = RawQuery.getString(1);
                                RawQuery.close();
                                RawQuery = RawQuery;
                                str3 = "";
                            } catch (SQLiteException e5) {
                                e = e5;
                                str = "_si";
                                str2 = "_npa";
                                str3 = "";
                                r82 = RawQuery;
                                Query = r82;
                                sQLiteException = e;
                                r6 = Query;
                                r22 = r6;
                                c4900M8301.mo8165().m8046().m8036("Data loss. Error selecting raw event. appId", C4794.m8038(string), sQLiteException);
                                if (r22 != 0) {
                                    r22.close();
                                }
                                m8301().m8359();
                                throw th;
                            }
                            try {
                                Query = sQLiteDatabaseM8354.query("raw_events_metadata", new String[]{"metadata"}, "app_id = ? and metadata_fingerprint = ?", new String[]{string, string2}, null, null, "rowid", "2");
                                try {
                                    try {
                                        if (Query.moveToFirst()) {
                                            try {
                                                c4900M8301.mo8165().m8046().m8035("Raw event metadata record is missing. appId", C4794.m8038(string));
                                                Query.close();
                                                str = "_si";
                                                str2 = "_npa";
                                            } catch (SQLiteException e6) {
                                                sQLiteException = e6;
                                                str = "_si";
                                                str2 = "_npa";
                                                r6 = Query;
                                                r22 = r6;
                                                c4900M8301.mo8165().m8046().m8036("Data loss. Error selecting raw event. appId", C4794.m8038(string), sQLiteException);
                                                if (r22 != 0) {
                                                }
                                            }
                                        } else {
                                            try {
                                                try {
                                                    C4642 c4642 = (C4642) ((AbstractC4421) ((C4642.C4643) C4833.m8121(C4642.m7713(), Query.getBlob(0))).m7370());
                                                    if (Query.moveToNext()) {
                                                        str2 = "_npa";
                                                        str = "_si";
                                                        c4900M8301.mo8165().m8048().m8035("Get multiple raw event metadata records, expected one. appId", C4794.m8038(string));
                                                    } else {
                                                        str = "_si";
                                                        str2 = "_npa";
                                                    }
                                                    Query.close();
                                                    c48903.m8314(c4642);
                                                    if (j2 != -1) {
                                                        str8 = "app_id = ? and metadata_fingerprint = ? and rowid <= ?";
                                                        strArr = new String[]{string, string2, String.valueOf(j2)};
                                                    } else {
                                                        str8 = "app_id = ? and metadata_fingerprint = ?";
                                                        strArr = new String[]{string, string2};
                                                    }
                                                    Cursor cursorQuery = sQLiteDatabaseM8354.query("raw_events", new String[]{"rowid", "name", "timestamp", "data"}, str8, strArr, null, null, "rowid", null);
                                                    try {
                                                        if (cursorQuery.moveToFirst()) {
                                                            while (true) {
                                                                long j6 = cursorQuery.getLong(0);
                                                                try {
                                                                    c46355 = (C4634.C4635) C4833.m8121(C4634.m7653(), cursorQuery.getBlob(3));
                                                                    c46355.m7661(cursorQuery.getString(1));
                                                                    c46355.m7660(cursorQuery.getLong(2));
                                                                } catch (IOException e7) {
                                                                    c4900M8301.mo8165().m8046().m8036("Data loss. Failed to merge raw event. appId", C4794.m8038(string), e7);
                                                                }
                                                                if (!c48903.m8315(j6, (C4634) ((AbstractC4421) c46355.m7370()))) {
                                                                    cursorQuery.close();
                                                                    break;
                                                                }
                                                                if (!cursorQuery.moveToNext()) {
                                                                    cursorQuery.close();
                                                                    break;
                                                                }
                                                            }
                                                        } else {
                                                            c4900M8301.mo8165().m8048().m8035("Raw event data disappeared while in transaction. appId", C4794.m8038(string));
                                                            cursorQuery.close();
                                                        }
                                                    } catch (SQLiteException e8) {
                                                        sQLiteException = e8;
                                                        r6 = cursorQuery;
                                                        r22 = r6;
                                                        c4900M8301.mo8165().m8046().m8036("Data loss. Error selecting raw event. appId", C4794.m8038(string), sQLiteException);
                                                        if (r22 != 0) {
                                                        }
                                                    }
                                                } catch (IOException e9) {
                                                    str = "_si";
                                                    str2 = "_npa";
                                                    c4900M8301.mo8165().m8046().m8036("Data loss. Failed to merge raw event metadata. appId", C4794.m8038(string), e9);
                                                    Query.close();
                                                }
                                            } catch (SQLiteException e10) {
                                                e = e10;
                                                sQLiteException = e;
                                                r6 = Query;
                                                r22 = r6;
                                                c4900M8301.mo8165().m8046().m8036("Data loss. Error selecting raw event. appId", C4794.m8038(string), sQLiteException);
                                                if (r22 != 0) {
                                                }
                                                m8301().m8359();
                                                throw th;
                                            }
                                        }
                                    } catch (Throwable th5) {
                                        th2 = th5;
                                        r8 = Query;
                                        if (r8 == 0) {
                                            throw th2;
                                        }
                                        r8.close();
                                        throw th2;
                                    }
                                } catch (SQLiteException e11) {
                                    e = e11;
                                    str = "_si";
                                    str2 = "_npa";
                                }
                            } catch (SQLiteException e12) {
                                e = e12;
                                str = "_si";
                                str2 = "_npa";
                                r82 = RawQuery;
                                Query = r82;
                                sQLiteException = e;
                                r6 = Query;
                                r22 = r6;
                                c4900M8301.mo8165().m8046().m8036("Data loss. Error selecting raw event. appId", C4794.m8038(string), sQLiteException);
                                if (r22 != 0) {
                                }
                                m8301().m8359();
                                throw th;
                            }
                            if (c48903.f14735 != null) {
                                if (!(c48903.f14735 != null || c48903.f14735.isEmpty())) {
                                }
                            }
                        } else {
                            String[] strArr3 = j2 != -1 ? new String[]{null, String.valueOf(j2)} : new String[]{null};
                            String str16 = j2 != -1 ? " and rowid <= ?" : "";
                            StringBuilder sb3 = new StringBuilder(str16.length() + 84);
                            sb3.append("select metadata_fingerprint from raw_events where app_id = ?");
                            sb3.append(str16);
                            sb3.append(" order by rowid limit 1;");
                            Cursor cursorRawQuery = sQLiteDatabaseM8354.rawQuery(sb3.toString(), strArr3);
                            if (cursorRawQuery.moveToFirst()) {
                                string2 = cursorRawQuery.getString(0);
                                cursorRawQuery.close();
                                string = null;
                                RawQuery = cursorRawQuery;
                                str3 = "";
                                Query = sQLiteDatabaseM8354.query("raw_events_metadata", new String[]{"metadata"}, "app_id = ? and metadata_fingerprint = ?", new String[]{string, string2}, null, null, "rowid", "2");
                                if (Query.moveToFirst()) {
                                }
                            } else {
                                cursorRawQuery.close();
                                str = "_si";
                                str2 = "_npa";
                                str3 = "";
                            }
                        }
                    } catch (Throwable th6) {
                        th2 = th6;
                        r8 = 0;
                    }
                } catch (Throwable th7) {
                    r8 = "_si";
                    th2 = th7;
                }
            } catch (Throwable th8) {
                th = th8;
                th = th;
            }
        } catch (Throwable th9) {
            th = th9;
        }
        m8301().m8359();
        throw th;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final boolean m8291(C4634.C4635 c4635, C4634.C4635 c46352) {
        C0567.m1920("_e".equals(c4635.m7667()));
        m8303();
        C4638 c4638M8128 = C4833.m8128((C4634) ((AbstractC4421) c4635.m7370()), "_sc");
        String str = c4638M8128 == null ? null : c4638M8128.zze;
        m8303();
        C4638 c4638M81282 = C4833.m8128((C4634) ((AbstractC4421) c46352.m7370()), "_pc");
        String str2 = c4638M81282 != null ? c4638M81282.zze : null;
        if (str2 == null || !str2.equals(str)) {
            return false;
        }
        m8295(c4635, c46352);
        return true;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final Boolean m8292(C4755 c4755) {
        try {
            if (c4755.m7956() != -2147483648L) {
                if (c4755.m7956() == C4322.m7223(this.f14718.f15009).m7222(c4755.m7939(), 0).versionCode) {
                    return true;
                }
            } else {
                String str = C4322.m7223(this.f14718.f15009).m7222(c4755.m7939(), 0).versionName;
                if (c4755.m7955() != null && c4755.m7955().equals(str)) {
                    return true;
                }
            }
            return false;
        } catch (PackageManager.NameNotFoundException unused) {
            return null;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:100:0x0270  */
    /* JADX WARN: Removed duplicated region for block: B:103:0x027e  */
    /* JADX WARN: Removed duplicated region for block: B:106:0x028c  */
    /* JADX WARN: Removed duplicated region for block: B:112:0x02a6  */
    /* JADX WARN: Removed duplicated region for block: B:114:0x02a9  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x0161  */
    /* JADX WARN: Removed duplicated region for block: B:51:0x0173  */
    /* JADX WARN: Removed duplicated region for block: B:76:0x01f3  */
    /* JADX WARN: Removed duplicated region for block: B:84:0x0217  */
    /* JADX WARN: Removed duplicated region for block: B:87:0x0225  */
    /* JADX WARN: Removed duplicated region for block: B:90:0x0233  */
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final C4755 m8293(C4977 c4977) throws Throwable {
        boolean z;
        long j;
        String str;
        long j2;
        m8310();
        m8305();
        C0567.m1910(c4977);
        C0567.m1926(c4977.f15049);
        C4755 c4755M8343 = m8301().m8343(c4977.f15049);
        String strM8197 = this.f14718.m8501().m8197(c4977.f15049);
        if (((InterfaceC4389) C4523.f13934.mo7259()).mo7288() && this.f14718.f15015.m8177(C4915.f14902)) {
            if (c4755M8343 == null) {
                c4755M8343 = new C4755(this.f14718, c4977.f15049);
                c4755M8343.m7919(this.f14718.m8504().m8275());
                c4755M8343.m7935(strM8197);
            } else if (!strM8197.equals(c4755M8343.m7951())) {
                c4755M8343.m7935(strM8197);
                c4755M8343.m7919(this.f14718.m8504().m8275());
            }
            c4755M8343.m7924(c4977.f15050);
            c4755M8343.m7927(c4977.f15066);
            if (C4538.m7580() && this.f14718.f15015.m8183(c4755M8343.m7939(), C4915.f14896)) {
                c4755M8343.m7931(c4977.f15070);
            }
            if (!TextUtils.isEmpty(c4977.f15059)) {
                c4755M8343.m7938(c4977.f15059);
            }
            long j3 = c4977.f15053;
            if (j3 != 0) {
                c4755M8343.m7930(j3);
            }
            if (!TextUtils.isEmpty(c4977.f15051)) {
                c4755M8343.m7941(c4977.f15051);
            }
            c4755M8343.m7926(c4977.f15058);
            String str2 = c4977.f15052;
            if (str2 != null) {
                c4755M8343.m7944(str2);
            }
            c4755M8343.m7934(c4977.f15054);
            c4755M8343.m7921(c4977.f15056);
            if (!TextUtils.isEmpty(c4977.f15055)) {
                c4755M8343.m7947(c4977.f15055);
            }
            if (!this.f14718.f15015.m8177(C4915.f14920)) {
                c4755M8343.m7949(c4977.f15060);
            }
            c4755M8343.m7925(c4977.f15063);
            c4755M8343.m7928(c4977.f15064);
            c4755M8343.m7918(c4977.f15067);
            c4755M8343.m7937(c4977.f15068);
            c4755M8343.f14289.mo8163().mo8008();
            if (c4755M8343.f14319) {
                m8301().m8331(c4755M8343);
            }
            return c4755M8343;
        }
        boolean z2 = true;
        if (c4755M8343 == null) {
            c4755M8343 = new C4755(this.f14718, c4977.f15049);
            c4755M8343.m7919(this.f14718.m8504().m8275());
            c4755M8343.m7935(strM8197);
        } else {
            if (strM8197.equals(c4755M8343.m7951())) {
                z = false;
                if (!TextUtils.equals(c4977.f15050, c4755M8343.m7945())) {
                    c4755M8343.m7924(c4977.f15050);
                    z = true;
                }
                if (!TextUtils.equals(c4977.f15066, c4755M8343.m7948())) {
                    c4755M8343.m7927(c4977.f15066);
                    z = true;
                }
                if (C4538.m7580() && this.f14718.f15015.m8183(c4755M8343.m7939(), C4915.f14896) && !TextUtils.equals(c4977.f15070, c4755M8343.m7950())) {
                    c4755M8343.m7931(c4977.f15070);
                    z = true;
                }
                if (!TextUtils.isEmpty(c4977.f15059) && !c4977.f15059.equals(c4755M8343.m7952())) {
                    c4755M8343.m7938(c4977.f15059);
                    z = true;
                }
                j = c4977.f15053;
                if (j != 0 && j != c4755M8343.m7958()) {
                    c4755M8343.m7930(c4977.f15053);
                    z = true;
                }
                if (!TextUtils.isEmpty(c4977.f15051) && !c4977.f15051.equals(c4755M8343.m7955())) {
                    c4755M8343.m7941(c4977.f15051);
                    z = true;
                }
                if (c4977.f15058 != c4755M8343.m7956()) {
                    c4755M8343.m7926(c4977.f15058);
                    z = true;
                }
                str = c4977.f15052;
                if (str != null && !str.equals(c4755M8343.m7957())) {
                    c4755M8343.m7944(c4977.f15052);
                    z = true;
                }
                if (c4977.f15054 != c4755M8343.m7959()) {
                    c4755M8343.m7934(c4977.f15054);
                    z = true;
                }
                if (c4977.f15056 != c4755M8343.m7961()) {
                    c4755M8343.m7921(c4977.f15056);
                    z = true;
                }
                if (!TextUtils.isEmpty(c4977.f15055)) {
                    String str3 = c4977.f15055;
                    c4755M8343.f14289.mo8163().mo8008();
                    if (!str3.equals(c4755M8343.f14318)) {
                        c4755M8343.m7947(c4977.f15055);
                        z = true;
                    }
                }
                if (!this.f14718.f15015.m8177(C4915.f14920) && c4977.f15060 != c4755M8343.m7922()) {
                    c4755M8343.m7949(c4977.f15060);
                    z = true;
                }
                if (c4977.f15063 != c4755M8343.m7929()) {
                    c4755M8343.m7925(c4977.f15063);
                    z = true;
                }
                if (c4977.f15064 != c4755M8343.m7932()) {
                    c4755M8343.m7928(c4977.f15064);
                    z = true;
                }
                if (c4977.f15067 != c4755M8343.m7933()) {
                    c4755M8343.m7918(c4977.f15067);
                    z = true;
                }
                j2 = c4977.f15068;
                if (j2 != 0 || j2 == c4755M8343.m7960()) {
                    z2 = z;
                } else {
                    c4755M8343.m7937(c4977.f15068);
                }
                if (z2) {
                    m8301().m8331(c4755M8343);
                }
                return c4755M8343;
            }
            c4755M8343.m7935(strM8197);
            c4755M8343.m7919(this.f14718.m8504().m8275());
        }
        z = true;
        if (!TextUtils.equals(c4977.f15050, c4755M8343.m7945())) {
        }
        if (!TextUtils.equals(c4977.f15066, c4755M8343.m7948())) {
        }
        if (C4538.m7580()) {
            c4755M8343.m7931(c4977.f15070);
            z = true;
        }
        if (!TextUtils.isEmpty(c4977.f15059)) {
            c4755M8343.m7938(c4977.f15059);
            z = true;
        }
        j = c4977.f15053;
        if (j != 0) {
            c4755M8343.m7930(c4977.f15053);
            z = true;
        }
        if (!TextUtils.isEmpty(c4977.f15051)) {
            c4755M8343.m7941(c4977.f15051);
            z = true;
        }
        if (c4977.f15058 != c4755M8343.m7956()) {
        }
        str = c4977.f15052;
        if (str != null) {
            c4755M8343.m7944(c4977.f15052);
            z = true;
        }
        if (c4977.f15054 != c4755M8343.m7959()) {
        }
        if (c4977.f15056 != c4755M8343.m7961()) {
        }
        if (!TextUtils.isEmpty(c4977.f15055)) {
        }
        if (!this.f14718.f15015.m8177(C4915.f14920)) {
            c4755M8343.m7949(c4977.f15060);
            z = true;
        }
        if (c4977.f15063 != c4755M8343.m7929()) {
        }
        if (c4977.f15064 != c4755M8343.m7932()) {
        }
        if (c4977.f15067 != c4755M8343.m7933()) {
        }
        j2 = c4977.f15068;
        if (j2 != 0) {
            z2 = z;
        }
        if (z2) {
        }
        return c4755M8343;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C4816 m8294() {
        m8280(this.f14710);
        return this.f14710;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m8295(C4634.C4635 c4635, C4634.C4635 c46352) {
        C0567.m1920("_e".equals(c4635.m7667()));
        m8303();
        C4638 c4638M8128 = C4833.m8128((C4634) ((AbstractC4421) c4635.m7370()), "_et");
        if (c4638M8128.m7678()) {
            long j = c4638M8128.zzf;
            if (j <= 0) {
                return;
            }
            m8303();
            C4638 c4638M81282 = C4833.m8128((C4634) ((AbstractC4421) c46352.m7370()), "_et");
            if (c4638M81282 != null) {
                long j2 = c4638M81282.zzf;
                if (j2 > 0) {
                    j += j2;
                }
            }
            m8303().m8138(c46352, "_et", Long.valueOf(j));
            m8303().m8138(c4635, "_fr", (Object) 1L);
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m8296(C4891 c4891, C4977 c4977) throws Throwable {
        C0567.m1910(c4891);
        C0567.m1926(c4891.f14737);
        C0567.m1910(c4891.f14739);
        C0567.m1926(c4891.f14739.f15117);
        m8310();
        m8305();
        if (m8300(c4977)) {
            if (!c4977.f15056) {
                m8293(c4977);
                return;
            }
            m8301().m8358();
            try {
                m8293(c4977);
                C4891 c4891M8348 = m8301().m8348(c4891.f14737, c4891.f14739.f15117);
                if (c4891M8348 != null) {
                    this.f14718.mo8165().f14451.m8036("Removing conditional user property", c4891.f14737, this.f14718.m8505().m8114(c4891.f14739.f15117));
                    m8301().m8349(c4891.f14737, c4891.f14739.f15117);
                    if (c4891M8348.f14741) {
                        m8301().m8344(c4891.f14737, c4891.f14739.f15117);
                    }
                    if (c4891.f14747 != null) {
                        m8297(this.f14718.m8504().m8243(c4891.f14737, c4891.f14747.f14822, c4891.f14747.f14823 != null ? c4891.f14747.f14823.m8371() : null, c4891M8348.f14738, c4891.f14747.f14825), c4977);
                    }
                } else {
                    this.f14718.mo8165().f14447.m8036("Conditional user property doesn't exist", C4794.m8038(c4891.f14737), this.f14718.m8505().m8114(c4891.f14739.f15117));
                }
                m8301().m8353();
            } finally {
                m8301().m8359();
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:121:0x03b9  */
    /* JADX WARN: Removed duplicated region for block: B:124:0x03c2 A[Catch: all -> 0x09e2, TRY_LEAVE, TryCatch #0 {all -> 0x09e2, blocks: (B:50:0x01db, B:52:0x01e4, B:56:0x01f5, B:60:0x0203, B:62:0x020d, B:67:0x0219, B:74:0x022b, B:77:0x0237, B:79:0x024e, B:84:0x0267, B:86:0x0271, B:88:0x027f, B:93:0x02b3, B:95:0x02b9, B:97:0x02c7, B:99:0x02cf, B:101:0x02d9, B:103:0x02e3, B:106:0x02ea, B:108:0x02fe, B:118:0x0382, B:120:0x038c, B:124:0x03c2, B:128:0x03d7, B:130:0x03ed, B:132:0x03fd, B:134:0x040e, B:136:0x0441, B:138:0x0446, B:139:0x045f, B:143:0x0470, B:145:0x0484, B:147:0x0489, B:148:0x04a2, B:153:0x04c4, B:157:0x04e9, B:158:0x0502, B:161:0x0511, B:164:0x0534, B:165:0x0550, B:167:0x055a, B:169:0x0568, B:171:0x056e, B:172:0x0579, B:174:0x0585, B:175:0x059c, B:177:0x05c5, B:180:0x05de, B:183:0x061f, B:185:0x0638, B:187:0x0672, B:188:0x0677, B:190:0x067f, B:191:0x0684, B:193:0x068c, B:194:0x0691, B:196:0x069a, B:197:0x06a0, B:199:0x06ad, B:200:0x06b2, B:202:0x06b8, B:204:0x06c8, B:206:0x06d2, B:208:0x06da, B:209:0x06df, B:211:0x06e9, B:213:0x06f3, B:215:0x06fb, B:221:0x0718, B:223:0x0720, B:224:0x0725, B:226:0x073a, B:228:0x0744, B:229:0x0747, B:231:0x075d, B:233:0x0761, B:235:0x076c, B:247:0x07da, B:249:0x081f, B:250:0x0824, B:252:0x082c, B:255:0x0837, B:257:0x083b, B:259:0x0847, B:261:0x08ab, B:262:0x08b0, B:263:0x08bc, B:265:0x08c6, B:266:0x08cd, B:268:0x08d7, B:269:0x08de, B:270:0x08e9, B:272:0x08ef, B:274:0x091e, B:275:0x092e, B:277:0x0936, B:279:0x093f, B:281:0x0945, B:285:0x0957, B:287:0x0979, B:290:0x098d, B:292:0x0993, B:295:0x09af, B:294:0x0997, B:236:0x0778, B:238:0x078a, B:240:0x078e, B:242:0x07a0, B:246:0x07d7, B:243:0x07ba, B:245:0x07c0, B:216:0x0701, B:218:0x070b, B:220:0x0713, B:184:0x062a, B:109:0x0319, B:110:0x033a, B:115:0x0364, B:117:0x0370, B:114:0x0353, B:100:0x02d4, B:91:0x0289, B:92:0x02a9), top: B:301:0x01db, inners: #1, #2 }] */
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m8297(C4913 c4913, C4977 c4977) throws Throwable {
        long j;
        String str;
        String str2;
        String str3;
        String str4;
        Object obj;
        long jM8217;
        C4906 c4906M8364;
        C4909 c4909M8375;
        List<Integer> listM8144;
        String str5;
        C5036 c5036M8346;
        long jLongValue;
        boolean z;
        Object obj2;
        String str6;
        int i;
        C5036 c5036;
        int i2;
        Iterator it;
        int i3;
        C4755 c4755M8343;
        C4913 c49132 = c4913;
        C0567.m1910(c4977);
        C0567.m1926(c4977.f15049);
        long jNanoTime = System.nanoTime();
        m8310();
        m8305();
        String str7 = c4977.f15049;
        m8303();
        if (C4833.m8127(c4913, c4977)) {
            if (!c4977.f15056) {
                m8293(c4977);
                return;
            }
            boolean z2 = true;
            if (m8294().m8075(str7, c49132.f14822)) {
                this.f14718.mo8165().m8048().m8036("Dropping blacklisted event. appId", C4794.m8038(str7), this.f14718.m8505().m8110(c49132.f14822));
                if (!m8294().m8079(str7) && !m8294().m8080(str7)) {
                    z2 = false;
                }
                if (!z2 && !"_err".equals(c49132.f14822)) {
                    this.f14718.m8504().m8244(11, "_ev", c49132.f14822, 0);
                }
                if (!z2 || (c4755M8343 = m8301().m8343(str7)) == null || Math.abs(((C4312) this.f14718.mo8164()).m7211() - Math.max(c4755M8343.m7964(), c4755M8343.m7963())) <= C4915.f14853.m8054(null).longValue()) {
                    return;
                }
                this.f14718.mo8165().m8050().m8034("Fetching config for blacklisted app");
                m8285(c4755M8343);
                return;
            }
            if (C4473.m7490() && this.f14718.m8500().m8177(C4915.f14918)) {
                String str8 = c49132.f14822;
                String str9 = c49132.f14824;
                Bundle bundleM8371 = c49132.f14823.m8371();
                long j2 = c49132.f14825;
                C4887 c4887M8504 = this.f14718.m8504();
                str = "_err";
                str2 = "_ev";
                j = jNanoTime;
                int iM8174 = this.f14718.m8500().m8174(str7, C4915.f14862, 25, 100);
                Iterator it2 = new TreeSet(bundleM8371.keySet()).iterator();
                int i4 = 0;
                while (it2.hasNext()) {
                    String str10 = (String) it2.next();
                    if (C4887.m8233(str10)) {
                        int i5 = i4 + 1;
                        if (i5 > iM8174) {
                            it = it2;
                            StringBuilder sb = new StringBuilder(48);
                            sb.append("Event can't contain more than ");
                            sb.append(iM8174);
                            sb.append(" params");
                            i2 = iM8174;
                            i3 = i5;
                            c4887M8504.mo8165().m8047().m8036(sb.toString(), c4887M8504.m8161().m8110(str8), c4887M8504.m8161().m8109(bundleM8371));
                            C4887.m8224(bundleM8371, 5);
                            bundleM8371.remove(str10);
                        } else {
                            i2 = iM8174;
                            it = it2;
                            i3 = i5;
                        }
                        i4 = i3;
                    } else {
                        i2 = iM8174;
                        it = it2;
                    }
                    it2 = it;
                    iM8174 = i2;
                }
                c49132 = new C4913(str8, new C4908(new Bundle(bundleM8371)), str9, j2);
            } else {
                j = jNanoTime;
                str = "_err";
                str2 = "_ev";
            }
            if (this.f14718.mo8165().m8044(2)) {
                this.f14718.mo8165().m8051().m8035("Logging event", this.f14718.m8505().m8111(c49132));
            }
            m8301().m8358();
            try {
                m8293(c4977);
                boolean z3 = "ecommerce_purchase".equals(c49132.f14822) || ((C4606.m7638() && this.f14718.m8500().m8177(C4915.f14917)) && ("purchase".equals(c49132.f14822) || "refund".equals(c49132.f14822)));
                if ("_iap".equals(c49132.f14822) || z3) {
                    String strM8374 = c49132.f14823.m8374("currency");
                    if (z3) {
                        double dDoubleValue = c49132.f14823.m8373("value").doubleValue() * 1000000.0d;
                        if (dDoubleValue == 0.0d) {
                            dDoubleValue = c49132.f14823.m8372("value").longValue() * 1000000.0d;
                        }
                        if (dDoubleValue > 9.223372036854776E18d || dDoubleValue < -9.223372036854776E18d) {
                            this.f14718.mo8165().m8048().m8036("Data lost. Currency value is too big. appId", C4794.m8038(str7), Double.valueOf(dDoubleValue));
                            str3 = "_sno";
                            str4 = str;
                            obj = null;
                            z = false;
                            if (!z) {
                                m8301().m8353();
                                return;
                            }
                        } else {
                            jLongValue = Math.round(dDoubleValue);
                            if (C4606.m7638() && this.f14718.m8500().m8177(C4915.f14917) && "refund".equals(c49132.f14822)) {
                                jLongValue = -jLongValue;
                            }
                        }
                    } else {
                        jLongValue = c49132.f14823.m8372("value").longValue();
                    }
                    if (!TextUtils.isEmpty(strM8374)) {
                        String upperCase = strM8374.toUpperCase(Locale.US);
                        if (upperCase.matches("[A-Z]{3}")) {
                            String strConcat = upperCase.length() != 0 ? "_ltv_".concat(upperCase) : new String("_ltv_");
                            C5036 c5036M83462 = m8301().m8346(str7, strConcat);
                            if (c5036M83462 == null || !(c5036M83462.f15175 instanceof Long)) {
                                str3 = "_sno";
                                str4 = str;
                                str6 = null;
                                i = 0;
                                C4900 c4900M8301 = m8301();
                                int iM8179 = this.f14718.m8500().m8179(str7, C4915.f14858) - 1;
                                C0567.m1926(str7);
                                c4900M8301.mo8008();
                                c4900M8301.m8155();
                                try {
                                    c4900M8301.m8354().execSQL("delete from user_attributes where app_id=? and name in (select name from user_attributes where app_id=? and name like '_ltv_%' order by set_timestamp desc limit ?,10);", new String[]{str7, str7, String.valueOf(iM8179)});
                                } catch (SQLiteException e) {
                                    c4900M8301.mo8165().m8046().m8036("Error pruning currencies. appId", C4794.m8038(str7), e);
                                }
                                c5036 = new C5036(str7, c49132.f14824, strConcat, ((C4312) this.f14718.mo8164()).m7211(), Long.valueOf(jLongValue));
                            } else {
                                str3 = "_sno";
                                str6 = null;
                                str4 = str;
                                c5036 = new C5036(str7, c49132.f14824, strConcat, ((C4312) this.f14718.mo8164()).m7211(), Long.valueOf(((Long) c5036M83462.f15175).longValue() + jLongValue));
                                i = 0;
                            }
                            obj2 = str6;
                            if (!m8301().m8340(c5036)) {
                                this.f14718.mo8165().m8046().m8037("Too many unique user properties are set. Ignoring user property. appId", C4794.m8038(str7), this.f14718.m8505().m8114(c5036.f15173), c5036.f15175);
                                this.f14718.m8504().m8244(9, str6, str6, i);
                                obj2 = str6;
                            }
                        } else {
                            str3 = "_sno";
                            str4 = str;
                            obj2 = null;
                        }
                        z = true;
                        obj = obj2;
                        if (!z) {
                        }
                    }
                } else {
                    str3 = "_sno";
                    str4 = str;
                    obj = null;
                }
                boolean zM8233 = C4887.m8233(c49132.f14822);
                boolean zEquals = str4.equals(c49132.f14822);
                if (C4606.m7638() && this.f14718.m8500().m8184(c4977.f15049, C4915.f14913)) {
                    this.f14718.m8504();
                    jM8217 = C4887.m8217(c49132.f14823) + 1;
                } else {
                    jM8217 = 1;
                }
                String str11 = str2;
                C4902 c4902M8327 = m8301().m8327(m8311(), str7, jM8217, true, zM8233, false, zEquals, false);
                long jIntValue = c4902M8327.f14785 - ((long) C4915.f14838.m8054((Integer) obj).intValue());
                if (jIntValue > 0) {
                    if (jIntValue % 1000 == 1) {
                        this.f14718.mo8165().m8046().m8036("Data loss. Too many events logged. appId, count", C4794.m8038(str7), Long.valueOf(c4902M8327.f14785));
                    }
                    m8301().m8353();
                    return;
                }
                if (zM8233) {
                    long jIntValue2 = c4902M8327.f14784 - ((long) C4915.f14840.m8054((Integer) obj).intValue());
                    if (jIntValue2 > 0) {
                        if (jIntValue2 % 1000 == 1) {
                            this.f14718.mo8165().m8046().m8036("Data loss. Too many public events logged. appId, count", C4794.m8038(str7), Long.valueOf(c4902M8327.f14784));
                        }
                        this.f14718.m8504().m8244(16, str11, c49132.f14822, 0);
                        m8301().m8353();
                        return;
                    }
                }
                if (zEquals) {
                    long jMax = c4902M8327.f14787 - ((long) Math.max(0, Math.min(1000000, this.f14718.m8500().m8179(c4977.f15049, C4915.f14839))));
                    if (jMax > 0) {
                        if (jMax == 1) {
                            this.f14718.mo8165().m8046().m8036("Too many error events logged. appId, count", C4794.m8038(str7), Long.valueOf(c4902M8327.f14787));
                        }
                        m8301().m8353();
                        return;
                    }
                }
                Bundle bundleM83712 = c49132.f14823.m8371();
                this.f14718.m8504().m8246(bundleM83712, "_o", c49132.f14824);
                if (this.f14718.m8504().m8268(str7)) {
                    this.f14718.m8504().m8246(bundleM83712, "_dbg", (Object) 1L);
                    this.f14718.m8504().m8246(bundleM83712, "_r", (Object) 1L);
                }
                if ("_s".equals(c49132.f14822) && (c5036M8346 = m8301().m8346(c4977.f15049, (str5 = str3))) != null && (c5036M8346.f15175 instanceof Long)) {
                    this.f14718.m8504().m8246(bundleM83712, str5, c5036M8346.f15175);
                }
                long jM8345 = m8301().m8345(str7);
                if (jM8345 > 0) {
                    this.f14718.mo8165().m8048().m8036("Data lost. Too many events stored on disk, deleted. appId", C4794.m8038(str7), Long.valueOf(jM8345));
                }
                String str12 = "_r";
                C4906 c4906 = new C4906(this.f14718, c49132.f14824, str7, c49132.f14822, c49132.f14825, 0L, bundleM83712);
                C4909 c4909M8329 = m8301().m8329(str7, c4906.f14797);
                if (c4909M8329 != null) {
                    c4906M8364 = c4906.m8364(this.f14718, c4909M8329.f14814);
                    c4909M8375 = c4909M8329.m8375(c4906M8364.f14799);
                } else if (m8301().m8347(str7) >= this.f14718.m8500().m8173(str7) && zM8233) {
                    this.f14718.mo8165().m8046().m8037("Too many event names used, ignoring event. appId, name, supported count", C4794.m8038(str7), this.f14718.m8505().m8110(c4906.f14797), Integer.valueOf(this.f14718.m8500().m8173(str7)));
                    this.f14718.m8504().m8244(8, (String) null, (String) null, 0);
                    return;
                } else {
                    c4909M8375 = new C4909(str7, c4906.f14797, c4906.f14799);
                    c4906M8364 = c4906;
                }
                m8301().m8332(c4909M8375);
                m8310();
                m8305();
                C0567.m1910(c4906M8364);
                C0567.m1910(c4977);
                C0567.m1926(c4906M8364.f14796);
                boolean z4 = false;
                C0567.m1920(c4906M8364.f14796.equals(c4977.f15049));
                C4642.C4643 c4643M7713 = C4642.m7713();
                c4643M7713.m7721();
                c4643M7713.m7726("android");
                if (!TextUtils.isEmpty(c4977.f15049)) {
                    c4643M7713.m7748(c4977.f15049);
                }
                if (!TextUtils.isEmpty(c4977.f15052)) {
                    c4643M7713.m7745(c4977.f15052);
                }
                if (!TextUtils.isEmpty(c4977.f15051)) {
                    c4643M7713.m7751(c4977.f15051);
                }
                if (c4977.f15058 != -2147483648L) {
                    c4643M7713.m7749((int) c4977.f15058);
                }
                c4643M7713.m7747(c4977.f15053);
                if (!TextUtils.isEmpty(c4977.f15050)) {
                    c4643M7713.m7760(c4977.f15050);
                }
                if (C4538.m7580() && this.f14718.m8500().m8184(c4977.f15049, C4915.f14896)) {
                    if (TextUtils.isEmpty(c4643M7713.m7775()) && !TextUtils.isEmpty(c4977.f15070)) {
                        c4643M7713.m7766(c4977.f15070);
                    }
                    if (TextUtils.isEmpty(c4643M7713.m7775()) && TextUtils.isEmpty(c4643M7713.m7778()) && !TextUtils.isEmpty(c4977.f15066)) {
                        c4643M7713.m7764(c4977.f15066);
                    }
                } else if (TextUtils.isEmpty(c4643M7713.m7775()) && !TextUtils.isEmpty(c4977.f15066)) {
                    c4643M7713.m7764(c4977.f15066);
                }
                if (c4977.f15054 != 0) {
                    c4643M7713.m7753(c4977.f15054);
                }
                c4643M7713.m7759(c4977.f15068);
                if (this.f14718.m8500().m8184(c4977.f15049, C4915.f14877) && (listM8144 = m8303().m8144()) != null) {
                    c4643M7713.m7737(listM8144);
                }
                Pair<String, Boolean> pairM8194 = this.f14718.m8501().m8194(c4977.f15049);
                if (TextUtils.isEmpty((CharSequence) pairM8194.first)) {
                    if (!this.f14718.m8509().m8365(this.f14718.mo8166()) && c4977.f15064) {
                        String string = Settings.Secure.getString(this.f14718.mo8166().getContentResolver(), "android_id");
                        if (string == null) {
                            this.f14718.mo8165().m8048().m8035("null secure ID. appId", C4794.m8038(c4643M7713.m7773()));
                            string = "null";
                        } else if (string.isEmpty()) {
                            this.f14718.mo8165().m8048().m8035("empty secure ID. appId", C4794.m8038(c4643M7713.m7773()));
                        }
                        c4643M7713.m7762(string);
                    }
                } else if (c4977.f15063) {
                    c4643M7713.m7754((String) pairM8194.first);
                    if (pairM8194.second != null) {
                        c4643M7713.m7730(((Boolean) pairM8194.second).booleanValue());
                    }
                }
                this.f14718.m8509().m8482();
                c4643M7713.m7738(Build.MODEL);
                this.f14718.m8509().m8482();
                c4643M7713.m7734(Build.VERSION.RELEASE);
                c4643M7713.m7743((int) this.f14718.m8509().m8366());
                c4643M7713.m7742(this.f14718.m8509().m8367());
                if (!this.f14718.m8500().m8177(C4915.f14920)) {
                    c4643M7713.m7757(c4977.f15060);
                }
                if (this.f14718.m8495()) {
                    c4643M7713.m7773();
                    if (!TextUtils.isEmpty(null)) {
                        c4643M7713.m7777();
                        throw null;
                    }
                }
                C4755 c4755M83432 = m8301().m8343(c4977.f15049);
                if (c4755M83432 == null) {
                    c4755M83432 = new C4755(this.f14718, c4977.f15049);
                    c4755M83432.m7919(this.f14718.m8504().m8275());
                    c4755M83432.m7938(c4977.f15059);
                    c4755M83432.m7924(c4977.f15050);
                    c4755M83432.m7935(this.f14718.m8501().m8197(c4977.f15049));
                    c4755M83432.m7940(0L);
                    c4755M83432.m7917(0L);
                    c4755M83432.m7923(0L);
                    c4755M83432.m7941(c4977.f15051);
                    c4755M83432.m7926(c4977.f15058);
                    c4755M83432.m7944(c4977.f15052);
                    c4755M83432.m7930(c4977.f15053);
                    c4755M83432.m7934(c4977.f15054);
                    c4755M83432.m7921(c4977.f15056);
                    if (!this.f14718.m8500().m8177(C4915.f14920)) {
                        c4755M83432.m7949(c4977.f15060);
                    }
                    c4755M83432.m7937(c4977.f15068);
                    m8301().m8331(c4755M83432);
                }
                if (!TextUtils.isEmpty(c4755M83432.m7942())) {
                    c4643M7713.m7756(c4755M83432.m7942());
                }
                if (!TextUtils.isEmpty(c4755M83432.m7952())) {
                    c4643M7713.m7761(c4755M83432.m7952());
                }
                List<C5036> listM8323 = m8301().m8323(c4977.f15049);
                for (int i6 = 0; i6 < listM8323.size(); i6++) {
                    C4665.C4666 c4666M7799 = C4665.m7799();
                    c4666M7799.m7802(listM8323.get(i6).f15173);
                    c4666M7799.m7801(listM8323.get(i6).f15174);
                    m8303().m8140(c4666M7799, listM8323.get(i6).f15175);
                    c4643M7713.m7728(c4666M7799);
                }
                try {
                    long jM8320 = m8301().m8320((C4642) ((AbstractC4421) c4643M7713.m7370()));
                    C4900 c4900M83012 = m8301();
                    if (c4906M8364.f14801 != null) {
                        Iterator<String> it3 = c4906M8364.f14801.iterator();
                        while (true) {
                            C4911 c4911 = (C4911) it3;
                            if (!c4911.hasNext()) {
                                boolean zM8077 = m8294().m8077(c4906M8364.f14796, c4906M8364.f14797);
                                C4902 c4902M8328 = m8301().m8328(m8311(), c4906M8364.f14796, false, false);
                                if (zM8077 && c4902M8328.f14788 < this.f14718.m8500().m8178(c4906M8364.f14796)) {
                                    break;
                                }
                            } else {
                                String str13 = str12;
                                if (str13.equals((String) c4911.next())) {
                                    break;
                                } else {
                                    str12 = str13;
                                }
                            }
                        }
                        z4 = true;
                    }
                    if (c4900M83012.m8339(c4906M8364, jM8320, z4)) {
                        this.f14721 = 0L;
                    }
                } catch (IOException e2) {
                    this.f14718.mo8165().m8046().m8036("Data loss. Failed to insert raw event metadata. appId", C4794.m8038(c4643M7713.m7773()), e2);
                }
                m8301().m8353();
                m8301().m8359();
                m8313();
                this.f14718.mo8165().m8051().m8035("Background event processing time, ms", Long.valueOf(((System.nanoTime() - j) + 500000) / 1000000));
            } finally {
                m8301().m8359();
            }
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m8298(C4999 c4999, C4977 c4977) throws Throwable {
        m8310();
        m8305();
        if (m8300(c4977)) {
            if (!c4977.f15056) {
                m8293(c4977);
                return;
            }
            if ("_npa".equals(c4999.f15117) && c4977.f15067 != null) {
                this.f14718.mo8165().f14451.m8034("Falling back to manifest metadata value for ad personalization");
                if (((C4312) this.f14718.f15022) == null) {
                    throw null;
                }
                m8289(new C4999("_npa", System.currentTimeMillis(), Long.valueOf(c4977.f15067.booleanValue() ? 1L : 0L), "auto"), c4977);
                return;
            }
            this.f14718.mo8165().f14451.m8035("Removing user property", this.f14718.m8505().m8114(c4999.f15117));
            m8301().m8358();
            try {
                m8293(c4977);
                m8301().m8344(c4977.f15049, c4999.f15117);
                m8301().m8353();
                this.f14718.mo8165().f14451.m8035("User property removed", this.f14718.m8505().m8114(c4999.f15117));
            } finally {
                m8301().m8359();
            }
        }
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final C5039 m8299() {
        m8280(this.f14711);
        return this.f14711;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final boolean m8300(C4977 c4977) {
        return (C4538.m7580() && this.f14718.f15015.m8183(c4977.f15049, C4915.f14896)) ? (TextUtils.isEmpty(c4977.f15050) && TextUtils.isEmpty(c4977.f15070) && TextUtils.isEmpty(c4977.f15066)) ? false : true : (TextUtils.isEmpty(c4977.f15050) && TextUtils.isEmpty(c4977.f15066)) ? false : true;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final C4900 m8301() {
        m8280(this.f14712);
        return this.f14712;
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final C4957 m8302() {
        m8280(this.f14715);
        return this.f14715;
    }

    @Override // p138.p176.p177.p242.p265.p266.InterfaceC4973
    /* JADX INFO: renamed from: ރ */
    public final C4785 mo8162() {
        return this.f14718.f15014;
    }

    @Override // p138.p176.p177.p242.p265.p266.InterfaceC4973
    /* JADX INFO: renamed from: ބ */
    public final C4771 mo8163() {
        return this.f14718.mo8163();
    }

    @Override // p138.p176.p177.p242.p265.p266.InterfaceC4973
    /* JADX INFO: renamed from: ޅ */
    public final InterfaceC4311 mo8164() {
        return this.f14718.f15022;
    }

    @Override // p138.p176.p177.p242.p265.p266.InterfaceC4973
    /* JADX INFO: renamed from: ކ */
    public final C4794 mo8165() {
        return this.f14718.mo8165();
    }

    @Override // p138.p176.p177.p242.p265.p266.InterfaceC4973
    /* JADX INFO: renamed from: އ */
    public final Context mo8166() {
        return this.f14718.f15009;
    }

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final C4833 m8303() {
        m8280(this.f14716);
        return this.f14716;
    }

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public final C4824 m8304() {
        return this.f14718.m8505();
    }

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final void m8305() {
        if (!this.f14719) {
            throw new IllegalStateException("UploadController is not initialized");
        }
    }

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final void m8306() {
        C4755 c4755M8343;
        String str;
        m8310();
        m8305();
        this.f14727 = true;
        boolean z = false;
        try {
            C4785 c4785 = this.f14718.f15014;
            Boolean bool = this.f14718.m8508().f15085;
            if (bool == null) {
                this.f14718.mo8165().f14447.m8034("Upload data called on the client side before use of service was decided");
                this.f14727 = false;
                m8282();
                return;
            }
            if (bool.booleanValue()) {
                this.f14718.mo8165().f14444.m8034("Upload called in the client side when service should be used");
                this.f14727 = false;
                m8282();
                return;
            }
            if (this.f14721 > 0) {
                m8313();
                this.f14727 = false;
                m8282();
                return;
            }
            m8310();
            if (this.f14730 != null) {
                this.f14718.mo8165().f14452.m8034("Uploading requested multiple times");
                this.f14727 = false;
                m8282();
                return;
            }
            if (!m8299().m8534()) {
                this.f14718.mo8165().f14452.m8034("Network not connected, ignoring upload request");
                m8313();
                this.f14727 = false;
                m8282();
                return;
            }
            if (((C4312) this.f14718.f15022) == null) {
                throw null;
            }
            long jCurrentTimeMillis = System.currentTimeMillis();
            int iM8179 = this.f14718.f15015.m8179(null, C4915.f14870);
            long jLongValue = jCurrentTimeMillis - C4915.f14831.m8054(null).longValue();
            for (int i = 0; i < iM8179 && m8290(jLongValue); i++) {
            }
            long jM8316 = this.f14718.m8501().f14648.m8316();
            if (jM8316 != 0) {
                this.f14718.mo8165().f14451.m8035("Uploading events. Elapsed time since last upload attempt (ms)", Long.valueOf(Math.abs(jCurrentTimeMillis - jM8316)));
            }
            String strM8355 = m8301().m8355();
            if (!TextUtils.isEmpty(strM8355)) {
                if (this.f14732 == -1) {
                    this.f14732 = m8301().m8356();
                }
                List<Pair<C4642, Long>> listM8324 = m8301().m8324(strM8355, this.f14718.f15015.m8179(strM8355, C4915.f14834), Math.max(0, this.f14718.f15015.m8179(strM8355, C4915.f14835)));
                if (!listM8324.isEmpty()) {
                    Iterator<Pair<C4642, Long>> it = listM8324.iterator();
                    while (true) {
                        if (!it.hasNext()) {
                            str = null;
                            break;
                        }
                        C4642 c4642 = (C4642) it.next().first;
                        if (!TextUtils.isEmpty(c4642.zzw)) {
                            str = c4642.zzw;
                            break;
                        }
                    }
                    if (str != null) {
                        int i2 = 0;
                        while (true) {
                            if (i2 >= listM8324.size()) {
                                break;
                            }
                            C4642 c46422 = (C4642) listM8324.get(i2).first;
                            if (!TextUtils.isEmpty(c46422.zzw) && !c46422.zzw.equals(str)) {
                                listM8324 = listM8324.subList(0, i2);
                                break;
                            }
                            i2++;
                        }
                    }
                    C4640.C4641 c4641M7362 = C4640.zzd.m7362();
                    int size = listM8324.size();
                    ArrayList arrayList = new ArrayList(listM8324.size());
                    boolean zEquals = "1".equals(this.f14718.f15015.f14633.mo8069(strM8355, "gaia_collection_enabled"));
                    int i3 = 0;
                    while (i3 < size) {
                        C4642.C4643 c4643M7363 = ((C4642) listM8324.get(i3).first).m7363();
                        arrayList.add((Long) listM8324.get(i3).second);
                        this.f14718.f15015.m8186();
                        c4643M7363.m7750(28000L);
                        c4643M7363.m7724(jCurrentTimeMillis);
                        C4785 c47852 = this.f14718.f15014;
                        c4643M7363.m7735(z);
                        if (!zEquals) {
                            if (c4643M7363.f13775) {
                                c4643M7363.m7368();
                                c4643M7363.f13775 = z;
                            }
                            C4642 c46423 = (C4642) c4643M7363.f13774;
                            c46423.zzc &= Integer.MAX_VALUE;
                            c46423.zzam = C4642.zzav.zzam;
                        }
                        if (this.f14718.f15015.m8183(strM8355, C4915.f14879)) {
                            long jM8129 = m8303().m8129(((C4642) ((AbstractC4421) c4643M7363.m7370())).m7406());
                            if (c4643M7363.f13775) {
                                c4643M7363.m7368();
                                c4643M7363.f13775 = z;
                            }
                            C4642 c46424 = (C4642) c4643M7363.f13774;
                            c46424.zzd |= 32;
                            c46424.zzat = jM8129;
                        }
                        c4641M7362.m7689(c4643M7363);
                        i3++;
                        z = false;
                    }
                    String strM8133 = this.f14718.mo8165().m8044(2) ? m8303().m8133((C4640) ((AbstractC4421) c4641M7362.m7370())) : null;
                    m8303();
                    byte[] bArrM7406 = ((C4640) ((AbstractC4421) c4641M7362.m7370())).m7406();
                    String strM8054 = C4915.f14844.m8054(null);
                    try {
                        URL url = new URL(strM8054);
                        C0567.m1920(!arrayList.isEmpty());
                        if (this.f14730 != null) {
                            this.f14718.mo8165().f14444.m8034("Set uploading progress before finishing the previous upload");
                        } else {
                            this.f14730 = new ArrayList(arrayList);
                        }
                        this.f14718.m8501().f14649.m8317(jCurrentTimeMillis);
                        this.f14718.mo8165().f14452.m8037("Uploading data. app, uncompressed size, data", size > 0 ? ((C4640) c4641M7362.f13774).zzc.get(0).zzs : "?", Integer.valueOf(bArrM7406.length), strM8133);
                        this.f14726 = true;
                        C5039 c5039M8299 = m8299();
                        C4855 c4855 = new C4855(this, strM8355);
                        c5039M8299.mo8008();
                        c5039M8299.m8155();
                        C0567.m1910(url);
                        C0567.m1910(bArrM7406);
                        C0567.m1910(c4855);
                        c5039M8299.mo8163().m8007(new RunnableC4819(c5039M8299, strM8355, url, bArrM7406, null, c4855));
                    } catch (MalformedURLException unused) {
                        this.f14718.mo8165().f14444.m8036("Failed to parse upload URL. Not uploading. appId", C4794.m8038(strM8355), strM8054);
                    }
                }
                this.f14727 = z;
                m8282();
            }
            this.f14732 = -1L;
            String strM8322 = m8301().m8322(jCurrentTimeMillis - C4915.f14831.m8054(null).longValue());
            if (!TextUtils.isEmpty(strM8322) && (c4755M8343 = m8301().m8343(strM8322)) != null) {
                m8285(c4755M8343);
            }
            z = false;
            this.f14727 = z;
            m8282();
        } catch (Throwable th) {
            this.f14727 = false;
            m8282();
            throw th;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:26:0x00a3  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x010b  */
    /* JADX WARN: Removed duplicated region for block: B:46:0x0122  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x018b  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x01a1  */
    /* JADX WARN: Removed duplicated region for block: B:70:? A[RETURN, SYNTHETIC] */
    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m8307() {
        boolean z;
        FileLock fileLockTryLock;
        int i;
        int i2;
        int i3;
        FileLock fileLock;
        m8310();
        m8305();
        if (this.f14720) {
            return;
        }
        boolean z2 = true;
        this.f14720 = true;
        m8310();
        if (this.f14718.f15015.m8177(C4915.f14894) && (fileLock = this.f14728) != null && fileLock.isValid()) {
            this.f14718.mo8165().f14452.m8034("Storage concurrent access okay");
        } else {
            try {
                FileChannel channel = new RandomAccessFile(new File(this.f14718.f15009.getFilesDir(), "google_app_measurement.db"), "rw").getChannel();
                this.f14729 = channel;
                fileLockTryLock = channel.tryLock();
                this.f14728 = fileLockTryLock;
            } catch (FileNotFoundException e) {
                this.f14718.mo8165().f14444.m8035("Failed to acquire storage lock", e);
            } catch (IOException e2) {
                this.f14718.mo8165().f14444.m8035("Failed to access storage lock file", e2);
            } catch (OverlappingFileLockException e3) {
                this.f14718.mo8165().f14447.m8035("Storage lock already acquired", e3);
            }
            if (fileLockTryLock != null) {
                this.f14718.mo8165().f14452.m8034("Storage concurrent access okay");
            } else {
                this.f14718.mo8165().f14444.m8034("Storage concurrent data access panic");
                z = false;
                if (z) {
                    return;
                }
                FileChannel fileChannel = this.f14729;
                m8310();
                if (fileChannel == null || !fileChannel.isOpen()) {
                    this.f14718.mo8165().f14444.m8034("Bad channel to read from");
                } else {
                    ByteBuffer byteBufferAllocate = ByteBuffer.allocate(4);
                    try {
                        fileChannel.position(0L);
                        i3 = fileChannel.read(byteBufferAllocate);
                    } catch (IOException e4) {
                        this.f14718.mo8165().f14444.m8035("Failed to read from channel", e4);
                    }
                    if (i3 == 4) {
                        byteBufferAllocate.flip();
                        i = byteBufferAllocate.getInt();
                        C4828 c4828M8510 = this.f14718.m8510();
                        c4828M8510.m8066();
                        i2 = c4828M8510.f14526;
                        m8310();
                        if (i <= i2) {
                            this.f14718.mo8165().f14444.m8036("Panic: can't downgrade version. Previous, current version", Integer.valueOf(i), Integer.valueOf(i2));
                            return;
                        }
                        if (i >= i2) {
                            return;
                        }
                        FileChannel fileChannel2 = this.f14729;
                        m8310();
                        if (fileChannel2 != null && fileChannel2.isOpen()) {
                            ByteBuffer byteBufferAllocate2 = ByteBuffer.allocate(4);
                            byteBufferAllocate2.putInt(i2);
                            byteBufferAllocate2.flip();
                            try {
                                fileChannel2.truncate(0L);
                                this.f14718.f15015.m8177(C4915.f14907);
                                fileChannel2.write(byteBufferAllocate2);
                                fileChannel2.force(true);
                                if (fileChannel2.size() != 4) {
                                    this.f14718.mo8165().f14444.m8035("Error writing to channel. Bytes written", Long.valueOf(fileChannel2.size()));
                                }
                            } catch (IOException e5) {
                                this.f14718.mo8165().f14444.m8035("Failed to write to channel", e5);
                                z2 = false;
                            }
                            if (z2) {
                                this.f14718.mo8165().f14444.m8036("Storage version upgrade failed. Previous, current version", Integer.valueOf(i), Integer.valueOf(i2));
                                return;
                            } else {
                                this.f14718.mo8165().f14452.m8036("Storage version upgraded. Previous, current version", Integer.valueOf(i), Integer.valueOf(i2));
                                return;
                            }
                        }
                        this.f14718.mo8165().f14444.m8034("Bad channel to read from");
                        z2 = false;
                        if (z2) {
                        }
                    } else if (i3 != -1) {
                        this.f14718.mo8165().f14447.m8035("Unexpected data length. Bytes read", Integer.valueOf(i3));
                    }
                }
                i = 0;
                C4828 c4828M85102 = this.f14718.m8510();
                c4828M85102.m8066();
                i2 = c4828M85102.f14526;
                m8310();
                if (i <= i2) {
                }
            }
        }
        z = true;
        if (z) {
        }
    }

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final C4799 m8308() {
        C4799 c4799 = this.f14713;
        if (c4799 != null) {
            return c4799;
        }
        throw new IllegalStateException("Network broadcast receiver not created");
    }

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public final C4866 m8309() {
        m8280(this.f14714);
        return this.f14714;
    }

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public final void m8310() {
        this.f14718.mo8163().mo8008();
    }

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public final long m8311() {
        if (((C4312) this.f14718.f15022) == null) {
            throw null;
        }
        long jCurrentTimeMillis = System.currentTimeMillis();
        C4874 c4874M8501 = this.f14718.m8501();
        c4874M8501.m8482();
        c4874M8501.mo8008();
        long jM8316 = c4874M8501.f14652.m8316();
        if (jM8316 == 0) {
            jM8316 = 1 + ((long) c4874M8501.m8167().m8273().nextInt(86400000));
            c4874M8501.f14652.m8317(jM8316);
        }
        return ((((jCurrentTimeMillis + jM8316) / 1000) / 60) / 60) / 24;
    }

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public final boolean m8312() {
        m8310();
        m8305();
        return ((m8301().m8341("select count(1) > 0 from raw_events", (String[]) null) > 0L ? 1 : (m8301().m8341("select count(1) > 0 from raw_events", (String[]) null) == 0L ? 0 : -1)) != 0) || !TextUtils.isEmpty(m8301().m8355());
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x00a5  */
    /* JADX WARN: Removed duplicated region for block: B:66:0x01a8  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x01c6  */
    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m8313() {
        boolean z;
        long jMax;
        long jMax2;
        boolean z2;
        m8310();
        m8305();
        if (this.f14721 > 0) {
            if (((C4312) this.f14718.f15022) == null) {
                throw null;
            }
            long jAbs = 3600000 - Math.abs(SystemClock.elapsedRealtime() - this.f14721);
            if (jAbs > 0) {
                this.f14718.mo8165().f14452.m8035("Upload has been suspended. Will update scheduling later in approximately ms", Long.valueOf(jAbs));
                m8308().m8064();
                m8309().m8169();
                return;
            }
            this.f14721 = 0L;
        }
        if (!this.f14718.m8498() || !m8312()) {
            this.f14718.mo8165().f14452.m8034("Nothing to upload or uploading impossible");
            m8308().m8064();
            m8309().m8169();
            return;
        }
        if (((C4312) this.f14718.f15022) == null) {
            throw null;
        }
        long jCurrentTimeMillis = System.currentTimeMillis();
        long jMax3 = Math.max(0L, C4915.f14854.m8054(null).longValue());
        if (m8301().m8341("select count(1) > 0 from raw_events where realtime = 1", (String[]) null) != 0) {
            z = true;
        } else {
            if (!(m8301().m8341("select count(1) > 0 from queue where has_realtime = 1", (String[]) null) != 0)) {
                z = false;
            }
        }
        if (z) {
            String strM8176 = this.f14718.f15015.m8176("debug.firebase.analytics.app", "");
            jMax = (TextUtils.isEmpty(strM8176) || ".none.".equals(strM8176)) ? Math.max(0L, C4915.f14848.m8054(null).longValue()) : Math.max(0L, C4915.f14849.m8054(null).longValue());
        } else {
            jMax = Math.max(0L, C4915.f14847.m8054(null).longValue());
        }
        long jM8316 = this.f14718.m8501().f14648.m8316();
        long jM83162 = this.f14718.m8501().f14649.m8316();
        long j = jMax;
        long jMax4 = Math.max(m8301().m8319("select max(bundle_end_timestamp) from queue", (String[]) null, 0L), m8301().m8319("select max(timestamp) from raw_events", (String[]) null, 0L));
        if (jMax4 != 0) {
            long jAbs2 = jCurrentTimeMillis - Math.abs(jMax4 - jCurrentTimeMillis);
            long jAbs3 = jCurrentTimeMillis - Math.abs(jM8316 - jCurrentTimeMillis);
            long jAbs4 = jCurrentTimeMillis - Math.abs(jM83162 - jCurrentTimeMillis);
            long jMax5 = Math.max(jAbs3, jAbs4);
            jMax2 = jMax3 + jAbs2;
            if (z && jMax5 > 0) {
                jMax2 = Math.min(jAbs2, jMax5) + j;
            }
            if (!m8303().m8141(jMax5, j)) {
                jMax2 = jMax5 + j;
            }
            if (jAbs4 != 0 && jAbs4 >= jAbs2) {
                int i = 0;
                while (true) {
                    z2 = false;
                    if (i >= Math.min(20, Math.max(0, C4915.f14856.m8054(null).intValue()))) {
                        jMax2 = 0;
                        break;
                    }
                    jMax2 += Math.max(0L, C4915.f14855.m8054(null).longValue()) * (1 << i);
                    if (jMax2 > jAbs4) {
                        break;
                    } else {
                        i++;
                    }
                }
            }
            if (jMax2 != 0) {
                this.f14718.mo8165().f14452.m8034("Next upload time is 0");
                m8308().m8064();
                m8309().m8169();
                return;
            }
            if (!m8299().m8534()) {
                this.f14718.mo8165().f14452.m8034("No network");
                C4799 c4799M8308 = m8308();
                c4799M8308.f14468.m8305();
                c4799M8308.f14468.mo8163().mo8008();
                if (!c4799M8308.f14469) {
                    c4799M8308.f14468.f14718.f15009.registerReceiver(c4799M8308, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
                    c4799M8308.f14470 = c4799M8308.f14468.m8299().m8534();
                    c4799M8308.f14468.mo8165().f14452.m8035("Registering connectivity change receiver. Network connected", Boolean.valueOf(c4799M8308.f14470));
                    c4799M8308.f14469 = true;
                }
                m8309().m8169();
                return;
            }
            long jM83163 = this.f14718.m8501().f14650.m8316();
            long jMax6 = Math.max(0L, C4915.f14845.m8054(null).longValue());
            if (!m8303().m8141(jM83163, jMax6)) {
                jMax2 = Math.max(jMax2, jM83163 + jMax6);
            }
            m8308().m8064();
            if (((C4312) this.f14718.f15022) == null) {
                throw null;
            }
            long jCurrentTimeMillis2 = jMax2 - System.currentTimeMillis();
            if (jCurrentTimeMillis2 <= 0) {
                jCurrentTimeMillis2 = Math.max(0L, C4915.f14850.m8054(null).longValue());
                C4898 c4898 = this.f14718.m8501().f14648;
                if (((C4312) this.f14718.f15022) == null) {
                    throw null;
                }
                c4898.m8317(System.currentTimeMillis());
            }
            this.f14718.mo8165().f14452.m8035("Upload scheduled in approximately ms", Long.valueOf(jCurrentTimeMillis2));
            C4866 c4866M8309 = m8309();
            c4866M8309.m8155();
            C4974 c4974 = c4866M8309.f14588;
            C4785 c4785 = c4974.f15014;
            Context context = c4974.f15009;
            if (!C4881.m8208(context)) {
                c4866M8309.mo8165().f14451.m8034("Receiver not registered/enabled");
            }
            if (!C4887.m8222(context)) {
                c4866M8309.mo8165().f14451.m8034("Service not registered/enabled");
            }
            c4866M8309.m8169();
            c4866M8309.mo8165().f14452.m8035("Scheduling upload, millis", Long.valueOf(jCurrentTimeMillis2));
            if (((C4312) c4866M8309.f14588.f15022) == null) {
                throw null;
            }
            long jElapsedRealtime = SystemClock.elapsedRealtime() + jCurrentTimeMillis2;
            if (jCurrentTimeMillis2 < Math.max(0L, C4915.f14851.m8054(null).longValue())) {
                if (c4866M8309.f14617.f14795 != 0) {
                    z2 = true;
                }
                if (!z2) {
                    c4866M8309.f14617.m8361(jCurrentTimeMillis2);
                }
            }
            C4974 c49742 = c4866M8309.f14588;
            C4785 c47852 = c49742.f15014;
            if (Build.VERSION.SDK_INT < 24) {
                c4866M8309.f14616.setInexactRepeating(2, jElapsedRealtime, Math.max(C4915.f14846.m8054(null).longValue(), jCurrentTimeMillis2), c4866M8309.m8171());
                return;
            }
            Context context2 = c49742.f15009;
            ComponentName componentName = new ComponentName(context2, "com.google.android.gms.measurement.AppMeasurementJobService");
            int iM8170 = c4866M8309.m8170();
            PersistableBundle persistableBundle = new PersistableBundle();
            persistableBundle.putString("action", "com.google.android.gms.measurement.UPLOAD");
            C4378.m7276(context2, new JobInfo.Builder(iM8170, componentName).setMinimumLatency(jCurrentTimeMillis2).setOverrideDeadline(jCurrentTimeMillis2 << 1).setExtras(persistableBundle).build(), "com.google.android.gms", "UploadAlarm");
            return;
        }
        jMax2 = 0;
        z2 = false;
        if (jMax2 != 0) {
        }
    }
}
