2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "EmbedResourceUtils.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field public static final FILE_SCHEME:Ljava/lang/String; = "res:///"
|
|
|
|
|
|
|
|
.field public static final INSTANCE:Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
|
|
|
|
.field public static final MAX_IMAGE_SIZE:I = 0x5a0
|
|
|
|
|
|
|
|
.field public static final MAX_IMAGE_VIEW_HEIGHT_PX:I
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/embed/EmbedResourceUtils;-><init>()V
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/utilities/embed/EmbedResourceUtils;->INSTANCE:Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
|
|
|
|
const/16 v0, 0x140
|
|
|
|
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/dimen/DimenUtils;->dpToPixels(I)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
sput v0, Lcom/discord/utilities/embed/EmbedResourceUtils;->MAX_IMAGE_VIEW_HEIGHT_PX:I
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>()V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final asImageItem(Lcom/discord/models/domain/ModelMessageAttachment;)Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getType()Lcom/discord/models/domain/ModelMessageAttachment$Type;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
if-eqz v0, :cond_1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getFilename()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/embed/EmbedResourceUtils;->createFileImageItem(Ljava/lang/String;)Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
new-instance v0, Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getUrl()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getProxyUrl()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getWidth()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getHeight()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
invoke-direct {v0, v1, v2, v3, p1}, Lcom/discord/models/domain/ModelMessageEmbed$Item;-><init>(Ljava/lang/String;Ljava/lang/String;II)V
|
|
|
|
|
|
|
|
move-object p1, v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final asVideoItem(Lcom/discord/models/domain/ModelMessageAttachment;)Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getType()Lcom/discord/models/domain/ModelMessageAttachment$Type;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v1, 0x2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance v0, Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getUrl()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getProxyUrl()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getWidth()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getHeight()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
invoke-direct {v0, v1, v2, v3, p1}, Lcom/discord/models/domain/ModelMessageEmbed$Item;-><init>(Ljava/lang/String;Ljava/lang/String;II)V
|
|
|
|
|
|
|
|
move-object p1, v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic calculateSize$default(Lcom/discord/utilities/embed/EmbedResourceUtils;IIIIIILjava/lang/Object;)Lkotlin/Pair;
|
|
|
|
.locals 6
|
|
|
|
|
|
|
|
and-int/lit8 p6, p6, 0x10
|
|
|
|
|
|
|
|
if-eqz p6, :cond_0
|
|
|
|
|
|
|
|
const/4 p5, 0x0
|
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move v5, p5
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
move-object v0, p0
|
|
|
|
|
|
|
|
move v1, p1
|
|
|
|
|
|
|
|
move v2, p2
|
|
|
|
|
|
|
|
move v3, p3
|
|
|
|
|
|
|
|
move v4, p4
|
|
|
|
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lcom/discord/utilities/embed/EmbedResourceUtils;->calculateSize(IIIII)Lkotlin/Pair;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final createFileImageItem(Ljava/lang/String;)Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
const-string v0, "res:///"
|
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-static {v0}, Lf/e/b/a/a;->D(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/utilities/embed/EmbedResourceUtils;->getFileDrawable(Ljava/lang/String;)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/16 v2, 0x1e
|
|
|
|
|
|
|
|
const/16 v3, 0x28
|
|
|
|
|
|
|
|
invoke-direct {v0, v1, p1, v2, v3}, Lcom/discord/models/domain/ModelMessageEmbed$Item;-><init>(Ljava/lang/String;Ljava/lang/String;II)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
2020-07-23 01:06:17 +00:00
|
|
|
.method public final calculateScaledSize(IIIILandroid/content/res/Resources;)Lkotlin/Pair;
|
|
|
|
.locals 6
|
2020-05-17 12:40:10 +00:00
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
2020-07-23 01:06:17 +00:00
|
|
|
"(IIII",
|
|
|
|
"Landroid/content/res/Resources;",
|
|
|
|
")",
|
2020-05-17 12:40:10 +00:00
|
|
|
"Lkotlin/Pair<",
|
|
|
|
"Ljava/lang/Integer;",
|
|
|
|
"Ljava/lang/Integer;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
if-eqz p5, :cond_7
|
2020-07-15 19:49:36 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
invoke-virtual {p5}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
move-result-object p5
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
iget p5, p5, Landroid/util/DisplayMetrics;->density:F
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
int-to-float v0, p1
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
mul-float v1, p5, v0
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
int-to-float v2, p2
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
mul-float p5, p5, v2
|
|
|
|
|
|
|
|
div-int/lit8 v3, p3, 0x2
|
|
|
|
|
|
|
|
int-to-float v3, v3
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
const/4 v5, 0x1
|
|
|
|
|
|
|
|
cmpl-float v3, v1, v3
|
|
|
|
|
|
|
|
if-gtz v3, :cond_1
|
|
|
|
|
|
|
|
div-int/lit8 v3, p4, 0x2
|
|
|
|
|
|
|
|
int-to-float v3, v3
|
|
|
|
|
|
|
|
cmpl-float v3, p5, v3
|
|
|
|
|
|
|
|
if-lez v3, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v3, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
2020-07-23 01:06:17 +00:00
|
|
|
:goto_0
|
|
|
|
const/4 v3, 0x1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:goto_1
|
2020-07-23 01:06:17 +00:00
|
|
|
if-eqz v3, :cond_6
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
if-le p1, p2, :cond_2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
const/4 v4, 0x1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_2
|
2020-07-23 01:06:17 +00:00
|
|
|
if-lez p2, :cond_3
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
div-float/2addr v0, v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const/4 v0, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
:goto_2
|
|
|
|
if-eqz v4, :cond_4
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
int-to-float p1, p3
|
2020-07-15 19:49:36 +00:00
|
|
|
|
2020-07-22 00:04:40 +00:00
|
|
|
goto :goto_3
|
2020-07-16 19:51:49 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
:cond_4
|
|
|
|
int-to-float p1, p4
|
|
|
|
|
|
|
|
mul-float p1, p1, v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:goto_3
|
2020-07-23 01:06:17 +00:00
|
|
|
if-eqz v4, :cond_5
|
|
|
|
|
|
|
|
int-to-float p2, p3
|
|
|
|
|
|
|
|
div-float/2addr p2, v0
|
|
|
|
|
|
|
|
goto :goto_4
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
int-to-float p2, p4
|
|
|
|
|
|
|
|
:goto_4
|
|
|
|
float-to-int p1, p1
|
2020-07-16 19:51:49 +00:00
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
float-to-int p2, p2
|
|
|
|
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
new-instance p3, Lkotlin/Pair;
|
|
|
|
|
|
|
|
invoke-direct {p3, p1, p2}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
goto :goto_5
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
float-to-int p1, v1
|
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
float-to-int p2, p5
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
new-instance p3, Lkotlin/Pair;
|
|
|
|
|
|
|
|
invoke-direct {p3, p1, p2}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
:goto_5
|
2020-05-17 12:40:10 +00:00
|
|
|
return-object p3
|
2020-07-23 01:06:17 +00:00
|
|
|
|
|
|
|
:cond_7
|
|
|
|
const-string p1, "resources"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-07-23 01:06:17 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
throw p1
|
2020-05-17 12:40:10 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final calculateSize(IIIII)Lkotlin/Pair;
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(IIIII)",
|
|
|
|
"Lkotlin/Pair<",
|
|
|
|
"Ljava/lang/Integer;",
|
|
|
|
"Ljava/lang/Integer;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
if-lez p1, :cond_0
|
|
|
|
|
|
|
|
int-to-float p2, p2
|
|
|
|
|
|
|
|
int-to-float v0, p1
|
|
|
|
|
|
|
|
div-float/2addr p2, v0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-static {p3, p1}, Ljava/lang/Math;->min(II)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
int-to-float p3, p1
|
|
|
|
|
|
|
|
mul-float p3, p3, p2
|
|
|
|
|
2020-07-25 02:57:47 +00:00
|
|
|
invoke-static {p3}, Lf/n/a/k/a;->roundToInt(F)I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
if-le p3, p4, :cond_1
|
|
|
|
|
|
|
|
int-to-float p1, p4
|
|
|
|
|
|
|
|
div-float/2addr p1, p2
|
|
|
|
|
2020-07-25 02:57:47 +00:00
|
|
|
invoke-static {p1}, Lf/n/a/k/a;->roundToInt(F)I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-static {p5, p1}, Ljava/lang/Math;->max(II)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
int-to-float p1, p1
|
|
|
|
|
|
|
|
mul-float p1, p1, p2
|
|
|
|
|
2020-07-25 02:57:47 +00:00
|
|
|
invoke-static {p1}, Lf/n/a/k/a;->roundToInt(F)I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
invoke-static {p1, p4}, Ljava/lang/Math;->min(II)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
int-to-float p3, p1
|
|
|
|
|
|
|
|
div-float/2addr p3, p2
|
|
|
|
|
|
|
|
float-to-int p2, p3
|
|
|
|
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
new-instance p3, Lkotlin/Pair;
|
|
|
|
|
|
|
|
invoke-direct {p3, p2, p1}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
return-object p3
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final computeMaximumImageWidthPx(Landroid/content/Context;)I
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const v1, 0x7f0701e6
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
const v2, 0x7f07006a
|
|
|
|
|
|
|
|
invoke-virtual {v0, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/display/DisplayUtils;->getScreenSize(Landroid/content/Context;)Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Rect;->width()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
const/16 v2, 0x5a0
|
|
|
|
|
|
|
|
add-int/2addr v1, v0
|
|
|
|
|
|
|
|
sub-int/2addr p1, v1
|
|
|
|
|
|
|
|
invoke-static {v2, p1}, Ljava/lang/Math;->min(II)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string p1, "context"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final createAttachmentEmbed(Lcom/discord/models/domain/ModelMessageAttachment;)Lcom/discord/models/domain/ModelMessageEmbed;
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/embed/EmbedResourceUtils;->asVideoItem(Lcom/discord/models/domain/ModelMessageAttachment;)Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/embed/EmbedResourceUtils;->asImageItem(Lcom/discord/models/domain/ModelMessageAttachment;)Lcom/discord/models/domain/ModelMessageEmbed$Item;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/models/domain/ModelMessageEmbed;
|
|
|
|
|
|
|
|
invoke-direct {v2, p1, v0, v1}, Lcom/discord/models/domain/ModelMessageEmbed;-><init>(Lcom/discord/models/domain/ModelMessageAttachment;Lcom/discord/models/domain/ModelMessageEmbed$Item;Lcom/discord/models/domain/ModelMessageEmbed$Item;)V
|
|
|
|
|
|
|
|
return-object v2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string p1, "attachment"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getFileDrawable(Ljava/lang/String;)I
|
|
|
|
.locals 2
|
|
|
|
.annotation build Landroidx/annotation/DrawableRes;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, ""
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
const/16 v1, 0x2e
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1, v1, v0}, Lj0/t/p;->substringAfterLast(Ljava/lang/String;CLjava/lang/String;)Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result-object v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_0
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object p1, Lcom/discord/utilities/embed/FileType;->Companion:Lcom/discord/utilities/embed/FileType$Companion;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/utilities/embed/FileType$Companion;->getFromExtension(Ljava/lang/String;)Lcom/discord/utilities/embed/FileType;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/embed/FileType;->getFileDrawable()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
goto :goto_0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
2020-08-20 22:29:33 +00:00
|
|
|
const p1, 0x7f0802de
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
:goto_0
|
2020-05-17 12:40:10 +00:00
|
|
|
return p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getMAX_IMAGE_VIEW_HEIGHT_PX()I
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
sget v0, Lcom/discord/utilities/embed/EmbedResourceUtils;->MAX_IMAGE_VIEW_HEIGHT_PX:I
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getPreviewUrls(Ljava/lang/String;II)[Ljava/lang/String;
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v1, "?width="
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p2, "&height="
|
|
|
|
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string p3, "res:///"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v1, 0x2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1, p3, v0, v1}, Lj0/t/k;->startsWith$default(Ljava/lang/String;Ljava/lang/String;ZI)Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result p3
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
if-nez p3, :cond_1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string p3, ".gif"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1, p3, v0, v1}, Lj0/t/k;->endsWith$default(Ljava/lang/String;Ljava/lang/String;ZI)Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-07-08 16:44:49 +00:00
|
|
|
new-array p1, v1, [Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string p3, "&format=webp"
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-static {p2, p3}, Lf/e/b/a/a;->p(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
|
|
|
aput-object p3, p1, v0
|
|
|
|
|
|
|
|
aput-object p2, p1, v2
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
new-array p1, v2, [Ljava/lang/String;
|
|
|
|
|
|
|
|
aput-object p2, p1, v0
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "originalUrl"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|