Recover Files v1.3.9版本的 MD5 值为:27a8b2c239c6cb7111d74d6bb07d21b2
以下内容为反编译后的 c.java 源代码,内容仅作参考
package r8;
import a9.x;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.JsonReader;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.browser.trusted.n;
import androidx.browser.trusted.sharing.ShareTarget;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.AndroidUtilsLight;
import com.google.android.gms.common.util.Hex;
import com.google.android.gms.common.util.VisibleForTesting;
import com.google.android.gms.tasks.Tasks;
import com.zhy.http.okhttp.OkHttpUtils;
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 k8.j;
import n8.l;
import org.json.JSONException;
import org.json.JSONObject;
import r8.a;
import r8.d;
import r8.f;
public class c {
public static final String A = "x-goog-api-key";
public static final int B = 10000;
public static final int D = 1;
public static final String F = "a:";
public static final String G = "Firebase-Installations";
@VisibleForTesting
public static final String H = "Invalid Expiration Timestamp.";
public static final int f38453e = 32768;
public static final int f38454f = 32769;
public static final int f38455g = 32770;
public static final int f38456h = 32771;
public static final String f38457i = "firebaseinstallations.googleapis.com";
public static final String f38458j = "projects/%s/installations";
public static final String f38459k = "projects/%s/installations/%s/authTokens:generate";
public static final String f38460l = "projects/%s/installations/%s";
public static final String f38461m = "v1";
public static final String f38462n = "FIS_v2";
public static final String f38463o = "Content-Type";
public static final String f38464p = "Accept";
public static final String f38465q = "application/json";
public static final String f38466r = "Content-Encoding";
public static final String f38467s = "gzip";
public static final String f38468t = "Cache-Control";
public static final String f38469u = "no-cache";
public static final String f38470v = "fire-installations-id";
public static final String f38471w = "x-firebase-client";
public static final String f38472x = "X-Android-Package";
public static final String f38473y = "X-Android-Cert";
public static final String f38474z = "x-goog-fis-android-iid-migration-auth";
public boolean f38475a;
public final Context f38476b;
public final m8.b<j> f38477c;
public final e f38478d = new e();
public static final Pattern C = Pattern.compile("[0-9]+s");
public static final Charset E = Charset.forName("UTF-8");
public c(@NonNull Context context, @NonNull m8.b<j> bVar) {
this.f38476b = context;
this.f38477c = bVar;
}
public static String a(@Nullable String str, @NonNull String str2, @NonNull String str3) {
String a10;
Object[] objArr = new Object[3];
objArr[0] = str2;
objArr[1] = str3;
if (TextUtils.isEmpty(str)) {
a10 = "";
} else {
a10 = n.a(", ", str);
}
objArr[2] = a10;
return String.format("Firebase options used while communicating with Firebase server APIs: %s, %s%s", objArr);
}
public static JSONObject b(@Nullable String str, @NonNull String str2) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("fid", str);
jSONObject.put(x.b.f195e, str2);
jSONObject.put("authVersion", f38462n);
jSONObject.put(x.b.f203m, "a:17.1.3");
return jSONObject;
} catch (JSONException e10) {
throw new IllegalStateException(e10);
}
}
public static JSONObject c() {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put(x.b.f203m, "a:17.1.3");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("installation", jSONObject);
return jSONObject2;
} catch (JSONException e10) {
throw new IllegalStateException(e10);
}
}
public static byte[] i(JSONObject jSONObject) throws IOException {
return jSONObject.toString().getBytes("UTF-8");
}
public static boolean j(int i10) {
if (i10 >= 200 && i10 < 300) {
return true;
}
return false;
}
public static void l(HttpURLConnection httpURLConnection, @Nullable String str, @NonNull String str2, @NonNull String str3) {
if (!TextUtils.isEmpty(p(httpURLConnection))) {
a(str, str2, str3);
}
}
@VisibleForTesting
public static long n(String str) {
Preconditions.checkArgument(C.matcher(str).matches(), H);
if (str != null && str.length() != 0) {
return Long.parseLong(str.substring(0, str.length() - 1));
}
return 0L;
}
@Nullable
public static String p(HttpURLConnection httpURLConnection) {
InputStream errorStream = httpURLConnection.getErrorStream();
if (errorStream == null) {
return null;
}
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(errorStream, E));
try {
try {
StringBuilder sb2 = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb2.append(readLine);
sb2.append('\n');
}
String format = String.format("Error when communicating with the Firebase Installations server API. HTTP response: [%d %s: %s]", Integer.valueOf(httpURLConnection.getResponseCode()), httpURLConnection.getResponseMessage(), sb2);
try {
bufferedReader.close();
} catch (IOException unused) {
}
return format;
} catch (IOException unused2) {
return null;
}
} catch (IOException unused3) {
bufferedReader.close();
return null;
} catch (Throwable th2) {
try {
bufferedReader.close();
} catch (IOException unused4) {
}
throw th2;
}
}
public static void t(URLConnection uRLConnection, byte[] bArr) throws IOException {
OutputStream outputStream = uRLConnection.getOutputStream();
if (outputStream != null) {
GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(outputStream);
try {
gZIPOutputStream.write(bArr);
try {
return;
} catch (IOException unused) {
return;
}
} finally {
try {
gZIPOutputStream.close();
outputStream.close();
} catch (IOException unused2) {
}
}
}
throw new IOException("Cannot send request to FIS servers. No OutputStream available.");
}
@NonNull
public d d(@NonNull String str, @Nullable String str2, @NonNull String str3, @NonNull String str4, @Nullable String str5) throws l {
int responseCode;
d o10;
if (this.f38478d.b()) {
URL h10 = h(String.format(f38458j, str3));
for (int i10 = 0; i10 <= 1; i10++) {
TrafficStats.setThreadStatsTag(f38454f);
HttpURLConnection m10 = m(h10, str);
try {
try {
m10.setRequestMethod(ShareTarget.METHOD_POST);
m10.setDoOutput(true);
if (str5 != null) {
m10.addRequestProperty(f38474z, str5);
}
r(m10, str2, str4);
responseCode = m10.getResponseCode();
this.f38478d.f(responseCode);
} finally {
m10.disconnect();
TrafficStats.clearThreadStatsTag();
}
} catch (IOException | AssertionError unused) {
}
if (j(responseCode)) {
o10 = o(m10);
} else {
l(m10, str4, str, str3);
if (responseCode != 429) {
if (responseCode < 500 || responseCode >= 600) {
a.b bVar = new a.b();
bVar.f38446e = d.b.BAD_CONFIG;
o10 = bVar.a();
} else {
m10.disconnect();
TrafficStats.clearThreadStatsTag();
}
} else {
throw new l("Firebase servers have received too many requests from this client in a short period of time. Please try again later.", l.a.TOO_MANY_REQUESTS);
}
}
return o10;
}
throw new l("Firebase Installations Service is unavailable. Please try again later.", l.a.UNAVAILABLE);
}
throw new l("Firebase Installations Service is unavailable. Please try again later.", l.a.UNAVAILABLE);
}
@NonNull
public void e(@NonNull String str, @NonNull String str2, @NonNull String str3, @NonNull String str4) throws l {
int responseCode;
int i10 = 0;
URL h10 = h(String.format(f38460l, str3, str2));
while (i10 <= 1) {
TrafficStats.setThreadStatsTag(f38455g);
HttpURLConnection m10 = m(h10, str);
try {
m10.setRequestMethod(OkHttpUtils.METHOD.DELETE);
m10.addRequestProperty(w6.d.f40375n, "FIS_v2 " + str4);
responseCode = m10.getResponseCode();
} catch (IOException unused) {
} catch (Throwable th2) {
m10.disconnect();
TrafficStats.clearThreadStatsTag();
throw th2;
}
if (responseCode != 200 && responseCode != 401 && responseCode != 404) {
l(m10, null, str, str3);
if (responseCode != 429 && (responseCode < 500 || responseCode >= 600)) {
throw new l("Bad config while trying to delete FID", l.a.BAD_CONFIG);
break;
}
i10++;
m10.disconnect();
TrafficStats.clearThreadStatsTag();
}
m10.disconnect();
TrafficStats.clearThreadStatsTag();
return;
}
throw new l("Firebase Installations Service is unavailable. Please try again later.", l.a.UNAVAILABLE);
}
@NonNull
public f f(@NonNull String str, @NonNull String str2, @NonNull String str3, @NonNull String str4) throws l {
int responseCode;
f q10;
if (this.f38478d.b()) {
URL h10 = h(String.format(f38459k, str3, str2));
for (int i10 = 0; i10 <= 1; i10++) {
TrafficStats.setThreadStatsTag(f38456h);
HttpURLConnection m10 = m(h10, str);
try {
try {
m10.setRequestMethod(ShareTarget.METHOD_POST);
m10.addRequestProperty(w6.d.f40375n, "FIS_v2 " + str4);
m10.setDoOutput(true);
s(m10);
responseCode = m10.getResponseCode();
this.f38478d.f(responseCode);
} finally {
m10.disconnect();
TrafficStats.clearThreadStatsTag();
}
} catch (IOException | AssertionError unused) {
}
if (j(responseCode)) {
q10 = q(m10);
} else {
l(m10, null, str, str3);
if (responseCode != 401 && responseCode != 404) {
if (responseCode != 429) {
if (responseCode < 500 || responseCode >= 600) {
q10 = f.a().b(f.b.BAD_CONFIG).a();
} else {
m10.disconnect();
TrafficStats.clearThreadStatsTag();
}
} else {
throw new l("Firebase servers have received too many requests from this client in a short period of time. Please try again later.", l.a.TOO_MANY_REQUESTS);
}
}
q10 = f.a().b(f.b.AUTH_ERROR).a();
}
return q10;
}
throw new l("Firebase Installations Service is unavailable. Please try again later.", l.a.UNAVAILABLE);
}
throw new l("Firebase Installations Service is unavailable. Please try again later.", l.a.UNAVAILABLE);
}
public final String g() {
try {
Context context = this.f38476b;
byte[] packageCertificateHashBytes = AndroidUtilsLight.getPackageCertificateHashBytes(context, context.getPackageName());
if (packageCertificateHashBytes == null) {
this.f38476b.getPackageName();
return null;
}
return Hex.bytesToStringUppercase(packageCertificateHashBytes, false);
} catch (PackageManager.NameNotFoundException unused) {
this.f38476b.getPackageName();
return null;
}
}
public final URL h(String str) throws l {
try {
return new URL(String.format("https://%s/%s/%s", f38457i, f38461m, str));
} catch (MalformedURLException e10) {
throw new l(e10.getMessage(), l.a.UNAVAILABLE);
}
}
public final HttpURLConnection m(URL url, String str) throws l {
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", f38467s);
httpURLConnection.addRequestProperty("Cache-Control", f38469u);
httpURLConnection.addRequestProperty("X-Android-Package", this.f38476b.getPackageName());
j jVar = this.f38477c.get();
if (jVar != null) {
try {
httpURLConnection.addRequestProperty(f38471w, (String) Tasks.await(jVar.a()));
} catch (InterruptedException unused) {
Thread.currentThread().interrupt();
} catch (ExecutionException unused2) {
}
}
httpURLConnection.addRequestProperty("X-Android-Cert", g());
httpURLConnection.addRequestProperty(A, str);
return httpURLConnection;
} catch (IOException unused3) {
throw new l("Firebase Installations Service is unavailable. Please try again later.", l.a.UNAVAILABLE);
}
}
public final d o(HttpURLConnection httpURLConnection) throws AssertionError, IOException {
InputStream inputStream = httpURLConnection.getInputStream();
JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, E));
f.a a10 = f.a();
a.b bVar = new a.b();
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String nextName = jsonReader.nextName();
if (nextName.equals("name")) {
bVar.f38442a = jsonReader.nextString();
} else if (nextName.equals("fid")) {
bVar.f38443b = jsonReader.nextString();
} else if (nextName.equals("refreshToken")) {
bVar.f38444c = jsonReader.nextString();
} else if (nextName.equals("authToken")) {
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String nextName2 = jsonReader.nextName();
if (nextName2.equals("token")) {
a10.c(jsonReader.nextString());
} else if (nextName2.equals("expiresIn")) {
a10.d(n(jsonReader.nextString()));
} else {
jsonReader.skipValue();
}
}
bVar.f38445d = a10.a();
jsonReader.endObject();
} else {
jsonReader.skipValue();
}
}
jsonReader.endObject();
jsonReader.close();
inputStream.close();
bVar.f38446e = d.b.OK;
return bVar.a();
}
public final f q(HttpURLConnection httpURLConnection) throws AssertionError, IOException {
InputStream inputStream = httpURLConnection.getInputStream();
JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, E));
f.a a10 = f.a();
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String nextName = jsonReader.nextName();
if (nextName.equals("token")) {
a10.c(jsonReader.nextString());
} else if (nextName.equals("expiresIn")) {
a10.d(n(jsonReader.nextString()));
} else {
jsonReader.skipValue();
}
}
jsonReader.endObject();
jsonReader.close();
inputStream.close();
return a10.b(f.b.OK).a();
}
public final void r(HttpURLConnection httpURLConnection, @Nullable String str, @NonNull String str2) throws IOException {
t(httpURLConnection, i(b(str, str2)));
}
public final void s(HttpURLConnection httpURLConnection) throws IOException {
t(httpURLConnection, i(c()));
}
public static void k() {
}
}