导航菜单

页面标题

页面副标题

Atlys v4.8.7 - C0985c.java 源代码

正在查看: Atlys v4.8.7 应用的 C0985c.java JAVA 源代码文件

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


package sf;

import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.Log;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.installations.FirebaseInstallationsException;
import hf.u;
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.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import m3.y;
import org.json.JSONException;
import org.json.JSONObject;
import qe.C0905c;
import qe.C0913k;
import re.j;
import rf.InterfaceC0959b;
import tf.C1011a;
import tf.C1012b;
import uf.C1026a;
import w.q;

public final class C0985c implements d {
    public static final Object m = new Object();
    public final be.h a;
    public final uf.c b;
    public final y c;
    public final i d;
    public final C0913k e;
    public final g f;
    public final Object g;
    public final ExecutorService h;
    public final Executor i;
    public String j;
    public final HashSet k;
    public final ArrayList l;

    static {
        new AtomicInteger(1);
    }

    public C0985c(be.h hVar, InterfaceC0959b interfaceC0959b, ExecutorService executorService, j jVar) {
        hVar.b();
        uf.c cVar = new uf.c(hVar.a, interfaceC0959b);
        y yVar = new y();
        yVar.b = hVar;
        if (Yj.a.b == null) {
            Yj.a.b = new Yj.a(21);
        }
        Yj.a aVar = Yj.a.b;
        if (i.d == null) {
            i.d = new i(aVar);
        }
        i iVar = i.d;
        C0913k c0913k = new C0913k(new C0905c(hVar, 2));
        g gVar = new g();
        this.g = new Object();
        this.k = new HashSet();
        this.l = new ArrayList();
        this.a = hVar;
        this.b = cVar;
        this.c = yVar;
        this.d = iVar;
        this.e = c0913k;
        this.f = gVar;
        this.h = executorService;
        this.i = jVar;
    }

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

    public final void b(boolean z) {
        C1011a r;
        synchronized (m) {
            try {
                be.h hVar = this.a;
                hVar.b();
                y b = y.b(hVar.a);
                try {
                    r = this.c.r();
                    int i = r.b;
                    if (i == 2 || i == 1) {
                        String h = h(r);
                        y yVar = this.c;
                        Un.g a = r.a();
                        a.e = h;
                        a.k(3);
                        r = a.i();
                        yVar.l(r);
                    }
                    if (b != null) {
                        b.s();
                    }
                } catch (Throwable th) {
                    if (b != null) {
                        b.s();
                    }
                    throw th;
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
        if (z) {
            Un.g a2 = r.a();
            a2.f = null;
            r = a2.i();
        }
        k(r);
        this.i.execute(new RunnableC0984b(this, z));
    }

    public final C1011a c(C1011a c1011a) {
        int responseCode;
        uf.b f;
        be.h hVar = this.a;
        hVar.b();
        String str = hVar.c.a;
        hVar.b();
        String str2 = hVar.c.g;
        String str3 = c1011a.d;
        uf.c cVar = this.b;
        uf.d dVar = cVar.c;
        if (!dVar.b()) {
            throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a = uf.c.a("projects/" + str2 + "/installations/" + c1011a.a + "/authTokens:generate");
        for (int i = 0; i <= 1; i++) {
            TrafficStats.setThreadStatsTag(32771);
            HttpURLConnection c = cVar.c(a, str);
            try {
                try {
                    c.setRequestMethod("POST");
                    c.addRequestProperty("Authorization", "FIS_v2 " + str3);
                    c.setDoOutput(true);
                    uf.c.h(c);
                    responseCode = c.getResponseCode();
                    dVar.d(responseCode);
                } catch (Throwable th) {
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    throw th;
                }
            } catch (IOException | AssertionError unused) {
            }
            if (responseCode >= 200 && responseCode < 300) {
                f = uf.c.f(c);
            } else {
                uf.c.b(c, null, str, str2);
                if (responseCode == 401 || responseCode == 404) {
                    B3.a a2 = uf.b.a();
                    a2.b = 3;
                    f = a2.d();
                } 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.");
                        B3.a a3 = uf.b.a();
                        a3.b = 2;
                        f = a3.d();
                    }
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                }
            }
            c.disconnect();
            TrafficStats.clearThreadStatsTag();
            int n = q.n(f.c);
            if (n == 0) {
                i iVar = this.d;
                iVar.getClass();
                TimeUnit timeUnit = TimeUnit.MILLISECONDS;
                iVar.a.getClass();
                long seconds = timeUnit.toSeconds(System.currentTimeMillis());
                Un.g a4 = c1011a.a();
                a4.f = f.a;
                a4.c = Long.valueOf(f.b);
                a4.g = Long.valueOf(seconds);
                return a4.i();
            }
            if (n == 1) {
                Un.g a5 = c1011a.a();
                a5.h = "BAD CONFIG";
                a5.k(5);
                return a5.i();
            }
            if (n != 2) {
                throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
            }
            l(null);
            Un.g a6 = c1011a.a();
            a6.k(2);
            return a6.i();
        }
        throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
    }

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

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

    public final void f(C1011a c1011a) {
        synchronized (m) {
            try {
                be.h hVar = this.a;
                hVar.b();
                y b = y.b(hVar.a);
                try {
                    this.c.l(c1011a);
                    if (b != null) {
                        b.s();
                    }
                } catch (Throwable th) {
                    if (b != null) {
                        b.s();
                    }
                    throw th;
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    public final void g() {
        be.h hVar = this.a;
        hVar.b();
        Preconditions.checkNotEmpty(hVar.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.");
        hVar.b();
        Preconditions.checkNotEmpty(hVar.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.");
        hVar.b();
        Preconditions.checkNotEmpty(hVar.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.");
        hVar.b();
        String str = hVar.c.b;
        Pattern pattern = i.c;
        Preconditions.checkArgument(str.contains(":"), "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.");
        hVar.b();
        Preconditions.checkArgument(i.c.matcher(hVar.c.a).matches(), "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.");
    }

    public final java.lang.String h(tf.C1011a r3) {
        throw new UnsupportedOperationException("Method not decompiled: sf.C0985c.h(tf.a):java.lang.String");
    }

    public final C1011a i(C1011a c1011a) {
        int responseCode;
        String str = c1011a.a;
        int i = 0;
        String str2 = null;
        if (str != null && str.length() == 11) {
            C1012b c1012b = (C1012b) this.e.get();
            synchronized (c1012b.a) {
                try {
                    String[] strArr = C1012b.c;
                    int i2 = 0;
                    while (true) {
                        if (i2 < 4) {
                            String str3 = strArr[i2];
                            String string = c1012b.a.getString("|T|" + c1012b.b + "|" + str3, null);
                            if (string == null || string.isEmpty()) {
                                i2++;
                            } else if (string.startsWith("{")) {
                                try {
                                    str2 = new JSONObject(string).getString("token");
                                } catch (JSONException unused) {
                                }
                            } else {
                                str2 = string;
                            }
                        }
                    }
                } finally {
                }
            }
        }
        uf.c cVar = this.b;
        be.h hVar = this.a;
        hVar.b();
        String str4 = hVar.c.a;
        String str5 = c1011a.a;
        be.h hVar2 = this.a;
        hVar2.b();
        String str6 = hVar2.c.g;
        be.h hVar3 = this.a;
        hVar3.b();
        String str7 = hVar3.c.b;
        uf.d dVar = cVar.c;
        if (!dVar.b()) {
            throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a = uf.c.a("projects/" + str6 + "/installations");
        C1026a c1026a = cVar;
        while (i <= 1) {
            TrafficStats.setThreadStatsTag(32769);
            HttpURLConnection c = c1026a.c(a, str4);
            try {
                try {
                    c.setRequestMethod("POST");
                    c.setDoOutput(true);
                    if (str2 != null) {
                        c.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2);
                    }
                    uf.c.g(c, str5, str7);
                    responseCode = c.getResponseCode();
                    dVar.d(responseCode);
                } finally {
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                }
            } catch (IOException | AssertionError unused2) {
            }
            if (responseCode < 200 || responseCode >= 300) {
                try {
                    uf.c.b(c, str7, str4, str6);
                } catch (IOException | AssertionError unused3) {
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    i++;
                    c1026a = c1026a;
                }
                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.");
                    C1026a c1026a2 = new C1026a(null, null, null, null, 2);
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    c1026a = c1026a2;
                } else {
                    c.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    i++;
                    c1026a = c1026a;
                }
            } else {
                C1026a e = uf.c.e(c);
                c.disconnect();
                TrafficStats.clearThreadStatsTag();
                c1026a = e;
            }
            int n = q.n(c1026a.e);
            if (n != 0) {
                if (n != 1) {
                    throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.");
                }
                Un.g a2 = c1011a.a();
                a2.h = "BAD CONFIG";
                a2.k(5);
                return a2.i();
            }
            String str8 = c1026a.b;
            String str9 = c1026a.c;
            i iVar = this.d;
            iVar.getClass();
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            iVar.a.getClass();
            long seconds = timeUnit.toSeconds(System.currentTimeMillis());
            uf.b bVar = c1026a.d;
            String str10 = bVar.a;
            long j = bVar.b;
            Un.g a3 = c1011a.a();
            a3.e = str8;
            a3.k(4);
            a3.f = str10;
            a3.b = str9;
            a3.c = Long.valueOf(j);
            a3.g = Long.valueOf(seconds);
            return a3.i();
        }
        throw new FirebaseInstallationsException("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 (((h) it.next()).a(exc)) {
                        it.remove();
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

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

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

    public final synchronized void m(C1011a c1011a, C1011a c1011a2) {
        if (this.k.size() != 0 && !TextUtils.equals(c1011a.a, c1011a2.a)) {
            Iterator it = this.k.iterator();
            if (it.hasNext()) {
                u.C(it.next());
                throw null;
            }
        }
    }
}