导航菜单

页面标题

页面副标题

Kickcash v16.1 - h.java 源代码

正在查看: Kickcash v16.1 应用的 h.java JAVA 源代码文件

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


package com.microsoft.clarity.qq;

import com.microsoft.clarity.jt.d0;
import com.microsoft.clarity.jt.e0;
import com.microsoft.clarity.mi.r;
import com.microsoft.clarity.nq.a0;
import com.microsoft.clarity.nq.b0;
import com.microsoft.clarity.nq.c0;
import com.microsoft.clarity.nq.d1;
import com.microsoft.clarity.nq.f1;
import com.microsoft.clarity.nq.g1;
import com.microsoft.clarity.nq.h0;
import com.microsoft.clarity.nq.w0;
import com.microsoft.clarity.pq.c1;
import com.microsoft.clarity.pq.d2;
import com.microsoft.clarity.pq.i2;
import com.microsoft.clarity.pq.k1;
import com.microsoft.clarity.pq.o2;
import com.microsoft.clarity.pq.q0;
import com.microsoft.clarity.pq.r;
import com.microsoft.clarity.pq.r0;
import com.microsoft.clarity.pq.s;
import com.microsoft.clarity.pq.v;
import com.microsoft.clarity.pq.v0;
import com.microsoft.clarity.pq.w0;
import com.microsoft.clarity.qq.b;
import com.microsoft.clarity.qq.e;
import com.microsoft.clarity.qq.g;
import com.microsoft.clarity.qq.i;
import com.microsoft.clarity.sq.b;
import com.microsoft.clarity.tq.a;
import com.microsoft.clarity.tq.b;
import java.io.EOFException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URI;
import java.util.Collections;
import java.util.Deque;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.SocketFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

class h implements v, b.a {
    private static final Map<com.microsoft.clarity.sq.a, f1> U = P();
    private static final Logger V = Logger.getLogger(h.class.getName());
    private static final g[] W = new g[0];
    private final SocketFactory A;
    private SSLSocketFactory B;
    private HostnameVerifier C;
    private Socket D;
    private int E;
    private final Deque<g> F;
    private final com.microsoft.clarity.rq.b G;
    private c1 H;
    private boolean I;
    private long J;
    private long K;
    private boolean L;
    private final Runnable M;
    private final int N;
    private final boolean O;
    private final o2 P;
    private final w0<g> Q;
    private c0.b R;
    final b0 S;
    Runnable T;
    private final InetSocketAddress a;
    private final String b;
    private final String c;
    private final Random d;
    private final r<com.microsoft.clarity.mi.p> e;
    private final int f;
    private final com.microsoft.clarity.sq.j g;
    private k1.a h;
    private com.microsoft.clarity.qq.b i;
    private p j;
    private final Object k;
    private final h0 l;
    private int m;
    private final Map<Integer, g> n;
    private final Executor o;
    private final d2 p;
    private final ScheduledExecutorService q;
    private final int r;
    private int s;
    private e t;
    private com.microsoft.clarity.nq.a u;
    private f1 v;
    private boolean w;
    private v0 x;
    private boolean y;
    private boolean z;

    class a extends w0<g> {
        a() {
        }

        @Override
        protected void b() {
            h.this.h.d(true);
        }

        @Override
        protected void c() {
            h.this.h.d(false);
        }
    }

    class b implements o2.c {
        b() {
        }
    }

    class d implements Runnable {
        d() {
        }

        @Override
        public void run() {
            Runnable runnable = h.this.T;
            if (runnable != null) {
                runnable.run();
            }
            h.this.o.execute(h.this.t);
            synchronized (h.this.k) {
                h.this.E = Integer.MAX_VALUE;
                h.this.l0();
            }
            h.this.getClass();
        }
    }

    public h(e.f fVar, InetSocketAddress inetSocketAddress, String str, String str2, com.microsoft.clarity.nq.a aVar, b0 b0Var, Runnable runnable) {
        this(fVar, inetSocketAddress, str, str2, aVar, r0.v, new com.microsoft.clarity.sq.g(), b0Var, runnable);
    }

    static int C(h hVar, int i) {
        int i2 = hVar.s + i;
        hVar.s = i2;
        return i2;
    }

    private static Map<com.microsoft.clarity.sq.a, f1> P() {
        EnumMap enumMap = new EnumMap(com.microsoft.clarity.sq.a.class);
        com.microsoft.clarity.sq.a aVar = com.microsoft.clarity.sq.a.NO_ERROR;
        f1 f1Var = f1.t;
        enumMap.put((EnumMap) aVar, (com.microsoft.clarity.sq.a) f1Var.q("No error: A GRPC status of OK should have been sent"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.PROTOCOL_ERROR, (com.microsoft.clarity.sq.a) f1Var.q("Protocol error"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.INTERNAL_ERROR, (com.microsoft.clarity.sq.a) f1Var.q("Internal error"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.FLOW_CONTROL_ERROR, (com.microsoft.clarity.sq.a) f1Var.q("Flow control error"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.STREAM_CLOSED, (com.microsoft.clarity.sq.a) f1Var.q("Stream closed"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.FRAME_TOO_LARGE, (com.microsoft.clarity.sq.a) f1Var.q("Frame too large"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.REFUSED_STREAM, (com.microsoft.clarity.sq.a) f1.u.q("Refused stream"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.CANCEL, (com.microsoft.clarity.sq.a) f1.g.q("Cancelled"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.COMPRESSION_ERROR, (com.microsoft.clarity.sq.a) f1Var.q("Compression error"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.CONNECT_ERROR, (com.microsoft.clarity.sq.a) f1Var.q("Connect error"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.ENHANCE_YOUR_CALM, (com.microsoft.clarity.sq.a) f1.o.q("Enhance your calm"));
        enumMap.put((EnumMap) com.microsoft.clarity.sq.a.INADEQUATE_SECURITY, (com.microsoft.clarity.sq.a) f1.m.q("Inadequate security"));
        return Collections.unmodifiableMap(enumMap);
    }

    private com.microsoft.clarity.tq.b Q(InetSocketAddress inetSocketAddress, String str, String str2) {
        com.microsoft.clarity.tq.a a2 = new a.b().k("https").h(inetSocketAddress.getHostName()).j(inetSocketAddress.getPort()).a();
        b.C0048b d2 = new b.C0048b().e(a2).d("Host", a2.c() + ":" + a2.f()).d("User-Agent", this.c);
        if (str != null && str2 != null) {
            d2.d("Proxy-Authorization", com.microsoft.clarity.rq.c.a(str, str2));
        }
        return d2.c();
    }

    public Socket R(InetSocketAddress inetSocketAddress, InetSocketAddress inetSocketAddress2, String str, String str2) throws g1 {
        try {
            Socket createSocket = inetSocketAddress2.getAddress() != null ? this.A.createSocket(inetSocketAddress2.getAddress(), inetSocketAddress2.getPort()) : this.A.createSocket(inetSocketAddress2.getHostName(), inetSocketAddress2.getPort());
            createSocket.setTcpNoDelay(true);
            d0 m = com.microsoft.clarity.jt.q.m(createSocket);
            com.microsoft.clarity.jt.g c2 = com.microsoft.clarity.jt.q.c(com.microsoft.clarity.jt.q.i(createSocket));
            com.microsoft.clarity.tq.b Q = Q(inetSocketAddress, str, str2);
            com.microsoft.clarity.tq.a b2 = Q.b();
            c2.d0(String.format("CONNECT %s:%d HTTP/1.1", b2.c(), Integer.valueOf(b2.f()))).d0("\r\n");
            int b3 = Q.a().b();
            for (int i = 0; i < b3; i++) {
                c2.d0(Q.a().a(i)).d0(": ").d0(Q.a().c(i)).d0("\r\n");
            }
            c2.d0("\r\n");
            c2.flush();
            com.microsoft.clarity.rq.j a2 = com.microsoft.clarity.rq.j.a(g0(m));
            while (!g0(m).equals("")) {
            }
            int i2 = a2.b;
            if (i2 >= 200 && i2 < 300) {
                return createSocket;
            }
            com.microsoft.clarity.jt.f fVar = new com.microsoft.clarity.jt.f();
            try {
                createSocket.shutdownOutput();
                m.read(fVar, 1024L);
            } catch (IOException e2) {
                fVar.d0("Unable to read body: " + e2.toString());
            }
            try {
                createSocket.close();
            } catch (IOException unused) {
            }
            throw f1.u.q(String.format("Response returned from proxy was not successful (expected 2xx, got %d %s). Response body:\n%s", Integer.valueOf(a2.b), a2.c, fVar.I0())).c();
        } catch (IOException e3) {
            throw f1.u.q("Failed trying to connect with proxy").p(e3).c();
        }
    }

    private Throwable Y() {
        synchronized (this.k) {
            f1 f1Var = this.v;
            if (f1Var != null) {
                return f1Var.c();
            }
            return f1.u.q("Connection closed").c();
        }
    }

    private void a0() {
        synchronized (this.k) {
            this.P.g(new b());
        }
    }

    private void d0(g gVar) {
        if (this.z && this.F.isEmpty() && this.n.isEmpty()) {
            this.z = false;
            c1 c1Var = this.H;
            if (c1Var != null) {
                c1Var.o();
            }
        }
        if (gVar.x()) {
            this.Q.e(gVar, false);
        }
    }

    public void f0(com.microsoft.clarity.sq.a aVar, String str) {
        k0(0, aVar, p0(aVar).e(str));
    }

    private static String g0(d0 d0Var) throws IOException {
        com.microsoft.clarity.jt.f fVar = new com.microsoft.clarity.jt.f();
        while (d0Var.read(fVar, 1L) != -1) {
            if (fVar.P0(fVar.size() - 1) == 10) {
                return fVar.D0();
            }
        }
        throw new EOFException("\\n not found: " + fVar.v0().u());
    }

    private void i0() {
        synchronized (this.k) {
            this.i.H();
            com.microsoft.clarity.sq.i iVar = new com.microsoft.clarity.sq.i();
            l.c(iVar, 7, this.f);
            this.i.M0(iVar);
            if (this.f > 65535) {
                this.i.a(0, r1 - 65535);
            }
        }
    }

    private void j0(g gVar) {
        if (!this.z) {
            this.z = true;
            c1 c1Var = this.H;
            if (c1Var != null) {
                c1Var.n();
            }
        }
        if (gVar.x()) {
            this.Q.e(gVar, true);
        }
    }

    public void k0(int i, com.microsoft.clarity.sq.a aVar, f1 f1Var) {
        synchronized (this.k) {
            if (this.v == null) {
                this.v = f1Var;
                this.h.c(f1Var);
            }
            if (aVar != null && !this.w) {
                this.w = true;
                this.i.j0(0, aVar, new byte[0]);
            }
            Iterator<Map.Entry<Integer, g>> it = this.n.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry<Integer, g> next = it.next();
                if (next.getKey().intValue() > i) {
                    it.remove();
                    next.getValue().t().M(f1Var, r.a.REFUSED, false, new com.microsoft.clarity.nq.v0());
                    d0(next.getValue());
                }
            }
            for (g gVar : this.F) {
                gVar.t().M(f1Var, r.a.MISCARRIED, true, new com.microsoft.clarity.nq.v0());
                d0(gVar);
            }
            this.F.clear();
            n0();
        }
    }

    public boolean l0() {
        boolean z = false;
        while (!this.F.isEmpty() && this.n.size() < this.E) {
            m0(this.F.poll());
            z = true;
        }
        return z;
    }

    private void m0(g gVar) {
        com.microsoft.clarity.mi.l.u(gVar.P() == -1, "StreamId already assigned");
        this.n.put(Integer.valueOf(this.m), gVar);
        j0(gVar);
        gVar.t().d0(this.m);
        if ((gVar.O() != w0.d.UNARY && gVar.O() != w0.d.SERVER_STREAMING) || gVar.S()) {
            this.i.flush();
        }
        int i = this.m;
        if (i < 2147483645) {
            this.m = i + 2;
        } else {
            this.m = Integer.MAX_VALUE;
            k0(Integer.MAX_VALUE, com.microsoft.clarity.sq.a.NO_ERROR, f1.u.q("Stream ids exhausted"));
        }
    }

    private void n0() {
        if (this.v == null || !this.n.isEmpty() || !this.F.isEmpty() || this.y) {
            return;
        }
        this.y = true;
        c1 c1Var = this.H;
        if (c1Var != null) {
            c1Var.q();
        }
        v0 v0Var = this.x;
        if (v0Var != null) {
            v0Var.f(Y());
            this.x = null;
        }
        if (!this.w) {
            this.w = true;
            this.i.j0(0, com.microsoft.clarity.sq.a.NO_ERROR, new byte[0]);
        }
        this.i.close();
    }

    static f1 p0(com.microsoft.clarity.sq.a aVar) {
        f1 f1Var = U.get(aVar);
        if (f1Var != null) {
            return f1Var;
        }
        return f1.h.q("Unknown http2 error code: " + aVar.X);
    }

    void S(boolean z, long j, long j2, boolean z2) {
        this.I = z;
        this.J = j;
        this.K = j2;
        this.L = z2;
    }

    void T(int i, f1 f1Var, r.a aVar, boolean z, com.microsoft.clarity.sq.a aVar2, com.microsoft.clarity.nq.v0 v0Var) {
        synchronized (this.k) {
            g remove = this.n.remove(Integer.valueOf(i));
            if (remove != null) {
                if (aVar2 != null) {
                    this.i.k(i, com.microsoft.clarity.sq.a.CANCEL);
                }
                if (f1Var != null) {
                    g.b t = remove.t();
                    if (v0Var == null) {
                        v0Var = new com.microsoft.clarity.nq.v0();
                    }
                    t.M(f1Var, aVar, z, v0Var);
                }
                if (!l0()) {
                    n0();
                    d0(remove);
                }
            }
        }
    }

    g[] U() {
        g[] gVarArr;
        synchronized (this.k) {
            gVarArr = (g[]) this.n.values().toArray(W);
        }
        return gVarArr;
    }

    public com.microsoft.clarity.nq.a V() {
        return this.u;
    }

    String W() {
        URI b2 = r0.b(this.b);
        return b2.getHost() != null ? b2.getHost() : this.b;
    }

    int X() {
        URI b2 = r0.b(this.b);
        return b2.getPort() != -1 ? b2.getPort() : this.a.getPort();
    }

    g Z(int i) {
        g gVar;
        synchronized (this.k) {
            gVar = this.n.get(Integer.valueOf(i));
        }
        return gVar;
    }

    @Override
    public void b(Throwable th) {
        com.microsoft.clarity.mi.l.o(th, "failureCause");
        k0(0, com.microsoft.clarity.sq.a.INTERNAL_ERROR, f1.u.p(th));
    }

    boolean b0() {
        return this.B == null;
    }

    @Override
    public void c(f1 f1Var) {
        g(f1Var);
        synchronized (this.k) {
            Iterator<Map.Entry<Integer, g>> it = this.n.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry<Integer, g> next = it.next();
                it.remove();
                next.getValue().t().N(f1Var, false, new com.microsoft.clarity.nq.v0());
                d0(next.getValue());
            }
            for (g gVar : this.F) {
                gVar.t().M(f1Var, r.a.MISCARRIED, true, new com.microsoft.clarity.nq.v0());
                d0(gVar);
            }
            this.F.clear();
            n0();
        }
    }

    boolean c0(int i) {
        boolean z;
        synchronized (this.k) {
            if (i < this.m) {
                z = true;
                if ((i & 1) == 1) {
                }
            }
            z = false;
        }
        return z;
    }

    @Override
    public void d(s.a aVar, Executor executor) {
        long nextLong;
        synchronized (this.k) {
            boolean z = true;
            com.microsoft.clarity.mi.l.t(this.i != null);
            if (this.y) {
                v0.g(aVar, executor, Y());
                return;
            }
            v0 v0Var = this.x;
            if (v0Var != null) {
                nextLong = 0;
                z = false;
            } else {
                nextLong = this.d.nextLong();
                com.microsoft.clarity.mi.p pVar = (com.microsoft.clarity.mi.p) this.e.get();
                pVar.g();
                v0 v0Var2 = new v0(nextLong, pVar);
                this.x = v0Var2;
                this.P.b();
                v0Var = v0Var2;
            }
            if (z) {
                this.i.b(false, (int) (nextLong >>> 32), (int) nextLong);
            }
            v0Var.a(aVar, executor);
        }
    }

    @Override
    public h0 e() {
        return this.l;
    }

    @Override
    public g a(com.microsoft.clarity.nq.w0<?, ?> w0Var, com.microsoft.clarity.nq.v0 v0Var, com.microsoft.clarity.nq.c cVar, com.microsoft.clarity.nq.k[] kVarArr) {
        com.microsoft.clarity.mi.l.o(w0Var, "method");
        com.microsoft.clarity.mi.l.o(v0Var, "headers");
        i2 h = i2.h(kVarArr, V(), v0Var);
        synchronized (this.k) {
            try {
                try {
                    return new g(w0Var, v0Var, this.i, this, this.j, this.k, this.r, this.f, this.b, this.c, h, this.P, cVar, this.O);
                } catch (Throwable th) {
                    th = th;
                    throw th;
                }
            } catch (Throwable th2) {
                th = th2;
            }
        }
    }

    @Override
    public Runnable f(k1.a aVar) {
        this.h = (k1.a) com.microsoft.clarity.mi.l.o(aVar, "listener");
        if (this.I) {
            c1 c1Var = new c1(new c1.c(this), this.q, this.J, this.K, this.L);
            this.H = c1Var;
            c1Var.p();
        }
        com.microsoft.clarity.qq.a O = com.microsoft.clarity.qq.a.O(this.p, this);
        com.microsoft.clarity.sq.c b2 = this.g.b(com.microsoft.clarity.jt.q.c(O), true);
        synchronized (this.k) {
            com.microsoft.clarity.qq.b bVar = new com.microsoft.clarity.qq.b(this, b2);
            this.i = bVar;
            this.j = new p(this, bVar);
        }
        CountDownLatch countDownLatch = new CountDownLatch(1);
        this.p.execute(new c(countDownLatch, O));
        try {
            i0();
            countDownLatch.countDown();
            this.p.execute(new d());
            return null;
        } catch (Throwable th) {
            countDownLatch.countDown();
            throw th;
        }
    }

    @Override
    public void g(f1 f1Var) {
        synchronized (this.k) {
            if (this.v != null) {
                return;
            }
            this.v = f1Var;
            this.h.c(f1Var);
            n0();
        }
    }

    void h0(g gVar) {
        this.F.remove(gVar);
        d0(gVar);
    }

    void o0(g gVar) {
        if (this.v != null) {
            gVar.t().M(this.v, r.a.MISCARRIED, true, new com.microsoft.clarity.nq.v0());
        } else if (this.n.size() < this.E) {
            m0(gVar);
        } else {
            this.F.add(gVar);
            j0(gVar);
        }
    }

    public String toString() {
        return com.microsoft.clarity.mi.g.b(this).c("logId", this.l.d()).d("address", this.a).toString();
    }

    private h(e.f fVar, InetSocketAddress inetSocketAddress, String str, String str2, com.microsoft.clarity.nq.a aVar, com.microsoft.clarity.mi.r<com.microsoft.clarity.mi.p> rVar, com.microsoft.clarity.sq.j jVar, b0 b0Var, Runnable runnable) {
        this.d = new Random();
        this.k = new Object();
        this.n = new HashMap();
        this.E = 0;
        this.F = new LinkedList();
        this.Q = new a();
        this.a = (InetSocketAddress) com.microsoft.clarity.mi.l.o(inetSocketAddress, "address");
        this.b = str;
        this.r = fVar.K0;
        this.f = fVar.P0;
        this.o = (Executor) com.microsoft.clarity.mi.l.o(fVar.Y, "executor");
        this.p = new d2(fVar.Y);
        this.q = (ScheduledExecutorService) com.microsoft.clarity.mi.l.o(fVar.E0, "scheduledExecutorService");
        this.m = 3;
        SocketFactory socketFactory = fVar.G0;
        this.A = socketFactory == null ? SocketFactory.getDefault() : socketFactory;
        this.B = fVar.H0;
        this.C = fVar.I0;
        this.G = (com.microsoft.clarity.rq.b) com.microsoft.clarity.mi.l.o(fVar.J0, "connectionSpec");
        this.e = (com.microsoft.clarity.mi.r) com.microsoft.clarity.mi.l.o(rVar, "stopwatchFactory");
        this.g = (com.microsoft.clarity.sq.j) com.microsoft.clarity.mi.l.o(jVar, "variant");
        this.c = r0.g("okhttp", str2);
        this.S = b0Var;
        this.M = (Runnable) com.microsoft.clarity.mi.l.o(runnable, "tooManyPingsRunnable");
        this.N = fVar.R0;
        this.P = fVar.F0.a();
        this.l = h0.a(getClass(), inetSocketAddress.toString());
        this.u = com.microsoft.clarity.nq.a.c().d(q0.b, aVar).a();
        this.O = fVar.S0;
        a0();
    }

    class c implements Runnable {
        final CountDownLatch X;
        final com.microsoft.clarity.qq.a Y;

        c(CountDownLatch countDownLatch, com.microsoft.clarity.qq.a aVar) {
            this.X = countDownLatch;
            this.Y = aVar;
        }

        @Override
        public void run() {
            h hVar;
            e eVar;
            Socket R;
            SSLSession sSLSession;
            Socket socket;
            try {
                this.X.await();
            } catch (InterruptedException unused) {
                Thread.currentThread().interrupt();
            }
            com.microsoft.clarity.jt.h d = com.microsoft.clarity.jt.q.d(new a());
            try {
                try {
                    h hVar2 = h.this;
                    b0 b0Var = hVar2.S;
                    if (b0Var == null) {
                        R = hVar2.A.createSocket(h.this.a.getAddress(), h.this.a.getPort());
                    } else {
                        if (!(b0Var.b() instanceof InetSocketAddress)) {
                            throw f1.t.q("Unsupported SocketAddress implementation " + h.this.S.b().getClass()).c();
                        }
                        h hVar3 = h.this;
                        R = hVar3.R(hVar3.S.c(), (InetSocketAddress) h.this.S.b(), h.this.S.d(), h.this.S.a());
                    }
                    Socket socket2 = R;
                    if (h.this.B != null) {
                        SSLSocket b = m.b(h.this.B, h.this.C, socket2, h.this.W(), h.this.X(), h.this.G);
                        sSLSession = b.getSession();
                        socket = b;
                    } else {
                        sSLSession = null;
                        socket = socket2;
                    }
                    socket.setTcpNoDelay(true);
                    com.microsoft.clarity.jt.h d2 = com.microsoft.clarity.jt.q.d(com.microsoft.clarity.jt.q.m(socket));
                    this.Y.L(com.microsoft.clarity.jt.q.i(socket), socket);
                    h hVar4 = h.this;
                    hVar4.u = hVar4.u.d().d(a0.a, socket.getRemoteSocketAddress()).d(a0.b, socket.getLocalSocketAddress()).d(a0.c, sSLSession).d(q0.a, sSLSession == null ? d1.NONE : d1.PRIVACY_AND_INTEGRITY).a();
                    h hVar5 = h.this;
                    hVar5.t = hVar5.new e(hVar5.g.a(d2, true));
                    synchronized (h.this.k) {
                        h.this.D = (Socket) com.microsoft.clarity.mi.l.o(socket, "socket");
                        if (sSLSession != null) {
                            h.this.R = new c0.b(new c0.c(sSLSession));
                        }
                    }
                } catch (g1 e) {
                    h.this.k0(0, com.microsoft.clarity.sq.a.INTERNAL_ERROR, e.a());
                    hVar = h.this;
                    eVar = hVar.new e(hVar.g.a(d, true));
                    hVar.t = eVar;
                } catch (Exception e2) {
                    h.this.b(e2);
                    hVar = h.this;
                    eVar = hVar.new e(hVar.g.a(d, true));
                    hVar.t = eVar;
                }
            } catch (Throwable th) {
                h hVar6 = h.this;
                hVar6.t = hVar6.new e(hVar6.g.a(d, true));
                throw th;
            }
        }

        class a implements d0 {
            a() {
            }

            @Override
            public long read(com.microsoft.clarity.jt.f fVar, long j) {
                return -1L;
            }

            @Override
            public e0 timeout() {
                return e0.d;
            }

            @Override
            public void close() {
            }
        }
    }

    class e implements b.a, Runnable {
        com.microsoft.clarity.sq.b Y;
        private final i X = new i(Level.FINE, (Class<?>) h.class);
        boolean Z = true;

        e(com.microsoft.clarity.sq.b bVar) {
            this.Y = bVar;
        }

        private int g(List<com.microsoft.clarity.sq.d> list) {
            long j = 0;
            for (int i = 0; i < list.size(); i++) {
                com.microsoft.clarity.sq.d dVar = list.get(i);
                j += dVar.a.F() + 32 + dVar.b.F();
            }
            return (int) Math.min(j, 2147483647L);
        }

        @Override
        public void a(int r8, long r9) {
            throw new UnsupportedOperationException("Method not decompiled: com.microsoft.clarity.qq.h.e.a(int, long):void");
        }

        @Override
        public void b(boolean z, int i, int i2) {
            v0 v0Var;
            long j = (i << 32) | (i2 & 4294967295L);
            this.X.e(i.a.INBOUND, j);
            if (!z) {
                synchronized (h.this.k) {
                    h.this.i.b(true, i, i2);
                }
                return;
            }
            synchronized (h.this.k) {
                v0Var = null;
                if (h.this.x == null) {
                    h.V.warning("Received unexpected ping ack. No ping outstanding");
                } else if (h.this.x.h() == j) {
                    v0 v0Var2 = h.this.x;
                    h.this.x = null;
                    v0Var = v0Var2;
                } else {
                    h.V.log(Level.WARNING, String.format("Received unexpected ping ack. Expecting %d, got %d", Long.valueOf(h.this.x.h()), Long.valueOf(j)));
                }
            }
            if (v0Var != null) {
                v0Var.d();
            }
        }

        @Override
        public void d(boolean z, int i, com.microsoft.clarity.jt.h hVar, int i2) throws IOException {
            this.X.b(i.a.INBOUND, i, hVar.f(), i2, z);
            g Z = h.this.Z(i);
            if (Z != null) {
                long j = i2;
                hVar.W0(j);
                com.microsoft.clarity.jt.f fVar = new com.microsoft.clarity.jt.f();
                fVar.y0(hVar.f(), j);
                com.microsoft.clarity.fr.c.c("OkHttpClientTransport$ClientFrameHandler.data", Z.t().f0());
                synchronized (h.this.k) {
                    Z.t().g0(fVar, z);
                }
            } else {
                if (!h.this.c0(i)) {
                    h.this.f0(com.microsoft.clarity.sq.a.PROTOCOL_ERROR, "Received data for unknown stream: " + i);
                    return;
                }
                synchronized (h.this.k) {
                    h.this.i.k(i, com.microsoft.clarity.sq.a.INVALID_STREAM);
                }
                hVar.skip(i2);
            }
            h.C(h.this, i2);
            if (h.this.s >= h.this.f * 0.5f) {
                synchronized (h.this.k) {
                    h.this.i.a(0, h.this.s);
                }
                h.this.s = 0;
            }
        }

        @Override
        public void f(int i, int i2, List<com.microsoft.clarity.sq.d> list) throws IOException {
            this.X.g(i.a.INBOUND, i, i2, list);
            synchronized (h.this.k) {
                h.this.i.k(i, com.microsoft.clarity.sq.a.PROTOCOL_ERROR);
            }
        }

        @Override
        public void k(int i, com.microsoft.clarity.sq.a aVar) {
            this.X.h(i.a.INBOUND, i, aVar);
            f1 e = h.p0(aVar).e("Rst Stream");
            boolean z = e.m() == f1.b.CANCELLED || e.m() == f1.b.DEADLINE_EXCEEDED;
            synchronized (h.this.k) {
                g gVar = (g) h.this.n.get(Integer.valueOf(i));
                if (gVar != null) {
                    com.microsoft.clarity.fr.c.c("OkHttpClientTransport$ClientFrameHandler.rstStream", gVar.t().f0());
                    h.this.T(i, e, aVar == com.microsoft.clarity.sq.a.REFUSED_STREAM ? r.a.REFUSED : r.a.PROCESSED, z, null, null);
                }
            }
        }

        @Override
        public void l(boolean z, com.microsoft.clarity.sq.i iVar) {
            boolean z2;
            this.X.i(i.a.INBOUND, iVar);
            synchronized (h.this.k) {
                if (l.b(iVar, 4)) {
                    h.this.E = l.a(iVar, 4);
                }
                if (l.b(iVar, 7)) {
                    z2 = h.this.j.e(l.a(iVar, 7));
                } else {
                    z2 = false;
                }
                if (this.Z) {
                    h.this.h.a();
                    this.Z = false;
                }
                h.this.i.T(iVar);
                if (z2) {
                    h.this.j.h();
                }
                h.this.l0();
            }
        }

        @Override
        public void m(boolean z, boolean z2, int i, int i2, List<com.microsoft.clarity.sq.d> list, com.microsoft.clarity.sq.e eVar) {
            f1 f1Var;
            int g;
            this.X.d(i.a.INBOUND, i, list, z2);
            boolean z3 = true;
            if (h.this.N == Integer.MAX_VALUE || (g = g(list)) <= h.this.N) {
                f1Var = null;
            } else {
                f1 f1Var2 = f1.o;
                Object[] objArr = new Object[3];
                objArr[0] = z2 ? "trailer" : "header";
                objArr[1] = Integer.valueOf(h.this.N);
                objArr[2] = Integer.valueOf(g);
                f1Var = f1Var2.q(String.format("Response %s metadata larger than %d: %d", objArr));
            }
            synchronized (h.this.k) {
                g gVar = (g) h.this.n.get(Integer.valueOf(i));
                if (gVar == null) {
                    if (h.this.c0(i)) {
                        h.this.i.k(i, com.microsoft.clarity.sq.a.INVALID_STREAM);
                    }
                } else if (f1Var == null) {
                    com.microsoft.clarity.fr.c.c("OkHttpClientTransport$ClientFrameHandler.headers", gVar.t().f0());
                    gVar.t().h0(list, z2);
                } else {
                    if (!z2) {
                        h.this.i.k(i, com.microsoft.clarity.sq.a.CANCEL);
                    }
                    gVar.t().N(f1Var, false, new com.microsoft.clarity.nq.v0());
                }
                z3 = false;
            }
            if (z3) {
                h.this.f0(com.microsoft.clarity.sq.a.PROTOCOL_ERROR, "Received header for unknown stream: " + i);
            }
        }

        @Override
        public void n(int i, com.microsoft.clarity.sq.a aVar, com.microsoft.clarity.jt.i iVar) {
            this.X.c(i.a.INBOUND, i, aVar, iVar);
            if (aVar == com.microsoft.clarity.sq.a.ENHANCE_YOUR_CALM) {
                String J = iVar.J();
                h.V.log(Level.WARNING, String.format("%s: Received GOAWAY with ENHANCE_YOUR_CALM. Debug data: %s", this, J));
                if ("too_many_pings".equals(J)) {
                    h.this.M.run();
                }
            }
            f1 e = r0.h.o(aVar.X).e("Received Goaway");
            if (iVar.F() > 0) {
                e = e.e(iVar.J());
            }
            h.this.k0(i, null, e);
        }

        @Override
        public void run() {
            f1 f1Var;
            String name = Thread.currentThread().getName();
            Thread.currentThread().setName("OkHttpClientTransport");
            while (this.Y.Y0(this)) {
                try {
                    if (h.this.H != null) {
                        h.this.H.m();
                    }
                } catch (Throwable th) {
                    try {
                        h.this.k0(0, com.microsoft.clarity.sq.a.PROTOCOL_ERROR, f1.t.q("error in frame handler").p(th));
                        try {
                            this.Y.close();
                        } catch (IOException e) {
                            e = e;
                            h.V.log(Level.INFO, "Exception closing frame reader", (Throwable) e);
                            h.this.h.b();
                            Thread.currentThread().setName(name);
                        }
                    } catch (Throwable th2) {
                        try {
                            this.Y.close();
                        } catch (IOException e2) {
                            h.V.log(Level.INFO, "Exception closing frame reader", (Throwable) e2);
                        }
                        h.this.h.b();
                        Thread.currentThread().setName(name);
                        throw th2;
                    }
                }
            }
            synchronized (h.this.k) {
                f1Var = h.this.v;
            }
            if (f1Var == null) {
                f1Var = f1.u.q("End of stream or IOException");
            }
            h.this.k0(0, com.microsoft.clarity.sq.a.INTERNAL_ERROR, f1Var);
            try {
                this.Y.close();
            } catch (IOException e3) {
                e = e3;
                h.V.log(Level.INFO, "Exception closing frame reader", (Throwable) e);
                h.this.h.b();
                Thread.currentThread().setName(name);
            }
            h.this.h.b();
            Thread.currentThread().setName(name);
        }

        @Override
        public void c() {
        }

        @Override
        public void e(int i, int i2, int i3, boolean z) {
        }
    }
}