package com.tapjoy; import android.content.Context; import android.content.SharedPreferences; import java.util.List; import java.util.Map; import kotlin.TuplesKt; import kotlin.collections.CollectionsKt__CollectionsKt; import kotlin.collections.MapsKt__MapsKt; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes4.dex */ public final class TJPurchases { public static final TJPurchases INSTANCE = new TJPurchases(); public static String a; public static int b; public static double c; public static double d; public static long e; public static TJKeyValueStorage f; public final String getPurchaseCurrency() { String str = a; return str == null ? "" : str; } public final Double getPurchaseLastPrice() { double d2 = d; if (d2 > 0.0d) { return Double.valueOf(d2); } return null; } public final Long getPurchaseLastTime() { long j = e; if (j > 0) { return Long.valueOf(j); } return null; } public final Integer getPurchaseTotalCount() { int i = b; if (i > 0) { return Integer.valueOf(i); } return null; } public final Double getPurchaseTotalPrice() { double d2 = c; if (d2 > 0.0d) { return Double.valueOf(d2); } return null; } public final void setContext(Context context) { Map mapOf; List listOf; TJKeyValueStorage tJKeyValueStorage; TJKeyValueStorage tJKeyValueStorage2; TJKeyValueStorage tJKeyValueStorage3; TJKeyValueStorage tJKeyValueStorage4; TJKeyValueStorage tJKeyValueStorage5; if (context != null) { TJKeyValueStorage tJKeyValueStorage6 = new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE); f = tJKeyValueStorage6; SharedPreferences sharedPreferences = context.getSharedPreferences("fiverocks", 0); Intrinsics.checkNotNullExpressionValue(sharedPreferences, "getSharedPreferences(...)"); mapOf = MapsKt__MapsKt.mapOf(TuplesKt.to("ptc", "pref_purchase_currency"), TuplesKt.to("pc", "pref_purchase_total_count"), TuplesKt.to("ptp", "pref_purchase_total_price"), TuplesKt.to("plp", "pref_purchase_last_price"), TuplesKt.to("lpt", "pref_purchase_last_time")); listOf = CollectionsKt__CollectionsKt.listOf((Object[]) new String[]{"ptp", "plp"}); new TJPreferencesMigration(tJKeyValueStorage6, sharedPreferences, mapOf, listOf).migrateAllKeysIfExists(); INSTANCE.getClass(); TJKeyValueStorage tJKeyValueStorage7 = f; if (tJKeyValueStorage7 != null) { a = tJKeyValueStorage7.getString("pref_purchase_currency", null); b = tJKeyValueStorage7.getInt("pref_purchase_total_count", 0); c = tJKeyValueStorage7.getDouble("pref_purchase_total_price", 0.0d); d = tJKeyValueStorage7.getDouble("pref_purchase_last_price", 0.0d); e = tJKeyValueStorage7.getLong("pref_purchase_last_time", 0L); } String str = a; if (str != null && str.length() != 0 && (tJKeyValueStorage5 = f) != null) { tJKeyValueStorage5.setValue("pref_purchase_currency", a); } int i = b; if (i > 0 && (tJKeyValueStorage4 = f) != null) { tJKeyValueStorage4.setValue("pref_purchase_total_count", Integer.valueOf(i)); } double d2 = c; if (d2 > 0.0d && (tJKeyValueStorage3 = f) != null) { tJKeyValueStorage3.setValue("pref_purchase_total_price", Double.valueOf(d2)); } double d3 = d; if (d3 > 0.0d && (tJKeyValueStorage2 = f) != null) { tJKeyValueStorage2.setValue("pref_purchase_last_price", Double.valueOf(d3)); } long j = e; if (j > 0 && (tJKeyValueStorage = f) != null) { tJKeyValueStorage.setValue("pref_purchase_last_time", Long.valueOf(j)); } } } /* JADX WARN: Code restructure failed: missing block: B:13:0x0023, code lost: if (r3 == null) goto L13; */ /* JADX WARN: Code restructure failed: missing block: B:23:0x0052, code lost: if (r3 == null) goto L26; */ /* JADX WARN: Code restructure failed: missing block: B:6:0x0014, code lost: if (r2.length() == 0) goto L16; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void trackPurchase(java.lang.String r17, java.lang.Double r18) { /* Method dump skipped, instructions count: 251 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJPurchases.trackPurchase(java.lang.String, java.lang.Double):void"); } }