CONECTA PRO v4.2.8版本的 MD5 值为:ad88cf9e66d8cdaae8c40233e50eb389
以下内容为反编译后的 d.java 源代码,内容仅作参考
package y6;
import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.Log;
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.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import k.b4;
import m5.q;
import org.json.JSONException;
import org.json.JSONObject;
import z5.p;
public final class d implements e {
public static final Object f10686m = new Object();
public final t5.g f10687a;
public final a7.c f10688b;
public final f4.h f10689c;
public final k f10690d;
public final p f10691e;
public final i f10692f;
public final Object f10693g;
public final ExecutorService f10694h;
public final Executor f10695i;
public String f10696j;
public final HashSet f10697k;
public final ArrayList f10698l;
static {
new AtomicInteger(1);
}
public d(t5.g gVar, x6.c cVar, ExecutorService executorService, a6.k kVar) {
gVar.a();
a7.c cVar2 = new a7.c(gVar.f9563a, cVar);
f4.h hVar = new f4.h(27, gVar);
if (j6.a.f6308s == null) {
j6.a.f6308s = new j6.a(3);
}
j6.a aVar = j6.a.f6308s;
if (k.f10706d == null) {
k.f10706d = new k(aVar);
}
k kVar2 = k.f10706d;
p pVar = new p(new z5.e(2, gVar));
i iVar = new i();
this.f10693g = new Object();
this.f10697k = new HashSet();
this.f10698l = new ArrayList();
this.f10687a = gVar;
this.f10688b = cVar2;
this.f10689c = hVar;
this.f10690d = kVar2;
this.f10691e = pVar;
this.f10692f = iVar;
this.f10694h = executorService;
this.f10695i = kVar;
}
public final void a(j jVar) {
synchronized (this.f10693g) {
this.f10698l.add(jVar);
}
}
public final void b(boolean z10) {
z6.a k2;
boolean z11;
synchronized (f10686m) {
t5.g gVar = this.f10687a;
gVar.a();
f4.h a10 = f4.h.a(gVar.f9563a);
k2 = this.f10689c.k();
z6.c cVar = z6.c.NOT_GENERATED;
z6.c cVar2 = k2.f10891b;
if (cVar2 != cVar && cVar2 != z6.c.ATTEMPT_MIGRATION) {
z11 = false;
if (z11) {
String h10 = h(k2);
f4.h hVar = this.f10689c;
b4 b4Var = new b4(k2);
b4Var.f6443a = h10;
b4Var.q(z6.c.UNREGISTERED);
k2 = b4Var.h();
hVar.f(k2);
}
if (a10 != null) {
a10.l();
}
}
z11 = true;
if (z11) {
}
if (a10 != null) {
}
}
if (z10) {
b4 b4Var2 = new b4(k2);
b4Var2.f6445c = null;
k2 = b4Var2.h();
}
k(k2);
this.f10695i.execute(new b(this, z10, 0));
}
public final z6.a c(z6.a aVar) {
int responseCode;
boolean z10;
a7.b f10;
f.c a10;
a7.f fVar;
t5.g gVar = this.f10687a;
gVar.a();
String str = gVar.f9565c.f9582a;
gVar.a();
String str2 = gVar.f9565c.f9588g;
String str3 = aVar.f10893d;
a7.c cVar = this.f10688b;
a7.e eVar = cVar.f125c;
if (eVar.b()) {
URL a11 = a7.c.a(String.format("projects/%s/installations/%s/authTokens:generate", str2, aVar.f10890a));
for (int i10 = 0; i10 <= 1; i10++) {
TrafficStats.setThreadStatsTag(32771);
HttpURLConnection c10 = cVar.c(a11, str);
try {
c10.setRequestMethod("POST");
c10.addRequestProperty("Authorization", "FIS_v2 " + str3);
c10.setDoOutput(true);
a7.c.h(c10);
responseCode = c10.getResponseCode();
eVar.d(responseCode);
if (responseCode >= 200 && responseCode < 300) {
z10 = true;
} else {
z10 = false;
}
} catch (IOException | AssertionError unused) {
} catch (Throwable th) {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
throw th;
}
if (z10) {
f10 = a7.c.f(c10);
} else {
a7.c.b(c10, null, str, str2);
if (responseCode != 401 && responseCode != 404) {
if (responseCode != 429) {
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.");
a10 = a7.b.a();
fVar = a7.f.BAD_CONFIG;
a10.f3735u = fVar;
f10 = a10.l();
} else {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
}
} else {
throw new f("Firebase servers have received too many requests from this client in a short period of time. Please try again later.");
}
}
a10 = a7.b.a();
fVar = a7.f.AUTH_ERROR;
a10.f3735u = fVar;
f10 = a10.l();
}
c10.disconnect();
TrafficStats.clearThreadStatsTag();
int ordinal = f10.f120c.ordinal();
if (ordinal != 0) {
if (ordinal != 1) {
if (ordinal == 2) {
l(null);
b4 b4Var = new b4(aVar);
b4Var.q(z6.c.NOT_GENERATED);
return b4Var.h();
}
throw new f("Firebase Installations Service is unavailable. Please try again later.");
}
b4 b4Var2 = new b4(aVar);
b4Var2.f6449g = "BAD CONFIG";
b4Var2.q(z6.c.REGISTER_ERROR);
return b4Var2.h();
}
k kVar = this.f10690d;
kVar.getClass();
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
kVar.f10707a.getClass();
long seconds = timeUnit.toSeconds(System.currentTimeMillis());
b4 b4Var3 = new b4(aVar);
b4Var3.f6445c = f10.f118a;
b4Var3.f6447e = Long.valueOf(f10.f119b);
b4Var3.f6448f = Long.valueOf(seconds);
return b4Var3.h();
}
throw new f("Firebase Installations Service is unavailable. Please try again later.");
}
throw new f("Firebase Installations Service is unavailable. Please try again later.");
}
public final q d() {
String str;
g();
synchronized (this) {
str = this.f10696j;
}
if (str != null) {
return com.bumptech.glide.f.h(str);
}
m5.j jVar = new m5.j();
a(new h(jVar));
q qVar = jVar.f7310a;
this.f10694h.execute(new a.b(7, this));
return qVar;
}
public final q e() {
g();
m5.j jVar = new m5.j();
a(new g(this.f10690d, jVar));
this.f10694h.execute(new b(this, false, 1));
return jVar.f7310a;
}
public final void f(z6.a aVar) {
synchronized (f10686m) {
t5.g gVar = this.f10687a;
gVar.a();
f4.h a10 = f4.h.a(gVar.f9563a);
this.f10689c.f(aVar);
if (a10 != null) {
a10.l();
}
}
}
public final void g() {
t5.g gVar = this.f10687a;
gVar.a();
p1.b.g(gVar.f9565c.f9583b, "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.");
gVar.a();
p1.b.g(gVar.f9565c.f9588g, "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.");
gVar.a();
p1.b.g(gVar.f9565c.f9582a, "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.");
gVar.a();
String str = gVar.f9565c.f9583b;
Pattern pattern = k.f10705c;
p1.b.b("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.", str.contains(":"));
gVar.a();
p1.b.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.", k.f10705c.matcher(gVar.f9565c.f9582a).matches());
}
public final String h(z6.a aVar) {
boolean z10;
String a10;
t5.g gVar = this.f10687a;
gVar.a();
if (!gVar.f9564b.equals("CHIME_ANDROID_SDK")) {
t5.g gVar2 = this.f10687a;
gVar2.a();
}
if (aVar.f10891b == z6.c.ATTEMPT_MIGRATION) {
z10 = true;
} else {
z10 = false;
}
if (z10) {
z6.b bVar = (z6.b) this.f10691e.get();
synchronized (bVar.f10898a) {
a10 = bVar.a();
if (a10 == null) {
a10 = bVar.b();
}
}
if (TextUtils.isEmpty(a10)) {
this.f10692f.getClass();
return i.a();
}
return a10;
}
this.f10692f.getClass();
return i.a();
}
public final z6.a i(z6.a aVar) {
int responseCode;
boolean z10;
a7.a e10;
String str = aVar.f10890a;
String str2 = null;
if (str != null && str.length() == 11) {
z6.b bVar = (z6.b) this.f10691e.get();
synchronized (bVar.f10898a) {
String[] strArr = z6.b.f10897c;
int i10 = 0;
while (true) {
if (i10 >= 4) {
break;
}
String str3 = strArr[i10];
String str4 = bVar.f10899b;
String string = bVar.f10898a.getString("|T|" + str4 + "|" + str3, null);
if (string != null && !string.isEmpty()) {
if (string.startsWith("{")) {
try {
str2 = new JSONObject(string).getString("token");
} catch (JSONException unused) {
}
} else {
str2 = string;
}
} else {
i10++;
}
}
}
}
a7.c cVar = this.f10688b;
t5.g gVar = this.f10687a;
gVar.a();
String str5 = gVar.f9565c.f9582a;
String str6 = aVar.f10890a;
t5.g gVar2 = this.f10687a;
gVar2.a();
String str7 = gVar2.f9565c.f9588g;
t5.g gVar3 = this.f10687a;
gVar3.a();
String str8 = gVar3.f9565c.f9583b;
a7.e eVar = cVar.f125c;
if (eVar.b()) {
URL a10 = a7.c.a(String.format("projects/%s/installations", str7));
for (int i11 = 0; i11 <= 1; i11++) {
TrafficStats.setThreadStatsTag(32769);
HttpURLConnection c10 = cVar.c(a10, str5);
try {
c10.setRequestMethod("POST");
c10.setDoOutput(true);
if (str2 != null) {
c10.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2);
}
a7.c.g(c10, str6, str8);
responseCode = c10.getResponseCode();
eVar.d(responseCode);
if (responseCode >= 200 && responseCode < 300) {
z10 = true;
} else {
z10 = false;
}
} catch (IOException | AssertionError unused2) {
} catch (Throwable th) {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
throw th;
}
if (z10) {
e10 = a7.c.e(c10);
} else {
a7.c.b(c10, str8, str5, str7);
if (responseCode != 429) {
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.");
e10 = new a7.a(null, null, null, null, a7.d.BAD_CONFIG);
} else {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
}
} else {
throw new f("Firebase servers have received too many requests from this client in a short period of time. Please try again later.");
}
}
c10.disconnect();
TrafficStats.clearThreadStatsTag();
int ordinal = e10.f117e.ordinal();
if (ordinal != 0) {
if (ordinal == 1) {
b4 b4Var = new b4(aVar);
b4Var.f6449g = "BAD CONFIG";
b4Var.q(z6.c.REGISTER_ERROR);
return b4Var.h();
}
throw new f("Firebase Installations Service is unavailable. Please try again later.");
}
String str9 = e10.f114b;
String str10 = e10.f115c;
k kVar = this.f10690d;
kVar.getClass();
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
kVar.f10707a.getClass();
long seconds = timeUnit.toSeconds(System.currentTimeMillis());
a7.b bVar2 = e10.f116d;
String str11 = bVar2.f118a;
long j10 = bVar2.f119b;
b4 b4Var2 = new b4(aVar);
b4Var2.f6443a = str9;
b4Var2.q(z6.c.REGISTERED);
b4Var2.f6445c = str11;
b4Var2.f6446d = str10;
b4Var2.f6447e = Long.valueOf(j10);
b4Var2.f6448f = Long.valueOf(seconds);
return b4Var2.h();
}
throw new f("Firebase Installations Service is unavailable. Please try again later.");
}
throw new f("Firebase Installations Service is unavailable. Please try again later.");
}
public final void j(Exception exc) {
synchronized (this.f10693g) {
Iterator it = this.f10698l.iterator();
while (it.hasNext()) {
if (((j) it.next()).b(exc)) {
it.remove();
}
}
}
}
public final void k(z6.a aVar) {
synchronized (this.f10693g) {
Iterator it = this.f10698l.iterator();
while (it.hasNext()) {
if (((j) it.next()).a(aVar)) {
it.remove();
}
}
}
}
public final synchronized void l(String str) {
this.f10696j = str;
}
public final synchronized void m(z6.a aVar, z6.a aVar2) {
if (this.f10697k.size() != 0 && !TextUtils.equals(aVar.f10890a, aVar2.f10890a)) {
Iterator it = this.f10697k.iterator();
if (it.hasNext()) {
a.d.t(it.next());
throw null;
}
}
}
}