Apk Done v1.0版本的 MD5 值为:44cfb8e1ce639995aa7f0de6a3a6388b
以下内容为反编译后的 SupersonicAdsAdapter.java 源代码,内容仅作参考
package com.ironsource.adapters.supersonicads;
import android.app.Activity;
import android.text.TextUtils;
import com.ironsource.environment.ContextProvider;
import com.ironsource.mediationsdk.AbstractAdapter;
import com.ironsource.mediationsdk.AbstractC1349b;
import com.ironsource.mediationsdk.H;
import com.ironsource.mediationsdk.IntegrationData;
import com.ironsource.mediationsdk.logger.IronLog;
import com.ironsource.mediationsdk.logger.IronSourceError;
import com.ironsource.mediationsdk.metadata.MetaDataUtils;
import com.ironsource.mediationsdk.sdk.InterstitialSmashListener;
import com.ironsource.mediationsdk.sdk.RewardedVideoSmashListener;
import com.ironsource.mediationsdk.sdk.j;
import com.ironsource.mediationsdk.utils.ErrorBuilder;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.mediationsdk.utils.IronSourceUtils;
import com.ironsource.mediationsdk.utils.o;
import com.ironsource.sdk.IronSourceNetwork;
import com.ironsource.sdk.SSAFactory;
import com.ironsource.sdk.g.a;
import com.ironsource.sdk.j.c;
import com.ironsource.sdk.j.e;
import com.ironsource.sdk.j.f;
import com.ironsource.sdk.utils.SDKUtils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
class SupersonicAdsAdapter extends AbstractAdapter implements ContextProvider.a, j, c, e, f {
private static final String VERSION = "7.2.1.1";
private final String AD_VISIBLE_EVENT_NAME;
private final String APPLICATION_PRIVATE_KEY;
private final String CAMPAIGN_ID;
private final String CLIENT_SIDE_CALLBACKS;
private final String CUSTOM_PARAM_PREFIX;
private final String CUSTOM_SEGMENT;
private final String DYNAMIC_CONTROLLER_CONFIG;
private final String DYNAMIC_CONTROLLER_DEBUG_MODE;
private final String DYNAMIC_CONTROLLER_URL;
private final String ITEM_COUNT;
private final String ITEM_NAME;
private final String ITEM_SIGNATURE;
private final String LANGUAGE;
private final String MAX_VIDEO_LENGTH;
private final String OW_PLACEMENT_ID;
private final String SDK_PLUGIN_TYPE;
private final String SESSION_ID;
private final String SUPERSONIC_ADS;
private final String TIMESTAMP;
private AtomicBoolean isRVInitiated;
private boolean mConsent;
private boolean mDidSetConsent;
private boolean mIsAlreadyShowing;
private boolean mIsRVAvailable;
private String mMediationSegment;
private com.ironsource.mediationsdk.sdk.f mOfferwallListener;
private com.ironsource.sdk.f mSSAPublisher;
private static AtomicBoolean mDidSetInitParams = new AtomicBoolean(false);
private static AtomicBoolean mDidInitSdk = new AtomicBoolean(false);
private SupersonicAdsAdapter(String str) {
super(str);
this.TIMESTAMP = "timestamp";
this.ITEM_SIGNATURE = "itemSignature";
this.SDK_PLUGIN_TYPE = "SDKPluginType";
this.OW_PLACEMENT_ID = "placementId";
this.SESSION_ID = "sessionid";
this.mIsRVAvailable = false;
this.SUPERSONIC_ADS = IronSourceConstants.SUPERSONIC_CONFIG_NAME;
this.DYNAMIC_CONTROLLER_URL = "controllerUrl";
this.DYNAMIC_CONTROLLER_DEBUG_MODE = "debugMode";
this.DYNAMIC_CONTROLLER_CONFIG = "controllerConfig";
this.LANGUAGE = "language";
this.MAX_VIDEO_LENGTH = "maxVideoLength";
this.CAMPAIGN_ID = "campaignId";
this.CUSTOM_PARAM_PREFIX = "custom_";
this.CUSTOM_SEGMENT = "custom_Segment";
this.ITEM_NAME = "itemName";
this.ITEM_COUNT = "itemCount";
this.APPLICATION_PRIVATE_KEY = "privateKey";
this.CLIENT_SIDE_CALLBACKS = "useClientSideCallbacks";
this.AD_VISIBLE_EVENT_NAME = "impressions";
IronLog.INTERNAL.verbose("");
this.isRVInitiated = new AtomicBoolean(false);
ContextProvider.getInstance().registerLifeCycleListener(this);
this.mIsAlreadyShowing = false;
}
private void addItemNameCountSignature(HashMap<String, String> hashMap, JSONObject jSONObject) {
try {
String optString = jSONObject.optString("itemName");
int optInt = jSONObject.optInt("itemCount", -1);
String optString2 = jSONObject.optString("privateKey");
boolean z = true;
boolean z2 = false;
if (TextUtils.isEmpty(optString)) {
z = false;
} else {
hashMap.put("itemName", optString);
}
if (TextUtils.isEmpty(optString2)) {
z = false;
}
if (optInt != -1) {
hashMap.put("itemCount", String.valueOf(optInt));
z2 = z;
}
if (z2) {
int currentTimestamp = IronSourceUtils.getCurrentTimestamp();
hashMap.put("timestamp", String.valueOf(currentTimestamp));
hashMap.put("itemSignature", createItemSig(currentTimestamp, optString, optInt, optString2));
}
} catch (Exception e) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.error(" addItemNameCountSignature" + e);
}
}
public void applyConsent(boolean z) {
if (this.mSSAPublisher == null) {
return;
}
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("gdprConsentStatus", String.valueOf(z));
jSONObject.put("demandSourceName", getProviderName());
} catch (JSONException e) {
e.printStackTrace();
}
this.mSSAPublisher.a(jSONObject);
}
private String createItemSig(int i, String str, int i2, String str2) {
return IronSourceUtils.getMD5(i + str + i2 + str2);
}
private String createMinimumOfferCommissionSig(double d, String str) {
return IronSourceUtils.getMD5(d + str);
}
private String createUserCreationDateSig(String str, String str2, String str3) {
return IronSourceUtils.getMD5(str + str2 + str3);
}
public static String getAdapterSDKVersion() {
return SDKUtils.getSDKVersion();
}
private HashMap<String, String> getGenenralExtraParams() {
HashMap<String, String> hashMap = new HashMap<>();
String pluginType = getPluginType();
if (!TextUtils.isEmpty(pluginType)) {
hashMap.put("SDKPluginType", pluginType);
}
return hashMap;
}
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(this.mMediationSegment)) {
hashMap.put("custom_Segment", this.mMediationSegment);
}
if (!TextUtils.isEmpty(H.a().p)) {
hashMap.put("sessionid", H.a().p);
}
return hashMap;
}
public static IntegrationData getIntegrationData(Activity activity) {
IntegrationData integrationData = new IntegrationData(IronSourceConstants.SUPERSONIC_CONFIG_NAME, "7.2.1.1");
integrationData.activities = new String[]{"com.ironsource.sdk.controller.ControllerActivity", "com.ironsource.sdk.controller.InterstitialActivity", "com.ironsource.sdk.controller.OpenUrlActivity"};
integrationData.providers = new String[]{"com.ironsource.lifecycle.IronsourceLifecycleProvider"};
return integrationData;
}
public HashMap<String, String> getInterstitialExtraParams() {
return getGenenralExtraParams();
}
public HashMap<String, String> getOfferwallExtraParams(JSONObject jSONObject) {
HashMap<String, String> genenralExtraParams = getGenenralExtraParams();
String optString = jSONObject.optString("language");
if (!TextUtils.isEmpty(optString)) {
genenralExtraParams.put("language", optString);
}
genenralExtraParams.put("useClientSideCallbacks", String.valueOf(SupersonicConfig.getConfigObj().getClientSideCallbacks()));
Map<String, String> offerwallCustomParams = SupersonicConfig.getConfigObj().getOfferwallCustomParams();
if (offerwallCustomParams != null && !offerwallCustomParams.isEmpty()) {
genenralExtraParams.putAll(offerwallCustomParams);
}
addItemNameCountSignature(genenralExtraParams, jSONObject);
return genenralExtraParams;
}
public HashMap<String, String> getRewardedVideoExtraParams(JSONObject jSONObject) {
HashMap<String, String> genenralExtraParams = getGenenralExtraParams();
String optString = jSONObject.optString("language");
if (!TextUtils.isEmpty(optString)) {
genenralExtraParams.put("language", optString);
}
String optString2 = jSONObject.optString("maxVideoLength");
if (!TextUtils.isEmpty(optString2)) {
genenralExtraParams.put("maxVideoLength", optString2);
}
String optString3 = jSONObject.optString("campaignId");
if (!TextUtils.isEmpty(optString3)) {
genenralExtraParams.put("campaignId", optString3);
}
if (!TextUtils.isEmpty(this.mMediationSegment)) {
genenralExtraParams.put("custom_Segment", this.mMediationSegment);
}
addItemNameCountSignature(genenralExtraParams, jSONObject);
Map<String, String> rewardedVideoCustomParams = SupersonicConfig.getConfigObj().getRewardedVideoCustomParams();
if (rewardedVideoCustomParams != null && !rewardedVideoCustomParams.isEmpty()) {
genenralExtraParams.putAll(rewardedVideoCustomParams);
}
return genenralExtraParams;
}
private boolean isValidMetaData(String str, String str2) {
if (str.equals("do_not_sell")) {
return MetaDataUtils.isValidCCPAMetaData(str, str2);
}
return true;
}
private void setParamsBeforeInit(JSONObject jSONObject) {
if (mDidSetInitParams.compareAndSet(false, true)) {
SDKUtils.setControllerUrl(jSONObject.optString("controllerUrl"));
int optInt = jSONObject.optInt("debugMode", 0);
if (isAdaptersDebugEnabled()) {
optInt = 3;
}
SDKUtils.setDebugMode(optInt);
SDKUtils.setControllerConfig(jSONObject.optString("controllerConfig", ""));
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + "setting controller url to " + jSONObject.optString("controllerUrl"));
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.verbose(getProviderName() + "setting controller config to " + jSONObject.optString("controllerConfig"));
IronLog ironLog3 = IronLog.ADAPTER_API;
ironLog3.verbose(getProviderName() + "setting debug mode to " + optInt);
}
}
public static SupersonicAdsAdapter startAdapter(String str) {
return new SupersonicAdsAdapter(str);
}
@Override
public void earlyInit(String str, String str2, JSONObject jSONObject) {
IronSourceUtils.sendAutomationLog(getProviderName() + ": earlyInit");
if (mDidInitSdk.compareAndSet(false, true)) {
SDKUtils.setDebugMode(isAdaptersDebugEnabled() ? 3 : jSONObject.optInt("debugMode", 0));
SDKUtils.setControllerUrl(jSONObject.optString("controllerUrl"));
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " IronSourceNetwork setting controller url to " + jSONObject.optString("controllerUrl"));
SDKUtils.setControllerConfig(jSONObject.optString("controllerConfig", ""));
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.verbose(getProviderName() + " IronSourceNetwork setting controller config to " + jSONObject.optString("controllerConfig"));
HashMap<String, String> initParams = getInitParams();
IronSourceNetwork.initSDK(ContextProvider.getInstance().getCurrentActiveActivity(), H.a().j, str2, initParams);
IronLog ironLog3 = IronLog.ADAPTER_API;
ironLog3.verbose("initSDK with appKey=" + H.a().j + " userId=" + str2 + " parameters " + initParams);
}
}
@Override
public void fetchRewardedVideoForAutomaticLoad(JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener) {
IronLog.ADAPTER_API.verbose(getProviderName());
Iterator<RewardedVideoSmashListener> it = this.mAllRewardedVideoSmashes.iterator();
while (it.hasNext()) {
RewardedVideoSmashListener next = it.next();
if (next != null) {
next.onRewardedVideoAvailabilityChanged(this.mIsRVAvailable);
}
}
}
@Override
public String getCoreSDKVersion() {
return SDKUtils.getSDKVersion();
}
@Override
public void getOfferwallCredits() {
if (this.mSSAPublisher == null) {
IronLog.INTERNAL.error("Please call init before calling getOfferwallCredits");
return;
}
H.a();
String str = H.a().k;
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " mSSAPublisher.getOfferWallCredits userId=" + str);
this.mSSAPublisher.a(H.a().j, str, this);
}
@Override
public String getVersion() {
return "7.2.1.1";
}
@Override
public void initInterstitial(String str, String str2, JSONObject jSONObject, InterstitialSmashListener interstitialSmashListener) {
setParamsBeforeInit(jSONObject);
postOnUIThread(new Runnable() {
@Override
public void run() {
try {
String mediationUserId = IronSourceUtils.getMediationUserId();
SupersonicAdsAdapter.this.mSSAPublisher = SSAFactory.getPublisherInstance(ContextProvider.getInstance().getCurrentActiveActivity());
HashMap interstitialExtraParams = SupersonicAdsAdapter.this.getInterstitialExtraParams();
if (SupersonicAdsAdapter.this.mDidSetConsent) {
SupersonicAdsAdapter.this.applyConsent(SupersonicAdsAdapter.this.mConsent);
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(SupersonicAdsAdapter.this.getProviderName() + " mSSAPublisher.initInterstitial userId=" + mediationUserId);
SupersonicAdsAdapter.this.mSSAPublisher.a(H.a().j, mediationUserId, SupersonicAdsAdapter.this.getProviderName(), (Map<String, String>) interstitialExtraParams, (c) SupersonicAdsAdapter.this);
SupersonicAdsAdapter.mDidInitSdk.set(true);
} catch (Exception e) {
e.printStackTrace();
SupersonicAdsAdapter.this.onInterstitialInitFailed(e.getMessage());
}
}
});
}
@Override
public void initOfferwall(String str, final String str2, final JSONObject jSONObject) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " userId=" + str2);
setParamsBeforeInit(jSONObject);
postOnUIThread(new Runnable() {
@Override
public void run() {
try {
HashMap offerwallExtraParams = SupersonicAdsAdapter.this.getOfferwallExtraParams(jSONObject);
SupersonicAdsAdapter.this.mSSAPublisher = SSAFactory.getPublisherInstance(ContextProvider.getInstance().getCurrentActiveActivity());
if (SupersonicAdsAdapter.this.mDidSetConsent) {
SupersonicAdsAdapter.this.applyConsent(SupersonicAdsAdapter.this.mConsent);
}
IronLog ironLog2 = IronLog.ADAPTER_API;
ironLog2.verbose(SupersonicAdsAdapter.this.getProviderName() + " mSSAPublisher.initOfferWall");
SupersonicAdsAdapter.this.mSSAPublisher.a(H.a().j, str2, offerwallExtraParams, SupersonicAdsAdapter.this);
SupersonicAdsAdapter.mDidInitSdk.set(true);
} catch (Exception e) {
e.printStackTrace();
IronLog ironLog3 = IronLog.ADAPTER_API;
ironLog3.error(SupersonicAdsAdapter.this.getProviderName() + ":initOfferwall(userId:" + str2 + ")" + e);
com.ironsource.mediationsdk.sdk.f fVar = SupersonicAdsAdapter.this.mOfferwallListener;
StringBuilder sb = new StringBuilder("Adapter initialization failure - ");
sb.append(SupersonicAdsAdapter.this.getProviderName());
sb.append(" - ");
sb.append(e.getMessage());
fVar.a(false, ErrorBuilder.buildInitFailedError(sb.toString(), IronSourceConstants.OFFERWALL_AD_UNIT));
}
}
});
}
@Override
public void initRewardedVideo(String str, String str2, final JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener) {
if (this.isRVInitiated.compareAndSet(false, true)) {
setParamsBeforeInit(jSONObject);
postOnUIThread(new Runnable() {
@Override
public void run() {
try {
String mediationUserId = IronSourceUtils.getMediationUserId();
SupersonicAdsAdapter.this.mSSAPublisher = SSAFactory.getPublisherInstance(ContextProvider.getInstance().getCurrentActiveActivity());
HashMap rewardedVideoExtraParams = SupersonicAdsAdapter.this.getRewardedVideoExtraParams(jSONObject);
if (SupersonicAdsAdapter.this.mDidSetConsent) {
SupersonicAdsAdapter.this.applyConsent(SupersonicAdsAdapter.this.mConsent);
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(SupersonicAdsAdapter.this.getProviderName() + " mSSAPublisher.initRewardedVideo userId=" + mediationUserId);
SupersonicAdsAdapter.this.mSSAPublisher.a(H.a().j, mediationUserId, SupersonicAdsAdapter.this.getProviderName(), (Map<String, String>) rewardedVideoExtraParams, (f) SupersonicAdsAdapter.this);
SupersonicAdsAdapter.mDidInitSdk.set(true);
} catch (Exception e) {
e.printStackTrace();
SupersonicAdsAdapter.this.onRVInitFail("initRewardedVideo");
}
}
});
return;
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " adapter already initiated");
fetchRewardedVideoForAutomaticLoad(jSONObject, rewardedVideoSmashListener);
}
@Override
public boolean isInterstitialReady(JSONObject jSONObject) {
com.ironsource.sdk.f fVar = this.mSSAPublisher;
return fVar != null && fVar.a(getProviderName());
}
public boolean isOfferwallAvailable() {
return true;
}
@Override
public boolean isRewardedVideoAvailable(JSONObject jSONObject) {
return this.mIsRVAvailable;
}
@Override
public void loadInterstitial(JSONObject jSONObject, InterstitialSmashListener interstitialSmashListener) {
if (this.mSSAPublisher == null) {
IronLog.INTERNAL.error("Please call initInterstitial before calling loadInterstitial");
Iterator<InterstitialSmashListener> it = this.mAllInterstitialSmashes.iterator();
while (it.hasNext()) {
InterstitialSmashListener next = it.next();
if (next != null) {
next.onInterstitialAdLoadFailed(ErrorBuilder.buildLoadFailedError("Load was called before Init"));
}
}
return;
}
JSONObject jSONObject2 = new JSONObject();
try {
jSONObject2.put("demandSourceName", getProviderName());
} catch (JSONException e) {
e.printStackTrace();
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " mSSAPublisher.loadInterstitial");
this.mSSAPublisher.c(jSONObject2);
}
@Override
public void onGetOWCreditsFailed(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mOfferwallListener != null) {
this.mOfferwallListener.onGetOfferwallCreditsFailed(ErrorBuilder.buildGenericError(str));
}
}
@Override
public void onInterstitialAdRewarded(String str, int i) {
}
@Override
public void onInterstitialClick() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveInterstitialSmash != null) {
this.mActiveInterstitialSmash.onInterstitialAdClicked();
}
}
@Override
public void onInterstitialClose() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveInterstitialSmash != null) {
this.mActiveInterstitialSmash.onInterstitialAdClosed();
}
}
@Override
public void onInterstitialEventNotificationReceived(String str, JSONObject jSONObject) {
if (jSONObject != null) {
IronLog ironLog = IronLog.ADAPTER_CALLBACK;
ironLog.verbose(getProviderName() + " " + str + " extData: " + jSONObject.toString());
if (TextUtils.isEmpty(str) || !"impressions".equals(str) || this.mActiveInterstitialSmash == null) {
return;
}
this.mActiveInterstitialSmash.onInterstitialAdVisible();
}
}
@Override
public void onInterstitialInitFailed(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
Iterator<InterstitialSmashListener> it = this.mAllInterstitialSmashes.iterator();
while (it.hasNext()) {
InterstitialSmashListener next = it.next();
if (next != null) {
next.onInterstitialInitFailed(ErrorBuilder.buildInitFailedError(str, "Interstitial"));
}
}
}
@Override
public void onInterstitialInitSuccess() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
Iterator<InterstitialSmashListener> it = this.mAllInterstitialSmashes.iterator();
while (it.hasNext()) {
InterstitialSmashListener next = it.next();
if (next != null) {
next.onInterstitialInitSuccess();
}
}
}
@Override
public void onInterstitialLoadFailed(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
Iterator<InterstitialSmashListener> it = this.mAllInterstitialSmashes.iterator();
while (it.hasNext()) {
InterstitialSmashListener next = it.next();
if (next != null) {
next.onInterstitialAdLoadFailed(ErrorBuilder.buildLoadFailedError(str));
}
}
}
@Override
public void onInterstitialLoadSuccess() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
Iterator<InterstitialSmashListener> it = this.mAllInterstitialSmashes.iterator();
while (it.hasNext()) {
InterstitialSmashListener next = it.next();
if (next != null) {
next.onInterstitialAdReady();
}
}
}
@Override
public void onInterstitialOpen() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveInterstitialSmash != null) {
this.mActiveInterstitialSmash.onInterstitialAdOpened();
}
}
@Override
public void onInterstitialShowFailed(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveInterstitialSmash != null) {
this.mActiveInterstitialSmash.onInterstitialAdShowFailed(ErrorBuilder.buildShowFailedError("Interstitial", str));
}
}
@Override
public void onInterstitialShowSuccess() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveInterstitialSmash != null) {
this.mActiveInterstitialSmash.onInterstitialAdShowSucceeded();
}
}
@Override
public void onOWAdClosed() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
com.ironsource.mediationsdk.sdk.f fVar = this.mOfferwallListener;
if (fVar != null) {
fVar.onOfferwallClosed();
}
}
@Override
public boolean onOWAdCredited(int i, int i2, boolean z) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
com.ironsource.mediationsdk.sdk.f fVar = this.mOfferwallListener;
return fVar != null && fVar.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) {
if (TextUtils.isEmpty(str)) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
} else {
IronLog ironLog = IronLog.ADAPTER_CALLBACK;
ironLog.verbose(getProviderName() + ":onOWShowSuccess(placementId:" + str + ")");
}
com.ironsource.mediationsdk.sdk.f fVar = this.mOfferwallListener;
if (fVar != null) {
fVar.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.f fVar = this.mOfferwallListener;
if (fVar != null) {
fVar.onOfferwallAvailable(true);
}
}
@Override
public void onPause(Activity activity) {
if (this.mSSAPublisher != null) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " mSSAPublisher.onPause");
this.mSSAPublisher.b(activity);
}
}
@Override
public void onRVAdClicked() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveRewardedVideoSmash != null) {
this.mActiveRewardedVideoSmash.onRewardedVideoAdClicked();
}
}
@Override
public void onRVAdClosed() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveRewardedVideoSmash != null) {
this.mActiveRewardedVideoSmash.onRewardedVideoAdClosed();
}
}
@Override
public void onRVAdCredited(int i) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveRewardedVideoSmash != null) {
this.mActiveRewardedVideoSmash.onRewardedVideoAdRewarded();
}
}
@Override
public void onRVAdOpened() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveRewardedVideoSmash != null) {
this.mActiveRewardedVideoSmash.onRewardedVideoAdOpened();
}
}
@Override
public void onRVEventNotificationReceived(String str, JSONObject jSONObject) {
if (jSONObject != null) {
IronLog ironLog = IronLog.ADAPTER_CALLBACK;
ironLog.verbose(getProviderName() + " " + str + " extData: " + jSONObject.toString());
}
if (TextUtils.isEmpty(str) || !"impressions".equals(str) || this.mActiveRewardedVideoSmash == null) {
return;
}
this.mActiveRewardedVideoSmash.onRewardedVideoAdVisible();
}
@Override
public void onRVInitFail(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
Iterator<RewardedVideoSmashListener> it = this.mAllRewardedVideoSmashes.iterator();
while (it.hasNext()) {
RewardedVideoSmashListener next = it.next();
if (next != null) {
next.onRewardedVideoAvailabilityChanged(false);
}
}
}
@Override
public void onRVInitSuccess(a aVar) {
int i;
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
try {
i = Integer.parseInt(aVar.b);
} catch (NumberFormatException e) {
IronLog ironLog = IronLog.INTERNAL;
ironLog.error("parseInt()" + e);
i = 0;
}
boolean z = i > 0;
this.mIsRVAvailable = z;
Iterator<RewardedVideoSmashListener> it = this.mAllRewardedVideoSmashes.iterator();
while (it.hasNext()) {
RewardedVideoSmashListener next = it.next();
if (next != null) {
next.onRewardedVideoAvailabilityChanged(z);
}
}
}
@Override
public void onRVNoMoreOffers() {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
this.mIsRVAvailable = false;
Iterator<RewardedVideoSmashListener> it = this.mAllRewardedVideoSmashes.iterator();
while (it.hasNext()) {
RewardedVideoSmashListener next = it.next();
if (next != null) {
next.onRewardedVideoAvailabilityChanged(false);
}
}
}
@Override
public void onRVShowFail(String str) {
IronLog.ADAPTER_CALLBACK.verbose(getProviderName());
if (this.mActiveRewardedVideoSmash != null) {
this.mActiveRewardedVideoSmash.onRewardedVideoAdShowFailed(new IronSourceError(509, str));
}
}
@Override
public void onResume(Activity activity) {
if (this.mSSAPublisher != null) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " mSSAPublisher.onResume");
this.mSSAPublisher.c(activity);
}
}
@Override
public void setConsent(boolean z) {
IronLog ironLog = IronLog.ADAPTER_API;
StringBuilder sb = new StringBuilder();
sb.append(getProviderName());
sb.append(": setConsent (");
sb.append(z ? "true" : "false");
sb.append(")");
ironLog.verbose(sb.toString());
this.mDidSetConsent = true;
this.mConsent = z;
applyConsent(z);
}
@Override
public void setInternalOfferwallListener(com.ironsource.mediationsdk.sdk.f fVar) {
this.mOfferwallListener = fVar;
}
@Override
public void setMediationSegment(String str) {
this.mMediationSegment = str;
}
@Override
public void setMediationState(AbstractC1349b.a aVar, String str) {
if (this.mSSAPublisher != null) {
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + ": setMediationState(" + str + " , " + getProviderName() + " , " + aVar.l + ")");
this.mSSAPublisher.a(str, getProviderName(), aVar.l);
}
}
@Override
public void setMetaData(String str, String str2) {
if (mDidInitSdk.get()) {
return;
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose("key=" + str + ", value=" + str2);
if (!isValidMetaData(str, str2)) {
IronLog.ADAPTER_API.verbose("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) {
this.mActiveInterstitialSmash = interstitialSmashListener;
if (this.mSSAPublisher == null) {
IronLog.INTERNAL.error("Please call loadInterstitialForBidding before calling showInterstitial");
if (this.mActiveInterstitialSmash != null) {
this.mActiveInterstitialSmash.onInterstitialAdShowFailed(ErrorBuilder.buildNoAdsToShowError("Interstitial"));
return;
}
return;
}
int b = o.a().b(2);
JSONObject jSONObject2 = new JSONObject();
try {
jSONObject2.put("demandSourceName", getProviderName());
jSONObject2.put(IronSourceConstants.KEY_SESSION_DEPTH, b);
} catch (JSONException e) {
e.printStackTrace();
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " mSSAPublisher.showInterstitial");
this.mSSAPublisher.d(jSONObject2);
}
@Override
public void showOfferwall(String str, JSONObject jSONObject) {
HashMap<String, String> offerwallExtraParams = getOfferwallExtraParams(jSONObject);
if (offerwallExtraParams != null) {
offerwallExtraParams.put("placementId", str);
}
if (this.mSSAPublisher == null) {
IronLog.INTERNAL.error("Please call init before calling showOfferwall");
return;
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " mSSAPublisher.showOfferWall");
this.mSSAPublisher.a(ContextProvider.getInstance().getCurrentActiveActivity(), offerwallExtraParams);
}
@Override
public void showRewardedVideo(JSONObject jSONObject, RewardedVideoSmashListener rewardedVideoSmashListener) {
this.mActiveRewardedVideoSmash = rewardedVideoSmashListener;
if (this.mSSAPublisher == null) {
this.mIsRVAvailable = false;
if (this.mActiveRewardedVideoSmash != null) {
this.mActiveRewardedVideoSmash.onRewardedVideoAdShowFailed(ErrorBuilder.buildNoAdsToShowError(IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
Iterator<RewardedVideoSmashListener> it = this.mAllRewardedVideoSmashes.iterator();
while (it.hasNext()) {
RewardedVideoSmashListener next = it.next();
if (next != null) {
next.onRewardedVideoAvailabilityChanged(false);
}
}
return;
}
int b = o.a().b(1);
JSONObject jSONObject2 = new JSONObject();
try {
jSONObject2.put("demandSourceName", getProviderName());
jSONObject2.put(IronSourceConstants.KEY_SESSION_DEPTH, b);
} catch (JSONException e) {
e.printStackTrace();
}
IronLog ironLog = IronLog.ADAPTER_API;
ironLog.verbose(getProviderName() + " mSSAPublisher.showRewardedVideo");
this.mSSAPublisher.b(jSONObject2);
}
}