303 lines
6.5 KiB
Smali
303 lines
6.5 KiB
Smali
.class public final Lcom/discord/utilities/apng/ApngDrawableFactory;
|
|
.super Ljava/lang/Object;
|
|
.source "ApngDrawableFactory.kt"
|
|
|
|
# interfaces
|
|
.implements Lf/g/j/i/a;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public createDrawable(Lcom/facebook/imagepipeline/image/CloseableImage;)Landroid/graphics/drawable/Drawable;
|
|
.locals 9
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
instance-of v1, p1, Lcom/discord/utilities/apng/ApngCloseableImage;
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
move-object v1, v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object v1, p1
|
|
|
|
:goto_0
|
|
check-cast v1, Lcom/discord/utilities/apng/ApngCloseableImage;
|
|
|
|
if-eqz v1, :cond_e
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/apng/ApngCloseableImage;->getEncodedImage()Lcom/facebook/imagepipeline/image/EncodedImage;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_e
|
|
|
|
check-cast p1, Lcom/discord/utilities/apng/ApngCloseableImage;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/apng/ApngCloseableImage;->getInputStream()Ljava/io/InputStream;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_e
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/apng/ApngCloseableImage;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/apng/ApngCloseableImage;->getHeight()I
|
|
|
|
move-result p1
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-nez p1, :cond_3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/4 v4, 0x0
|
|
|
|
:goto_2
|
|
xor-int/2addr v3, v4
|
|
|
|
xor-int/2addr v3, v2
|
|
|
|
if-eqz v3, :cond_d
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v3
|
|
|
|
if-lez v3, :cond_4
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
const/4 v3, 0x0
|
|
|
|
goto :goto_4
|
|
|
|
:cond_5
|
|
:goto_3
|
|
const/4 v3, 0x1
|
|
|
|
:goto_4
|
|
if-eqz v3, :cond_c
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v3
|
|
|
|
if-lez v3, :cond_6
|
|
|
|
goto :goto_5
|
|
|
|
:cond_6
|
|
const/4 v2, 0x0
|
|
|
|
:cond_7
|
|
:goto_5
|
|
if-eqz v2, :cond_b
|
|
|
|
if-nez v0, :cond_8
|
|
|
|
if-nez p1, :cond_8
|
|
|
|
const/16 v2, 0xa0
|
|
|
|
const/16 v7, 0xa0
|
|
|
|
goto :goto_6
|
|
|
|
:cond_8
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
:goto_6
|
|
sget-object v2, Lcom/linecorp/apng/decoder/Apng;->Companion:Lcom/linecorp/apng/decoder/Apng$Companion;
|
|
|
|
invoke-virtual {v2, v1}, Lcom/linecorp/apng/decoder/Apng$Companion;->decode(Ljava/io/InputStream;)Lcom/linecorp/apng/decoder/Apng;
|
|
|
|
move-result-object v4
|
|
|
|
new-instance v1, Lf/j/a/a;
|
|
|
|
new-instance v2, Lf/j/a/a$a;
|
|
|
|
if-eqz v0, :cond_9
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_7
|
|
|
|
:cond_9
|
|
invoke-virtual {v4}, Lcom/linecorp/apng/decoder/Apng;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
:goto_7
|
|
move v5, v0
|
|
|
|
if-eqz p1, :cond_a
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p1
|
|
|
|
goto :goto_8
|
|
|
|
:cond_a
|
|
invoke-virtual {v4}, Lcom/linecorp/apng/decoder/Apng;->getHeight()I
|
|
|
|
move-result p1
|
|
|
|
:goto_8
|
|
move v6, p1
|
|
|
|
sget-object v8, Lf/j/a/a$a$a;->d:Lf/j/a/a$a$a;
|
|
|
|
move-object v3, v2
|
|
|
|
invoke-direct/range {v3 .. v8}, Lf/j/a/a$a;-><init>(Lcom/linecorp/apng/decoder/Apng;IIILkotlin/jvm/functions/Function0;)V
|
|
|
|
invoke-direct {v1, v2}, Lf/j/a/a;-><init>(Lf/j/a/a$a;)V
|
|
|
|
return-object v1
|
|
|
|
:cond_b
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Can not specify 0 or negative as height value. height = "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_c
|
|
new-instance p1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Can not specify 0 or negative as width value. width = "
|
|
|
|
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_d
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Can not specify only one side of size. width = "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, ", height = "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_e
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public supportsImageType(Lcom/facebook/imagepipeline/image/CloseableImage;)Z
|
|
.locals 0
|
|
|
|
instance-of p1, p1, Lcom/discord/utilities/apng/ApngCloseableImage;
|
|
|
|
return p1
|
|
.end method
|