导航菜单

页面标题

页面副标题

Crafto v9.3.3 - PreferencesHelperUsa.java 源代码

正在查看: Crafto v9.3.3 应用的 PreferencesHelperUsa.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.crafto.android.usa.utility;

import C1.e;
import Eb.J0;
import Ng.Z;
import Q9.m;
import Xf.j;
import Xf.k;
import android.content.SharedPreferences;
import android.net.Uri;
import com.crafto.android.ui.app_launch_payment.l;
import com.crafto.android.usa.data.model.Community;
import com.crafto.android.usa.data.model.GeneralConfiguration;
import com.crafto.android.usa.data.model.InitData;
import com.crafto.android.usa.data.model.MembershipData;
import com.crafto.android.usa.data.model.MembershipPlanDetails;
import com.crafto.android.usa.data.model.PostMedia;
import com.crafto.android.usa.data.model.QuoteData;
import com.crafto.android.usa.data.model.QuotesSupportData;
import com.crafto.android.usa.data.model.Translations;
import com.crafto.android.usa.data.model.UserAdditionalData;
import com.crafto.android.usa.data.model.UserConfigData;
import com.crafto.android.usa.data.model.UserUsa;
import com.crafto.android.usa.data.model.Widget;
import com.crafto.android.usa.data.model.membership.MembsershipDetailsData;
import com.crafto.android.usa.data.model.notification.NotificationPermissionData;
import com.crafto.android.usa.data.model.quotes.QuotesCategory;
import com.crafto.android.usa.utility.a;
import com.crafto.android.utility.PreferencesHelper;
import com.google.gson.i;
import com.google.gson.reflect.TypeToken;
import com.razorpay.ApplicationDetails;
import do.a;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import org.jetbrains.annotations.NotNull;

@SourceDebugExtension({"SMAP\nPreferencesHelperUsa.kt\nKotlin\n*S Kotlin\n*F\n+ 1 PreferencesHelperUsa.kt\ncom/crafto/android/usa/utility/PreferencesHelperUsa\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,1705:1\n1#2:1706\n*E\n"})
public final class PreferencesHelperUsa {

    @NotNull
    public final String f21080A;

    @NotNull
    public final String f21081B;

    @NotNull
    public final String f21082C;

    @NotNull
    public final String f21083D;

    @NotNull
    public final String f21084E;

    @NotNull
    public final String f21085F;

    @NotNull
    public final String f21086G;

    @NotNull
    public final String f21087H;

    @NotNull
    public final SharedPreferences f21088a;

    @NotNull
    public final i f21089b;

    public PreferencesHelper f21090c;

    @NotNull
    public final String d;

    @NotNull
    public final String f21091e;

    @NotNull
    public final String f21092f;

    @NotNull
    public final String f21093g;

    @NotNull
    public final String f21094h;

    @NotNull
    public final String f21095i;

    @NotNull
    public final String f21096j;

    @NotNull
    public final String f21097k;

    @NotNull
    public final String f21098l;

    @NotNull
    public final String f21099m;

    @NotNull
    public final String f21100n;

    @NotNull
    public final String f21101o;

    @NotNull
    public final String f21102p;

    @NotNull
    public final String f21103q;

    @NotNull
    public final String f21104r;

    @NotNull
    public final String f21105s;

    @NotNull
    public final String f21106t;

    @NotNull
    public final String f21107u;

    @NotNull
    public final String f21108v;

    @NotNull
    public final String f21109w;

    @NotNull
    public final String f21110x;

    @NotNull
    public final String f21111y;

    @NotNull
    public final String f21112z;

    public PreferencesHelperUsa(@NotNull SharedPreferences sharedPreferences, @NotNull i iVar) {
        Intrinsics.checkNotNullParameter(sharedPreferences, "sharedPreferences");
        Intrinsics.checkNotNullParameter(iVar, "gson");
        this.f21088a = sharedPreferences;
        this.f21089b = iVar;
        int i7 = a.b.f21199a;
        this.d = "in_app_rate_sheet_shown";
        this.f21091e = "isFilterImageUploaded";
        this.f21092f = "homeContactStripShowCount";
        this.f21093g = "sessionLocalCountContactConnect";
        this.f21094h = "setSubscribeEventSent";
        this.f21095i = "timezoneEventSent";
        this.f21096j = "dayOfYear";
        this.f21097k = "notificationTags";
        this.f21098l = "membershipExpiredPopupLastShownDate";
        this.f21099m = "razorpayUpiApps";
        this.f21100n = "razorpayUpiAutopayApps";
        this.f21101o = "phonepeVersionCode";
        this.f21102p = "selectedImageUri";
        this.f21103q = "showScrollingPreview";
        this.f21104r = "tempSelectedCountry";
        this.f21105s = "isRedirectionFromDeeplink";
        this.f21106t = "wasFirstLaunchRemoveBgBitmapDialogShown";
        this.f21107u = "notificationsPermissionsData";
        this.f21108v = "configurationData";
        this.f21109w = "launchConfigurationData";
        this.f21110x = "pratyashiData";
        this.f21111y = "IsPoliticalPratyashiExp";
        this.f21112z = "deepLink";
        this.f21080A = "onboardingRemoveBackgroundPopupBeforePremium";
        this.f21081B = "generalConfigurationData";
        this.f21082C = "quoteCategorySelectionData";
        this.f21083D = "translations";
        this.f21084E = "notifDialogDisplayCount";
        this.f21085F = "searchTerm";
        this.f21086G = "hideGooglePlayWarningScreen";
        this.f21087H = "holiPersonalityUrl";
    }

    public final void A(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "parameterValue");
        Xf.i.b(this.f21088a, "countryName", str);
    }

    public final void B(String str) {
        do.a.a.c(e.a("setReferralLink ", str), new Object[0]);
        if (str == null || str.length() <= 0) {
            return;
        }
        Xf.i.b(this.f21088a, "keyFacebookAppLinkTargetUri", str);
    }

    public final void C() {
        this.f21088a.edit().putBoolean(this.f21091e, true).apply();
    }

    public final void D(boolean z7) {
        do.a.a.c(Z.c("setIsRedirectionFromDeeplink ", z7), new Object[0]);
        this.f21088a.edit().putBoolean(this.f21105s, z7).apply();
    }

    public final void E(long j7) {
        this.f21088a.edit().putLong("last_grp_msg_del_time", j7).apply();
    }

    public final void F(int i7) {
        j.c(this.f21088a, "paymentStatusStripDismissCount", i7);
    }

    public final void G(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "parameterValue");
        do.a.a.c("setLocale ".concat(str), new Object[0]);
        Xf.i.b(this.f21088a, "default_locale", str);
    }

    public final void H(MembsershipDetailsData membsershipDetailsData) {
        SharedPreferences sharedPreferences = this.f21088a;
        try {
            if (membsershipDetailsData != null) {
                sharedPreferences.edit().putString("membershipData", this.f21089b.h(membsershipDetailsData)).apply();
            } else {
                sharedPreferences.edit().putString("membershipData", null).apply();
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
    }

    public final void I(NotificationPermissionData notificationPermissionData) {
        if (i() == null) {
            this.f21088a.edit().putString(this.f21107u, this.f21089b.h(notificationPermissionData)).apply();
        }
    }

    public final void J(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "url");
        Xf.i.b(this.f21088a, "mOnboardingPaymentPageBgUrl", str);
    }

    public final void K(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "type");
        Xf.i.b(this.f21088a, "mOnboardingPaymentPageUrlType", str);
    }

    public final void L(String str) {
        do.a.a.c(e.a("setReferralLink ", str), new Object[0]);
        if (str != null) {
            Xf.i.b(this.f21088a, "referrallink", str);
        }
    }

    public final void M(MembershipPlanDetails membershipPlanDetails) {
        SharedPreferences sharedPreferences = this.f21088a;
        try {
            if (membershipPlanDetails != null) {
                sharedPreferences.edit().putString("selectedPlan", this.f21089b.h(membershipPlanDetails)).apply();
            } else {
                sharedPreferences.edit().putString("selectedPlan", null).apply();
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
    }

    public final void N() {
        k.b(this.f21088a, "showCaptionTutorial", false);
    }

    public final void O(boolean z7) {
        this.f21088a.edit().putBoolean(this.d, z7).apply();
    }

    public final void P(UserUsa userUsa) {
        ArrayList businessImages;
        UserAdditionalData userBusinessData;
        ArrayList businessImages2;
        String country;
        do.a.a.c(l.a(userUsa, "mytag setSignedInUser #2 "), new Object[0]);
        if (userUsa != null) {
            try {
                UserAdditionalData userBusinessData2 = userUsa.getUserBusinessData();
                if (userBusinessData2 != null && (businessImages = userBusinessData2.getBusinessImages()) != null) {
                    ListIterator listIterator = businessImages.listIterator();
                    Intrinsics.checkNotNullExpressionValue(listIterator, "listIterator(...)");
                    while (listIterator.hasNext()) {
                        Object next = listIterator.next();
                        Intrinsics.checkNotNullExpressionValue(next, "next(...)");
                        PostMedia postMedia = (PostMedia) next;
                        Long mediaId = postMedia.getMediaId();
                        UserAdditionalData userBusinessData3 = userUsa.getUserBusinessData();
                        if (Intrinsics.areEqual(mediaId, userBusinessData3 != null ? userBusinessData3.getSelectedBusinessImageId() : null)) {
                            postMedia.setSelected(true);
                            UserAdditionalData userBusinessData4 = userUsa.getUserBusinessData();
                            if (userBusinessData4 != null) {
                                userBusinessData4.setSelectedBusinessImage(postMedia.getMediaURL());
                            }
                            listIterator.set(postMedia);
                        }
                    }
                    UserAdditionalData userBusinessData5 = userUsa.getUserBusinessData();
                    if ((userBusinessData5 != null ? userBusinessData5.getSelectedBusinessImage() : null) == null && (userBusinessData = userUsa.getUserBusinessData()) != null && (businessImages2 = userBusinessData.getBusinessImages()) != null && businessImages2.size() > 0) {
                        UserAdditionalData userBusinessData6 = userUsa.getUserBusinessData();
                        ArrayList businessImages3 = userBusinessData6 != null ? userBusinessData6.getBusinessImages() : null;
                        Intrinsics.checkNotNull(businessImages3);
                        ((PostMedia) businessImages3.get(0)).setSelected(true);
                        UserAdditionalData userBusinessData7 = userUsa.getUserBusinessData();
                        if (userBusinessData7 != null) {
                            UserAdditionalData userBusinessData8 = userUsa.getUserBusinessData();
                            ArrayList businessImages4 = userBusinessData8 != null ? userBusinessData8.getBusinessImages() : null;
                            Intrinsics.checkNotNull(businessImages4);
                            userBusinessData7.setSelectedBusinessImage(((PostMedia) businessImages4.get(0)).getMediaURL());
                        }
                    }
                }
            } catch (Exception e8) {
                do.a.a.e(e8);
                return;
            }
        }
        if ((userUsa != null ? userUsa.getUserPersonalData() : null) == null) {
            UserUsa p7 = p();
            if ((p7 != null ? p7.getUserPersonalData() : null) != null && userUsa != null) {
                UserUsa p8 = p();
                userUsa.setUserPersonalData(p8 != null ? p8.getUserPersonalData() : null);
            }
        }
        if ((userUsa != null ? userUsa.getUserBusinessData() : null) == null) {
            UserUsa p9 = p();
            if ((p9 != null ? p9.getUserBusinessData() : null) != null && userUsa != null) {
                UserUsa p10 = p();
                userUsa.setUserBusinessData(p10 != null ? p10.getUserBusinessData() : null);
            }
        }
        UserUsa p11 = p();
        if (p11 != null && p11.isRegistered() && userUsa != null) {
            userUsa.setRegistered(true);
        }
        SharedPreferences sharedPreferences = this.f21088a;
        if (userUsa != null) {
            sharedPreferences.edit().putString("signedInUser", this.f21089b.h(userUsa)).apply();
        } else {
            sharedPreferences.edit().putString("signedInUser", null).apply();
        }
        if (userUsa == null || (country = userUsa.getCountry()) == null) {
            return;
        }
        A(country);
    }

    public final void Q(m mVar) {
        a.a aVar = do.a.a;
        aVar.c("setQuoteDataForProcessingPayment " + mVar, new Object[0]);
        try {
            String str = "";
            if (mVar instanceof QuoteData) {
                if (((QuoteData) mVar).getContentType() != null && ((QuoteData) mVar).getUrl() != null) {
                    StringBuilder sb2 = new StringBuilder("contentType_");
                    sb2.append(((QuoteData) mVar).getContentType());
                    sb2.append(" - url_");
                    sb2.append(((QuoteData) mVar).getUrl());
                    sb2.append(" - location_");
                    QuotesCategory selectedCategory = ((QuoteData) mVar).getSelectedCategory();
                    sb2.append(selectedCategory != null ? selectedCategory.getValue() : null);
                    sb2.append(" - position_");
                    sb2.append(((QuoteData) mVar).getContentListPosition());
                    str = sb2.toString();
                }
            } else if (mVar instanceof InitData) {
                Widget widget = ((InitData) mVar).getWidget();
                if ((widget != null ? widget.getData() : null) instanceof MembershipData) {
                    StringBuilder sb3 = new StringBuilder("widget_");
                    Widget widget2 = ((InitData) mVar).getWidget();
                    sb3.append(widget2 != null ? widget2.getType() : null);
                    str = sb3.toString();
                }
            }
            if (str.length() > 0) {
                aVar.c("setQuoteDataForProcessingPayment_paymentSource ".concat(str), new Object[0]);
                this.f21088a.edit().putString("sourceDataForPaymentInstrumentation_", str).apply();
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
    }

    public final void R(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "text");
        try {
            this.f21088a.edit().putString("sourceDataForPaymentInstrumentation_", str).apply();
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
    }

    public final void S(QuotesSupportData quotesSupportData) {
        do.a.a.c("setSupportData QuotesSupportData " + quotesSupportData, new Object[0]);
        SharedPreferences sharedPreferences = this.f21088a;
        try {
            if (quotesSupportData != null) {
                sharedPreferences.edit().putString("supportData", this.f21089b.h(quotesSupportData)).apply();
            } else {
                sharedPreferences.edit().putString("supportData", null).apply();
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
    }

    public final void T(int i7) {
        j.c(this.f21088a, "keyTempBucketId", i7);
    }

    public final void U(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "tag");
        a.a aVar = do.a.a;
        aVar.c("storeNotificationTag ".concat(str), new Object[0]);
        int i7 = Calendar.getInstance().get(6);
        aVar.c(J0.a(i7, "addTodayTags "), new Object[0]);
        SharedPreferences sharedPreferences = this.f21088a;
        String str2 = this.f21096j;
        int i8 = sharedPreferences.getInt(str2, -1);
        String str3 = this.f21097k;
        if (i7 != i8) {
            aVar.c(J0.a(i7, "clearStoredTagsHistory "), new Object[0]);
            sharedPreferences.edit().putInt(str2, i7).apply();
            sharedPreferences.edit().putString(str3, null).apply();
        }
        Intrinsics.checkNotNullParameter(str, "tag");
        try {
            aVar.c("setNotificationTags tag ".concat(str), new Object[0]);
            ArrayList<String> j7 = j();
            if (j7 == null) {
                j7 = new ArrayList<>();
            }
            j7.add(str);
            aVar.c("setNotificationTags " + j7, new Object[0]);
            sharedPreferences.edit().putString(str3, this.f21089b.h(j7)).apply();
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
    }

    public final void V(Uri uri) {
        if (uri != null) {
            this.f21088a.edit().putString(this.f21102p, uri.toString()).apply();
        }
    }

    @NotNull
    public final String a() {
        String string = this.f21088a.getString("appLanguage", null);
        return string != null ? string : "";
    }

    public final UserConfigData b() {
        String string = this.f21088a.getString(this.f21108v, null);
        if (string != null) {
            return (UserConfigData) this.f21089b.c(UserConfigData.class, string);
        }
        return null;
    }

    public final String c() {
        String string = this.f21088a.getString("countryName", null);
        if (string == null) {
            return null;
        }
        Locale locale = Locale.US;
        Intrinsics.checkNotNullExpressionValue(locale, "US");
        String upperCase = string.toUpperCase(locale);
        Intrinsics.checkNotNullExpressionValue(upperCase, "toUpperCase(...)");
        return upperCase;
    }

    public final GeneralConfiguration d() {
        String string = this.f21088a.getString(this.f21081B, null);
        if (string != null) {
            return (GeneralConfiguration) this.f21089b.c(GeneralConfiguration.class, string);
        }
        return null;
    }

    public final boolean e() {
        return this.f21088a.getBoolean("keyIsBeautificationFlow", false);
    }

    @NotNull
    public final String f() {
        String string = this.f21088a.getString("lastAttemptedPaymentMethod", "");
        return string == null ? "" : string;
    }

    public final String g() {
        return this.f21088a.getString("default_locale", null);
    }

    public final MembsershipDetailsData h() {
        try {
            String string = this.f21088a.getString("membershipData", null);
            if (string != null) {
                return (MembsershipDetailsData) this.f21089b.c(MembsershipDetailsData.class, string);
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
        return null;
    }

    public final NotificationPermissionData i() {
        String string = this.f21088a.getString(this.f21107u, null);
        if (string != null) {
            return (NotificationPermissionData) this.f21089b.c(NotificationPermissionData.class, string);
        }
        return null;
    }

    public final ArrayList<String> j() {
        try {
            String string = this.f21088a.getString(this.f21097k, null);
            if (string != null) {
                return (ArrayList) this.f21089b.d(string, new TypeToken<ArrayList<String>>() {
                }.getType());
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
        return null;
    }

    public final String k() {
        String string = this.f21088a.getString("referralcode", null);
        if (string != null) {
            return string;
        }
        return null;
    }

    public final String l() {
        String string = this.f21088a.getString("referrallink", null);
        if (string != null) {
            return string;
        }
        return null;
    }

    public final float m() {
        return this.f21088a.getFloat("deviceScreenSize", 6.2f);
    }

    public final MembershipPlanDetails n() {
        try {
            String string = this.f21088a.getString("selectedPlan", null);
            if (string != null) {
                return (MembershipPlanDetails) this.f21089b.c(MembershipPlanDetails.class, string);
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
        return null;
    }

    public final Community o() {
        try {
            String string = this.f21088a.getString("signedInGroup", null);
            if (string != null) {
                return (Community) this.f21089b.c(Community.class, string);
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
        return null;
    }

    public final UserUsa p() {
        try {
            do.a.a.c("getSignedInUser", new Object[0]);
            String string = this.f21088a.getString("signedInUser", null);
            if (string != null) {
                return (UserUsa) this.f21089b.c(UserUsa.class, string);
            }
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
        return null;
    }

    public final String q() {
        try {
            return this.f21088a.getString("sourceDataForPaymentInstrumentation_", null);
        } catch (Exception e8) {
            do.a.a.e(e8);
            return null;
        }
    }

    public final int r() {
        return this.f21088a.getInt("keyTempBucketId", -1);
    }

    public final Translations s() {
        String string = this.f21088a.getString(this.f21083D, null);
        if (string != null) {
            return (Translations) this.f21089b.c(Translations.class, string);
        }
        return null;
    }

    public final List<ApplicationDetails> t() {
        String string = this.f21088a.getString(this.f21100n, null);
        if (string == null) {
            return null;
        }
        return (List) this.f21089b.d(string, new TypeToken<ArrayList<ApplicationDetails>>() {
        }.getType());
    }

    public final List<ApplicationDetails> u() {
        String string = this.f21088a.getString(this.f21099m, null);
        if (string == null) {
            return null;
        }
        return (List) this.f21089b.d(string, new TypeToken<ArrayList<ApplicationDetails>>() {
        }.getType());
    }

    public final boolean v(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "tag");
        ArrayList<String> j7 = j();
        return j7 != null && j7.contains(str);
    }

    public final void w() {
        PreferencesHelper preferencesHelper;
        String str = this.f21087H;
        String str2 = this.f21084E;
        String str3 = this.f21092f;
        String str4 = this.f21093g;
        String str5 = this.f21104r;
        SharedPreferences sharedPreferences = this.f21088a;
        try {
            String g8 = g();
            String string = sharedPreferences.getString("base_url", "https://crafto.app/");
            String c8 = c();
            String string2 = sharedPreferences.getString(str5, null);
            int i7 = sharedPreferences.getInt("session_count_contact_connect", 3);
            int i8 = sharedPreferences.getInt(str4, 0);
            int i9 = sharedPreferences.getInt(str3, 0);
            int i10 = sharedPreferences.getInt(str2, 0);
            String string3 = sharedPreferences.getString("holi_file_name", null);
            if (string3 == null) {
                string3 = "";
            }
            String str6 = string3;
            String string4 = sharedPreferences.getString(str, null);
            int r7 = r();
            boolean z7 = sharedPreferences.getBoolean("keyIsBeautificationFlow", false);
            boolean z8 = sharedPreferences.getBoolean("keyIsSnapchatFlow", false);
            sharedPreferences.edit().clear().apply();
            sharedPreferences.edit().putString("base_url", string).apply();
            sharedPreferences.edit().putString(str5, string2).apply();
            if (c8 != null) {
                A(c8);
            }
            sharedPreferences.edit().putBoolean("keyIsBeautificationFlow", z7).apply();
            sharedPreferences.edit().putBoolean("keyIsSnapchatFlow", z8).apply();
            T(r7);
            sharedPreferences.edit().putInt("session_count_contact_connect", i7).apply();
            sharedPreferences.edit().putInt(str4, i8).apply();
            sharedPreferences.edit().putInt(str3, i9).apply();
            sharedPreferences.edit().putInt(str2, i10).apply();
            sharedPreferences.edit().putString("holi_file_name", str6).apply();
            if (string4 != null) {
                Intrinsics.checkNotNullParameter(string4, "link");
                sharedPreferences.edit().putString(str, string4).apply();
            }
            if (g8 != null) {
                G(g8);
            }
            PreferencesHelper preferencesHelper2 = this.f21090c;
            if (preferencesHelper2 != null) {
                preferencesHelper = preferencesHelper2;
            } else {
                Intrinsics.throwUninitializedPropertyAccessException("preferencesHlpr");
                preferencesHelper = null;
            }
            preferencesHelper.P();
        } catch (Exception e8) {
            do.a.a.e(e8);
        }
    }

    public final void x(String str) {
        do.a.a.c(e.a("setAppLanguage ", str), new Object[0]);
        if (str != null) {
            Xf.i.b(this.f21088a, "appLanguage", str);
        }
    }

    public final void y(String str) {
        Xf.i.b(this.f21088a, "authToken", str);
    }

    public final void z(UserConfigData userConfigData) {
        do.a.a.c("setConfigData " + userConfigData, new Object[0]);
        this.f21088a.edit().putString(this.f21108v, this.f21089b.h(userConfigData)).apply();
    }
}