apkfuckery/com.discord/smali_classes2/okio/h.smali

660 lines
12 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class public final Lokio/h;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "GzipSource.java"
2019-02-04 20:08:30 +00:00
# interfaces
2019-02-27 21:13:14 +00:00
.implements Lokio/q;
2019-02-04 20:08:30 +00:00
# instance fields
2019-06-25 01:04:50 +00:00
.field private final bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
.field private bwX:I
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
.field private final bwY:Lokio/i;
2019-02-04 20:08:30 +00:00
.field private final crc:Ljava/util/zip/CRC32;
.field private final inflater:Ljava/util/zip/Inflater;
# direct methods
2019-02-27 21:13:14 +00:00
.method public constructor <init>(Lokio/q;)V
2019-02-04 20:08:30 +00:00
.locals 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
2019-06-25 01:04:50 +00:00
iput v0, p0, Lokio/h;->bwX:I
2019-02-04 20:08:30 +00:00
new-instance v0, Ljava/util/zip/CRC32;
invoke-direct {v0}, Ljava/util/zip/CRC32;-><init>()V
iput-object v0, p0, Lokio/h;->crc:Ljava/util/zip/CRC32;
if-eqz p1, :cond_0
new-instance v0, Ljava/util/zip/Inflater;
const/4 v1, 0x1
invoke-direct {v0, v1}, Ljava/util/zip/Inflater;-><init>(Z)V
iput-object v0, p0, Lokio/h;->inflater:Ljava/util/zip/Inflater;
2019-02-27 21:13:14 +00:00
invoke-static {p1}, Lokio/j;->b(Lokio/q;)Lokio/d;
2019-02-04 20:08:30 +00:00
move-result-object p1
2019-06-25 01:04:50 +00:00
iput-object p1, p0, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
new-instance p1, Lokio/i;
2019-06-25 01:04:50 +00:00
iget-object v0, p0, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
iget-object v1, p0, Lokio/h;->inflater:Ljava/util/zip/Inflater;
invoke-direct {p1, v0, v1}, Lokio/i;-><init>(Lokio/d;Ljava/util/zip/Inflater;)V
2019-06-25 01:04:50 +00:00
iput-object p1, p0, Lokio/h;->bwY:Lokio/i;
2019-02-04 20:08:30 +00:00
return-void
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "source == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method private b(Lokio/c;JJ)V
.locals 4
2019-06-25 01:04:50 +00:00
iget-object p1, p1, Lokio/c;->bwP:Lokio/m;
2019-02-04 20:08:30 +00:00
:goto_0
2019-02-27 21:13:14 +00:00
iget v0, p1, Lokio/m;->limit:I
2019-02-04 20:08:30 +00:00
2019-02-27 21:13:14 +00:00
iget v1, p1, Lokio/m;->pos:I
2019-02-04 20:08:30 +00:00
sub-int/2addr v0, v1
int-to-long v0, v0
cmp-long v2, p2, v0
if-ltz v2, :cond_0
2019-02-27 21:13:14 +00:00
iget v0, p1, Lokio/m;->limit:I
2019-02-04 20:08:30 +00:00
2019-02-27 21:13:14 +00:00
iget v1, p1, Lokio/m;->pos:I
2019-02-04 20:08:30 +00:00
sub-int/2addr v0, v1
int-to-long v0, v0
sub-long/2addr p2, v0
2019-06-25 01:04:50 +00:00
iget-object p1, p1, Lokio/m;->bxh:Lokio/m;
2019-02-04 20:08:30 +00:00
goto :goto_0
:cond_0
const-wide/16 v0, 0x0
:goto_1
cmp-long v2, p4, v0
if-lez v2, :cond_1
2019-02-27 21:13:14 +00:00
iget v2, p1, Lokio/m;->pos:I
2019-02-04 20:08:30 +00:00
int-to-long v2, v2
add-long/2addr v2, p2
long-to-int p2, v2
2019-02-27 21:13:14 +00:00
iget p3, p1, Lokio/m;->limit:I
2019-02-04 20:08:30 +00:00
sub-int/2addr p3, p2
int-to-long v2, p3
invoke-static {v2, v3, p4, p5}, Ljava/lang/Math;->min(JJ)J
move-result-wide v2
long-to-int p3, v2
iget-object v2, p0, Lokio/h;->crc:Ljava/util/zip/CRC32;
2019-02-27 21:13:14 +00:00
iget-object v3, p1, Lokio/m;->data:[B
2019-02-04 20:08:30 +00:00
invoke-virtual {v2, v3, p2, p3}, Ljava/util/zip/CRC32;->update([BII)V
int-to-long p2, p3
sub-long/2addr p4, p2
2019-06-25 01:04:50 +00:00
iget-object p1, p1, Lokio/m;->bxh:Lokio/m;
2019-02-04 20:08:30 +00:00
move-wide p2, v0
goto :goto_1
:cond_1
return-void
.end method
.method private static q(Ljava/lang/String;II)V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-ne p2, p1, :cond_0
return-void
:cond_0
new-instance v0, Ljava/io/IOException;
const/4 v1, 0x3
new-array v1, v1, [Ljava/lang/Object;
const/4 v2, 0x0
aput-object p0, v1, v2
const/4 p0, 0x1
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p2
aput-object p2, v1, p0
const/4 p0, 0x2
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
aput-object p1, v1, p0
const-string p0, "%s: actual 0x%08x != expected 0x%08x"
invoke-static {p0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
# virtual methods
.method public final a(Lokio/c;J)J
.locals 19
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
move-object/from16 v6, p0
move-object/from16 v7, p1
move-wide/from16 v8, p2
const-wide/16 v0, 0x0
cmp-long v2, v8, v0
if-ltz v2, :cond_12
cmp-long v2, v8, v0
if-nez v2, :cond_0
return-wide v0
:cond_0
2019-06-25 01:04:50 +00:00
iget v0, v6, Lokio/h;->bwX:I
2019-02-04 20:08:30 +00:00
const-wide/16 v10, -0x1
const/4 v12, 0x1
if-nez v0, :cond_d
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
const-wide/16 v1, 0xa
2019-06-04 23:20:38 +00:00
invoke-interface {v0, v1, v2}, Lokio/d;->au(J)V
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DM()Lokio/c;
2019-02-04 20:08:30 +00:00
move-result-object v0
const-wide/16 v1, 0x3
2019-06-04 23:20:38 +00:00
invoke-virtual {v0, v1, v2}, Lokio/c;->av(J)B
2019-02-04 20:08:30 +00:00
move-result v13
shr-int/lit8 v0, v13, 0x1
and-int/2addr v0, v12
if-ne v0, v12, :cond_1
const/4 v14, 0x1
goto :goto_0
:cond_1
const/4 v0, 0x0
const/4 v14, 0x0
:goto_0
if-eqz v14, :cond_2
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DM()Lokio/c;
2019-02-04 20:08:30 +00:00
move-result-object v1
const-wide/16 v2, 0x0
const-wide/16 v4, 0xa
move-object/from16 v0, p0
invoke-direct/range {v0 .. v5}, Lokio/h;->b(Lokio/c;JJ)V
:cond_2
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
invoke-interface {v0}, Lokio/d;->readShort()S
move-result v0
2019-05-03 18:53:54 +00:00
const/16 v1, 0x1f8b
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
const-string v2, "ID1ID2"
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-static {v2, v1, v0}, Lokio/h;->q(Ljava/lang/String;II)V
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
const-wide/16 v1, 0x8
2019-06-04 23:20:38 +00:00
invoke-interface {v0, v1, v2}, Lokio/d;->aB(J)V
2019-02-04 20:08:30 +00:00
shr-int/lit8 v0, v13, 0x2
and-int/2addr v0, v12
if-ne v0, v12, :cond_5
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
const-wide/16 v1, 0x2
2019-06-04 23:20:38 +00:00
invoke-interface {v0, v1, v2}, Lokio/d;->au(J)V
2019-02-04 20:08:30 +00:00
if-eqz v14, :cond_3
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DM()Lokio/c;
2019-02-04 20:08:30 +00:00
move-result-object v1
const-wide/16 v2, 0x0
const-wide/16 v4, 0x2
move-object/from16 v0, p0
invoke-direct/range {v0 .. v5}, Lokio/h;->b(Lokio/c;JJ)V
:cond_3
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DM()Lokio/c;
2019-02-04 20:08:30 +00:00
move-result-object v0
2019-06-25 01:04:50 +00:00
invoke-virtual {v0}, Lokio/c;->DR()S
2019-02-04 20:08:30 +00:00
move-result v0
2019-06-25 01:04:50 +00:00
iget-object v1, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
int-to-long v4, v0
2019-06-04 23:20:38 +00:00
invoke-interface {v1, v4, v5}, Lokio/d;->au(J)V
2019-02-04 20:08:30 +00:00
if-eqz v14, :cond_4
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DM()Lokio/c;
2019-02-04 20:08:30 +00:00
move-result-object v1
const-wide/16 v2, 0x0
move-object/from16 v0, p0
move-wide v15, v4
invoke-direct/range {v0 .. v5}, Lokio/h;->b(Lokio/c;JJ)V
goto :goto_1
:cond_4
move-wide v15, v4
:goto_1
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
move-wide v1, v15
2019-06-04 23:20:38 +00:00
invoke-interface {v0, v1, v2}, Lokio/d;->aB(J)V
2019-02-04 20:08:30 +00:00
:cond_5
shr-int/lit8 v0, v13, 0x3
and-int/2addr v0, v12
const-wide/16 v15, 0x1
if-ne v0, v12, :cond_8
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DW()J
2019-02-04 20:08:30 +00:00
move-result-wide v17
cmp-long v0, v17, v10
if-eqz v0, :cond_7
if-eqz v14, :cond_6
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DM()Lokio/c;
2019-02-04 20:08:30 +00:00
move-result-object v1
const-wide/16 v2, 0x0
add-long v4, v17, v15
move-object/from16 v0, p0
invoke-direct/range {v0 .. v5}, Lokio/h;->b(Lokio/c;JJ)V
:cond_6
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
add-long v1, v17, v15
2019-06-04 23:20:38 +00:00
invoke-interface {v0, v1, v2}, Lokio/d;->aB(J)V
2019-02-04 20:08:30 +00:00
goto :goto_2
:cond_7
new-instance v0, Ljava/io/EOFException;
invoke-direct {v0}, Ljava/io/EOFException;-><init>()V
throw v0
:cond_8
:goto_2
shr-int/lit8 v0, v13, 0x4
and-int/2addr v0, v12
if-ne v0, v12, :cond_b
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DW()J
2019-02-04 20:08:30 +00:00
move-result-wide v17
cmp-long v0, v17, v10
if-eqz v0, :cond_a
if-eqz v14, :cond_9
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DM()Lokio/c;
2019-02-04 20:08:30 +00:00
move-result-object v1
const-wide/16 v2, 0x0
add-long v4, v17, v15
move-object/from16 v0, p0
invoke-direct/range {v0 .. v5}, Lokio/h;->b(Lokio/c;JJ)V
:cond_9
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
add-long v1, v17, v15
2019-06-04 23:20:38 +00:00
invoke-interface {v0, v1, v2}, Lokio/d;->aB(J)V
2019-02-04 20:08:30 +00:00
goto :goto_3
:cond_a
new-instance v0, Ljava/io/EOFException;
invoke-direct {v0}, Ljava/io/EOFException;-><init>()V
throw v0
:cond_b
:goto_3
if-eqz v14, :cond_c
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DR()S
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
move-result v0
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
iget-object v1, v6, Lokio/h;->crc:Ljava/util/zip/CRC32;
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
move-result-wide v1
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
long-to-int v2, v1
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
int-to-short v1, v2
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
const-string v2, "FHCRC"
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-static {v2, v0, v1}, Lokio/h;->q(Ljava/lang/String;II)V
2019-02-04 20:08:30 +00:00
iget-object v0, v6, Lokio/h;->crc:Ljava/util/zip/CRC32;
invoke-virtual {v0}, Ljava/util/zip/CRC32;->reset()V
:cond_c
2019-06-25 01:04:50 +00:00
iput v12, v6, Lokio/h;->bwX:I
2019-02-04 20:08:30 +00:00
:cond_d
2019-06-25 01:04:50 +00:00
iget v0, v6, Lokio/h;->bwX:I
2019-02-04 20:08:30 +00:00
const/4 v1, 0x2
if-ne v0, v12, :cond_f
iget-wide v2, v7, Lokio/c;->size:J
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bwY:Lokio/i;
2019-02-04 20:08:30 +00:00
invoke-virtual {v0, v7, v8, v9}, Lokio/i;->a(Lokio/c;J)J
move-result-wide v8
cmp-long v0, v8, v10
if-eqz v0, :cond_e
move-object/from16 v0, p0
move-object/from16 v1, p1
move-wide v4, v8
invoke-direct/range {v0 .. v5}, Lokio/h;->b(Lokio/c;JJ)V
return-wide v8
:cond_e
2019-06-25 01:04:50 +00:00
iput v1, v6, Lokio/h;->bwX:I
2019-02-04 20:08:30 +00:00
:cond_f
2019-06-25 01:04:50 +00:00
iget v0, v6, Lokio/h;->bwX:I
2019-02-04 20:08:30 +00:00
if-ne v0, v1, :cond_11
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DS()I
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
move-result v0
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
iget-object v1, v6, Lokio/h;->crc:Ljava/util/zip/CRC32;
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
move-result-wide v1
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
long-to-int v2, v1
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
const-string v1, "CRC"
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-static {v1, v0, v2}, Lokio/h;->q(Ljava/lang/String;II)V
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DS()I
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
move-result v0
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
iget-object v1, v6, Lokio/h;->inflater:Ljava/util/zip/Inflater;
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-virtual {v1}, Ljava/util/zip/Inflater;->getBytesWritten()J
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
move-result-wide v1
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
long-to-int v2, v1
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
const-string v1, "ISIZE"
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-static {v1, v0, v2}, Lokio/h;->q(Ljava/lang/String;II)V
2019-02-04 20:08:30 +00:00
const/4 v0, 0x3
2019-06-25 01:04:50 +00:00
iput v0, v6, Lokio/h;->bwX:I
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
iget-object v0, v6, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-06-25 01:04:50 +00:00
invoke-interface {v0}, Lokio/d;->DO()Z
2019-02-04 20:08:30 +00:00
move-result v0
if-eqz v0, :cond_10
goto :goto_4
:cond_10
new-instance v0, Ljava/io/IOException;
const-string v1, "gzip finished without exhausting source"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:cond_11
:goto_4
return-wide v10
:cond_12
new-instance v0, Ljava/lang/IllegalArgumentException;
invoke-static/range {p2 .. p3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v1
const-string v2, "byteCount < 0: "
invoke-virtual {v2, v1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final close()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
2019-06-25 01:04:50 +00:00
iget-object v0, p0, Lokio/h;->bwY:Lokio/i;
2019-02-04 20:08:30 +00:00
invoke-virtual {v0}, Lokio/i;->close()V
return-void
.end method
2019-02-27 21:13:14 +00:00
.method public final timeout()Lokio/r;
2019-02-04 20:08:30 +00:00
.locals 1
2019-06-25 01:04:50 +00:00
iget-object v0, p0, Lokio/h;->bqM:Lokio/d;
2019-02-04 20:08:30 +00:00
2019-02-27 21:13:14 +00:00
invoke-interface {v0}, Lokio/d;->timeout()Lokio/r;
2019-02-04 20:08:30 +00:00
move-result-object v0
return-object v0
.end method