163 lines
4.1 KiB
Smali
163 lines
4.1 KiB
Smali
.class public final Lcom/discord/utilities/nitro/NitroUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "NitroUtils.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/nitro/NitroUtils;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/nitro/NitroUtils;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/nitro/NitroUtils;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/nitro/NitroUtils;->INSTANCE:Lcom/discord/utilities/nitro/NitroUtils;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getNitroGiftIcon(Lcom/discord/models/domain/ModelGift;)I
|
|
.locals 1
|
|
|
|
const-string v0, "gift"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGift;->getStoreListing()Lcom/discord/models/domain/ModelStoreListing;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelStoreListing;->getSku()Lcom/discord/models/domain/ModelSku;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelSku;->getSkuCategory()Lcom/discord/models/domain/ModelSku$SkuCategory;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Lcom/discord/utilities/nitro/NitroUtils$WhenMappings;->$EnumSwitchMapping$0:[I
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelSku$SkuCategory;->ordinal()I
|
|
|
|
move-result p1
|
|
|
|
aget p1, v0, p1
|
|
|
|
packed-switch p1, :pswitch_data_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
:pswitch_0
|
|
const p1, 0x7f0800f8
|
|
|
|
return p1
|
|
|
|
:pswitch_1
|
|
const p1, 0x7f0800f9
|
|
|
|
return p1
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_1
|
|
:pswitch_0
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method public final isAcceptableNitroGift(Lcom/discord/models/domain/ModelUser;Lcom/discord/models/domain/ModelGift;)Z
|
|
.locals 3
|
|
|
|
const-string v0, "user"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "gift"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelGift;->isAnyNitroGift()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->getPremiumType()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
:cond_0
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelGift;->getStoreListing()Lcom/discord/models/domain/ModelStoreListing;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelStoreListing;->getSku()Lcom/discord/models/domain/ModelSku;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSku;->getSkuCategory()Lcom/discord/models/domain/ModelSku$SkuCategory;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v2, Lcom/discord/models/domain/ModelSku$SkuCategory;->NITRO_CLASSIC:Lcom/discord/models/domain/ModelSku$SkuCategory;
|
|
|
|
if-ne v0, v2, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->getPremiumType()I
|
|
|
|
move-result v0
|
|
|
|
if-eq v0, v1, :cond_2
|
|
|
|
:cond_1
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelGift;->getStoreListing()Lcom/discord/models/domain/ModelStoreListing;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelStoreListing;->getSku()Lcom/discord/models/domain/ModelSku;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelSku;->getSkuCategory()Lcom/discord/models/domain/ModelSku$SkuCategory;
|
|
|
|
move-result-object p2
|
|
|
|
sget-object v0, Lcom/discord/models/domain/ModelSku$SkuCategory;->NITRO:Lcom/discord/models/domain/ModelSku$SkuCategory;
|
|
|
|
if-ne p2, v0, :cond_3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->getPremiumType()I
|
|
|
|
move-result p1
|
|
|
|
const/4 p2, 0x2
|
|
|
|
if-ne p1, p2, :cond_3
|
|
|
|
:cond_2
|
|
return v1
|
|
|
|
:cond_3
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|