导航菜单

页面标题

页面副标题

Perplexity v2.48.1 - C0610d.java 源代码

正在查看: Perplexity v2.48.1 应用的 C0610d.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package kf;

import Ic.D;
import Je.l;
import V3.u;
import android.net.TrafficStats;
import android.util.Log;
import com.google.firebase.installations.FirebaseInstallationsException;
import com.revenuecat.purchases.common.Constants;
import g.w;
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.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import jk.A;
import lf.C0622a;
import lf.C0623b;
import mf.C0640a;
import mf.C0641b;
import mf.C0642c;
import mf.C0643d;
import nd.k;
import nd.s;
import org.json.JSONException;
import org.json.JSONObject;

public final class C0610d implements InterfaceC0611e {
    public static final Object m = new Object();
    public final Ce.g a;
    public final C0642c b;
    public final A c;
    public final j d;
    public final l e;
    public final h f;
    public final Object g;
    public final ExecutorService h;
    public final Ke.l i;
    public String j;
    public final HashSet k;
    public final ArrayList l;

    static {
        new AtomicInteger(1);
    }

    public C0610d(Ce.g gVar, jf.b bVar, ExecutorService executorService, Ke.l lVar) {
        gVar.a();
        C0642c c0642c = new C0642c(gVar.a, bVar);
        A a = new A(gVar);
        if (h9.i.x == null) {
            h9.i.x = new h9.i(23);
        }
        h9.i iVar = h9.i.x;
        if (j.d == null) {
            j.d = new j(iVar);
        }
        j jVar = j.d;
        l lVar2 = new l(new Je.e(gVar, 2));
        h hVar = new h();
        this.g = new Object();
        this.k = new HashSet();
        this.l = new ArrayList();
        this.a = gVar;
        this.b = c0642c;
        this.c = a;
        this.d = jVar;
        this.e = lVar2;
        this.f = hVar;
        this.h = executorService;
        this.i = lVar;
    }

    public final void a() {
        throw new UnsupportedOperationException("Method not decompiled: kf.C0610d.a():void");
    }

    public final C0622a b(C0622a c0622a) {
        int responseCode;
        C0641b f;
        Ce.g gVar = this.a;
        gVar.a();
        String str = gVar.c.a;
        String str2 = c0622a.a;
        Ce.g gVar2 = this.a;
        gVar2.a();
        String str3 = gVar2.c.g;
        String str4 = c0622a.d;
        C0642c c0642c = this.b;
        C0643d c0643d = c0642c.c;
        if (!c0643d.a()) {
            throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a = C0642c.a("projects/" + str3 + "/installations/" + str2 + "/authTokens:generate");
        for (int i = 0; i <= 1; i++) {
            TrafficStats.setThreadStatsTag(32771);
            HttpURLConnection c = c0642c.c(a, str);
            try {
                try {
                    c.setRequestMethod("POST");
                    c.addRequestProperty("Authorization", "FIS_v2 " + str4);
                    c.setDoOutput(true);
                    C0642c.h(c);
                    responseCode = c.getResponseCode();
                    c0643d.b(responseCode);
                } catch (Throwable th) {
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    throw th;
                }
            } catch (IOException | AssertionError unused) {
            }
            if (responseCode >= 200 && responseCode < 300) {
                f = C0642c.f(c);
            } else {
                C0642c.b(c, null, str, str3);
                if (responseCode == 401 || responseCode == 404) {
                    D5.A a2 = C0641b.a();
                    a2.x = 3;
                    f = a2.j();
                } 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.");
                        D5.A a3 = C0641b.a();
                        a3.x = 2;
                        f = a3.j();
                    }
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                }
            }
            c.disconnect();
            TrafficStats.clearThreadStatsTag();
            int f2 = u.f(f.c);
            if (f2 == 0) {
                j jVar = this.d;
                jVar.getClass();
                TimeUnit timeUnit = TimeUnit.MILLISECONDS;
                jVar.a.getClass();
                long seconds = timeUnit.toSeconds(System.currentTimeMillis());
                Vm.g a4 = c0622a.a();
                a4.c = f.a;
                a4.e = Long.valueOf(f.b);
                a4.f = Long.valueOf(seconds);
                return a4.i();
            }
            if (f2 == 1) {
                Vm.g a5 = c0622a.a();
                a5.g = "BAD CONFIG";
                a5.a = 5;
                return a5.i();
            }
            if (f2 != 2) {
                throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
            }
            synchronized (this) {
                this.j = null;
            }
            Vm.g a6 = c0622a.a();
            a6.a = 2;
            return a6.i();
        }
        throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
    }

    public final s c() {
        String str;
        e();
        synchronized (this) {
            str = this.j;
        }
        if (str != null) {
            return w.n(str);
        }
        k kVar = new k();
        g gVar = new g(kVar);
        synchronized (this.g) {
            this.l.add(gVar);
        }
        s sVar = kVar.a;
        this.h.execute(new RunnableC0609c(this, 0));
        return sVar;
    }

    public final s d() {
        e();
        k kVar = new k();
        f fVar = new f(this.d, kVar);
        synchronized (this.g) {
            this.l.add(fVar);
        }
        this.h.execute(new RunnableC0609c(this, 1));
        return kVar.a;
    }

    public final void e() {
        Ce.g gVar = this.a;
        gVar.a();
        D.f(gVar.c.b, "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.");
        gVar.a();
        D.f(gVar.c.g, "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.");
        gVar.a();
        D.f(gVar.c.a, "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.");
        gVar.a();
        String str = gVar.c.b;
        Pattern pattern = j.c;
        D.a("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.", str.contains(Constants.SUBS_ID_BASE_PLAN_ID_SEPARATOR));
        gVar.a();
        D.a("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.", j.c.matcher(gVar.c.a).matches());
    }

    public final java.lang.String f(lf.C0622a r6) {
        throw new UnsupportedOperationException("Method not decompiled: kf.C0610d.f(lf.a):java.lang.String");
    }

    public final C0622a g(C0622a c0622a) {
        int responseCode;
        String str = c0622a.a;
        String str2 = null;
        if (str != null && str.length() == 11) {
            C0623b c0623b = (C0623b) this.e.get();
            synchronized (c0623b.a) {
                try {
                    String[] strArr = C0623b.c;
                    int i = 0;
                    while (true) {
                        if (i < 4) {
                            String str3 = strArr[i];
                            String string = c0623b.a.getString("|T|" + c0623b.b + "|" + str3, null);
                            if (string == null || string.isEmpty()) {
                                i++;
                            } else if (string.startsWith("{")) {
                                try {
                                    str2 = new JSONObject(string).getString("token");
                                } catch (JSONException unused) {
                                }
                            } else {
                                str2 = string;
                            }
                        }
                    }
                } finally {
                }
            }
        }
        C0642c c0642c = this.b;
        Ce.g gVar = this.a;
        gVar.a();
        String str4 = gVar.c.a;
        String str5 = c0622a.a;
        Ce.g gVar2 = this.a;
        gVar2.a();
        String str6 = gVar2.c.g;
        Ce.g gVar3 = this.a;
        gVar3.a();
        String str7 = gVar3.c.b;
        C0643d c0643d = c0642c.c;
        if (!c0643d.a()) {
            throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a = C0642c.a("projects/" + str6 + "/installations");
        int i2 = 0;
        C0640a c0640a = c0642c;
        while (i2 <= 1) {
            TrafficStats.setThreadStatsTag(32769);
            HttpURLConnection c = c0640a.c(a, str4);
            try {
                try {
                    c.setRequestMethod("POST");
                    c.setDoOutput(true);
                    if (str2 != null) {
                        c.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2);
                    }
                    C0642c.g(c, str5, str7);
                    responseCode = c.getResponseCode();
                    c0643d.b(responseCode);
                } catch (IOException | AssertionError unused2) {
                }
                if (responseCode >= 200 && responseCode < 300) {
                    C0640a e = C0642c.e(c);
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    c0640a = e;
                } else {
                    try {
                        C0642c.b(c, str7, str4, str6);
                    } catch (IOException | AssertionError unused3) {
                        c.disconnect();
                        TrafficStats.clearThreadStatsTag();
                        i2++;
                        c0640a = c0640a;
                    }
                    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.");
                        C0640a c0640a2 = new C0640a(null, null, null, null, 2);
                        c.disconnect();
                        TrafficStats.clearThreadStatsTag();
                        c0640a = c0640a2;
                    } else {
                        c.disconnect();
                        TrafficStats.clearThreadStatsTag();
                        i2++;
                        c0640a = c0640a;
                    }
                }
                int f = u.f(c0640a.e);
                if (f != 0) {
                    if (f != 1) {
                        throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
                    }
                    Vm.g a2 = c0622a.a();
                    a2.g = "BAD CONFIG";
                    a2.a = 5;
                    return a2.i();
                }
                String str8 = c0640a.b;
                String str9 = c0640a.c;
                j jVar = this.d;
                jVar.getClass();
                TimeUnit timeUnit = TimeUnit.MILLISECONDS;
                jVar.a.getClass();
                long seconds = timeUnit.toSeconds(System.currentTimeMillis());
                C0641b c0641b = c0640a.d;
                String str10 = c0641b.a;
                long j = c0641b.b;
                Vm.g a3 = c0622a.a();
                a3.b = str8;
                a3.a = 4;
                a3.c = str10;
                a3.d = str9;
                a3.e = Long.valueOf(j);
                a3.f = Long.valueOf(seconds);
                return a3.i();
            } finally {
                c.disconnect();
                TrafficStats.clearThreadStatsTag();
            }
        }
        throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
    }

    public final void h(Exception exc) {
        synchronized (this.g) {
            try {
                Iterator it = this.l.iterator();
                while (it.hasNext()) {
                    if (((i) it.next()).a(exc)) {
                        it.remove();
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public final void i(C0622a c0622a) {
        synchronized (this.g) {
            try {
                Iterator it = this.l.iterator();
                while (it.hasNext()) {
                    if (((i) it.next()).b(c0622a)) {
                        it.remove();
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}