1438 lines
40 KiB
Smali
1438 lines
40 KiB
Smali
.class public final Lcom/discord/utilities/dsti/StickerUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "StickerUtils.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final DEFAULT_HEADER_SIZE_PX$delegate:Lkotlin/Lazy;
|
|
|
|
.field public static final DEFAULT_STICKER_SIZE_PX$delegate:Lkotlin/Lazy;
|
|
|
|
.field public static final INSTANCE:Lcom/discord/utilities/dsti/StickerUtils;
|
|
|
|
.field public static final PREMIUM_TIER_2_STICKERS_DISCOUNT_PERCENTAGE:I = 0x21
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/dsti/StickerUtils;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/dsti/StickerUtils;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/dsti/StickerUtils;->INSTANCE:Lcom/discord/utilities/dsti/StickerUtils;
|
|
|
|
sget-object v0, Lcom/discord/utilities/dsti/StickerUtils$DEFAULT_STICKER_SIZE_PX$2;->INSTANCE:Lcom/discord/utilities/dsti/StickerUtils$DEFAULT_STICKER_SIZE_PX$2;
|
|
|
|
invoke-static {v0}, Lf/h/a/f/f/n/f;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/discord/utilities/dsti/StickerUtils;->DEFAULT_STICKER_SIZE_PX$delegate:Lkotlin/Lazy;
|
|
|
|
sget-object v0, Lcom/discord/utilities/dsti/StickerUtils$DEFAULT_HEADER_SIZE_PX$2;->INSTANCE:Lcom/discord/utilities/dsti/StickerUtils$DEFAULT_HEADER_SIZE_PX$2;
|
|
|
|
invoke-static {v0}, Lf/h/a/f/f/n/f;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/discord/utilities/dsti/StickerUtils;->DEFAULT_HEADER_SIZE_PX$delegate:Lkotlin/Lazy;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic getBannerCDNAssetUrl$default(Lcom/discord/utilities/dsti/StickerUtils;JLcom/discord/models/store/dto/ModelStoreAsset;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/String;
|
|
.locals 0
|
|
|
|
and-int/lit8 p5, p5, 0x4
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
const/4 p4, 0x0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p1, p2, p3, p4}, Lcom/discord/utilities/dsti/StickerUtils;->getBannerCDNAssetUrl(JLcom/discord/models/store/dto/ModelStoreAsset;Ljava/lang/Integer;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static synthetic getCDNAssetUrl$default(Lcom/discord/utilities/dsti/StickerUtils;Lcom/discord/models/sticker/dto/ModelSticker;Ljava/lang/Integer;ZILjava/lang/Object;)Ljava/lang/String;
|
|
.locals 0
|
|
|
|
and-int/lit8 p5, p4, 0x2
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
:cond_0
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
const/4 p3, 0x1
|
|
|
|
:cond_1
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/utilities/dsti/StickerUtils;->getCDNAssetUrl(Lcom/discord/models/sticker/dto/ModelSticker;Ljava/lang/Integer;Z)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final getStickerPackPriceForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Ljava/lang/Integer;
|
|
.locals 1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelStickerPack;->getStoreListing()Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;->getSku()Lcom/discord/models/domain/ModelSku;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelSku;->getPrice()Lcom/discord/models/domain/ModelSku$Price;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelSku$Price;->getPremium()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->getTierInt()I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {v0, p2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/discord/models/domain/ModelSku$ModelPremiumSkuPrice;
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelSku$ModelPremiumSkuPrice;->getAmount()I
|
|
|
|
move-result p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelSku$Price;->getAmount()I
|
|
|
|
move-result p1
|
|
|
|
:goto_0
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public static synthetic isStoreListingExpiringSoon$default(Lcom/discord/utilities/dsti/StickerUtils;Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;JLcom/discord/utilities/time/Clock;ILjava/lang/Object;)Z
|
|
.locals 0
|
|
|
|
and-int/lit8 p5, p5, 0x4
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
invoke-static {}, Lcom/discord/utilities/time/ClockFactory;->get()Lcom/discord/utilities/time/Clock;
|
|
|
|
move-result-object p4
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p1, p2, p3, p4}, Lcom/discord/utilities/dsti/StickerUtils;->isStoreListingExpiringSoon(Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;JLcom/discord/utilities/time/Clock;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final calculatePremiumStickerPackDiscount()I
|
|
.locals 3
|
|
|
|
sget-object v0, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->NONE:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
invoke-virtual {p0, v0}, Lcom/discord/utilities/dsti/StickerUtils;->getStickerPackPrice(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)I
|
|
|
|
move-result v0
|
|
|
|
sget-object v1, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_2:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
invoke-virtual {p0, v1}, Lcom/discord/utilities/dsti/StickerUtils;->getStickerPackPrice(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)I
|
|
|
|
move-result v1
|
|
|
|
sub-int v1, v0, v1
|
|
|
|
int-to-float v1, v1
|
|
|
|
const/high16 v2, 0x42c80000 # 100.0f
|
|
|
|
mul-float v1, v1, v2
|
|
|
|
int-to-float v0, v0
|
|
|
|
div-float/2addr v1, v0
|
|
|
|
float-to-int v0, v1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final fetchSticker(Landroid/content/Context;Lcom/discord/models/sticker/dto/ModelSticker;)Lrx/Observable;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Lcom/discord/models/sticker/dto/ModelSticker;",
|
|
")",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/utilities/file/DownloadUtils$DownloadState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "sticker"
|
|
|
|
invoke-static {p2, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "stickers"
|
|
|
|
invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->mkdir()Z
|
|
|
|
:cond_0
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/sticker/dto/ModelSticker;->getAssetUrl()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v0, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
new-instance p1, Lcom/discord/utilities/file/DownloadUtils$DownloadState$Completed;
|
|
|
|
invoke-direct {p1, v1}, Lcom/discord/utilities/file/DownloadUtils$DownloadState$Completed;-><init>(Ljava/io/File;)V
|
|
|
|
new-instance p2, Lh0/l/e/j;
|
|
|
|
invoke-direct {p2, p1}, Lh0/l/e/j;-><init>(Ljava/lang/Object;)V
|
|
|
|
const-string p1, "Observable.just(Download\u2026oadState.Completed(file))"
|
|
|
|
invoke-static {p2, p1}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x6
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v1, p0
|
|
|
|
move-object v2, p2
|
|
|
|
invoke-static/range {v1 .. v6}, Lcom/discord/utilities/dsti/StickerUtils;->getCDNAssetUrl$default(Lcom/discord/utilities/dsti/StickerUtils;Lcom/discord/models/sticker/dto/ModelSticker;Ljava/lang/Integer;ZILjava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/sticker/dto/ModelSticker;->getAssetUrl()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p1, v1, p2, v0}, Lcom/discord/utilities/file/DownloadUtils;->downloadFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_0
|
|
return-object p2
|
|
.end method
|
|
|
|
.method public final getBannerCDNAssetUrl(JLcom/discord/models/store/dto/ModelStoreAsset;Ljava/lang/Integer;)Ljava/lang/String;
|
|
.locals 2
|
|
|
|
const-string v0, "asset"
|
|
|
|
invoke-static {p3, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "https://cdn.discordapp.com/app-assets/"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "/store/"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/store/dto/ModelStoreAsset;->getId()J
|
|
|
|
move-result-wide p1
|
|
|
|
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const/16 p1, 0x2e
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {}, Lcom/discord/utilities/string/StringUtilsKt;->getSTATIC_IMAGE_EXTENSION()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
const-string p1, "?size="
|
|
|
|
invoke-static {p1}, Lf/e/c/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p4}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2}, Lcom/discord/utilities/icon/IconUtils;->getMediaProxySize(I)I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string p1, ""
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final getCDNAssetUrl(Lcom/discord/models/sticker/dto/ModelSticker;Ljava/lang/Integer;Z)Ljava/lang/String;
|
|
.locals 6
|
|
|
|
const-string v0, "sticker"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelSticker;->getType()Lcom/discord/models/sticker/dto/ModelSticker$Type;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const-string v2, ""
|
|
|
|
const/16 v3, 0x2f
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
const/4 p2, 0x3
|
|
|
|
if-eq v0, p2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string p2, "https://discord.com/stickers/"
|
|
|
|
invoke-static {p2}, Lf/e/c/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelSticker;->getId()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-virtual {p2, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelSticker;->getAssetUrl()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const-string v0, "https://media.discordapp.net/stickers/"
|
|
|
|
invoke-static {v0}, Lf/e/c/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelSticker;->getId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-virtual {v0, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelSticker;->getAssetUrl()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "?passthrough="
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
const-string p1, "&size="
|
|
|
|
invoke-static {p1}, Lf/e/c/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p2}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2}, Lcom/discord/utilities/icon/IconUtils;->getMediaProxySize(I)I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_2
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_0
|
|
return-object v2
|
|
.end method
|
|
|
|
.method public final getDEFAULT_HEADER_SIZE_PX()I
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/dsti/StickerUtils;->DEFAULT_HEADER_SIZE_PX$delegate:Lkotlin/Lazy;
|
|
|
|
invoke-interface {v0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final getDEFAULT_STICKER_SIZE_PX()I
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/dsti/StickerUtils;->DEFAULT_STICKER_SIZE_PX$delegate:Lkotlin/Lazy;
|
|
|
|
invoke-interface {v0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final getLimitedTimeLeftString(Landroid/content/res/Resources;Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;)Ljava/lang/CharSequence;
|
|
.locals 9
|
|
|
|
const-string v0, "resources"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;->getUnpublishedAt()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-nez v0, :cond_1
|
|
|
|
const-string p1, ""
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
invoke-virtual {p2}, Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;->getUnpublishedAtDate()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {}, Lcom/discord/utilities/time/ClockFactory;->get()Lcom/discord/utilities/time/Clock;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p2}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
|
|
|
|
move-result-wide v2
|
|
|
|
sub-long/2addr v0, v2
|
|
|
|
sget-object p2, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
|
|
|
|
invoke-virtual {p2, v0, v1}, Lcom/discord/utilities/time/TimeUtils;->getDaysFromMillis(J)I
|
|
|
|
move-result p2
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-lez p2, :cond_2
|
|
|
|
const v0, 0x7f100030
|
|
|
|
new-array v1, v3, [Ljava/lang/Object;
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
invoke-virtual {p1, v0, p2, v1}, Landroid/content/res/Resources;->getQuantityString(II[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "resources.getQuantityStr\u2026days, daysAway, daysAway)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_2
|
|
sget-object p2, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
|
|
|
|
invoke-virtual {p2, v0, v1}, Lcom/discord/utilities/time/TimeUtils;->getHoursFromMillis(J)I
|
|
|
|
move-result p2
|
|
|
|
int-to-long v4, p2
|
|
|
|
const-wide/32 v6, 0x36ee80
|
|
|
|
mul-long v4, v4, v6
|
|
|
|
sub-long/2addr v0, v4
|
|
|
|
sget-object v4, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
|
|
|
|
invoke-virtual {v4, v0, v1}, Lcom/discord/utilities/time/TimeUtils;->getMinutesFromMillis(J)I
|
|
|
|
move-result v4
|
|
|
|
int-to-long v5, v4
|
|
|
|
const-wide/32 v7, 0xea60
|
|
|
|
mul-long v5, v5, v7
|
|
|
|
sub-long/2addr v0, v5
|
|
|
|
sget-object v5, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
|
|
|
|
invoke-virtual {v5, v0, v1}, Lcom/discord/utilities/time/TimeUtils;->getSecondsFromMillis(J)I
|
|
|
|
move-result v0
|
|
|
|
if-ltz p2, :cond_4
|
|
|
|
if-ltz v4, :cond_4
|
|
|
|
if-gez v0, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
const v1, 0x7f12062e
|
|
|
|
const/4 v5, 0x3
|
|
|
|
new-array v5, v5, [Ljava/lang/Object;
|
|
|
|
new-array v6, v3, [Ljava/lang/Object;
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p2
|
|
|
|
aput-object p2, v6, v2
|
|
|
|
const-string p2, "%02d"
|
|
|
|
const-string v7, "java.lang.String.format(format, *args)"
|
|
|
|
invoke-static {v6, v3, p2, v7}, Lf/e/c/a/a;->B([Ljava/lang/Object;ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
aput-object v6, v5, v2
|
|
|
|
new-array v6, v3, [Ljava/lang/Object;
|
|
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v4
|
|
|
|
aput-object v4, v6, v2
|
|
|
|
invoke-static {v6, v3, p2, v7}, Lf/e/c/a/a;->B([Ljava/lang/Object;ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
aput-object v4, v5, v3
|
|
|
|
const/4 v4, 0x2
|
|
|
|
new-array v6, v3, [Ljava/lang/Object;
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
aput-object v0, v6, v2
|
|
|
|
invoke-static {v6, v3, p2, v7}, Lf/e/c/a/a;->B([Ljava/lang/Object;ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
aput-object p2, v5, v4
|
|
|
|
invoke-virtual {p1, v1, v5}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "resources.getString(\n \u2026%02d\", secondsAway)\n )"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_4
|
|
:goto_1
|
|
const p2, 0x7f121699
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "resources.getString(R.st\u2026icker_pack_expiring_soon)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final getStickerPackPremiumPriceLabel(Landroid/content/Context;Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Ljava/lang/CharSequence;
|
|
.locals 12
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "stickerPack"
|
|
|
|
invoke-static {p2, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "currentPremiumTier"
|
|
|
|
invoke-static {p3, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->NONE:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eq p3, v0, :cond_1
|
|
|
|
invoke-direct {p0, p2, v0}, Lcom/discord/utilities/dsti/StickerUtils;->getStickerPackPriceForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, p2, p3}, Lcom/discord/utilities/dsti/StickerUtils;->getStickerPackPriceForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
invoke-static {v0, v3}, Ly/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
xor-int/2addr v4, v2
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2, p1}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getFormattedPrice(ILandroid/content/Context;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p3
|
|
|
|
const v0, 0x7f060291
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
const p3, 0x7f12168b
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
aput-object p2, v2, v1
|
|
|
|
invoke-virtual {p1, p3, v2}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const-string p2, "context.getString(R.stri\u2026d, formattedRegularPrice)"
|
|
|
|
invoke-static {v4, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-static {p1, v0}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v6
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/16 v8, 0x14
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object v3, p1
|
|
|
|
invoke-static/range {v3 .. v9}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown$default(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p3
|
|
|
|
invoke-static {p3, p1}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getFormattedPrice(ILandroid/content/Context;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p3
|
|
|
|
const v3, 0x7f12168d
|
|
|
|
const/4 v4, 0x2
|
|
|
|
new-array v4, v4, [Ljava/lang/Object;
|
|
|
|
aput-object p3, v4, v1
|
|
|
|
aput-object p2, v4, v2
|
|
|
|
invoke-virtual {p1, v3, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
const-string p2, "context.getString(\n \u2026egularPrice\n )"
|
|
|
|
invoke-static {v6, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v7, 0x0
|
|
|
|
invoke-static {p1, v0}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v8
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/16 v10, 0x14
|
|
|
|
const/4 v11, 0x0
|
|
|
|
move-object v5, p1
|
|
|
|
invoke-static/range {v5 .. v11}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown$default(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
invoke-virtual {p0, p2, p3}, Lcom/discord/utilities/dsti/StickerUtils;->isStickerPackFreeForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
const p2, 0x7f12167d
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "context.getString(R.stri\u2026.sticker_pack_price_free)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_2
|
|
sget-object v0, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_1:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
invoke-virtual {p0, p2, v0}, Lcom/discord/utilities/dsti/StickerUtils;->isStickerPackFreeForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
sget-object v0, Lcom/discord/utilities/premium/PremiumUtils;->INSTANCE:Lcom/discord/utilities/premium/PremiumUtils;
|
|
|
|
sget-object v3, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_1:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
invoke-virtual {v0, p3, v3}, Lcom/discord/utilities/premium/PremiumUtils;->isPremiumTierAtLeast(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
const p2, 0x7f12167e
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "context.getString(R.stri\u2026free_with_premium_tier_1)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_3
|
|
sget-object v0, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_2:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
invoke-virtual {p0, p2, v0}, Lcom/discord/utilities/dsti/StickerUtils;->isStickerPackFreeForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
sget-object p2, Lcom/discord/utilities/premium/PremiumUtils;->INSTANCE:Lcom/discord/utilities/premium/PremiumUtils;
|
|
|
|
sget-object v0, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_2:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
invoke-virtual {p2, p3, v0}, Lcom/discord/utilities/premium/PremiumUtils;->isPremiumTierAtLeast(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Z
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_4
|
|
|
|
const p2, 0x7f12167f
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "context.getString(R.stri\u2026free_with_premium_tier_2)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_4
|
|
sget-object p2, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_2:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
invoke-virtual {p0, p2}, Lcom/discord/utilities/dsti/StickerUtils;->getStickerPackPrice(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2, p1}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getFormattedPrice(ILandroid/content/Context;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p2
|
|
|
|
sget-object v0, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_2:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
if-ne p3, v0, :cond_5
|
|
|
|
goto :goto_0
|
|
|
|
:cond_5
|
|
const p3, 0x7f12169d
|
|
|
|
new-array v0, v2, [Ljava/lang/Object;
|
|
|
|
aput-object p2, v0, v1
|
|
|
|
invoke-virtual {p1, p3, v0}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const-string p1, "context.getString(R.stri\u2026m_tier_2, formattedPrice)"
|
|
|
|
invoke-static {p2, p1}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:goto_0
|
|
return-object p2
|
|
.end method
|
|
|
|
.method public final getStickerPackPrice(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)I
|
|
.locals 1
|
|
|
|
const-string v0, "premiumTier"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result p1
|
|
|
|
const/4 v0, 0x2
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/16 p1, 0x12b
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/16 p1, 0xc7
|
|
|
|
:goto_0
|
|
return p1
|
|
.end method
|
|
|
|
.method public final getStickerPackPriceLabel(Landroid/content/Context;Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "stickerPack"
|
|
|
|
invoke-static {p2, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "currentPremiumTier"
|
|
|
|
invoke-static {p3, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0, p2, p3}, Lcom/discord/utilities/dsti/StickerUtils;->isStickerPackFreeForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const p2, 0x7f12167d
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "context.getString(R.stri\u2026.sticker_pack_price_free)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
invoke-virtual {p2}, Lcom/discord/models/sticker/dto/ModelStickerPack;->isPremiumPack()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
const p2, 0x7f12167f
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "context.getString(R.stri\u2026free_with_premium_tier_2)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
invoke-virtual {p0, p3}, Lcom/discord/utilities/dsti/StickerUtils;->getStickerPackPrice(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2, p1}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getFormattedPrice(ILandroid/content/Context;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final isStickerPackFreeForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Z
|
|
.locals 3
|
|
|
|
const-string v0, "stickerPack"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "premiumTier"
|
|
|
|
invoke-static {p2, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;->TIER_2:Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-ne p2, v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelStickerPack;->isPremiumPack()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/utilities/dsti/StickerUtils;->getStickerPackPriceForPremiumTier(Lcom/discord/models/sticker/dto/ModelStickerPack;Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
:goto_1
|
|
const/4 p1, 0x0
|
|
|
|
:goto_2
|
|
if-nez v0, :cond_4
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
const/4 v1, 0x0
|
|
|
|
:cond_4
|
|
:goto_3
|
|
return v1
|
|
.end method
|
|
|
|
.method public final isStickerPackNew(JLcom/discord/stores/StoreStickers$ViewedPurchaseablePacks;J)Z
|
|
.locals 2
|
|
|
|
const-string/jumbo v0, "viewedPurchaseableStickerPackIds"
|
|
|
|
invoke-static {p3, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p3}, Lcom/discord/stores/StoreStickers$ViewedPurchaseablePacks;->getStickerPackIds()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p3}, Lcom/discord/stores/StoreStickers$ViewedPurchaseablePacks;->isFirstTimeViewing()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p3}, Lcom/discord/stores/StoreStickers$ViewedPurchaseablePacks;->getDate()J
|
|
|
|
move-result-wide p1
|
|
|
|
cmp-long p3, p1, p4
|
|
|
|
if-ltz p3, :cond_1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
return p1
|
|
.end method
|
|
|
|
.method public final isStoreListingExpiringSoon(Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;JLcom/discord/utilities/time/Clock;)Z
|
|
.locals 6
|
|
|
|
const-string v0, "clock"
|
|
|
|
invoke-static {p4, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;->getUnpublishedAtDate()J
|
|
|
|
move-result-wide v1
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
cmp-long v5, v1, v3
|
|
|
|
if-nez v5, :cond_1
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Lcom/discord/models/sticker/dto/ModelStickerPackStoreListing;->getUnpublishedAtDate()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-interface {p4}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
|
|
|
|
move-result-wide v3
|
|
|
|
add-long/2addr v3, p2
|
|
|
|
cmp-long p1, v1, v3
|
|
|
|
if-gtz p1, :cond_2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:cond_2
|
|
return v0
|
|
.end method
|
|
|
|
.method public final parseFromMessageNotificationJson(Ljava/lang/String;)Lcom/discord/models/sticker/dto/ModelSticker;
|
|
.locals 13
|
|
|
|
const-string/jumbo v0, "tags"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
:try_start_0
|
|
new-instance v2, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v2, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string p1, "stickers"
|
|
|
|
invoke-virtual {v2, p1}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p1, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v2, "JSONObject(data).getJSON\u2026ickers\").getJSONObject(0)"
|
|
|
|
invoke-static {p1, v2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
:try_start_1
|
|
new-instance v2, Lcom/discord/models/sticker/dto/ModelSticker;
|
|
|
|
const-string v3, "id"
|
|
|
|
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
|
|
|
|
move-result-wide v4
|
|
|
|
const-string v3, "pack_id"
|
|
|
|
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
|
|
|
|
move-result-wide v6
|
|
|
|
const-string v3, "name"
|
|
|
|
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
const-string v3, "jsonSticker.getString(\"name\")"
|
|
|
|
invoke-static {v8, v3}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v3, "description"
|
|
|
|
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v9
|
|
|
|
const-string v3, "jsonSticker.getString(\"description\")"
|
|
|
|
invoke-static {v9, v3}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v3, "asset"
|
|
|
|
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
const-string v3, "format_type"
|
|
|
|
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
move-object v12, p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object v12, v1
|
|
|
|
:goto_0
|
|
move-object v3, v2
|
|
|
|
invoke-direct/range {v3 .. v12}, Lcom/discord/models/sticker/dto/ModelSticker;-><init>(JJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
move-object v1, v2
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
move-object v4, p1
|
|
|
|
sget-object v2, Lcom/discord/app/AppLog;->e:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x4
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const-string v3, "Error parsing sticker from notification"
|
|
|
|
invoke-static/range {v2 .. v7}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
:catch_1
|
|
:goto_1
|
|
return-object v1
|
|
.end method
|