GOUTY SSH V2 🌐 v4.2.5版本的 MD5 值为:635449b1ebcf1b9e08b24bdcbf1c404a

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


package a7;

import a4.o;
import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.Log;
import c6.p;
import i.a4;
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 org.json.JSONException;
import org.json.JSONObject;

public final class d implements e {

    public static final Object f129m = new Object();

    public final w5.g f130a;

    public final c7.c f131b;

    public final i4.e f132c;

    public final k f133d;

    public final p f134e;

    public final i f135f;

    public final Object f136g;

    public final ExecutorService f137h;

    public final Executor f138i;

    public String f139j;

    public final HashSet f140k;

    public final ArrayList f141l;

    static {
        new AtomicInteger(1);
    }

    public d(w5.g gVar, z6.c cVar, ExecutorService executorService, d6.k kVar) {
        gVar.a();
        c7.c cVar2 = new c7.c(gVar.f10616a, cVar);
        i4.e eVar = new i4.e(29, gVar);
        k a10 = k.a();
        p pVar = new p(new c6.e(2, gVar));
        i iVar = new i();
        this.f136g = new Object();
        this.f140k = new HashSet();
        this.f141l = new ArrayList();
        this.f130a = gVar;
        this.f131b = cVar2;
        this.f132c = eVar;
        this.f133d = a10;
        this.f134e = pVar;
        this.f135f = iVar;
        this.f137h = executorService;
        this.f138i = kVar;
    }

    public final void a(j jVar) {
        synchronized (this.f136g) {
            this.f141l.add(jVar);
        }
    }

    public final void b(boolean z10) {
        b7.a m10;
        boolean z11;
        synchronized (f129m) {
            w5.g gVar = this.f130a;
            gVar.a();
            i4.e a10 = i4.e.a(gVar.f10616a);
            try {
                m10 = this.f132c.m();
                b7.c cVar = b7.c.NOT_GENERATED;
                b7.c cVar2 = m10.f1874b;
                if (cVar2 != cVar && cVar2 != b7.c.ATTEMPT_MIGRATION) {
                    z11 = false;
                    if (z11) {
                        String h10 = h(m10);
                        i4.e eVar = this.f132c;
                        a4 a4Var = new a4(m10);
                        a4Var.f5280a = h10;
                        a4Var.o(b7.c.UNREGISTERED);
                        m10 = a4Var.g();
                        eVar.j(m10);
                    }
                }
                z11 = true;
                if (z11) {
                }
            } finally {
                if (a10 != null) {
                    a10.n();
                }
            }
        }
        if (z10) {
            a4 a4Var2 = new a4(m10);
            a4Var2.f5282c = null;
            m10 = a4Var2.g();
        }
        k(m10);
        this.f138i.execute(new b(this, z10, 0));
    }

    public final b7.a c(b7.a aVar) {
        int responseCode;
        c7.b f10;
        w2.c cVar;
        c7.f fVar;
        w5.g gVar = this.f130a;
        gVar.a();
        String str = gVar.f10618c.f10626a;
        gVar.a();
        String str2 = gVar.f10618c.f10632g;
        String str3 = aVar.f1876d;
        c7.c cVar2 = this.f131b;
        c7.e eVar = cVar2.f2260c;
        if (!eVar.b()) {
            throw new f("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a10 = c7.c.a(String.format("projects/%s/installations/%s/authTokens:generate", str2, aVar.f1873a));
        for (int i10 = 0; i10 <= 1; i10++) {
            TrafficStats.setThreadStatsTag(32771);
            HttpURLConnection c10 = cVar2.c(a10, str);
            try {
                c10.setRequestMethod("POST");
                c10.addRequestProperty("Authorization", "FIS_v2 " + str3);
                c10.setDoOutput(true);
                c7.c.h(c10);
                responseCode = c10.getResponseCode();
                eVar.d(responseCode);
            } catch (IOException | AssertionError unused) {
            } catch (Throwable th) {
                c10.disconnect();
                TrafficStats.clearThreadStatsTag();
                throw th;
            }
            if (responseCode >= 200 && responseCode < 300) {
                f10 = c7.c.f(c10);
            } else {
                c7.c.b(c10, null, str, str2);
                if (responseCode != 401 && responseCode != 404) {
                    if (responseCode == 429) {
                        throw new f("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.");
                        cVar = new w2.c(6);
                        cVar.f10500x = 0L;
                        fVar = c7.f.BAD_CONFIG;
                        cVar.f10501y = fVar;
                        f10 = cVar.a();
                    } else {
                        c10.disconnect();
                        TrafficStats.clearThreadStatsTag();
                    }
                }
                cVar = new w2.c(6);
                cVar.f10500x = 0L;
                fVar = c7.f.AUTH_ERROR;
                cVar.f10501y = fVar;
                f10 = cVar.a();
            }
            c10.disconnect();
            TrafficStats.clearThreadStatsTag();
            int ordinal = f10.f2255c.ordinal();
            if (ordinal == 0) {
                k kVar = this.f133d;
                kVar.getClass();
                TimeUnit timeUnit = TimeUnit.MILLISECONDS;
                kVar.f150a.getClass();
                long seconds = timeUnit.toSeconds(System.currentTimeMillis());
                a4 a4Var = new a4(aVar);
                a4Var.f5282c = f10.f2253a;
                a4Var.f5284e = Long.valueOf(f10.f2254b);
                a4Var.f5285f = Long.valueOf(seconds);
                return a4Var.g();
            }
            if (ordinal == 1) {
                a4 a4Var2 = new a4(aVar);
                a4Var2.f5286g = "BAD CONFIG";
                a4Var2.o(b7.c.REGISTER_ERROR);
                return a4Var2.g();
            }
            if (ordinal != 2) {
                throw new f("Firebase Installations Service is unavailable. Please try again later.");
            }
            l(null);
            a4 a4Var3 = new a4(aVar);
            a4Var3.o(b7.c.NOT_GENERATED);
            return a4Var3.g();
        }
        throw new f("Firebase Installations Service is unavailable. Please try again later.");
    }

    public final p5.p d() {
        String str;
        g();
        synchronized (this) {
            str = this.f139j;
        }
        if (str != null) {
            return com.bumptech.glide.d.j(str);
        }
        p5.j jVar = new p5.j();
        a(new h(jVar));
        p5.p pVar = jVar.f8373a;
        this.f137h.execute(new androidx.activity.b(11, this));
        return pVar;
    }

    public final p5.p e() {
        g();
        p5.j jVar = new p5.j();
        a(new g(this.f133d, jVar));
        this.f137h.execute(new b(this, false, 1));
        return jVar.f8373a;
    }

    public final void f(b7.a aVar) {
        synchronized (f129m) {
            w5.g gVar = this.f130a;
            gVar.a();
            i4.e a10 = i4.e.a(gVar.f10616a);
            try {
                this.f132c.j(aVar);
            } finally {
                if (a10 != null) {
                    a10.n();
                }
            }
        }
    }

    public final void g() {
        w5.g gVar = this.f130a;
        gVar.a();
        com.bumptech.glide.c.k(gVar.f10618c.f10627b, "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();
        com.bumptech.glide.c.k(gVar.f10618c.f10632g, "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();
        com.bumptech.glide.c.k(gVar.f10618c.f10626a, "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.f10618c.f10627b;
        Pattern pattern = k.f148c;
        com.bumptech.glide.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.", str.contains(":"));
        gVar.a();
        com.bumptech.glide.c.b("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.", k.f148c.matcher(gVar.f10618c.f10626a).matches());
    }

    public final String h(b7.a aVar) {
        String a10;
        w5.g gVar = this.f130a;
        gVar.a();
        if (!gVar.f10617b.equals("CHIME_ANDROID_SDK")) {
            w5.g gVar2 = this.f130a;
            gVar2.a();
        }
        if (aVar.f1874b == b7.c.ATTEMPT_MIGRATION) {
            b7.b bVar = (b7.b) this.f134e.get();
            synchronized (bVar.f1881a) {
                a10 = bVar.a();
                if (a10 == null) {
                    a10 = bVar.b();
                }
            }
            if (!TextUtils.isEmpty(a10)) {
                return a10;
            }
            this.f135f.getClass();
            return i.a();
        }
        this.f135f.getClass();
        return i.a();
    }

    public final b7.a i(b7.a aVar) {
        int responseCode;
        c7.a e10;
        String str = aVar.f1873a;
        String str2 = null;
        if (str != null && str.length() == 11) {
            b7.b bVar = (b7.b) this.f134e.get();
            synchronized (bVar.f1881a) {
                String[] strArr = b7.b.f1880c;
                int i10 = 0;
                while (true) {
                    if (i10 >= 4) {
                        break;
                    }
                    String str3 = strArr[i10];
                    String string = bVar.f1881a.getString("|T|" + bVar.f1882b + "|" + str3, null);
                    if (string == null || string.isEmpty()) {
                        i10++;
                    } else if (string.startsWith("{")) {
                        try {
                            str2 = new JSONObject(string).getString("token");
                        } catch (JSONException unused) {
                        }
                    } else {
                        str2 = string;
                    }
                }
            }
        }
        c7.c cVar = this.f131b;
        w5.g gVar = this.f130a;
        gVar.a();
        String str4 = gVar.f10618c.f10626a;
        String str5 = aVar.f1873a;
        w5.g gVar2 = this.f130a;
        gVar2.a();
        String str6 = gVar2.f10618c.f10632g;
        w5.g gVar3 = this.f130a;
        gVar3.a();
        String str7 = gVar3.f10618c.f10627b;
        c7.e eVar = cVar.f2260c;
        if (!eVar.b()) {
            throw new f("Firebase Installations Service is unavailable. Please try again later.");
        }
        URL a10 = c7.c.a(String.format("projects/%s/installations", str6));
        for (int i11 = 0; i11 <= 1; i11++) {
            TrafficStats.setThreadStatsTag(32769);
            HttpURLConnection c10 = cVar.c(a10, str4);
            try {
                try {
                    c10.setRequestMethod("POST");
                    c10.setDoOutput(true);
                    if (str2 != null) {
                        c10.addRequestProperty("x-goog-fis-android-iid-migration-auth", str2);
                    }
                    c7.c.g(c10, str5, str7);
                    responseCode = c10.getResponseCode();
                    eVar.d(responseCode);
                } catch (Throwable th) {
                    c10.disconnect();
                    TrafficStats.clearThreadStatsTag();
                    throw th;
                }
            } catch (IOException | AssertionError unused2) {
            }
            if (responseCode >= 200 && responseCode < 300) {
                e10 = c7.c.e(c10);
            } else {
                c7.c.b(c10, str7, str4, str6);
                if (responseCode == 429) {
                    throw new f("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.");
                    e10 = new c7.a(null, null, null, null, c7.d.BAD_CONFIG);
                } else {
                    c10.disconnect();
                    TrafficStats.clearThreadStatsTag();
                }
            }
            c10.disconnect();
            TrafficStats.clearThreadStatsTag();
            int ordinal = e10.f2252e.ordinal();
            if (ordinal != 0) {
                if (ordinal != 1) {
                    throw new f("Firebase Installations Service is unavailable. Please try again later.");
                }
                a4 a4Var = new a4(aVar);
                a4Var.f5286g = "BAD CONFIG";
                a4Var.o(b7.c.REGISTER_ERROR);
                return a4Var.g();
            }
            String str8 = e10.f2249b;
            String str9 = e10.f2250c;
            k kVar = this.f133d;
            kVar.getClass();
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            kVar.f150a.getClass();
            long seconds = timeUnit.toSeconds(System.currentTimeMillis());
            c7.b bVar2 = e10.f2251d;
            String str10 = bVar2.f2253a;
            long j10 = bVar2.f2254b;
            a4 a4Var2 = new a4(aVar);
            a4Var2.f5280a = str8;
            a4Var2.o(b7.c.REGISTERED);
            a4Var2.f5282c = str10;
            a4Var2.f5283d = str9;
            a4Var2.f5284e = Long.valueOf(j10);
            a4Var2.f5285f = Long.valueOf(seconds);
            return a4Var2.g();
        }
        throw new f("Firebase Installations Service is unavailable. Please try again later.");
    }

    public final void j(Exception exc) {
        synchronized (this.f136g) {
            Iterator it = this.f141l.iterator();
            while (it.hasNext()) {
                if (((j) it.next()).a(exc)) {
                    it.remove();
                }
            }
        }
    }

    public final void k(b7.a aVar) {
        synchronized (this.f136g) {
            Iterator it = this.f141l.iterator();
            while (it.hasNext()) {
                if (((j) it.next()).b(aVar)) {
                    it.remove();
                }
            }
        }
    }

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

    public final synchronized void m(b7.a aVar, b7.a aVar2) {
        if (this.f140k.size() != 0 && !TextUtils.equals(aVar.f1873a, aVar2.f1873a)) {
            Iterator it = this.f140k.iterator();
            if (it.hasNext()) {
                o.s(it.next());
                throw null;
            }
        }
    }
}