123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- .class public final Lokhttp3/internal/ws/WebSocketProtocol;
- .super Ljava/lang/Object;
- .source ""
- # static fields
- .field static final ACCEPT_MAGIC:Ljava/lang/String; = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
- .field static final B0_FLAG_FIN:I = 0x80
- .field static final B0_FLAG_RSV1:I = 0x40
- .field static final B0_FLAG_RSV2:I = 0x20
- .field static final B0_FLAG_RSV3:I = 0x10
- .field static final B0_MASK_OPCODE:I = 0xf
- .field static final B1_FLAG_MASK:I = 0x80
- .field static final B1_MASK_LENGTH:I = 0x7f
- .field static final CLOSE_ABNORMAL_TERMINATION:I = 0x3ee
- .field static final CLOSE_CLIENT_GOING_AWAY:I = 0x3e9
- .field static final CLOSE_MESSAGE_MAX:J = 0x7bL
- .field static final CLOSE_NO_STATUS_CODE:I = 0x3ed
- .field static final CLOSE_PROTOCOL_EXCEPTION:I = 0x3ea
- .field static final OPCODE_BINARY:I = 0x2
- .field static final OPCODE_CONTINUATION:I = 0x0
- .field static final OPCODE_CONTROL_CLOSE:I = 0x8
- .field static final OPCODE_CONTROL_PING:I = 0x9
- .field static final OPCODE_CONTROL_PONG:I = 0xa
- .field static final OPCODE_FLAG_CONTROL:I = 0x8
- .field static final OPCODE_TEXT:I = 0x1
- .field static final PAYLOAD_BYTE_MAX:J = 0x7dL
- .field static final PAYLOAD_LONG:I = 0x7f
- .field static final PAYLOAD_SHORT:I = 0x7e
- .field static final PAYLOAD_SHORT_MAX:J = 0xffffL
- # direct methods
- .method private constructor <init>()V
- .locals 2
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- new-instance v0, Ljava/lang/AssertionError;
- const-string v1, "No instances."
- invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
- throw v0
- .end method
- .method public static acceptHeader(Ljava/lang/String;)Ljava/lang/String;
- .locals 1
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string p0, "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
- invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p0
- invoke-static {p0}, Lokio/ByteString;->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 static closeCodeExceptionMessage(I)Ljava/lang/String;
- .locals 2
- const/16 v0, 0x3e8
- if-lt p0, v0, :cond_4
- const/16 v0, 0x1388
- if-lt p0, v0, :cond_0
- goto :goto_1
- :cond_0
- const/16 v0, 0x3ec
- if-lt p0, v0, :cond_1
- const/16 v0, 0x3ee
- if-le p0, v0, :cond_2
- :cond_1
- const/16 v0, 0x3f4
- if-lt p0, v0, :cond_3
- const/16 v0, 0xbb7
- if-gt p0, v0, :cond_3
- :cond_2
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "Code "
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- const-string p0, " is reserved and may not be used."
- invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- :goto_0
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p0
- return-object p0
- :cond_3
- const/4 p0, 0x0
- return-object p0
- :cond_4
- :goto_1
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "Code must be in range [1000,5000): "
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- goto :goto_0
- .end method
- .method static toggleMask([BJ[BJ)V
- .locals 5
- array-length v0, p3
- const/4 v1, 0x0
- :goto_0
- int-to-long v2, v1
- cmp-long v4, v2, p1
- if-gez v4, :cond_0
- int-to-long v2, v0
- rem-long v2, p4, v2
- long-to-int v3, v2
- aget-byte v2, p0, v1
- aget-byte v3, p3, v3
- xor-int/2addr v2, v3
- int-to-byte v2, v2
- aput-byte v2, p0, v1
- add-int/lit8 v1, v1, 0x1
- const-wide/16 v2, 0x1
- add-long/2addr p4, v2
- goto :goto_0
- :cond_0
- return-void
- .end method
- .method static validateCloseCode(I)V
- .locals 1
- invoke-static {p0}, Lokhttp3/internal/ws/WebSocketProtocol;->closeCodeExceptionMessage(I)Ljava/lang/String;
- move-result-object p0
- if-nez p0, :cond_0
- return-void
- :cond_0
- new-instance v0, Ljava/lang/IllegalArgumentException;
- invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
|