正在查看: Perplexity v2.48.1 应用的 C4796d.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Perplexity v2.48.1 应用的 C4796d.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package kf;
import D5.A;
import Ic.D;
import Je.l;
import V3.AbstractC1762u;
import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.Log;
import com.google.firebase.installations.FirebaseInstallationsException;
import com.revenuecat.purchases.common.Constants;
import g.AbstractC3687w;
import h9.C3901i;
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.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import jk.C4530A;
import lf.C5031a;
import lf.C5032b;
import mf.C5149a;
import mf.C5150b;
import mf.C5151c;
import mf.C5152d;
import nd.k;
import nd.s;
import org.json.JSONException;
import org.json.JSONObject;
public final class C4796d implements InterfaceC4797e {
public static final Object f52416m = new Object();
public final Ce.g f52417a;
public final C5151c f52418b;
public final C4530A f52419c;
public final j f52420d;
public final l f52421e;
public final h f52422f;
public final Object f52423g;
public final ExecutorService f52424h;
public final Ke.l f52425i;
public String f52426j;
public final HashSet f52427k;
public final ArrayList f52428l;
static {
new AtomicInteger(1);
}
public C4796d(Ce.g gVar, jf.b bVar, ExecutorService executorService, Ke.l lVar) {
gVar.a();
C5151c c5151c = new C5151c(gVar.f2022a, bVar);
C4530A c4530a = new C4530A(gVar);
if (C3901i.f47257x == null) {
C3901i.f47257x = new C3901i(23);
}
C3901i c3901i = C3901i.f47257x;
if (j.f52436d == null) {
j.f52436d = new j(c3901i);
}
j jVar = j.f52436d;
l lVar2 = new l(new Je.e(gVar, 2));
h hVar = new h();
this.f52423g = new Object();
this.f52427k = new HashSet();
this.f52428l = new ArrayList();
this.f52417a = gVar;
this.f52418b = c5151c;
this.f52419c = c4530a;
this.f52420d = jVar;
this.f52421e = lVar2;
this.f52422f = hVar;
this.f52424h = executorService;
this.f52425i = lVar;
}
public final void a() {
C5031a o10;
synchronized (f52416m) {
try {
Ce.g gVar = this.f52417a;
gVar.a();
C4794b a4 = C4794b.a(gVar.f2022a);
try {
o10 = this.f52419c.o();
int i10 = o10.f57097b;
boolean z10 = true;
if (i10 != 2 && i10 != 1) {
z10 = false;
}
if (a4 != null) {
a4.e();
}
} catch (Throwable th2) {
if (a4 != null) {
a4.e();
}
throw th2;
}
} catch (Throwable th3) {
throw th3;
}
}
i(o10);
this.f52425i.execute(new RunnableC4795c(this, 2));
}
public final C5031a b(C5031a c5031a) {
int responseCode;
C5150b f4;
Ce.g gVar = this.f52417a;
gVar.a();
String str = gVar.f2024c.f2037a;
String str2 = c5031a.f57096a;
Ce.g gVar2 = this.f52417a;
gVar2.a();
String str3 = gVar2.f2024c.f2043g;
String str4 = c5031a.f57099d;
C5151c c5151c = this.f52418b;
C5152d c5152d = c5151c.f57816c;
if (!c5152d.a()) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
URL a4 = C5151c.a("projects/" + str3 + "/installations/" + str2 + "/authTokens:generate");
for (int i10 = 0; i10 <= 1; i10++) {
TrafficStats.setThreadStatsTag(32771);
HttpURLConnection c10 = c5151c.c(a4, str);
try {
try {
c10.setRequestMethod("POST");
c10.addRequestProperty("Authorization", "FIS_v2 " + str4);
c10.setDoOutput(true);
C5151c.h(c10);
responseCode = c10.getResponseCode();
c5152d.b(responseCode);
} catch (Throwable th2) {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
throw th2;
}
} catch (IOException | AssertionError unused) {
}
if (responseCode >= 200 && responseCode < 300) {
f4 = C5151c.f(c10);
} else {
C5151c.b(c10, null, str, str3);
if (responseCode == 401 || responseCode == 404) {
A a10 = C5150b.a();
a10.f3124x = 3;
f4 = a10.j();
} else {
if (responseCode == 429) {
throw new FirebaseInstallationsException("Firebase servers have received too many requests from this client in a short period of time. Please try again later.");
}
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.");
A a11 = C5150b.a();
a11.f3124x = 2;
f4 = a11.j();
}
c10.disconnect();
TrafficStats.clearThreadStatsTag();
}
}
c10.disconnect();
TrafficStats.clearThreadStatsTag();
int f10 = AbstractC1762u.f(f4.f57811c);
if (f10 == 0) {
j jVar = this.f52420d;
jVar.getClass();
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
jVar.f52437a.getClass();
long seconds = timeUnit.toSeconds(System.currentTimeMillis());
Vm.g a12 = c5031a.a();
a12.f27000c = f4.f57809a;
a12.f27002e = Long.valueOf(f4.f57810b);
a12.f27003f = Long.valueOf(seconds);
return a12.i();
}
if (f10 == 1) {
Vm.g a13 = c5031a.a();
a13.f27004g = "BAD CONFIG";
a13.f26998a = 5;
return a13.i();
}
if (f10 != 2) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
synchronized (this) {
this.f52426j = null;
}
Vm.g a14 = c5031a.a();
a14.f26998a = 2;
return a14.i();
}
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
public final s c() {
String str;
e();
synchronized (this) {
str = this.f52426j;
}
if (str != null) {
return AbstractC3687w.n(str);
}
k kVar = new k();
g gVar = new g(kVar);
synchronized (this.f52423g) {
this.f52428l.add(gVar);
}
s sVar = kVar.f58821a;
this.f52424h.execute(new RunnableC4795c(this, 0));
return sVar;
}
public final s d() {
e();
k kVar = new k();
f fVar = new f(this.f52420d, kVar);
synchronized (this.f52423g) {
this.f52428l.add(fVar);
}
this.f52424h.execute(new RunnableC4795c(this, 1));
return kVar.f58821a;
}
public final void e() {
Ce.g gVar = this.f52417a;
gVar.a();
D.f(gVar.f2024c.f2038b, "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();
D.f(gVar.f2024c.f2043g, "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();
D.f(gVar.f2024c.f2037a, "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.f2024c.f2038b;
Pattern pattern = j.f52435c;
D.a("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(Constants.SUBS_ID_BASE_PLAN_ID_SEPARATOR));
gVar.a();
D.a("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.", j.f52435c.matcher(gVar.f2024c.f2037a).matches());
}
public final String f(C5031a c5031a) {
String string;
Ce.g gVar = this.f52417a;
gVar.a();
if (!gVar.f2023b.equals("CHIME_ANDROID_SDK")) {
Ce.g gVar2 = this.f52417a;
gVar2.a();
}
if (c5031a.f57097b == 1) {
C5032b c5032b = (C5032b) this.f52421e.get();
synchronized (c5032b.f57104a) {
try {
synchronized (c5032b.f57104a) {
string = c5032b.f57104a.getString("|S|id", null);
}
if (string == null) {
string = c5032b.a();
}
} finally {
}
}
if (!TextUtils.isEmpty(string)) {
return string;
}
this.f52422f.getClass();
return h.a();
}
this.f52422f.getClass();
return h.a();
}
public final C5031a g(C5031a c5031a) {
int responseCode;
String str = c5031a.f57096a;
String str2 = null;
if (str != null && str.length() == 11) {
C5032b c5032b = (C5032b) this.f52421e.get();
synchronized (c5032b.f57104a) {
try {
String[] strArr = C5032b.f57103c;
int i10 = 0;
while (true) {
if (i10 < 4) {
String str3 = strArr[i10];
String string = c5032b.f57104a.getString("|T|" + c5032b.f57105b + "|" + 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;
}
}
}
} finally {
}
}
}
C5151c c5151c = this.f52418b;
Ce.g gVar = this.f52417a;
gVar.a();
String str4 = gVar.f2024c.f2037a;
String str5 = c5031a.f57096a;
Ce.g gVar2 = this.f52417a;
gVar2.a();
String str6 = gVar2.f2024c.f2043g;
Ce.g gVar3 = this.f52417a;
gVar3.a();
String str7 = gVar3.f2024c.f2038b;
C5152d c5152d = c5151c.f57816c;
if (!c5152d.a()) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
URL a4 = C5151c.a("projects/" + str6 + "/installations");
int i11 = 0;
C5149a c5149a = c5151c;
while (i11 <= 1) {
TrafficStats.setThreadStatsTag(32769);
HttpURLConnection c10 = c5149a.c(a4, str4);
try {
try {
c10.setRequestMethod("POST");
c10.setDoOutput(true);
if (str2 != null) {
c10.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2);
}
C5151c.g(c10, str5, str7);
responseCode = c10.getResponseCode();
c5152d.b(responseCode);
} catch (IOException | AssertionError unused2) {
}
if (responseCode >= 200 && responseCode < 300) {
C5149a e10 = C5151c.e(c10);
c10.disconnect();
TrafficStats.clearThreadStatsTag();
c5149a = e10;
} else {
try {
C5151c.b(c10, str7, str4, str6);
} catch (IOException | AssertionError unused3) {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
i11++;
c5149a = c5149a;
}
if (responseCode == 429) {
throw new FirebaseInstallationsException("Firebase servers have received too many requests from this client in a short period of time. Please try again later.");
}
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.");
C5149a c5149a2 = new C5149a(null, null, null, null, 2);
c10.disconnect();
TrafficStats.clearThreadStatsTag();
c5149a = c5149a2;
} else {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
i11++;
c5149a = c5149a;
}
}
int f4 = AbstractC1762u.f(c5149a.f57808e);
if (f4 != 0) {
if (f4 != 1) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
Vm.g a10 = c5031a.a();
a10.f27004g = "BAD CONFIG";
a10.f26998a = 5;
return a10.i();
}
String str8 = c5149a.f57805b;
String str9 = c5149a.f57806c;
j jVar = this.f52420d;
jVar.getClass();
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
jVar.f52437a.getClass();
long seconds = timeUnit.toSeconds(System.currentTimeMillis());
C5150b c5150b = c5149a.f57807d;
String str10 = c5150b.f57809a;
long j10 = c5150b.f57810b;
Vm.g a11 = c5031a.a();
a11.f26999b = str8;
a11.f26998a = 4;
a11.f27000c = str10;
a11.f27001d = str9;
a11.f27002e = Long.valueOf(j10);
a11.f27003f = Long.valueOf(seconds);
return a11.i();
} finally {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
}
}
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
public final void h(Exception exc) {
synchronized (this.f52423g) {
try {
Iterator it = this.f52428l.iterator();
while (it.hasNext()) {
if (((i) it.next()).a(exc)) {
it.remove();
}
}
} catch (Throwable th2) {
throw th2;
}
}
}
public final void i(C5031a c5031a) {
synchronized (this.f52423g) {
try {
Iterator it = this.f52428l.iterator();
while (it.hasNext()) {
if (((i) it.next()).b(c5031a)) {
it.remove();
}
}
} catch (Throwable th2) {
throw th2;
}
}
}
}