Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
package com.unity3d.services.store;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public interface JsonSerializable {
JSONObject toJson();
}

View File

@@ -0,0 +1,13 @@
package com.unity3d.services.store;
/* loaded from: classes4.dex */
public enum StoreError {
NOT_INITIALIZED,
CLASS_NOT_FOUND,
NO_SUCH_METHOD,
INVOCATION_TARGET,
ILLEGAL_ACCESS,
JSON_ERROR,
STORE_ERROR,
UNKNOWN_ERROR
}

View File

@@ -0,0 +1,20 @@
package com.unity3d.services.store;
/* loaded from: classes4.dex */
public enum StoreEvent {
INITIALIZATION_REQUEST_RESULT,
INITIALIZATION_REQUEST_FAILED,
DISCONNECTED_RESULT,
PURCHASES_ON_RESUME_RESULT,
PURCHASES_ON_RESUME_ERROR,
PURCHASES_UPDATED_RESULT,
PURCHASES_UPDATED_ERROR,
PURCHASES_REQUEST_RESULT,
PURCHASES_REQUEST_ERROR,
PURCHASE_HISTORY_LIST_REQUEST_RESULT,
PURCHASE_HISTORY_LIST_REQUEST_ERROR,
SKU_DETAILS_LIST_REQUEST_RESULT,
SKU_DETAILS_LIST_REQUEST_ERROR,
IS_FEATURE_SUPPORTED_REQUEST_RESULT,
IS_FEATURE_SUPPORTED_REQUEST_ERROR
}

View File

@@ -0,0 +1,118 @@
package com.unity3d.services.store;
import com.unity3d.services.core.properties.ClientProperties;
import com.unity3d.services.store.core.StoreExceptionHandler;
import com.unity3d.services.store.core.StoreLifecycleListener;
import com.unity3d.services.store.gpbl.StoreBilling;
import com.unity3d.services.store.gpbl.listeners.BillingInitializationListener;
import com.unity3d.services.store.gpbl.listeners.FeatureSupportedListener;
import com.unity3d.services.store.gpbl.listeners.PurchaseHistoryResponseListener;
import com.unity3d.services.store.gpbl.listeners.PurchasesResponseListener;
import com.unity3d.services.store.gpbl.listeners.SkuDetailsResponseListener;
import com.unity3d.services.store.gpbl.listeners.StoreEventListener;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.flow.MutableStateFlow;
import kotlinx.coroutines.flow.StateFlowKt;
/* loaded from: classes4.dex */
public final class StoreMonitor {
private final MutableStateFlow _isInitialized;
private StoreBilling storeBilling;
private final StoreExceptionHandler storeExceptionHandler;
private StoreLifecycleListener storeLifecycleListener;
public StoreMonitor(StoreExceptionHandler storeExceptionHandler) {
Intrinsics.checkNotNullParameter(storeExceptionHandler, "storeExceptionHandler");
this.storeExceptionHandler = storeExceptionHandler;
this._isInitialized = StateFlowKt.MutableStateFlow(Boolean.FALSE);
}
public final boolean isInitialized() {
return ((Boolean) this._isInitialized.getValue()).booleanValue();
}
public final void initialize(BillingInitializationListener billingInitializationListener) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Intrinsics.checkNotNullParameter(billingInitializationListener, "billingInitializationListener");
if (isInitialized()) {
billingInitializationListener.onIsAlreadyInitialized();
return;
}
StoreBilling storeBilling = new StoreBilling(ClientProperties.getApplicationContext(), billingInitializationListener);
this.storeBilling = storeBilling;
storeBilling.initialize(billingInitializationListener);
this._isInitialized.setValue(Boolean.TRUE);
}
public final int isFeatureSupported(int i, String str, FeatureSupportedListener featureSupportedListener) {
Intrinsics.checkNotNullParameter(featureSupportedListener, "featureSupportedListener");
try {
StoreBilling storeBilling = this.storeBilling;
r0 = storeBilling != null ? storeBilling.isFeatureSupported(str) : -1;
featureSupportedListener.onFeatureSupported(r0);
} catch (Exception e) {
this.storeExceptionHandler.handleStoreException(StoreEvent.IS_FEATURE_SUPPORTED_REQUEST_ERROR, i, e);
}
return r0;
}
public final void getPurchases(int i, String str, PurchasesResponseListener purchasesResponseListener) {
Intrinsics.checkNotNullParameter(purchasesResponseListener, "purchasesResponseListener");
try {
StoreBilling storeBilling = this.storeBilling;
if (storeBilling == null) {
throw new IllegalStateException("Required value was null.".toString());
}
if (storeBilling != null) {
storeBilling.getPurchases(str, purchasesResponseListener);
}
} catch (Exception e) {
this.storeExceptionHandler.handleStoreException(StoreEvent.PURCHASES_REQUEST_ERROR, i, e);
}
}
public final void getPurchaseHistory(int i, String str, int i2, PurchaseHistoryResponseListener purchaseHistoryResponseListener) {
Intrinsics.checkNotNullParameter(purchaseHistoryResponseListener, "purchaseHistoryResponseListener");
try {
StoreBilling storeBilling = this.storeBilling;
if (storeBilling != null) {
storeBilling.getPurchaseHistory(str, i2, purchaseHistoryResponseListener);
}
} catch (Exception e) {
this.storeExceptionHandler.handleStoreException(StoreEvent.PURCHASE_HISTORY_LIST_REQUEST_ERROR, i, e);
}
}
public final void getSkuDetails(int i, String str, List<String> list, SkuDetailsResponseListener skuDetailsResponseListener) {
Intrinsics.checkNotNullParameter(skuDetailsResponseListener, "skuDetailsResponseListener");
try {
StoreBilling storeBilling = this.storeBilling;
if (storeBilling != null) {
storeBilling.getSkuDetails(str, list, skuDetailsResponseListener);
}
} catch (Exception e) {
this.storeExceptionHandler.handleStoreException(StoreEvent.SKU_DETAILS_LIST_REQUEST_ERROR, i, e);
}
}
public final void startPurchaseTracking(ArrayList<String> purchaseTypes, StoreEventListener storeEventListener) {
Intrinsics.checkNotNullParameter(purchaseTypes, "purchaseTypes");
Intrinsics.checkNotNullParameter(storeEventListener, "storeEventListener");
if (this.storeLifecycleListener != null) {
stopPurchaseTracking();
}
StoreBilling storeBilling = this.storeBilling;
Intrinsics.checkNotNull(storeBilling);
this.storeLifecycleListener = new StoreLifecycleListener(purchaseTypes, storeBilling, storeEventListener);
ClientProperties.getApplication().registerActivityLifecycleCallbacks(this.storeLifecycleListener);
}
public final void stopPurchaseTracking() {
if (this.storeLifecycleListener != null) {
ClientProperties.getApplication().unregisterActivityLifecycleCallbacks(this.storeLifecycleListener);
this.storeLifecycleListener = null;
}
}
}

View File

@@ -0,0 +1,22 @@
package com.unity3d.services.store;
import com.unity3d.services.core.webview.WebViewEventCategory;
import com.unity3d.services.core.webview.bridge.IEventSender;
import java.util.Arrays;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class StoreWebViewEventSender {
private final IEventSender eventSender;
public StoreWebViewEventSender(IEventSender eventSender) {
Intrinsics.checkNotNullParameter(eventSender, "eventSender");
this.eventSender = eventSender;
}
public final void send(StoreEvent event, Object... params) {
Intrinsics.checkNotNullParameter(event, "event");
Intrinsics.checkNotNullParameter(params, "params");
this.eventSender.sendEvent(WebViewEventCategory.STORE, event, Arrays.copyOf(params, params.length));
}
}

View File

@@ -0,0 +1,154 @@
package com.unity3d.services.store;
import com.unity3d.ads.core.extensions.JsonSerializableExtensionsKt;
import com.unity3d.services.store.gpbl.BillingResultResponseCode;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseHistoryRecordBridge;
import com.unity3d.services.store.gpbl.bridges.SkuDetailsBridge;
import com.unity3d.services.store.gpbl.listeners.StoreEventListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import org.json.JSONArray;
@SourceDebugExtension({"SMAP\nWebViewStoreEventListener.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WebViewStoreEventListener.kt\ncom/unity3d/services/store/WebViewStoreEventListener\n+ 2 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,110:1\n37#2,2:111\n37#2,2:113\n*S KotlinDebug\n*F\n+ 1 WebViewStoreEventListener.kt\ncom/unity3d/services/store/WebViewStoreEventListener\n*L\n85#1:111,2\n88#1:113,2\n*E\n"})
/* loaded from: classes4.dex */
public final class WebViewStoreEventListener implements StoreEventListener {
private final boolean isLifecycleListener;
private final int operationId;
private final StoreWebViewEventSender storeWebViewEventSender;
@Override // com.unity3d.services.store.gpbl.listeners.StoreEventListener
public int getOperationId() {
return this.operationId;
}
public WebViewStoreEventListener(int i, StoreWebViewEventSender storeWebViewEventSender, boolean z) {
Intrinsics.checkNotNullParameter(storeWebViewEventSender, "storeWebViewEventSender");
this.operationId = i;
this.storeWebViewEventSender = storeWebViewEventSender;
this.isLifecycleListener = z;
}
public /* synthetic */ WebViewStoreEventListener(int i, StoreWebViewEventSender storeWebViewEventSender, boolean z, int i2, DefaultConstructorMarker defaultConstructorMarker) {
this(i, storeWebViewEventSender, (i2 & 4) != 0 ? false : z);
}
@Override // com.unity3d.services.store.gpbl.listeners.BillingInitializationListener
public void onIsAlreadyInitialized() {
this.storeWebViewEventSender.send(StoreEvent.INITIALIZATION_REQUEST_RESULT, Integer.valueOf(BillingResultResponseCode.OK.getResponseCode()));
}
@Override // com.unity3d.services.store.gpbl.listeners.FeatureSupportedListener
public void onFeatureSupported(int i) {
this.storeWebViewEventSender.send(StoreEvent.IS_FEATURE_SUPPORTED_REQUEST_RESULT, Integer.valueOf(getOperationId()), Integer.valueOf(i));
}
@Override // com.unity3d.services.store.gpbl.listeners.BillingClientStateListener
public void onBillingSetupFinished(BillingResultBridge billingResult) {
Intrinsics.checkNotNullParameter(billingResult, "billingResult");
if (billingResult.getResponseCode() == BillingResultResponseCode.OK) {
StoreWebViewEventSender storeWebViewEventSender = this.storeWebViewEventSender;
StoreEvent storeEvent = StoreEvent.INITIALIZATION_REQUEST_RESULT;
BillingResultResponseCode responseCode = billingResult.getResponseCode();
Intrinsics.checkNotNullExpressionValue(responseCode, "billingResult.responseCode");
storeWebViewEventSender.send(storeEvent, responseCode);
return;
}
StoreWebViewEventSender storeWebViewEventSender2 = this.storeWebViewEventSender;
StoreEvent storeEvent2 = StoreEvent.INITIALIZATION_REQUEST_FAILED;
BillingResultResponseCode responseCode2 = billingResult.getResponseCode();
Intrinsics.checkNotNullExpressionValue(responseCode2, "billingResult.responseCode");
storeWebViewEventSender2.send(storeEvent2, responseCode2);
}
@Override // com.unity3d.services.store.gpbl.listeners.BillingClientStateListener
public void onBillingServiceDisconnected() {
this.storeWebViewEventSender.send(StoreEvent.DISCONNECTED_RESULT, new Object[0]);
}
@Override // com.unity3d.services.store.gpbl.listeners.PurchaseHistoryResponseListener
public void onPurchaseHistoryUpdated(BillingResultBridge billingResult, List<? extends PurchaseHistoryRecordBridge> list) {
JSONArray jSONArray;
Intrinsics.checkNotNullParameter(billingResult, "billingResult");
StoreWebViewEventSender storeWebViewEventSender = this.storeWebViewEventSender;
StoreEvent storeEvent = StoreEvent.PURCHASE_HISTORY_LIST_REQUEST_RESULT;
Object[] objArr = new Object[3];
objArr[0] = Integer.valueOf(getOperationId());
BillingResultResponseCode responseCode = billingResult.getResponseCode();
Intrinsics.checkNotNullExpressionValue(responseCode, "billingResult.responseCode");
objArr[1] = responseCode;
if (list == null || (jSONArray = JsonSerializableExtensionsKt.toJsonArray(list)) == null) {
jSONArray = new JSONArray();
}
objArr[2] = jSONArray;
storeWebViewEventSender.send(storeEvent, objArr);
}
@Override // com.unity3d.services.store.gpbl.listeners.SkuDetailsResponseListener
public void onSkuDetailsUpdated(BillingResultBridge billingResult, List<? extends SkuDetailsBridge> list) {
JSONArray jSONArray;
Intrinsics.checkNotNullParameter(billingResult, "billingResult");
StoreWebViewEventSender storeWebViewEventSender = this.storeWebViewEventSender;
StoreEvent storeEvent = StoreEvent.SKU_DETAILS_LIST_REQUEST_RESULT;
Object[] objArr = new Object[2];
objArr[0] = Integer.valueOf(getOperationId());
if (list == null || (jSONArray = JsonSerializableExtensionsKt.toJsonArray(list)) == null) {
jSONArray = new JSONArray();
}
objArr[1] = jSONArray;
storeWebViewEventSender.send(storeEvent, objArr);
}
@Override // com.unity3d.services.store.gpbl.listeners.PurchasesResponseListener
public void onPurchaseResponse(BillingResultBridge billingResult, List<? extends PurchaseBridge> list) {
JSONArray jSONArray;
Intrinsics.checkNotNullParameter(billingResult, "billingResult");
ArrayList arrayList = new ArrayList();
if (getOperationId() != -1) {
arrayList.add(Integer.valueOf(getOperationId()));
}
if (billingResult.getResponseCode() == BillingResultResponseCode.OK) {
if (list == null || (jSONArray = JsonSerializableExtensionsKt.toJsonArray(list)) == null) {
jSONArray = new JSONArray();
}
arrayList.add(jSONArray);
StoreWebViewEventSender storeWebViewEventSender = this.storeWebViewEventSender;
StoreEvent storeEvent = this.isLifecycleListener ? StoreEvent.PURCHASES_ON_RESUME_RESULT : StoreEvent.PURCHASES_REQUEST_RESULT;
Object[] array = arrayList.toArray(new Object[0]);
storeWebViewEventSender.send(storeEvent, Arrays.copyOf(array, array.length));
return;
}
arrayList.add(billingResult.getResponseCode());
StoreWebViewEventSender storeWebViewEventSender2 = this.storeWebViewEventSender;
StoreEvent storeEvent2 = this.isLifecycleListener ? StoreEvent.PURCHASES_ON_RESUME_ERROR : StoreEvent.PURCHASES_REQUEST_ERROR;
Object[] array2 = arrayList.toArray(new Object[0]);
storeWebViewEventSender2.send(storeEvent2, Arrays.copyOf(array2, array2.length));
}
@Override // com.unity3d.services.store.gpbl.listeners.PurchaseUpdatedResponseListener
public void onPurchaseUpdated(BillingResultBridge billingResult, List<? extends PurchaseBridge> list) {
JSONArray jSONArray;
Intrinsics.checkNotNullParameter(billingResult, "billingResult");
if (billingResult.getResponseCode() == BillingResultResponseCode.OK) {
StoreWebViewEventSender storeWebViewEventSender = this.storeWebViewEventSender;
StoreEvent storeEvent = StoreEvent.PURCHASES_UPDATED_RESULT;
Object[] objArr = new Object[1];
if (list == null || (jSONArray = JsonSerializableExtensionsKt.toJsonArray(list)) == null) {
jSONArray = new JSONArray();
}
objArr[0] = jSONArray;
storeWebViewEventSender.send(storeEvent, objArr);
return;
}
StoreWebViewEventSender storeWebViewEventSender2 = this.storeWebViewEventSender;
StoreEvent storeEvent2 = StoreEvent.PURCHASES_UPDATED_ERROR;
BillingResultResponseCode responseCode = billingResult.getResponseCode();
Intrinsics.checkNotNullExpressionValue(responseCode, "billingResult.responseCode");
storeWebViewEventSender2.send(storeEvent2, responseCode);
}
}

View File

@@ -0,0 +1,14 @@
package com.unity3d.services.store.core;
import com.unity3d.services.store.StoreEvent;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class GatewayStoreExceptionHandler implements StoreExceptionHandler {
@Override // com.unity3d.services.store.core.StoreExceptionHandler
public void handleStoreException(StoreEvent storeEvent, int i, Exception exception) {
Intrinsics.checkNotNullParameter(storeEvent, "storeEvent");
Intrinsics.checkNotNullParameter(exception, "exception");
throw exception;
}
}

View File

@@ -0,0 +1,38 @@
package com.unity3d.services.store.core;
import com.unity3d.services.store.StoreWebViewEventSender;
import com.unity3d.services.store.WebViewStoreEventListener;
import com.unity3d.services.store.gpbl.listeners.StoreEventListener;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class StoreEventListenerFactory {
private final StoreWebViewEventSender storeWebViewEventSender;
public final StoreEventListener invoke() {
return invoke$default(this, 0, false, 3, null);
}
public final StoreEventListener invoke(int i) {
return invoke$default(this, i, false, 2, null);
}
public StoreEventListenerFactory(StoreWebViewEventSender storeWebViewEventSender) {
Intrinsics.checkNotNullParameter(storeWebViewEventSender, "storeWebViewEventSender");
this.storeWebViewEventSender = storeWebViewEventSender;
}
public static /* synthetic */ StoreEventListener invoke$default(StoreEventListenerFactory storeEventListenerFactory, int i, boolean z, int i2, Object obj) {
if ((i2 & 1) != 0) {
i = -1;
}
if ((i2 & 2) != 0) {
z = false;
}
return storeEventListenerFactory.invoke(i, z);
}
public final StoreEventListener invoke(int i, boolean z) {
return new WebViewStoreEventListener(i, this.storeWebViewEventSender, z);
}
}

View File

@@ -0,0 +1,8 @@
package com.unity3d.services.store.core;
import com.unity3d.services.store.StoreEvent;
/* loaded from: classes4.dex */
public interface StoreExceptionHandler {
void handleStoreException(StoreEvent storeEvent, int i, Exception exc);
}

View File

@@ -0,0 +1,71 @@
package com.unity3d.services.store.core;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import com.unity3d.services.core.log.DeviceLog;
import com.unity3d.services.store.gpbl.StoreBilling;
import com.unity3d.services.store.gpbl.listeners.StoreEventListener;
import java.util.ArrayList;
import java.util.Iterator;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class StoreLifecycleListener implements Application.ActivityLifecycleCallbacks {
private final ArrayList<String> _purchaseTypes;
private final StoreBilling _storeBilling;
private final StoreEventListener _storeEventListener;
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
Intrinsics.checkNotNullParameter(activity, "activity");
Intrinsics.checkNotNullParameter(outState, "outState");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
public StoreLifecycleListener(ArrayList<String> _purchaseTypes, StoreBilling _storeBilling, StoreEventListener _storeEventListener) {
Intrinsics.checkNotNullParameter(_purchaseTypes, "_purchaseTypes");
Intrinsics.checkNotNullParameter(_storeBilling, "_storeBilling");
Intrinsics.checkNotNullParameter(_storeEventListener, "_storeEventListener");
this._purchaseTypes = _purchaseTypes;
this._storeBilling = _storeBilling;
this._storeEventListener = _storeEventListener;
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
try {
Iterator<String> it = this._purchaseTypes.iterator();
while (it.hasNext()) {
this._storeBilling.getPurchases(it.next(), this._storeEventListener);
}
} catch (ClassNotFoundException e) {
DeviceLog.warning("Couldn't fetch purchases onActivityResumed. " + e.getMessage());
}
}
}

View File

@@ -0,0 +1,20 @@
package com.unity3d.services.store.core;
import com.unity3d.scar.adapter.common.WebViewAdsError;
import com.unity3d.services.core.webview.WebViewEventCategory;
import java.util.Arrays;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class StoreWebViewError extends WebViewAdsError {
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public StoreWebViewError(Enum<?> r2, String str, Object... errorArguments) {
super(r2, str, Arrays.copyOf(errorArguments, errorArguments.length));
Intrinsics.checkNotNullParameter(errorArguments, "errorArguments");
}
@Override // com.unity3d.scar.adapter.common.WebViewAdsError, com.unity3d.scar.adapter.common.IUnityAdsError
public String getDomain() {
return WebViewEventCategory.STORE.name();
}
}

View File

@@ -0,0 +1,34 @@
package com.unity3d.services.store.core;
import com.unity3d.scar.adapter.common.WebViewAdsError;
import com.unity3d.services.ads.gmascar.handlers.WebViewErrorHandler;
import com.unity3d.services.store.StoreError;
import com.unity3d.services.store.StoreEvent;
import java.lang.reflect.InvocationTargetException;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
/* loaded from: classes4.dex */
public final class WebViewStoreExceptionHandler implements StoreExceptionHandler {
private final WebViewErrorHandler _webViewErrorHandler;
public WebViewStoreExceptionHandler(WebViewErrorHandler _webViewErrorHandler) {
Intrinsics.checkNotNullParameter(_webViewErrorHandler, "_webViewErrorHandler");
this._webViewErrorHandler = _webViewErrorHandler;
}
@Override // com.unity3d.services.store.core.StoreExceptionHandler
public void handleStoreException(StoreEvent storeEvent, int i, Exception exception) {
Intrinsics.checkNotNullParameter(storeEvent, "storeEvent");
Intrinsics.checkNotNullParameter(exception, "exception");
sendErrorToWebView(storeEvent, getStoreError(exception), i, exception);
}
private final void sendErrorToWebView(StoreEvent storeEvent, StoreError storeError, int i, Exception exc) {
this._webViewErrorHandler.handleError((WebViewAdsError) new StoreWebViewError(storeEvent, exc.getMessage(), Integer.valueOf(i), storeError, exc.getMessage()));
}
private final StoreError getStoreError(Exception exc) {
return exc instanceof NoSuchMethodException ? StoreError.NO_SUCH_METHOD : exc instanceof IllegalAccessException ? StoreError.ILLEGAL_ACCESS : exc instanceof JSONException ? StoreError.JSON_ERROR : exc instanceof InvocationTargetException ? StoreError.INVOCATION_TARGET : exc instanceof ClassNotFoundException ? StoreError.CLASS_NOT_FOUND : StoreError.UNKNOWN_ERROR;
}
}

View File

@@ -0,0 +1,128 @@
package com.unity3d.services.store.core.api;
import com.unity3d.services.ads.gmascar.handlers.WebViewErrorHandler;
import com.unity3d.services.core.misc.Utilities;
import com.unity3d.services.core.webview.bridge.WebViewCallback;
import com.unity3d.services.core.webview.bridge.WebViewExposed;
import com.unity3d.services.store.StoreError;
import com.unity3d.services.store.StoreEvent;
import com.unity3d.services.store.StoreMonitor;
import com.unity3d.services.store.core.StoreEventListenerFactory;
import com.unity3d.services.store.core.WebViewStoreExceptionHandler;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
/* loaded from: classes4.dex */
public class Store {
private static final WebViewStoreExceptionHandler WEB_VIEW_STORE_EXCEPTION_HANDLER;
private static final StoreEventListenerFactory storeEventListenerFactory;
private static final StoreMonitor storeMonitor;
static {
WebViewStoreExceptionHandler webViewStoreExceptionHandler = new WebViewStoreExceptionHandler(new WebViewErrorHandler());
WEB_VIEW_STORE_EXCEPTION_HANDLER = webViewStoreExceptionHandler;
storeEventListenerFactory = (StoreEventListenerFactory) Utilities.getService(StoreEventListenerFactory.class);
storeMonitor = new StoreMonitor(webViewStoreExceptionHandler);
}
@WebViewExposed
public static void initialize(WebViewCallback webViewCallback) {
try {
storeMonitor.initialize(storeEventListenerFactory.invoke());
webViewCallback.invoke(new Object[0]);
} catch (Exception e) {
webViewCallback.error(StoreError.UNKNOWN_ERROR, e.getMessage(), e.getClass().getName());
}
}
@WebViewExposed
public static void startPurchaseTracking(JSONArray jSONArray, WebViewCallback webViewCallback) {
if (!storeMonitor.isInitialized()) {
webViewCallback.error(StoreError.NOT_INITIALIZED, new Object[0]);
return;
}
ArrayList<String> arrayList = new ArrayList<>();
for (int i = 0; i < jSONArray.length(); i++) {
try {
arrayList.add(jSONArray.getString(i));
} catch (JSONException e) {
webViewCallback.error(StoreError.JSON_ERROR, e.getMessage());
return;
}
}
storeMonitor.startPurchaseTracking(arrayList, storeEventListenerFactory.invoke(-1, true));
webViewCallback.invoke(new Object[0]);
}
@WebViewExposed
public static void stopPurchaseTracking(WebViewCallback webViewCallback) {
StoreMonitor storeMonitor2 = storeMonitor;
if (!storeMonitor2.isInitialized()) {
webViewCallback.error(StoreError.NOT_INITIALIZED, new Object[0]);
} else {
storeMonitor2.stopPurchaseTracking();
webViewCallback.invoke(new Object[0]);
}
}
@WebViewExposed
public static void isFeatureSupported(final Integer num, final String str, WebViewCallback webViewCallback) {
if (!storeMonitor.isInitialized()) {
webViewCallback.error(StoreError.NOT_INITIALIZED, new Object[0]);
} else {
new Thread(new Runnable() { // from class: com.unity3d.services.store.core.api.Store$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
Store.lambda$isFeatureSupported$0(num, str);
}
}).start();
webViewCallback.invoke(new Object[0]);
}
}
/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ void lambda$isFeatureSupported$0(Integer num, String str) {
storeMonitor.isFeatureSupported(num.intValue(), str, storeEventListenerFactory.invoke(num.intValue()));
}
@WebViewExposed
public static void getPurchases(Integer num, String str, WebViewCallback webViewCallback) {
StoreMonitor storeMonitor2 = storeMonitor;
if (!storeMonitor2.isInitialized()) {
webViewCallback.error(StoreError.NOT_INITIALIZED, new Object[0]);
} else {
storeMonitor2.getPurchases(num.intValue(), str, storeEventListenerFactory.invoke(num.intValue()));
webViewCallback.invoke(new Object[0]);
}
}
@WebViewExposed
public static void getPurchaseHistory(Integer num, String str, Integer num2, WebViewCallback webViewCallback) {
StoreMonitor storeMonitor2 = storeMonitor;
if (!storeMonitor2.isInitialized()) {
webViewCallback.error(StoreError.NOT_INITIALIZED, new Object[0]);
} else {
storeMonitor2.getPurchaseHistory(num.intValue(), str, num2.intValue(), storeEventListenerFactory.invoke(num.intValue()));
webViewCallback.invoke(new Object[0]);
}
}
@WebViewExposed
public static void getSkuDetails(Integer num, String str, JSONArray jSONArray, WebViewCallback webViewCallback) {
if (!storeMonitor.isInitialized()) {
webViewCallback.error(StoreError.NOT_INITIALIZED, new Object[0]);
return;
}
try {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < jSONArray.length(); i++) {
arrayList.add(jSONArray.getString(i));
}
storeMonitor.getSkuDetails(num.intValue(), str, arrayList, storeEventListenerFactory.invoke(num.intValue()));
} catch (JSONException e) {
WEB_VIEW_STORE_EXCEPTION_HANDLER.handleStoreException(StoreEvent.SKU_DETAILS_LIST_REQUEST_ERROR, num.intValue(), e);
}
webViewCallback.invoke(new Object[0]);
}
}

View File

@@ -0,0 +1,31 @@
package com.unity3d.services.store.core.configuration;
import com.unity3d.services.core.configuration.Configuration;
import com.unity3d.services.core.configuration.ErrorState;
import com.unity3d.services.core.configuration.IModuleConfiguration;
import com.unity3d.services.store.core.api.Store;
/* loaded from: classes4.dex */
public class StoreModuleConfiguration implements IModuleConfiguration {
private static final Class[] WEB_APP_API_CLASS_LIST = {Store.class};
@Override // com.unity3d.services.core.configuration.IModuleConfiguration
public Class[] getWebAppApiClassList() {
return WEB_APP_API_CLASS_LIST;
}
@Override // com.unity3d.services.core.configuration.IModuleConfiguration
public boolean initCompleteState(Configuration configuration) {
return true;
}
@Override // com.unity3d.services.core.configuration.IModuleConfiguration
public boolean initErrorState(Configuration configuration, ErrorState errorState, String str) {
return true;
}
@Override // com.unity3d.services.core.configuration.IModuleConfiguration
public boolean resetState(Configuration configuration) {
return true;
}
}

View File

@@ -0,0 +1,41 @@
package com.unity3d.services.store.gpbl;
import androidx.annotation.NonNull;
/* loaded from: classes4.dex */
public enum BillingResultResponseCode {
UNKNOWN(-100),
SERVICE_TIMEOUT(-3),
FEATURE_NOT_SUPPORTED(-2),
SERVICE_DISCONNECTED(-1),
OK(0),
USER_CANCELED(1),
SERVICE_UNAVAILABLE(2),
BILLING_UNAVAILABLE(3),
ITEM_UNAVAILABLE(4),
DEVELOPER_ERROR(5),
ERROR(6),
ITEM_ALREADY_OWNED(7),
ITEM_NOT_OWNED(8),
NETWORK_ERROR(12);
private final int _responseCode;
public int getResponseCode() {
return this._responseCode;
}
BillingResultResponseCode(int i) {
this._responseCode = i;
}
@NonNull
public static BillingResultResponseCode fromResponseCode(int i) {
for (BillingResultResponseCode billingResultResponseCode : values()) {
if (billingResultResponseCode.getResponseCode() == i) {
return billingResultResponseCode;
}
}
return UNKNOWN;
}
}

View File

@@ -0,0 +1,8 @@
package com.unity3d.services.store.gpbl;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public interface IBillingResponse {
JSONObject getOriginalJson();
}

View File

@@ -0,0 +1,80 @@
package com.unity3d.services.store.gpbl;
import android.content.Context;
import com.unity3d.services.store.gpbl.bridges.SkuDetailsParamsBridge;
import com.unity3d.services.store.gpbl.bridges.billingclient.BillingClientBuilderFactory;
import com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient;
import com.unity3d.services.store.gpbl.listeners.BillingClientStateListener;
import com.unity3d.services.store.gpbl.listeners.PurchaseHistoryResponseListener;
import com.unity3d.services.store.gpbl.listeners.PurchaseUpdatedResponseListener;
import com.unity3d.services.store.gpbl.listeners.PurchasesResponseListener;
import com.unity3d.services.store.gpbl.listeners.SkuDetailsResponseListener;
import com.unity3d.services.store.gpbl.proxies.BillingClientStateListenerProxy;
import com.unity3d.services.store.gpbl.proxies.PurchaseHistoryResponseListenerProxy;
import com.unity3d.services.store.gpbl.proxies.PurchaseUpdatedListenerProxy;
import com.unity3d.services.store.gpbl.proxies.PurchasesResponseListenerProxy;
import com.unity3d.services.store.gpbl.proxies.SkuDetailsResponseListenerProxy;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
/* loaded from: classes4.dex */
public class StoreBilling {
private final IBillingClient _billingClientBridge;
public StoreBilling(Context context, PurchaseUpdatedResponseListener purchaseUpdatedResponseListener) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
this._billingClientBridge = BillingClientBuilderFactory.getBillingClientBuilder(context).setListener(new PurchaseUpdatedListenerProxy(purchaseUpdatedResponseListener)).enablePendingPurchases().build();
}
public void initialize(BillingClientStateListener billingClientStateListener) throws ClassNotFoundException {
this._billingClientBridge.startConnection(new BillingClientStateListenerProxy(billingClientStateListener));
}
/* JADX WARN: Removed duplicated region for block: B:5:0x0027 A[ORIG_RETURN, RETURN] */
/* JADX WARN: Removed duplicated region for block: B:7:0x0025 A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public int isFeatureSupported(java.lang.String r2) {
/*
r1 = this;
java.lang.String r0 = "inapp"
boolean r0 = r2.equals(r0)
if (r0 == 0) goto L11
com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient r2 = r1._billingClientBridge
boolean r2 = r2.isReady()
if (r2 == 0) goto L27
goto L25
L11:
java.lang.String r0 = "subs"
boolean r0 = r2.equals(r0)
if (r0 == 0) goto L1b
java.lang.String r2 = "subscriptions"
L1b:
com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient r0 = r1._billingClientBridge
com.unity3d.services.store.gpbl.BillingResultResponseCode r2 = r0.isFeatureSupported(r2)
com.unity3d.services.store.gpbl.BillingResultResponseCode r0 = com.unity3d.services.store.gpbl.BillingResultResponseCode.OK
if (r2 != r0) goto L27
L25:
r2 = 0
goto L28
L27:
r2 = -1
L28:
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.unity3d.services.store.gpbl.StoreBilling.isFeatureSupported(java.lang.String):int");
}
public void getPurchases(String str, PurchasesResponseListener purchasesResponseListener) throws ClassNotFoundException {
this._billingClientBridge.queryPurchasesAsync(str, new PurchasesResponseListenerProxy(purchasesResponseListener));
}
public void getSkuDetails(String str, List<String> list, SkuDetailsResponseListener skuDetailsResponseListener) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
this._billingClientBridge.querySkuDetailsAsync(SkuDetailsParamsBridge.newBuilder().setSkuList(list).setType(str).build(), new SkuDetailsResponseListenerProxy(skuDetailsResponseListener));
}
public void getPurchaseHistory(String str, int i, PurchaseHistoryResponseListener purchaseHistoryResponseListener) throws ClassNotFoundException {
this._billingClientBridge.queryPurchaseHistoryAsync(str, new PurchaseHistoryResponseListenerProxy(purchaseHistoryResponseListener, i));
}
}

View File

@@ -0,0 +1,31 @@
package com.unity3d.services.store.gpbl.bridges;
import androidx.annotation.NonNull;
import com.unity3d.services.core.reflection.GenericBridge;
import com.unity3d.services.store.gpbl.BillingResultResponseCode;
import java.util.HashMap;
/* loaded from: classes4.dex */
public class BillingResultBridge extends GenericBridge {
private static final String getResponseCodeMethodName = "getResponseCode";
private final Object _billingResult;
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.BillingResult";
}
public BillingResultBridge(Object obj) {
super(new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.BillingResultBridge.1
{
put(BillingResultBridge.getResponseCodeMethodName, new Class[0]);
}
});
this._billingResult = obj;
}
@NonNull
public BillingResultResponseCode getResponseCode() {
return BillingResultResponseCode.fromResponseCode(((Integer) callNonVoidMethod(getResponseCodeMethodName, this._billingResult, new Object[0])).intValue());
}
}

View File

@@ -0,0 +1,49 @@
package com.unity3d.services.store.gpbl.bridges;
import com.unity3d.services.core.log.DeviceLog;
import com.unity3d.services.core.reflection.GenericBridge;
import com.unity3d.services.store.JsonSerializable;
import com.unity3d.services.store.gpbl.IBillingResponse;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public abstract class CommonJsonResponseBridge extends GenericBridge implements IBillingResponse, JsonSerializable {
private static final String getOriginalJsonMethodName = "getOriginalJson";
private final Object _internalBridgeRef;
public CommonJsonResponseBridge(Object obj) {
this(obj, new HashMap());
}
public CommonJsonResponseBridge(Object obj, Map<String, Class<?>[]> map) {
super(appendCommonResponseMethods(map));
this._internalBridgeRef = obj;
}
private static Map<String, Class<?>[]> appendCommonResponseMethods(Map<String, Class<?>[]> map) {
map.putAll(new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.CommonJsonResponseBridge.1
{
put(CommonJsonResponseBridge.getOriginalJsonMethodName, new Class[0]);
}
});
return map;
}
@Override // com.unity3d.services.store.gpbl.IBillingResponse
public JSONObject getOriginalJson() {
try {
return new JSONObject((String) callNonVoidMethod(getOriginalJsonMethodName, this._internalBridgeRef, new Object[0]));
} catch (JSONException e) {
DeviceLog.error("Couldn't parse BillingResponse JSON : %s", e.getMessage());
return null;
}
}
@Override // com.unity3d.services.store.JsonSerializable
public JSONObject toJson() {
return getOriginalJson();
}
}

View File

@@ -0,0 +1,43 @@
package com.unity3d.services.store.gpbl.bridges;
import com.unity3d.ads.metadata.InAppPurchaseMetaData;
import com.unity3d.services.core.log.DeviceLog;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class PurchaseBridge extends CommonJsonResponseBridge {
private static final String getSignatureMethodName = "getSignature";
private final Object _purchase;
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.Purchase";
}
public PurchaseBridge(Object obj) {
super(obj, new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.PurchaseBridge.1
{
put(PurchaseBridge.getSignatureMethodName, new Class[0]);
}
});
this._purchase = obj;
}
public String getSignature() {
return (String) callNonVoidMethod(getSignatureMethodName, this._purchase, new Object[0]);
}
@Override // com.unity3d.services.store.gpbl.bridges.CommonJsonResponseBridge, com.unity3d.services.store.JsonSerializable
public JSONObject toJson() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("purchaseData", getOriginalJson());
jSONObject.put(InAppPurchaseMetaData.KEY_SIGNATURE, getSignature());
} catch (JSONException e) {
DeviceLog.warning("Could not build Purchase result Json: ", e.getMessage());
}
return jSONObject;
}
}

View File

@@ -0,0 +1,13 @@
package com.unity3d.services.store.gpbl.bridges;
/* loaded from: classes4.dex */
public class PurchaseHistoryRecordBridge extends CommonJsonResponseBridge {
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.PurchaseHistoryRecord";
}
public PurchaseHistoryRecordBridge(Object obj) {
super(obj);
}
}

View File

@@ -0,0 +1,45 @@
package com.unity3d.services.store.gpbl.bridges;
import com.unity3d.services.core.reflection.GenericBridge;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes4.dex */
public class PurchasesResultBridge extends GenericBridge {
private static final String getBillingResultMethodName = "getBillingResult";
private static final String getPurchasesListMethodName = "getPurchasesList";
private final Object _purchasesResult;
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.Purchase$PurchasesResult";
}
public PurchasesResultBridge(Object obj) {
super(new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.PurchasesResultBridge.1
{
put(PurchasesResultBridge.getBillingResultMethodName, new Class[0]);
put(PurchasesResultBridge.getPurchasesListMethodName, new Class[0]);
}
});
this._purchasesResult = obj;
}
public BillingResultBridge getBillingResult() {
return new BillingResultBridge(callNonVoidMethod(getBillingResultMethodName, this._purchasesResult, new Object[0]));
}
public List<PurchaseBridge> getPurchasesList() {
List list = (List) callNonVoidMethod(getPurchasesListMethodName, this._purchasesResult, new Object[0]);
ArrayList arrayList = new ArrayList();
if (list != null) {
Iterator it = list.iterator();
while (it.hasNext()) {
arrayList.add(new PurchaseBridge(it.next()));
}
}
return arrayList;
}
}

View File

@@ -0,0 +1,13 @@
package com.unity3d.services.store.gpbl.bridges;
/* loaded from: classes4.dex */
public class SkuDetailsBridge extends CommonJsonResponseBridge {
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.SkuDetails";
}
public SkuDetailsBridge(Object obj) {
super(obj);
}
}

View File

@@ -0,0 +1,86 @@
package com.unity3d.services.store.gpbl.bridges;
import com.android.billingclient.api.SkuDetailsParams;
import com.unity3d.services.core.reflection.GenericBridge;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/* loaded from: classes4.dex */
public class SkuDetailsParamsBridge extends GenericBridge {
private static final String newBuilderMethodName = "newBuilder";
private static final Map<String, Class<?>[]> staticMethods = new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.SkuDetailsParamsBridge.1
{
put(SkuDetailsParamsBridge.newBuilderMethodName, new Class[0]);
}
};
private final Object _skuDetailsParamsInternalInstance;
public static Class<?> getClassForBridge() throws ClassNotFoundException {
return SkuDetailsParams.class;
}
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.SkuDetailsParams";
}
public Object getInternalInstance() {
return this._skuDetailsParamsInternalInstance;
}
public SkuDetailsParamsBridge(Object obj) {
super(new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.SkuDetailsParamsBridge.2
{
put(SkuDetailsParamsBridge.newBuilderMethodName, new Class[0]);
}
});
this._skuDetailsParamsInternalInstance = obj;
}
public static BuilderBridge newBuilder() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException {
return new BuilderBridge(callNonVoidStaticMethod(newBuilderMethodName, new Object[0]));
}
public static Object callNonVoidStaticMethod(String str, Object... objArr) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, NoSuchMethodException {
return getClassForBridge().getMethod(str, staticMethods.get(str)).invoke(null, objArr);
}
public static class BuilderBridge extends GenericBridge {
private static final String buildMethodName = "build";
private static final String setSkusListMethodName = "setSkusList";
private static final String setTypeMethodName = "setType";
private Object _skuDetailsParamsBuilderInternalInstance;
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.SkuDetailsParams$Builder";
}
public BuilderBridge(Object obj) {
super(new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.SkuDetailsParamsBridge.BuilderBridge.1
{
put(BuilderBridge.buildMethodName, new Class[0]);
put(BuilderBridge.setSkusListMethodName, new Class[]{List.class});
put(BuilderBridge.setTypeMethodName, new Class[]{String.class});
}
});
this._skuDetailsParamsBuilderInternalInstance = obj;
}
public BuilderBridge setSkuList(List<String> list) {
this._skuDetailsParamsBuilderInternalInstance = callNonVoidMethod(setSkusListMethodName, this._skuDetailsParamsBuilderInternalInstance, list);
return this;
}
public BuilderBridge setType(String str) {
this._skuDetailsParamsBuilderInternalInstance = callNonVoidMethod(setTypeMethodName, this._skuDetailsParamsBuilderInternalInstance, str);
return this;
}
public SkuDetailsParamsBridge build() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException {
return new SkuDetailsParamsBridge(callNonVoidMethod(buildMethodName, this._skuDetailsParamsBuilderInternalInstance, new Object[0]));
}
}
}

View File

@@ -0,0 +1,12 @@
package com.unity3d.services.store.gpbl.bridges.billingclient;
import android.content.Context;
import com.unity3d.services.store.gpbl.bridges.billingclient.v4.BillingClientBridge;
import java.lang.reflect.InvocationTargetException;
/* loaded from: classes4.dex */
public class BillingClientBuilderFactory {
public static IBillingClientBuilderBridge getBillingClientBuilder(Context context) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
return BillingClientBridge.newBuilder(context);
}
}

View File

@@ -0,0 +1,23 @@
package com.unity3d.services.store.gpbl.bridges.billingclient;
import com.unity3d.services.store.gpbl.BillingResultResponseCode;
import com.unity3d.services.store.gpbl.bridges.SkuDetailsParamsBridge;
import com.unity3d.services.store.gpbl.proxies.BillingClientStateListenerProxy;
import com.unity3d.services.store.gpbl.proxies.PurchaseHistoryResponseListenerProxy;
import com.unity3d.services.store.gpbl.proxies.PurchasesResponseListenerProxy;
import com.unity3d.services.store.gpbl.proxies.SkuDetailsResponseListenerProxy;
/* loaded from: classes4.dex */
public interface IBillingClient {
BillingResultResponseCode isFeatureSupported(String str);
boolean isReady();
void queryPurchaseHistoryAsync(String str, PurchaseHistoryResponseListenerProxy purchaseHistoryResponseListenerProxy) throws ClassNotFoundException;
void queryPurchasesAsync(String str, PurchasesResponseListenerProxy purchasesResponseListenerProxy) throws ClassNotFoundException;
void querySkuDetailsAsync(SkuDetailsParamsBridge skuDetailsParamsBridge, SkuDetailsResponseListenerProxy skuDetailsResponseListenerProxy) throws ClassNotFoundException;
void startConnection(BillingClientStateListenerProxy billingClientStateListenerProxy) throws ClassNotFoundException;
}

View File

@@ -0,0 +1,13 @@
package com.unity3d.services.store.gpbl.bridges.billingclient;
import com.unity3d.services.store.gpbl.proxies.PurchaseUpdatedListenerProxy;
import java.lang.reflect.InvocationTargetException;
/* loaded from: classes4.dex */
public interface IBillingClientBuilderBridge {
IBillingClient build() throws ClassNotFoundException;
IBillingClientBuilderBridge enablePendingPurchases();
IBillingClientBuilderBridge setListener(PurchaseUpdatedListenerProxy purchaseUpdatedListenerProxy) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException;
}

View File

@@ -0,0 +1,94 @@
package com.unity3d.services.store.gpbl.bridges.billingclient.common;
import android.content.Context;
import com.android.billingclient.api.BillingClient;
import com.unity3d.services.core.reflection.GenericBridge;
import com.unity3d.services.store.gpbl.BillingResultResponseCode;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.SkuDetailsParamsBridge;
import com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient;
import com.unity3d.services.store.gpbl.proxies.BillingClientStateListenerProxy;
import com.unity3d.services.store.gpbl.proxies.PurchaseHistoryResponseListenerProxy;
import com.unity3d.services.store.gpbl.proxies.SkuDetailsResponseListenerProxy;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public abstract class BillingClientBridgeCommon extends GenericBridge implements IBillingClient {
protected static final String endConnectionMethodName = "endConnection";
protected static final String isFeatureSupportedMethodName = "isFeatureSupported";
protected static final String isReadyMethodName = "isReady";
protected static final String newBuilderMethodName = "newBuilder";
protected static final String queryPurchaseHistoryAsyncMethodName = "queryPurchaseHistoryAsync";
protected static final String querySkuDetailsAsyncMethodName = "querySkuDetailsAsync";
protected static final String startConnectionMethodName = "startConnection";
private static final Map<String, Class<?>[]> staticMethods = new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.billingclient.common.BillingClientBridgeCommon.1
{
put(BillingClientBridgeCommon.newBuilderMethodName, new Class[]{Context.class});
}
};
protected final Object _billingClientInternalInstance;
public static Class<?> getClassForBridge() throws ClassNotFoundException {
return BillingClient.class;
}
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.BillingClient";
}
public BillingClientBridgeCommon(Object obj, Map<String, Class<?>[]> map) throws ClassNotFoundException {
super(appendFunctionAnParameters(map));
this._billingClientInternalInstance = obj;
}
private static Map<String, Class<?>[]> appendFunctionAnParameters(Map<String, Class<?>[]> map) throws ClassNotFoundException {
map.putAll(new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.billingclient.common.BillingClientBridgeCommon.2
{
put(BillingClientBridgeCommon.newBuilderMethodName, new Class[]{Context.class});
put(BillingClientBridgeCommon.startConnectionMethodName, new Class[]{BillingClientStateListenerProxy.getProxyListenerClass()});
put(BillingClientBridgeCommon.endConnectionMethodName, new Class[0]);
put(BillingClientBridgeCommon.querySkuDetailsAsyncMethodName, new Class[]{SkuDetailsParamsBridge.getClassForBridge(), SkuDetailsResponseListenerProxy.getProxyListenerClass()});
put(BillingClientBridgeCommon.queryPurchaseHistoryAsyncMethodName, new Class[]{String.class, PurchaseHistoryResponseListenerProxy.getProxyListenerClass()});
put(BillingClientBridgeCommon.isFeatureSupportedMethodName, new Class[]{String.class});
put(BillingClientBridgeCommon.isReadyMethodName, new Class[0]);
}
});
return map;
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient
public void startConnection(BillingClientStateListenerProxy billingClientStateListenerProxy) throws ClassNotFoundException {
callVoidMethod(startConnectionMethodName, this._billingClientInternalInstance, billingClientStateListenerProxy.getProxyInstance());
}
public void endConnection() {
callVoidMethod(endConnectionMethodName, this._billingClientInternalInstance, new Object[0]);
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient
public BillingResultResponseCode isFeatureSupported(String str) {
return new BillingResultBridge(callNonVoidMethod(isFeatureSupportedMethodName, this._billingClientInternalInstance, str)).getResponseCode();
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient
public boolean isReady() {
return ((Boolean) callNonVoidMethod(isReadyMethodName, this._billingClientInternalInstance, new Object[0])).booleanValue();
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient
public void querySkuDetailsAsync(SkuDetailsParamsBridge skuDetailsParamsBridge, SkuDetailsResponseListenerProxy skuDetailsResponseListenerProxy) throws ClassNotFoundException {
callVoidMethod(querySkuDetailsAsyncMethodName, this._billingClientInternalInstance, skuDetailsParamsBridge.getInternalInstance(), skuDetailsResponseListenerProxy.getProxyInstance());
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient
public void queryPurchaseHistoryAsync(String str, PurchaseHistoryResponseListenerProxy purchaseHistoryResponseListenerProxy) throws ClassNotFoundException {
callVoidMethod(queryPurchaseHistoryAsyncMethodName, this._billingClientInternalInstance, str, purchaseHistoryResponseListenerProxy.getProxyInstance());
}
public static Object callNonVoidStaticMethod(String str, Object... objArr) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, NoSuchMethodException {
return getClassForBridge().getMethod(str, staticMethods.get(str)).invoke(null, objArr);
}
}

View File

@@ -0,0 +1,43 @@
package com.unity3d.services.store.gpbl.bridges.billingclient.common;
import com.unity3d.services.core.reflection.GenericBridge;
import com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClientBuilderBridge;
import com.unity3d.services.store.gpbl.proxies.PurchaseUpdatedListenerProxy;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
/* loaded from: classes4.dex */
public abstract class BillingClientBuilderBridgeCommon extends GenericBridge implements IBillingClientBuilderBridge {
protected static final String buildMethodName = "build";
private static final String enablePendingPurchasesMethodName = "enablePendingPurchases";
private static final String setListenerMethodName = "setListener";
protected Object _billingClientBuilderInternalInstance;
@Override // com.unity3d.services.core.reflection.GenericBridge
public String getClassName() {
return "com.android.billingclient.api.BillingClient$Builder";
}
public BillingClientBuilderBridgeCommon(Object obj) throws ClassNotFoundException {
super(new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.billingclient.common.BillingClientBuilderBridgeCommon.1
{
put(BillingClientBuilderBridgeCommon.setListenerMethodName, new Class[]{PurchaseUpdatedListenerProxy.getProxyListenerClass()});
put(BillingClientBuilderBridgeCommon.enablePendingPurchasesMethodName, new Class[0]);
put(BillingClientBuilderBridgeCommon.buildMethodName, new Class[0]);
}
});
this._billingClientBuilderInternalInstance = obj;
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClientBuilderBridge
public IBillingClientBuilderBridge setListener(PurchaseUpdatedListenerProxy purchaseUpdatedListenerProxy) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
this._billingClientBuilderInternalInstance = callNonVoidMethod(setListenerMethodName, this._billingClientBuilderInternalInstance, purchaseUpdatedListenerProxy.getProxyInstance());
return this;
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClientBuilderBridge
public IBillingClientBuilderBridge enablePendingPurchases() {
this._billingClientBuilderInternalInstance = callNonVoidMethod(enablePendingPurchasesMethodName, this._billingClientBuilderInternalInstance, new Object[0]);
return this;
}
}

View File

@@ -0,0 +1,50 @@
package com.unity3d.services.store.gpbl.bridges.billingclient.v4;
import android.content.Context;
import com.unity3d.services.store.gpbl.bridges.billingclient.common.BillingClientBridgeCommon;
import com.unity3d.services.store.gpbl.bridges.billingclient.common.BillingClientBuilderBridgeCommon;
import com.unity3d.services.store.gpbl.proxies.PurchasesResponseListenerProxy;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
/* loaded from: classes4.dex */
public class BillingClientBridge extends BillingClientBridgeCommon {
private static final String queryPurchasesAsyncMethodName = "queryPurchasesAsync";
public BillingClientBridge(Object obj) throws ClassNotFoundException {
super(obj, new HashMap<String, Class<?>[]>() { // from class: com.unity3d.services.store.gpbl.bridges.billingclient.v4.BillingClientBridge.1
{
put(BillingClientBridge.queryPurchasesAsyncMethodName, new Class[]{String.class, PurchasesResponseListenerProxy.getProxyListenerClass()});
}
});
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClient
public void queryPurchasesAsync(String str, PurchasesResponseListenerProxy purchasesResponseListenerProxy) throws ClassNotFoundException {
callVoidMethod(queryPurchasesAsyncMethodName, this._billingClientInternalInstance, str, purchasesResponseListenerProxy.getProxyInstance());
}
public static boolean isAvailable() {
try {
BillingClientBridgeCommon.getClassForBridge().getMethod(queryPurchasesAsyncMethodName, String.class, PurchasesResponseListenerProxy.getProxyListenerClass());
return true;
} catch (ClassNotFoundException | NoSuchMethodException unused) {
return false;
}
}
public static BuilderBridge newBuilder(Context context) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException {
return new BuilderBridge(BillingClientBridgeCommon.callNonVoidStaticMethod("newBuilder", context));
}
public static class BuilderBridge extends BillingClientBuilderBridgeCommon {
public BuilderBridge(Object obj) throws ClassNotFoundException {
super(obj);
}
@Override // com.unity3d.services.store.gpbl.bridges.billingclient.IBillingClientBuilderBridge
public BillingClientBridgeCommon build() throws ClassNotFoundException {
return new BillingClientBridge(callNonVoidMethod("build", this._billingClientBuilderInternalInstance, new Object[0]));
}
}
}

View File

@@ -0,0 +1,10 @@
package com.unity3d.services.store.gpbl.listeners;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
/* loaded from: classes4.dex */
public interface BillingClientStateListener {
void onBillingServiceDisconnected();
void onBillingSetupFinished(BillingResultBridge billingResultBridge);
}

View File

@@ -0,0 +1,6 @@
package com.unity3d.services.store.gpbl.listeners;
/* loaded from: classes4.dex */
public interface BillingInitializationListener extends BillingClientStateListener, PurchaseUpdatedResponseListener {
void onIsAlreadyInitialized();
}

View File

@@ -0,0 +1,6 @@
package com.unity3d.services.store.gpbl.listeners;
/* loaded from: classes4.dex */
public interface FeatureSupportedListener {
void onFeatureSupported(int i);
}

View File

@@ -0,0 +1,10 @@
package com.unity3d.services.store.gpbl.listeners;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseHistoryRecordBridge;
import java.util.List;
/* loaded from: classes4.dex */
public interface PurchaseHistoryResponseListener {
void onPurchaseHistoryUpdated(BillingResultBridge billingResultBridge, List<? extends PurchaseHistoryRecordBridge> list);
}

View File

@@ -0,0 +1,10 @@
package com.unity3d.services.store.gpbl.listeners;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseBridge;
import java.util.List;
/* loaded from: classes4.dex */
public interface PurchaseUpdatedResponseListener {
void onPurchaseUpdated(BillingResultBridge billingResultBridge, List<? extends PurchaseBridge> list);
}

View File

@@ -0,0 +1,10 @@
package com.unity3d.services.store.gpbl.listeners;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseBridge;
import java.util.List;
/* loaded from: classes4.dex */
public interface PurchasesResponseListener {
void onPurchaseResponse(BillingResultBridge billingResultBridge, List<? extends PurchaseBridge> list);
}

View File

@@ -0,0 +1,10 @@
package com.unity3d.services.store.gpbl.listeners;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.SkuDetailsBridge;
import java.util.List;
/* loaded from: classes4.dex */
public interface SkuDetailsResponseListener {
void onSkuDetailsUpdated(BillingResultBridge billingResultBridge, List<? extends SkuDetailsBridge> list);
}

View File

@@ -0,0 +1,6 @@
package com.unity3d.services.store.gpbl.listeners;
/* loaded from: classes4.dex */
public interface StoreEventListener extends PurchaseHistoryResponseListener, SkuDetailsResponseListener, PurchasesResponseListener, PurchaseUpdatedResponseListener, FeatureSupportedListener, BillingInitializationListener {
int getOperationId();
}

View File

@@ -0,0 +1,52 @@
package com.unity3d.services.store.gpbl.proxies;
import com.unity3d.services.core.reflection.GenericListenerProxy;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.listeners.BillingClientStateListener;
import java.lang.reflect.Method;
/* loaded from: classes4.dex */
public class BillingClientStateListenerProxy extends GenericListenerProxy {
private static String onBillingServiceDisconnectedMethodName = "onBillingServiceDisconnected";
private static String onBillingSetupFinishedMethodName = "onBillingSetupFinished";
private BillingClientStateListener billingClientStateListener;
public static Class<?> getProxyListenerClass() throws ClassNotFoundException {
return com.android.billingclient.api.BillingClientStateListener.class;
}
public BillingClientStateListenerProxy(BillingClientStateListener billingClientStateListener) {
this.billingClientStateListener = billingClientStateListener;
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy
public Class<?> getProxyClass() throws ClassNotFoundException {
return getProxyListenerClass();
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy, java.lang.reflect.InvocationHandler
public Object invoke(Object obj, Method method, Object[] objArr) throws Throwable {
if (method.getName().equals(onBillingSetupFinishedMethodName)) {
onBillingSetupFinished(objArr[0]);
} else if (method.getName().equals(onBillingServiceDisconnectedMethodName)) {
onBillingServiceDisconnected();
} else {
return super.invoke(obj, method, objArr);
}
return null;
}
private void onBillingSetupFinished(Object obj) {
BillingClientStateListener billingClientStateListener = this.billingClientStateListener;
if (billingClientStateListener != null) {
billingClientStateListener.onBillingSetupFinished(new BillingResultBridge(obj));
}
}
private void onBillingServiceDisconnected() {
BillingClientStateListener billingClientStateListener = this.billingClientStateListener;
if (billingClientStateListener != null) {
billingClientStateListener.onBillingServiceDisconnected();
}
}
}

View File

@@ -0,0 +1,55 @@
package com.unity3d.services.store.gpbl.proxies;
import com.unity3d.services.core.reflection.GenericListenerProxy;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseHistoryRecordBridge;
import com.unity3d.services.store.gpbl.listeners.PurchaseHistoryResponseListener;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes4.dex */
public class PurchaseHistoryResponseListenerProxy extends GenericListenerProxy {
private static final String onPurchaseHistoryResponseMethodName = "onPurchaseHistoryResponse";
private int _maxPurchases;
private PurchaseHistoryResponseListener purchaseHistoryResponseListener;
public static Class<?> getProxyListenerClass() throws ClassNotFoundException {
return com.android.billingclient.api.PurchaseHistoryResponseListener.class;
}
public PurchaseHistoryResponseListenerProxy(PurchaseHistoryResponseListener purchaseHistoryResponseListener, int i) {
this.purchaseHistoryResponseListener = purchaseHistoryResponseListener;
this._maxPurchases = i;
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy
public Class<?> getProxyClass() throws ClassNotFoundException {
return getProxyListenerClass();
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy, java.lang.reflect.InvocationHandler
public Object invoke(Object obj, Method method, Object[] objArr) throws Throwable {
if (method.getName().equals(onPurchaseHistoryResponseMethodName)) {
onPurchaseHistoryResponse(objArr[0], (List) objArr[1]);
return null;
}
return super.invoke(obj, method, objArr);
}
public void onPurchaseHistoryResponse(Object obj, List<Object> list) {
ArrayList arrayList;
if (list != null) {
arrayList = new ArrayList();
for (int i = 0; i < this._maxPurchases && i < list.size(); i++) {
arrayList.add(new PurchaseHistoryRecordBridge(list.get(i)));
}
} else {
arrayList = null;
}
PurchaseHistoryResponseListener purchaseHistoryResponseListener = this.purchaseHistoryResponseListener;
if (purchaseHistoryResponseListener != null) {
purchaseHistoryResponseListener.onPurchaseHistoryUpdated(new BillingResultBridge(obj), arrayList);
}
}
}

View File

@@ -0,0 +1,56 @@
package com.unity3d.services.store.gpbl.proxies;
import com.android.billingclient.api.PurchasesUpdatedListener;
import com.unity3d.services.core.reflection.GenericListenerProxy;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseBridge;
import com.unity3d.services.store.gpbl.listeners.PurchaseUpdatedResponseListener;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes4.dex */
public class PurchaseUpdatedListenerProxy extends GenericListenerProxy {
private static final String onPurchasesUpdatedMethodName = "onPurchasesUpdated";
private PurchaseUpdatedResponseListener purchaseUpdatedResponseListener;
public static Class<?> getProxyListenerClass() throws ClassNotFoundException {
return PurchasesUpdatedListener.class;
}
public PurchaseUpdatedListenerProxy(PurchaseUpdatedResponseListener purchaseUpdatedResponseListener) {
this.purchaseUpdatedResponseListener = purchaseUpdatedResponseListener;
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy
public Class<?> getProxyClass() throws ClassNotFoundException {
return getProxyListenerClass();
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy, java.lang.reflect.InvocationHandler
public Object invoke(Object obj, Method method, Object[] objArr) throws Throwable {
if (method.getName().equals(onPurchasesUpdatedMethodName)) {
onPurchasesUpdated(objArr[0], (List) objArr[1]);
return null;
}
return super.invoke(obj, method, objArr);
}
public void onPurchasesUpdated(Object obj, List<Object> list) {
ArrayList arrayList;
if (list != null) {
arrayList = new ArrayList();
Iterator<Object> it = list.iterator();
while (it.hasNext()) {
arrayList.add(new PurchaseBridge(it.next()));
}
} else {
arrayList = null;
}
PurchaseUpdatedResponseListener purchaseUpdatedResponseListener = this.purchaseUpdatedResponseListener;
if (purchaseUpdatedResponseListener != null) {
purchaseUpdatedResponseListener.onPurchaseUpdated(new BillingResultBridge(obj), arrayList);
}
}
}

View File

@@ -0,0 +1,60 @@
package com.unity3d.services.store.gpbl.proxies;
import com.unity3d.services.core.reflection.GenericListenerProxy;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.PurchaseBridge;
import com.unity3d.services.store.gpbl.listeners.PurchasesResponseListener;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes4.dex */
public class PurchasesResponseListenerProxy extends GenericListenerProxy {
private static final String onQueryPurchasesResponseMethodName = "onQueryPurchasesResponse";
private PurchasesResponseListener purchasesResponseListener;
public static Class<?> getProxyListenerClass() throws ClassNotFoundException {
return com.android.billingclient.api.PurchasesResponseListener.class;
}
public PurchasesResponseListener getPurchasesResponseListener() {
return this.purchasesResponseListener;
}
public PurchasesResponseListenerProxy(PurchasesResponseListener purchasesResponseListener) {
this.purchasesResponseListener = purchasesResponseListener;
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy
public Class<?> getProxyClass() throws ClassNotFoundException {
return getProxyListenerClass();
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy, java.lang.reflect.InvocationHandler
public Object invoke(Object obj, Method method, Object[] objArr) throws Throwable {
if (method.getName().equals(onQueryPurchasesResponseMethodName)) {
onQueryPurchasesResponse(objArr[0], (List) objArr[1]);
return null;
}
return super.invoke(obj, method, objArr);
}
public void onQueryPurchasesResponse(Object obj, List<Object> list) {
ArrayList arrayList;
BillingResultBridge billingResultBridge = new BillingResultBridge(obj);
if (list != null) {
arrayList = new ArrayList();
Iterator<Object> it = list.iterator();
while (it.hasNext()) {
arrayList.add(new PurchaseBridge(it.next()));
}
} else {
arrayList = null;
}
PurchasesResponseListener purchasesResponseListener = this.purchasesResponseListener;
if (purchasesResponseListener != null) {
purchasesResponseListener.onPurchaseResponse(billingResultBridge, arrayList);
}
}
}

View File

@@ -0,0 +1,55 @@
package com.unity3d.services.store.gpbl.proxies;
import com.unity3d.services.core.reflection.GenericListenerProxy;
import com.unity3d.services.store.gpbl.bridges.BillingResultBridge;
import com.unity3d.services.store.gpbl.bridges.SkuDetailsBridge;
import com.unity3d.services.store.gpbl.listeners.SkuDetailsResponseListener;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes4.dex */
public class SkuDetailsResponseListenerProxy extends GenericListenerProxy {
private static final String onSkuDetailsResponseMethodName = "onSkuDetailsResponse";
private SkuDetailsResponseListener skuDetailsResponseListener;
public static Class<?> getProxyListenerClass() throws ClassNotFoundException {
return com.android.billingclient.api.SkuDetailsResponseListener.class;
}
public SkuDetailsResponseListenerProxy(SkuDetailsResponseListener skuDetailsResponseListener) {
this.skuDetailsResponseListener = skuDetailsResponseListener;
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy
public Class<?> getProxyClass() throws ClassNotFoundException {
return getProxyListenerClass();
}
@Override // com.unity3d.services.core.reflection.GenericListenerProxy, java.lang.reflect.InvocationHandler
public Object invoke(Object obj, Method method, Object[] objArr) throws Throwable {
if (method.getName().equals(onSkuDetailsResponseMethodName)) {
onSkuDetailsResponse(objArr[0], (List) objArr[1]);
return null;
}
return super.invoke(obj, method, objArr);
}
public void onSkuDetailsResponse(Object obj, List<Object> list) {
ArrayList arrayList;
if (list != null) {
arrayList = new ArrayList();
Iterator<Object> it = list.iterator();
while (it.hasNext()) {
arrayList.add(new SkuDetailsBridge(it.next()));
}
} else {
arrayList = null;
}
SkuDetailsResponseListener skuDetailsResponseListener = this.skuDetailsResponseListener;
if (skuDetailsResponseListener != null) {
skuDetailsResponseListener.onSkuDetailsUpdated(new BillingResultBridge(obj), arrayList);
}
}
}