discord-jadx/app/src/main/java/com/discord/utilities/billing/GooglePlaySku.java

279 lines
12 KiB
Java

package com.discord.utilities.billing;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;
import com.discord.api.premium.SubscriptionInterval;
import d0.d0.f;
import d0.t.g0;
import d0.z.d.m;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import kotlin.NoWhenBranchMatchedException;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: GooglePlaySku.kt */
/* JADX WARN: Init of enum PREMIUM_TIER_2_YEARLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_1_YEARLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_1_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_1_YEARLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_1_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_2_YEARLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_2_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_3_YEARLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_3_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_5_YEARLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_5_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_10_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_13_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_2_PREMIUM_GUILD_28_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_1_PREMIUM_GUILD_1_YEARLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_TIER_1_PREMIUM_GUILD_1_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_GUILD_1_MONTHLY can be incorrect */
/* JADX WARN: Init of enum PREMIUM_GUILD_2_MONTHLY can be incorrect */
public enum GooglePlaySku {
PREMIUM_TIER_2_YEARLY("premium_tier_2_yearly", 2131231853, r14, null, 2, r15, 8, null),
PREMIUM_TIER_2_MONTHLY("premium_tier_2_monthly", 2131231853, r14, r13, 2, r18),
PREMIUM_TIER_1_YEARLY("premium_tier_1_yearly", 2131231850, r14, null, 0, r15, 8, null),
PREMIUM_TIER_1_MONTHLY("premium_tier_1_monthly", 2131231850, r14, r13, 0, r18),
PREMIUM_TIER_2_PREMIUM_GUILD_1_YEARLY("premium_tier_2_premium_guild_1_yearly", 2131231841, r14, null, 3, r15, 8, null),
PREMIUM_TIER_2_PREMIUM_GUILD_1_MONTHLY("premium_tier_2_premium_guild_1_monthly", 2131231841, r14, r13, 3, r18),
PREMIUM_TIER_2_PREMIUM_GUILD_2_YEARLY("premium_tier_2_premium_guild_2_yearly", 2131231844, r14, null, 4, r15, 8, null),
PREMIUM_TIER_2_PREMIUM_GUILD_2_MONTHLY("premium_tier_2_premium_guild_2_monthly", 2131231844, r14, r13, 4, r18),
PREMIUM_TIER_2_PREMIUM_GUILD_3_YEARLY("premium_tier_2_premium_guild_3_yearly", 2131231846, r14, null, 5, r15, 8, null),
PREMIUM_TIER_2_PREMIUM_GUILD_3_MONTHLY("premium_tier_2_premium_guild_3_monthly", 2131231846, r14, r13, 5, r18),
PREMIUM_TIER_2_PREMIUM_GUILD_5_YEARLY("premium_tier_2_premium_guild_5_yearly", 2131231847, r14, null, 7, r15, 8, null),
PREMIUM_TIER_2_PREMIUM_GUILD_5_MONTHLY("premium_tier_2_premium_guild_5_monthly", 2131231847, r14, r13, 7, r18),
PREMIUM_TIER_2_PREMIUM_GUILD_10_MONTHLY("premium_tier_2_premium_guild_10_monthly", 2131231842, r14, null, 12, r18, 8, null),
PREMIUM_TIER_2_PREMIUM_GUILD_13_MONTHLY("premium_tier_2_premium_guild_13_monthly", 2131231843, r14, null, 15, r18, 8, null),
PREMIUM_TIER_2_PREMIUM_GUILD_28_MONTHLY("premium_tier_2_premium_guild_28_monthly", 2131231845, r14, null, 30, r18, 8, null),
PREMIUM_TIER_1_PREMIUM_GUILD_1_YEARLY("premium_tier_1_premium_guild_1_yearly", 2131231851, r14, null, 1, r15, 8, null),
PREMIUM_TIER_1_PREMIUM_GUILD_1_MONTHLY("premium_tier_1_premium_guild_1_monthly", 2131231851, r14, r13, 1, r18),
PREMIUM_GUILD_1_MONTHLY("premium_guild_1_monthly", 2131231848, r13, r17, 1, r18),
PREMIUM_GUILD_2_MONTHLY("premium_guild_2_monthly", 2131231849, r13, r17, 2, r18);
private static final List<String> ALL_SKU_NAMES;
public static final Companion Companion = new Companion(null);
private static final Map<String, GooglePlaySku> skusBySkuName;
private final int iconDrawableResId;
private final SubscriptionInterval interval;
private final int premiumSubscriptionCount;
private final String skuName;
private final Type type;
private final GooglePlaySku upgrade;
/* compiled from: GooglePlaySku.kt */
public static final class Companion {
public final /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
Type.values();
int[] iArr = new int[5];
$EnumSwitchMapping$0 = iArr;
iArr[Type.PREMIUM_TIER_2.ordinal()] = 1;
iArr[Type.PREMIUM_TIER_1.ordinal()] = 2;
iArr[Type.PREMIUM_GUILD.ordinal()] = 3;
iArr[Type.PREMIUM_TIER_2_AND_PREMIUM_GUILD.ordinal()] = 4;
iArr[Type.PREMIUM_TIER_1_AND_PREMIUM_GUILD.ordinal()] = 5;
}
}
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final GooglePlaySku fromSkuName(String str) {
m.checkNotNullParameter(str, "skuName");
return (GooglePlaySku) GooglePlaySku.access$getSkusBySkuName$cp().get(str);
}
public final List<String> getALL_SKU_NAMES() {
return GooglePlaySku.access$getALL_SKU_NAMES$cp();
}
@DrawableRes
public final int getBorderResource(Type type) {
m.checkNotNullParameter(type, "skuType");
int ordinal = type.ordinal();
if (ordinal == 0) {
return 2131231022;
}
if (ordinal == 1) {
return 2131231020;
}
if (ordinal == 2) {
return 2131231029;
}
if (ordinal == 3) {
return 2131231028;
}
if (ordinal == 4) {
return 2131231026;
}
throw new NoWhenBranchMatchedException();
}
public final GooglePlaySku getDowngrade(String str) {
m.checkNotNullParameter(str, "skuName");
GooglePlaySku[] values = GooglePlaySku.values();
int i = 0;
while (true) {
String str2 = null;
if (i >= 19) {
return null;
}
GooglePlaySku googlePlaySku = values[i];
GooglePlaySku upgrade = googlePlaySku.getUpgrade();
if (upgrade != null) {
str2 = upgrade.getSkuName();
}
if (m.areEqual(str2, str)) {
return googlePlaySku;
}
i++;
}
}
}
/* compiled from: GooglePlaySku.kt */
public enum Section {
PREMIUM,
PREMIUM_AND_PREMIUM_GUILD,
PREMIUM_GUILD;
public static final Companion Companion = new Companion(null);
/* compiled from: GooglePlaySku.kt */
public static final class Companion {
public final /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
Section.values();
int[] iArr = new int[3];
$EnumSwitchMapping$0 = iArr;
iArr[Section.PREMIUM.ordinal()] = 1;
iArr[Section.PREMIUM_AND_PREMIUM_GUILD.ordinal()] = 2;
iArr[Section.PREMIUM_GUILD.ordinal()] = 3;
}
}
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
@StringRes
public final int getHeaderResource(Section section) {
m.checkNotNullParameter(section, "section");
int ordinal = section.ordinal();
if (ordinal == 0) {
return 2131886944;
}
if (ordinal == 1) {
return 2131886940;
}
if (ordinal == 2) {
return 2131886943;
}
throw new NoWhenBranchMatchedException();
}
}
}
/* compiled from: GooglePlaySku.kt */
public enum Type {
PREMIUM_TIER_2,
PREMIUM_TIER_1,
PREMIUM_TIER_2_AND_PREMIUM_GUILD,
PREMIUM_TIER_1_AND_PREMIUM_GUILD,
PREMIUM_GUILD
}
static {
Type type = Type.PREMIUM_TIER_2;
SubscriptionInterval subscriptionInterval = SubscriptionInterval.YEARLY;
GooglePlaySku googlePlaySku = PREMIUM_TIER_2_YEARLY;
SubscriptionInterval subscriptionInterval2 = SubscriptionInterval.MONTHLY;
GooglePlaySku googlePlaySku2 = PREMIUM_TIER_2_MONTHLY;
Type type2 = Type.PREMIUM_TIER_1;
GooglePlaySku googlePlaySku3 = PREMIUM_TIER_1_YEARLY;
Type type3 = Type.PREMIUM_TIER_2_AND_PREMIUM_GUILD;
GooglePlaySku googlePlaySku4 = PREMIUM_TIER_2_PREMIUM_GUILD_1_YEARLY;
GooglePlaySku googlePlaySku5 = PREMIUM_TIER_2_PREMIUM_GUILD_2_YEARLY;
GooglePlaySku googlePlaySku6 = PREMIUM_TIER_2_PREMIUM_GUILD_3_YEARLY;
GooglePlaySku googlePlaySku7 = PREMIUM_TIER_2_PREMIUM_GUILD_5_YEARLY;
Type type4 = Type.PREMIUM_TIER_1_AND_PREMIUM_GUILD;
GooglePlaySku googlePlaySku8 = PREMIUM_TIER_1_PREMIUM_GUILD_1_YEARLY;
Type type5 = Type.PREMIUM_GUILD;
GooglePlaySku[] values = values();
ArrayList arrayList = new ArrayList(19);
for (int i = 0; i < 19; i++) {
arrayList.add(values[i].skuName);
}
ALL_SKU_NAMES = arrayList;
GooglePlaySku[] values2 = values();
LinkedHashMap linkedHashMap = new LinkedHashMap(f.coerceAtLeast(g0.mapCapacity(19), 16));
for (int i2 = 0; i2 < 19; i2++) {
GooglePlaySku googlePlaySku9 = values2[i2];
linkedHashMap.put(googlePlaySku9.skuName, googlePlaySku9);
}
skusBySkuName = linkedHashMap;
}
private GooglePlaySku(String str, @DrawableRes int i, Type type, GooglePlaySku googlePlaySku, int i2, SubscriptionInterval subscriptionInterval) {
this.skuName = str;
this.iconDrawableResId = i;
this.type = type;
this.upgrade = googlePlaySku;
this.premiumSubscriptionCount = i2;
this.interval = subscriptionInterval;
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ GooglePlaySku(String str, int i, Type type, GooglePlaySku googlePlaySku, int i2, SubscriptionInterval subscriptionInterval, int i3, DefaultConstructorMarker defaultConstructorMarker) {
this(str, i, type, (i3 & 8) != 0 ? null : googlePlaySku, i2, subscriptionInterval);
}
public static final /* synthetic */ List access$getALL_SKU_NAMES$cp() {
return ALL_SKU_NAMES;
}
public static final /* synthetic */ Map access$getSkusBySkuName$cp() {
return skusBySkuName;
}
public final int getIconDrawableResId() {
return this.iconDrawableResId;
}
public final SubscriptionInterval getInterval() {
return this.interval;
}
public final int getPremiumSubscriptionCount() {
return this.premiumSubscriptionCount;
}
public final String getSkuName() {
return this.skuName;
}
public final Type getType() {
return this.type;
}
public final GooglePlaySku getUpgrade() {
return this.upgrade;
}
}