404 lines
9.7 KiB
Smali
404 lines
9.7 KiB
Smali
.class public final Lokhttp3/internal/framed/Http2;
|
|
.super Ljava/lang/Object;
|
|
.source "Http2.java"
|
|
|
|
# interfaces
|
|
.implements Lokhttp3/internal/framed/Variant;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lokhttp3/internal/framed/Http2$FrameLogger;,
|
|
Lokhttp3/internal/framed/Http2$ContinuationSource;,
|
|
Lokhttp3/internal/framed/Http2$Writer;,
|
|
Lokhttp3/internal/framed/Http2$Reader;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final CONNECTION_PREFACE:Lokio/ByteString;
|
|
|
|
.field static final FLAG_ACK:B = 0x1t
|
|
|
|
.field static final FLAG_COMPRESSED:B = 0x20t
|
|
|
|
.field static final FLAG_END_HEADERS:B = 0x4t
|
|
|
|
.field static final FLAG_END_PUSH_PROMISE:B = 0x4t
|
|
|
|
.field static final FLAG_END_STREAM:B = 0x1t
|
|
|
|
.field static final FLAG_NONE:B = 0x0t
|
|
|
|
.field static final FLAG_PADDED:B = 0x8t
|
|
|
|
.field static final FLAG_PRIORITY:B = 0x20t
|
|
|
|
.field static final INITIAL_MAX_FRAME_SIZE:I = 0x4000
|
|
|
|
.field static final TYPE_CONTINUATION:B = 0x9t
|
|
|
|
.field static final TYPE_DATA:B = 0x0t
|
|
|
|
.field static final TYPE_GOAWAY:B = 0x7t
|
|
|
|
.field static final TYPE_HEADERS:B = 0x1t
|
|
|
|
.field static final TYPE_PING:B = 0x6t
|
|
|
|
.field static final TYPE_PRIORITY:B = 0x2t
|
|
|
|
.field static final TYPE_PUSH_PROMISE:B = 0x5t
|
|
|
|
.field static final TYPE_RST_STREAM:B = 0x3t
|
|
|
|
.field static final TYPE_SETTINGS:B = 0x4t
|
|
|
|
.field static final TYPE_WINDOW_UPDATE:B = 0x8t
|
|
|
|
.field private static final logger:Ljava/util/logging/Logger;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.prologue
|
|
const-class v0, Lokhttp3/internal/framed/Http2$FrameLogger;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lokhttp3/internal/framed/Http2;->logger:Ljava/util/logging/Logger;
|
|
|
|
const-string v0, "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
|
|
|
|
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lokhttp3/internal/framed/Http2;->CONNECTION_PREFACE:Lokio/ByteString;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.prologue
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$000()Lokio/ByteString;
|
|
.locals 1
|
|
|
|
.prologue
|
|
sget-object v0, Lokhttp3/internal/framed/Http2;->CONNECTION_PREFACE:Lokio/ByteString;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static synthetic access$100()Ljava/util/logging/Logger;
|
|
.locals 1
|
|
|
|
.prologue
|
|
sget-object v0, Lokhttp3/internal/framed/Http2;->logger:Ljava/util/logging/Logger;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static synthetic access$200(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
|
|
.locals 1
|
|
.param p0, "x0" # Ljava/lang/String;
|
|
.param p1, "x1" # [Ljava/lang/Object;
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
invoke-static {p0, p1}, Lokhttp3/internal/framed/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static synthetic access$300(Lokio/BufferedSource;)I
|
|
.locals 1
|
|
.param p0, "x0" # Lokio/BufferedSource;
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
invoke-static {p0}, Lokhttp3/internal/framed/Http2;->readMedium(Lokio/BufferedSource;)I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method static synthetic access$400(IBS)I
|
|
.locals 1
|
|
.param p0, "x0" # I
|
|
.param p1, "x1" # B
|
|
.param p2, "x2" # S
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
invoke-static {p0, p1, p2}, Lokhttp3/internal/framed/Http2;->lengthWithoutPadding(IBS)I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method static synthetic access$500(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
.locals 1
|
|
.param p0, "x0" # Ljava/lang/String;
|
|
.param p1, "x1" # [Ljava/lang/Object;
|
|
|
|
.prologue
|
|
invoke-static {p0, p1}, Lokhttp3/internal/framed/Http2;->illegalArgument(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static synthetic access$600(Lokio/BufferedSink;I)V
|
|
.locals 0
|
|
.param p0, "x0" # Lokio/BufferedSink;
|
|
.param p1, "x1" # I
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
invoke-static {p0, p1}, Lokhttp3/internal/framed/Http2;->writeMedium(Lokio/BufferedSink;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static varargs illegalArgument(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
.locals 2
|
|
.param p0, "message" # Ljava/lang/String;
|
|
.param p1, "args" # [Ljava/lang/Object;
|
|
|
|
.prologue
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private static varargs ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
|
|
.locals 2
|
|
.param p0, "message" # Ljava/lang/String;
|
|
.param p1, "args" # [Ljava/lang/Object;
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
new-instance v0, Ljava/io/IOException;
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private static lengthWithoutPadding(IBS)I
|
|
.locals 4
|
|
.param p0, "length" # I
|
|
.param p1, "flags" # B
|
|
.param p2, "padding" # S
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
and-int/lit8 v0, p1, 0x8
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
add-int/lit8 p0, p0, -0x1
|
|
|
|
:cond_0
|
|
if-le p2, p0, :cond_1
|
|
|
|
const-string v0, "PROTOCOL_ERROR padding %s > remaining length %s"
|
|
|
|
const/4 v1, 0x2
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {p2}, Ljava/lang/Short;->valueOf(S)Ljava/lang/Short;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
invoke-static {v0, v1}, Lokhttp3/internal/framed/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
|
|
|
|
move-result-object v0
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
sub-int v0, p0, p2
|
|
|
|
int-to-short v0, v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private static readMedium(Lokio/BufferedSource;)I
|
|
.locals 2
|
|
.param p0, "source" # Lokio/BufferedSource;
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
invoke-interface {p0}, Lokio/BufferedSource;->readByte()B
|
|
|
|
move-result v0
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
shl-int/lit8 v0, v0, 0x10
|
|
|
|
invoke-interface {p0}, Lokio/BufferedSource;->readByte()B
|
|
|
|
move-result v1
|
|
|
|
and-int/lit16 v1, v1, 0xff
|
|
|
|
shl-int/lit8 v1, v1, 0x8
|
|
|
|
or-int/2addr v0, v1
|
|
|
|
invoke-interface {p0}, Lokio/BufferedSource;->readByte()B
|
|
|
|
move-result v1
|
|
|
|
and-int/lit16 v1, v1, 0xff
|
|
|
|
or-int/2addr v0, v1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private static writeMedium(Lokio/BufferedSink;I)V
|
|
.locals 1
|
|
.param p0, "sink" # Lokio/BufferedSink;
|
|
.param p1, "i" # I
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
ushr-int/lit8 v0, p1, 0x10
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
invoke-interface {p0, v0}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
|
|
|
|
ushr-int/lit8 v0, p1, 0x8
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
invoke-interface {p0, v0}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
|
|
|
|
and-int/lit16 v0, p1, 0xff
|
|
|
|
invoke-interface {p0, v0}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getProtocol()Lokhttp3/Protocol;
|
|
.locals 1
|
|
|
|
.prologue
|
|
sget-object v0, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public newReader(Lokio/BufferedSource;Z)Lokhttp3/internal/framed/FrameReader;
|
|
.locals 2
|
|
.param p1, "source" # Lokio/BufferedSource;
|
|
.param p2, "client" # Z
|
|
|
|
.prologue
|
|
new-instance v0, Lokhttp3/internal/framed/Http2$Reader;
|
|
|
|
const/16 v1, 0x1000
|
|
|
|
invoke-direct {v0, p1, v1, p2}, Lokhttp3/internal/framed/Http2$Reader;-><init>(Lokio/BufferedSource;IZ)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public newWriter(Lokio/BufferedSink;Z)Lokhttp3/internal/framed/FrameWriter;
|
|
.locals 1
|
|
.param p1, "sink" # Lokio/BufferedSink;
|
|
.param p2, "client" # Z
|
|
|
|
.prologue
|
|
new-instance v0, Lokhttp3/internal/framed/Http2$Writer;
|
|
|
|
invoke-direct {v0, p1, p2}, Lokhttp3/internal/framed/Http2$Writer;-><init>(Lokio/BufferedSink;Z)V
|
|
|
|
return-object v0
|
|
.end method
|