导航菜单

页面标题

页面副标题

Bhakti v5.4.0 - e.java 源代码

正在查看: Bhakti v5.4.0 应用的 e.java JAVA 源代码文件

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


package cd;

import Ac.p;
import B4.v;
import I5.f;
import L8.o0;
import Lc.d;
import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.Log;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.gms.tasks.Tasks;
import ed.C0048c;
import ed.C0049e;
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 oc.g;
import org.json.JSONException;
import org.json.JSONObject;
import pg.a;
import t4.V;
import zc.l;

public final class e implements f {

    public static final Object f124m = new Object();
    public final g a;
    public final C0048c b;
    public final f c;
    public final m d;
    public final l e;
    public final k f;
    public final Object g;
    public final ExecutorService h;
    public final p i;

    public String f125j;
    public final HashSet k;
    public final ArrayList l;

    static {
        new AtomicInteger(1);
    }

    public e(g gVar, bd.b bVar, ExecutorService executorService, p pVar) {
        gVar.a();
        C0048c c0048c = new C0048c(gVar.a, bVar);
        f fVar = new f(gVar);
        if (a.c == null) {
            a.c = new a(23);
        }
        a aVar = a.c;
        if (m.d == null) {
            m.d = new m(aVar);
        }
        m mVar = m.d;
        l lVar = new l(new b(gVar, 0));
        k kVar = new k();
        this.g = new Object();
        this.k = new HashSet();
        this.l = new ArrayList();
        this.a = gVar;
        this.b = c0048c;
        this.c = fVar;
        this.d = mVar;
        this.e = lVar;
        this.f = kVar;
        this.h = executorService;
        this.i = pVar;
    }

    public final void a(l lVar) {
        synchronized (this.g) {
            this.l.add(lVar);
        }
    }

    public final void b() {
        throw new UnsupportedOperationException("Method not decompiled: cd.e.b():void");
    }

    public final dd.a c(dd.a aVar) {
        int responseCode;
        ed.b f;
        g gVar = this.a;
        gVar.a();
        String str = gVar.c.a;
        gVar.a();
        String str2 = gVar.c.g;
        String str3 = aVar.d;
        C0048c c0048c = this.b;
        C0049e c0049e = c0048c.c;
        if (!c0049e.b()) {
            g gVar2 = g.BAD_CONFIG;
            throw new h("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a = C0048c.a("projects/" + str2 + "/installations/" + aVar.a + "/authTokens:generate");
        for (int i = 0; i <= 1; i++) {
            TrafficStats.setThreadStatsTag(32771);
            HttpURLConnection c = c0048c.c(a, str);
            try {
                try {
                    c.setRequestMethod("POST");
                    c.addRequestProperty("Authorization", "FIS_v2 " + str3);
                    c.setDoOutput(true);
                    C0048c.h(c);
                    responseCode = c.getResponseCode();
                    c0049e.d(responseCode);
                } catch (Throwable th2) {
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    throw th2;
                }
            } catch (IOException | AssertionError unused) {
            }
            if (responseCode >= 200 && responseCode < 300) {
                f = C0048c.f(c);
            } else {
                C0048c.b(c, null, str, str2);
                if (responseCode == 401 || responseCode == 404) {
                    V a2 = ed.b.a();
                    a2.T(ed.f.AUTH_ERROR);
                    f = a2.v();
                } else {
                    if (responseCode == 429) {
                        g gVar3 = g.BAD_CONFIG;
                        throw new h("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.");
                        V a3 = ed.b.a();
                        a3.T(ed.f.BAD_CONFIG);
                        f = a3.v();
                    }
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                }
            }
            c.disconnect();
            TrafficStats.clearThreadStatsTag();
            int i2 = d.b[f.b().ordinal()];
            if (i2 != 1) {
                if (i2 == 2) {
                    d a4 = aVar.a();
                    a4.g = "BAD CONFIG";
                    a4.g(dd.c.REGISTER_ERROR);
                    return a4.a();
                }
                if (i2 != 3) {
                    g gVar4 = g.BAD_CONFIG;
                    throw new h("Firebase Installations Service is unavailable. Please try again later.");
                }
                l(null);
                d a6 = aVar.a();
                a6.g(dd.c.NOT_GENERATED);
                return a6.a();
            }
            String c3 = f.c();
            long d = f.d();
            m mVar = this.d;
            mVar.getClass();
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            mVar.a.getClass();
            long seconds = timeUnit.toSeconds(System.currentTimeMillis());
            d a7 = aVar.a();
            a7.c = c3;
            a7.e = Long.valueOf(d);
            a7.f = Long.valueOf(seconds);
            return a7.a();
        }
        g gVar5 = g.BAD_CONFIG;
        throw new h("Firebase Installations Service is unavailable. Please try again later.");
    }

    public final Task d() {
        String str;
        g();
        synchronized (this) {
            str = this.f125j;
        }
        if (str != null) {
            return Tasks.forResult(str);
        }
        TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
        a(new j(taskCompletionSource));
        Task task = taskCompletionSource.getTask();
        this.h.execute(new c(this, 0));
        return task;
    }

    public final Task e() {
        g();
        TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
        a(new i(this.d, taskCompletionSource));
        Task task = taskCompletionSource.getTask();
        this.h.execute(new c(this, 1));
        return task;
    }

    public final void f(dd.a aVar) {
        synchronized (f124m) {
            try {
                g gVar = this.a;
                gVar.a();
                f a = f.a(gVar.a);
                try {
                    this.c.q(aVar);
                    if (a != null) {
                        a.u();
                    }
                } catch (Throwable th2) {
                    if (a != null) {
                        a.u();
                    }
                    throw th2;
                }
            } catch (Throwable th3) {
                throw th3;
            }
        }
    }

    public final void g() {
        g gVar = this.a;
        gVar.a();
        o0.j(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();
        o0.j(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();
        o0.j(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 = m.c;
        o0.e("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(":"));
        gVar.a();
        o0.e("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.", m.c.matcher(gVar.c.a).matches());
    }

    public final java.lang.String h(dd.a r3) {
        throw new UnsupportedOperationException("Method not decompiled: cd.e.h(dd.a):java.lang.String");
    }

    public final dd.a i(dd.a aVar) {
        int responseCode;
        ed.a e;
        String str = aVar.a;
        String str2 = null;
        if (str != null && str.length() == 11) {
            dd.b bVar = (dd.b) this.e.get();
            synchronized (bVar.a) {
                try {
                    String[] strArr = dd.b.c;
                    int i = 0;
                    while (true) {
                        if (i < 4) {
                            String str3 = strArr[i];
                            String string = bVar.a.getString("|T|" + bVar.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 {
                }
            }
        }
        C0048c c0048c = this.b;
        g gVar = this.a;
        gVar.a();
        String str4 = gVar.c.a;
        String str5 = aVar.a;
        g gVar2 = this.a;
        gVar2.a();
        String str6 = gVar2.c.g;
        g gVar3 = this.a;
        gVar3.a();
        String str7 = gVar3.c.b;
        C0049e c0049e = c0048c.c;
        if (!c0049e.b()) {
            g gVar4 = g.BAD_CONFIG;
            throw new h("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a = C0048c.a("projects/" + str6 + "/installations");
        for (int i2 = 0; i2 <= 1; i2++) {
            TrafficStats.setThreadStatsTag(32769);
            HttpURLConnection c = c0048c.c(a, str4);
            try {
                try {
                    c.setRequestMethod("POST");
                    c.setDoOutput(true);
                    if (str2 != null) {
                        c.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2);
                    }
                    C0048c.g(c, str5, str7);
                    responseCode = c.getResponseCode();
                    c0049e.d(responseCode);
                } finally {
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                }
            } catch (IOException | AssertionError unused2) {
            }
            if (responseCode >= 200 && responseCode < 300) {
                e = C0048c.e(c);
            } else {
                C0048c.b(c, str7, str4, str6);
                if (responseCode == 429) {
                    g gVar5 = g.BAD_CONFIG;
                    throw new h("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.");
                    v a2 = ed.a.a();
                    a2.s1(ed.d.BAD_CONFIG);
                    e = a2.l();
                }
                c.disconnect();
                TrafficStats.clearThreadStatsTag();
            }
            c.disconnect();
            TrafficStats.clearThreadStatsTag();
            int i3 = d.a[e.e().ordinal()];
            if (i3 != 1) {
                if (i3 != 2) {
                    g gVar6 = g.BAD_CONFIG;
                    throw new h("Firebase Installations Service is unavailable. Please try again later.");
                }
                d a3 = aVar.a();
                a3.g = "BAD CONFIG";
                a3.g(dd.c.REGISTER_ERROR);
                return a3.a();
            }
            String c3 = e.c();
            String d = e.d();
            m mVar = this.d;
            mVar.getClass();
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            mVar.a.getClass();
            long seconds = timeUnit.toSeconds(System.currentTimeMillis());
            String c4 = e.b().c();
            long d2 = e.b().d();
            d a4 = aVar.a();
            a4.a = c3;
            a4.g(dd.c.REGISTERED);
            a4.c = c4;
            a4.d = d;
            a4.e = Long.valueOf(d2);
            a4.f = Long.valueOf(seconds);
            return a4.a();
        }
        g gVar7 = g.BAD_CONFIG;
        throw new h("Firebase Installations Service is unavailable. Please try again later.");
    }

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

    public final void k(dd.a aVar) {
        synchronized (this.g) {
            try {
                Iterator it = this.l.iterator();
                while (it.hasNext()) {
                    if (((l) it.next()).b(aVar)) {
                        it.remove();
                    }
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    public final synchronized void l(String str) {
        this.f125j = str;
    }

    public final synchronized void m(dd.a aVar, dd.a aVar2) {
        if (this.k.size() != 0 && !TextUtils.equals(aVar.a, aVar2.a)) {
            Iterator it = this.k.iterator();
            if (it.hasNext()) {
                Ii.b.w(it.next());
                throw null;
            }
        }
    }
}