Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9

以下内容为反编译后的 a.java 源代码,内容仅作参考


package com.bugsnag.android;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.RemoteException;
import androidx.annotation.NonNull;
import com.bugsnag.android.internal.TaskType;
import com.bugsnag.android.m;
import com.bugsnag.android.r;
import java.io.File;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Pattern;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.EmptyList;
import kotlin.collections.EmptySet;
import kotlin.jvm.internal.Intrinsics;
import myobfuscated.nf.a2;
import myobfuscated.nf.c0;
import myobfuscated.nf.c2;
import myobfuscated.nf.d1;
import myobfuscated.nf.f0;
import myobfuscated.nf.g0;
import myobfuscated.nf.g2;
import myobfuscated.nf.h1;
import myobfuscated.nf.h2;
import myobfuscated.nf.i0;
import myobfuscated.nf.i1;
import myobfuscated.nf.j1;
import myobfuscated.nf.m1;
import myobfuscated.nf.o1;
import myobfuscated.nf.p0;
import myobfuscated.nf.p1;
import myobfuscated.nf.p2;
import myobfuscated.nf.q2;
import myobfuscated.nf.r1;
import myobfuscated.nf.r2;
import myobfuscated.nf.s1;
import myobfuscated.nf.t2;
import myobfuscated.nf.u;
import myobfuscated.nf.u0;
import myobfuscated.nf.v1;
import myobfuscated.nf.w;
import myobfuscated.nf.w0;
import myobfuscated.nf.w1;
import myobfuscated.nf.x;
import myobfuscated.nf.x0;
import myobfuscated.nf.x1;
import myobfuscated.nf.y;
import myobfuscated.nf.y0;
import myobfuscated.nf.y1;
import myobfuscated.nf.z;
import myobfuscated.nf.z0;
import myobfuscated.nf.z1;
import myobfuscated.of.b;
import myobfuscated.of.g;
public final class a {
    public final z0 A;
    public final myobfuscated.of.h a;
    public final p1 b;
    public final d1 c;
    public final myobfuscated.of.j d;
    public final f0 e;
    public final myobfuscated.nf.o f;
    public final r2 g;
    public final Map<String, Object> h;
    public final Context i;
    @NonNull
    public final p0 j;
    @NonNull
    public final myobfuscated.nf.f k;
    @NonNull
    public final BreadcrumbState l;
    @NonNull
    public final o1 m = new myobfuscated.nf.h();
    @NonNull
    public final g n;
    public final p o;
    public final h2 p;
    public final m1 q;
    public final c0 r;
    public final c s;
    public final x t;
    public final a2 u;
    public final s1 v;
    public final h1 w;
    public final i1 x;
    public final j1 y;
    public final myobfuscated.of.b z;

    public a(@NonNull z zVar, @NonNull Context context) {
        Pair pair;
        b.a aVar;
        Method method;
        SharedPreferences.Editor clear;
        myobfuscated.of.b bVar = new myobfuscated.of.b();
        this.z = bVar;
        myobfuscated.pf.b bVar2 = new myobfuscated.pf.b(context);
        Context context2 = bVar2.b;
        this.i = context2;
        this.v = zVar.a.D;
        c0 c0Var = new c0(context2, new myobfuscated.nf.p(this));
        this.r = c0Var;
        myobfuscated.pf.a aVar2 = new myobfuscated.pf.a(bVar2, zVar, c0Var, bVar);
        myobfuscated.of.h hVar = aVar2.b;
        this.a = hVar;
        m1 m1Var = hVar.t;
        this.q = m1Var;
        if (!(context instanceof Application)) {
            m1Var.g("You should initialize Bugsnag from the onCreate() callback of your Application subclass, as this guarantees errors are captured as early as possible. If a custom Application subclass is not possible in your app then you should suppress this warning by passing the Application context instead: Bugsnag.start(context.getApplicationContext()). For further info see: https://docs.bugsnag.com/platforms/android/#basic-configuration");
        }
        File value = hVar.y.getValue();
        File file = new File(value, "bugsnag");
        if (!file.isDirectory()) {
            file.mkdirs();
        }
        for (Pair pair2 : myobfuscated.jk2.o.h(new Pair("last-run-info", "last-run-info"), new Pair("bugsnag-sessions", "sessions"), new Pair("user-info", "user-info"), new Pair("bugsnag-native", "native"), new Pair("bugsnag-errors", "errors"))) {
            String str = (String) pair2.component2();
            File file2 = new File(value, (String) pair2.component1());
            if (file2.exists()) {
                file2.renameTo(new File(file, str));
            }
        }
        StorageModule storageModule = new StorageModule(this.i, this.a, this.q);
        myobfuscated.of.h hVar2 = this.a;
        new ArrayList();
        ?? hVar3 = new myobfuscated.nf.h();
        myobfuscated.nf.o oVar = zVar.a.c;
        ?? hVar4 = new myobfuscated.nf.h();
        zVar.a.getClass();
        Unit unit = Unit.a;
        BreadcrumbState breadcrumbState = new BreadcrumbState(hVar2.u, oVar, hVar2.t);
        y yVar = zVar.a;
        p1 p1Var = new p1(yVar.d.a.c());
        d1 d1Var = new d1(yVar.e.a.b());
        this.t = hVar3;
        this.f = oVar;
        this.l = breadcrumbState;
        this.e = hVar4;
        this.b = p1Var;
        this.c = d1Var;
        myobfuscated.pf.c cVar = new myobfuscated.pf.c(bVar2);
        myobfuscated.of.b bVar3 = this.z;
        TaskType taskType = TaskType.IO;
        storageModule.b(bVar3, taskType);
        p2 p2Var = new p2(aVar2, storageModule, this, this.z, oVar);
        this.y = p2Var.b;
        this.o = p2Var.c;
        DataCollectionModule dataCollectionModule = new DataCollectionModule(bVar2, aVar2, cVar, p2Var, this.z, this.r, (String) storageModule.d.getValue(), (String) storageModule.e.getValue(), this.m);
        dataCollectionModule.b(this.z, taskType);
        this.k = (myobfuscated.nf.f) dataCollectionModule.g.getValue();
        this.j = (p0) dataCollectionModule.i.getValue();
        final t2 t2Var = (t2) storageModule.f.getValue();
        q2 q2Var = zVar.a.b;
        t2Var.getClass();
        boolean z = (q2Var.a == null && q2Var.c == null && q2Var.b == null) ? false : true;
        String str2 = t2Var.a;
        if (!z) {
            boolean z2 = t2Var.e;
            if (z2) {
                c2 c2Var = t2Var.b;
                SharedPreferences sharedPreferences = c2Var.a;
                if (Intrinsics.c(sharedPreferences == null ? null : Boolean.valueOf(sharedPreferences.contains("install.iud")), Boolean.TRUE)) {
                    SharedPreferences sharedPreferences2 = c2Var.a;
                    q2Var = new q2(sharedPreferences2 == null ? null : sharedPreferences2.getString("user.id", str2), sharedPreferences2 == null ? null : sharedPreferences2.getString("user.email", null), sharedPreferences2 == null ? null : sharedPreferences2.getString("user.name", null));
                    t2Var.a(q2Var);
                } else {
                    g2<q2> g2Var = t2Var.d;
                    if (g2Var.a.canRead() && g2Var.a.length() > 0 && z2) {
                        try {
                            q2Var = g2Var.a(new UserStore$loadPersistedUser$1(q2.d));
                        } catch (Exception e) {
                            t2Var.c.a("Failed to load user info", e);
                        }
                    }
                }
            }
            q2Var = null;
        }
        r2 r2Var = (q2Var == null || (q2Var.a == null && q2Var.c == null && q2Var.b == null)) ? new r2(new q2(str2, null, null)) : new r2(q2Var);
        r2Var.addObserver(new myobfuscated.of.o() {
            @Override
            public final void onStateChange(com.bugsnag.android.r rVar) {
                if (rVar instanceof r.s) {
                    t2.this.a(((r.s) rVar).a);
                }
            }
        });
        this.g = r2Var;
        c2 c2Var2 = (c2) storageModule.b.getValue();
        SharedPreferences sharedPreferences3 = c2Var2.a;
        Boolean valueOf = sharedPreferences3 == null ? null : Boolean.valueOf(sharedPreferences3.contains("install.iud"));
        Boolean bool = Boolean.TRUE;
        if (Intrinsics.c(valueOf, bool)) {
            SharedPreferences sharedPreferences4 = c2Var2.a;
            SharedPreferences.Editor edit = sharedPreferences4 == null ? null : sharedPreferences4.edit();
            if (edit != null && (clear = edit.clear()) != null) {
                clear.commit();
            }
        }
        EventStorageModule eventStorageModule = new EventStorageModule(bVar2, aVar2, dataCollectionModule, this.z, p2Var, cVar, this.v, this.f);
        eventStorageModule.b(this.z, TaskType.IO);
        g gVar = (g) eventStorageModule.d.getValue();
        this.n = gVar;
        this.s = new c(this.q, gVar, this.a, this.f, this.v, this.z);
        z0 z0Var = new z0(this, this.q);
        this.A = z0Var;
        this.x = (i1) storageModule.g.getValue();
        this.w = (h1) storageModule.i.getValue();
        a2 a2Var = new a2(zVar.a.E, this.a, this.q);
        this.u = a2Var;
        EnumSet enumSet = zVar.a.A;
        Telemetry telemetry = Telemetry.USAGE;
        if (enumSet.contains(telemetry)) {
            this.d = new myobfuscated.of.k(null);
        } else {
            this.d = new Object();
        }
        y yVar2 = zVar.a;
        yVar2.getClass();
        new CopyOnWriteArrayList();
        new CopyOnWriteArrayList();
        new CopyOnWriteArrayList();
        new CopyOnWriteArrayList();
        new p1(0);
        new d1(0);
        ThreadSendPolicy threadSendPolicy = ThreadSendPolicy.ALWAYS;
        u0 u0Var = new u0(true, true, true, true);
        EmptySet emptySet = EmptySet.INSTANCE;
        EnumSet.of(Telemetry.INTERNAL_ERRORS, telemetry);
        EmptyList emptyList = EmptyList.INSTANCE;
        new HashSet();
        Pair[] elements = new Pair[15];
        HashSet<z1> hashSet = yVar2.E;
        elements[0] = hashSet.size() > 0 ? new Pair("pluginCount", Integer.valueOf(hashSet.size())) : null;
        boolean z3 = yVar2.o;
        elements[1] = !z3 ? new Pair("autoDetectErrors", Boolean.valueOf(z3)) : null;
        boolean z4 = yVar2.l;
        elements[2] = !z4 ? new Pair("autoTrackSessions", Boolean.valueOf(z4)) : null;
        elements[3] = yVar2.y.size() > 0 ? new Pair("discardClassesCount", Integer.valueOf(yVar2.y.size())) : null;
        elements[4] = !Intrinsics.c(null, null) ? new Pair("enabledBreadcrumbTypes", y.a(null)) : null;
        u0 u0Var2 = yVar2.n;
        if (Intrinsics.c(u0Var2, u0Var)) {
            pair = null;
        } else {
            String[] elements2 = new String[4];
            elements2[0] = u0Var2.a ? "anrs" : null;
            elements2[1] = u0Var2.b ? "ndkCrashes" : null;
            elements2[2] = u0Var2.c ? "unhandledExceptions" : null;
            elements2[3] = u0Var2.d ? "unhandledRejections" : null;
            Intrinsics.checkNotNullParameter(elements2, "elements");
            pair = new Pair("enabledErrorTypes", y.a(kotlin.collections.b.u(elements2)));
        }
        elements[5] = pair;
        long j = yVar2.k;
        elements[6] = j != 0 ? new Pair("launchDurationMillis", Long.valueOf(j)) : null;
        elements[7] = !Intrinsics.c(yVar2.q, r1.a) ? new Pair("logger", bool) : null;
        int i = yVar2.t;
        elements[8] = i != 100 ? new Pair("maxBreadcrumbs", Integer.valueOf(i)) : null;
        int i2 = yVar2.u;
        elements[9] = i2 != 32 ? new Pair("maxPersistedEvents", Integer.valueOf(i2)) : null;
        int i3 = yVar2.v;
        elements[10] = i3 != 128 ? new Pair("maxPersistedSessions", Integer.valueOf(i3)) : null;
        int i4 = yVar2.w;
        elements[11] = i4 != 200 ? new Pair("maxReportedThreads", Integer.valueOf(i4)) : null;
        elements[12] = null;
        ThreadSendPolicy threadSendPolicy2 = yVar2.i;
        elements[13] = threadSendPolicy2 != threadSendPolicy ? new Pair("sendThreads", threadSendPolicy2) : null;
        boolean z5 = yVar2.C;
        elements[14] = z5 ? new Pair("attemptDeliveryOnCrash", Boolean.valueOf(z5)) : null;
        Intrinsics.checkNotNullParameter(elements, "elements");
        this.h = kotlin.collections.d.o(kotlin.collections.b.u(elements));
        this.p = new h2(this, this.q);
        if (this.a.c.c) {
            java.lang.Thread.setDefaultUncaughtExceptionHandler(z0Var);
        }
        NativeInterface.setClient(this);
        for (z1 z1Var : a2Var.c) {
            try {
                String name = z1Var.getClass().getName();
                u0 u0Var3 = a2Var.a.c;
                if (Intrinsics.c(name, "com.bugsnag.android.NdkPlugin")) {
                    if (u0Var3.b) {
                        z1Var.load(this);
                    }
                } else if (!Intrinsics.c(name, "com.bugsnag.android.AnrPlugin")) {
                    z1Var.load(this);
                } else if (u0Var3.a) {
                    z1Var.load(this);
                }
            } catch (Throwable th) {
                a2Var.b.d("Failed to load plugin " + z1Var + ", continuing with initialisation.", th);
            }
        }
        z1 z1Var2 = this.u.d;
        if (z1Var2 != null) {
            g0.b = z1Var2;
            g0.c = g0.c("setInternalMetricsEnabled", Boolean.TYPE);
            g0.d = g0.c("setStaticData", Map.class);
            g0.c("getSignalUnwindStackFunction", new Class[0]);
            g0.e = g0.c("getCurrentCallbackSetCounts", new Class[0]);
            g0.f = g0.c("getCurrentNativeApiCallUsage", new Class[0]);
            g0.g = g0.c("initCallbackCounts", Map.class);
            g0.h = g0.c("notifyAddCallback", String.class);
            g0.c("notifyRemoveCallback", String.class);
        }
        if (this.a.j.contains(Telemetry.USAGE) && (method = g0.c) != null) {
            method.invoke(g0.b, Boolean.TRUE);
        }
        g gVar2 = this.n;
        m1 m1Var2 = gVar2.m;
        if (gVar2.h.z) {
            try {
                aVar = gVar2.k.a(TaskType.ERROR_REQUEST, new y0(gVar2));
            } catch (RejectedExecutionException e2) {
                m1Var2.e("Failed to flush launch crash reports, continuing.", e2);
                aVar = null;
            }
            if (aVar != null) {
                try {
                    aVar.get(2000L, TimeUnit.MILLISECONDS);
                } catch (InterruptedException | ExecutionException | TimeoutException e3) {
                    m1Var2.e("Failed to send launch crash reports within 2s timeout, continuing.", e3);
                }
            }
        }
        this.n.j();
        this.o.c();
        this.d.a(this.h);
        myobfuscated.nf.o oVar2 = this.f;
        myobfuscated.of.j jVar = this.d;
        oVar2.e = jVar;
        HashMap hashMap = new HashMap();
        Collection<v1> collection = oVar2.b;
        if (collection.size() > 0) {
            hashMap.put("onBreadcrumb", Integer.valueOf(collection.size()));
        }
        Collection<w1> collection2 = oVar2.a;
        if (collection2.size() > 0) {
            hashMap.put("onError", Integer.valueOf(collection2.size()));
        }
        List<x1> list = oVar2.d;
        if (list.size() > 0) {
            hashMap.put("onSendError", Integer.valueOf(list.size()));
        }
        Collection<y1> collection3 = oVar2.c;
        if (collection3.size() > 0) {
            hashMap.put("onSession", Integer.valueOf(collection3.size()));
        }
        jVar.d(hashMap);
        Context context3 = this.i;
        if (context3 instanceof Application) {
            Application application = (Application) context3;
            Application application2 = myobfuscated.of.g.d;
            if (application != application2) {
                myobfuscated.of.g gVar3 = myobfuscated.of.g.a;
                if (application2 != null) {
                    application2.unregisterActivityLifecycleCallbacks(gVar3);
                }
                myobfuscated.of.g.d = application;
                application.registerActivityLifecycleCallbacks(gVar3);
            }
            p pVar = this.o;
            ArrayList<WeakReference<g.a>> arrayList = myobfuscated.of.g.b;
            synchronized (arrayList) {
                arrayList.add(new WeakReference<>(pVar));
            }
            boolean z6 = myobfuscated.of.g.i;
            pVar.a(z6 ? myobfuscated.of.g.k : myobfuscated.of.g.j, z6);
            if (!this.a.b(BreadcrumbType.STATE)) {
                application.registerActivityLifecycleCallbacks(new myobfuscated.nf.a(new myobfuscated.nf.q(this)));
            }
        }
        this.i.registerComponentCallbacks(new w(this.j, new myobfuscated.nf.t(this), new u(this)));
        try {
            this.z.a(TaskType.DEFAULT, new myobfuscated.nf.r(this));
        } catch (RejectedExecutionException e4) {
            this.q.a("Failed to register for system events", e4);
        }
        a(BreadcrumbType.STATE, "Bugsnag loaded", new HashMap());
        this.q.d("Bugsnag loaded");
    }

    public final void a(@NonNull BreadcrumbType breadcrumbType, @NonNull String str, @NonNull Map map) {
        if (this.a.b(breadcrumbType)) {
            return;
        }
        this.l.add(new Breadcrumb(str, breadcrumbType, map, new Date(), this.q));
    }

    public final void b(@NonNull BreadcrumbType breadcrumbType, @NonNull String str, @NonNull Map map) {
        if (str == null || breadcrumbType == null || map == null) {
            c("leaveBreadcrumb");
            return;
        }
        this.l.add(new Breadcrumb(str, breadcrumbType, map, new Date(), this.q));
    }

    public final void c(String str) {
        this.q.e(myobfuscated.b0.b.s("Invalid null value supplied to client.", str, ", ignoring"));
    }

    public final void d(@NonNull Throwable th, w1 w1Var) {
        if (this.a.e(th)) {
            return;
        }
        f(new f(th, this.a, q.a(null, "handledException", null), this.b.a, this.c.a, this.q), w1Var);
    }

    public final void e(@NonNull Throwable th, m mVar, String str, String str2) {
        myobfuscated.of.b bVar = this.z;
        q a = q.a(Severity.ERROR, str, str2);
        m[] mVarArr = {this.b.a, mVar};
        ArrayList arrayList = new ArrayList(2);
        for (int i = 0; i < 2; i++) {
            arrayList.add(mVarArr[i].d());
        }
        ArrayList arrayList2 = new ArrayList();
        for (int i2 = 0; i2 < 2; i2++) {
            myobfuscated.jk2.t.r(mVarArr[i2].b.a, arrayList2);
        }
        m mVar2 = new m(m.a.a(arrayList));
        mVar2.b.a = kotlin.collections.c.B0(arrayList2);
        f(new f(th, this.a, a, mVar2, this.c.a, this.q), null);
        h1 h1Var = this.w;
        int i3 = h1Var != null ? h1Var.a : 0;
        boolean z = this.y.b.get();
        if (z) {
            i3++;
        }
        try {
            bVar.a(TaskType.IO, new myobfuscated.nf.s(this, new h1(i3, true, z)));
        } catch (RejectedExecutionException e) {
            this.q.a("Failed to persist last run info", e);
        }
        bVar.d.shutdownNow();
        bVar.e.shutdownNow();
        ExecutorService executorService = bVar.a;
        executorService.shutdown();
        ExecutorService executorService2 = bVar.b;
        executorService2.shutdown();
        ExecutorService executorService3 = bVar.c;
        executorService3.shutdown();
        try {
            executorService.awaitTermination(1500L, TimeUnit.MILLISECONDS);
        } catch (InterruptedException unused) {
        }
        try {
            executorService2.awaitTermination(1500L, TimeUnit.MILLISECONDS);
        } catch (InterruptedException unused2) {
        }
        try {
            executorService3.awaitTermination(1500L, TimeUnit.MILLISECONDS);
        } catch (InterruptedException unused3) {
        }
    }

    public final void f(@NonNull f fVar, w1 w1Var) {
        long time = new Date().getTime();
        p0 p0Var = this.j;
        fVar.a.l = p0Var.c(time);
        fVar.b("device", p0Var.d());
        myobfuscated.nf.f fVar2 = this.k;
        myobfuscated.nf.g a = fVar2.a();
        w0 w0Var = fVar.a;
        w0Var.k = a;
        fVar.b("app", fVar2.b());
        BreadcrumbState breadcrumbState = this.l;
        w0Var.m = breadcrumbState.copy();
        q2 q2Var = this.g.a;
        w0Var.s = new q2(q2Var.a, q2Var.b, q2Var.c);
        f0 f0Var = this.e;
        String str = f0Var.b;
        b.a aVar = null;
        if (str == "__BUGSNAG_MANUAL_CONTEXT__") {
            str = null;
        }
        if (str == null) {
            str = f0Var.a;
        }
        w0Var.q = str;
        w0Var.r = this.d;
        Set<Pattern> set = this.b.a.b.a;
        w0Var.h.a = kotlin.collections.c.B0(set);
        w0Var.d.b.a = kotlin.collections.c.B0(set);
        n nVar = this.o.g;
        nVar = (nVar == null || nVar.m.get()) ? null : null;
        if (nVar != null && (this.a.d || !nVar.i.get())) {
            w0Var.i = nVar;
        }
        Collection<w1> collection = this.f.a;
        boolean isEmpty = collection.isEmpty();
        m1 m1Var = this.q;
        if (!isEmpty) {
            for (w1 w1Var2 : collection) {
                try {
                } catch (Throwable th) {
                    m1Var.a("OnBreadcrumbCallback threw an Exception", th);
                }
                if (!w1Var2.a(fVar)) {
                    break;
                }
            }
        }
        if (w1Var == null || w1Var.a(fVar)) {
            List<e> list = w0Var.n;
            if (list.size() > 0) {
                String str2 = list.get(0).a.a;
                String str3 = list.get(0).a.b;
                HashMap hashMap = new HashMap();
                hashMap.put("errorClass", str2);
                hashMap.put("message", str3);
                hashMap.put("unhandled", String.valueOf(fVar.a.b.f));
                hashMap.put("severity", w0Var.b.e.toString());
                breadcrumbState.add(new Breadcrumb(str2, BreadcrumbType.ERROR, hashMap, new Date(), this.q));
            }
            c cVar = this.s;
            m1 m1Var2 = cVar.a;
            m1Var2.d("DeliveryDelegate#deliver() - event being stored/delivered by Client");
            n nVar2 = w0Var.i;
            if (nVar2 != null) {
                if (fVar.a.b.f) {
                    nVar2.j.incrementAndGet();
                    w0Var.i = n.a(nVar2);
                    cVar.updateState(r.j.a);
                } else {
                    nVar2.k.incrementAndGet();
                    w0Var.i = n.a(nVar2);
                    cVar.updateState(r.i.a);
                }
            }
            q qVar = w0Var.b;
            if (!qVar.g) {
                if (cVar.e.a(fVar, m1Var2)) {
                    try {
                        cVar.f.a(TaskType.ERROR_REQUEST, new i0(cVar, new x0(w0Var.j, fVar, null, cVar.d, cVar.c), fVar));
                        return;
                    } catch (RejectedExecutionException unused) {
                        cVar.b.g(fVar);
                        m1Var2.g("Exceeded max queue count, saving to disk to send later");
                        return;
                    }
                }
                return;
            }
            boolean equals = "unhandledPromiseRejection".equals(qVar.a);
            List<e> list2 = w0Var.n;
            if (Intrinsics.c("ANR", list2.isEmpty() ^ true ? list2.get(0).a.a : null) || equals) {
                g gVar = cVar.b;
                gVar.g(fVar);
                gVar.j();
                return;
            } else if (!cVar.c.A) {
                cVar.b.g(fVar);
                return;
            } else {
                long currentTimeMillis = System.currentTimeMillis() + 3000;
                g gVar2 = cVar.b;
                String g = gVar2.g(fVar);
                if (g != null) {
                    try {
                        aVar = gVar2.k.b(TaskType.ERROR_REQUEST, new h(gVar2, g));
                    } catch (RejectedExecutionException unused2) {
                        gVar2.m.g("Failed to flush all on-disk errors, retaining unsent errors for later.");
                    }
                }
                long currentTimeMillis2 = currentTimeMillis - System.currentTimeMillis();
                if (aVar == null || currentTimeMillis2 <= 0) {
                    return;
                }
                try {
                    aVar.get(currentTimeMillis2, TimeUnit.MILLISECONDS);
                } catch (Exception e) {
                    m1Var2.a("failed to immediately deliver event", e);
                }
                if (aVar.a.isDone()) {
                    return;
                }
                aVar.cancel(true);
                return;
            }
        }
        m1Var.d("Skipping notification - onError task returned false");
    }

    public final void finalize() throws Throwable {
        m1 m1Var = this.q;
        h2 h2Var = this.p;
        if (h2Var != null) {
            try {
                try {
                    try {
                        this.i.unregisterReceiver(h2Var);
                    } catch (RemoteException e) {
                        if (m1Var != null) {
                            m1Var.a("Failed to register receiver", e);
                        }
                    }
                } catch (IllegalArgumentException e2) {
                    if (m1Var != null) {
                        m1Var.a("Failed to register receiver", e2);
                    }
                } catch (SecurityException e3) {
                    if (m1Var != null) {
                        m1Var.a("Failed to register receiver", e3);
                    }
                }
            } catch (IllegalArgumentException unused) {
                m1Var.g("Receiver not registered");
            }
        }
        super.finalize();
    }
}