导航菜单

页面标题

页面副标题

万能钥匙 v1.1.23 - d.java 源代码

正在查看: 万能钥匙 v1.1.23 应用的 d.java JAVA 源代码文件

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


package gl0;

import com.zm.adxsdk.protocol.api.interfaces.WfConstant;
import com.zm.fda.OOZ20.OO22Z;
import gl0.g;
import hl0.h;
import java.io.Closeable;
import java.io.IOException;
import java.net.ProtocolException;
import java.net.SocketTimeoutException;
import java.util.ArrayDeque;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.n;
import mg0.o;
import sk0.a0;
import sk0.b0;
import sk0.c0;
import sk0.e0;
import sk0.i0;
import sk0.j0;
import sk0.r;
import tj0.t;

@Metadata(d1 = {"\u0000¸\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u001d\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0002\b\u000e\u0018\u0000 z2\u00020\u00012\u00020\u0002:\u0005=147?BA\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\u0006\u0010\u0006\u001a\u00020\u0005\u0012\u0006\u0010\b\u001a\u00020\u0007\u0012\u0006\u0010\n\u001a\u00020\t\u0012\u0006\u0010\f\u001a\u00020\u000b\u0012\b\u0010\u000e\u001a\u0004\u0018\u00010\r\u0012\u0006\u0010\u000f\u001a\u00020\u000b¢\u0006\u0004\b\u0010\u0010\u0011J\u0013\u0010\u0013\u001a\u00020\u0012*\u00020\rH\u0002¢\u0006\u0004\b\u0013\u0010\u0014J\u001f\u0010\u0019\u001a\u00020\u00122\u0006\u0010\u0016\u001a\u00020\u00152\u0006\u0010\u0018\u001a\u00020\u0017H\u0002¢\u0006\u0004\b\u0019\u0010\u001aJ\u000f\u0010\u001c\u001a\u00020\u001bH\u0002¢\u0006\u0004\b\u001c\u0010\u001dJ\u000f\u0010\u001e\u001a\u00020\u001bH\u0016¢\u0006\u0004\b\u001e\u0010\u001dJ\u0015\u0010!\u001a\u00020\u001b2\u0006\u0010 \u001a\u00020\u001f¢\u0006\u0004\b!\u0010\"J!\u0010'\u001a\u00020\u001b2\u0006\u0010$\u001a\u00020#2\b\u0010&\u001a\u0004\u0018\u00010%H\u0000¢\u0006\u0004\b'\u0010(J\u001d\u0010-\u001a\u00020\u001b2\u0006\u0010*\u001a\u00020)2\u0006\u0010,\u001a\u00020+¢\u0006\u0004\b-\u0010.J\r\u0010/\u001a\u00020\u001b¢\u0006\u0004\b/\u0010\u001dJ\u0017\u00101\u001a\u00020\u001b2\u0006\u00100\u001a\u00020)H\u0016¢\u0006\u0004\b1\u00102J\u0017\u00104\u001a\u00020\u001b2\u0006\u00103\u001a\u00020\u0015H\u0016¢\u0006\u0004\b4\u00105J\u0017\u00107\u001a\u00020\u001b2\u0006\u00106\u001a\u00020\u0015H\u0016¢\u0006\u0004\b7\u00105J\u0017\u00108\u001a\u00020\u001b2\u0006\u00106\u001a\u00020\u0015H\u0016¢\u0006\u0004\b8\u00105J\u001f\u0010;\u001a\u00020\u001b2\u0006\u00109\u001a\u00020\u00172\u0006\u0010:\u001a\u00020)H\u0016¢\u0006\u0004\b;\u0010<J\u0017\u0010=\u001a\u00020\u00122\u0006\u00100\u001a\u00020)H\u0016¢\u0006\u0004\b=\u0010>J\u0017\u0010?\u001a\u00020\u00122\u0006\u00103\u001a\u00020\u0015H\u0016¢\u0006\u0004\b?\u0010@J!\u0010A\u001a\u00020\u00122\u0006\u00109\u001a\u00020\u00172\b\u0010:\u001a\u0004\u0018\u00010)H\u0016¢\u0006\u0004\bA\u0010BJ'\u0010D\u001a\u00020\u00122\u0006\u00109\u001a\u00020\u00172\b\u0010:\u001a\u0004\u0018\u00010)2\u0006\u0010C\u001a\u00020\u000b¢\u0006\u0004\bD\u0010EJ\u000f\u0010F\u001a\u00020\u0012H\u0000¢\u0006\u0004\bF\u0010GJ\u000f\u0010H\u001a\u00020\u001bH\u0000¢\u0006\u0004\bH\u0010\u001dJ#\u0010K\u001a\u00020\u001b2\n\u0010?\u001a\u00060Ij\u0002`J2\b\u0010$\u001a\u0004\u0018\u00010#¢\u0006\u0004\bK\u0010LR\u0014\u0010\u0006\u001a\u00020\u00058\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b=\u0010MR\u001a\u0010\b\u001a\u00020\u00078\u0000X\u0080\u0004¢\u0006\f\n\u0004\b1\u0010N\u001a\u0004\bO\u0010PR\u0014\u0010\n\u001a\u00020\t8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b4\u0010QR\u0014\u0010\f\u001a\u00020\u000b8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b7\u0010RR\u0018\u0010\u000e\u001a\u0004\u0018\u00010\r8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b?\u0010SR\u0016\u0010\u000f\u001a\u00020\u000b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b8\u0010RR\u0014\u0010U\u001a\u00020)8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bA\u0010TR\u0018\u0010X\u001a\u0004\u0018\u00010V8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b;\u0010WR\u0018\u0010\\\u001a\u0004\u0018\u00010Y8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bZ\u0010[R\u0018\u0010`\u001a\u0004\u0018\u00010]8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b^\u0010_R\u0018\u0010d\u001a\u0004\u0018\u00010a8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bb\u0010cR\u0016\u0010h\u001a\u00020e8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bf\u0010gR\u0018\u0010*\u001a\u0004\u0018\u00010)8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001e\u0010TR\u0018\u0010,\u001a\u0004\u0018\u00010+8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b'\u0010iR\u001a\u0010l\u001a\b\u0012\u0004\u0012\u00020\u00150j8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bD\u0010kR\u001a\u0010n\u001a\b\u0012\u0004\u0012\u00020m0j8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b!\u0010kR\u0016\u0010o\u001a\u00020\u000b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bK\u0010RR\u0016\u0010q\u001a\u00020\u00128\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bO\u0010pR\u0016\u0010s\u001a\u00020\u00178\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b-\u0010rR\u0018\u0010t\u001a\u0004\u0018\u00010)8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0013\u0010TR\u0016\u0010u\u001a\u00020\u00128\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b/\u0010pR\u0016\u0010v\u001a\u00020\u00178\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001c\u0010rR\u0016\u0010w\u001a\u00020\u00178\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0019\u0010rR\u0016\u0010x\u001a\u00020\u00178\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bF\u0010rR\u0016\u0010y\u001a\u00020\u00128\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bH\u0010p¨\u0006{"}, d2 = {"Lgl0/d;", "Lsk0/i0;", "Lgl0/g$a;", "Lwk0/e;", "taskRunner", "Lsk0/c0;", "originalRequest", "Lsk0/j0;", "listener", "Ljava/util/Random;", "random", "", "pingIntervalMillis", "Lgl0/e;", "extensions", "minimumDeflateSize", "<init>", "(Lwk0/e;Lsk0/c0;Lsk0/j0;Ljava/util/Random;JLgl0/e;J)V", "", "t", "(Lgl0/e;)Z", "Lhl0/h;", "data", "", "formatOpcode", "w", "(Lhl0/h;I)Z", "Llg0/e0;", OO22Z.h, "()V", "m", "Lsk0/a0;", "client", OO22Z.j, "(Lsk0/a0;)V", "Lsk0/e0;", "response", "Lxk0/c;", "exchange", "n", "(Lsk0/e0;Lxk0/c;)V", "", "name", "Lgl0/d$d;", "streams", "s", "(Ljava/lang/String;Lgl0/d$d;)V", "u", "text", "b", "(Ljava/lang/String;)V", "bytes", "c", "(Lhl0/h;)V", "payload", "d", "f", WfConstant.EVENT_KEY_FAIL_CODE, "reason", "h", "(ILjava/lang/String;)V", "a", "(Ljava/lang/String;)Z", "e", "(Lhl0/h;)Z", "g", "(ILjava/lang/String;)Z", "cancelAfterCloseMillis", "o", "(ILjava/lang/String;J)Z", "x", "()Z", "y", "Ljava/lang/Exception;", "Lkotlin/Exception;", "q", "(Ljava/lang/Exception;Lsk0/e0;)V", "Lsk0/c0;", "Lsk0/j0;", "r", "()Lsk0/j0;", "Ljava/util/Random;", "J", "Lgl0/e;", "Ljava/lang/String;", "key", "Lsk0/e;", "Lsk0/e;", "call", "Lwk0/a;", "i", "Lwk0/a;", "writerTask", "Lgl0/g;", "j", "Lgl0/g;", "reader", "Lgl0/h;", "k", "Lgl0/h;", "writer", "Lwk0/d;", "l", "Lwk0/d;", "taskQueue", "Lgl0/d$d;", "Ljava/util/ArrayDeque;", "Ljava/util/ArrayDeque;", "pongQueue", "", "messageAndCloseQueue", "queueSize", "Z", "enqueuedClose", "I", "receivedCloseCode", "receivedCloseReason", "failed", "sentPingCount", "receivedPingCount", "receivedPongCount", "awaitingPong", "z", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class d implements i0, g.a {

    public final c0 originalRequest;

    public final j0 listener;

    public final Random random;

    public final long pingIntervalMillis;

    public WebSocketExtensions extensions;

    public long minimumDeflateSize;

    public final String key;

    public sk0.e call;

    public wk0.a writerTask;

    public gl0.g reader;

    public gl0.h writer;

    public wk0.d taskQueue;

    public String name;

    public AbstractC0097d streams;

    public final ArrayDeque<hl0.h> pongQueue;

    public final ArrayDeque<Object> messageAndCloseQueue;

    public long queueSize;

    public boolean enqueuedClose;

    public int receivedCloseCode;

    public String receivedCloseReason;

    public boolean failed;

    public int sentPingCount;

    public int receivedPingCount;

    public int receivedPongCount;

    public boolean awaitingPong;
    public static final List<b0> A = o.d(b0.HTTP_1_1);

    @Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\r\b\u0000\u0018\u00002\u00020\u0001B!\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004\u0012\u0006\u0010\u0007\u001a\u00020\u0006¢\u0006\u0004\b\b\u0010\tR\u0017\u0010\u0003\u001a\u00020\u00028\u0006¢\u0006\f\n\u0004\b\n\u0010\u000b\u001a\u0004\b\f\u0010\rR\u0019\u0010\u0005\u001a\u0004\u0018\u00010\u00048\u0006¢\u0006\f\n\u0004\b\f\u0010\u000e\u001a\u0004\b\u000f\u0010\u0010R\u0017\u0010\u0007\u001a\u00020\u00068\u0006¢\u0006\f\n\u0004\b\u000f\u0010\u0011\u001a\u0004\b\n\u0010\u0012¨\u0006\u0013"}, d2 = {"Lgl0/d$a;", "", "", WfConstant.EVENT_KEY_FAIL_CODE, "Lhl0/h;", "reason", "", "cancelAfterCloseMillis", "<init>", "(ILhl0/h;J)V", "a", "I", "b", "()I", "Lhl0/h;", "c", "()Lhl0/h;", "J", "()J", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class a {

        public final int code;

        public final hl0.h reason;

        public final long cancelAfterCloseMillis;

        public a(int i, hl0.h hVar, long j) {
            this.code = i;
            this.reason = hVar;
            this.cancelAfterCloseMillis = j;
        }

        public final long getCancelAfterCloseMillis() {
            return this.cancelAfterCloseMillis;
        }

        public final int getCode() {
            return this.code;
        }

        public final hl0.h getReason() {
            return this.reason;
        }
    }

    @Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\n\b\u0000\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0004¢\u0006\u0004\b\u0006\u0010\u0007R\u0017\u0010\u0003\u001a\u00020\u00028\u0006¢\u0006\f\n\u0004\b\b\u0010\t\u001a\u0004\b\n\u0010\u000bR\u0017\u0010\u0005\u001a\u00020\u00048\u0006¢\u0006\f\n\u0004\b\n\u0010\f\u001a\u0004\b\b\u0010\r¨\u0006\u000e"}, d2 = {"Lgl0/d$c;", "", "", "formatOpcode", "Lhl0/h;", "data", "<init>", "(ILhl0/h;)V", "a", "I", "b", "()I", "Lhl0/h;", "()Lhl0/h;", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class c {

        public final int formatOpcode;

        public final hl0.h data;

        public c(int i, hl0.h data) {
            n.i(data, "data");
            this.formatOpcode = i;
            this.data = data;
        }

        public final hl0.h getData() {
            return this.data;
        }

        public final int getFormatOpcode() {
            return this.formatOpcode;
        }
    }

    @Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000e\b&\u0018\u00002\u00020\u0001B\u001f\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0004\u0012\u0006\u0010\u0007\u001a\u00020\u0006¢\u0006\u0004\b\b\u0010\tR\u0017\u0010\u0003\u001a\u00020\u00028\u0006¢\u0006\f\n\u0004\b\n\u0010\u000b\u001a\u0004\b\n\u0010\fR\u0017\u0010\u0005\u001a\u00020\u00048\u0006¢\u0006\f\n\u0004\b\r\u0010\u000e\u001a\u0004\b\u000f\u0010\u0010R\u0017\u0010\u0007\u001a\u00020\u00068\u0006¢\u0006\f\n\u0004\b\u0011\u0010\u0012\u001a\u0004\b\u0011\u0010\u0013¨\u0006\u0014"}, d2 = {"Lgl0/d$d;", "Ljava/io/Closeable;", "", "client", "Lhl0/g;", "source", "Lhl0/f;", "sink", "<init>", "(ZLhl0/g;Lhl0/f;)V", "a", "Z", "()Z", "b", "Lhl0/g;", "d", "()Lhl0/g;", "c", "Lhl0/f;", "()Lhl0/f;", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static abstract class AbstractC0097d implements Closeable {

        public final boolean client;

        public final hl0.g source;

        public final hl0.f sink;

        public AbstractC0097d(boolean z, hl0.g source, hl0.f sink) {
            n.i(source, "source");
            n.i(sink, "sink");
            this.client = z;
            this.source = source;
            this.sink = sink;
        }

        public final boolean getClient() {
            return this.client;
        }

        public final hl0.f getSink() {
            return this.sink;
        }

        public final hl0.g getSource() {
            return this.source;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0003\b\u0082\u0004\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u000f\u0010\u0005\u001a\u00020\u0004H\u0016¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\u0007"}, d2 = {"Lgl0/d$e;", "Lwk0/a;", "<init>", "(Lgl0/d;)V", "", "f", "()J", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public final class e extends wk0.a {
        public e() {
            super(d.this.name + " writer", false, 2, (DefaultConstructorMarker) null);
        }

        public long f() {
            try {
                return d.this.x() ? 0L : -1L;
            } catch (IOException e) {
                d.this.q(e, null);
                return -1L;
            }
        }
    }

    @Metadata(d1 = {"\u0000%\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u001f\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004H\u0016¢\u0006\u0004\b\u0007\u0010\bJ\u001f\u0010\u000b\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\n\u001a\u00020\tH\u0016¢\u0006\u0004\b\u000b\u0010\f¨\u0006\r"}, d2 = {"gl0/d$f", "Lsk0/f;", "Lsk0/e;", "call", "Lsk0/e0;", "response", "Llg0/e0;", "c", "(Lsk0/e;Lsk0/e0;)V", "Ljava/io/IOException;", "e", "f", "(Lsk0/e;Ljava/io/IOException;)V", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class f implements sk0.f {
        public final c0 b;

        public f(c0 c0Var) {
            this.b = c0Var;
        }

        public void c(sk0.e call, e0 response) {
            n.i(call, "call");
            n.i(response, "response");
            xk0.c exchange = response.getExchange();
            try {
                d.this.n(response, exchange);
                n.f(exchange);
                AbstractC0097d n = exchange.n();
                WebSocketExtensions a = WebSocketExtensions.INSTANCE.a(response.getHeaders());
                d.this.extensions = a;
                if (!d.this.t(a)) {
                    d dVar = d.this;
                    synchronized (dVar) {
                        dVar.messageAndCloseQueue.clear();
                        dVar.g(1010, "unexpected Sec-WebSocket-Extensions in response header");
                    }
                }
                try {
                    d.this.s(tk0.e.i + " WebSocket " + this.b.getUrl().q(), n);
                    d.this.getListener().f(d.this, response);
                    d.this.u();
                } catch (Exception e) {
                    d.this.q(e, null);
                }
            } catch (IOException e2) {
                d.this.q(e2, response);
                tk0.e.m(response);
                if (exchange != null) {
                    exchange.v();
                }
            }
        }

        public void f(sk0.e call, IOException e) {
            n.i(call, "call");
            n.i(e, "e");
            d.this.q(e, null);
        }
    }

    @Metadata(d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\t\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u000f\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"gl0/d$g", "Lwk0/a;", "", "f", "()J", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class g extends wk0.a {
        public final d e;
        public final long f;

        public g(String str, d dVar, long j) {
            super(str, false, 2, (DefaultConstructorMarker) null);
            this.e = dVar;
            this.f = j;
        }

        public long f() {
            this.e.y();
            return this.f;
        }
    }

    @Metadata(d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\t\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u000f\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005¸\u0006\u0000"}, d2 = {"wk0/c", "Lwk0/a;", "", "f", "()J", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class h extends wk0.a {
        public final d e;

        public h(String str, boolean z, d dVar) {
            super(str, z);
            this.e = dVar;
        }

        public long f() {
            this.e.m();
            return -1L;
        }
    }

    public d(wk0.e taskRunner, c0 originalRequest, j0 listener, Random random, long j, WebSocketExtensions webSocketExtensions, long j2) {
        n.i(taskRunner, "taskRunner");
        n.i(originalRequest, "originalRequest");
        n.i(listener, "listener");
        n.i(random, "random");
        this.originalRequest = originalRequest;
        this.listener = listener;
        this.random = random;
        this.pingIntervalMillis = j;
        this.extensions = webSocketExtensions;
        this.minimumDeflateSize = j2;
        this.taskQueue = taskRunner.i();
        this.pongQueue = new ArrayDeque<>();
        this.messageAndCloseQueue = new ArrayDeque<>();
        this.receivedCloseCode = -1;
        if (!n.d("GET", originalRequest.getMethod())) {
            throw new IllegalArgumentException(("Request must be GET: " + originalRequest.getMethod()).toString());
        }
        h.Companion companion = hl0.h.INSTANCE;
        byte[] bArr = new byte[16];
        random.nextBytes(bArr);
        lg0.e0 e0Var = lg0.e0.a;
        this.key = h.Companion.g(companion, bArr, 0, 0, 3, null).a();
    }

    @Override
    public boolean a(String text) {
        n.i(text, "text");
        return w(hl0.h.INSTANCE.d(text), 1);
    }

    @Override
    public void b(String text) throws IOException {
        n.i(text, "text");
        this.listener.e(this, text);
    }

    @Override
    public void c(hl0.h bytes) throws IOException {
        n.i(bytes, "bytes");
        this.listener.d(this, bytes);
    }

    @Override
    public synchronized void d(hl0.h payload) {
        try {
            n.i(payload, "payload");
            if (!this.failed && (!this.enqueuedClose || !this.messageAndCloseQueue.isEmpty())) {
                this.pongQueue.add(payload);
                v();
                this.receivedPingCount++;
            }
        } finally {
        }
    }

    @Override
    public boolean e(hl0.h bytes) {
        n.i(bytes, "bytes");
        return w(bytes, 2);
    }

    @Override
    public synchronized void f(hl0.h payload) {
        n.i(payload, "payload");
        this.receivedPongCount++;
        this.awaitingPong = false;
    }

    @Override
    public boolean g(int code, String reason) {
        return o(code, reason, 60000L);
    }

    @Override
    public void h(int code, String reason) {
        AbstractC0097d abstractC0097d;
        gl0.g gVar;
        gl0.h hVar;
        n.i(reason, "reason");
        if (code == -1) {
            throw new IllegalArgumentException("Failed requirement.");
        }
        synchronized (this) {
            try {
                if (this.receivedCloseCode != -1) {
                    throw new IllegalStateException("already closed");
                }
                this.receivedCloseCode = code;
                this.receivedCloseReason = reason;
                abstractC0097d = null;
                if (this.enqueuedClose && this.messageAndCloseQueue.isEmpty()) {
                    AbstractC0097d abstractC0097d2 = this.streams;
                    this.streams = null;
                    gVar = this.reader;
                    this.reader = null;
                    hVar = this.writer;
                    this.writer = null;
                    this.taskQueue.n();
                    abstractC0097d = abstractC0097d2;
                } else {
                    gVar = null;
                    hVar = null;
                }
                lg0.e0 e0Var = lg0.e0.a;
            } catch (Throwable th) {
                throw th;
            }
        }
        try {
            this.listener.b(this, code, reason);
            if (abstractC0097d != null) {
                this.listener.a(this, code, reason);
            }
        } finally {
            if (abstractC0097d != null) {
                tk0.e.m(abstractC0097d);
            }
            if (gVar != null) {
                tk0.e.m(gVar);
            }
            if (hVar != null) {
                tk0.e.m(hVar);
            }
        }
    }

    public void m() {
        sk0.e eVar = this.call;
        n.f(eVar);
        eVar.cancel();
    }

    public final void n(e0 response, xk0.c exchange) throws IOException {
        n.i(response, "response");
        if (response.getCode() != 101) {
            throw new ProtocolException("Expected HTTP 101 response but was '" + response.getCode() + ' ' + response.getMessage() + '\'');
        }
        String v = e0.v(response, "Connection", null, 2, null);
        if (!t.v("Upgrade", v, true)) {
            throw new ProtocolException("Expected 'Connection' header value 'Upgrade' but was '" + v + '\'');
        }
        String v2 = e0.v(response, "Upgrade", null, 2, null);
        if (!t.v("websocket", v2, true)) {
            throw new ProtocolException("Expected 'Upgrade' header value 'websocket' but was '" + v2 + '\'');
        }
        String v3 = e0.v(response, "Sec-WebSocket-Accept", null, 2, null);
        String a2 = hl0.h.INSTANCE.d(this.key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11").K().a();
        if (n.d(a2, v3)) {
            if (exchange == null) {
                throw new ProtocolException("Web Socket exchange missing: bad interceptor?");
            }
            return;
        }
        throw new ProtocolException("Expected 'Sec-WebSocket-Accept' header value '" + a2 + "' but was '" + v3 + '\'');
    }

    public final synchronized boolean o(int code, String reason, long cancelAfterCloseMillis) {
        hl0.h hVar;
        try {
            gl0.f.a.c(code);
            if (reason != null) {
                hVar = hl0.h.INSTANCE.d(reason);
                if (hVar.size() > 123) {
                    throw new IllegalArgumentException(("reason.size() > 123: " + reason).toString());
                }
            } else {
                hVar = null;
            }
            if (!this.failed && !this.enqueuedClose) {
                this.enqueuedClose = true;
                this.messageAndCloseQueue.add(new a(code, hVar, cancelAfterCloseMillis));
                v();
                return true;
            }
            return false;
        } finally {
        }
    }

    public final void p(a0 client) {
        n.i(client, "client");
        if (this.originalRequest.d("Sec-WebSocket-Extensions") != null) {
            q(new ProtocolException("Request header not permitted: 'Sec-WebSocket-Extensions'"), null);
            return;
        }
        a0 c2 = client.A().h(r.b).N(A).c();
        c0 b = this.originalRequest.i().e("Upgrade", "websocket").e("Connection", "Upgrade").e("Sec-WebSocket-Key", this.key).e("Sec-WebSocket-Version", "13").e("Sec-WebSocket-Extensions", "permessage-deflate").b();
        xk0.e eVar = new xk0.e(c2, b, true);
        this.call = eVar;
        n.f(eVar);
        eVar.r0(new f(b));
    }

    public final void q(Exception e2, e0 response) {
        n.i(e2, "e");
        synchronized (this) {
            if (this.failed) {
                return;
            }
            this.failed = true;
            AbstractC0097d abstractC0097d = this.streams;
            this.streams = null;
            gl0.g gVar = this.reader;
            this.reader = null;
            gl0.h hVar = this.writer;
            this.writer = null;
            this.taskQueue.n();
            lg0.e0 e0Var = lg0.e0.a;
            try {
                this.listener.c(this, e2, response);
            } finally {
                if (abstractC0097d != null) {
                    tk0.e.m(abstractC0097d);
                }
                if (gVar != null) {
                    tk0.e.m(gVar);
                }
                if (hVar != null) {
                    tk0.e.m(hVar);
                }
            }
        }
    }

    public final j0 getListener() {
        return this.listener;
    }

    public final void s(String name, AbstractC0097d streams) throws IOException {
        Throwable th;
        n.i(name, "name");
        n.i(streams, "streams");
        WebSocketExtensions webSocketExtensions = this.extensions;
        n.f(webSocketExtensions);
        synchronized (this) {
            try {
                this.name = name;
                this.streams = streams;
                this.writer = new gl0.h(streams.getClient(), streams.getSink(), this.random, webSocketExtensions.perMessageDeflate, webSocketExtensions.a(streams.getClient()), this.minimumDeflateSize);
                this.writerTask = new e();
                long j = this.pingIntervalMillis;
                if (j != 0) {
                    try {
                        long nanos = TimeUnit.MILLISECONDS.toNanos(j);
                        this.taskQueue.i(new g(name + " ping", this, nanos), nanos);
                    } catch (Throwable th2) {
                        th = th2;
                        throw th;
                    }
                }
                if (!this.messageAndCloseQueue.isEmpty()) {
                    v();
                }
                lg0.e0 e0Var = lg0.e0.a;
                this.reader = new gl0.g(streams.getClient(), streams.getSource(), this, webSocketExtensions.perMessageDeflate, webSocketExtensions.a(!streams.getClient()));
            } catch (Throwable th3) {
                th = th3;
            }
        }
    }

    public final boolean t(WebSocketExtensions webSocketExtensions) {
        if (!webSocketExtensions.unknownValues && webSocketExtensions.clientMaxWindowBits == null) {
            return webSocketExtensions.serverMaxWindowBits == null || new gh0.d(8, 15).b(webSocketExtensions.serverMaxWindowBits.intValue());
        }
        return false;
    }

    public final void u() throws IOException {
        while (this.receivedCloseCode == -1) {
            gl0.g gVar = this.reader;
            n.f(gVar);
            gVar.a();
        }
    }

    public final void v() {
        if (!tk0.e.h || Thread.holdsLock(this)) {
            wk0.a aVar = this.writerTask;
            if (aVar != null) {
                wk0.d.j(this.taskQueue, aVar, 0L, 2, null);
                return;
            }
            return;
        }
        throw new AssertionError("Thread " + Thread.currentThread().getName() + " MUST hold lock on " + this);
    }

    public final synchronized boolean w(hl0.h data, int formatOpcode) {
        if (!this.failed && !this.enqueuedClose) {
            if (this.queueSize + data.size() > 16777216) {
                g(com.zm.fda.OOZ20.Z2500.OO22Z.m, null);
                return false;
            }
            this.queueSize += data.size();
            this.messageAndCloseQueue.add(new c(formatOpcode, data));
            v();
            return true;
        }
        return false;
    }

    public final boolean x() throws java.io.IOException {
        throw new UnsupportedOperationException("Method not decompiled: gl0.d.x():boolean");
    }

    public final void y() {
        synchronized (this) {
            try {
                if (this.failed) {
                    return;
                }
                gl0.h hVar = this.writer;
                if (hVar == null) {
                    return;
                }
                int i = this.awaitingPong ? this.sentPingCount : -1;
                this.sentPingCount++;
                this.awaitingPong = true;
                lg0.e0 e0Var = lg0.e0.a;
                if (i == -1) {
                    try {
                        hVar.e(hl0.h.e);
                        return;
                    } catch (IOException e2) {
                        q(e2, null);
                        return;
                    }
                }
                q(new SocketTimeoutException("sent ping but didn't receive pong within " + this.pingIntervalMillis + "ms (after " + (i - 1) + " successful ping/pongs)"), null);
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}