正在查看: Releam v2.13.2 应用的 c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Releam v2.13.2 应用的 c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package x6;
import android.content.Context;
import android.text.TextUtils;
import android.util.JsonReader;
import android.util.Log;
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.regex.Pattern;
import java.util.zip.GZIPOutputStream;
import javax.xml.XMLConstants;
import ka.v;
import org.json.JSONException;
import org.json.JSONObject;
import x1.g;
public final class c {
public static final Pattern f10685d = Pattern.compile("[0-9]+s");
public static final Charset f10686e = Charset.forName("UTF-8");
public final Context f10687a;
public final u6.c f10688b;
public final e f10689c = new e();
public c(Context context, u6.c cVar) {
this.f10687a = context;
this.f10688b = cVar;
}
public static URL a(String str) {
try {
return new URL(String.format("https://%s/%s/%s", "firebaseinstallations.googleapis.com", "v1", str));
} catch (MalformedURLException e10) {
throw new v6.d(e10.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, f10686e));
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;
}
Log.w("Firebase-Installations", str4);
Object[] objArr = new Object[3];
objArr[0] = str2;
objArr[1] = str3;
objArr[2] = TextUtils.isEmpty(str) ? XMLConstants.DEFAULT_NS_PREFIX : g.a(", ", str);
Log.w("Firebase-Installations", String.format("Firebase options used while communicating with Firebase server APIs: %s, %s%s", objArr));
}
public static long d(String str) {
v.n(f10685d.matcher(str).matches(), "Invalid Expiration Timestamp.");
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, f10686e));
long j10 = 0L;
jsonReader.beginObject();
String str = null;
String str2 = null;
String str3 = null;
String str4 = null;
b bVar = null;
while (jsonReader.hasNext()) {
String nextName = jsonReader.nextName();
if (nextName.equals("name")) {
str2 = jsonReader.nextString();
} else if (nextName.equals("fid")) {
str3 = jsonReader.nextString();
} else if (nextName.equals("refreshToken")) {
str4 = jsonReader.nextString();
} else if (nextName.equals("authToken")) {
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String nextName2 = jsonReader.nextName();
if (nextName2.equals("token")) {
str = jsonReader.nextString();
} else if (nextName2.equals("expiresIn")) {
j10 = Long.valueOf(d(jsonReader.nextString()));
} else {
jsonReader.skipValue();
}
}
String str5 = j10 == null ? " tokenExpirationTimestamp" : XMLConstants.DEFAULT_NS_PREFIX;
if (!str5.isEmpty()) {
throw new IllegalStateException("Missing required properties:".concat(str5));
}
bVar = new b(str, j10.longValue(), null);
jsonReader.endObject();
} else {
jsonReader.skipValue();
}
}
jsonReader.endObject();
jsonReader.close();
inputStream.close();
return new a(str2, str3, str4, bVar, d.OK);
}
public static b f(HttpURLConnection httpURLConnection) {
InputStream inputStream = httpURLConnection.getInputStream();
JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, f10686e));
long j10 = 0L;
jsonReader.beginObject();
String str = null;
while (jsonReader.hasNext()) {
String nextName = jsonReader.nextName();
if (nextName.equals("token")) {
str = jsonReader.nextString();
} else if (nextName.equals("expiresIn")) {
j10 = Long.valueOf(d(jsonReader.nextString()));
} else {
jsonReader.skipValue();
}
}
jsonReader.endObject();
jsonReader.close();
inputStream.close();
f fVar = f.OK;
String str2 = j10 == null ? " tokenExpirationTimestamp" : XMLConstants.DEFAULT_NS_PREFIX;
if (str2.isEmpty()) {
return new b(str, j10.longValue(), fVar);
}
throw new IllegalStateException("Missing required properties:".concat(str2));
}
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.1.0");
i(httpURLConnection, jSONObject.toString().getBytes("UTF-8"));
} catch (JSONException e10) {
throw new IllegalStateException(e10);
}
}
public static void h(HttpURLConnection httpURLConnection) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("sdkVersion", "a:17.1.0");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("installation", jSONObject);
i(httpURLConnection, jSONObject2.toString().getBytes("UTF-8"));
} catch (JSONException e10) {
throw new IllegalStateException(e10);
}
}
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 java.net.HttpURLConnection c(java.lang.String r10, java.net.URL r11) {
throw new UnsupportedOperationException("Method not decompiled: x6.c.c(java.lang.String, java.net.URL):java.net.HttpURLConnection");
}
}