Rabbit-R1/android (non root)/smali/smali_classes3/okhttp3/internal/ws/WebSocketProtocol.smali
2024-05-21 17:08:36 -04:00

374 lines
10 KiB
Smali

.class public final Lokhttp3/internal/ws/WebSocketProtocol;
.super Ljava/lang/Object;
.source "WebSocketProtocol.kt"
# annotations
.annotation system Ldalvik/annotation/SourceDebugExtension;
value = "SMAP\nWebSocketProtocol.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WebSocketProtocol.kt\nokhttp3/internal/ws/WebSocketProtocol\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,141:1\n1#2:142\n*E\n"
.end annotation
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u00004\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0008\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0008\n\u0002\u0008\u0008\n\u0002\u0010\t\n\u0002\u0008\u0011\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0012\n\u0002\u0008\u0002\u0008\u00c6\u0002\u0018\u00002\u00020\u0001B\u0007\u0008\u0002\u00a2\u0006\u0002\u0010\u0002J\u000e\u0010\u001c\u001a\u00020\u00042\u0006\u0010\u001d\u001a\u00020\u0004J\u0010\u0010\u001e\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u001f\u001a\u00020\u0006J\u0016\u0010 \u001a\u00020!2\u0006\u0010\"\u001a\u00020#2\u0006\u0010\u001d\u001a\u00020$J\u000e\u0010%\u001a\u00020!2\u0006\u0010\u001f\u001a\u00020\u0006R\u000e\u0010\u0003\u001a\u00020\u0004X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0008\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000c\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0015\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0016\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0018\u001a\u00020\u000fX\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u001a\u001a\u00020\u0006X\u0080T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u000fX\u0080T\u00a2\u0006\u0002\n\u0000\u00a8\u0006&"
}
d2 = {
"Lokhttp3/internal/ws/WebSocketProtocol;",
"",
"()V",
"ACCEPT_MAGIC",
"",
"B0_FLAG_FIN",
"",
"B0_FLAG_RSV1",
"B0_FLAG_RSV2",
"B0_FLAG_RSV3",
"B0_MASK_OPCODE",
"B1_FLAG_MASK",
"B1_MASK_LENGTH",
"CLOSE_CLIENT_GOING_AWAY",
"CLOSE_MESSAGE_MAX",
"",
"CLOSE_NO_STATUS_CODE",
"OPCODE_BINARY",
"OPCODE_CONTINUATION",
"OPCODE_CONTROL_CLOSE",
"OPCODE_CONTROL_PING",
"OPCODE_CONTROL_PONG",
"OPCODE_FLAG_CONTROL",
"OPCODE_TEXT",
"PAYLOAD_BYTE_MAX",
"PAYLOAD_LONG",
"PAYLOAD_SHORT",
"PAYLOAD_SHORT_MAX",
"acceptHeader",
"key",
"closeCodeExceptionMessage",
"code",
"toggleMask",
"",
"cursor",
"Lokio/Buffer$UnsafeCursor;",
"",
"validateCloseCode",
"okhttp"
}
k = 0x1
mv = {
0x1,
0x4,
0x0
}
.end annotation
# static fields
.field public static final ACCEPT_MAGIC:Ljava/lang/String; = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
.field public static final B0_FLAG_FIN:I = 0x80
.field public static final B0_FLAG_RSV1:I = 0x40
.field public static final B0_FLAG_RSV2:I = 0x20
.field public static final B0_FLAG_RSV3:I = 0x10
.field public static final B0_MASK_OPCODE:I = 0xf
.field public static final B1_FLAG_MASK:I = 0x80
.field public static final B1_MASK_LENGTH:I = 0x7f
.field public static final CLOSE_CLIENT_GOING_AWAY:I = 0x3e9
.field public static final CLOSE_MESSAGE_MAX:J = 0x7bL
.field public static final CLOSE_NO_STATUS_CODE:I = 0x3ed
.field public static final INSTANCE:Lokhttp3/internal/ws/WebSocketProtocol;
.field public static final OPCODE_BINARY:I = 0x2
.field public static final OPCODE_CONTINUATION:I = 0x0
.field public static final OPCODE_CONTROL_CLOSE:I = 0x8
.field public static final OPCODE_CONTROL_PING:I = 0x9
.field public static final OPCODE_CONTROL_PONG:I = 0xa
.field public static final OPCODE_FLAG_CONTROL:I = 0x8
.field public static final OPCODE_TEXT:I = 0x1
.field public static final PAYLOAD_BYTE_MAX:J = 0x7dL
.field public static final PAYLOAD_LONG:I = 0x7f
.field public static final PAYLOAD_SHORT:I = 0x7e
.field public static final PAYLOAD_SHORT_MAX:J = 0xffffL
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 21
new-instance v0, Lokhttp3/internal/ws/WebSocketProtocol;
invoke-direct {v0}, Lokhttp3/internal/ws/WebSocketProtocol;-><init>()V
sput-object v0, Lokhttp3/internal/ws/WebSocketProtocol;->INSTANCE:Lokhttp3/internal/ws/WebSocketProtocol;
return-void
.end method
.method private constructor <init>()V
.locals 0
.line 21
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public final acceptHeader(Ljava/lang/String;)Ljava/lang/String;
.locals 1
const-string p0, "key"
invoke-static {p1, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 138
sget-object p0, Lokio/ByteString;->Companion:Lokio/ByteString$Companion;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p1
const-string v0, "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p1
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-virtual {p0, p1}, Lokio/ByteString$Companion;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object p0
invoke-virtual {p0}, Lokio/ByteString;->sha1()Lokio/ByteString;
move-result-object p0
invoke-virtual {p0}, Lokio/ByteString;->base64()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public final closeCodeExceptionMessage(I)Ljava/lang/String;
.locals 1
const/16 p0, 0x3e8
if-lt p1, p0, :cond_5
const/16 p0, 0x1388
if-lt p1, p0, :cond_0
goto :goto_1
:cond_0
const/16 p0, 0x3ec
if-gt p0, p1, :cond_1
const/16 p0, 0x3ee
if-ge p0, p1, :cond_3
:cond_1
const/16 p0, 0x3f7
if-le p0, p1, :cond_2
goto :goto_0
:cond_2
const/16 p0, 0xbb7
if-lt p0, p1, :cond_4
.line 126
:cond_3
new-instance p0, Ljava/lang/StringBuilder;
const-string v0, "Code "
invoke-direct {p0, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object p0
const-string p1, " is reserved and may not be used."
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
goto :goto_2
:cond_4
:goto_0
const/4 p0, 0x0
goto :goto_2
.line 124
:cond_5
:goto_1
new-instance p0, Ljava/lang/StringBuilder;
const-string v0, "Code must be in range [1000,5000): "
invoke-direct {p0, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
:goto_2
return-object p0
.end method
.method public final toggleMask(Lokio/Buffer$UnsafeCursor;[B)V
.locals 6
const-string p0, "cursor"
invoke-static {p1, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string p0, "key"
invoke-static {p2, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 100
array-length p0, p2
const/4 v0, 0x0
.line 102
:cond_0
iget-object v1, p1, Lokio/Buffer$UnsafeCursor;->data:[B
.line 103
iget v2, p1, Lokio/Buffer$UnsafeCursor;->start:I
.line 104
iget v3, p1, Lokio/Buffer$UnsafeCursor;->end:I
if-eqz v1, :cond_1
:goto_0
if-ge v2, v3, :cond_1
.line 107
rem-int/2addr v0, p0
.line 111
aget-byte v4, v1, v2
.line 112
aget-byte v5, p2, v0
xor-int/2addr v4, v5
int-to-byte v4, v4
.line 113
aput-byte v4, v1, v2
add-int/lit8 v2, v2, 0x1
add-int/lit8 v0, v0, 0x1
goto :goto_0
.line 119
:cond_1
invoke-virtual {p1}, Lokio/Buffer$UnsafeCursor;->next()I
move-result v1
const/4 v2, -0x1
if-ne v1, v2, :cond_0
return-void
.end method
.method public final validateCloseCode(I)V
.locals 0
.line 133
invoke-virtual {p0, p1}, Lokhttp3/internal/ws/WebSocketProtocol;->closeCodeExceptionMessage(I)Ljava/lang/String;
move-result-object p0
if-nez p0, :cond_0
const/4 p1, 0x1
goto :goto_0
:cond_0
const/4 p1, 0x0
:goto_0
if-eqz p1, :cond_1
return-void
.line 134
:cond_1
invoke-static {p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
check-cast p1, Ljava/lang/Throwable;
throw p1
.end method