MD5 校验值:52ffe34fa08a87a6cc4bc36d7eb3dad1
u.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package gh; 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 dh.e; import gh.e; import ih.a0; import ih.b; import ih.g; import ih.j; import ih.u; import java.io.File; import java.io.FileOutputStream; import java.io.FilenameFilter; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.StringWriter; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.NavigableSet; import java.util.TreeSet; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.atomic.AtomicBoolean; public final class u { public static final j f16190p = new FilenameFilter() { @Override public final boolean accept(File file, String str) { return str.startsWith(".ae"); } }; public final Context f16191a; public final d0 f16192b; public final kf.l f16193c; public final f f16194d; public final h0 f16195e; public final lh.f f16196f; public final a f16197g; public final hh.c f16198h; public final dh.a f16199i; public final eh.a f16200j; public final k0 f16201k; public c0 f16202l; public final tg.h<Boolean> f16203m = new tg.h<>(); public final tg.h<Boolean> f16204n = new tg.h<>(); public final tg.h<Void> f16205o = new tg.h<>(); public u(Context context, f fVar, h0 h0Var, d0 d0Var, lh.f fVar2, kf.l lVar, a aVar, hh.c cVar, k0 k0Var, dh.a aVar2, eh.a aVar3) { new AtomicBoolean(false); this.f16191a = context; this.f16194d = fVar; this.f16195e = h0Var; this.f16192b = d0Var; this.f16196f = fVar2; this.f16193c = lVar; this.f16197g = aVar; this.f16198h = cVar; this.f16199i = aVar2; this.f16200j = aVar3; this.f16201k = k0Var; } public static void a(u uVar, String str) { int i10; Integer num; uVar.getClass(); long currentTimeMillis = System.currentTimeMillis() / 1000; String a8 = bm.l.a("Opening a new session with ID ", str); if (Log.isLoggable("FirebaseCrashlytics", 3)) { Log.d("FirebaseCrashlytics", a8, null); } Locale locale = Locale.US; String format = String.format(locale, "Crashlytics Android SDK/%s", "18.3.2"); h0 h0Var = uVar.f16195e; a aVar = uVar.f16197g; String str2 = h0Var.f16154c; String str3 = aVar.f16107e; String str4 = aVar.f16108f; String c10 = h0Var.c(); if (aVar.f16105c != null) { i10 = 4; } else { i10 = 1; } ih.x xVar = new ih.x(str2, str3, str4, c10, a0.k0.a(i10), aVar.f16109g); String str5 = Build.VERSION.RELEASE; String str6 = Build.VERSION.CODENAME; ih.z zVar = new ih.z(str5, str6, e.j()); StatFs statFs = new StatFs(Environment.getDataDirectory().getPath()); long blockCount = statFs.getBlockCount() * statFs.getBlockSize(); e.a aVar2 = e.a.UNKNOWN; String str7 = Build.CPU_ABI; if (TextUtils.isEmpty(str7)) { if (Log.isLoggable("FirebaseCrashlytics", 2)) { Log.v("FirebaseCrashlytics", "Architecture#getValue()::Build.CPU_ABI returned null or empty", null); } } else { e.a aVar3 = (e.a) e.a.f16135b.get(str7.toLowerCase(locale)); if (aVar3 != null) { aVar2 = aVar3; } } int ordinal = aVar2.ordinal(); String str8 = Build.MODEL; int availableProcessors = Runtime.getRuntime().availableProcessors(); long g10 = e.g(); boolean i11 = e.i(); int d10 = e.d(); String str9 = Build.MANUFACTURER; String str10 = Build.PRODUCT; uVar.f16199i.c(str, format, currentTimeMillis, new ih.w(xVar, zVar, new ih.y(ordinal, str8, availableProcessors, g10, blockCount, i11, d10, str9, str10))); uVar.f16198h.a(str); k0 k0Var = uVar.f16201k; a0 a0Var = k0Var.f16159a; a0Var.getClass(); Charset charset = ih.a0.f18558a; b.a aVar4 = new b.a(); aVar4.f18567a = "18.3.2"; String str11 = a0Var.f16114c.f16103a; if (str11 != null) { aVar4.f18568b = str11; String c11 = a0Var.f16113b.c(); if (c11 != null) { aVar4.f18570d = c11; a aVar5 = a0Var.f16114c; String str12 = aVar5.f16107e; if (str12 != null) { aVar4.f18571e = str12; String str13 = aVar5.f16108f; if (str13 != null) { aVar4.f18572f = str13; aVar4.f18569c = 4; g.a aVar6 = new g.a(); aVar6.f18613e = Boolean.FALSE; aVar6.f18611c = Long.valueOf(currentTimeMillis); if (str != null) { aVar6.f18610b = str; String str14 = a0.f16111f; if (str14 != null) { aVar6.f18609a = str14; h0 h0Var2 = a0Var.f16113b; String str15 = h0Var2.f16154c; if (str15 != null) { a aVar7 = a0Var.f16114c; String str16 = aVar7.f16107e; if (str16 != null) { String str17 = aVar7.f16108f; String c12 = h0Var2.c(); dh.e eVar = a0Var.f16114c.f16109g; if (eVar.f10989b == null) { eVar.f10989b = new e.a(eVar); } String str18 = eVar.f10989b.f10990a; dh.e eVar2 = a0Var.f16114c.f16109g; if (eVar2.f10989b == null) { eVar2.f10989b = new e.a(eVar2); } aVar6.f18614f = new ih.h(str15, str16, str17, c12, str18, eVar2.f10989b.f10991b); u.a aVar8 = new u.a(); aVar8.f18727a = 3; aVar8.f18728b = str5; aVar8.f18729c = str6; aVar8.f18730d = Boolean.valueOf(e.j()); aVar6.f18616h = aVar8.a(); StatFs statFs2 = new StatFs(Environment.getDataDirectory().getPath()); int i12 = 7; if (!TextUtils.isEmpty(str7) && (num = (Integer) a0.f16110e.get(str7.toLowerCase(locale))) != null) { i12 = num.intValue(); } int availableProcessors2 = Runtime.getRuntime().availableProcessors(); long g11 = e.g(); long blockCount2 = statFs2.getBlockCount() * statFs2.getBlockSize(); boolean i13 = e.i(); int d11 = e.d(); j.a aVar9 = new j.a(); aVar9.f18636a = Integer.valueOf(i12); aVar9.f18637b = str8; aVar9.f18638c = Integer.valueOf(availableProcessors2); aVar9.f18639d = Long.valueOf(g11); aVar9.f18640e = Long.valueOf(blockCount2); aVar9.f18641f = Boolean.valueOf(i13); aVar9.f18642g = Integer.valueOf(d11); aVar9.f18643h = str9; aVar9.f18644i = str10; aVar6.f18617i = aVar9.a(); aVar6.f18619k = 3; aVar4.f18573g = aVar6.a(); ih.b a10 = aVar4.a(); lh.e eVar3 = k0Var.f16160b; eVar3.getClass(); a0.e eVar4 = a10.f18565h; if (eVar4 == null) { if (Log.isLoggable("FirebaseCrashlytics", 3)) { Log.d("FirebaseCrashlytics", "Could not get session for report", null); return; } return; } String g12 = eVar4.g(); try { lh.e.f24241f.getClass(); th.d dVar = jh.b.f21319a; dVar.getClass(); StringWriter stringWriter = new StringWriter(); try { dVar.a(stringWriter, a10); } catch (IOException unused) { } lh.e.e(eVar3.f24245b.b(g12, "report"), stringWriter.toString()); File b10 = eVar3.f24245b.b(g12, "start-time"); long i14 = eVar4.i(); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream(b10), lh.e.f24239d); try { outputStreamWriter.write(""); b10.setLastModified(i14 * 1000); outputStreamWriter.close(); } finally { } } catch (IOException e10) { String a11 = bm.l.a("Could not persist report for session ", g12); if (Log.isLoggable("FirebaseCrashlytics", 3)) { Log.d("FirebaseCrashlytics", a11, e10); } } } else { throw new NullPointerException("Null version"); } } else { throw new NullPointerException("Null identifier"); } } else { throw new NullPointerException("Null generator"); } } else { throw new NullPointerException("Null identifier"); } } else { throw new NullPointerException("Null displayVersion"); } } else { throw new NullPointerException("Null buildVersion"); } } else { throw new NullPointerException("Null installationUuid"); } } else { throw new NullPointerException("Null gmpAppId"); } } public static tg.a0 b(u uVar) { boolean z10; tg.a0 c10; uVar.getClass(); ArrayList arrayList = new ArrayList(); lh.f fVar = uVar.f16196f; for (File file : lh.f.e(fVar.f24248b.listFiles(f16190p))) { 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); c10 = tg.j.e(null); } else { if (Log.isLoggable("FirebaseCrashlytics", 3)) { Log.d("FirebaseCrashlytics", "Logging app exception event to Firebase Analytics", null); } c10 = tg.j.c(new ScheduledThreadPoolExecutor(1), new t(uVar, parseLong)); } arrayList.add(c10); } catch (NumberFormatException unused2) { StringBuilder b10 = android.support.v4.media.d.b("Could not parse app exception timestamp from file "); b10.append(file.getName()); Log.w("FirebaseCrashlytics", b10.toString(), null); } file.delete(); } return tg.j.f(arrayList); } public final void c(boolean z10, nh.h hVar) { Object obj; boolean z11; File file; boolean z12; List<ApplicationExitInfo> historicalProcessExitReasons; lh.e eVar = this.f16201k.f16160b; eVar.getClass(); ArrayList arrayList = new ArrayList(new TreeSet(lh.f.e(eVar.f24245b.f24249c.list())).descendingSet()); int i10 = 2; if (arrayList.size() <= z10) { if (Log.isLoggable("FirebaseCrashlytics", 2)) { Log.v("FirebaseCrashlytics", "No open sessions to be closed.", null); return; } return; } String str = (String) arrayList.get(z10 ? 1 : 0); if (((nh.e) hVar).f26863h.get().f26847b.f26853b) { int i11 = Build.VERSION.SDK_INT; if (i11 >= 30) { historicalProcessExitReasons = ((ActivityManager) this.f16191a.getSystemService("activity")).getHistoricalProcessExitReasons(null, 0, 0); if (historicalProcessExitReasons.size() != 0) { hh.c cVar = new hh.c(this.f16196f, str); hh.d dVar = new hh.d(this.f16196f); hh.g gVar = new hh.g(); gVar.f17554a.f17557a.getReference().a(dVar.b(str, false)); gVar.f17555b.f17557a.getReference().a(dVar.b(str, true)); gVar.f17556c.set(dVar.c(str), false); this.f16201k.d(str, historicalProcessExitReasons, cVar, gVar); } else { String a8 = bm.l.a("No ApplicationExitInfo available. Session: ", str); if (Log.isLoggable("FirebaseCrashlytics", 2)) { Log.v("FirebaseCrashlytics", a8, null); } } } else { String c10 = a0.a0.c("ANR feature enabled, but device is API ", i11); if (Log.isLoggable("FirebaseCrashlytics", 2)) { Log.v("FirebaseCrashlytics", c10, null); } } } else if (Log.isLoggable("FirebaseCrashlytics", 2)) { Log.v("FirebaseCrashlytics", "ANR feature disabled.", null); } if (this.f16199i.d(str)) { String a10 = bm.l.a("Finalizing native report for session ", str); if (Log.isLoggable("FirebaseCrashlytics", 2)) { Log.v("FirebaseCrashlytics", a10, null); } this.f16199i.a(str).getClass(); Log.w("FirebaseCrashlytics", "No minidump data found for session " + str, null); } if (z10 != 0) { obj = (String) arrayList.get(0); } else { obj = null; } k0 k0Var = this.f16201k; long currentTimeMillis = System.currentTimeMillis() / 1000; lh.e eVar2 = k0Var.f16160b; lh.f fVar = eVar2.f24245b; fVar.getClass(); lh.f.a(new File(fVar.f24247a, ".com.google.firebase.crashlytics")); lh.f.a(new File(fVar.f24247a, ".com.google.firebase.crashlytics-ndk")); if (Build.VERSION.SDK_INT >= 28) { z11 = true; } else { z11 = false; } if (z11) { lh.f.a(new File(fVar.f24247a, ".com.google.firebase.crashlytics.files.v1")); } NavigableSet<String> descendingSet = new TreeSet(lh.f.e(eVar2.f24245b.f24249c.list())).descendingSet(); if (obj != null) { descendingSet.remove(obj); } if (descendingSet.size() > 8) { while (descendingSet.size() > 8) { String str2 = (String) descendingSet.last(); String a11 = bm.l.a("Removing session over cap: ", str2); if (Log.isLoggable("FirebaseCrashlytics", 3)) { Log.d("FirebaseCrashlytics", a11, null); } lh.f fVar2 = eVar2.f24245b; fVar2.getClass(); lh.f.d(new File(fVar2.f24249c, str2)); descendingSet.remove(str2); } } loop1: for (String str3 : descendingSet) { String a12 = bm.l.a("Finalizing report for session ", str3); if (Log.isLoggable("FirebaseCrashlytics", i10)) { Log.v("FirebaseCrashlytics", a12, null); } lh.f fVar3 = eVar2.f24245b; lh.d dVar2 = lh.e.f24243h; fVar3.getClass(); File file2 = new File(fVar3.f24249c, str3); file2.mkdirs(); List<File> e10 = lh.f.e(file2.listFiles(dVar2)); if (e10.isEmpty()) { String b10 = d0.g.b("Session ", str3, " has no events."); if (Log.isLoggable("FirebaseCrashlytics", i10)) { Log.v("FirebaseCrashlytics", b10, null); } } else { Collections.sort(e10); ArrayList arrayList2 = new ArrayList(); while (true) { boolean z13 = false; for (File file3 : e10) { try { jh.b bVar = lh.e.f24241f; String d10 = lh.e.d(file3); bVar.getClass(); try { JsonReader jsonReader = new JsonReader(new StringReader(d10)); try { ih.k d11 = jh.b.d(jsonReader); jsonReader.close(); arrayList2.add(d11); if (!z13) { String name = file3.getName(); if (name.startsWith("event") && name.endsWith("_")) { z12 = true; } else { z12 = false; } if (!z12) { break; } } z13 = true; } catch (Throwable th2) { try { jsonReader.close(); } catch (Throwable th3) { th2.addSuppressed(th3); } throw th2; break loop1; } } catch (IllegalStateException e11) { throw new IOException(e11); break loop1; } } catch (IOException e12) { Log.w("FirebaseCrashlytics", "Could not add event to report for " + file3, e12); } } if (arrayList2.isEmpty()) { Log.w("FirebaseCrashlytics", "Could not parse event files for session " + str3, null); } else { String c11 = new hh.d(eVar2.f24245b).c(str3); File b11 = eVar2.f24245b.b(str3, "report"); try { jh.b bVar2 = lh.e.f24241f; String d12 = lh.e.d(b11); bVar2.getClass(); ih.b i12 = jh.b.g(d12).i(currentTimeMillis, c11, z13); ih.b0<a0.e.d> b0Var = new ih.b0<>(arrayList2); if (i12.f18565h != null) { b.a aVar = new b.a(i12); g.a l10 = i12.f18565h.l(); l10.f18618j = b0Var; aVar.f18573g = l10.a(); ih.b a13 = aVar.a(); a0.e eVar3 = a13.f18565h; if (eVar3 != null) { if (z13) { lh.f fVar4 = eVar2.f24245b; String g10 = eVar3.g(); fVar4.getClass(); file = new File(fVar4.f24251e, g10); } else { lh.f fVar5 = eVar2.f24245b; String g11 = eVar3.g(); fVar5.getClass(); file = new File(fVar5.f24250d, g11); } th.d dVar3 = jh.b.f21319a; dVar3.getClass(); StringWriter stringWriter = new StringWriter(); try { dVar3.a(stringWriter, a13); } catch (IOException unused) { } lh.e.e(file, stringWriter.toString()); } } else { throw new IllegalStateException("Reports without sessions cannot have events added to them."); break; } } catch (IOException e13) { Log.w("FirebaseCrashlytics", "Could not synthesize final report file for " + b11, e13); } } } } lh.f fVar6 = eVar2.f24245b; fVar6.getClass(); lh.f.d(new File(fVar6.f24249c, str3)); i10 = 2; } ((nh.e) eVar2.f24246c).f26863h.get().f26846a.getClass(); ArrayList b12 = eVar2.b(); int size = b12.size(); if (size > 4) { Iterator it = b12.subList(4, size).iterator(); while (it.hasNext()) { ((File) it.next()).delete(); } } } public final boolean d(nh.h hVar) { boolean z10; if (Boolean.TRUE.equals(this.f16194d.f16143d.get())) { c0 c0Var = this.f16202l; if (c0Var != null && c0Var.f16123e.get()) { z10 = true; } else { z10 = false; } if (z10) { 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, hVar); 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; } } throw new IllegalStateException("Not running on background worker thread as intended."); } public final tg.g e(tg.a0 a0Var) { boolean z10; tg.a0 a0Var2; tg.a0 a0Var3; lh.e eVar = this.f16201k.f16160b; if (lh.f.e(eVar.f24245b.f24250d.listFiles()).isEmpty() && lh.f.e(eVar.f24245b.f24251e.listFiles()).isEmpty() && lh.f.e(eVar.f24245b.f24252f.listFiles()).isEmpty()) { z10 = false; } else { z10 = true; } if (!z10) { if (Log.isLoggable("FirebaseCrashlytics", 2)) { Log.v("FirebaseCrashlytics", "No crash reports are available to be sent.", null); } this.f16203m.d(Boolean.FALSE); return tg.j.e(null); } dh.f fVar = dh.f.f10992h; fVar.l("Crash reports are available to be sent."); if (this.f16192b.a()) { if (Log.isLoggable("FirebaseCrashlytics", 3)) { Log.d("FirebaseCrashlytics", "Automatic data collection is enabled. Allowing upload.", null); } this.f16203m.d(Boolean.FALSE); a0Var3 = tg.j.e(Boolean.TRUE); } else { fVar.h("Automatic data collection is disabled."); fVar.l("Notifying that unsent reports are available."); this.f16203m.d(Boolean.TRUE); d0 d0Var = this.f16192b; synchronized (d0Var.f16127b) { a0Var2 = d0Var.f16128c.f32409a; } n nVar = new n(); a0Var2.getClass(); tg.z zVar = tg.i.f32410a; tg.a0 a0Var4 = new tg.a0(); a0Var2.f32404b.a(new tg.v(zVar, nVar, a0Var4)); a0Var2.w(); fVar.h("Waiting for send/deleteUnsentReports to be called."); tg.a0 a0Var5 = this.f16204n.f32409a; ExecutorService executorService = m0.f16176a; tg.h hVar = new tg.h(); androidx.biometric.l lVar = new androidx.biometric.l(hVar); a0Var4.i(lVar); a0Var5.i(lVar); a0Var3 = hVar.f32409a; } q qVar = new q(this, a0Var); a0Var3.getClass(); tg.z zVar2 = tg.i.f32410a; tg.a0 a0Var6 = new tg.a0(); a0Var3.f32404b.a(new tg.v(zVar2, qVar, a0Var6)); a0Var3.w(); return a0Var6; } }