MD5 校验值:facd8e3913e14e36e7daf9e69fbd45cb
PurchasesOrchestrator.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package com.revenuecat.purchases; import A0.d; import D0.PXWk.rBCr; import D2.m; import E0.gyz.UkMqIa; import L.C0059c; import P2.iPeF.jPzm; import a.AbstractC0137a; import android.app.Activity; import android.app.Application; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.util.Pair; import androidx.core.os.SOfo.ZEcPrKiVIStcof; import androidx.lifecycle.ProcessLifecycleOwner; import androidx.room.migration.aPQ.ZgDYSIg; import com.revenuecat.purchases.common.AppConfig; import com.revenuecat.purchases.common.Backend; import com.revenuecat.purchases.common.BillingAbstract; import com.revenuecat.purchases.common.Config; import com.revenuecat.purchases.common.LogIntent; import com.revenuecat.purchases.common.LogUtilsKt; import com.revenuecat.purchases.common.LogWrapperKt; import com.revenuecat.purchases.common.PlatformInfo; import com.revenuecat.purchases.common.UtilsKt; import com.revenuecat.purchases.common.caching.DeviceCache; import com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer; import com.revenuecat.purchases.common.offerings.OfferingsManager; import com.revenuecat.purchases.common.offlineentitlements.OfflineEntitlementsManager; import com.revenuecat.purchases.common.subscriberattributes.SubscriberAttributeKey; import com.revenuecat.purchases.identity.IdentityManager; import com.revenuecat.purchases.interfaces.Callback; import com.revenuecat.purchases.interfaces.GetStoreProductsCallback; import com.revenuecat.purchases.interfaces.LogInCallback; import com.revenuecat.purchases.interfaces.ProductChangeCallback; import com.revenuecat.purchases.interfaces.PurchaseCallback; import com.revenuecat.purchases.interfaces.PurchaseErrorCallback; import com.revenuecat.purchases.interfaces.ReceiveCustomerInfoCallback; import com.revenuecat.purchases.interfaces.ReceiveOfferingsCallback; import com.revenuecat.purchases.interfaces.SyncPurchasesCallback; import com.revenuecat.purchases.interfaces.UpdatedCustomerInfoListener; import com.revenuecat.purchases.models.BillingFeature; import com.revenuecat.purchases.models.GoogleReplacementMode; import com.revenuecat.purchases.models.InAppMessageType; import com.revenuecat.purchases.models.PurchasingData; import com.revenuecat.purchases.models.StoreProduct; import com.revenuecat.purchases.models.StoreTransaction; import com.revenuecat.purchases.paywalls.PaywallPresentedCache; import com.revenuecat.purchases.paywalls.events.PaywallEvent; import com.revenuecat.purchases.paywalls.events.PaywallEventsManager; import com.revenuecat.purchases.strings.AttributionStrings; import com.revenuecat.purchases.strings.ConfigureStrings; import com.revenuecat.purchases.strings.CustomerInfoStrings; import com.revenuecat.purchases.strings.IdentityStrings; import com.revenuecat.purchases.strings.PurchaseStrings; import com.revenuecat.purchases.strings.RestoreStrings; import com.revenuecat.purchases.subscriberattributes.SubscriberAttributesManager; import com.revenuecat.purchases.utils.AndroidVersionUtilsKt; import com.revenuecat.purchases.utils.CustomActivityLifecycleHandler; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import k2.AbstractC0322a; import k2.C0320D; import k2.C0329h; import k2.InterfaceC0327f; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.f; import kotlin.jvm.internal.k; import kotlin.jvm.internal.l; import kotlin.jvm.internal.uH.YpIkwCgYXfGh; import l2.i; import l2.j; import l2.r; import l2.y; import l2.z; import n3.Dj.WRle; import v2.InterfaceC0428o; public final class PurchasesOrchestrator implements LifecycleDelegate, CustomActivityLifecycleHandler { public static final String frameworkVersion = "7.2.5"; private static URL proxyURL; private AppConfig appConfig; private final Application application; private final Backend backend; private final BillingAbstract billing; private final CustomerInfoHelper customerInfoHelper; private final CustomerInfoUpdateHandler customerInfoUpdateHandler; private final DeviceCache deviceCache; private final IdentityManager identityManager; private final InterfaceC0327f lifecycleHandler$delegate; private final Handler mainHandler; private final OfferingsManager offeringsManager; private final OfflineEntitlementsManager offlineEntitlementsManager; private final PaywallEventsManager paywallEventsManager; private final PaywallPresentedCache paywallPresentedCache; private final PostPendingTransactionsHelper postPendingTransactionsHelper; private final PostReceiptHelper postReceiptHelper; private final PostTransactionWithProductDetailsHelper postTransactionWithProductDetailsHelper; private volatile PurchasesState state; private final SubscriberAttributesManager subscriberAttributesManager; private final SyncPurchasesHelper syncPurchasesHelper; public static final Companion Companion = new Companion(null); private static PlatformInfo platformInfo = new PlatformInfo("native", null); public static final class AnonymousClass1 implements BillingAbstract.StateListener { public AnonymousClass1() { } @Override public void onConnected() { PostPendingTransactionsHelper.syncPendingPurchaseQueue$default(PurchasesOrchestrator.this.postPendingTransactionsHelper, PurchasesOrchestrator.this.getAllowSharingPlayStoreAccount(), null, null, 6, null); PurchasesOrchestrator.this.billing.getStorefront(PurchasesOrchestrator$1$onConnected$1.INSTANCE, PurchasesOrchestrator$1$onConnected$2.INSTANCE); } } public static final class AnonymousClass2 extends l implements Function0 { public AnonymousClass2() { super(0); } @Override public Object invoke() { m30invoke(); return C0320D.f2794a; } public final void m30invoke() { ProcessLifecycleOwner.get().getLifecycle().addObserver(PurchasesOrchestrator.this.getLifecycleHandler()); PurchasesOrchestrator.this.application.registerActivityLifecycleCallbacks(PurchasesOrchestrator.this); } } public static final class Companion { private Companion() { } public Companion(f fVar) { this(); } public static void canMakePayments$default(Companion companion, Context context, List list, Callback callback, int i, Object obj) { if ((i & 2) != 0) { list = r.f2923a; } companion.canMakePayments(context, list, callback); } public final void canMakePayments(Context context, List<? extends BillingFeature> features, Callback<Boolean> callback) { k.e(context, ZEcPrKiVIStcof.cttN); k.e(features, "features"); k.e(callback, "callback"); C0059c c0059c = new C0059c(context, new d(15)); c0059c.g(new PurchasesOrchestrator$Companion$canMakePayments$2$1(new Handler(context.getMainLooper()), callback, c0059c, features)); } public final boolean getDebugLogsEnabled() { return LogUtilsKt.getDebugLogsEnabled(getLogLevel()); } public final synchronized LogHandler getLogHandler() { return LogWrapperKt.getCurrentLogHandler(); } public final LogLevel getLogLevel() { return Config.INSTANCE.getLogLevel(); } public final PlatformInfo getPlatformInfo() { return PurchasesOrchestrator.platformInfo; } public final URL getProxyURL() { return PurchasesOrchestrator.proxyURL; } public final void setDebugLogsEnabled(boolean z3) { setLogLevel(LogUtilsKt.debugLogsEnabled(LogLevel.Companion, z3)); } public final synchronized void setLogHandler(LogHandler value) { k.e(value, "value"); LogWrapperKt.setCurrentLogHandler(value); } public final void setLogLevel(LogLevel value) { k.e(value, "value"); Config.INSTANCE.setLogLevel(value); } public final void setPlatformInfo(PlatformInfo platformInfo) { k.e(platformInfo, "<set-?>"); PurchasesOrchestrator.platformInfo = platformInfo; } public final void setProxyURL(URL url) { PurchasesOrchestrator.proxyURL = url; } } public PurchasesOrchestrator(Application application, String str, Backend backend, BillingAbstract billing, DeviceCache deviceCache, IdentityManager identityManager, SubscriberAttributesManager subscriberAttributesManager, AppConfig appConfig, CustomerInfoHelper customerInfoHelper, CustomerInfoUpdateHandler customerInfoUpdateHandler, DiagnosticsSynchronizer diagnosticsSynchronizer, OfflineEntitlementsManager offlineEntitlementsManager, PostReceiptHelper postReceiptHelper, PostTransactionWithProductDetailsHelper postTransactionWithProductDetailsHelper, PostPendingTransactionsHelper postPendingTransactionsHelper, SyncPurchasesHelper syncPurchasesHelper, OfferingsManager offeringsManager, PaywallEventsManager paywallEventsManager, PaywallPresentedCache paywallPresentedCache, Handler handler) { k.e(application, "application"); k.e(backend, "backend"); k.e(billing, "billing"); k.e(deviceCache, "deviceCache"); k.e(identityManager, "identityManager"); k.e(subscriberAttributesManager, "subscriberAttributesManager"); k.e(appConfig, "appConfig"); k.e(customerInfoHelper, "customerInfoHelper"); k.e(customerInfoUpdateHandler, "customerInfoUpdateHandler"); k.e(offlineEntitlementsManager, "offlineEntitlementsManager"); k.e(postReceiptHelper, "postReceiptHelper"); k.e(postTransactionWithProductDetailsHelper, "postTransactionWithProductDetailsHelper"); k.e(postPendingTransactionsHelper, UkMqIa.ECxsOok); k.e(syncPurchasesHelper, "syncPurchasesHelper"); k.e(offeringsManager, "offeringsManager"); k.e(paywallPresentedCache, "paywallPresentedCache"); this.application = application; this.backend = backend; this.billing = billing; this.deviceCache = deviceCache; this.identityManager = identityManager; this.subscriberAttributesManager = subscriberAttributesManager; this.appConfig = appConfig; this.customerInfoHelper = customerInfoHelper; this.customerInfoUpdateHandler = customerInfoUpdateHandler; this.offlineEntitlementsManager = offlineEntitlementsManager; this.postReceiptHelper = postReceiptHelper; this.postTransactionWithProductDetailsHelper = postTransactionWithProductDetailsHelper; this.postPendingTransactionsHelper = postPendingTransactionsHelper; this.syncPurchasesHelper = syncPurchasesHelper; this.offeringsManager = offeringsManager; this.paywallEventsManager = paywallEventsManager; this.paywallPresentedCache = paywallPresentedCache; this.mainHandler = handler; this.state = new PurchasesState(null, null, null, false, false, 31, null); this.lifecycleHandler$delegate = AbstractC0322a.d(new PurchasesOrchestrator$lifecycleHandler$2(this)); identityManager.configure(str); billing.setStateListener(new BillingAbstract.StateListener() { public AnonymousClass1() { } @Override public void onConnected() { PostPendingTransactionsHelper.syncPendingPurchaseQueue$default(PurchasesOrchestrator.this.postPendingTransactionsHelper, PurchasesOrchestrator.this.getAllowSharingPlayStoreAccount(), null, null, 6, null); PurchasesOrchestrator.this.billing.getStorefront(PurchasesOrchestrator$1$onConnected$1.INSTANCE, PurchasesOrchestrator$1$onConnected$2.INSTANCE); } }); billing.setPurchasesUpdatedListener(getPurchasesUpdatedListener()); BillingAbstract.startConnectionOnMainThread$default(billing, 0L, 1, null); dispatch(new AnonymousClass2()); if (!this.appConfig.getDangerousSettings().getAutoSyncPurchases()) { LogWrapperKt.log(LogIntent.WARNING, ConfigureStrings.AUTO_SYNC_PURCHASES_DISABLED); } if (AndroidVersionUtilsKt.isAndroidNOrNewer()) { if (diagnosticsSynchronizer != null) { diagnosticsSynchronizer.clearDiagnosticsFileIfTooBig(); } if (diagnosticsSynchronizer != null) { diagnosticsSynchronizer.syncDiagnosticsFileIfNeeded(); } } } public PurchasesOrchestrator(Application application, String str, Backend backend, BillingAbstract billingAbstract, DeviceCache deviceCache, IdentityManager identityManager, SubscriberAttributesManager subscriberAttributesManager, AppConfig appConfig, CustomerInfoHelper customerInfoHelper, CustomerInfoUpdateHandler customerInfoUpdateHandler, DiagnosticsSynchronizer diagnosticsSynchronizer, OfflineEntitlementsManager offlineEntitlementsManager, PostReceiptHelper postReceiptHelper, PostTransactionWithProductDetailsHelper postTransactionWithProductDetailsHelper, PostPendingTransactionsHelper postPendingTransactionsHelper, SyncPurchasesHelper syncPurchasesHelper, OfferingsManager offeringsManager, PaywallEventsManager paywallEventsManager, PaywallPresentedCache paywallPresentedCache, Handler handler, int i, f fVar) { this(application, str, backend, billingAbstract, deviceCache, identityManager, subscriberAttributesManager, appConfig, customerInfoHelper, customerInfoUpdateHandler, diagnosticsSynchronizer, offlineEntitlementsManager, postReceiptHelper, postTransactionWithProductDetailsHelper, postPendingTransactionsHelper, syncPurchasesHelper, offeringsManager, paywallEventsManager, paywallPresentedCache, (i & 524288) != 0 ? new Handler(Looper.getMainLooper()) : handler); } public final void dispatch(PurchaseErrorCallback purchaseErrorCallback, PurchasesError purchasesError) { dispatch(new PurchasesOrchestrator$dispatch$1(purchaseErrorCallback, purchasesError)); } public final void dispatch(Function0 function0) { if (k.a(Thread.currentThread(), Looper.getMainLooper().getThread())) { function0.invoke(); return; } Handler handler = this.mainHandler; if (handler == null) { handler = new Handler(Looper.getMainLooper()); } handler.post(new a(function0, 2)); } public static final void dispatch$lambda$16(Function0 tmp0) { k.e(tmp0, "$tmp0"); tmp0.invoke(); } private final void flushPaywallEvents() { PaywallEventsManager paywallEventsManager; if (!AndroidVersionUtilsKt.isAndroidNOrNewer() || (paywallEventsManager = this.paywallEventsManager) == null) { return; } paywallEventsManager.flushEvents(); } public final List<PurchaseCallback> getAndClearAllPurchaseCallbacks() { List<PurchaseCallback> e02; synchronized (this) { Map<String, PurchaseCallback> purchaseCallbacksByProductId = getState$purchases_defaultsRelease().getPurchaseCallbacksByProductId(); PurchasesState state$purchases_defaultsRelease = getState$purchases_defaultsRelease(); Map emptyMap = Collections.emptyMap(); k.d(emptyMap, "emptyMap()"); setState$purchases_defaultsRelease(PurchasesState.copy$default(state$purchases_defaultsRelease, null, emptyMap, null, false, false, 29, null)); e02 = j.e0(purchaseCallbacksByProductId.values()); } return e02; } public final ProductChangeCallback getAndClearProductChangeCallback() { ProductChangeCallback deprecatedProductChangeCallback = getState$purchases_defaultsRelease().getDeprecatedProductChangeCallback(); setState$purchases_defaultsRelease(PurchasesState.copy$default(getState$purchases_defaultsRelease(), null, null, null, false, false, 27, null)); return deprecatedProductChangeCallback; } public final AppLifecycleHandler getLifecycleHandler() { return (AppLifecycleHandler) this.lifecycleHandler$delegate.getValue(); } public final Pair<InterfaceC0428o, InterfaceC0428o> getProductChangeCompletedCallbacks(ProductChangeCallback productChangeCallback) { return new Pair<>(new PurchasesOrchestrator$getProductChangeCompletedCallbacks$onSuccess$1(productChangeCallback, this), new PurchasesOrchestrator$getProductChangeCompletedCallbacks$onError$1(productChangeCallback, this)); } public static void getProducts$default(PurchasesOrchestrator purchasesOrchestrator, List list, ProductType productType, GetStoreProductsCallback getStoreProductsCallback, int i, Object obj) { if ((i & 2) != 0) { productType = null; } purchasesOrchestrator.getProducts(list, productType, getStoreProductsCallback); } public final void getProductsOfTypes(Set<String> set, Set<? extends ProductType> set2, List<? extends StoreProduct> list, GetStoreProductsCallback getStoreProductsCallback) { Set h0 = j.h0(set2); ProductType productType = (ProductType) j.P(h0); C0320D c0320d = null; if (productType != null) { h0.remove(productType); } else { productType = null; } if (productType != null) { this.billing.queryProductDetailsAsync(productType, set, new PurchasesOrchestrator$getProductsOfTypes$1$1(this, set, h0, list, getStoreProductsCallback), new PurchasesOrchestrator$getProductsOfTypes$1$2(this, getStoreProductsCallback)); c0320d = C0320D.f2794a; } if (c0320d == null) { getStoreProductsCallback.onReceived(list); } } public final PurchaseCallback getPurchaseCallback(String str) { PurchaseCallback purchaseCallback = getState$purchases_defaultsRelease().getPurchaseCallbacksByProductId().get(str); PurchasesState state$purchases_defaultsRelease = getState$purchases_defaultsRelease(); Map<String, PurchaseCallback> purchaseCallbacksByProductId = getState$purchases_defaultsRelease().getPurchaseCallbacksByProductId(); LinkedHashMap linkedHashMap = new LinkedHashMap(); for (Map.Entry<String, PurchaseCallback> entry : purchaseCallbacksByProductId.entrySet()) { if (!k.a(entry.getKey(), str)) { linkedHashMap.put(entry.getKey(), entry.getValue()); } } setState$purchases_defaultsRelease(PurchasesState.copy$default(state$purchases_defaultsRelease, null, linkedHashMap, null, false, false, 29, null)); return purchaseCallback; } public final Pair<InterfaceC0428o, InterfaceC0428o> getPurchaseCompletedCallbacks() { return new Pair<>(new PurchasesOrchestrator$getPurchaseCompletedCallbacks$onSuccess$1(this), new PurchasesOrchestrator$getPurchaseCompletedCallbacks$onError$1(this)); } private final BillingAbstract.PurchasesUpdatedListener getPurchasesUpdatedListener() { return new BillingAbstract.PurchasesUpdatedListener() { @Override public void onPurchasesFailedToUpdate(PurchasesError purchasesError) { ProductChangeCallback andClearProductChangeCallback; C0320D c0320d; List andClearAllPurchaseCallbacks; k.e(purchasesError, "purchasesError"); PurchasesOrchestrator purchasesOrchestrator = PurchasesOrchestrator.this; synchronized (purchasesOrchestrator) { try { andClearProductChangeCallback = purchasesOrchestrator.getAndClearProductChangeCallback(); if (andClearProductChangeCallback != null) { purchasesOrchestrator.dispatch(andClearProductChangeCallback, purchasesError); c0320d = C0320D.f2794a; } else { c0320d = null; } if (c0320d == null) { andClearAllPurchaseCallbacks = purchasesOrchestrator.getAndClearAllPurchaseCallbacks(); Iterator it2 = andClearAllPurchaseCallbacks.iterator(); while (it2.hasNext()) { purchasesOrchestrator.dispatch((PurchaseCallback) it2.next(), purchasesError); } } } catch (Throwable th) { throw th; } } } @Override public void onPurchasesUpdated(List<StoreTransaction> purchases) { Pair purchaseCompletedCallbacks; PostTransactionWithProductDetailsHelper postTransactionWithProductDetailsHelper; ProductChangeCallback andClearProductChangeCallback; k.e(purchases, "purchases"); PurchasesOrchestrator purchasesOrchestrator = PurchasesOrchestrator.this; synchronized (purchasesOrchestrator) { try { if (purchasesOrchestrator.getState$purchases_defaultsRelease().getDeprecatedProductChangeCallback() != null) { andClearProductChangeCallback = purchasesOrchestrator.getAndClearProductChangeCallback(); purchaseCompletedCallbacks = purchasesOrchestrator.getProductChangeCompletedCallbacks(andClearProductChangeCallback); } else { purchaseCompletedCallbacks = purchasesOrchestrator.getPurchaseCompletedCallbacks(); } } catch (Throwable th) { throw th; } } postTransactionWithProductDetailsHelper = PurchasesOrchestrator.this.postTransactionWithProductDetailsHelper; postTransactionWithProductDetailsHelper.postTransactions(purchases, PurchasesOrchestrator.this.getAllowSharingPlayStoreAccount(), PurchasesOrchestrator.this.getAppUserID(), PostReceiptInitiationSource.PURCHASE, (InterfaceC0428o) purchaseCompletedCallbacks.first, (InterfaceC0428o) purchaseCompletedCallbacks.second); } }; } public static void getState$purchases_defaultsRelease$annotations() { } public static void logIn$default(PurchasesOrchestrator purchasesOrchestrator, String str, LogInCallback logInCallback, int i, Object obj) { if ((i & 2) != 0) { logInCallback = null; } purchasesOrchestrator.logIn(str, logInCallback); } public static void logOut$default(PurchasesOrchestrator purchasesOrchestrator, ReceiveCustomerInfoCallback receiveCustomerInfoCallback, int i, Object obj) { if ((i & 1) != 0) { receiveCustomerInfoCallback = null; } purchasesOrchestrator.logOut(receiveCustomerInfoCallback); } private final void replaceOldPurchaseWithNewProduct(PurchasingData purchasingData, String missingDelimiterValue, GoogleReplacementMode googleReplacementMode, Activity activity, String str, String str2, Boolean bool, PurchaseErrorCallback purchaseErrorCallback) { String substring; ProductType productType = purchasingData.getProductType(); ProductType productType2 = ProductType.SUBS; if (productType != productType2) { PurchasesError purchasesError = new PurchasesError(PurchasesErrorCode.PurchaseNotAllowedError, PurchaseStrings.UPGRADING_INVALID_TYPE); LogUtilsKt.errorLog(purchasesError); ProductChangeCallback andClearProductChangeCallback = getAndClearProductChangeCallback(); if (andClearProductChangeCallback != null) { dispatch(andClearProductChangeCallback, purchasesError); } Iterator<T> it2 = getAndClearAllPurchaseCallbacks().iterator(); while (it2.hasNext()) { dispatch((PurchaseCallback) it2.next(), purchasesError); } return; } ?? obj = new Object(); obj.f2881a = missingDelimiterValue; String str3 = YpIkwCgYXfGh.xVo; if (m.R(missingDelimiterValue, str3, false)) { k.e(missingDelimiterValue, "<this>"); k.e(missingDelimiterValue, "missingDelimiterValue"); int Y3 = m.Y(missingDelimiterValue, str3, 0, false, 6); if (Y3 == -1) { substring = missingDelimiterValue; } else { substring = missingDelimiterValue.substring(0, Y3); k.d(substring, "this as java.lang.String…ing(startIndex, endIndex)"); } obj.f2881a = substring; StringBuilder q4 = C.a.q("Using incorrect oldProductId: ", missingDelimiterValue, ". The productId should not contain the basePlanId. Using productId: "); q4.append((String) obj.f2881a); q4.append('.'); LogUtilsKt.warnLog(q4.toString()); } this.billing.findPurchaseInPurchaseHistory(str, productType2, (String) obj.f2881a, new PurchasesOrchestrator$replaceOldPurchaseWithNewProduct$2(obj, this, activity, str, purchasingData, googleReplacementMode, str2, bool), new PurchasesOrchestrator$replaceOldPurchaseWithNewProduct$3(this, purchaseErrorCallback)); } private final boolean shouldRefreshCustomerInfo(boolean z3) { if (this.appConfig.getCustomEntitlementComputation()) { return false; } return z3 || this.deviceCache.isCustomerInfoCacheStale(getAppUserID(), false); } public static void syncPurchases$default(PurchasesOrchestrator purchasesOrchestrator, SyncPurchasesCallback syncPurchasesCallback, int i, Object obj) { if ((i & 1) != 0) { syncPurchasesCallback = null; } purchasesOrchestrator.syncPurchases(syncPurchasesCallback); } private final void synchronizeSubscriberAttributesIfNeeded() { SubscriberAttributesManager.synchronizeSubscriberAttributesForAllUsers$default(this.subscriberAttributesManager, getAppUserID(), null, 2, null); } public final void updateAllCaches(String str, ReceiveCustomerInfoCallback receiveCustomerInfoCallback) { boolean appInBackground = getState$purchases_defaultsRelease().getAppInBackground(); this.customerInfoHelper.retrieveCustomerInfo(str, CacheFetchPolicy.FETCH_CURRENT, appInBackground, getAllowSharingPlayStoreAccount(), receiveCustomerInfoCallback); OfferingsManager.fetchAndCacheOfferings$default(this.offeringsManager, str, appInBackground, null, null, 12, null); } public static void updateAllCaches$default(PurchasesOrchestrator purchasesOrchestrator, String str, ReceiveCustomerInfoCallback receiveCustomerInfoCallback, int i, Object obj) { if ((i & 2) != 0) { receiveCustomerInfoCallback = null; } purchasesOrchestrator.updateAllCaches(str, receiveCustomerInfoCallback); } public final void close() { synchronized (this) { PurchasesState state$purchases_defaultsRelease = getState$purchases_defaultsRelease(); Map emptyMap = Collections.emptyMap(); k.d(emptyMap, "emptyMap()"); setState$purchases_defaultsRelease(PurchasesState.copy$default(state$purchases_defaultsRelease, null, emptyMap, null, false, false, 29, null)); } this.backend.close(); this.billing.close(); setUpdatedCustomerInfoListener(null); dispatch(new PurchasesOrchestrator$close$2(this)); } public final void collectDeviceIdentifiers() { com.google.android.gms.internal.play_billing.a.n(new Object[]{"collectDeviceIdentifiers"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.collectDeviceIdentifiers(getAppUserID(), this.application); } public final synchronized boolean getAllowSharingPlayStoreAccount() { Boolean allowSharingPlayStoreAccount; try { allowSharingPlayStoreAccount = getState$purchases_defaultsRelease().getAllowSharingPlayStoreAccount(); } catch (Throwable th) { throw th; } return allowSharingPlayStoreAccount != null ? allowSharingPlayStoreAccount.booleanValue() : this.identityManager.currentUserIsAnonymous(); } public final AppConfig getAppConfig() { return this.appConfig; } public final synchronized String getAppUserID() { return this.identityManager.getCurrentAppUserID(); } public final void getCustomerInfo(CacheFetchPolicy fetchPolicy, ReceiveCustomerInfoCallback receiveCustomerInfoCallback) { k.e(fetchPolicy, "fetchPolicy"); k.e(receiveCustomerInfoCallback, jPzm.zkQxseNYQawuMVY); this.customerInfoHelper.retrieveCustomerInfo(this.identityManager.getCurrentAppUserID(), fetchPolicy, getState$purchases_defaultsRelease().getAppInBackground(), getAllowSharingPlayStoreAccount(), receiveCustomerInfoCallback); } public final void getCustomerInfo(ReceiveCustomerInfoCallback callback) { k.e(callback, "callback"); getCustomerInfo(CacheFetchPolicy.Companion.m18default(), callback); } public final synchronized boolean getFinishTransactions() { return this.appConfig.getFinishTransactions(); } public final void getOfferings(ReceiveOfferingsCallback listener) { k.e(listener, "listener"); this.offeringsManager.getOfferings(this.identityManager.getCurrentAppUserID(), getState$purchases_defaultsRelease().getAppInBackground(), new PurchasesOrchestrator$getOfferings$1(listener), new PurchasesOrchestrator$getOfferings$2(listener)); } public final OfflineEntitlementsManager getOfflineEntitlementsManager() { return this.offlineEntitlementsManager; } public final void getProducts(List<String> list, ProductType productType, final GetStoreProductsCallback callback) { k.e(list, UkMqIa.bGbMrahqhM); k.e(callback, "callback"); getProductsOfTypes(j.i0(list), productType != null ? AbstractC0137a.U(productType) : z.d0(ProductType.SUBS, ProductType.INAPP), new GetStoreProductsCallback() { @Override public void onError(PurchasesError error) { k.e(error, "error"); GetStoreProductsCallback.this.onError(error); } @Override public void onReceived(List<? extends StoreProduct> storeProducts) { k.e(storeProducts, "storeProducts"); GetStoreProductsCallback.this.onReceived(storeProducts); } }); } public final void getProductsOfTypes(Set<String> productIds, Set<? extends ProductType> types, GetStoreProductsCallback callback) { k.e(productIds, "productIds"); k.e(types, "types"); k.e(callback, "callback"); ArrayList arrayList = new ArrayList(); for (Object obj : types) { if (((ProductType) obj) != ProductType.UNKNOWN) { arrayList.add(obj); } } getProductsOfTypes(productIds, j.i0(arrayList), r.f2923a, callback); } public final synchronized PurchasesState getState$purchases_defaultsRelease() { return this.state; } public final Store getStore() { return this.appConfig.getStore(); } public final synchronized UpdatedCustomerInfoListener getUpdatedCustomerInfoListener() { return this.customerInfoUpdateHandler.getUpdatedCustomerInfoListener(); } public final void invalidateCustomerInfoCache() { LogWrapperKt.log(LogIntent.DEBUG, CustomerInfoStrings.INVALIDATING_CUSTOMERINFO_CACHE); this.deviceCache.clearCustomerInfoCache(getAppUserID()); } public final boolean isAnonymous() { return this.identityManager.currentUserIsAnonymous(); } public final void logIn(String newAppUserID, LogInCallback logInCallback) { k.e(newAppUserID, "newAppUserID"); String currentAppUserID = this.identityManager.getCurrentAppUserID(); C0320D c0320d = null; if (k.a(currentAppUserID, newAppUserID)) { currentAppUserID = null; } if (currentAppUserID != null) { this.identityManager.logIn(newAppUserID, new PurchasesOrchestrator$logIn$2$1(this, newAppUserID, logInCallback), new PurchasesOrchestrator$logIn$2$2(this, logInCallback)); c0320d = C0320D.f2794a; } if (c0320d == null) { this.customerInfoHelper.retrieveCustomerInfo(this.identityManager.getCurrentAppUserID(), CacheFetchPolicy.Companion.m18default(), getState$purchases_defaultsRelease().getAppInBackground(), getAllowSharingPlayStoreAccount(), ListenerConversionsCommonKt.receiveCustomerInfoCallback(new PurchasesOrchestrator$logIn$3(this, logInCallback), new PurchasesOrchestrator$logIn$4(this, logInCallback))); } } public final void logOut(ReceiveCustomerInfoCallback receiveCustomerInfoCallback) { this.identityManager.logOut(new PurchasesOrchestrator$logOut$1(receiveCustomerInfoCallback, this)); } @Override public void onActivityCreated(Activity activity, Bundle bundle) { CustomActivityLifecycleHandler.DefaultImpls.onActivityCreated(this, activity, bundle); } @Override public void onActivityDestroyed(Activity activity) { CustomActivityLifecycleHandler.DefaultImpls.onActivityDestroyed(this, activity); } @Override public void onActivityPaused(Activity activity) { CustomActivityLifecycleHandler.DefaultImpls.onActivityPaused(this, activity); } @Override public void onActivityResumed(Activity activity) { CustomActivityLifecycleHandler.DefaultImpls.onActivityResumed(this, activity); } @Override public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { CustomActivityLifecycleHandler.DefaultImpls.onActivitySaveInstanceState(this, activity, bundle); } @Override public void onActivityStarted(Activity activity) { k.e(activity, "activity"); if (this.appConfig.getShowInAppMessagesAutomatically()) { showInAppMessagesIfNeeded(activity, i.Q(InAppMessageType.values())); } } @Override public void onActivityStopped(Activity activity) { CustomActivityLifecycleHandler.DefaultImpls.onActivityStopped(this, activity); } @Override public void onAppBackgrounded() { synchronized (this) { setState$purchases_defaultsRelease(PurchasesState.copy$default(getState$purchases_defaultsRelease(), null, null, null, true, false, 23, null)); } LogWrapperKt.log(LogIntent.DEBUG, ConfigureStrings.APP_BACKGROUNDED); synchronizeSubscriberAttributesIfNeeded(); } @Override public void onAppForegrounded() { boolean firstTimeInForeground; synchronized (this) { firstTimeInForeground = getState$purchases_defaultsRelease().getFirstTimeInForeground(); setState$purchases_defaultsRelease(PurchasesState.copy$default(getState$purchases_defaultsRelease(), null, null, null, false, false, 7, null)); } LogIntent logIntent = LogIntent.DEBUG; LogWrapperKt.log(logIntent, ConfigureStrings.APP_FOREGROUNDED); if (shouldRefreshCustomerInfo(firstTimeInForeground)) { LogWrapperKt.log(logIntent, CustomerInfoStrings.CUSTOMERINFO_STALE_UPDATING_FOREGROUND); CustomerInfoHelper.retrieveCustomerInfo$default(this.customerInfoHelper, this.identityManager.getCurrentAppUserID(), CacheFetchPolicy.FETCH_CURRENT, false, getAllowSharingPlayStoreAccount(), null, 16, null); } this.offeringsManager.onAppForeground(this.identityManager.getCurrentAppUserID()); PostPendingTransactionsHelper.syncPendingPurchaseQueue$default(this.postPendingTransactionsHelper, getAllowSharingPlayStoreAccount(), null, null, 6, null); synchronizeSubscriberAttributesIfNeeded(); OfflineEntitlementsManager.updateProductEntitlementMappingCacheIfStale$default(this.offlineEntitlementsManager, null, 1, null); flushPaywallEvents(); } public final void purchase(PurchaseParams purchaseParams, PurchaseCallback callback) { C0320D c0320d; k.e(purchaseParams, "purchaseParams"); k.e(callback, "callback"); String oldProductId = purchaseParams.getOldProductId(); if (oldProductId != null) { startProductChange(purchaseParams.getActivity$purchases_defaultsRelease(), purchaseParams.getPurchasingData$purchases_defaultsRelease(), purchaseParams.getPresentedOfferingIdentifier$purchases_defaultsRelease(), oldProductId, purchaseParams.getGoogleReplacementMode(), purchaseParams.isPersonalizedPrice(), callback); c0320d = C0320D.f2794a; } else { c0320d = null; } if (c0320d == null) { startPurchase(purchaseParams.getActivity$purchases_defaultsRelease(), purchaseParams.getPurchasingData$purchases_defaultsRelease(), purchaseParams.getPresentedOfferingIdentifier$purchases_defaultsRelease(), purchaseParams.isPersonalizedPrice(), callback); } } public final void removeUpdatedCustomerInfoListener() { setUpdatedCustomerInfoListener(null); } public final void restorePurchases(ReceiveCustomerInfoCallback callback) { k.e(callback, "callback"); LogWrapperKt.log(LogIntent.DEBUG, RestoreStrings.RESTORING_PURCHASE); if (!getAllowSharingPlayStoreAccount()) { LogWrapperKt.log(LogIntent.WARNING, RestoreStrings.SHARING_ACC_RESTORE_FALSE); } String currentAppUserID = this.identityManager.getCurrentAppUserID(); this.billing.queryAllPurchases(currentAppUserID, new PurchasesOrchestrator$restorePurchases$1(this, callback, currentAppUserID), new PurchasesOrchestrator$restorePurchases$2(this, callback)); } public final void setAd(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setAd"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.CampaignParameters.Ad.INSTANCE, str, getAppUserID()); } public final void setAdGroup(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setAdGroup"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.CampaignParameters.AdGroup.INSTANCE, str, getAppUserID()); } public final void setAdjustID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setAdjustID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttributionID(SubscriberAttributeKey.AttributionIds.Adjust.INSTANCE, str, getAppUserID(), this.application); } public final void setAirshipChannelID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setAirshipChannelID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.IntegrationIds.Airship.INSTANCE, str, getAppUserID()); } public final synchronized void setAllowSharingPlayStoreAccount(boolean z3) { setState$purchases_defaultsRelease(PurchasesState.copy$default(getState$purchases_defaultsRelease(), Boolean.valueOf(z3), null, null, false, false, 30, null)); } public final void setAppConfig(AppConfig appConfig) { k.e(appConfig, "<set-?>"); this.appConfig = appConfig; } public final void setAppsflyerID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setAppsflyerID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttributionID(SubscriberAttributeKey.AttributionIds.AppsFlyer.INSTANCE, str, getAppUserID(), this.application); } public final void setAttributes(Map<String, String> attributes) { k.e(attributes, "attributes"); com.google.android.gms.internal.play_billing.a.n(new Object[]{rBCr.HwuJaUmFzRn}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttributes(attributes, getAppUserID()); } public final void setCampaign(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setCampaign"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.CampaignParameters.Campaign.INSTANCE, str, getAppUserID()); } public final void setCleverTapID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setCleverTapID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttributionID(SubscriberAttributeKey.AttributionIds.CleverTap.INSTANCE, str, getAppUserID(), this.application); } public final void setCreative(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setCreative"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.CampaignParameters.Creative.INSTANCE, str, getAppUserID()); } public final void setDisplayName(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setDisplayName"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.DisplayName.INSTANCE, str, getAppUserID()); } public final void setEmail(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setEmail"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.Email.INSTANCE, str, getAppUserID()); } public final void setFBAnonymousID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setFBAnonymousID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttributionID(SubscriberAttributeKey.AttributionIds.Facebook.INSTANCE, str, getAppUserID(), this.application); } public final synchronized void setFinishTransactions(boolean z3) { this.appConfig.setFinishTransactions(z3); } public final void setFirebaseAppInstanceID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{ZgDYSIg.vOHINKjuOXcoRsS}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.IntegrationIds.FirebaseAppInstanceId.INSTANCE, str, getAppUserID()); } public final void setKeyword(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"seKeyword"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.CampaignParameters.Keyword.INSTANCE, str, getAppUserID()); } public final void setMediaSource(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setMediaSource"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.CampaignParameters.MediaSource.INSTANCE, str, getAppUserID()); } public final void setMixpanelDistinctID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setMixpanelDistinctID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.IntegrationIds.MixpanelDistinctId.INSTANCE, str, getAppUserID()); } public final void setMparticleID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setMparticleID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttributionID(SubscriberAttributeKey.AttributionIds.Mparticle.INSTANCE, str, getAppUserID(), this.application); } public final void setOnesignalID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setOnesignalID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.IntegrationIds.OneSignal.INSTANCE, str, getAppUserID()); } public final void setOnesignalUserID(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setOnesignalUserID"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.IntegrationIds.OneSignalUserId.INSTANCE, str, getAppUserID()); } public final void setPhoneNumber(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setPhoneNumber"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.PhoneNumber.INSTANCE, str, getAppUserID()); } public final void setPushToken(String str) { com.google.android.gms.internal.play_billing.a.n(new Object[]{"setPushToken"}, 1, AttributionStrings.METHOD_CALLED, LogIntent.DEBUG); this.subscriberAttributesManager.setAttribute(SubscriberAttributeKey.FCMTokens.INSTANCE, str, getAppUserID()); } public final synchronized void setState$purchases_defaultsRelease(PurchasesState value) { k.e(value, "value"); this.state = value; } public final synchronized void setUpdatedCustomerInfoListener(UpdatedCustomerInfoListener updatedCustomerInfoListener) { this.customerInfoUpdateHandler.setUpdatedCustomerInfoListener(updatedCustomerInfoListener); } public final void showInAppMessagesIfNeeded(Activity activity, List<? extends InAppMessageType> inAppMessageTypes) { k.e(activity, "activity"); k.e(inAppMessageTypes, "inAppMessageTypes"); this.billing.showInAppMessagesIfNeeded(activity, inAppMessageTypes, new PurchasesOrchestrator$showInAppMessagesIfNeeded$1(this)); } public final void startDeprecatedProductChange(Activity activity, PurchasingData purchasingData, String str, String oldProductId, GoogleReplacementMode googleReplacementMode, ProductChangeCallback listener) { String str2; ?? r02; ProductChangeCallback productChangeCallback; k.e(activity, "activity"); k.e(purchasingData, "purchasingData"); k.e(oldProductId, "oldProductId"); k.e(listener, "listener"); if (purchasingData.getProductType() != ProductType.SUBS) { getAndClearProductChangeCallback(); PurchasesError purchasesError = new PurchasesError(PurchasesErrorCode.PurchaseNotAllowedError, PurchaseStrings.UPGRADING_INVALID_TYPE); LogUtilsKt.errorLog(purchasesError); dispatch(listener, purchasesError); return; } LogIntent logIntent = LogIntent.PURCHASE; StringBuilder sb = new StringBuilder(" "); sb.append(purchasingData); sb.append(' '); C0320D c0320d = null; sb.append(str != null ? PurchaseStrings.OFFERING.concat(str) : null); sb.append(" oldProductId: "); sb.append(oldProductId); sb.append(" googleReplacementMode "); sb.append(googleReplacementMode); com.google.android.gms.internal.play_billing.a.n(new Object[]{sb.toString()}, 1, PurchaseStrings.PRODUCT_CHANGE_STARTED, logIntent); synchronized (this) { try { if (!this.appConfig.getFinishTransactions()) { LogWrapperKt.log(LogIntent.WARNING, PurchaseStrings.PURCHASE_FINISH_TRANSACTION_FALSE); } if (getState$purchases_defaultsRelease().getDeprecatedProductChangeCallback() == null) { setState$purchases_defaultsRelease(PurchasesState.copy$default(getState$purchases_defaultsRelease(), null, null, listener, false, false, 27, null)); str2 = this.identityManager.getCurrentAppUserID(); } else { str2 = null; } } catch (Throwable th) { throw th; } } if (str2 != null) { r02 = 0; productChangeCallback = listener; replaceOldPurchaseWithNewProduct(purchasingData, oldProductId, googleReplacementMode, activity, str2, str, null, listener); c0320d = C0320D.f2794a; } else { r02 = 0; productChangeCallback = listener; } if (c0320d == null) { getAndClearProductChangeCallback(); PurchasesError purchasesError2 = new PurchasesError(PurchasesErrorCode.OperationAlreadyInProgressError, r02, 2, r02); LogUtilsKt.errorLog(purchasesError2); dispatch(productChangeCallback, purchasesError2); } } public final void startProductChange(Activity activity, PurchasingData purchasingData, String str, String oldProductId, GoogleReplacementMode googleReplacementMode, Boolean bool, PurchaseCallback purchaseCallback) { String str2; C0320D c0320d; k.e(activity, "activity"); k.e(purchasingData, "purchasingData"); k.e(oldProductId, "oldProductId"); k.e(googleReplacementMode, "googleReplacementMode"); k.e(purchaseCallback, "purchaseCallback"); if (purchasingData.getProductType() != ProductType.SUBS) { PurchasesError purchasesError = new PurchasesError(PurchasesErrorCode.PurchaseNotAllowedError, PurchaseStrings.UPGRADING_INVALID_TYPE); LogUtilsKt.errorLog(purchasesError); dispatch(purchaseCallback, purchasesError); return; } LogIntent logIntent = LogIntent.PURCHASE; StringBuilder sb = new StringBuilder(" "); sb.append(purchasingData); sb.append(' '); sb.append(str != null ? PurchaseStrings.OFFERING.concat(str) : null); sb.append(" oldProductId: "); sb.append(oldProductId); sb.append(" googleReplacementMode "); sb.append(googleReplacementMode); com.google.android.gms.internal.play_billing.a.n(new Object[]{sb.toString()}, 1, PurchaseStrings.PRODUCT_CHANGE_STARTED, logIntent); synchronized (this) { try { if (!this.appConfig.getFinishTransactions()) { LogWrapperKt.log(LogIntent.WARNING, PurchaseStrings.PURCHASE_FINISH_TRANSACTION_FALSE); } if (getState$purchases_defaultsRelease().getPurchaseCallbacksByProductId().containsKey(purchasingData.getProductId())) { str2 = null; } else { setState$purchases_defaultsRelease(PurchasesState.copy$default(getState$purchases_defaultsRelease(), null, y.x0(getState$purchases_defaultsRelease().getPurchaseCallbacksByProductId(), y.u0(new C0329h(purchasingData.getProductId(), purchaseCallback))), null, false, false, 29, null)); str2 = this.identityManager.getCurrentAppUserID(); } } catch (Throwable th) { throw th; } } if (str2 != null) { replaceOldPurchaseWithNewProduct(purchasingData, oldProductId, googleReplacementMode, activity, str2, str, bool, purchaseCallback); c0320d = C0320D.f2794a; } else { c0320d = null; } if (c0320d == null) { PurchasesError purchasesError2 = new PurchasesError(PurchasesErrorCode.OperationAlreadyInProgressError, null, 2, null); LogUtilsKt.errorLog(purchasesError2); Iterator<T> it2 = getAndClearAllPurchaseCallbacks().iterator(); while (it2.hasNext()) { dispatch((PurchaseCallback) it2.next(), purchasesError2); } } } public final void startPurchase(Activity activity, PurchasingData purchasingData, String str, Boolean bool, PurchaseCallback listener) { String str2; C0320D c0320d; k.e(activity, "activity"); k.e(purchasingData, "purchasingData"); k.e(listener, "listener"); LogIntent logIntent = LogIntent.PURCHASE; StringBuilder sb = new StringBuilder(" "); sb.append(purchasingData); sb.append(' '); sb.append(str != null ? PurchaseStrings.OFFERING.concat(str) : null); com.google.android.gms.internal.play_billing.a.n(new Object[]{sb.toString()}, 1, PurchaseStrings.PURCHASE_STARTED, logIntent); synchronized (this) { try { if (!this.appConfig.getFinishTransactions()) { LogWrapperKt.log(LogIntent.WARNING, WRle.UKyZM); } if (getState$purchases_defaultsRelease().getPurchaseCallbacksByProductId().containsKey(purchasingData.getProductId())) { str2 = null; } else { setState$purchases_defaultsRelease(PurchasesState.copy$default(getState$purchases_defaultsRelease(), null, y.x0(getState$purchases_defaultsRelease().getPurchaseCallbacksByProductId(), y.u0(new C0329h(purchasingData.getProductId(), listener))), null, false, false, 29, null)); str2 = this.identityManager.getCurrentAppUserID(); } } catch (Throwable th) { throw th; } } if (str2 != null) { this.billing.makePurchaseAsync(activity, str2, purchasingData, null, str, bool); c0320d = C0320D.f2794a; } else { c0320d = null; } if (c0320d == null) { PurchasesError purchasesError = new PurchasesError(PurchasesErrorCode.OperationAlreadyInProgressError, null, 2, null); LogUtilsKt.errorLog(purchasesError); dispatch(listener, purchasesError); } } public final void switchUser(String newAppUserID) { k.e(newAppUserID, "newAppUserID"); if (k.a(this.identityManager.getCurrentAppUserID(), newAppUserID)) { LogUtilsKt.warnLog(String.format(IdentityStrings.SWITCHING_USER_SAME_APP_USER_ID, Arrays.copyOf(new Object[]{newAppUserID}, 1))); } else { this.identityManager.switchUser(newAppUserID); OfferingsManager.fetchAndCacheOfferings$default(this.offeringsManager, newAppUserID, getState$purchases_defaultsRelease().getAppInBackground(), null, null, 12, null); } } public final void syncObserverModeAmazonPurchase(String productID, String receiptID, String amazonUserID, String str, Double d2) { k.e(productID, "productID"); k.e(receiptID, "receiptID"); k.e(amazonUserID, "amazonUserID"); LogIntent logIntent = LogIntent.DEBUG; com.google.android.gms.internal.play_billing.a.n(new Object[]{receiptID, amazonUserID}, 2, PurchaseStrings.SYNCING_PURCHASE_STORE_USER_ID, logIntent); Set<String> previouslySentHashedTokens = this.deviceCache.getPreviouslySentHashedTokens(); if (!previouslySentHashedTokens.contains(UtilsKt.sha1(receiptID))) { previouslySentHashedTokens = null; } if (previouslySentHashedTokens != null) { com.google.android.gms.internal.play_billing.a.n(new Object[]{receiptID, amazonUserID}, 2, PurchaseStrings.SYNCING_PURCHASE_SKIPPING, logIntent); } else { this.billing.normalizePurchaseData(productID, receiptID, amazonUserID, new PurchasesOrchestrator$syncObserverModeAmazonPurchase$3(d2, str, this, receiptID, amazonUserID, this.identityManager.getCurrentAppUserID()), new PurchasesOrchestrator$syncObserverModeAmazonPurchase$4(receiptID, amazonUserID)); } } public final void syncPurchases(SyncPurchasesCallback syncPurchasesCallback) { this.syncPurchasesHelper.syncPurchases(getAllowSharingPlayStoreAccount(), getState$purchases_defaultsRelease().getAppInBackground(), new PurchasesOrchestrator$syncPurchases$1(syncPurchasesCallback), new PurchasesOrchestrator$syncPurchases$2(syncPurchasesCallback)); } @ExperimentalPreviewRevenueCatPurchasesAPI public final void track(PaywallEvent paywallEvent) { PaywallEventsManager paywallEventsManager; k.e(paywallEvent, "paywallEvent"); this.paywallPresentedCache.receiveEvent(paywallEvent); if (!AndroidVersionUtilsKt.isAndroidNOrNewer() || (paywallEventsManager = this.paywallEventsManager) == null) { return; } paywallEventsManager.track(paywallEvent); } }