667 lines
13 KiB
Smali
667 lines
13 KiB
Smali
.class public final Lcom/facebook/imageutils/f;
|
|
.super Ljava/lang/Object;
|
|
.source "WebpUtil.java"
|
|
|
|
|
|
# direct methods
|
|
.method private static a([BLjava/lang/String;)Z
|
|
.locals 5
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x4
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eq v1, v0, :cond_0
|
|
|
|
return v2
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-ge v0, v1, :cond_2
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v3
|
|
|
|
aget-byte v4, p0, v0
|
|
|
|
if-eq v3, v4, :cond_1
|
|
|
|
return v2
|
|
|
|
:cond_1
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static k(Ljava/io/InputStream;)Landroid/util/Pair;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/io/InputStream;",
|
|
")",
|
|
"Landroid/util/Pair<",
|
|
"Ljava/lang/Integer;",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x4
|
|
|
|
new-array v1, v0, [B
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:try_start_0
|
|
invoke-virtual {p0, v1}, Ljava/io/InputStream;->read([B)I
|
|
|
|
const-string v3, "RIFF"
|
|
|
|
invoke-static {v1, v3}, Lcom/facebook/imageutils/f;->a([BLjava/lang/String;)Z
|
|
|
|
move-result v3
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_5
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
:try_start_1
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
:cond_0
|
|
:goto_0
|
|
return-object v2
|
|
|
|
:cond_1
|
|
:try_start_2
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->l(Ljava/io/InputStream;)I
|
|
|
|
invoke-virtual {p0, v1}, Ljava/io/InputStream;->read([B)I
|
|
|
|
const-string v3, "WEBP"
|
|
|
|
invoke-static {v1, v3}, Lcom/facebook/imageutils/f;->a([BLjava/lang/String;)Z
|
|
|
|
move-result v3
|
|
:try_end_2
|
|
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_5
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
if-nez v3, :cond_3
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
:try_start_3
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_3
|
|
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return-object v2
|
|
|
|
:cond_3
|
|
:try_start_4
|
|
invoke-virtual {p0, v1}, Ljava/io/InputStream;->read([B)I
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_2
|
|
if-ge v4, v0, :cond_4
|
|
|
|
aget-byte v5, v1, v4
|
|
|
|
int-to-char v5, v5
|
|
|
|
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "VP8 "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eqz v1, :cond_8
|
|
|
|
const-wide/16 v0, 0x7
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/io/InputStream;->skip(J)J
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->o(Ljava/io/InputStream;)S
|
|
|
|
move-result v0
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->o(Ljava/io/InputStream;)S
|
|
|
|
move-result v1
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->o(Ljava/io/InputStream;)S
|
|
|
|
move-result v4
|
|
|
|
const/16 v5, 0x9d
|
|
|
|
if-ne v0, v5, :cond_6
|
|
|
|
if-ne v1, v3, :cond_6
|
|
|
|
const/16 v0, 0x2a
|
|
|
|
if-eq v4, v0, :cond_5
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
new-instance v0, Landroid/util/Pair;
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->m(Ljava/io/InputStream;)I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->m(Ljava/io/InputStream;)I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v0, v1, v3}, Landroid/util/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
:try_end_4
|
|
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_5
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_0
|
|
|
|
goto :goto_4
|
|
|
|
:cond_6
|
|
:goto_3
|
|
move-object v0, v2
|
|
|
|
:goto_4
|
|
if-eqz p0, :cond_7
|
|
|
|
:try_start_5
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_5
|
|
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_2
|
|
|
|
goto :goto_5
|
|
|
|
:catch_2
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
:cond_7
|
|
:goto_5
|
|
return-object v0
|
|
|
|
:cond_8
|
|
:try_start_6
|
|
const-string v1, "VP8L"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_b
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->l(Ljava/io/InputStream;)I
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->p(Ljava/io/InputStream;)B
|
|
|
|
move-result v0
|
|
|
|
const/16 v1, 0x2f
|
|
|
|
if-eq v0, v1, :cond_9
|
|
|
|
goto :goto_6
|
|
|
|
:cond_9
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v0
|
|
|
|
int-to-byte v0, v0
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v1
|
|
|
|
int-to-byte v1, v1
|
|
|
|
and-int/lit16 v1, v1, 0xff
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v4
|
|
|
|
int-to-byte v4, v4
|
|
|
|
and-int/lit16 v4, v4, 0xff
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v5
|
|
|
|
int-to-byte v5, v5
|
|
|
|
and-int/lit16 v5, v5, 0xff
|
|
|
|
and-int/lit8 v6, v1, 0x3f
|
|
|
|
shl-int/lit8 v6, v6, 0x8
|
|
|
|
or-int/2addr v0, v6
|
|
|
|
add-int/2addr v0, v3
|
|
|
|
and-int/lit8 v5, v5, 0xf
|
|
|
|
shl-int/lit8 v5, v5, 0xa
|
|
|
|
shl-int/lit8 v4, v4, 0x2
|
|
|
|
or-int/2addr v4, v5
|
|
|
|
and-int/lit16 v1, v1, 0xc0
|
|
|
|
shr-int/lit8 v1, v1, 0x6
|
|
|
|
or-int/2addr v1, v4
|
|
|
|
add-int/2addr v1, v3
|
|
|
|
new-instance v3, Landroid/util/Pair;
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v3, v0, v1}, Landroid/util/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
:try_end_6
|
|
.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_5
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_0
|
|
|
|
move-object v2, v3
|
|
|
|
:goto_6
|
|
if-eqz p0, :cond_a
|
|
|
|
:try_start_7
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_7
|
|
.catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_3
|
|
|
|
goto :goto_7
|
|
|
|
:catch_3
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
:cond_a
|
|
:goto_7
|
|
return-object v2
|
|
|
|
:cond_b
|
|
:try_start_8
|
|
const-string v1, "VP8X"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_d
|
|
|
|
const-wide/16 v0, 0x8
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/io/InputStream;->skip(J)J
|
|
|
|
new-instance v0, Landroid/util/Pair;
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->n(Ljava/io/InputStream;)I
|
|
|
|
move-result v1
|
|
|
|
add-int/2addr v1, v3
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->n(Ljava/io/InputStream;)I
|
|
|
|
move-result v4
|
|
|
|
add-int/2addr v4, v3
|
|
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v0, v1, v3}, Landroid/util/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
:try_end_8
|
|
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_5
|
|
.catchall {:try_start_8 .. :try_end_8} :catchall_0
|
|
|
|
if-eqz p0, :cond_c
|
|
|
|
:try_start_9
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_9
|
|
.catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_4
|
|
|
|
goto :goto_8
|
|
|
|
:catch_4
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
:cond_c
|
|
:goto_8
|
|
return-object v0
|
|
|
|
:cond_d
|
|
if-eqz p0, :cond_e
|
|
|
|
:try_start_a
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_a
|
|
.catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_6
|
|
|
|
goto :goto_9
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_a
|
|
|
|
:catch_5
|
|
move-exception v0
|
|
|
|
:try_start_b
|
|
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
|
|
:try_end_b
|
|
.catchall {:try_start_b .. :try_end_b} :catchall_0
|
|
|
|
if-eqz p0, :cond_e
|
|
|
|
:try_start_c
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_c
|
|
.catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_6
|
|
|
|
goto :goto_9
|
|
|
|
:catch_6
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
:cond_e
|
|
:goto_9
|
|
return-object v2
|
|
|
|
:goto_a
|
|
if-eqz p0, :cond_f
|
|
|
|
:try_start_d
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
|
|
:try_end_d
|
|
.catch Ljava/io/IOException; {:try_start_d .. :try_end_d} :catch_7
|
|
|
|
goto :goto_b
|
|
|
|
:catch_7
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
:cond_f
|
|
:goto_b
|
|
goto :goto_d
|
|
|
|
:goto_c
|
|
throw v0
|
|
|
|
:goto_d
|
|
goto :goto_c
|
|
.end method
|
|
|
|
.method private static l(Ljava/io/InputStream;)I
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v0
|
|
|
|
int-to-byte v0, v0
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v1
|
|
|
|
int-to-byte v1, v1
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v2
|
|
|
|
int-to-byte v2, v2
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result p0
|
|
|
|
int-to-byte p0, p0
|
|
|
|
shl-int/lit8 p0, p0, 0x18
|
|
|
|
const/high16 v3, -0x1000000
|
|
|
|
and-int/2addr p0, v3
|
|
|
|
shl-int/lit8 v2, v2, 0x10
|
|
|
|
const/high16 v3, 0xff0000
|
|
|
|
and-int/2addr v2, v3
|
|
|
|
or-int/2addr p0, v2
|
|
|
|
shl-int/lit8 v1, v1, 0x8
|
|
|
|
const v2, 0xff00
|
|
|
|
and-int/2addr v1, v2
|
|
|
|
or-int/2addr p0, v1
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
or-int/2addr p0, v0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static m(Ljava/io/InputStream;)I
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v0
|
|
|
|
int-to-byte v0, v0
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result p0
|
|
|
|
int-to-byte p0, p0
|
|
|
|
shl-int/lit8 p0, p0, 0x8
|
|
|
|
const v1, 0xff00
|
|
|
|
and-int/2addr p0, v1
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
or-int/2addr p0, v0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static n(Ljava/io/InputStream;)I
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->p(Ljava/io/InputStream;)B
|
|
|
|
move-result v0
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->p(Ljava/io/InputStream;)B
|
|
|
|
move-result v1
|
|
|
|
invoke-static {p0}, Lcom/facebook/imageutils/f;->p(Ljava/io/InputStream;)B
|
|
|
|
move-result p0
|
|
|
|
shl-int/lit8 p0, p0, 0x10
|
|
|
|
const/high16 v2, 0xff0000
|
|
|
|
and-int/2addr p0, v2
|
|
|
|
shl-int/lit8 v1, v1, 0x8
|
|
|
|
const v2, 0xff00
|
|
|
|
and-int/2addr v1, v2
|
|
|
|
or-int/2addr p0, v1
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
or-int/2addr p0, v0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static o(Ljava/io/InputStream;)S
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result p0
|
|
|
|
and-int/lit16 p0, p0, 0xff
|
|
|
|
int-to-short p0, p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static p(Ljava/io/InputStream;)B
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result p0
|
|
|
|
and-int/lit16 p0, p0, 0xff
|
|
|
|
int-to-byte p0, p0
|
|
|
|
return p0
|
|
.end method
|