正在查看: Atlys v4.8.7 应用的 C6018c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Atlys v4.8.7 应用的 C6018c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package sf;
import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.Log;
import com.facebook.internal.security.CertificateUtil;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.installations.FirebaseInstallationsException;
import f4.RunnableC3386e;
import hf.u;
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 m3.y;
import org.json.JSONException;
import org.json.JSONObject;
import qe.C5581c;
import qe.C5589k;
import re.j;
import rf.InterfaceC5875b;
import tf.C6182a;
import tf.C6183b;
import uf.C6255a;
import w.AbstractC6430q;
public final class C6018c implements d {
public static final Object f63052m = new Object();
public final be.h f63053a;
public final uf.c f63054b;
public final y f63055c;
public final i f63056d;
public final C5589k f63057e;
public final g f63058f;
public final Object f63059g;
public final ExecutorService f63060h;
public final Executor f63061i;
public String f63062j;
public final HashSet f63063k;
public final ArrayList l;
static {
new AtomicInteger(1);
}
public C6018c(be.h hVar, InterfaceC5875b interfaceC5875b, ExecutorService executorService, j jVar) {
hVar.b();
uf.c cVar = new uf.c(hVar.f34385a, interfaceC5875b);
y yVar = new y();
yVar.f55688b = hVar;
if (Yj.a.f28217b == null) {
Yj.a.f28217b = new Yj.a(21);
}
Yj.a aVar = Yj.a.f28217b;
if (i.f63071d == null) {
i.f63071d = new i(aVar);
}
i iVar = i.f63071d;
C5589k c5589k = new C5589k(new C5581c(hVar, 2));
g gVar = new g();
this.f63059g = new Object();
this.f63063k = new HashSet();
this.l = new ArrayList();
this.f63053a = hVar;
this.f63054b = cVar;
this.f63055c = yVar;
this.f63056d = iVar;
this.f63057e = c5589k;
this.f63058f = gVar;
this.f63060h = executorService;
this.f63061i = jVar;
}
public final void a(h hVar) {
synchronized (this.f63059g) {
this.l.add(hVar);
}
}
public final void b(boolean z10) {
C6182a r10;
synchronized (f63052m) {
try {
be.h hVar = this.f63053a;
hVar.b();
y b10 = y.b(hVar.f34385a);
try {
r10 = this.f63055c.r();
int i10 = r10.f63967b;
if (i10 == 2 || i10 == 1) {
String h10 = h(r10);
y yVar = this.f63055c;
Un.g a10 = r10.a();
a10.f24127e = h10;
a10.k(3);
r10 = a10.i();
yVar.l(r10);
}
if (b10 != null) {
b10.s();
}
} catch (Throwable th2) {
if (b10 != null) {
b10.s();
}
throw th2;
}
} catch (Throwable th3) {
throw th3;
}
}
if (z10) {
Un.g a11 = r10.a();
a11.f24128f = null;
r10 = a11.i();
}
k(r10);
this.f63061i.execute(new RunnableC6017b(this, z10));
}
public final C6182a c(C6182a c6182a) {
int responseCode;
uf.b f10;
be.h hVar = this.f63053a;
hVar.b();
String str = hVar.f34387c.f34400a;
hVar.b();
String str2 = hVar.f34387c.f34406g;
String str3 = c6182a.f63969d;
uf.c cVar = this.f63054b;
uf.d dVar = cVar.f64512c;
if (!dVar.b()) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
URL a10 = uf.c.a("projects/" + str2 + "/installations/" + c6182a.f63966a + "/authTokens:generate");
for (int i10 = 0; i10 <= 1; i10++) {
TrafficStats.setThreadStatsTag(32771);
HttpURLConnection c10 = cVar.c(a10, str);
try {
try {
c10.setRequestMethod("POST");
c10.addRequestProperty("Authorization", "FIS_v2 " + str3);
c10.setDoOutput(true);
uf.c.h(c10);
responseCode = c10.getResponseCode();
dVar.d(responseCode);
} catch (Throwable th2) {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
throw th2;
}
} catch (IOException | AssertionError unused) {
}
if (responseCode >= 200 && responseCode < 300) {
f10 = uf.c.f(c10);
} else {
uf.c.b(c10, null, str, str2);
if (responseCode == 401 || responseCode == 404) {
B3.a a11 = uf.b.a();
a11.f2979b = 3;
f10 = a11.d();
} 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.");
B3.a a12 = uf.b.a();
a12.f2979b = 2;
f10 = a12.d();
}
c10.disconnect();
TrafficStats.clearThreadStatsTag();
}
}
c10.disconnect();
TrafficStats.clearThreadStatsTag();
int n10 = AbstractC6430q.n(f10.f64507c);
if (n10 == 0) {
i iVar = this.f63056d;
iVar.getClass();
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
iVar.f63072a.getClass();
long seconds = timeUnit.toSeconds(System.currentTimeMillis());
Un.g a13 = c6182a.a();
a13.f24128f = f10.f64505a;
a13.f24125c = Long.valueOf(f10.f64506b);
a13.f24129g = Long.valueOf(seconds);
return a13.i();
}
if (n10 == 1) {
Un.g a14 = c6182a.a();
a14.f24130h = "BAD CONFIG";
a14.k(5);
return a14.i();
}
if (n10 != 2) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
l(null);
Un.g a15 = c6182a.a();
a15.k(2);
return a15.i();
}
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
public final Task d() {
String str;
g();
synchronized (this) {
str = this.f63062j;
}
if (str != null) {
return Tasks.forResult(str);
}
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
a(new f(taskCompletionSource));
Task task = taskCompletionSource.getTask();
this.f63060h.execute(new RunnableC3386e(this, 20));
return task;
}
public final Task e() {
g();
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
a(new e(this.f63056d, taskCompletionSource));
Task task = taskCompletionSource.getTask();
this.f63060h.execute(new RunnableC6017b(this));
return task;
}
public final void f(C6182a c6182a) {
synchronized (f63052m) {
try {
be.h hVar = this.f63053a;
hVar.b();
y b10 = y.b(hVar.f34385a);
try {
this.f63055c.l(c6182a);
if (b10 != null) {
b10.s();
}
} catch (Throwable th2) {
if (b10 != null) {
b10.s();
}
throw th2;
}
} catch (Throwable th3) {
throw th3;
}
}
}
public final void g() {
be.h hVar = this.f63053a;
hVar.b();
Preconditions.checkNotEmpty(hVar.f34387c.f34401b, "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.");
hVar.b();
Preconditions.checkNotEmpty(hVar.f34387c.f34406g, "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.");
hVar.b();
Preconditions.checkNotEmpty(hVar.f34387c.f34400a, "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.");
hVar.b();
String str = hVar.f34387c.f34401b;
Pattern pattern = i.f63070c;
Preconditions.checkArgument(str.contains(CertificateUtil.DELIMITER), "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.");
hVar.b();
Preconditions.checkArgument(i.f63070c.matcher(hVar.f34387c.f34400a).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.");
}
public final String h(C6182a c6182a) {
String a10;
be.h hVar = this.f63053a;
hVar.b();
if (!hVar.f34386b.equals("CHIME_ANDROID_SDK")) {
be.h hVar2 = this.f63053a;
hVar2.b();
}
if (c6182a.f63967b == 1) {
C6183b c6183b = (C6183b) this.f63057e.get();
synchronized (c6183b.f63974a) {
try {
a10 = c6183b.a();
if (a10 == null) {
a10 = c6183b.b();
}
} finally {
}
}
if (!TextUtils.isEmpty(a10)) {
return a10;
}
this.f63058f.getClass();
return g.a();
}
this.f63058f.getClass();
return g.a();
}
public final C6182a i(C6182a c6182a) {
int responseCode;
String str = c6182a.f63966a;
int i10 = 0;
String str2 = null;
if (str != null && str.length() == 11) {
C6183b c6183b = (C6183b) this.f63057e.get();
synchronized (c6183b.f63974a) {
try {
String[] strArr = C6183b.f63973c;
int i11 = 0;
while (true) {
if (i11 < 4) {
String str3 = strArr[i11];
String string = c6183b.f63974a.getString("|T|" + c6183b.f63975b + "|" + str3, null);
if (string == null || string.isEmpty()) {
i11++;
} else if (string.startsWith("{")) {
try {
str2 = new JSONObject(string).getString("token");
} catch (JSONException unused) {
}
} else {
str2 = string;
}
}
}
} finally {
}
}
}
uf.c cVar = this.f63054b;
be.h hVar = this.f63053a;
hVar.b();
String str4 = hVar.f34387c.f34400a;
String str5 = c6182a.f63966a;
be.h hVar2 = this.f63053a;
hVar2.b();
String str6 = hVar2.f34387c.f34406g;
be.h hVar3 = this.f63053a;
hVar3.b();
String str7 = hVar3.f34387c.f34401b;
uf.d dVar = cVar.f64512c;
if (!dVar.b()) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
URL a10 = uf.c.a("projects/" + str6 + "/installations");
C6255a c6255a = cVar;
while (i10 <= 1) {
TrafficStats.setThreadStatsTag(32769);
HttpURLConnection c10 = c6255a.c(a10, str4);
try {
try {
c10.setRequestMethod("POST");
c10.setDoOutput(true);
if (str2 != null) {
c10.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2);
}
uf.c.g(c10, str5, str7);
responseCode = c10.getResponseCode();
dVar.d(responseCode);
} finally {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
}
} catch (IOException | AssertionError unused2) {
}
if (responseCode < 200 || responseCode >= 300) {
try {
uf.c.b(c10, str7, str4, str6);
} catch (IOException | AssertionError unused3) {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
i10++;
c6255a = c6255a;
}
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.");
C6255a c6255a2 = new C6255a(null, null, null, null, 2);
c10.disconnect();
TrafficStats.clearThreadStatsTag();
c6255a = c6255a2;
} else {
c10.disconnect();
TrafficStats.clearThreadStatsTag();
i10++;
c6255a = c6255a;
}
} else {
C6255a e4 = uf.c.e(c10);
c10.disconnect();
TrafficStats.clearThreadStatsTag();
c6255a = e4;
}
int n10 = AbstractC6430q.n(c6255a.f64504e);
if (n10 != 0) {
if (n10 != 1) {
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
Un.g a11 = c6182a.a();
a11.f24130h = "BAD CONFIG";
a11.k(5);
return a11.i();
}
String str8 = c6255a.f64501b;
String str9 = c6255a.f64502c;
i iVar = this.f63056d;
iVar.getClass();
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
iVar.f63072a.getClass();
long seconds = timeUnit.toSeconds(System.currentTimeMillis());
uf.b bVar = c6255a.f64503d;
String str10 = bVar.f64505a;
long j2 = bVar.f64506b;
Un.g a12 = c6182a.a();
a12.f24127e = str8;
a12.k(4);
a12.f24128f = str10;
a12.f24124b = str9;
a12.f24125c = Long.valueOf(j2);
a12.f24129g = Long.valueOf(seconds);
return a12.i();
}
throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
}
public final void j(Exception exc) {
synchronized (this.f63059g) {
try {
Iterator it = this.l.iterator();
while (it.hasNext()) {
if (((h) it.next()).a(exc)) {
it.remove();
}
}
} catch (Throwable th2) {
throw th2;
}
}
}
public final void k(C6182a c6182a) {
synchronized (this.f63059g) {
try {
Iterator it = this.l.iterator();
while (it.hasNext()) {
if (((h) it.next()).b(c6182a)) {
it.remove();
}
}
} catch (Throwable th2) {
throw th2;
}
}
}
public final synchronized void l(String str) {
this.f63062j = str;
}
public final synchronized void m(C6182a c6182a, C6182a c6182a2) {
if (this.f63063k.size() != 0 && !TextUtils.equals(c6182a.f63966a, c6182a2.f63966a)) {
Iterator it = this.f63063k.iterator();
if (it.hasNext()) {
u.C(it.next());
throw null;
}
}
}
}