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.gpbl.IBillingResponse; import java.util.HashMap; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes2.dex */ public abstract class CommonJsonResponseBridge extends GenericBridge implements IBillingResponse { private static final String getOriginalJsonMethodName = "getOriginalJson"; private final Object _internalBridgeRef; protected CommonJsonResponseBridge(Object obj) { this(obj, new HashMap()); } private static Map[]> appendCommonResponseMethods(Map[]> map) { map.putAll(new HashMap[]>() { // 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 e10) { DeviceLog.error("Couldn't parse BillingResponse JSON : %s", e10.getMessage()); return null; } } protected CommonJsonResponseBridge(Object obj, Map[]> map) { super(appendCommonResponseMethods(map)); this._internalBridgeRef = obj; } }