MD5 校验值:d7f913ab91d7343430e85d5ce2e5aff0
a.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package kc; import android.net.TrafficStats; import android.text.TextUtils; import android.util.Log; import androidx.appcompat.widget.f1; import com.huawei.hms.support.hianalytics.HiAnalyticsConstant; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; import mc.a; import mc.c; import mc.d; import nc.b; import nc.d; import nc.f; import org.json.JSONException; import org.json.JSONObject; import t9.i; import t9.j; import t9.l; public class a implements b { public static final Object f34906m = new Object(); public static final ThreadFactory f34907n = new ThreadFactoryC0190a(); public final jb.c f34908a; public final nc.c f34909b; public final mc.c f34910c; public final h f34911d; public final mc.b f34912e; public final f f34913f; public final Object f34914g; public final ExecutorService f34915h; public final ExecutorService f34916i; public String f34917j; public Set<lc.a> f34918k; public final List<g> f34919l; public class ThreadFactoryC0190a implements ThreadFactory { public final AtomicInteger f34920a = new AtomicInteger(1); @Override public Thread newThread(Runnable runnable) { return new Thread(runnable, String.format("firebase-installations-executor-%d", Integer.valueOf(this.f34920a.getAndIncrement()))); } } public a(jb.c cVar, jc.b<qc.h> bVar, jc.b<ic.e> bVar2) { TimeUnit timeUnit = TimeUnit.SECONDS; LinkedBlockingQueue linkedBlockingQueue = new LinkedBlockingQueue(); ThreadFactory threadFactory = f34907n; ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(0, 1, 30L, timeUnit, linkedBlockingQueue, threadFactory); cVar.a(); nc.c cVar2 = new nc.c(cVar.f33498a, bVar, bVar2); mc.c cVar3 = new mc.c(cVar); h c10 = h.c(); mc.b bVar3 = new mc.b(cVar); f fVar = new f(); this.f34914g = new Object(); this.f34918k = new HashSet(); this.f34919l = new ArrayList(); this.f34908a = cVar; this.f34909b = cVar2; this.f34910c = cVar3; this.f34911d = c10; this.f34912e = bVar3; this.f34913f = fVar; this.f34915h = threadPoolExecutor; this.f34916i = new ThreadPoolExecutor(0, 1, 30L, timeUnit, new LinkedBlockingQueue(), threadFactory); } public static a d() { jb.c b10 = jb.c.b(); i.e.e(true, "Null is not a valid value of FirebaseApp."); b10.a(); return (a) b10.f33501d.a(b.class); } public final mc.d a(mc.d dVar) { int responseCode; nc.f f10; nc.c cVar = this.f34909b; String b10 = b(); mc.a aVar = (mc.a) dVar; String str = aVar.f36515b; String e10 = e(); String str2 = aVar.f36518e; if (!cVar.f37002d.a()) { throw new c("Firebase Installations Service is unavailable. Please try again later.", 2); } URL a10 = cVar.a(String.format("projects/%s/installations/%s/authTokens:generate", e10, str)); for (int i10 = 0; i10 <= 1; i10++) { TrafficStats.setThreadStatsTag(32771); HttpURLConnection c10 = cVar.c(a10, b10); try { c10.setRequestMethod("POST"); c10.addRequestProperty("Authorization", "FIS_v2 " + str2); c10.setDoOutput(true); cVar.h(c10); responseCode = c10.getResponseCode(); cVar.f37002d.b(responseCode); } catch (IOException | AssertionError unused) { } catch (Throwable th2) { c10.disconnect(); TrafficStats.clearThreadStatsTag(); throw th2; } if (responseCode >= 200 && responseCode < 300) { f10 = cVar.f(c10); } else { nc.c.b(c10, null, b10, e10); if (responseCode != 401 && responseCode != 404) { if (responseCode == 429) { throw new c("Firebase servers have received too many requests from this client in a short period of time. Please try again later.", 3); } if (responseCode < 500 || responseCode >= 600) { Log.e("Firebase-Installations", "Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase."); b.C0214b c0214b = (b.C0214b) nc.f.a(); c0214b.f36996c = f.b.BAD_CONFIG; f10 = c0214b.a(); } else { c10.disconnect(); TrafficStats.clearThreadStatsTag(); } } b.C0214b c0214b2 = (b.C0214b) nc.f.a(); c0214b2.f36996c = f.b.AUTH_ERROR; f10 = c0214b2.a(); } c10.disconnect(); TrafficStats.clearThreadStatsTag(); nc.b bVar = (nc.b) f10; int ordinal = bVar.f36993c.ordinal(); if (ordinal == 0) { String str3 = bVar.f36991a; long j10 = bVar.f36992b; long b11 = this.f34911d.b(); a.b bVar2 = (a.b) dVar.j(); bVar2.f36524c = str3; bVar2.f36526e = Long.valueOf(j10); bVar2.f36527f = Long.valueOf(b11); return bVar2.a(); } if (ordinal == 1) { a.b bVar3 = (a.b) dVar.j(); bVar3.f36528g = "BAD CONFIG"; bVar3.b(c.a.REGISTER_ERROR); return bVar3.a(); } if (ordinal != 2) { throw new c("Firebase Installations Service is unavailable. Please try again later.", 2); } synchronized (this) { this.f34917j = null; } d.a j11 = dVar.j(); j11.b(c.a.NOT_GENERATED); return j11.a(); } throw new c("Firebase Installations Service is unavailable. Please try again later.", 2); } public String b() { jb.c cVar = this.f34908a; cVar.a(); return cVar.f33500c.f33510a; } public String c() { jb.c cVar = this.f34908a; cVar.a(); return cVar.f33500c.f33511b; } public String e() { jb.c cVar = this.f34908a; cVar.a(); return cVar.f33500c.f33516g; } public final String f(mc.d dVar) { String string; jb.c cVar = this.f34908a; cVar.a(); if (cVar.f33499b.equals("CHIME_ANDROID_SDK") || this.f34908a.g()) { if (((mc.a) dVar).f36516c == c.a.ATTEMPT_MIGRATION) { mc.b bVar = this.f34912e; synchronized (bVar.f36530a) { synchronized (bVar.f36530a) { string = bVar.f36530a.getString("|S|id", null); } if (string == null) { string = bVar.a(); } } return TextUtils.isEmpty(string) ? this.f34913f.a() : string; } } return this.f34913f.a(); } public final mc.d g(mc.d dVar) { int responseCode; nc.d e10; mc.a aVar = (mc.a) dVar; String str = aVar.f36515b; String str2 = null; if (str != null && str.length() == 11) { mc.b bVar = this.f34912e; synchronized (bVar.f36530a) { String[] strArr = mc.b.f36529c; int length = strArr.length; int i10 = 0; while (true) { if (i10 >= length) { break; } String str3 = strArr[i10]; String string = bVar.f36530a.getString("|T|" + bVar.f36531b + HiAnalyticsConstant.REPORT_VAL_SEPARATOR + str3, null); if (string == null || string.isEmpty()) { i10++; } else if (string.startsWith("{")) { try { str2 = new JSONObject(string).getString("token"); } catch (JSONException unused) { } } else { str2 = string; } } } } nc.c cVar = this.f34909b; String b10 = b(); String str4 = aVar.f36515b; String e11 = e(); String c10 = c(); if (!cVar.f37002d.a()) { throw new c("Firebase Installations Service is unavailable. Please try again later.", 2); } URL a10 = cVar.a(String.format("projects/%s/installations", e11)); for (int i11 = 0; i11 <= 1; i11++) { TrafficStats.setThreadStatsTag(32769); HttpURLConnection c11 = cVar.c(a10, b10); try { try { c11.setRequestMethod("POST"); c11.setDoOutput(true); if (str2 != null) { c11.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2); } cVar.g(c11, str4, c10); responseCode = c11.getResponseCode(); cVar.f37002d.b(responseCode); } catch (IOException | AssertionError unused2) { } if (responseCode >= 200 && responseCode < 300) { e10 = cVar.e(c11); } else { nc.c.b(c11, c10, b10, e11); if (responseCode == 429) { throw new c("Firebase servers have received too many requests from this client in a short period of time. Please try again later.", 3); } if (responseCode < 500 || responseCode >= 600) { Log.e("Firebase-Installations", "Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase."); nc.a aVar2 = new nc.a(null, null, null, null, d.a.BAD_CONFIG, null); c11.disconnect(); TrafficStats.clearThreadStatsTag(); e10 = aVar2; } else { c11.disconnect(); TrafficStats.clearThreadStatsTag(); } } nc.a aVar3 = (nc.a) e10; int ordinal = aVar3.f36990e.ordinal(); if (ordinal != 0) { if (ordinal != 1) { throw new c("Firebase Installations Service is unavailable. Please try again later.", 2); } a.b bVar2 = (a.b) dVar.j(); bVar2.f36528g = "BAD CONFIG"; bVar2.b(c.a.REGISTER_ERROR); return bVar2.a(); } String str5 = aVar3.f36987b; String str6 = aVar3.f36988c; long b11 = this.f34911d.b(); String c12 = aVar3.f36989d.c(); long d10 = aVar3.f36989d.d(); a.b bVar3 = (a.b) dVar.j(); bVar3.f36522a = str5; bVar3.b(c.a.REGISTERED); bVar3.f36524c = c12; bVar3.f36525d = str6; bVar3.f36526e = Long.valueOf(d10); bVar3.f36527f = Long.valueOf(b11); return bVar3.a(); } finally { c11.disconnect(); TrafficStats.clearThreadStatsTag(); } } throw new c("Firebase Installations Service is unavailable. Please try again later.", 2); } @Override public i<String> getId() { String str; i.e.i(c(), "Please set your Application ID. A valid Firebase App ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options."); i.e.i(e(), "Please set your Project ID. A valid Firebase Project ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options."); i.e.i(b(), "Please set a valid API key. A Firebase API key is required to communicate with Firebase server APIs: It authenticates your project with Google.Please refer to https://firebase.google.com/support/privacy/init-options."); String c10 = c(); Pattern pattern = h.f34926c; i.e.e(c10.contains(":"), "Please set your Application ID. A valid Firebase App ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options."); i.e.e(h.f34926c.matcher(b()).matches(), "Please set a valid API key. A Firebase API key is required to communicate with Firebase server APIs: It authenticates your project with Google.Please refer to https://firebase.google.com/support/privacy/init-options."); synchronized (this) { str = this.f34917j; } if (str != null) { return l.d(str); } j jVar = new j(); e eVar = new e(jVar); synchronized (this.f34914g) { this.f34919l.add(eVar); } i iVar = jVar.f41169a; this.f34915h.execute(new f1(this)); return iVar; } public final void h(Exception exc) { synchronized (this.f34914g) { Iterator<g> it = this.f34919l.iterator(); while (it.hasNext()) { if (it.next().a(exc)) { it.remove(); } } } } public final void i(mc.d dVar) { synchronized (this.f34914g) { Iterator<g> it = this.f34919l.iterator(); while (it.hasNext()) { if (it.next().b(dVar)) { it.remove(); } } } } }