APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Նվագարկիչ
版本号:9.9.9
包名称:com.iptv.player

MD5 校验值:d7f913ab91d7343430e85d5ce2e5aff0

反编译源代码说明

p.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package sb;

import android.app.ActivityManager;
import android.app.ApplicationExitInfo;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.text.TextUtils;
import android.util.JsonReader;
import android.util.Log;
import d9.b51;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
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.Objects;
import java.util.SortedSet;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicBoolean;
import pb.c;
import sb.e;
import ub.a0;
import ub.b;
import ub.c;
import ub.g;
import ub.j;
import ub.k;

public class p {

    public static final int f40400p = 0;

    public final Context f40401a;

    public final a0 f40402b;

    public final b51 f40403c;

    public final f f40404d;

    public final e0 f40405e;

    public final xb.e f40406f;

    public final sb.a f40407g;

    public final tb.c f40408h;

    public final pb.a f40409i;

    public final qb.a f40410j;

    public final g0 f40411k;

    public z f40412l;

    public final t9.j<Boolean> f40413m = new t9.j<>();

    public final t9.j<Boolean> f40414n = new t9.j<>();

    public final t9.j<Void> f40415o = new t9.j<>();

    public class a implements t9.h<Boolean, Void> {

        public final t9.i f40416a;

        public a(t9.i iVar) {
            this.f40416a = iVar;
        }

        @Override
        public t9.i<Void> a(Boolean bool) {
            return p.this.f40404d.c(new o(this, bool));
        }
    }

    public p(Context context, f fVar, e0 e0Var, a0 a0Var, xb.e eVar, b51 b51Var, sb.a aVar, tb.g gVar, tb.c cVar, g0 g0Var, pb.a aVar2, qb.a aVar3) {
        new AtomicBoolean(false);
        this.f40401a = context;
        this.f40404d = fVar;
        this.f40405e = e0Var;
        this.f40402b = a0Var;
        this.f40406f = eVar;
        this.f40403c = b51Var;
        this.f40407g = aVar;
        this.f40408h = cVar;
        this.f40409i = aVar2;
        this.f40410j = aVar3;
        this.f40411k = g0Var;
    }

    public static void a(p pVar, String str) {
        c.a aVar;
        Integer num;
        Objects.requireNonNull(pVar);
        long currentTimeMillis = System.currentTimeMillis() / 1000;
        String a10 = i.c.a("Opening a new session with ID ", str);
        Integer num2 = 3;
        if (Log.isLoggable("FirebaseCrashlytics", 3)) {
            Log.d("FirebaseCrashlytics", a10, null);
        }
        Locale locale = Locale.US;
        String format = String.format(locale, "Crashlytics Android SDK/%s", "18.2.7");
        e0 e0Var = pVar.f40405e;
        sb.a aVar2 = pVar.f40407g;
        ub.x xVar = new ub.x(e0Var.f40366c, aVar2.f40335e, aVar2.f40336f, e0Var.c(), u.g.e(aVar2.f40333c != null ? 4 : 1), aVar2.f40337g);
        Context context = pVar.f40401a;
        String str2 = Build.VERSION.RELEASE;
        String str3 = Build.VERSION.CODENAME;
        ub.z zVar = new ub.z(str2, str3, e.k(context));
        Context context2 = pVar.f40401a;
        StatFs statFs = new StatFs(Environment.getDataDirectory().getPath());
        long blockCount = statFs.getBlockCount() * statFs.getBlockSize();
        e.a aVar3 = e.a.UNKNOWN;
        String str4 = Build.CPU_ABI;
        if (!TextUtils.isEmpty(str4)) {
            e.a aVar4 = (e.a) ((HashMap) e.a.f40360b).get(str4.toLowerCase(locale));
            if (aVar4 != null) {
                aVar3 = aVar4;
            }
        } else if (Log.isLoggable("FirebaseCrashlytics", 2)) {
            Log.v("FirebaseCrashlytics", "Architecture#getValue()::Build.CPU_ABI returned null or empty", null);
        }
        int ordinal = aVar3.ordinal();
        String str5 = Build.MODEL;
        int availableProcessors = Runtime.getRuntime().availableProcessors();
        long h10 = e.h();
        boolean j10 = e.j(context2);
        int d10 = e.d(context2);
        String str6 = Build.MANUFACTURER;
        String str7 = Build.PRODUCT;
        pVar.f40409i.a(str, format, currentTimeMillis, new ub.w(xVar, zVar, new ub.y(ordinal, str5, availableProcessors, h10, blockCount, j10, d10, str6, str7)));
        pVar.f40408h.a(str);
        g0 g0Var = pVar.f40411k;
        x xVar2 = g0Var.f40376a;
        Objects.requireNonNull(xVar2);
        Charset charset = ub.a0.f42101a;
        b.C0282b c0282b = new b.C0282b();
        c0282b.f42110a = "18.2.7";
        String str8 = xVar2.f40449c.f40331a;
        Objects.requireNonNull(str8, "Null gmpAppId");
        c0282b.f42111b = str8;
        String c10 = xVar2.f40448b.c();
        Objects.requireNonNull(c10, "Null installationUuid");
        c0282b.f42113d = c10;
        String str9 = xVar2.f40449c.f40335e;
        Objects.requireNonNull(str9, "Null buildVersion");
        c0282b.f42114e = str9;
        String str10 = xVar2.f40449c.f40336f;
        Objects.requireNonNull(str10, "Null displayVersion");
        c0282b.f42115f = str10;
        c0282b.f42112c = 4;
        g.b bVar = new g.b();
        bVar.b(false);
        bVar.f42154c = Long.valueOf(currentTimeMillis);
        Objects.requireNonNull(str, "Null identifier");
        bVar.f42153b = str;
        String str11 = x.f40446f;
        Objects.requireNonNull(str11, "Null generator");
        bVar.f42152a = str11;
        String str12 = xVar2.f40448b.f40366c;
        Objects.requireNonNull(str12, "Null identifier");
        String str13 = xVar2.f40449c.f40335e;
        Objects.requireNonNull(str13, "Null version");
        String str14 = xVar2.f40449c.f40336f;
        String c11 = xVar2.f40448b.c();
        pb.c cVar = xVar2.f40449c.f40337g;
        if (cVar.f38884b == null) {
            aVar = null;
            cVar.f38884b = new c.b(cVar, null);
        } else {
            aVar = null;
        }
        String str15 = cVar.f38884b.f38885a;
        pb.c cVar2 = xVar2.f40449c.f40337g;
        if (cVar2.f38884b == null) {
            cVar2.f38884b = new c.b(cVar2, aVar);
        }
        bVar.f42157f = new ub.h(str12, str13, str14, null, c11, str15, cVar2.f38884b.f38886b, null);
        Boolean valueOf = Boolean.valueOf(e.k(xVar2.f40447a));
        String str16 = num2 == null ? " platform" : "";
        if (valueOf == null) {
            str16 = i.c.a(str16, " jailbroken");
        }
        if (!str16.isEmpty()) {
            throw new IllegalStateException(i.c.a("Missing required properties:", str16));
        }
        bVar.f42159h = new ub.u(num2.intValue(), str2, str3, valueOf.booleanValue(), null);
        StatFs statFs2 = new StatFs(Environment.getDataDirectory().getPath());
        int i10 = 7;
        if (!TextUtils.isEmpty(str4) && (num = (Integer) ((HashMap) x.f40445e).get(str4.toLowerCase(locale))) != null) {
            i10 = num.intValue();
        }
        int availableProcessors2 = Runtime.getRuntime().availableProcessors();
        long h11 = e.h();
        long blockCount2 = statFs2.getBlockCount() * statFs2.getBlockSize();
        boolean j11 = e.j(xVar2.f40447a);
        int d11 = e.d(xVar2.f40447a);
        j.b bVar2 = new j.b();
        bVar2.f42179a = Integer.valueOf(i10);
        bVar2.f42180b = str5;
        bVar2.f42181c = Integer.valueOf(availableProcessors2);
        bVar2.f42182d = Long.valueOf(h11);
        bVar2.f42183e = Long.valueOf(blockCount2);
        bVar2.f42184f = Boolean.valueOf(j11);
        bVar2.f42185g = Integer.valueOf(d11);
        bVar2.f42186h = str6;
        bVar2.f42187i = str7;
        bVar.f42160i = bVar2.a();
        bVar.f42162k = num2;
        c0282b.f42116g = bVar.a();
        ub.a0 a11 = c0282b.a();
        xb.d dVar = g0Var.f40377b;
        Objects.requireNonNull(dVar);
        a0.e eVar = ((ub.b) a11).f42108h;
        if (eVar == null) {
            if (Log.isLoggable("FirebaseCrashlytics", 3)) {
                Log.d("FirebaseCrashlytics", "Could not get session for report", null);
                return;
            }
            return;
        }
        String g10 = eVar.g();
        try {
            xb.d.f(dVar.f44761b.g(g10, "report"), xb.d.f44757f.h(a11));
            File g11 = dVar.f44761b.g(g10, "start-time");
            long i11 = eVar.i();
            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream(g11), xb.d.f44755d);
            try {
                outputStreamWriter.write("");
                g11.setLastModified(i11 * 1000);
                outputStreamWriter.close();
            } finally {
            }
        } catch (IOException e10) {
            String a12 = i.c.a("Could not persist report for session ", g10);
            if (Log.isLoggable("FirebaseCrashlytics", 3)) {
                Log.d("FirebaseCrashlytics", a12, e10);
            }
        }
    }

    public static t9.i b(p pVar) {
        boolean z10;
        t9.i b10;
        Objects.requireNonNull(pVar);
        ArrayList arrayList = new ArrayList();
        xb.e eVar = pVar.f40406f;
        for (File file : xb.e.l(((File) eVar.f44764b).listFiles(i.f40383a))) {
            try {
                long parseLong = Long.parseLong(file.getName().substring(3));
                try {
                    Class.forName("com.google.firebase.crash.FirebaseCrash");
                    z10 = true;
                } catch (ClassNotFoundException unused) {
                    z10 = false;
                }
                if (z10) {
                    Log.w("FirebaseCrashlytics", "Skipping logging Crashlytics event to Firebase, FirebaseCrash exists", null);
                    b10 = t9.l.d(null);
                } else {
                    if (Log.isLoggable("FirebaseCrashlytics", 3)) {
                        Log.d("FirebaseCrashlytics", "Logging app exception event to Firebase Analytics", null);
                    }
                    b10 = t9.l.b(new ScheduledThreadPoolExecutor(1), new s(pVar, parseLong));
                }
                arrayList.add(b10);
            } catch (NumberFormatException unused2) {
                StringBuilder a10 = android.support.v4.media.b.a("Could not parse app exception timestamp from file ");
                a10.append(file.getName());
                Log.w("FirebaseCrashlytics", a10.toString(), null);
            }
            file.delete();
        }
        return t9.l.e(arrayList);
    }

    public final void c(boolean z10, zb.c cVar) {
        File file;
        String e10;
        ApplicationExitInfo applicationExitInfo;
        String str;
        String str2;
        InputStream traceInputStream;
        ArrayList arrayList = new ArrayList(this.f40411k.f40377b.c());
        if (arrayList.size() <= z10) {
            if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                Log.v("FirebaseCrashlytics", "No open sessions to be closed.", null);
                return;
            }
            return;
        }
        String str3 = (String) arrayList.get(z10 ? 1 : 0);
        if (((zb.b) cVar).b().a().f8489b) {
            int i10 = Build.VERSION.SDK_INT;
            if (i10 >= 30) {
                List<ApplicationExitInfo> historicalProcessExitReasons = ((ActivityManager) this.f40401a.getSystemService("activity")).getHistoricalProcessExitReasons(null, 0, 0);
                if (historicalProcessExitReasons.size() != 0) {
                    tb.c cVar2 = new tb.c(this.f40406f, str3);
                    xb.e eVar = this.f40406f;
                    f fVar = this.f40404d;
                    tb.d dVar = new tb.d(eVar);
                    tb.g gVar = new tb.g(str3, eVar, fVar);
                    gVar.f41215a.f41218a.getReference().a(dVar.b(str3, false));
                    gVar.f41216b.f41218a.getReference().a(dVar.b(str3, true));
                    gVar.f41217c.set(dVar.c(str3), false);
                    g0 g0Var = this.f40411k;
                    long lastModified = g0Var.f40377b.f44761b.g(str3, "start-time").lastModified();
                    Iterator<ApplicationExitInfo> it = historicalProcessExitReasons.iterator();
                    while (it.hasNext()) {
                        applicationExitInfo = it.next();
                        if (applicationExitInfo.getTimestamp() < lastModified) {
                            break;
                        }
                        if (applicationExitInfo.getReason() == 6) {
                            break;
                        }
                    }
                    applicationExitInfo = null;
                    if (applicationExitInfo == null) {
                        String a10 = i.c.a("No relevant ApplicationExitInfo occurred during session: ", str3);
                        if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                            Log.v("FirebaseCrashlytics", a10, null);
                        }
                    } else {
                        x xVar = g0Var.f40376a;
                        try {
                            traceInputStream = applicationExitInfo.getTraceInputStream();
                        } catch (IOException e11) {
                            StringBuilder a11 = android.support.v4.media.b.a("Could not get input trace in application exit info: ");
                            a11.append(applicationExitInfo.toString());
                            a11.append(" Error: ");
                            a11.append(e11);
                            Log.w("FirebaseCrashlytics", a11.toString(), null);
                        }
                        if (traceInputStream != null) {
                            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                            byte[] bArr = new byte[8192];
                            while (true) {
                                int read = traceInputStream.read(bArr);
                                if (read == -1) {
                                    break;
                                } else {
                                    byteArrayOutputStream.write(bArr, 0, read);
                                }
                            }
                            str = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name());
                            c.b bVar = new c.b();
                            bVar.f42130d = Integer.valueOf(applicationExitInfo.getImportance());
                            String processName = applicationExitInfo.getProcessName();
                            Objects.requireNonNull(processName, "Null processName");
                            bVar.f42128b = processName;
                            bVar.f42129c = Integer.valueOf(applicationExitInfo.getReason());
                            bVar.f42133g = Long.valueOf(applicationExitInfo.getTimestamp());
                            bVar.f42127a = Integer.valueOf(applicationExitInfo.getPid());
                            bVar.f42131e = Long.valueOf(applicationExitInfo.getPss());
                            bVar.f42132f = Long.valueOf(applicationExitInfo.getRss());
                            bVar.f42134h = str;
                            a0.a a12 = bVar.a();
                            int i11 = xVar.f40447a.getResources().getConfiguration().orientation;
                            k.b bVar2 = new k.b();
                            bVar2.e("anr");
                            ub.c cVar3 = (ub.c) a12;
                            bVar2.d(cVar3.f42125g);
                            Boolean valueOf = Boolean.valueOf(cVar3.f42122d == 100);
                            Integer valueOf2 = Integer.valueOf(i11);
                            ub.m mVar = new ub.m(null, null, a12, xVar.e(), xVar.a(), null);
                            str2 = valueOf2 != null ? " uiOrientation" : "";
                            if (str2.isEmpty()) {
                                throw new IllegalStateException(i.c.a("Missing required properties:", str2));
                            }
                            bVar2.f42195c = new ub.l(mVar, null, null, valueOf, valueOf2.intValue(), null);
                            bVar2.f42196d = xVar.b(i11);
                            a0.e.d a13 = bVar2.a();
                            String a14 = i.c.a("Persisting anr for session ", str3);
                            if (Log.isLoggable("FirebaseCrashlytics", 3)) {
                                Log.d("FirebaseCrashlytics", a14, null);
                            }
                            g0Var.f40377b.d(g0Var.a(a13, cVar2, gVar), str3, true);
                        }
                        str = null;
                        c.b bVar3 = new c.b();
                        bVar3.f42130d = Integer.valueOf(applicationExitInfo.getImportance());
                        String processName2 = applicationExitInfo.getProcessName();
                        Objects.requireNonNull(processName2, "Null processName");
                        bVar3.f42128b = processName2;
                        bVar3.f42129c = Integer.valueOf(applicationExitInfo.getReason());
                        bVar3.f42133g = Long.valueOf(applicationExitInfo.getTimestamp());
                        bVar3.f42127a = Integer.valueOf(applicationExitInfo.getPid());
                        bVar3.f42131e = Long.valueOf(applicationExitInfo.getPss());
                        bVar3.f42132f = Long.valueOf(applicationExitInfo.getRss());
                        bVar3.f42134h = str;
                        a0.a a122 = bVar3.a();
                        int i112 = xVar.f40447a.getResources().getConfiguration().orientation;
                        k.b bVar22 = new k.b();
                        bVar22.e("anr");
                        ub.c cVar32 = (ub.c) a122;
                        bVar22.d(cVar32.f42125g);
                        Boolean valueOf3 = Boolean.valueOf(cVar32.f42122d == 100);
                        Integer valueOf22 = Integer.valueOf(i112);
                        ub.m mVar2 = new ub.m(null, null, a122, xVar.e(), xVar.a(), null);
                        if (valueOf22 != null) {
                        }
                        if (str2.isEmpty()) {
                        }
                    }
                } else {
                    String a15 = i.c.a("No ApplicationExitInfo available. Session: ", str3);
                    if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                        Log.v("FirebaseCrashlytics", a15, null);
                    }
                }
            } else {
                String a16 = android.support.v4.media.a.a("ANR feature enabled, but device is API ", i10);
                if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                    Log.v("FirebaseCrashlytics", a16, null);
                }
            }
        } else if (Log.isLoggable("FirebaseCrashlytics", 2)) {
            Log.v("FirebaseCrashlytics", "ANR feature disabled.", null);
        }
        if (this.f40409i.d(str3)) {
            String a17 = i.c.a("Finalizing native report for session ", str3);
            if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                Log.v("FirebaseCrashlytics", a17, null);
            }
            Objects.requireNonNull(this.f40409i.b(str3));
            Log.w("FirebaseCrashlytics", "No minidump data found for session " + str3, null);
        }
        String str4 = z10 != 0 ? (String) arrayList.get(0) : null;
        g0 g0Var2 = this.f40411k;
        long currentTimeMillis = System.currentTimeMillis() / 1000;
        xb.d dVar2 = g0Var2.f40377b;
        xb.e eVar2 = dVar2.f44761b;
        Objects.requireNonNull(eVar2);
        File[] fileArr = {new File(((File) eVar2.f44764b).getParent(), ".com.google.firebase.crashlytics"), new File(((File) eVar2.f44764b).getParent(), ".com.google.firebase.crashlytics-ndk")};
        for (int i12 = 0; i12 < 2; i12++) {
            File file2 = fileArr[i12];
            if (file2.exists() && xb.e.k(file2)) {
                StringBuilder a18 = android.support.v4.media.b.a("Deleted legacy Crashlytics files from ");
                a18.append(file2.getPath());
                String sb2 = a18.toString();
                if (Log.isLoggable("FirebaseCrashlytics", 3)) {
                    Log.d("FirebaseCrashlytics", sb2, null);
                }
            }
        }
        SortedSet<String> c10 = dVar2.c();
        if (str4 != null) {
            c10.remove(str4);
        }
        if (c10.size() > 8) {
            while (c10.size() > 8) {
                String last = c10.last();
                String a19 = i.c.a("Removing session over cap: ", last);
                if (Log.isLoggable("FirebaseCrashlytics", 3)) {
                    Log.d("FirebaseCrashlytics", a19, null);
                }
                xb.e eVar3 = dVar2.f44761b;
                Objects.requireNonNull(eVar3);
                xb.e.k(new File((File) eVar3.f44765c, last));
                c10.remove(last);
            }
        }
        loop3: for (String str5 : c10) {
            String a20 = i.c.a("Finalizing report for session ", str5);
            if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                Log.v("FirebaseCrashlytics", a20, null);
            }
            List<File> l10 = xb.e.l(dVar2.f44761b.f(str5).listFiles(xb.d.f44759h));
            if (l10.isEmpty()) {
                String a21 = android.support.v4.media.c.a("Session ", str5, " has no events.");
                if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                    Log.v("FirebaseCrashlytics", a21, null);
                }
            } else {
                Collections.sort(l10);
                ArrayList arrayList2 = new ArrayList();
                while (true) {
                    boolean z11 = false;
                    for (File file3 : l10) {
                        try {
                            vb.a aVar = xb.d.f44757f;
                            e10 = xb.d.e(file3);
                            Objects.requireNonNull(aVar);
                        } catch (IOException e12) {
                            Log.w("FirebaseCrashlytics", "Could not add event to report for " + file3, e12);
                        }
                        try {
                            JsonReader jsonReader = new JsonReader(new StringReader(e10));
                            try {
                                a0.e.d d10 = vb.a.d(jsonReader);
                                jsonReader.close();
                                arrayList2.add(d10);
                                if (!z11) {
                                    String name = file3.getName();
                                    if (!(name.startsWith("event") && name.endsWith("_"))) {
                                        break;
                                    }
                                }
                                z11 = true;
                            } finally {
                                break loop3;
                            }
                        } catch (IllegalStateException e13) {
                            throw new IOException(e13);
                        }
                    }
                    if (arrayList2.isEmpty()) {
                        Log.w("FirebaseCrashlytics", "Could not parse event files for session " + str5, null);
                    } else {
                        String c11 = new tb.d(dVar2.f44761b).c(str5);
                        File g10 = dVar2.f44761b.g(str5, "report");
                        try {
                            vb.a aVar2 = xb.d.f44757f;
                            ub.a0 j10 = aVar2.g(xb.d.e(g10)).j(currentTimeMillis, z11, c11);
                            ub.b0<a0.e.d> b0Var = new ub.b0<>(arrayList2);
                            if (((ub.b) j10).f42108h == null) {
                                throw new IllegalStateException("Reports without sessions cannot have events added to them.");
                                break;
                            }
                            a0.b i13 = j10.i();
                            g.b bVar4 = (g.b) ((ub.b) j10).f42108h.l();
                            bVar4.f42161j = b0Var;
                            b.C0282b c0282b = (b.C0282b) i13;
                            c0282b.f42116g = bVar4.a();
                            ub.a0 a22 = c0282b.a();
                            a0.e eVar4 = ((ub.b) a22).f42108h;
                            if (eVar4 != null) {
                                if (z11) {
                                    xb.e eVar5 = dVar2.f44761b;
                                    String g11 = eVar4.g();
                                    Objects.requireNonNull(eVar5);
                                    file = new File((File) eVar5.f44767e, g11);
                                } else {
                                    xb.e eVar6 = dVar2.f44761b;
                                    String g12 = eVar4.g();
                                    Objects.requireNonNull(eVar6);
                                    file = new File((File) eVar6.f44766d, g12);
                                }
                                xb.d.f(file, aVar2.h(a22));
                            }
                        } catch (IOException e14) {
                            Log.w("FirebaseCrashlytics", "Could not synthesize final report file for " + g10, e14);
                        }
                    }
                }
            }
            xb.e eVar7 = dVar2.f44761b;
            Objects.requireNonNull(eVar7);
            xb.e.k(new File((File) eVar7.f44765c, str5));
        }
        int i14 = ((zb.b) dVar2.f44762c).b().b().f37128b;
        ArrayList arrayList3 = (ArrayList) dVar2.b();
        int size = arrayList3.size();
        if (size <= i14) {
            return;
        }
        Iterator it2 = arrayList3.subList(i14, size).iterator();
        while (it2.hasNext()) {
            ((File) it2.next()).delete();
        }
    }

    public final void d(long j10) {
        try {
            if (this.f40406f.a(".ae" + j10).createNewFile()) {
            } else {
                throw new IOException("Create new file failed.");
            }
        } catch (IOException e10) {
            Log.w("FirebaseCrashlytics", "Could not create app exception marker file.", e10);
        }
    }

    public boolean e(zb.c cVar) {
        this.f40404d.a();
        z zVar = this.f40412l;
        if (zVar != null && zVar.f40455e.get()) {
            Log.w("FirebaseCrashlytics", "Skipping session finalization because a crash has already occurred.", null);
            return false;
        }
        if (Log.isLoggable("FirebaseCrashlytics", 2)) {
            Log.v("FirebaseCrashlytics", "Finalizing previously open sessions.", null);
        }
        try {
            c(true, cVar);
            if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                Log.v("FirebaseCrashlytics", "Closed all previously open sessions.", null);
            }
            return true;
        } catch (Exception e10) {
            Log.e("FirebaseCrashlytics", "Unable to finalize previously open sessions.", e10);
            return false;
        }
    }

    public final String f() {
        SortedSet<String> c10 = this.f40411k.f40377b.c();
        if (c10.isEmpty()) {
            return null;
        }
        return c10.first();
    }

    public t9.i<Void> g(t9.i<ac.a> iVar) {
        t9.r<Void> rVar;
        t9.i iVar2;
        xb.d dVar = this.f40411k.f40377b;
        int i10 = 1;
        if (!((dVar.f44761b.d().isEmpty() && dVar.f44761b.c().isEmpty() && dVar.f44761b.b().isEmpty()) ? false : true)) {
            if (Log.isLoggable("FirebaseCrashlytics", 2)) {
                Log.v("FirebaseCrashlytics", "No crash reports are available to be sent.", null);
            }
            this.f40413m.b(Boolean.FALSE);
            return t9.l.d(null);
        }
        pb.d dVar2 = pb.d.f38887a;
        dVar2.d("Crash reports are available to be sent.");
        if (this.f40402b.a()) {
            if (Log.isLoggable("FirebaseCrashlytics", 3)) {
                Log.d("FirebaseCrashlytics", "Automatic data collection is enabled. Allowing upload.", null);
            }
            this.f40413m.b(Boolean.FALSE);
            iVar2 = t9.l.d(Boolean.TRUE);
        } else {
            dVar2.b("Automatic data collection is disabled.");
            dVar2.d("Notifying that unsent reports are available.");
            this.f40413m.b(Boolean.TRUE);
            a0 a0Var = this.f40402b;
            synchronized (a0Var.f40340c) {
                rVar = a0Var.f40341d.f41169a;
            }
            m mVar = new m(this);
            Objects.requireNonNull(rVar);
            Executor executor = t9.k.f41170a;
            t9.r rVar2 = new t9.r();
            rVar.f41184b.b(new t9.n(executor, mVar, rVar2));
            rVar.t();
            dVar2.b("Waiting for send/deleteUnsentReports to be called.");
            t9.r<Boolean> rVar3 = this.f40414n.f41169a;
            ExecutorService executorService = j0.f40388a;
            t9.j jVar = new t9.j();
            h0 h0Var = new h0(jVar, i10);
            rVar2.g(h0Var);
            rVar3.g(h0Var);
            iVar2 = jVar.f41169a;
        }
        a aVar = new a(iVar);
        t9.r rVar4 = (t9.r) iVar2;
        Objects.requireNonNull(rVar4);
        Executor executor2 = t9.k.f41170a;
        t9.r rVar5 = new t9.r();
        rVar4.f41184b.b(new t9.n(executor2, aVar, rVar5));
        rVar4.t();
        return rVar5;
    }
}