Brazzers Premium v2.1.5版本的 MD5 值为:822198ebc1561433ac78052c8b72a0ea

以下内容为反编译后的 d.java 源代码,内容仅作参考


package ca;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.support.v4.media.session.l;
import android.text.TextUtils;
import android.util.JsonReader;
import android.util.Log;
import com.davemorrissey.labs.subscaleview.BuildConfig;
import com.unity3d.ads.metadata.MediationMetaData;
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.security.MessageDigest;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.zip.GZIPOutputStream;
import n.h;
import org.json.JSONException;
import org.json.JSONObject;
public class d {
    public static final Pattern f2039e = Pattern.compile("[0-9]+s");
    public static final Charset f2040f = Charset.forName("UTF-8");
    public final Context f2041a;
    public final y9.c f2042b;
    public final y9.c f2043c;
    public final f f2044d = new f();

    public d(Context context, y9.c cVar, y9.c cVar2) {
        this.f2041a = context;
        this.f2042b = cVar;
        this.f2043c = cVar2;
    }

    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, f2040f));
            try {
                StringBuilder sb2 = new StringBuilder();
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        break;
                    }
                    sb2.append(readLine);
                    sb2.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(), sb2);
            } 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) ? BuildConfig.FLAVOR : l.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) {
        com.google.android.gms.common.internal.d.b(f2039e.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 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 URL a(String str) {
        try {
            return new URL(String.format("https://%s/%s/%s", "firebaseinstallations.googleapis.com", "v1", str));
        } catch (MalformedURLException e10) {
            throw new z9.d(e10.getMessage(), 2);
        }
    }

    public final HttpURLConnection c(URL url, String str) {
        MessageDigest a10;
        boolean a11;
        Set unmodifiableSet;
        Set unmodifiableSet2;
        String sb2;
        int i10 = 2;
        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");
            httpURLConnection.addRequestProperty("X-Android-Package", this.f2041a.getPackageName());
            if (this.f2043c.get() != null && this.f2042b.get() != null) {
                x9.d dVar = (x9.d) ((x9.f) this.f2043c.get());
                Objects.requireNonNull(dVar);
                long currentTimeMillis = System.currentTimeMillis();
                boolean a12 = ((x9.g) dVar.f11695a.get()).a("fire-installations-id", currentTimeMillis);
                x9.g gVar = (x9.g) dVar.f11695a.get();
                synchronized (gVar) {
                    a11 = gVar.a("fire-global", currentTimeMillis);
                }
                if (a12 && a11) {
                    i10 = 4;
                } else if (a11) {
                    i10 = 3;
                } else if (!a12) {
                    i10 = 1;
                }
                if (i10 != 1) {
                    ea.c cVar = (ea.c) this.f2042b.get();
                    ea.d dVar2 = cVar.f4167b;
                    synchronized (dVar2.f4169a) {
                        unmodifiableSet = Collections.unmodifiableSet(dVar2.f4169a);
                    }
                    if (unmodifiableSet.isEmpty()) {
                        sb2 = cVar.f4166a;
                    } else {
                        StringBuilder sb3 = new StringBuilder();
                        sb3.append(cVar.f4166a);
                        sb3.append(' ');
                        ea.d dVar3 = cVar.f4167b;
                        synchronized (dVar3.f4169a) {
                            unmodifiableSet2 = Collections.unmodifiableSet(dVar3.f4169a);
                        }
                        sb3.append(ea.c.a(unmodifiableSet2));
                        sb2 = sb3.toString();
                    }
                    httpURLConnection.addRequestProperty("x-firebase-client", sb2);
                    httpURLConnection.addRequestProperty("x-firebase-client-log-type", Integer.toString(h.b(i10)));
                }
            }
            String str2 = null;
            try {
                Context context = this.f2041a;
                PackageInfo packageInfo = a7.c.a(context).f183a.getPackageManager().getPackageInfo(context.getPackageName(), 64);
                Signature[] signatureArr = packageInfo.signatures;
                byte[] digest = (signatureArr == null || signatureArr.length != 1 || (a10 = z6.a.a("SHA1")) == null) ? null : a10.digest(packageInfo.signatures[0].toByteArray());
                if (digest == null) {
                    Log.e("ContentValues", "Could not get fingerprint hash for package: " + this.f2041a.getPackageName());
                } else {
                    int length = digest.length;
                    StringBuilder sb4 = new StringBuilder(length << 1);
                    for (int i11 = 0; i11 < length; i11++) {
                        char[] cArr = z6.e.f12314a;
                        sb4.append(cArr[(digest[i11] & 240) >>> 4]);
                        sb4.append(cArr[digest[i11] & 15]);
                    }
                    str2 = sb4.toString();
                }
            } catch (PackageManager.NameNotFoundException e10) {
                StringBuilder a13 = android.support.v4.media.b.a("No such package: ");
                a13.append(this.f2041a.getPackageName());
                Log.e("ContentValues", a13.toString(), e10);
            }
            httpURLConnection.addRequestProperty("X-Android-Cert", str2);
            httpURLConnection.addRequestProperty("x-goog-api-key", str);
            return httpURLConnection;
        } catch (IOException unused) {
            throw new z9.d("Firebase Installations Service is unavailable. Please try again later.", 2);
        }
    }

    public final a e(HttpURLConnection httpURLConnection) {
        InputStream inputStream = httpURLConnection.getInputStream();
        JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, f2040f));
        b a10 = c.a();
        jsonReader.beginObject();
        String str = null;
        String str2 = null;
        String str3 = null;
        c cVar = null;
        while (jsonReader.hasNext()) {
            String nextName = jsonReader.nextName();
            if (nextName.equals(MediationMetaData.KEY_NAME)) {
                str = jsonReader.nextString();
            } else if (nextName.equals("fid")) {
                str2 = jsonReader.nextString();
            } else if (nextName.equals("refreshToken")) {
                str3 = jsonReader.nextString();
            } else if (nextName.equals("authToken")) {
                jsonReader.beginObject();
                while (jsonReader.hasNext()) {
                    String nextName2 = jsonReader.nextName();
                    if (nextName2.equals("token")) {
                        a10.f2033a = jsonReader.nextString();
                    } else if (nextName2.equals("expiresIn")) {
                        a10.b(d(jsonReader.nextString()));
                    } else {
                        jsonReader.skipValue();
                    }
                }
                cVar = a10.a();
                jsonReader.endObject();
            } else {
                jsonReader.skipValue();
            }
        }
        jsonReader.endObject();
        jsonReader.close();
        inputStream.close();
        return new a(str, str2, str3, cVar, e.OK, null);
    }

    public final c f(HttpURLConnection httpURLConnection) {
        InputStream inputStream = httpURLConnection.getInputStream();
        JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, f2040f));
        b a10 = c.a();
        jsonReader.beginObject();
        while (jsonReader.hasNext()) {
            String nextName = jsonReader.nextName();
            if (nextName.equals("token")) {
                a10.f2033a = jsonReader.nextString();
            } else if (nextName.equals("expiresIn")) {
                a10.b(d(jsonReader.nextString()));
            } else {
                jsonReader.skipValue();
            }
        }
        jsonReader.endObject();
        jsonReader.close();
        inputStream.close();
        a10.f2035c = g.OK;
        return a10.a();
    }

    public final 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.0.0");
            i(httpURLConnection, jSONObject.toString().getBytes("UTF-8"));
        } catch (JSONException e10) {
            throw new IllegalStateException(e10);
        }
    }

    public final void h(HttpURLConnection httpURLConnection) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("sdkVersion", "a:17.0.0");
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("installation", jSONObject);
            i(httpURLConnection, jSONObject2.toString().getBytes("UTF-8"));
        } catch (JSONException e10) {
            throw new IllegalStateException(e10);
        }
    }
}