正在查看: Baubap v3.9.7 应用的 c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Baubap v3.9.7 应用的 c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package fz;
import android.content.Context;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import android.util.JsonReader;
import b2.o;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.Tasks;
import d0.l;
import f0.q;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
import java.util.zip.GZIPOutputStream;
import org.json.JSONException;
import org.json.JSONObject;
import yy.h;
public final class c {
public static final Pattern d = Pattern.compile("[0-9]+s");
public static final Charset e = Charset.forName("UTF-8");
public final Context a;
public final cz.c b;
public final e c = new e();
public c(Context context, cz.c cVar) {
this.a = context;
this.b = cVar;
}
public static URL a(String str) {
try {
return new URL(String.format("https://%s/%s/%s", "firebaseinstallations.googleapis.com", "v1", str));
} catch (MalformedURLException e2) {
throw new dz.f(e2.getMessage());
}
}
public static void b(HttpURLConnection httpURLConnection, String str, String str2, String str3) {
InputStream errorStream = httpURLConnection.getErrorStream();
String str4 = null;
if (errorStream != null) {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(errorStream, e));
try {
StringBuilder sb = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb.append(readLine);
sb.append('\n');
}
str4 = String.format("Error when communicating with the Firebase Installations server API. HTTP response: [%d %s: %s]", Integer.valueOf(httpURLConnection.getResponseCode()), httpURLConnection.getResponseMessage(), sb);
} catch (IOException unused) {
} catch (Throwable th) {
try {
bufferedReader.close();
} catch (IOException unused2) {
}
throw th;
}
try {
bufferedReader.close();
} catch (IOException unused3) {
}
}
if (TextUtils.isEmpty(str4)) {
return;
}
io.sentry.android.core.c.t("Firebase-Installations", str4);
Object[] objArr = new Object[3];
objArr[0] = str2;
objArr[1] = str3;
objArr[2] = TextUtils.isEmpty(str) ? "" : o.p(", ", str);
io.sentry.android.core.c.t("Firebase-Installations", String.format("Firebase options used while communicating with Firebase server APIs: %s, %s%s", objArr));
}
public static long d(String str) {
q.v("Invalid Expiration Timestamp.", d.matcher(str).matches());
if (str == null || str.length() == 0) {
return 0L;
}
return Long.parseLong(str.substring(0, str.length() - 1));
}
public static a e(HttpURLConnection httpURLConnection) {
InputStream inputStream = httpURLConnection.getInputStream();
JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, e));
h a = b.a();
l lVar = new l(15);
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String nextName = jsonReader.nextName();
if (nextName.equals("name")) {
lVar.a = jsonReader.nextString();
} else if (nextName.equals("fid")) {
lVar.b = jsonReader.nextString();
} else if (nextName.equals("refreshToken")) {
lVar.c = jsonReader.nextString();
} else if (nextName.equals("authToken")) {
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String nextName2 = jsonReader.nextName();
if (nextName2.equals("token")) {
a.c = jsonReader.nextString();
} else if (nextName2.equals("expiresIn")) {
a.d = Long.valueOf(d(jsonReader.nextString()));
} else {
jsonReader.skipValue();
}
}
lVar.d = a.b();
jsonReader.endObject();
} else {
jsonReader.skipValue();
}
}
jsonReader.endObject();
jsonReader.close();
inputStream.close();
d dVar = d.b;
lVar.e = dVar;
return new a((String) lVar.a, (String) lVar.b, (String) lVar.c, (b) lVar.d, dVar);
}
public static b f(HttpURLConnection httpURLConnection) {
InputStream inputStream = httpURLConnection.getInputStream();
JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, e));
h a = b.a();
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String nextName = jsonReader.nextName();
if (nextName.equals("token")) {
a.c = jsonReader.nextString();
} else if (nextName.equals("expiresIn")) {
a.d = Long.valueOf(d(jsonReader.nextString()));
} else {
jsonReader.skipValue();
}
}
jsonReader.endObject();
jsonReader.close();
inputStream.close();
a.e = f.b;
return a.b();
}
public static void g(HttpURLConnection httpURLConnection, String str, String str2) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("fid", str);
jSONObject.put("appId", str2);
jSONObject.put("authVersion", "FIS_v2");
jSONObject.put("sdkVersion", "a:17.2.0");
i(httpURLConnection, jSONObject.toString().getBytes("UTF-8"));
} catch (JSONException e2) {
throw new IllegalStateException(e2);
}
}
public static void h(HttpURLConnection httpURLConnection) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("sdkVersion", "a:17.2.0");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("installation", jSONObject);
i(httpURLConnection, jSONObject2.toString().getBytes("UTF-8"));
} catch (JSONException e2) {
throw new IllegalStateException(e2);
}
}
public static void i(URLConnection uRLConnection, byte[] bArr) {
OutputStream outputStream = uRLConnection.getOutputStream();
if (outputStream == null) {
throw new IOException("Cannot send request to FIS servers. No OutputStream available.");
}
GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(outputStream);
try {
gZIPOutputStream.write(bArr);
} finally {
try {
gZIPOutputStream.close();
outputStream.close();
} catch (IOException unused) {
}
}
}
public final HttpURLConnection c(URL url, String str) {
Task call;
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setConnectTimeout(10000);
httpURLConnection.setUseCaches(false);
httpURLConnection.setReadTimeout(10000);
httpURLConnection.addRequestProperty("Content-Type", "application/json");
httpURLConnection.addRequestProperty("Accept", "application/json");
httpURLConnection.addRequestProperty("Content-Encoding", "gzip");
httpURLConnection.addRequestProperty("Cache-Control", "no-cache");
Context context = this.a;
httpURLConnection.addRequestProperty("X-Android-Package", context.getPackageName());
az.f fVar = (az.f) this.b.get();
if (fVar != null) {
try {
az.d dVar = (az.d) fVar;
if (!com.bumptech.glide.d.r1(dVar.b)) {
call = Tasks.forResult("");
} else {
call = Tasks.call(dVar.e, new az.c(dVar, 0));
}
httpURLConnection.addRequestProperty("x-firebase-client", (String) Tasks.await(call));
} catch (InterruptedException e2) {
Thread.currentThread().interrupt();
io.sentry.android.core.c.u("ContentValues", "Failed to get heartbeats header", e2);
} catch (ExecutionException e3) {
io.sentry.android.core.c.u("ContentValues", "Failed to get heartbeats header", e3);
}
}
String str2 = null;
try {
byte[] c = pv.c.c(context, context.getPackageName());
if (c == null) {
io.sentry.android.core.c.c("ContentValues", "Could not get fingerprint hash for package: " + context.getPackageName());
} else {
str2 = pv.c.a(c);
}
} catch (PackageManager.NameNotFoundException e4) {
io.sentry.android.core.c.d("ContentValues", "No such package: " + context.getPackageName(), e4);
}
httpURLConnection.addRequestProperty("X-Android-Cert", str2);
httpURLConnection.addRequestProperty("x-goog-api-key", str);
return httpURLConnection;
} catch (IOException unused) {
throw new dz.f("Firebase Installations Service is unavailable. Please try again later.");
}
}
}