Perfume Of Love v2.14.9版本的 MD5 值为:16011aefc5a55805771706ce3b259b4e
以下内容为反编译后的 IronSourceAdapter.java 源代码,内容仅作参考
package com.ironsource.adapters.ironsource;
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import com.ironsource.adapters.supersonicads.SupersonicConfig;
import com.ironsource.environment.ContextProvider;
import com.ironsource.mediationsdk.AbstractAdapter;
import com.ironsource.mediationsdk.AdapterUtils;
import com.ironsource.mediationsdk.C1327d;
import com.ironsource.mediationsdk.ISBannerSize;
import com.ironsource.mediationsdk.IronSourceBannerLayout;
import com.ironsource.mediationsdk.LoadWhileShowSupportState;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerLayout;
import com.ironsource.mediationsdk.logger.IronLog;
import com.ironsource.mediationsdk.logger.IronSourceError;
import com.ironsource.mediationsdk.metadata.MetaDataUtils;
import com.ironsource.mediationsdk.sdk.BannerSmashListener;
import com.ironsource.mediationsdk.sdk.InterstitialSmashListener;
import com.ironsource.mediationsdk.sdk.RewardedVideoSmashListener;
import com.ironsource.mediationsdk.sdk.g;
import com.ironsource.mediationsdk.utils.ErrorBuilder;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.mediationsdk.utils.IronSourceUtils;
import com.ironsource.mediationsdk.utils.n;
import com.ironsource.mediationsdk.y;
import com.ironsource.sdk.IronSourceNetwork;
import com.ironsource.sdk.a;
import com.ironsource.sdk.b;
import com.ironsource.sdk.j.d;
import com.ironsource.sdk.j.e;
import com.ironsource.sdk.utils.SDKUtils;
import com.ironsource.unity.androidbridge.AndroidBridgeConstants;
import com.vungle.warren.model.ReportDBAdapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import ms.bd.o.Pgl.c;
import org.json.JSONException;
import org.json.JSONObject;
public class IronSourceAdapter extends AbstractAdapter implements ContextProvider.a, g, e {
public static final String IRONSOURCE_BIDDING_TOKEN_KEY = "token";
public static final String IRONSOURCE_ONE_FLOW_KEY = "isOneFlow";
private static final int IS_LOAD_EXCEPTION = 1000;
private static final int IS_SHOW_EXCEPTION = 1001;
private static final int RV_LOAD_EXCEPTION = 1002;
private static final int RV_SHOW_EXCEPTION = 1003;
private static final String VERSION = "7.3.0.1";
private static AtomicBoolean mDidInitSdk = new AtomicBoolean(false);
private final String ADM_KEY;
private final String DEMAND_SOURCE_NAME;
private final String DYNAMIC_CONTROLLER_CONFIG;
private final String DYNAMIC_CONTROLLER_DEBUG_MODE;
private final String DYNAMIC_CONTROLLER_URL;
private final String LWS_SUPPORT_STATE;
private final String OW_CLIENT_SIDE_CALLBACKS;
private final String OW_PLACEMENT_ID;
private final String SDK_PLUGIN_TYPE;
private final String SESSION_ID;
final ConcurrentHashMap<String, BannerSmashListener> mDemandSourceToBNSmash;
ConcurrentHashMap<String, ArrayList<b>> mDemandSourceToBnAd;
ConcurrentHashMap<String, b> mDemandSourceToISAd;
ConcurrentHashMap<String, InterstitialSmashListener> mDemandSourceToISSmash;
ConcurrentHashMap<String, b> mDemandSourceToRvAd;
ConcurrentHashMap<String, RewardedVideoSmashListener> mDemandSourceToRvSmash;
private com.ironsource.mediationsdk.sdk.e mOfferwallListener;
private IronSourceAdapter(String str) {
super(str);
this.DYNAMIC_CONTROLLER_URL = "controllerUrl";
this.DYNAMIC_CONTROLLER_DEBUG_MODE = "debugMode";
this.DYNAMIC_CONTROLLER_CONFIG = "controllerConfig";
this.SESSION_ID = "sessionid";
this.SDK_PLUGIN_TYPE = "SDKPluginType";
this.ADM_KEY = "adm";
this.DEMAND_SOURCE_NAME = "demandSourceName";
this.OW_PLACEMENT_ID = ReportDBAdapter.ReportColumns.COLUMN_PLACEMENT_ID;
this.OW_CLIENT_SIDE_CALLBACKS = "useClientSideCallbacks";
this.LWS_SUPPORT_STATE = "isSupportedLWS";
this.mDemandSourceToRvAd = new ConcurrentHashMap<>();
this.mDemandSourceToRvSmash = new ConcurrentHashMap<>();
this.mDemandSourceToISAd = new ConcurrentHashMap<>();
this.mDemandSourceToISSmash = new ConcurrentHashMap<>();
this.mDemandSourceToBnAd = new ConcurrentHashMap<>();
this.mDemandSourceToBNSmash = new ConcurrentHashMap<>();
ContextProvider.getInstance().registerLifeCycleListener(this);
}
private a convertBannerSize(Context context, ISBannerSize iSBannerSize) {
String description = iSBannerSize.getDescription();
description.hashCode();
char c = 65535;
switch (description.hashCode()) {
case -387072689:
if (description.equals(AndroidBridgeConstants.BANNER_SIZE_RECTANGLE)) {
c = 0;
break;
}
break;
case 72205083:
if (description.equals(AndroidBridgeConstants.BANNER_SIZE_LARGE)) {
c = 1;
break;
}
break;
case 79011241:
if (description.equals(AndroidBridgeConstants.BANNER_SIZE_SMART)) {
c = 2;
break;
}
break;
case 1951953708:
if (description.equals("BANNER")) {
c = 3;
break;
}
break;
case 1999208305:
if (description.equals("CUSTOM")) {
c = 4;
break;
}
break;
}
int i = 90;
int i2 = 320;
switch (c) {
case 0:
i2 = c.COLLECT_MODE_FINANCE;
i = 250;
break;
case 1:
break;
case 2:
boolean isLargeScreen = AdapterUtils.isLargeScreen(context);
if (isLargeScreen) {
i2 = 728;
break;
}
break;
case 3:
i = 50;
break;
case 4:
int height = iSBannerSize.getHeight();
if (height == 50 || height == 90) {
i = height;
break;
} else {
return null;
}
default:
return null;
}
return new a(AdapterUtils.dpToPixels(context, i2), AdapterUtils.dpToPixels(context, i), description);
}
private b createBannerAdInstance(String str, a aVar, JSONObject jSONObject, BannerSmashListener bannerSmashListener) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("creating banner ad instance for " + str);
IronSourceBannerListener ironSourceBannerListener = new IronSourceBannerListener(this, bannerSmashListener, str);
boolean optBoolean = jSONObject.optBoolean("isOneFlow");
boolean z = jSONObject.optInt("instanceType", 2) == 2;
com.ironsource.sdk.c cVar = new com.ironsource.sdk.c(str, ironSourceBannerListener);
cVar.d = getInitParams();
cVar.b = z;
cVar.e = optBoolean;
cVar.c = aVar;
return cVar.a();
}
private HashMap<String, String> createBannerLoadParams(JSONObject jSONObject, String str) {
HashMap<String, String> hashMap = new HashMap<>();
if (str != null) {
C1327d.a();
hashMap.put("adm", C1327d.c(str));
hashMap.put("isOneFlow", String.valueOf(jSONObject.optBoolean("isOneFlow")));
C1327d.a();
hashMap.putAll(C1327d.b(str));
}
return hashMap;
}
private String getDemandSourceName(JSONObject jSONObject) {
return !TextUtils.isEmpty(jSONObject.optString("demandSourceName")) ? jSONObject.optString("demandSourceName") : getProviderName();
}
private HashMap<String, String> getInitParams() {
HashMap<String, String> hashMap = new HashMap<>();
String pluginType = getPluginType();
if (!TextUtils.isEmpty(pluginType)) {
hashMap.put("SDKPluginType", pluginType);
}
if (!TextUtils.isEmpty(y.a().m)) {
hashMap.put("sessionid", y.a().m);
}
return hashMap;
}
private b getInterstitialAdInstance(String str, boolean z, InterstitialSmashListener interstitialSmashListener) {
b bVar = this.mDemandSourceToISAd.get(str);
if (bVar == null) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("creating ad instance for " + str + " isBidder=" + z);
com.ironsource.sdk.c cVar = new com.ironsource.sdk.c(str, new IronSourceInterstitialListener(interstitialSmashListener, str));
cVar.d = getInitParams();
cVar.b = z;
b a = cVar.a();
this.mDemandSourceToISAd.put(str, a);
return a;
}
return bVar;
}
public HashMap<String, String> getOfferwallExtraParams() {
HashMap<String, String> initParams = getInitParams();
initParams.put("useClientSideCallbacks", String.valueOf(SupersonicConfig.getConfigObj().getClientSideCallbacks()));
Map<String, String> offerwallCustomParams = SupersonicConfig.getConfigObj().getOfferwallCustomParams();
if (offerwallCustomParams != null && !offerwallCustomParams.isEmpty()) {
initParams.putAll(offerwallCustomParams);
}
return initParams;
}
private b getRewardedVideoAdInstance(String str, boolean z, boolean z2, RewardedVideoSmashListener rewardedVideoSmashListener) {
b bVar = this.mDemandSourceToRvAd.get(str);
if (bVar == null) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("creating ad instance for " + str + " isDemandOnly=" + z + " isBidder=" + z2);
com.ironsource.sdk.c cVar = new com.ironsource.sdk.c(str, new IronSourceRewardedVideoListener(rewardedVideoSmashListener, str, z));
cVar.d = getInitParams();
cVar.a = true;
cVar.b = z2;
b a = cVar.a();
this.mDemandSourceToRvAd.put(str, a);
return a;
}
return bVar;
}
private void initInterstitialInternal(String str, JSONObject jSONObject, InterstitialSmashListener interstitialSmashListener, String str2) {
initSDK(str, jSONObject);
this.mDemandSourceToISSmash.put(str2, interstitialSmashListener);
interstitialSmashListener.onInterstitialInitSuccess();
}
private void initRewardedVideoInternal(String str, JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener, String str2) {
initSDK(str, jSONObject);
this.mDemandSourceToRvSmash.put(str2, rewardedVideoSmashListener);
}
private void initSDK(String str, JSONObject jSONObject) {
if (mDidInitSdk.compareAndSet(false, true)) {
String mediationUserId = IronSourceUtils.getMediationUserId();
int optInt = jSONObject.optInt("debugMode", 0);
if (isAdaptersDebugEnabled()) {
optInt = 3;
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("setting debug mode to " + optInt);
SDKUtils.setDebugMode(optInt);
SDKUtils.setControllerUrl(jSONObject.optString("controllerUrl"));
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.verbose("IronSourceNetwork setting controller url to " + jSONObject.optString("controllerUrl"));
JSONObject optJSONObject = jSONObject.optJSONObject("controllerConfig");
String jSONObject2 = optJSONObject != null ? optJSONObject.toString() : "";
SDKUtils.setControllerConfig(jSONObject2);
IronLog ironLog3 = IronLog.ADAPTER_API;
ironLog3.verbose("IronSourceNetwork setting controller config to " + jSONObject2);
HashMap<String, String> initParams = getInitParams();
String str2 = y.a().g;
IronLog ironLog4 = IronLog.ADAPTER_API;
ironLog4.verbose("with appKey=" + str2 + " userId=" + mediationUserId + " parameters " + initParams);
IronSourceNetwork.setInitListener(new d() {
@Override
public void onFail(com.ironsource.sdk.g.e eVar) {
IronLog ironLog5 = IronLog.ADAPTER_API;
ironLog5.verbose("OnNetworkSDKInitListener fail - code:" + eVar.b + " message:" + eVar.a);
}
@Override
public void onSuccess() {
IronLog.ADAPTER_API.verbose("OnNetworkSDKInitListener success");
}
});
IronSourceNetwork.initSDK(ContextProvider.getInstance().getApplicationContext(), str2, mediationUserId, initParams);
}
}
private void loadBannerInternal(ISBannerSize iSBannerSize, JSONObject jSONObject, BannerSmashListener bannerSmashListener, String str) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("demandSourceName: " + demandSourceName);
try {
a convertBannerSize = convertBannerSize(ContextProvider.getInstance().getApplicationContext(), iSBannerSize);
if (convertBannerSize == null) {
bannerSmashListener.onBannerAdLoadFailed(ErrorBuilder.unsupportedBannerSize(getProviderName()));
return;
}
HashMap<String, String> createBannerLoadParams = createBannerLoadParams(jSONObject, str);
printInstanceExtraParams(createBannerLoadParams);
IronSourceNetwork.loadAd(ContextProvider.getInstance().getCurrentActiveActivity(), createBannerAdInstance(demandSourceName, convertBannerSize, jSONObject, bannerSmashListener), createBannerLoadParams);
} catch (Exception e) {
bannerSmashListener.onBannerAdLoadFailed(ErrorBuilder.buildLoadFailedError("Banner Load Fail, " + getProviderName() + " - " + e.getMessage()));
}
}
private void loadInterstitialAdInternal(String str, String str2, boolean z, InterstitialSmashListener interstitialSmashListener) {
HashMap hashMap = new HashMap();
if (str2 != null) {
C1327d.a();
hashMap.put("adm", C1327d.c(str2));
C1327d.a();
hashMap.putAll(C1327d.b(str2));
}
b interstitialAdInstance = getInterstitialAdInstance(str, z, interstitialSmashListener);
printInstanceExtraParams(hashMap);
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("demandSourceName=" + interstitialAdInstance.c);
IronSourceNetwork.loadAd(ContextProvider.getInstance().getCurrentActiveActivity(), interstitialAdInstance, hashMap);
}
private void loadRewardedVideoAdInternal(String str, String str2, boolean z, boolean z2, RewardedVideoSmashListener rewardedVideoSmashListener) {
HashMap hashMap = new HashMap();
if (str2 != null) {
C1327d.a();
hashMap.put("adm", C1327d.c(str2));
C1327d.a();
hashMap.putAll(C1327d.b(str2));
}
b rewardedVideoAdInstance = getRewardedVideoAdInstance(str, z, z2, rewardedVideoSmashListener);
printInstanceExtraParams(hashMap);
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("demandSourceName=" + rewardedVideoAdInstance.c);
IronSourceNetwork.loadAd(ContextProvider.getInstance().getCurrentActiveActivity(), rewardedVideoAdInstance, hashMap);
}
private void printInstanceExtraParams(Map<String, String> map) {
if (map == null || map.size() <= 0) {
return;
}
IronLog.ADAPTER_API.verbose("instance extra params:");
for (String str : map.keySet()) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(str + "=" + map.get(str));
}
}
private void showAdInternal(b bVar, int i) {
int b = n.a().b(i);
HashMap hashMap = new HashMap();
hashMap.put(IronSourceConstants.KEY_SESSION_DEPTH, String.valueOf(b));
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("demandSourceName=" + bVar.c + " showParams=" + hashMap);
IronSourceNetwork.showAd(bVar, hashMap);
}
public static IronSourceAdapter startAdapter(String str) {
return new IronSourceAdapter(str);
}
@Override
public void destroyBanner(JSONObject jSONObject) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(demandSourceName + ": destroyBanner()");
ArrayList<b> arrayList = this.mDemandSourceToBnAd.get(demandSourceName);
if (arrayList != null) {
try {
Iterator<b> it = arrayList.iterator();
while (it.hasNext()) {
IronSourceNetwork.destroyAd(it.next());
}
this.mDemandSourceToBnAd.remove(demandSourceName);
} catch (Exception e) {
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.verbose("destroyBanner failed: " + e.getMessage());
}
}
}
@Override
public void earlyInit(String str, String str2, JSONObject jSONObject) {
if (y.a().g == null) {
IronLog.ADAPTER_API.error("Appkey is null for early init");
return;
}
IronSourceUtils.sendAutomationLog(getDemandSourceName(jSONObject) + ": earlyInit");
initSDK(y.a().g, jSONObject);
}
@Override
public Map<String, Object> getBannerBiddingData(JSONObject jSONObject, JSONObject jSONObject2) {
return getBiddingData();
}
Map<String, Object> getBiddingData() {
IronLog.ADAPTER_API.verbose();
HashMap hashMap = new HashMap();
String token = IronSourceNetwork.getToken(ContextProvider.getInstance().getApplicationContext());
if (token == null) {
IronLog.ADAPTER_API.error("bidding token is null");
token = "";
}
hashMap.put("token", token);
return hashMap;
}
@Override
public String getCoreSDKVersion() {
return SDKUtils.getSDKVersion();
}
@Override
public Map<String, Object> getInterstitialBiddingData(JSONObject jSONObject, JSONObject jSONObject2) {
return getBiddingData();
}
@Override
public LoadWhileShowSupportState getLoadWhileShowSupportState(JSONObject jSONObject) {
LoadWhileShowSupportState loadWhileShowSupportState = this.mLWSSupportState;
return (jSONObject == null || !jSONObject.optBoolean("isSupportedLWS")) ? loadWhileShowSupportState : LoadWhileShowSupportState.LOAD_WHILE_SHOW_BY_INSTANCE;
}
@Override
public void getOfferwallCredits() {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " getOfferwallCredits");
try {
IronSourceNetwork.getOfferWallCredits(this);
} catch (Exception e) {
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.error("exception " + e.getMessage());
}
}
@Override
public JSONObject getPlayerBiddingData() {
JSONObject jSONObject;
IronLog.ADAPTER_API.verbose();
JSONObject jSONObject2 = new JSONObject();
try {
jSONObject = IronSourceNetwork.getRawToken(ContextProvider.getInstance().getApplicationContext());
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("getRawToken exception: " + e.getLocalizedMessage());
jSONObject = null;
}
if (jSONObject != null) {
return jSONObject;
}
IronLog.ADAPTER_API.error("Player's bidding token is null");
return jSONObject2;
}
@Override
public Map<String, Object> getRewardedVideoBiddingData(JSONObject jSONObject, JSONObject jSONObject2) {
return getBiddingData();
}
@Override
public String getVersion() {
return "7.3.0.1";
}
@Override
public void initAndLoadRewardedVideo(String str, String str2, JSONObject jSONObject, JSONObject jSONObject2, RewardedVideoSmashListener rewardedVideoSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose(demandSourceName + ": demandSourceName=" + demandSourceName);
initRewardedVideoInternal(str, jSONObject, rewardedVideoSmashListener, demandSourceName);
loadRewardedVideo(jSONObject, jSONObject2, rewardedVideoSmashListener);
}
@Override
public void initBannerForBidding(String str, String str2, JSONObject jSONObject, BannerSmashListener bannerSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("demandSourceName: " + demandSourceName);
initSDK(str, jSONObject);
this.mDemandSourceToBNSmash.put(demandSourceName, bannerSmashListener);
bannerSmashListener.onBannerInitSuccess();
}
@Override
public void initInterstitial(String str, String str2, JSONObject jSONObject, InterstitialSmashListener interstitialSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose(demandSourceName + ": demandSourceName=" + demandSourceName);
initInterstitialInternal(str, jSONObject, interstitialSmashListener, demandSourceName);
}
@Override
public void initInterstitialForBidding(String str, String str2, JSONObject jSONObject, InterstitialSmashListener interstitialSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose(demandSourceName + ": demandSourceName=" + demandSourceName);
initInterstitialInternal(str, jSONObject, interstitialSmashListener, demandSourceName);
}
@Override
public void initOfferwall(String str, String str2, JSONObject jSONObject) {
initSDK(str, jSONObject);
IronLog.ADAPTER_API.verbose(":initOfferwall");
postOnUIThread(new Runnable() {
@Override
public void run() {
try {
IronSourceNetwork.initOfferWall(IronSourceAdapter.this.getOfferwallExtraParams(), IronSourceAdapter.this);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error(IronSourceAdapter.this.getProviderName() + ":initOfferwall " + e);
com.ironsource.mediationsdk.sdk.e eVar = IronSourceAdapter.this.mOfferwallListener;
eVar.a(false, ErrorBuilder.buildInitFailedError("Adapter initialization failure - " + IronSourceAdapter.this.getProviderName() + " - " + e.getMessage(), IronSourceConstants.OFFERWALL_AD_UNIT));
}
}
});
}
@Override
public void initRewardedVideoForDemandOnly(String str, String str2, JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose(demandSourceName + ": demandSourceName=" + demandSourceName);
initRewardedVideoInternal(str, jSONObject, rewardedVideoSmashListener, demandSourceName);
}
@Override
public void initRewardedVideoWithCallback(String str, String str2, JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose(demandSourceName + ": demandSourceName=" + demandSourceName);
initRewardedVideoInternal(str, jSONObject, rewardedVideoSmashListener, demandSourceName);
rewardedVideoSmashListener.onRewardedVideoInitSuccess();
}
@Override
public boolean isInterstitialReady(JSONObject jSONObject) {
b bVar = this.mDemandSourceToISAd.get(getDemandSourceName(jSONObject));
return bVar != null && IronSourceNetwork.isAdAvailableForInstance(bVar);
}
public boolean isOfferwallAvailable() {
return true;
}
@Override
public boolean isRewardedVideoAvailable(JSONObject jSONObject) {
b bVar = this.mDemandSourceToRvAd.get(getDemandSourceName(jSONObject));
return bVar != null && IronSourceNetwork.isAdAvailableForInstance(bVar);
}
@Override
public void loadBannerForBidding(JSONObject jSONObject, JSONObject jSONObject2, String str, IronSourceBannerLayout ironSourceBannerLayout, BannerSmashListener bannerSmashListener) {
if (ironSourceBannerLayout != null) {
loadBannerInternal(ironSourceBannerLayout.getSize(), jSONObject, bannerSmashListener, str);
return;
}
bannerSmashListener.onBannerAdLoadFailed(ErrorBuilder.buildLoadFailedError("Banner Load Fail, " + getProviderName() + " - banner is null"));
}
@Override
public void loadBannerForDemandOnlyForBidding(JSONObject jSONObject, String str, ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, BannerSmashListener bannerSmashListener) {
if (iSDemandOnlyBannerLayout != null) {
loadBannerInternal(iSDemandOnlyBannerLayout.getSize(), jSONObject, bannerSmashListener, str);
return;
}
bannerSmashListener.onBannerAdLoadFailed(ErrorBuilder.buildLoadFailedError("Banner Load Fail, " + getProviderName() + " - banner is null"));
}
@Override
public void loadInterstitial(JSONObject jSONObject, JSONObject jSONObject2, InterstitialSmashListener interstitialSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog.ADAPTER_API.verbose(demandSourceName);
try {
loadInterstitialAdInternal(demandSourceName, null, false, interstitialSmashListener);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("exception " + e.getMessage());
interstitialSmashListener.onInterstitialAdLoadFailed(new IronSourceError(1000, e.getMessage()));
}
}
@Override
public void loadInterstitialForBidding(JSONObject jSONObject, JSONObject jSONObject2, String str, InterstitialSmashListener interstitialSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog.ADAPTER_API.verbose(demandSourceName);
try {
loadInterstitialAdInternal(demandSourceName, str, true, interstitialSmashListener);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("for bidding exception " + e.getMessage());
interstitialSmashListener.onInterstitialAdLoadFailed(new IronSourceError(1000, e.getMessage()));
}
}
@Override
public void loadRewardedVideo(JSONObject jSONObject, JSONObject jSONObject2, RewardedVideoSmashListener rewardedVideoSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog.ADAPTER_API.verbose(demandSourceName);
try {
loadRewardedVideoAdInternal(demandSourceName, null, false, false, rewardedVideoSmashListener);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("exception " + e.getMessage());
RewardedVideoSmashListener rewardedVideoSmashListener2 = this.mDemandSourceToRvSmash.get(demandSourceName);
if (rewardedVideoSmashListener2 != null) {
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.error("exception " + e.getMessage());
rewardedVideoSmashListener2.onRewardedVideoLoadFailed(new IronSourceError(1002, e.getMessage()));
rewardedVideoSmashListener2.onRewardedVideoAvailabilityChanged(false);
}
}
}
@Override
public void loadRewardedVideoForBidding(JSONObject jSONObject, JSONObject jSONObject2, String str, RewardedVideoSmashListener rewardedVideoSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog.ADAPTER_API.verbose(demandSourceName);
try {
loadRewardedVideoAdInternal(demandSourceName, str, false, true, rewardedVideoSmashListener);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("exception " + e.getMessage());
rewardedVideoSmashListener.onRewardedVideoLoadFailed(new IronSourceError(1002, e.getMessage()));
rewardedVideoSmashListener.onRewardedVideoAvailabilityChanged(false);
}
}
@Override
public void loadRewardedVideoForDemandOnly(JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog.ADAPTER_API.verbose(demandSourceName);
try {
loadRewardedVideoAdInternal(demandSourceName, null, true, false, rewardedVideoSmashListener);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("exception " + e.getMessage());
rewardedVideoSmashListener.onRewardedVideoLoadFailed(new IronSourceError(1002, e.getMessage()));
}
}
@Override
public void loadRewardedVideoForDemandOnlyForBidding(JSONObject jSONObject, String str, RewardedVideoSmashListener rewardedVideoSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog.ADAPTER_API.verbose(demandSourceName);
try {
loadRewardedVideoAdInternal(demandSourceName, str, true, true, rewardedVideoSmashListener);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("exception " + e.getMessage());
rewardedVideoSmashListener.onRewardedVideoLoadFailed(new IronSourceError(1002, e.getMessage()));
}
}
@Override
public void onGetOWCreditsFailed(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mOfferwallListener != null) {
this.mOfferwallListener.onGetOfferwallCreditsFailed(ErrorBuilder.buildGenericError(str));
}
}
@Override
public void onOWAdClosed() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
com.ironsource.mediationsdk.sdk.e eVar = this.mOfferwallListener;
if (eVar != null) {
eVar.onOfferwallClosed();
}
}
@Override
public boolean onOWAdCredited(int i, int i2, boolean z) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
com.ironsource.mediationsdk.sdk.e eVar = this.mOfferwallListener;
return eVar != null && eVar.onOfferwallAdCredited(i, i2, z);
}
@Override
public void onOWShowFail(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mOfferwallListener != null) {
this.mOfferwallListener.onOfferwallShowFailed(ErrorBuilder.buildGenericError(str));
}
}
@Override
public void onOWShowSuccess(String str) {
IronLog ironLog = IronLog.ADAPTER_CALLBACK;
ironLog.verbose("onOWShowSuccess(placementId:" + str + ")");
com.ironsource.mediationsdk.sdk.e eVar = this.mOfferwallListener;
if (eVar != null) {
eVar.onOfferwallOpened();
}
}
@Override
public void onOfferwallEventNotificationReceived(String str, JSONObject jSONObject) {
if (jSONObject != null) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
}
}
@Override
public void onOfferwallInitFail(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mOfferwallListener != null) {
this.mOfferwallListener.a(false, ErrorBuilder.buildGenericError(str));
}
}
@Override
public void onOfferwallInitSuccess() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
com.ironsource.mediationsdk.sdk.e eVar = this.mOfferwallListener;
if (eVar != null) {
eVar.onOfferwallAvailable(true);
}
}
@Override
public void onPause(Activity activity) {
IronLog.ADAPTER_API.verbose("IronSourceNetwork.onPause");
IronSourceNetwork.onPause(activity);
}
@Override
public void onResume(Activity activity) {
IronLog.ADAPTER_API.verbose("IronSourceNetwork.onResume");
IronSourceNetwork.onResume(activity);
}
@Override
public void setConsent(boolean z) {
IronLog ironLog = IronLog.ADAPTER_API;
StringBuilder sb = new StringBuilder("(");
sb.append(z ? "true" : "false");
sb.append(")");
ironLog.verbose(sb.toString());
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("consent", z ? "1" : "0");
IronSourceNetwork.updateMetadata(jSONObject);
} catch (JSONException e) {
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.error("exception " + e.getMessage());
}
}
@Override
public void setInternalOfferwallListener(com.ironsource.mediationsdk.sdk.e eVar) {
this.mOfferwallListener = eVar;
}
@Override
public void setMetaData(String str, List<String> list) {
if (list.isEmpty()) {
return;
}
String str2 = list.get(0);
if (mDidInitSdk.get()) {
return;
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("key=" + str + ", value=" + str2);
if (!MetaDataUtils.isValidCCPAMetaData(str, str2)) {
IronLog.ADAPTER_API.verbose("MetaData not valid");
return;
}
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(str, str2);
IronSourceNetwork.updateMetadata(jSONObject);
} catch (JSONException e) {
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.error("error - " + e);
e.printStackTrace();
}
}
@Override
public void showInterstitial(JSONObject jSONObject, InterstitialSmashListener interstitialSmashListener) {
String demandSourceName = getDemandSourceName(jSONObject);
IronLog.ADAPTER_API.verbose(demandSourceName);
try {
showAdInternal(this.mDemandSourceToISAd.get(demandSourceName), 2);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("exception " + e.getMessage());
interstitialSmashListener.onInterstitialAdShowFailed(new IronSourceError(1001, e.getMessage()));
}
}
@Override
public void showOfferwall(String str, JSONObject jSONObject) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " showOfferWall");
try {
HashMap<String, String> offerwallExtraParams = getOfferwallExtraParams();
offerwallExtraParams.put(ReportDBAdapter.ReportColumns.COLUMN_PLACEMENT_ID, str);
IronSourceNetwork.showOfferWall(ContextProvider.getInstance().getCurrentActiveActivity(), offerwallExtraParams);
} catch (Exception e) {
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.error("exception " + e.getMessage());
}
}
@Override
public void showRewardedVideo(JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener) {
try {
showAdInternal(this.mDemandSourceToRvAd.get(getDemandSourceName(jSONObject)), 1);
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error("exception " + e.getMessage());
rewardedVideoSmashListener.onRewardedVideoAdShowFailed(new IronSourceError(1003, e.getMessage()));
}
}
}