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,101 @@
package com.applovin.mediation.adapters;
import com.applovin.adview.AppLovinAdView;
import com.applovin.adview.AppLovinAdViewDisplayErrorCode;
import com.applovin.adview.AppLovinAdViewEventListener;
import com.applovin.impl.rb;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.listeners.MaxAdViewAdapterListener;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinSdkUtils;
/* loaded from: classes2.dex */
public class AppLovinAdapterAdViewListener implements rb, AppLovinAdDisplayListener, AppLovinAdClickListener, AppLovinAdViewEventListener {
private final MaxAdFormat adFormat;
private final MaxAdViewAdapterListener listener;
private final AppLovinMediationAdapter parentAdapter;
public AppLovinAdapterAdViewListener(AppLovinMediationAdapter appLovinMediationAdapter, MaxAdFormat maxAdFormat, MaxAdViewAdapterListener maxAdViewAdapterListener) {
this.parentAdapter = appLovinMediationAdapter;
this.adFormat = maxAdFormat;
this.listener = maxAdViewAdapterListener;
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$adReceived$0(AppLovinAd appLovinAd) {
this.parentAdapter.loadedAdView = new AppLovinAdView(this.parentAdapter.getWrappingSdk(), appLovinAd.getSize(), this.parentAdapter.getApplicationContext());
this.parentAdapter.loadedAdView.setAdDisplayListener(this);
this.parentAdapter.loadedAdView.setAdClickListener(this);
this.parentAdapter.loadedAdView.setAdViewEventListener(this);
this.listener.onAdViewAdLoaded(this.parentAdapter.loadedAdView);
this.parentAdapter.loadedAdView.renderAd(appLovinAd);
}
@Override // com.applovin.sdk.AppLovinAdClickListener
public void adClicked(AppLovinAd appLovinAd) {
this.parentAdapter.log(this.adFormat.getLabel() + " ad clicked");
this.listener.onAdViewAdClicked(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.adview.AppLovinAdViewEventListener
public void adClosedFullscreen(AppLovinAd appLovinAd, AppLovinAdView appLovinAdView) {
this.parentAdapter.log(this.adFormat.getLabel() + " ad collapsed");
this.listener.onAdViewAdCollapsed();
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adDisplayed(AppLovinAd appLovinAd) {
this.parentAdapter.log(this.adFormat.getLabel() + " ad shown");
this.listener.onAdViewAdDisplayed();
}
@Override // com.applovin.adview.AppLovinAdViewEventListener
public void adFailedToDisplay(AppLovinAd appLovinAd, AppLovinAdView appLovinAdView, AppLovinAdViewDisplayErrorCode appLovinAdViewDisplayErrorCode) {
this.parentAdapter.log(this.adFormat.getLabel() + " failed to display with error code: " + appLovinAdViewDisplayErrorCode);
this.listener.onAdViewAdDisplayFailed(MaxAdapterError.UNSPECIFIED);
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adHidden(AppLovinAd appLovinAd) {
this.parentAdapter.log(this.adFormat.getLabel() + " ad hidden");
this.listener.onAdViewAdHidden(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.adview.AppLovinAdViewEventListener
public void adLeftApplication(AppLovinAd appLovinAd, AppLovinAdView appLovinAdView) {
this.parentAdapter.log(this.adFormat.getLabel() + " ad left application");
}
@Override // com.applovin.adview.AppLovinAdViewEventListener
public void adOpenedFullscreen(AppLovinAd appLovinAd, AppLovinAdView appLovinAdView) {
this.parentAdapter.log(this.adFormat.getLabel() + " ad expanded");
this.listener.onAdViewAdExpanded();
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void adReceived(final AppLovinAd appLovinAd) {
this.parentAdapter.log(this.adFormat.getLabel() + " ad loaded");
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.mediation.adapters.AppLovinAdapterAdViewListener$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
AppLovinAdapterAdViewListener.this.lambda$adReceived$0(appLovinAd);
}
});
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void failedToReceiveAd(int i) {
failedToReceiveAdV2(new AppLovinError(i, ""));
}
@Override // com.applovin.impl.rb
public void failedToReceiveAdV2(AppLovinError appLovinError) {
MaxAdapterError maxError = AppLovinMediationAdapter.toMaxError(appLovinError);
this.parentAdapter.log(this.adFormat.getLabel() + " ad failed to load with error: " + maxError);
this.listener.onAdViewAdLoadFailed(maxError);
}
}

View File

@@ -0,0 +1,68 @@
package com.applovin.mediation.adapters;
import android.os.Bundle;
import com.applovin.impl.qb;
import com.applovin.impl.rb;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.impl.sdk.ad.b;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.listeners.MaxAppOpenAdapterListener;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
/* loaded from: classes2.dex */
public class AppLovinAdapterAppOpenListener implements rb, AppLovinAdClickListener, qb {
private final MaxAppOpenAdapterListener listener;
private final AppLovinMediationAdapter parentAdapter;
public AppLovinAdapterAppOpenListener(AppLovinMediationAdapter appLovinMediationAdapter, MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
this.parentAdapter = appLovinMediationAdapter;
this.listener = maxAppOpenAdapterListener;
}
@Override // com.applovin.sdk.AppLovinAdClickListener
public void adClicked(AppLovinAd appLovinAd) {
this.parentAdapter.log("App open ad clicked");
this.listener.onAppOpenAdClicked(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adDisplayed(AppLovinAd appLovinAd) {
this.parentAdapter.log("App open ad shown");
Bundle bundle = new Bundle(1);
if (appLovinAd instanceof b) {
bundle.putBundle("applovin_ad_view_info", ((b) appLovinAd).d());
}
this.listener.onAppOpenAdDisplayed(bundle);
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adHidden(AppLovinAd appLovinAd) {
this.parentAdapter.log("App open ad hidden");
this.listener.onAppOpenAdHidden(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void adReceived(AppLovinAd appLovinAd) {
this.parentAdapter.log("App open ad loaded");
this.parentAdapter.loadedAppOpenAd = appLovinAd;
this.listener.onAppOpenAdLoaded();
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void failedToReceiveAd(int i) {
failedToReceiveAdV2(new AppLovinError(i, ""));
}
@Override // com.applovin.impl.rb
public void failedToReceiveAdV2(AppLovinError appLovinError) {
this.parentAdapter.log("App open ad failed to load with error: " + appLovinError);
this.listener.onAppOpenAdLoadFailed(AppLovinMediationAdapter.toMaxError(appLovinError));
}
@Override // com.applovin.impl.qb
public void onAdDisplayFailed(String str) {
this.parentAdapter.log("App open ad failed to display with error: " + str);
this.listener.onAppOpenAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, str));
}
}

View File

@@ -0,0 +1,68 @@
package com.applovin.mediation.adapters;
import android.os.Bundle;
import com.applovin.impl.qb;
import com.applovin.impl.rb;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.impl.sdk.ad.b;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
/* loaded from: classes2.dex */
public class AppLovinAdapterInterstitialListener implements rb, AppLovinAdClickListener, qb {
private final MaxInterstitialAdapterListener listener;
private final AppLovinMediationAdapter parentAdapter;
public AppLovinAdapterInterstitialListener(AppLovinMediationAdapter appLovinMediationAdapter, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
this.parentAdapter = appLovinMediationAdapter;
this.listener = maxInterstitialAdapterListener;
}
@Override // com.applovin.sdk.AppLovinAdClickListener
public void adClicked(AppLovinAd appLovinAd) {
this.parentAdapter.log("Interstitial ad clicked");
this.listener.onInterstitialAdClicked(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adDisplayed(AppLovinAd appLovinAd) {
this.parentAdapter.log("Interstitial ad shown");
Bundle bundle = new Bundle(1);
if (appLovinAd instanceof b) {
bundle.putBundle("applovin_ad_view_info", ((b) appLovinAd).d());
}
this.listener.onInterstitialAdDisplayed(bundle);
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adHidden(AppLovinAd appLovinAd) {
this.parentAdapter.log("Interstitial ad hidden");
this.listener.onInterstitialAdHidden(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void adReceived(AppLovinAd appLovinAd) {
this.parentAdapter.log("Interstitial ad loaded");
this.parentAdapter.loadedInterstitialAd = appLovinAd;
this.listener.onInterstitialAdLoaded();
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void failedToReceiveAd(int i) {
failedToReceiveAdV2(new AppLovinError(i, ""));
}
@Override // com.applovin.impl.rb
public void failedToReceiveAdV2(AppLovinError appLovinError) {
this.parentAdapter.log("Interstitial ad failed to load with error: " + appLovinError);
this.listener.onInterstitialAdLoadFailed(AppLovinMediationAdapter.toMaxError(appLovinError));
}
@Override // com.applovin.impl.qb
public void onAdDisplayFailed(String str) {
this.parentAdapter.log("Interstitial ad failed to display with error: " + str);
this.listener.onInterstitialAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_UNSPECIFIED, str));
}
}

View File

@@ -0,0 +1,69 @@
package com.applovin.mediation.adapters;
import android.view.View;
import android.view.ViewGroup;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.mediation.nativeAds.MaxNativeAd;
import com.applovin.mediation.nativeAds.MaxNativeAdView;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes2.dex */
public class AppLovinAdapterNativeAd extends MaxNativeAd {
private final AppLovinMediationAdapter parentAdapter;
public AppLovinAdapterNativeAd(AppLovinMediationAdapter appLovinMediationAdapter, MaxNativeAd.Builder builder) {
super(builder);
this.parentAdapter = appLovinMediationAdapter;
}
@Override // com.applovin.mediation.nativeAds.MaxNativeAd
public boolean prepareForInteraction(List<View> list, ViewGroup viewGroup) {
AppLovinMediationAdapter appLovinMediationAdapter = this.parentAdapter;
AppLovinNativeAdImpl appLovinNativeAdImpl = (AppLovinNativeAdImpl) appLovinMediationAdapter.loadedNativeAd;
if (appLovinNativeAdImpl == null) {
appLovinMediationAdapter.e("Failed to register native ad views: native ad is null");
return false;
}
appLovinMediationAdapter.d("Preparing views for interaction: " + list + " with container: " + viewGroup);
appLovinNativeAdImpl.registerViewsForInteraction(list, viewGroup);
return true;
}
@Override // com.applovin.mediation.nativeAds.MaxNativeAd
public void prepareViewForInteraction(MaxNativeAdView maxNativeAdView) {
AppLovinMediationAdapter appLovinMediationAdapter = this.parentAdapter;
AppLovinNativeAdImpl appLovinNativeAdImpl = (AppLovinNativeAdImpl) appLovinMediationAdapter.loadedNativeAd;
if (appLovinNativeAdImpl == null) {
appLovinMediationAdapter.e("Failed to register native ad view for interaction. Native ad is null");
return;
}
appLovinMediationAdapter.d("Preparing view for interaction: " + maxNativeAdView);
ArrayList arrayList = new ArrayList(5);
if (StringUtils.isValidString(getTitle()) && maxNativeAdView.getTitleTextView() != null) {
this.parentAdapter.d("Adding title TextView: " + maxNativeAdView.getTitleTextView());
arrayList.add(maxNativeAdView.getTitleTextView());
}
if (StringUtils.isValidString(getAdvertiser()) && maxNativeAdView.getAdvertiserTextView() != null) {
this.parentAdapter.d("Adding advertiser TextView: " + maxNativeAdView.getAdvertiserTextView());
arrayList.add(maxNativeAdView.getAdvertiserTextView());
}
if (StringUtils.isValidString(getBody()) && maxNativeAdView.getBodyTextView() != null) {
this.parentAdapter.d("Adding body TextView: " + maxNativeAdView.getBodyTextView());
arrayList.add(maxNativeAdView.getBodyTextView());
}
if (StringUtils.isValidString(getCallToAction()) && maxNativeAdView.getCallToActionButton() != null) {
this.parentAdapter.d("Adding CTA button: " + maxNativeAdView.getCallToActionButton());
this.parentAdapter.d("CTA button is clickable: " + maxNativeAdView.getCallToActionButton().isClickable());
this.parentAdapter.d("CTA button is enabled: " + maxNativeAdView.getCallToActionButton().isEnabled());
this.parentAdapter.d("CTA button has onClickListeners: " + maxNativeAdView.getCallToActionButton().hasOnClickListeners());
arrayList.add(maxNativeAdView.getCallToActionButton());
}
if (getIcon() != null && maxNativeAdView.getIconImageView() != null) {
this.parentAdapter.d("Adding icon image view: " + maxNativeAdView.getIconImageView());
arrayList.add(maxNativeAdView.getIconImageView());
}
appLovinNativeAdImpl.registerViewsForInteraction(arrayList, maxNativeAdView);
}
}

View File

@@ -0,0 +1,54 @@
package com.applovin.mediation.adapters;
import android.text.TextUtils;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAd;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdEventListener;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdLoadListener;
import com.applovin.impl.sdk.utils.BundleUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.listeners.MaxNativeAdAdapterListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.applovin.mediation.nativeAds.MaxNativeAd;
/* loaded from: classes2.dex */
public class AppLovinAdapterNativeListener implements AppLovinNativeAdLoadListener, AppLovinNativeAdEventListener {
private final MaxNativeAdAdapterListener listener;
private final MaxAdapterResponseParameters parameters;
private final AppLovinMediationAdapter parentAdapter;
public AppLovinAdapterNativeListener(MaxAdapterResponseParameters maxAdapterResponseParameters, AppLovinMediationAdapter appLovinMediationAdapter, MaxNativeAdAdapterListener maxNativeAdAdapterListener) {
this.parameters = maxAdapterResponseParameters;
this.parentAdapter = appLovinMediationAdapter;
this.listener = maxNativeAdAdapterListener;
}
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAdEventListener
public void onNativeAdClicked(AppLovinNativeAd appLovinNativeAd) {
this.parentAdapter.d("Native ad clicked");
this.listener.onNativeAdClicked();
}
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAdLoadListener
public void onNativeAdLoadFailed(AppLovinError appLovinError) {
this.parentAdapter.d("Native ad failed to load with error: " + appLovinError);
this.listener.onNativeAdLoadFailed(AppLovinMediationAdapter.toMaxError(appLovinError));
}
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAdLoadListener
public void onNativeAdLoaded(AppLovinNativeAd appLovinNativeAd) {
this.parentAdapter.d("Native ad loaded: " + appLovinNativeAd);
if (!StringUtils.isValidString(BundleUtils.getString("template", "", this.parameters.getServerParameters())) || !TextUtils.isEmpty(appLovinNativeAd.getTitle())) {
((AppLovinNativeAdImpl) appLovinNativeAd).setEventListener(this);
AppLovinMediationAdapter appLovinMediationAdapter = this.parentAdapter;
appLovinMediationAdapter.loadedNativeAd = appLovinNativeAd;
this.listener.onNativeAdLoaded(new AppLovinAdapterNativeAd(appLovinMediationAdapter, new MaxNativeAd.Builder().setAdFormat(MaxAdFormat.NATIVE).setTitle(appLovinNativeAd.getTitle()).setAdvertiser(appLovinNativeAd.getAdvertiser()).setBody(appLovinNativeAd.getBody()).setCallToAction(appLovinNativeAd.getCallToAction()).setIcon(new MaxNativeAd.MaxNativeAdImage(appLovinNativeAd.getIconUri())).setOptionsView(appLovinNativeAd.getOptionsView()).setMediaView(appLovinNativeAd.getMediaView()).setMainImage(new MaxNativeAd.MaxNativeAdImage(((AppLovinNativeAdImpl) appLovinNativeAd).getMainImageUri())).setMediaContentAspectRatio(appLovinNativeAd.getMediaView().getAspectRatio()).setStarRating(appLovinNativeAd.getStarRating())), null);
return;
}
this.parentAdapter.e("Native ad does not have required assets: " + appLovinNativeAd);
this.listener.onNativeAdLoadFailed(MaxAdapterError.MISSING_REQUIRED_NATIVE_AD_ASSETS);
}
}

View File

@@ -0,0 +1,109 @@
package com.applovin.mediation.adapters;
import android.os.Bundle;
import com.applovin.impl.qb;
import com.applovin.impl.rb;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.impl.sdk.ad.b;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.listeners.MaxRewardedInterstitialAdapterListener;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdRewardListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import java.util.Map;
/* loaded from: classes2.dex */
public class AppLovinAdapterRewardedInterstitialListener implements rb, AppLovinAdRewardListener, AppLovinAdVideoPlaybackListener, AppLovinAdClickListener, qb {
private boolean hasGrantedReward;
private final MaxRewardedInterstitialAdapterListener listener;
private final AppLovinMediationAdapter parentAdapter;
public AppLovinAdapterRewardedInterstitialListener(AppLovinMediationAdapter appLovinMediationAdapter, MaxRewardedInterstitialAdapterListener maxRewardedInterstitialAdapterListener) {
this.parentAdapter = appLovinMediationAdapter;
this.listener = maxRewardedInterstitialAdapterListener;
}
@Override // com.applovin.sdk.AppLovinAdClickListener
public void adClicked(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded interstitial ad clicked");
this.listener.onRewardedInterstitialAdClicked(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adDisplayed(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded interstitial ad shown");
Bundle bundle = new Bundle(1);
if (appLovinAd instanceof b) {
bundle.putBundle("applovin_ad_view_info", ((b) appLovinAd).d());
}
this.listener.onRewardedInterstitialAdDisplayed(bundle);
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adHidden(AppLovinAd appLovinAd) {
if (this.hasGrantedReward || this.parentAdapter.shouldAlwaysRewardUser()) {
MaxReward reward = this.parentAdapter.getReward();
this.parentAdapter.log("Rewarded interstitial rewarded user with reward: " + reward);
this.listener.onUserRewarded(reward);
}
this.parentAdapter.log("Rewarded interstitial ad hidden");
this.listener.onRewardedInterstitialAdHidden(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void adReceived(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded interstitial ad loaded");
this.parentAdapter.loadedRewardedInterstitialAd = appLovinAd;
this.listener.onRewardedInterstitialAdLoaded();
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void failedToReceiveAd(int i) {
failedToReceiveAdV2(new AppLovinError(i, ""));
}
@Override // com.applovin.impl.rb
public void failedToReceiveAdV2(AppLovinError appLovinError) {
this.parentAdapter.log("Rewarded interstitial ad failed to load with error: " + appLovinError);
this.listener.onRewardedInterstitialAdLoadFailed(AppLovinMediationAdapter.toMaxError(appLovinError));
}
@Override // com.applovin.impl.qb
public void onAdDisplayFailed(String str) {
this.parentAdapter.log("Rewarded interstitial ad failed to display with error: " + str);
this.listener.onRewardedInterstitialAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_UNSPECIFIED, str));
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void userOverQuota(AppLovinAd appLovinAd, Map<String, String> map) {
this.parentAdapter.log("User is over quota: " + map);
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void userRewardRejected(AppLovinAd appLovinAd, Map<String, String> map) {
this.parentAdapter.log("Reward rejected: " + map);
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void userRewardVerified(AppLovinAd appLovinAd, Map<String, String> map) {
this.parentAdapter.log("Reward verified");
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void validationRequestFailed(AppLovinAd appLovinAd, int i) {
this.parentAdapter.log("Reward validation request failed with code: " + i);
}
@Override // com.applovin.sdk.AppLovinAdVideoPlaybackListener
public void videoPlaybackBegan(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded interstitial ad video started");
}
@Override // com.applovin.sdk.AppLovinAdVideoPlaybackListener
public void videoPlaybackEnded(AppLovinAd appLovinAd, double d, boolean z) {
this.parentAdapter.log("Rewarded interstitial ad video ended at " + d + "% and is fully watched: " + z);
this.hasGrantedReward = z;
}
}

View File

@@ -0,0 +1,109 @@
package com.applovin.mediation.adapters;
import android.os.Bundle;
import com.applovin.impl.qb;
import com.applovin.impl.rb;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.impl.sdk.ad.b;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdRewardListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import java.util.Map;
/* loaded from: classes2.dex */
public class AppLovinAdapterRewardedListener implements rb, AppLovinAdRewardListener, AppLovinAdVideoPlaybackListener, AppLovinAdClickListener, qb {
private boolean hasGrantedReward;
private final MaxRewardedAdapterListener listener;
private final AppLovinMediationAdapter parentAdapter;
public AppLovinAdapterRewardedListener(AppLovinMediationAdapter appLovinMediationAdapter, MaxRewardedAdapterListener maxRewardedAdapterListener) {
this.parentAdapter = appLovinMediationAdapter;
this.listener = maxRewardedAdapterListener;
}
@Override // com.applovin.sdk.AppLovinAdClickListener
public void adClicked(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded ad clicked");
this.listener.onRewardedAdClicked(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adDisplayed(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded ad shown");
Bundle bundle = new Bundle(1);
if (appLovinAd instanceof b) {
bundle.putBundle("applovin_ad_view_info", ((b) appLovinAd).d());
}
this.listener.onRewardedAdDisplayed(bundle);
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adHidden(AppLovinAd appLovinAd) {
if (this.hasGrantedReward || this.parentAdapter.shouldAlwaysRewardUser()) {
MaxReward reward = this.parentAdapter.getReward();
this.parentAdapter.log("Rewarded user with reward: " + reward);
this.listener.onUserRewarded(reward);
}
this.parentAdapter.log("Rewarded ad hidden");
this.listener.onRewardedAdHidden(AppLovinMediationAdapter.getExtraInfo(appLovinAd));
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void adReceived(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded ad loaded");
this.parentAdapter.loadedRewardedAd = appLovinAd;
this.listener.onRewardedAdLoaded();
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void failedToReceiveAd(int i) {
failedToReceiveAdV2(new AppLovinError(i, ""));
}
@Override // com.applovin.impl.rb
public void failedToReceiveAdV2(AppLovinError appLovinError) {
this.parentAdapter.log("Rewarded ad failed to load with error code: " + appLovinError);
this.listener.onRewardedAdLoadFailed(AppLovinMediationAdapter.toMaxError(appLovinError));
}
@Override // com.applovin.impl.qb
public void onAdDisplayFailed(String str) {
this.parentAdapter.log("Rewarded ad failed to display with error: " + str);
this.listener.onRewardedAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_UNSPECIFIED, str));
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void userOverQuota(AppLovinAd appLovinAd, Map<String, String> map) {
this.parentAdapter.log("User is over quota: " + map);
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void userRewardRejected(AppLovinAd appLovinAd, Map<String, String> map) {
this.parentAdapter.log("Reward rejected: " + map);
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void userRewardVerified(AppLovinAd appLovinAd, Map<String, String> map) {
this.parentAdapter.log("Reward verified");
}
@Override // com.applovin.sdk.AppLovinAdRewardListener
public void validationRequestFailed(AppLovinAd appLovinAd, int i) {
this.parentAdapter.log("Reward validation request failed with code: " + i);
}
@Override // com.applovin.sdk.AppLovinAdVideoPlaybackListener
public void videoPlaybackBegan(AppLovinAd appLovinAd) {
this.parentAdapter.log("Rewarded ad video started");
}
@Override // com.applovin.sdk.AppLovinAdVideoPlaybackListener
public void videoPlaybackEnded(AppLovinAd appLovinAd, double d, boolean z) {
this.parentAdapter.log("Rewarded ad video ended at " + d + "% and is fully watched: " + z);
this.hasGrantedReward = z;
}
}

View File

@@ -0,0 +1,265 @@
package com.applovin.mediation.adapters;
import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Lifecycle;
import com.applovin.adview.AppLovinAdView;
import com.applovin.adview.AppLovinIncentivizedInterstitial;
import com.applovin.adview.AppLovinInterstitialAd;
import com.applovin.adview.AppLovinInterstitialAdDialog;
import com.applovin.impl.adview.AppLovinAppOpenAd;
import com.applovin.impl.adview.AppLovinRewardedInterstitialAd;
import com.applovin.impl.rb;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.impl.sdk.ad.AppLovinAdImpl;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAd;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.ve;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.adapter.MaxAdViewAdapter;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.MaxAppOpenAdapter;
import com.applovin.mediation.adapter.MaxInterstitialAdapter;
import com.applovin.mediation.adapter.MaxRewardedAdapter;
import com.applovin.mediation.adapter.MaxRewardedInterstitialAdapter;
import com.applovin.mediation.adapter.MaxSignalProvider;
import com.applovin.mediation.adapter.listeners.MaxAdViewAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxAppOpenAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxNativeAdAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxSignalCollectionListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterInitializationParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterSignalCollectionParameters;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdSize;
import com.applovin.sdk.AppLovinAdType;
import com.applovin.sdk.AppLovinBidTokenCollectionListener;
import com.applovin.sdk.AppLovinSdk;
/* loaded from: classes2.dex */
public class AppLovinMediationAdapter extends MediationAdapterBase implements MaxSignalProvider, MaxInterstitialAdapter, MaxAppOpenAdapter, MaxRewardedAdapter, MaxRewardedInterstitialAdapter, MaxAdViewAdapter {
protected AppLovinAdView loadedAdView;
protected AppLovinAd loadedAppOpenAd;
protected AppLovinAd loadedInterstitialAd;
protected AppLovinNativeAd loadedNativeAd;
protected AppLovinAd loadedRewardedAd;
protected AppLovinAd loadedRewardedInterstitialAd;
public AppLovinMediationAdapter(AppLovinSdk appLovinSdk) {
super(appLovinSdk);
}
public static Bundle getExtraInfo(AppLovinAd appLovinAd) {
Bundle bundle = new Bundle(1);
bundle.putBundle("ad_values", ((AppLovinAdImpl) appLovinAd).getMAXAdValues());
return bundle;
}
private void loadFullscreenAd(String str, MaxAdapterResponseParameters maxAdapterResponseParameters, MaxAdFormat maxAdFormat, Object obj) {
if (StringUtils.isValidString(maxAdapterResponseParameters.getBidResponse())) {
log("Loading bidding " + maxAdFormat.getLabel() + " ad...");
getWrappingSdk().getAdService().loadNextAdForAdToken(maxAdapterResponseParameters.getBidResponse(), (rb) obj);
return;
}
if (!StringUtils.isValidString(maxAdapterResponseParameters.getThirdPartyAdPlacementId())) {
log("Loading mediated " + maxAdFormat.getLabel() + " ad...");
getWrappingSdk().getAdService().loadNextAdForZoneId(str, (rb) obj);
return;
}
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
log("Loading mediated " + maxAdFormat.getLabel() + " ad: " + thirdPartyAdPlacementId + "...");
getWrappingSdk().getAdService().loadNextAdForZoneId(thirdPartyAdPlacementId, (rb) obj);
}
public static MaxAdapterError toMaxError(AppLovinError appLovinError) {
MaxAdapterError maxAdapterError = appLovinError.getCode() == -1009 ? MaxAdapterError.NO_CONNECTION : appLovinError.getCode() == 204 ? MaxAdapterError.NO_FILL : appLovinError.getCode() == -1 ? MaxAdapterError.INTERNAL_ERROR : appLovinError.getCode() >= 500 ? MaxAdapterError.SERVER_ERROR : MaxAdapterError.UNSPECIFIED;
return new MaxAdapterError(maxAdapterError.getCode(), maxAdapterError.getErrorMessage(), appLovinError.getCode(), appLovinError.getMessage());
}
@Override // com.applovin.mediation.adapter.MaxSignalProvider
public void collectSignal(MaxAdapterSignalCollectionParameters maxAdapterSignalCollectionParameters, Activity activity, final MaxSignalCollectionListener maxSignalCollectionListener) {
log("Collecting signal...");
if (((Boolean) getWrappingSdk().a().a(ve.W7)).booleanValue()) {
getWrappingSdk().getAdService().collectBidToken(new AppLovinBidTokenCollectionListener() { // from class: com.applovin.mediation.adapters.AppLovinMediationAdapter.1
@Override // com.applovin.sdk.AppLovinBidTokenCollectionListener
public void onBidTokenCollected(String str) {
AppLovinMediationAdapter.this.log("Signal collection successful");
maxSignalCollectionListener.onSignalCollected(str);
}
@Override // com.applovin.sdk.AppLovinBidTokenCollectionListener
public void onBidTokenCollectionFailed(String str) {
AppLovinMediationAdapter.this.log("Signal collection failed with error: " + str);
maxSignalCollectionListener.onSignalCollectionFailed(str);
}
});
} else {
maxSignalCollectionListener.onSignalCollected(getWrappingSdk().getAdService().getBidToken());
}
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getAdapterVersion() {
return getSdkVersion();
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getSdkVersion() {
return AppLovinSdk.VERSION;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void initialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters, Activity activity, MaxAdapter.OnCompletionListener onCompletionListener) {
onCompletionListener.onCompletion(MaxAdapter.InitializationStatus.DOES_NOT_APPLY, null);
}
@Override // com.applovin.mediation.adapter.MaxAdViewAdapter
public void loadAdViewAd(MaxAdapterResponseParameters maxAdapterResponseParameters, MaxAdFormat maxAdFormat, Activity activity, MaxAdViewAdapterListener maxAdViewAdapterListener) {
AppLovinAdapterAdViewListener appLovinAdapterAdViewListener = new AppLovinAdapterAdViewListener(this, maxAdFormat, maxAdViewAdapterListener);
if (StringUtils.isValidString(maxAdapterResponseParameters.getBidResponse())) {
log("Loading bidding " + maxAdFormat.getLabel() + " ad...");
getWrappingSdk().getAdService().loadNextAdForAdToken(maxAdapterResponseParameters.getBidResponse(), appLovinAdapterAdViewListener);
return;
}
if (StringUtils.isValidString(maxAdapterResponseParameters.getThirdPartyAdPlacementId())) {
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
log("Loading mediated " + maxAdFormat.getLabel() + " ad: " + thirdPartyAdPlacementId + "...");
getWrappingSdk().getAdService().loadNextAdForZoneId(thirdPartyAdPlacementId, appLovinAdapterAdViewListener);
return;
}
AppLovinAdSize appLovinAdSize = maxAdFormat == MaxAdFormat.BANNER ? AppLovinAdSize.BANNER : maxAdFormat == MaxAdFormat.MREC ? AppLovinAdSize.MREC : maxAdFormat == MaxAdFormat.LEADER ? AppLovinAdSize.LEADER : null;
if (appLovinAdSize == null) {
log("Failed to load ad for format: " + maxAdFormat);
maxAdViewAdapterListener.onAdViewAdLoadFailed(MaxAdapterError.INTERNAL_ERROR);
return;
}
log("Loading regular " + maxAdFormat.getLabel() + " ad...");
getWrappingSdk().getAdService().loadNextAd(appLovinAdSize, appLovinAdapterAdViewListener);
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxAppOpenAdapter
public void loadAppOpenAd(@NonNull MaxAdapterResponseParameters maxAdapterResponseParameters, @Nullable Activity activity, @NonNull MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
loadFullscreenAd("inter_appopen", maxAdapterResponseParameters, MaxAdFormat.APP_OPEN, new AppLovinAdapterAppOpenListener(this, maxAppOpenAdapterListener));
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void loadInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
loadFullscreenAd("inter_regular", maxAdapterResponseParameters, MaxAdFormat.INTERSTITIAL, new AppLovinAdapterInterstitialListener(this, maxInterstitialAdapterListener));
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxNativeAdAdapter
public void loadNativeAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxNativeAdAdapterListener maxNativeAdAdapterListener) {
if (TextUtils.isEmpty(maxAdapterResponseParameters.getBidResponse())) {
maxNativeAdAdapterListener.onNativeAdLoadFailed(MaxAdapterError.INVALID_CONFIGURATION);
} else {
d("Loading bidding native ad...");
getWrappingSdk().a().U().loadNextAdForAdToken(maxAdapterResponseParameters.getBidResponse(), new AppLovinAdapterNativeListener(maxAdapterResponseParameters, this, maxNativeAdAdapterListener));
}
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void loadRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
loadFullscreenAd("inter_videoa", maxAdapterResponseParameters, MaxAdFormat.REWARDED, new AppLovinAdapterRewardedListener(this, maxRewardedAdapterListener));
}
@Override // com.applovin.mediation.adapter.MaxRewardedInterstitialAdapter
public void loadRewardedInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedInterstitialAdapterListener maxRewardedInterstitialAdapterListener) {
loadFullscreenAd("inter_autorew", maxAdapterResponseParameters, MaxAdFormat.REWARDED_INTERSTITIAL, new AppLovinAdapterRewardedInterstitialListener(this, maxRewardedInterstitialAdapterListener));
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxAppOpenAdapter
public void showAppOpenAd(@NonNull MaxAdapterResponseParameters maxAdapterResponseParameters, @Nullable Activity activity, @NonNull MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
log("Showing app open ad: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
AppLovinAppOpenAd appLovinAppOpenAd = new AppLovinAppOpenAd(getWrappingSdk());
AppLovinAdapterAppOpenListener appLovinAdapterAppOpenListener = new AppLovinAdapterAppOpenListener(this, maxAppOpenAdapterListener);
appLovinAppOpenAd.setAdDisplayListener(appLovinAdapterAppOpenListener);
appLovinAppOpenAd.setAdClickListener(appLovinAdapterAppOpenListener);
appLovinAppOpenAd.show(this.loadedAppOpenAd);
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void showInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
log("Showing interstitial: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
AppLovinInterstitialAdDialog create = AppLovinInterstitialAd.create(getWrappingSdk(), activity);
AppLovinAdapterInterstitialListener appLovinAdapterInterstitialListener = new AppLovinAdapterInterstitialListener(this, maxInterstitialAdapterListener);
create.setAdDisplayListener(appLovinAdapterInterstitialListener);
create.setAdClickListener(appLovinAdapterInterstitialListener);
create.showAndRender(this.loadedInterstitialAd);
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void showRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
log("Showing rewarded ad: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
configureReward(maxAdapterResponseParameters);
AppLovinIncentivizedInterstitial create = AppLovinIncentivizedInterstitial.create(getWrappingSdk());
AppLovinAdapterRewardedListener appLovinAdapterRewardedListener = new AppLovinAdapterRewardedListener(this, maxRewardedAdapterListener);
create.show(this.loadedRewardedAd, activity, appLovinAdapterRewardedListener, appLovinAdapterRewardedListener, appLovinAdapterRewardedListener, appLovinAdapterRewardedListener);
}
@Override // com.applovin.mediation.adapter.MaxRewardedInterstitialAdapter
public void showRewardedInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedInterstitialAdapterListener maxRewardedInterstitialAdapterListener) {
log("Showing rewarded interstitial ad: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
AppLovinAdapterRewardedInterstitialListener appLovinAdapterRewardedInterstitialListener = new AppLovinAdapterRewardedInterstitialListener(this, maxRewardedInterstitialAdapterListener);
if (this.loadedRewardedInterstitialAd.getType() == AppLovinAdType.AUTO_INCENTIVIZED) {
configureReward(maxAdapterResponseParameters);
AppLovinRewardedInterstitialAd appLovinRewardedInterstitialAd = new AppLovinRewardedInterstitialAd(getWrappingSdk());
appLovinRewardedInterstitialAd.setAdDisplayListener(appLovinAdapterRewardedInterstitialListener);
appLovinRewardedInterstitialAd.setAdClickListener(appLovinAdapterRewardedInterstitialListener);
appLovinRewardedInterstitialAd.setAdVideoPlaybackListener(appLovinAdapterRewardedInterstitialListener);
appLovinRewardedInterstitialAd.show(this.loadedRewardedInterstitialAd, activity, appLovinAdapterRewardedInterstitialListener);
return;
}
log("Rewarded interstitial is regular interstitial");
AppLovinInterstitialAdDialog create = AppLovinInterstitialAd.create(getWrappingSdk(), activity);
create.setAdDisplayListener(appLovinAdapterRewardedInterstitialListener);
create.setAdClickListener(appLovinAdapterRewardedInterstitialListener);
create.setAdVideoPlaybackListener(appLovinAdapterRewardedInterstitialListener);
create.showAndRender(this.loadedRewardedInterstitialAd);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void onDestroy() {
this.loadedInterstitialAd = null;
this.loadedAppOpenAd = null;
this.loadedRewardedAd = null;
this.loadedRewardedInterstitialAd = null;
AppLovinAdView appLovinAdView = this.loadedAdView;
if (appLovinAdView != null) {
appLovinAdView.destroy();
this.loadedAdView = null;
}
AppLovinNativeAd appLovinNativeAd = this.loadedNativeAd;
if (appLovinNativeAd instanceof AppLovinNativeAdImpl) {
((AppLovinNativeAdImpl) appLovinNativeAd).destroy();
this.loadedNativeAd = null;
}
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxRewardedAdViewAdapter
public void showRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, ViewGroup viewGroup, Lifecycle lifecycle, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
log("Showing rewarded ad view: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
configureReward(maxAdapterResponseParameters);
AppLovinIncentivizedInterstitial create = AppLovinIncentivizedInterstitial.create(getWrappingSdk());
AppLovinAdapterRewardedListener appLovinAdapterRewardedListener = new AppLovinAdapterRewardedListener(this, maxRewardedAdapterListener);
create.show(this.loadedRewardedAd, viewGroup, lifecycle, activity, appLovinAdapterRewardedListener, appLovinAdapterRewardedListener, appLovinAdapterRewardedListener, appLovinAdapterRewardedListener);
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxInterstitialAdViewAdapter
public void showInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, ViewGroup viewGroup, Lifecycle lifecycle, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
log("Showing interstitial ad view: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
AppLovinInterstitialAdDialog create = AppLovinInterstitialAd.create(getWrappingSdk(), activity);
AppLovinAdapterInterstitialListener appLovinAdapterInterstitialListener = new AppLovinAdapterInterstitialListener(this, maxInterstitialAdapterListener);
create.setAdDisplayListener(appLovinAdapterInterstitialListener);
create.setAdClickListener(appLovinAdapterInterstitialListener);
create.showAndRender(this.loadedInterstitialAd, viewGroup, lifecycle);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,629 @@
package com.applovin.mediation.adapters;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.adapter.MaxAdViewAdapter;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.MaxInterstitialAdapter;
import com.applovin.mediation.adapter.MaxRewardedAdapter;
import com.applovin.mediation.adapter.MaxSignalProvider;
import com.applovin.mediation.adapter.listeners.MaxAdViewAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxSignalCollectionListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterInitializationParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterSignalCollectionParameters;
import com.applovin.mediation.adapters.inneractive.BuildConfig;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.fyber.inneractive.sdk.external.BidTokenProvider;
import com.fyber.inneractive.sdk.external.ImpressionData;
import com.fyber.inneractive.sdk.external.InneractiveAdManager;
import com.fyber.inneractive.sdk.external.InneractiveAdRequest;
import com.fyber.inneractive.sdk.external.InneractiveAdSpot;
import com.fyber.inneractive.sdk.external.InneractiveAdSpotManager;
import com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListenerWithImpressionData;
import com.fyber.inneractive.sdk.external.InneractiveAdViewUnitController;
import com.fyber.inneractive.sdk.external.InneractiveErrorCode;
import com.fyber.inneractive.sdk.external.InneractiveFullScreenAdRewardedListener;
import com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListenerWithImpressionData;
import com.fyber.inneractive.sdk.external.InneractiveFullscreenUnitController;
import com.fyber.inneractive.sdk.external.InneractiveFullscreenVideoContentController;
import com.fyber.inneractive.sdk.external.InneractiveUnitController;
import com.fyber.inneractive.sdk.external.OnFyberMarketplaceInitializedListener;
import com.fyber.inneractive.sdk.external.VideoContentListener;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import csdk.gluads.max.EAMax;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes2.dex */
public class InneractiveMediationAdapter extends MediationAdapterBase implements MaxSignalProvider, MaxInterstitialAdapter, MaxRewardedAdapter, MaxAdViewAdapter {
private static final AtomicBoolean initialized = new AtomicBoolean();
private static MaxAdapter.InitializationStatus status;
private ViewGroup adViewGroup;
private InneractiveAdSpot adViewSpot;
private boolean hasGrantedReward;
private InneractiveAdSpot interstitialSpot;
private InneractiveAdSpot rewardedSpot;
public InneractiveMediationAdapter(AppLovinSdk appLovinSdk) {
super(appLovinSdk);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void initialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters, Activity activity, final MaxAdapter.OnCompletionListener onCompletionListener) {
if (EAMax.adapterDisabled(getClass().getName(), onCompletionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
if (initialized.compareAndSet(false, true)) {
status = MaxAdapter.InitializationStatus.INITIALIZING;
String string = maxAdapterInitializationParameters.getServerParameters().getString("app_id", null);
log("Initializing Inneractive SDK with app id: " + string + "...");
InneractiveAdManager.setUserId(getWrappingSdk().getUserIdentifier());
InneractiveAdManager.setMediationName("Max");
InneractiveAdManager.setMediationVersion(AppLovinSdk.VERSION);
InneractiveAdManager.initialize(getContext(activity), string, new OnFyberMarketplaceInitializedListener() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.1
@Override // com.fyber.inneractive.sdk.external.OnFyberMarketplaceInitializedListener
public void onFyberMarketplaceInitialized(OnFyberMarketplaceInitializedListener.FyberInitStatus fyberInitStatus) {
if (fyberInitStatus == OnFyberMarketplaceInitializedListener.FyberInitStatus.SUCCESSFULLY) {
InneractiveMediationAdapter.this.log("Inneractive SDK initialized");
MaxAdapter.InitializationStatus unused = InneractiveMediationAdapter.status = MaxAdapter.InitializationStatus.INITIALIZED_SUCCESS;
onCompletionListener.onCompletion(InneractiveMediationAdapter.status, null);
return;
}
InneractiveMediationAdapter.this.log("Inneractive SDK failed to initialize with error: " + fyberInitStatus);
MaxAdapter.InitializationStatus unused2 = InneractiveMediationAdapter.status = MaxAdapter.InitializationStatus.INITIALIZED_FAILURE;
onCompletionListener.onCompletion(InneractiveMediationAdapter.status, fyberInitStatus.toString());
}
});
return;
}
if (InneractiveAdManager.wasInitialized()) {
log("Inneractive SDK already initialized");
}
onCompletionListener.onCompletion(status, null);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getSdkVersion() {
return InneractiveAdManager.getVersion();
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getAdapterVersion() {
return BuildConfig.VERSION_NAME;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void onDestroy() {
InneractiveAdSpot inneractiveAdSpot = this.interstitialSpot;
if (inneractiveAdSpot != null) {
inneractiveAdSpot.destroy();
this.interstitialSpot = null;
}
InneractiveAdSpot inneractiveAdSpot2 = this.rewardedSpot;
if (inneractiveAdSpot2 != null) {
inneractiveAdSpot2.destroy();
this.rewardedSpot = null;
}
InneractiveAdSpot inneractiveAdSpot3 = this.adViewSpot;
if (inneractiveAdSpot3 != null) {
inneractiveAdSpot3.destroy();
this.adViewSpot = null;
}
this.adViewGroup = null;
}
@Override // com.applovin.mediation.adapter.MaxSignalProvider
public void collectSignal(MaxAdapterSignalCollectionParameters maxAdapterSignalCollectionParameters, Activity activity, MaxSignalCollectionListener maxSignalCollectionListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxSignalCollectionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
log("Collecting signal...");
updateUserInfo(maxAdapterSignalCollectionParameters);
maxSignalCollectionListener.onSignalCollected(BidTokenProvider.getBidderToken());
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void loadInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, final MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse()) ? "bidding " : "");
sb.append("interstitial ad for spot id \"");
sb.append(maxAdapterResponseParameters.getThirdPartyAdPlacementId());
sb.append("\"...");
log(sb.toString());
updateUserInfo(maxAdapterResponseParameters);
InneractiveFullscreenVideoContentController inneractiveFullscreenVideoContentController = new InneractiveFullscreenVideoContentController();
InneractiveFullscreenUnitController inneractiveFullscreenUnitController = new InneractiveFullscreenUnitController();
inneractiveFullscreenUnitController.addContentController(inneractiveFullscreenVideoContentController);
inneractiveFullscreenUnitController.setEventsListener(new InneractiveFullscreenAdEventsListenerWithImpressionData() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.2
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdImpression(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdWillCloseInternalBrowser(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdWillOpenExternalApp(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListenerWithImpressionData
public void onAdImpression(InneractiveAdSpot inneractiveAdSpot, ImpressionData impressionData) {
InneractiveMediationAdapter.this.log("Interstitial shown");
String creativeId = impressionData.getCreativeId();
if (!TextUtils.isEmpty(creativeId)) {
Bundle bundle = new Bundle(1);
bundle.putString(CampaignEx.JSON_KEY_CREATIVE_ID, creativeId);
maxInterstitialAdapterListener.onInterstitialAdDisplayed(bundle);
return;
}
maxInterstitialAdapterListener.onInterstitialAdDisplayed();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdClicked(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("Interstitial clicked");
maxInterstitialAdapterListener.onInterstitialAdClicked();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener
public void onAdDismissed(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("Interstitial hidden");
maxInterstitialAdapterListener.onInterstitialAdHidden();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdEnteredErrorState(InneractiveAdSpot inneractiveAdSpot, InneractiveUnitController.AdDisplayError adDisplayError) {
MaxAdapterError maxAdapterError = new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, adDisplayError.toString());
InneractiveMediationAdapter.this.log("Interstitial failed to show: " + maxAdapterError);
maxInterstitialAdapterListener.onInterstitialAdDisplayFailed(maxAdapterError);
}
});
InneractiveAdSpot createSpot = InneractiveAdSpotManager.get().createSpot();
this.interstitialSpot = createSpot;
createSpot.addUnitController(inneractiveFullscreenUnitController);
this.interstitialSpot.setRequestListener(new InneractiveAdSpot.RequestListener() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.3
@Override // com.fyber.inneractive.sdk.external.InneractiveAdSpot.RequestListener
public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("Interstitial loaded");
maxInterstitialAdapterListener.onInterstitialAdLoaded();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdSpot.RequestListener
public void onInneractiveFailedAdRequest(InneractiveAdSpot inneractiveAdSpot, InneractiveErrorCode inneractiveErrorCode) {
MaxAdapterError maxError = InneractiveMediationAdapter.toMaxError(inneractiveErrorCode);
InneractiveMediationAdapter.this.log("Interstitial failed to load with Inneractive error: " + maxError);
maxInterstitialAdapterListener.onInterstitialAdLoadFailed(maxError);
}
});
if (AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse())) {
this.interstitialSpot.loadAd(maxAdapterResponseParameters.getBidResponse());
} else {
this.interstitialSpot.requestAd(new InneractiveAdRequest(maxAdapterResponseParameters.getThirdPartyAdPlacementId()));
}
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void showInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
log("Showing interstitial ad...");
if (this.interstitialSpot.isReady()) {
((InneractiveFullscreenUnitController) this.interstitialSpot.getSelectedUnitController()).show(activity);
} else {
log("Interstitial ad not ready");
maxInterstitialAdapterListener.onInterstitialAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Interstitial ad not ready"));
}
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void loadRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, final MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse()) ? "bidding " : "");
sb.append("rewarded ad for spot id \"");
sb.append(maxAdapterResponseParameters.getThirdPartyAdPlacementId());
sb.append("\"...");
log(sb.toString());
updateUserInfo(maxAdapterResponseParameters);
InneractiveFullscreenVideoContentController inneractiveFullscreenVideoContentController = new InneractiveFullscreenVideoContentController();
inneractiveFullscreenVideoContentController.setEventsListener(new VideoContentListener() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.4
@Override // com.fyber.inneractive.sdk.external.VideoContentListener
public void onProgress(int i, int i2) {
if (i2 == 0) {
InneractiveMediationAdapter.this.log("Rewarded video started");
}
}
@Override // com.fyber.inneractive.sdk.external.VideoContentListener
public void onCompleted() {
InneractiveMediationAdapter.this.log("Rewarded video completed");
}
@Override // com.fyber.inneractive.sdk.external.VideoContentListener
public void onPlayerError() {
InneractiveMediationAdapter.this.log("Rewarded video failed to display for unspecified error");
maxRewardedAdapterListener.onRewardedAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed"));
}
});
InneractiveFullscreenUnitController inneractiveFullscreenUnitController = new InneractiveFullscreenUnitController();
inneractiveFullscreenUnitController.addContentController(inneractiveFullscreenVideoContentController);
inneractiveFullscreenUnitController.setEventsListener(new InneractiveFullscreenAdEventsListenerWithImpressionData() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.5
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdImpression(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdWillCloseInternalBrowser(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdWillOpenExternalApp(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListenerWithImpressionData
public void onAdImpression(InneractiveAdSpot inneractiveAdSpot, ImpressionData impressionData) {
InneractiveMediationAdapter.this.log("Rewarded ad shown");
String creativeId = impressionData.getCreativeId();
if (!TextUtils.isEmpty(creativeId)) {
Bundle bundle = new Bundle(1);
bundle.putString(CampaignEx.JSON_KEY_CREATIVE_ID, creativeId);
maxRewardedAdapterListener.onRewardedAdDisplayed(bundle);
return;
}
maxRewardedAdapterListener.onRewardedAdDisplayed();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdClicked(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("Rewarded ad clicked");
maxRewardedAdapterListener.onRewardedAdClicked();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener
public void onAdDismissed(InneractiveAdSpot inneractiveAdSpot) {
if (InneractiveMediationAdapter.this.hasGrantedReward || InneractiveMediationAdapter.this.shouldAlwaysRewardUser()) {
MaxReward reward = InneractiveMediationAdapter.this.getReward();
InneractiveMediationAdapter.this.log("Rewarded user with reward: " + reward);
maxRewardedAdapterListener.onUserRewarded(reward);
}
InneractiveMediationAdapter.this.log("Rewarded ad hidden");
maxRewardedAdapterListener.onRewardedAdHidden();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveFullscreenAdEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdEnteredErrorState(InneractiveAdSpot inneractiveAdSpot, InneractiveUnitController.AdDisplayError adDisplayError) {
MaxAdapterError maxAdapterError = new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, adDisplayError.toString());
InneractiveMediationAdapter.this.log("Rewarded ad failed to show: " + maxAdapterError);
maxRewardedAdapterListener.onRewardedAdDisplayFailed(maxAdapterError);
}
});
inneractiveFullscreenUnitController.setRewardedListener(new InneractiveFullScreenAdRewardedListener() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.6
@Override // com.fyber.inneractive.sdk.external.InneractiveFullScreenAdRewardedListener
public void onAdRewarded(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("User earned reward.");
InneractiveMediationAdapter.this.hasGrantedReward = true;
}
});
InneractiveAdSpot createSpot = InneractiveAdSpotManager.get().createSpot();
this.rewardedSpot = createSpot;
createSpot.addUnitController(inneractiveFullscreenUnitController);
this.rewardedSpot.setRequestListener(new InneractiveAdSpot.RequestListener() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.7
@Override // com.fyber.inneractive.sdk.external.InneractiveAdSpot.RequestListener
public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("Rewarded ad loaded");
maxRewardedAdapterListener.onRewardedAdLoaded();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdSpot.RequestListener
public void onInneractiveFailedAdRequest(InneractiveAdSpot inneractiveAdSpot, InneractiveErrorCode inneractiveErrorCode) {
MaxAdapterError maxError = InneractiveMediationAdapter.toMaxError(inneractiveErrorCode);
InneractiveMediationAdapter.this.log("Rewarded ad failed to load with Inneractive error: " + maxError);
maxRewardedAdapterListener.onRewardedAdLoadFailed(maxError);
}
});
if (AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse())) {
this.rewardedSpot.loadAd(maxAdapterResponseParameters.getBidResponse());
} else {
this.rewardedSpot.requestAd(new InneractiveAdRequest(maxAdapterResponseParameters.getThirdPartyAdPlacementId()));
}
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void showRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
log("Showing rewarded ad...");
if (this.rewardedSpot.isReady()) {
configureReward(maxAdapterResponseParameters);
((InneractiveFullscreenUnitController) this.rewardedSpot.getSelectedUnitController()).show(activity);
} else {
log("Rewarded ad not ready");
maxRewardedAdapterListener.onRewardedAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Rewarded ad not ready"));
}
}
@Override // com.applovin.mediation.adapter.MaxAdViewAdapter
public void loadAdViewAd(MaxAdapterResponseParameters maxAdapterResponseParameters, MaxAdFormat maxAdFormat, Activity activity, final MaxAdViewAdapterListener maxAdViewAdapterListener) {
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse()) ? "bidding " : "");
sb.append(maxAdFormat.getLabel());
sb.append(" ad for spot id \"");
sb.append(maxAdapterResponseParameters.getThirdPartyAdPlacementId());
sb.append("\"...");
log(sb.toString());
updateUserInfo(maxAdapterResponseParameters);
final InneractiveAdViewUnitController inneractiveAdViewUnitController = new InneractiveAdViewUnitController();
inneractiveAdViewUnitController.setEventsListener(new InneractiveAdViewEventsListenerWithImpressionData() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.8
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdImpression(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener
public void onAdResized(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdWillCloseInternalBrowser(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdWillOpenExternalApp(InneractiveAdSpot inneractiveAdSpot) {
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListenerWithImpressionData
public void onAdImpression(InneractiveAdSpot inneractiveAdSpot, ImpressionData impressionData) {
InneractiveMediationAdapter.this.log("AdView shown");
String creativeId = impressionData.getCreativeId();
if (!TextUtils.isEmpty(creativeId)) {
Bundle bundle = new Bundle(1);
bundle.putString(CampaignEx.JSON_KEY_CREATIVE_ID, creativeId);
maxAdViewAdapterListener.onAdViewAdDisplayed(bundle);
return;
}
maxAdViewAdapterListener.onAdViewAdDisplayed();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdClicked(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("AdView clicked");
maxAdViewAdapterListener.onAdViewAdClicked();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener
public void onAdExpanded(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("AdView expanded");
maxAdViewAdapterListener.onAdViewAdExpanded();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener
public void onAdCollapsed(InneractiveAdSpot inneractiveAdSpot) {
InneractiveMediationAdapter.this.log("AdView collapsed");
maxAdViewAdapterListener.onAdViewAdCollapsed();
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdViewEventsListener, com.fyber.inneractive.sdk.external.InneractiveUnitController.EventsListener
public void onAdEnteredErrorState(InneractiveAdSpot inneractiveAdSpot, InneractiveUnitController.AdDisplayError adDisplayError) {
MaxAdapterError maxAdapterError = new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, adDisplayError.toString());
InneractiveMediationAdapter.this.log("AdView failed to show: " + maxAdapterError);
maxAdViewAdapterListener.onAdViewAdDisplayFailed(maxAdapterError);
}
});
this.adViewGroup = new RelativeLayout(getContext(activity));
InneractiveAdSpot createSpot = InneractiveAdSpotManager.get().createSpot();
this.adViewSpot = createSpot;
createSpot.addUnitController(inneractiveAdViewUnitController);
this.adViewSpot.setRequestListener(new InneractiveAdSpot.RequestListener() { // from class: com.applovin.mediation.adapters.InneractiveMediationAdapter.9
@Override // com.fyber.inneractive.sdk.external.InneractiveAdSpot.RequestListener
public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot inneractiveAdSpot) {
if (inneractiveAdSpot.isReady()) {
InneractiveMediationAdapter.this.log("AdView loaded");
inneractiveAdViewUnitController.bindView(InneractiveMediationAdapter.this.adViewGroup);
maxAdViewAdapterListener.onAdViewAdLoaded(InneractiveMediationAdapter.this.adViewGroup);
} else {
InneractiveMediationAdapter.this.log("AdView not ready");
maxAdViewAdapterListener.onAdViewAdLoadFailed(MaxAdapterError.AD_NOT_READY);
}
}
@Override // com.fyber.inneractive.sdk.external.InneractiveAdSpot.RequestListener
public void onInneractiveFailedAdRequest(InneractiveAdSpot inneractiveAdSpot, InneractiveErrorCode inneractiveErrorCode) {
InneractiveMediationAdapter.this.log("AdView failed to load with Inneractive error: " + inneractiveErrorCode + " " + inneractiveErrorCode.toString());
maxAdViewAdapterListener.onAdViewAdLoadFailed(InneractiveMediationAdapter.toMaxError(inneractiveErrorCode));
}
});
if (AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse())) {
this.adViewSpot.loadAd(maxAdapterResponseParameters.getBidResponse());
} else {
this.adViewSpot.requestAd(new InneractiveAdRequest(maxAdapterResponseParameters.getThirdPartyAdPlacementId()));
}
}
private void updateUserInfo(MaxAdapterParameters maxAdapterParameters) {
InneractiveAdManager.setUserId(getWrappingSdk().getUserIdentifier());
Boolean hasUserConsent = maxAdapterParameters.hasUserConsent();
if (hasUserConsent != null) {
InneractiveAdManager.setGdprConsent(hasUserConsent.booleanValue());
} else {
InneractiveAdManager.clearGdprConsentData();
}
if (AppLovinSdk.VERSION_CODE >= 11040399 && maxAdapterParameters.getConsentString() != null) {
InneractiveAdManager.setGdprConsentString(maxAdapterParameters.getConsentString());
}
Bundle serverParameters = maxAdapterParameters.getServerParameters();
if (serverParameters.containsKey("is_muted")) {
InneractiveAdManager.setMuteVideo(serverParameters.getBoolean("is_muted"));
}
Boolean isDoNotSell = maxAdapterParameters.isDoNotSell();
if (isDoNotSell != null) {
InneractiveAdManager.setUSPrivacyString(isDoNotSell.booleanValue() ? "1YY-" : "1YN-");
} else {
InneractiveAdManager.setUSPrivacyString("1---");
}
}
/* renamed from: com.applovin.mediation.adapters.InneractiveMediationAdapter$10, reason: invalid class name */
public static /* synthetic */ class AnonymousClass10 {
static final /* synthetic */ int[] $SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode;
static {
int[] iArr = new int[InneractiveErrorCode.values().length];
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode = iArr;
try {
iArr[InneractiveErrorCode.NO_FILL.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.SERVER_INTERNAL_ERROR.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.SERVER_INVALID_RESPONSE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.SDK_INTERNAL_ERROR.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.ERROR_CODE_NATIVE_VIDEO_NOT_SUPPORTED.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.NATIVE_ADS_NOT_SUPPORTED_FOR_OS.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.UNSUPPORTED_SPOT.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.NON_SECURE_CONTENT_DETECTED.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.CANCELLED.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.CONNECTION_TIMEOUT.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.LOAD_TIMEOUT.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.IN_FLIGHT_TIMEOUT.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.CONNECTION_ERROR.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.UNKNOWN_APP_ID.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.INVALID_INPUT.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.SDK_NOT_INITIALIZED.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.SDK_NOT_INITIALIZED_OR_CONFIG_ERROR.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.ERROR_CONFIGURATION_MISMATCH.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.ERROR_CONFIGURATION_NO_SUCH_SPOT.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.SPOT_DISABLED.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[InneractiveErrorCode.UNSPECIFIED.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public static MaxAdapterError toMaxError(InneractiveErrorCode inneractiveErrorCode) {
MaxAdapterError maxAdapterError = MaxAdapterError.UNSPECIFIED;
switch (AnonymousClass10.$SwitchMap$com$fyber$inneractive$sdk$external$InneractiveErrorCode[inneractiveErrorCode.ordinal()]) {
case 1:
maxAdapterError = MaxAdapterError.NO_FILL;
break;
case 2:
maxAdapterError = MaxAdapterError.SERVER_ERROR;
break;
case 3:
maxAdapterError = MaxAdapterError.BAD_REQUEST;
break;
case 4:
case 5:
case 6:
case 7:
case 8:
maxAdapterError = MaxAdapterError.INTERNAL_ERROR;
break;
case 9:
maxAdapterError = MaxAdapterError.AD_NOT_READY;
break;
case 10:
case 11:
case 12:
maxAdapterError = MaxAdapterError.TIMEOUT;
break;
case 13:
maxAdapterError = MaxAdapterError.NO_CONNECTION;
break;
case 14:
case 15:
case 16:
case 17:
maxAdapterError = MaxAdapterError.NOT_INITIALIZED;
break;
case 18:
case 19:
case 20:
maxAdapterError = MaxAdapterError.INVALID_CONFIGURATION;
break;
}
return new MaxAdapterError(maxAdapterError.getErrorCode(), maxAdapterError.getErrorMessage(), inneractiveErrorCode.ordinal(), inneractiveErrorCode.name());
}
private Context getContext(Activity activity) {
return activity != null ? activity.getApplicationContext() : getApplicationContext();
}
}

View File

@@ -0,0 +1,908 @@
package com.applovin.mediation.adapters;
import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.adapter.MaxAdViewAdapter;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.MaxInterstitialAdapter;
import com.applovin.mediation.adapter.MaxRewardedAdapter;
import com.applovin.mediation.adapter.MaxSignalProvider;
import com.applovin.mediation.adapter.listeners.MaxAdViewAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxSignalCollectionListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterInitializationParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterSignalCollectionParameters;
import com.applovin.mediation.adapters.ironsource.BuildConfig;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.ironsource.mediationsdk.ISBannerSize;
import com.ironsource.mediationsdk.IronSource;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerLayout;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerListener;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener;
import com.ironsource.mediationsdk.logger.IronSourceError;
import com.ironsource.mediationsdk.metadata.a;
import com.ironsource.mediationsdk.utils.IronSourceUtils;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.unity3d.ironsourceads.AdSize;
import com.unity3d.ironsourceads.InitListener;
import com.unity3d.ironsourceads.InitRequest;
import com.unity3d.ironsourceads.IronSourceAds;
import com.unity3d.ironsourceads.banner.BannerAdLoader;
import com.unity3d.ironsourceads.banner.BannerAdLoaderListener;
import com.unity3d.ironsourceads.banner.BannerAdRequest;
import com.unity3d.ironsourceads.banner.BannerAdView;
import com.unity3d.ironsourceads.banner.BannerAdViewListener;
import com.unity3d.ironsourceads.interstitial.InterstitialAd;
import com.unity3d.ironsourceads.interstitial.InterstitialAdListener;
import com.unity3d.ironsourceads.interstitial.InterstitialAdLoader;
import com.unity3d.ironsourceads.interstitial.InterstitialAdLoaderListener;
import com.unity3d.ironsourceads.interstitial.InterstitialAdRequest;
import com.unity3d.ironsourceads.rewarded.RewardedAd;
import com.unity3d.ironsourceads.rewarded.RewardedAdListener;
import com.unity3d.ironsourceads.rewarded.RewardedAdLoader;
import com.unity3d.ironsourceads.rewarded.RewardedAdLoaderListener;
import com.unity3d.ironsourceads.rewarded.RewardedAdRequest;
import csdk.gluads.max.EAMax;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes2.dex */
public class IronSourceMediationAdapter extends MediationAdapterBase implements MaxSignalProvider, MaxInterstitialAdapter, MaxRewardedAdapter, MaxAdViewAdapter {
private ISDemandOnlyBannerLayout adView;
@Nullable
private String adViewPlacementIdentifier;
private BannerAdView biddingAdView;
private InterstitialAd biddingInterstitialAd;
private BiddingInterstitialListener biddingInterstitialListener;
private RewardedAd biddingRewardedAd;
private BiddingRewardedListener biddingRewardedListener;
private String mRouterPlacementIdentifier;
private static final IronSourceRouter ROUTER = new IronSourceRouter();
private static final AtomicBoolean INITIALIZED = new AtomicBoolean();
private static final List<String> loadedAdViewPlacementIdentifiers = Collections.synchronizedList(new ArrayList());
public IronSourceMediationAdapter(AppLovinSdk appLovinSdk) {
super(appLovinSdk);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void initialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters, Activity activity, final MaxAdapter.OnCompletionListener onCompletionListener) {
if (EAMax.adapterDisabled(getClass().getName(), onCompletionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
if (INITIALIZED.compareAndSet(false, true)) {
String string = maxAdapterInitializationParameters.getServerParameters().getString(MBridgeConstans.APP_KEY);
log("Initializing IronSource SDK with app key: " + string + "...");
IronSource.setMediationType("MAX" + getAdapterVersionCode() + "SDK" + AppLovinSdk.VERSION_CODE);
setPrivacySettings(maxAdapterInitializationParameters);
Boolean isDoNotSell = maxAdapterInitializationParameters.isDoNotSell();
if (isDoNotSell != null) {
IronSource.setMetaData(a.a, Boolean.toString(isDoNotSell.booleanValue()));
}
IronSource.setAdaptersDebug(maxAdapterInitializationParameters.isTesting());
IronSourceRouter ironSourceRouter = ROUTER;
IronSource.setISDemandOnlyInterstitialListener(ironSourceRouter);
IronSource.setISDemandOnlyRewardedVideoListener(ironSourceRouter);
IronSourceAds.init(getApplicationContext(), new InitRequest.Builder(string).withLegacyAdFormats(getAdFormatsToInitialize(maxAdapterInitializationParameters)).build(), new InitListener() { // from class: com.applovin.mediation.adapters.IronSourceMediationAdapter.1
@Override // com.unity3d.ironsourceads.InitListener
public void onInitSuccess() {
IronSourceMediationAdapter.this.log("IronSource SDK initialized.");
onCompletionListener.onCompletion(MaxAdapter.InitializationStatus.INITIALIZED_SUCCESS, null);
}
@Override // com.unity3d.ironsourceads.InitListener
public void onInitFailed(@NonNull IronSourceError ironSourceError) {
IronSourceMediationAdapter.this.log("Failed to initialize IronSource SDK with error: " + ironSourceError);
onCompletionListener.onCompletion(MaxAdapter.InitializationStatus.INITIALIZED_FAILURE, ironSourceError.getErrorMessage());
}
});
}
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getSdkVersion() {
return IronSourceUtils.getSDKVersion();
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getAdapterVersion() {
return BuildConfig.VERSION_NAME;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void onDestroy() {
if (this.adViewPlacementIdentifier != null) {
log("Destroying adview with instance ID: " + this.adViewPlacementIdentifier);
IronSource.destroyISDemandOnlyBanner(this.adViewPlacementIdentifier);
loadedAdViewPlacementIdentifiers.remove(this.adViewPlacementIdentifier);
}
ROUTER.removeAdapter(this, this.mRouterPlacementIdentifier);
BannerAdView bannerAdView = this.biddingAdView;
if (bannerAdView != null) {
bannerAdView.setListener(null);
this.biddingAdView = null;
}
InterstitialAd interstitialAd = this.biddingInterstitialAd;
if (interstitialAd != null) {
interstitialAd.setListener(null);
this.biddingInterstitialAd = null;
}
RewardedAd rewardedAd = this.biddingRewardedAd;
if (rewardedAd != null) {
rewardedAd.setListener(null);
this.biddingRewardedAd = null;
}
this.biddingInterstitialListener = null;
this.biddingRewardedListener = null;
}
@Override // com.applovin.mediation.adapter.MaxSignalProvider
public void collectSignal(MaxAdapterSignalCollectionParameters maxAdapterSignalCollectionParameters, Activity activity, MaxSignalCollectionListener maxSignalCollectionListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxSignalCollectionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
log("Collecting signal...");
setPrivacySettings(maxAdapterSignalCollectionParameters);
maxSignalCollectionListener.onSignalCollected(IronSource.getISDemandOnlyBiddingData(getApplicationContext()));
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void loadInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
setPrivacySettings(maxAdapterResponseParameters);
String bidResponse = maxAdapterResponseParameters.getBidResponse();
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ironSource ");
sb.append(isValidString ? "bidding " : "");
sb.append("interstitial for instance ID: ");
sb.append(thirdPartyAdPlacementId);
log(sb.toString());
if (isValidString) {
InterstitialAdRequest build = new InterstitialAdRequest.Builder(thirdPartyAdPlacementId, bidResponse).build();
BiddingInterstitialListener biddingInterstitialListener = new BiddingInterstitialListener(maxInterstitialAdapterListener);
this.biddingInterstitialListener = biddingInterstitialListener;
InterstitialAdLoader.loadAd(build, biddingInterstitialListener);
return;
}
String interstitialRouterIdentifier = IronSourceRouter.getInterstitialRouterIdentifier(thirdPartyAdPlacementId);
this.mRouterPlacementIdentifier = interstitialRouterIdentifier;
IronSourceRouter ironSourceRouter = ROUTER;
ironSourceRouter.addInterstitialAdapter(this, maxInterstitialAdapterListener, interstitialRouterIdentifier);
if (IronSource.isISDemandOnlyInterstitialReady(thirdPartyAdPlacementId)) {
log("Ad is available already for instance ID: " + thirdPartyAdPlacementId);
ironSourceRouter.onAdLoaded(this.mRouterPlacementIdentifier);
return;
}
IronSource.loadISDemandOnlyInterstitial(activity, thirdPartyAdPlacementId);
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void showInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
boolean isValidString = AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse());
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
log("Showing ironSource interstitial for instance ID: " + thirdPartyAdPlacementId);
if (isValidString) {
InterstitialAd interstitialAd = this.biddingInterstitialAd;
if (interstitialAd == null || !interstitialAd.isReadyToShow()) {
log("Unable to show ironSource interstitial - ad is not ready for instance ID: " + thirdPartyAdPlacementId);
maxInterstitialAdapterListener.onInterstitialAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Interstitial ad not ready"));
return;
}
this.biddingInterstitialAd.setListener(this.biddingInterstitialListener);
this.biddingInterstitialAd.show(activity);
return;
}
IronSourceRouter ironSourceRouter = ROUTER;
ironSourceRouter.addShowingAdapter(this);
if (!IronSource.isISDemandOnlyInterstitialReady(thirdPartyAdPlacementId)) {
log("Unable to show ironSource interstitial - no ad loaded for instance ID: " + thirdPartyAdPlacementId);
ironSourceRouter.onAdDisplayFailed(IronSourceRouter.getInterstitialRouterIdentifier(thirdPartyAdPlacementId), new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Interstitial ad not ready"));
return;
}
IronSource.showISDemandOnlyInterstitial(thirdPartyAdPlacementId);
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void loadRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
setPrivacySettings(maxAdapterResponseParameters);
String bidResponse = maxAdapterResponseParameters.getBidResponse();
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ironSource ");
sb.append(isValidString ? "bidding " : "");
sb.append("rewarded for instance ID: ");
sb.append(thirdPartyAdPlacementId);
log(sb.toString());
if (isValidString) {
RewardedAdRequest build = new RewardedAdRequest.Builder(thirdPartyAdPlacementId, bidResponse).build();
BiddingRewardedListener biddingRewardedListener = new BiddingRewardedListener(maxRewardedAdapterListener);
this.biddingRewardedListener = biddingRewardedListener;
RewardedAdLoader.loadAd(build, biddingRewardedListener);
return;
}
String rewardedVideoRouterIdentifier = IronSourceRouter.getRewardedVideoRouterIdentifier(thirdPartyAdPlacementId);
this.mRouterPlacementIdentifier = rewardedVideoRouterIdentifier;
IronSourceRouter ironSourceRouter = ROUTER;
ironSourceRouter.addRewardedAdapter(this, maxRewardedAdapterListener, rewardedVideoRouterIdentifier);
if (IronSource.isISDemandOnlyRewardedVideoAvailable(thirdPartyAdPlacementId)) {
log("Ad is available already for instance ID: " + thirdPartyAdPlacementId);
ironSourceRouter.onAdLoaded(this.mRouterPlacementIdentifier);
return;
}
IronSource.loadISDemandOnlyRewardedVideo(activity, thirdPartyAdPlacementId);
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void showRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
boolean isValidString = AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse());
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
log("Showing ironSource rewarded for instance ID: " + thirdPartyAdPlacementId);
if (isValidString) {
RewardedAd rewardedAd = this.biddingRewardedAd;
if (rewardedAd == null || !rewardedAd.isReadyToShow()) {
log("Unable to show ironSource rewarded - ad is not ready for instance ID: " + thirdPartyAdPlacementId);
maxRewardedAdapterListener.onRewardedAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Rewarded ad not ready"));
return;
}
configureReward(maxAdapterResponseParameters);
this.biddingRewardedAd.setListener(this.biddingRewardedListener);
this.biddingRewardedAd.show(activity);
return;
}
IronSourceRouter ironSourceRouter = ROUTER;
ironSourceRouter.addShowingAdapter(this);
if (!IronSource.isISDemandOnlyRewardedVideoAvailable(thirdPartyAdPlacementId)) {
log("Unable to show ironSource rewarded - no ad loaded...");
ironSourceRouter.onAdDisplayFailed(IronSourceRouter.getRewardedVideoRouterIdentifier(thirdPartyAdPlacementId), new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Rewarded ad not ready"));
} else {
configureReward(maxAdapterResponseParameters);
IronSource.showISDemandOnlyRewardedVideo(thirdPartyAdPlacementId);
}
}
@Override // com.applovin.mediation.adapter.MaxAdViewAdapter
public void loadAdViewAd(MaxAdapterResponseParameters maxAdapterResponseParameters, MaxAdFormat maxAdFormat, Activity activity, MaxAdViewAdapterListener maxAdViewAdapterListener) {
setPrivacySettings(maxAdapterResponseParameters);
String bidResponse = maxAdapterResponseParameters.getBidResponse();
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(isValidString ? "bidding " : "");
sb.append(maxAdFormat.getLabel());
sb.append(" ad for instance ID: ");
sb.append(maxAdapterResponseParameters.getThirdPartyAdPlacementId());
log(sb.toString());
this.adViewPlacementIdentifier = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
if (isValidString) {
BannerAdLoader.loadAd(new BannerAdRequest.Builder(getApplicationContext(), this.adViewPlacementIdentifier, bidResponse, toISAdSize(maxAdFormat)).build(), new BiddingAdViewListener(maxAdViewAdapterListener));
return;
}
if (loadedAdViewPlacementIdentifiers.contains(maxAdapterResponseParameters.getThirdPartyAdPlacementId())) {
log("AdView ad failed to load for instance ID: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + ". An ad with the same instance ID is already loaded");
MaxAdapterError maxAdapterError = MaxAdapterError.INTERNAL_ERROR;
maxAdViewAdapterListener.onAdViewAdLoadFailed(new MaxAdapterError(maxAdapterError.getCode(), maxAdapterError.getMessage(), 0, "An ad with the same instance ID is already loaded"));
return;
}
if (activity == null) {
log(maxAdFormat.getLabel() + " ad load failed: Activity is null");
maxAdViewAdapterListener.onAdViewAdLoadFailed(MaxAdapterError.MISSING_ACTIVITY);
return;
}
ISDemandOnlyBannerLayout createBannerForDemandOnly = IronSource.createBannerForDemandOnly(activity, toISBannerSize(maxAdFormat));
this.adView = createBannerForDemandOnly;
createBannerForDemandOnly.setBannerDemandOnlyListener(new AdViewListener(maxAdViewAdapterListener));
IronSource.loadISDemandOnlyBanner(activity, this.adView, this.adViewPlacementIdentifier);
}
private void setPrivacySettings(MaxAdapterParameters maxAdapterParameters) {
Boolean hasUserConsent = maxAdapterParameters.hasUserConsent();
if (hasUserConsent != null) {
IronSource.setConsent(hasUserConsent.booleanValue());
}
}
private List<IronSourceAds.AdFormat> getAdFormatsToInitialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters) {
ArrayList<String> stringArrayList = maxAdapterInitializationParameters.getServerParameters().getStringArrayList("init_ad_formats");
if (stringArrayList == null || stringArrayList.isEmpty()) {
return Arrays.asList(IronSourceAds.AdFormat.INTERSTITIAL, IronSourceAds.AdFormat.REWARDED, IronSourceAds.AdFormat.BANNER);
}
ArrayList arrayList = new ArrayList();
if (stringArrayList.contains("inter")) {
arrayList.add(IronSourceAds.AdFormat.INTERSTITIAL);
}
if (stringArrayList.contains("rewarded")) {
arrayList.add(IronSourceAds.AdFormat.REWARDED);
}
if (stringArrayList.contains("banner")) {
arrayList.add(IronSourceAds.AdFormat.BANNER);
}
return arrayList;
}
private ISBannerSize toISBannerSize(MaxAdFormat maxAdFormat) {
if (maxAdFormat == MaxAdFormat.BANNER) {
return ISBannerSize.BANNER;
}
if (maxAdFormat == MaxAdFormat.LEADER) {
return ISBannerSize.LARGE;
}
if (maxAdFormat == MaxAdFormat.MREC) {
return ISBannerSize.RECTANGLE;
}
throw new IllegalArgumentException("Invalid ad format: " + maxAdFormat);
}
private AdSize toISAdSize(MaxAdFormat maxAdFormat) {
if (maxAdFormat == MaxAdFormat.BANNER) {
return AdSize.banner();
}
if (maxAdFormat == MaxAdFormat.LEADER) {
return AdSize.leaderboard();
}
if (maxAdFormat == MaxAdFormat.MREC) {
return AdSize.mediumRectangle();
}
throw new IllegalArgumentException("Invalid ad format: " + maxAdFormat);
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
/* JADX WARN: Removed duplicated region for block: B:24:0x003c */
/* JADX WARN: Removed duplicated region for block: B:29:0x0042 */
/* JADX WARN: Removed duplicated region for block: B:30:0x0045 */
/* JADX WARN: Removed duplicated region for block: B:31:0x0048 */
/* JADX WARN: Removed duplicated region for block: B:32:0x004b */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static com.applovin.mediation.adapter.MaxAdapterError toMaxError(com.ironsource.mediationsdk.logger.IronSourceError r4) {
/*
int r0 = r4.getErrorCode()
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.UNSPECIFIED
r2 = 501(0x1f5, float:7.02E-43)
if (r0 == r2) goto L57
r2 = 502(0x1f6, float:7.03E-43)
if (r0 == r2) goto L57
r2 = 505(0x1f9, float:7.08E-43)
if (r0 == r2) goto L57
r2 = 506(0x1fa, float:7.09E-43)
if (r0 == r2) goto L57
r2 = 526(0x20e, float:7.37E-43)
if (r0 == r2) goto L54
r2 = 527(0x20f, float:7.38E-43)
if (r0 == r2) goto L51
r2 = 1060(0x424, float:1.485E-42)
if (r0 == r2) goto L51
r2 = 1061(0x425, float:1.487E-42)
if (r0 == r2) goto L51
switch(r0) {
case 1: goto L51;
case 520: goto L4e;
case 600: goto L4b;
case 601: goto L4b;
case 602: goto L4b;
case 603: goto L4b;
case 604: goto L54;
case 605: goto L51;
case 606: goto L48;
case 607: goto L4b;
case 608: goto L45;
case 609: goto L45;
case 610: goto L51;
case 611: goto L51;
case 612: goto L4b;
case 613: goto L51;
case 614: goto L51;
case 615: goto L57;
case 616: goto L57;
case 621: goto L48;
case 1010: goto L4b;
case 1158: goto L48;
case 3306: goto L48;
case 7001: goto L4b;
case 7002: goto L4b;
case 7003: goto L4b;
case 7004: goto L4b;
case 7101: goto L51;
case 7102: goto L51;
case 7103: goto L51;
case 7104: goto L51;
case 7105: goto L57;
case 7106: goto L57;
case 7107: goto L57;
case 7108: goto L57;
case 7109: goto L57;
case 7110: goto L57;
case 7111: goto L57;
case 7112: goto L57;
case 7113: goto L45;
case 7115: goto L4b;
case 7116: goto L57;
case 7117: goto L57;
case 7118: goto L57;
case 7201: goto L51;
case 7202: goto L42;
default: goto L29;
}
L29:
switch(r0) {
case 508: goto L4b;
case 509: goto L48;
case 510: goto L59;
default: goto L2c;
}
L2c:
switch(r0) {
case 1000: goto L51;
case 1001: goto L51;
case 1002: goto L51;
case 1003: goto L51;
case 1004: goto L51;
case 1005: goto L51;
case 1006: goto L3f;
case 1007: goto L51;
case 1008: goto L51;
default: goto L2f;
}
L2f:
switch(r0) {
case 1020: goto L57;
case 1021: goto L57;
case 1022: goto L3c;
case 1023: goto L3c;
case 1024: goto L48;
default: goto L32;
}
L32:
switch(r0) {
case 1026: goto L3c;
case 1027: goto L3c;
case 1028: goto L51;
case 1029: goto L57;
case 1030: goto L51;
case 1031: goto L57;
case 1032: goto L45;
case 1033: goto L45;
case 1034: goto L51;
case 1035: goto L48;
case 1036: goto L3c;
case 1037: goto L3c;
case 1038: goto L51;
case 1039: goto L51;
case 1040: goto L51;
case 1041: goto L51;
default: goto L35;
}
L35:
switch(r0) {
case 1050: goto L3c;
case 1051: goto L42;
case 1052: goto L45;
case 1053: goto L3c;
case 1054: goto L42;
case 1055: goto L45;
case 1056: goto L3c;
case 1057: goto L39;
case 1058: goto L48;
default: goto L38;
}
L38:
goto L59
L39:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.AD_EXPIRED
goto L59
L3c:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.INVALID_LOAD_STATE
goto L59
L3f:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.SIGNAL_COLLECTION_TIMEOUT
goto L59
L42:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.AD_NOT_READY
goto L59
L45:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.TIMEOUT
goto L59
L48:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.NO_FILL
goto L59
L4b:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.NOT_INITIALIZED
goto L59
L4e:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.NO_CONNECTION
goto L59
L51:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.INTERNAL_ERROR
goto L59
L54:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.AD_FREQUENCY_CAPPED
goto L59
L57:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.INVALID_CONFIGURATION
L59:
com.applovin.mediation.adapter.MaxAdapterError r2 = new com.applovin.mediation.adapter.MaxAdapterError
int r3 = r1.getErrorCode()
java.lang.String r1 = r1.getErrorMessage()
java.lang.String r4 = r4.getErrorMessage()
r2.<init>(r3, r1, r0, r4)
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.applovin.mediation.adapters.IronSourceMediationAdapter.toMaxError(com.ironsource.mediationsdk.logger.IronSourceError):com.applovin.mediation.adapter.MaxAdapterError");
}
private long getAdapterVersionCode() {
int parseInt;
long j;
long j2 = 0;
for (String str : getAdapterVersion().replaceAll("[^0-9.]", "").split("\\.")) {
long j3 = j2 * 100;
if (j3 != 0 && str.length() > 2) {
parseInt = Integer.parseInt(str.substring(0, 2));
} else if (str.isEmpty()) {
j = 0;
j2 = j3 + j;
} else {
parseInt = Integer.parseInt(str);
}
j = parseInt;
j2 = j3 + j;
}
return j2;
}
public static class IronSourceRouter extends MediationAdapterRouter implements ISDemandOnlyInterstitialListener, ISDemandOnlyRewardedVideoListener {
private boolean hasGrantedReward;
private IronSourceRouter() {
}
@Override // com.applovin.mediation.adapters.MediationAdapterRouter
public void initialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters, Activity activity, MaxAdapter.OnCompletionListener onCompletionListener) {
if (EAMax.adapterDisabled(getClass().getName(), onCompletionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener
public void onInterstitialAdReady(String str) {
log("Interstitial loaded for instance ID: " + str);
onAdLoaded(getInterstitialRouterIdentifier(str));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener
public void onInterstitialAdLoadFailed(String str, IronSourceError ironSourceError) {
log("Interstitial ad failed to load for instance ID: " + str + " with error: " + ironSourceError);
onAdLoadFailed(getInterstitialRouterIdentifier(str), IronSourceMediationAdapter.toMaxError(ironSourceError));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener
public void onInterstitialAdOpened(String str) {
log("Interstitial ad displayed for instance ID: " + str);
onAdDisplayed(getInterstitialRouterIdentifier(str));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener
public void onInterstitialAdShowFailed(String str, IronSourceError ironSourceError) {
MaxAdapterError maxAdapterError = new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", ironSourceError.getErrorCode(), ironSourceError.getErrorMessage());
log("Interstitial ad failed to show for instance ID: " + str + " with error: " + maxAdapterError);
onAdDisplayFailed(getInterstitialRouterIdentifier(str), maxAdapterError);
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener
public void onInterstitialAdClicked(String str) {
log("Interstitial ad clicked for instance ID: " + str);
onAdClicked(getInterstitialRouterIdentifier(str));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener
public void onInterstitialAdClosed(String str) {
log("Interstitial ad closed for instance ID: " + str);
onAdHidden(getInterstitialRouterIdentifier(str));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener
public void onRewardedVideoAdLoadSuccess(String str) {
log("Rewarded ad loaded for instance ID: " + str);
onAdLoaded(getRewardedVideoRouterIdentifier(str));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener
public void onRewardedVideoAdLoadFailed(String str, IronSourceError ironSourceError) {
log("Rewarded ad failed to load for instance ID: " + str);
onAdLoadFailed(getRewardedVideoRouterIdentifier(str), IronSourceMediationAdapter.toMaxError(ironSourceError));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener
public void onRewardedVideoAdOpened(String str) {
log("Rewarded ad shown for instance ID: " + str);
onAdDisplayed(getRewardedVideoRouterIdentifier(str));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener
public void onRewardedVideoAdShowFailed(String str, IronSourceError ironSourceError) {
MaxAdapterError maxAdapterError = new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", ironSourceError.getErrorCode(), ironSourceError.getErrorMessage());
log("Rewarded ad failed to show for instance ID: " + str + " with error: " + maxAdapterError);
onAdDisplayFailed(getRewardedVideoRouterIdentifier(str), maxAdapterError);
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener
public void onRewardedVideoAdClicked(String str) {
log("Rewarded ad clicked for instance ID: " + str);
onAdClicked(getRewardedVideoRouterIdentifier(str));
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener
public void onRewardedVideoAdClosed(String str) {
String rewardedVideoRouterIdentifier = getRewardedVideoRouterIdentifier(str);
if (this.hasGrantedReward || shouldAlwaysRewardUser(rewardedVideoRouterIdentifier)) {
MaxReward reward = getReward(rewardedVideoRouterIdentifier);
log("Rewarded ad rewarded user with reward: " + reward + " for instance ID: " + str);
onUserRewarded(rewardedVideoRouterIdentifier, reward);
}
log("Rewarded ad hidden for instance ID: " + str);
onAdHidden(rewardedVideoRouterIdentifier);
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener
public void onRewardedVideoAdRewarded(String str) {
log("Rewarded ad granted reward for instance ID: " + str);
this.hasGrantedReward = true;
}
/* JADX INFO: Access modifiers changed from: private */
public static String getInterstitialRouterIdentifier(String str) {
return str + "-" + IronSource.AD_UNIT.INTERSTITIAL;
}
/* JADX INFO: Access modifiers changed from: private */
public static String getRewardedVideoRouterIdentifier(String str) {
return str + "-" + IronSource.AD_UNIT.REWARDED_VIDEO;
}
}
public class AdViewListener implements ISDemandOnlyBannerListener {
private final MaxAdViewAdapterListener listener;
public AdViewListener(MaxAdViewAdapterListener maxAdViewAdapterListener) {
this.listener = maxAdViewAdapterListener;
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerListener
public void onBannerAdLoaded(String str) {
IronSourceMediationAdapter.this.log("AdView loaded for instance ID: " + str);
this.listener.onAdViewAdLoaded(IronSourceMediationAdapter.this.adView);
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerListener
public void onBannerAdLoadFailed(String str, IronSourceError ironSourceError) {
MaxAdapterError maxError = IronSourceMediationAdapter.toMaxError(ironSourceError);
IronSourceMediationAdapter.this.log("AdView ad failed to load for instance ID: " + str + " with error: " + maxError);
this.listener.onAdViewAdLoadFailed(maxError);
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerListener
public void onBannerAdClicked(String str) {
IronSourceMediationAdapter.this.log("AdView ad clicked for instance ID: " + str);
this.listener.onAdViewAdClicked();
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerListener
public void onBannerAdShown(String str) {
IronSourceMediationAdapter.loadedAdViewPlacementIdentifiers.add(str);
IronSourceMediationAdapter.this.log("AdView ad displayed for instance ID: " + str);
this.listener.onAdViewAdDisplayed();
}
@Override // com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerListener
public void onBannerAdLeftApplication(String str) {
IronSourceMediationAdapter.this.log("AdView ad left application for instance ID: " + str);
}
}
public class BiddingInterstitialListener implements InterstitialAdLoaderListener, InterstitialAdListener {
private final MaxInterstitialAdapterListener listener;
public BiddingInterstitialListener(MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
this.listener = maxInterstitialAdapterListener;
}
@Override // com.unity3d.ironsourceads.interstitial.InterstitialAdLoaderListener
public void onInterstitialAdLoaded(@NonNull InterstitialAd interstitialAd) {
IronSourceMediationAdapter.this.log("Interstitial loaded for bidding instance ID: " + interstitialAd.getAdInfo().getInstanceId());
IronSourceMediationAdapter.this.biddingInterstitialAd = interstitialAd;
this.listener.onInterstitialAdLoaded(createExtraInfo(interstitialAd));
}
@Override // com.unity3d.ironsourceads.interstitial.InterstitialAdLoaderListener
public void onInterstitialAdLoadFailed(@NonNull IronSourceError ironSourceError) {
IronSourceMediationAdapter.this.log("Interstitial ad failed to load for bidding instance with error: " + ironSourceError);
this.listener.onInterstitialAdLoadFailed(IronSourceMediationAdapter.toMaxError(ironSourceError));
}
@Override // com.unity3d.ironsourceads.interstitial.InterstitialAdListener
public void onInterstitialAdShown(@NonNull InterstitialAd interstitialAd) {
IronSourceMediationAdapter.this.log("Interstitial ad displayed for bidding instance ID: " + interstitialAd.getAdInfo().getInstanceId());
this.listener.onInterstitialAdDisplayed(createExtraInfo(interstitialAd));
}
@Override // com.unity3d.ironsourceads.interstitial.InterstitialAdListener
public void onInterstitialAdFailedToShow(@NonNull InterstitialAd interstitialAd, @NonNull IronSourceError ironSourceError) {
MaxAdapterError maxAdapterError = new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", ironSourceError.getErrorCode(), ironSourceError.getErrorMessage());
IronSourceMediationAdapter.this.log("Interstitial ad failed to show for bidding instance ID: " + interstitialAd.getAdInfo().getInstanceId() + " with error: " + maxAdapterError);
this.listener.onInterstitialAdDisplayFailed(maxAdapterError, createExtraInfo(interstitialAd));
}
@Override // com.unity3d.ironsourceads.interstitial.InterstitialAdListener
public void onInterstitialAdClicked(@NonNull InterstitialAd interstitialAd) {
IronSourceMediationAdapter.this.log("Interstitial ad clicked for bidding instance ID: " + interstitialAd.getAdInfo().getInstanceId());
this.listener.onInterstitialAdClicked(createExtraInfo(interstitialAd));
}
@Override // com.unity3d.ironsourceads.interstitial.InterstitialAdListener
public void onInterstitialAdDismissed(@NonNull InterstitialAd interstitialAd) {
IronSourceMediationAdapter.this.log("Interstitial ad closed for bidding instance ID: " + interstitialAd.getAdInfo().getInstanceId());
this.listener.onInterstitialAdHidden(createExtraInfo(interstitialAd));
}
@Nullable
private Bundle createExtraInfo(@NonNull InterstitialAd interstitialAd) {
String adId = interstitialAd.getAdInfo().getAdId();
if (TextUtils.isEmpty(adId)) {
return null;
}
Bundle bundle = new Bundle(1);
bundle.putString(CampaignEx.JSON_KEY_CREATIVE_ID, adId);
return bundle;
}
}
public class BiddingRewardedListener implements RewardedAdLoaderListener, RewardedAdListener {
private boolean hasGrantedReward;
private final MaxRewardedAdapterListener listener;
public BiddingRewardedListener(MaxRewardedAdapterListener maxRewardedAdapterListener) {
this.listener = maxRewardedAdapterListener;
}
@Override // com.unity3d.ironsourceads.rewarded.RewardedAdLoaderListener
public void onRewardedAdLoaded(@NonNull RewardedAd rewardedAd) {
IronSourceMediationAdapter.this.log("Rewarded ad loaded for bidding instance ID: " + rewardedAd.getAdInfo().getInstanceId());
IronSourceMediationAdapter.this.biddingRewardedAd = rewardedAd;
this.listener.onRewardedAdLoaded(createExtraInfo(rewardedAd));
}
@Override // com.unity3d.ironsourceads.rewarded.RewardedAdLoaderListener
public void onRewardedAdLoadFailed(@NonNull IronSourceError ironSourceError) {
IronSourceMediationAdapter.this.log("Rewarded ad failed to load for bidding instance with error: " + ironSourceError);
this.listener.onRewardedAdLoadFailed(IronSourceMediationAdapter.toMaxError(ironSourceError));
}
@Override // com.unity3d.ironsourceads.rewarded.RewardedAdListener
public void onRewardedAdShown(@NonNull RewardedAd rewardedAd) {
IronSourceMediationAdapter.this.log("Rewarded ad shown for bidding instance ID: " + rewardedAd.getAdInfo().getInstanceId());
this.listener.onRewardedAdDisplayed(createExtraInfo(rewardedAd));
}
@Override // com.unity3d.ironsourceads.rewarded.RewardedAdListener
public void onRewardedAdFailedToShow(@NonNull RewardedAd rewardedAd, @NonNull IronSourceError ironSourceError) {
MaxAdapterError maxAdapterError = new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", ironSourceError.getErrorCode(), ironSourceError.getErrorMessage());
IronSourceMediationAdapter.this.log("Rewarded ad failed to show for bidding instance ID: " + rewardedAd.getAdInfo().getInstanceId() + " with error: " + maxAdapterError);
this.listener.onRewardedAdDisplayFailed(maxAdapterError, createExtraInfo(rewardedAd));
}
@Override // com.unity3d.ironsourceads.rewarded.RewardedAdListener
public void onRewardedAdClicked(@NonNull RewardedAd rewardedAd) {
IronSourceMediationAdapter.this.log("Rewarded ad clicked for instance ID: " + rewardedAd.getAdInfo().getInstanceId());
this.listener.onRewardedAdClicked(createExtraInfo(rewardedAd));
}
@Override // com.unity3d.ironsourceads.rewarded.RewardedAdListener
public void onRewardedAdDismissed(@NonNull RewardedAd rewardedAd) {
if (this.hasGrantedReward || IronSourceMediationAdapter.this.shouldAlwaysRewardUser()) {
MaxReward reward = IronSourceMediationAdapter.this.getReward();
IronSourceMediationAdapter.this.log("Rewarded ad rewarded user with reward: " + reward + " for instance ID: " + rewardedAd.getAdInfo().getInstanceId());
this.listener.onUserRewarded(reward);
}
IronSourceMediationAdapter.this.log("Rewarded ad hidden for instance ID: " + rewardedAd.getAdInfo().getInstanceId());
this.listener.onRewardedAdHidden(createExtraInfo(rewardedAd));
}
@Override // com.unity3d.ironsourceads.rewarded.RewardedAdListener
public void onUserEarnedReward(@NonNull RewardedAd rewardedAd) {
IronSourceMediationAdapter.this.log("Rewarded ad granted reward for instance ID: " + rewardedAd.getAdInfo().getInstanceId());
this.hasGrantedReward = true;
}
@Nullable
private Bundle createExtraInfo(@NonNull RewardedAd rewardedAd) {
String adId = rewardedAd.getAdInfo().getAdId();
if (TextUtils.isEmpty(adId)) {
return null;
}
Bundle bundle = new Bundle(1);
bundle.putString(CampaignEx.JSON_KEY_CREATIVE_ID, adId);
return bundle;
}
}
public class BiddingAdViewListener implements BannerAdLoaderListener, BannerAdViewListener {
private final MaxAdViewAdapterListener listener;
public BiddingAdViewListener(MaxAdViewAdapterListener maxAdViewAdapterListener) {
this.listener = maxAdViewAdapterListener;
}
@Override // com.unity3d.ironsourceads.banner.BannerAdLoaderListener
public void onBannerAdLoaded(@NonNull BannerAdView bannerAdView) {
IronSourceMediationAdapter.this.log("AdView loaded for instance ID: " + bannerAdView.getAdInfo().getInstanceId());
IronSourceMediationAdapter.this.biddingAdView = bannerAdView;
IronSourceMediationAdapter.this.biddingAdView.setListener(this);
this.listener.onAdViewAdLoaded(IronSourceMediationAdapter.this.biddingAdView, createExtraInfo(bannerAdView));
}
@Override // com.unity3d.ironsourceads.banner.BannerAdLoaderListener
public void onBannerAdLoadFailed(@NonNull IronSourceError ironSourceError) {
MaxAdapterError maxError = IronSourceMediationAdapter.toMaxError(ironSourceError);
IronSourceMediationAdapter.this.log("AdView ad failed to load for bidding instance with error: " + maxError);
this.listener.onAdViewAdLoadFailed(maxError);
}
@Override // com.unity3d.ironsourceads.banner.BannerAdViewListener
public void onBannerAdClicked(@NonNull BannerAdView bannerAdView) {
IronSourceMediationAdapter.this.log("AdView ad clicked");
this.listener.onAdViewAdClicked(createExtraInfo(bannerAdView));
}
@Override // com.unity3d.ironsourceads.banner.BannerAdViewListener
public void onBannerAdShown(@NonNull BannerAdView bannerAdView) {
IronSourceMediationAdapter.this.log("AdView ad displayed");
this.listener.onAdViewAdDisplayed(createExtraInfo(bannerAdView));
}
@Nullable
private Bundle createExtraInfo(@NonNull BannerAdView bannerAdView) {
String adId = bannerAdView.getAdInfo().getAdId();
if (TextUtils.isEmpty(adId)) {
return null;
}
Bundle bundle = new Bundle(1);
bundle.putString(CampaignEx.JSON_KEY_CREATIVE_ID, adId);
return bundle;
}
}
}

View File

@@ -0,0 +1,227 @@
package com.applovin.mediation.adapters;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Lifecycle;
import com.applovin.impl.mediation.MaxRewardImpl;
import com.applovin.impl.sdk.j;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.BundleUtils;
import com.applovin.impl.yp;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.MaxAppOpenAdapter;
import com.applovin.mediation.adapter.MaxInterstitialAdViewAdapter;
import com.applovin.mediation.adapter.MaxNativeAdAdapter;
import com.applovin.mediation.adapter.MaxRewardedAdViewAdapter;
import com.applovin.mediation.adapter.listeners.MaxAppOpenAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxNativeAdAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.applovin.sdk.AppLovinSdk;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import java.io.InputStream;
import java.net.URL;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
/* loaded from: classes2.dex */
public abstract class MediationAdapterBase implements MaxAdapter, MaxNativeAdAdapter, MaxInterstitialAdViewAdapter, MaxRewardedAdViewAdapter, MaxAppOpenAdapter {
private boolean alwaysRewardUser;
private final n mLogger;
private final j mSdk;
private final String mTag;
private final AppLovinSdk mWrappingSdk;
private MaxReward reward;
public MediationAdapterBase(AppLovinSdk appLovinSdk) {
this.mWrappingSdk = appLovinSdk;
j a = appLovinSdk.a();
this.mSdk = a;
this.mLogger = a.J();
this.mTag = getClass().getSimpleName();
}
public static String mediationTag() {
return "AppLovinSdk_" + AppLovinSdk.VERSION;
}
public void checkActivities(Context context, Class<?>... clsArr) {
}
public void checkExistence(Class<?>... clsArr) {
if (clsArr == null || clsArr.length <= 0) {
return;
}
for (Class<?> cls : clsArr) {
log("Found: " + cls.getName());
}
}
public void configureReward(MaxAdapterResponseParameters maxAdapterResponseParameters) {
Bundle serverParameters = maxAdapterResponseParameters.getServerParameters();
this.alwaysRewardUser = BundleUtils.getBoolean("always_reward_user", maxAdapterResponseParameters.isTesting(), serverParameters);
int i = BundleUtils.getInt("amount", 0, serverParameters);
String string = BundleUtils.getString("currency", "", serverParameters);
log("Creating reward: " + i + " " + string);
this.reward = MaxRewardImpl.create(i, string);
}
public Future<Drawable> createDrawableFuture(final String str, final Resources resources) {
return getCachingExecutorService().submit(new Callable<Drawable>() { // from class: com.applovin.mediation.adapters.MediationAdapterBase.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // java.util.concurrent.Callable
public Drawable call() throws Exception {
InputStream openStream = FirebasePerfUrlConnection.openStream(new URL(str));
BitmapDrawable bitmapDrawable = new BitmapDrawable(resources, BitmapFactory.decodeStream(openStream));
openStream.close();
return bitmapDrawable;
}
});
}
public void d(String str) {
if (n.a()) {
this.mLogger.a(this.mTag, str);
}
}
public void e(String str) {
if (n.a()) {
this.mLogger.b(this.mTag, str);
}
}
public Context getApplicationContext() {
return j.l();
}
public ExecutorService getCachingExecutorService() {
return this.mSdk.j0().b();
}
public MaxReward getReward() {
MaxReward maxReward = this.reward;
return maxReward != null ? maxReward : MaxRewardImpl.createDefault();
}
public String getVersionString(Class cls, String str) {
String b = yp.b(cls, str);
if (b == null) {
log("Failed to retrieve version string.");
}
return b;
}
public AppLovinSdk getWrappingSdk() {
return this.mWrappingSdk;
}
public void i(String str) {
if (n.a()) {
this.mLogger.d(this.mTag, str);
}
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public boolean isBeta() {
return false;
}
public void loadAppOpenAd(@NonNull MaxAdapterResponseParameters maxAdapterResponseParameters, @Nullable Activity activity, @NonNull MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
d("This adapter (" + getAdapterVersion() + ") does not support app open ads.");
maxAppOpenAdapterListener.onAppOpenAdLoadFailed(MaxAdapterError.INVALID_CONFIGURATION);
}
public void loadNativeAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxNativeAdAdapterListener maxNativeAdAdapterListener) {
d("This adapter (" + getAdapterVersion() + ") does not support native ads.");
maxNativeAdAdapterListener.onNativeAdLoadFailed(MaxAdapterError.INVALID_CONFIGURATION);
}
public void log(String str) {
if (n.a()) {
this.mLogger.d(this.mTag, str);
}
}
public boolean shouldAlwaysRewardUser() {
return this.alwaysRewardUser;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
@Nullable
public Boolean shouldCollectSignalsOnUiThread() {
return null;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
@Nullable
public Boolean shouldInitializeOnUiThread() {
return null;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
@Nullable
public Boolean shouldLoadAdsOnUiThread(MaxAdFormat maxAdFormat) {
return null;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
@Nullable
public Boolean shouldShowAdsOnUiThread(MaxAdFormat maxAdFormat) {
return null;
}
public void showAppOpenAd(@NonNull MaxAdapterResponseParameters maxAdapterResponseParameters, @Nullable Activity activity, @NonNull MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
d("This adapter (" + getAdapterVersion() + ") does not support app open ads.");
maxAppOpenAdapterListener.onAppOpenAdDisplayFailed(MaxAdapterError.INVALID_CONFIGURATION);
}
public void showInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, ViewGroup viewGroup, Lifecycle lifecycle, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
d("This adapter (" + getAdapterVersion() + ") does not support interstitial ad view ads.");
maxInterstitialAdapterListener.onInterstitialAdDisplayFailed(MaxAdapterError.INVALID_CONFIGURATION);
}
public void showRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, ViewGroup viewGroup, Lifecycle lifecycle, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
d("This adapter (" + getAdapterVersion() + ") does not support rewarded ad view ads.");
maxRewardedAdapterListener.onRewardedAdDisplayFailed(MaxAdapterError.INVALID_CONFIGURATION);
}
public void userError(String str) {
userError(str, null);
}
public void w(String str) {
if (n.a()) {
this.mLogger.k(this.mTag, str);
}
}
public void e(String str, Throwable th) {
if (n.a()) {
this.mLogger.a(this.mTag, str, th);
}
}
public void log(String str, Throwable th) {
if (n.a()) {
this.mLogger.a(this.mTag, str, th);
}
}
public void userError(String str, Throwable th) {
n.c(this.mTag, str, th);
}
}

View File

@@ -0,0 +1,510 @@
package com.applovin.mediation.adapters;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.Nullable;
import com.applovin.impl.mediation.MaxRewardImpl;
import com.applovin.impl.sdk.j;
import com.applovin.impl.sdk.n;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.listeners.MaxAdViewAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxAppOpenAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterInitializationParameters;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/* loaded from: classes2.dex */
public abstract class MediationAdapterRouter {
private static final Map<String, MediationAdapterRouter> sharedInstances = new HashMap();
private static final Object sharedInstancesLock = new Object();
private final Map<String, List<MediationAdapterRouterListenerWrapper>> listeners;
private final Object listenersLock;
private final Set<MaxAdapter> loadedAdapters;
protected MaxAdapter.OnCompletionListener mOnCompletionListener;
private j mSdk;
private final String mTag;
private final Set<MaxAdapter> showingAdapters;
public final class MediationAdapterRouterListenerWrapper {
private View mAdView;
private final MaxAdapter mAdapter;
private final MaxAdapterListener mListener;
private final RouterAdLoadType mLoadType;
public MediationAdapterRouterListenerWrapper(MaxAdapter maxAdapter, MaxAdapterListener maxAdapterListener, RouterAdLoadType routerAdLoadType, View view) {
this.mAdapter = maxAdapter;
this.mListener = maxAdapterListener;
this.mLoadType = routerAdLoadType;
this.mAdView = view;
}
public View getAdView() {
return this.mAdView;
}
public MaxAdapter getAdapter() {
return this.mAdapter;
}
public MaxAdapterListener getListener() {
return this.mListener;
}
public RouterAdLoadType getLoadType() {
return this.mLoadType;
}
public void setAdView(View view) {
this.mAdView = view;
}
}
public enum RouterAdLoadType {
INTERSTITIAL,
APPOPEN,
REWARDED,
ADVIEW
}
public MediationAdapterRouter() {
String simpleName = getClass().getSimpleName();
this.mTag = simpleName;
this.listeners = new HashMap();
this.listenersLock = new Object();
this.loadedAdapters = Collections.synchronizedSet(new HashSet());
this.showingAdapters = Collections.synchronizedSet(new HashSet());
if ("max".equalsIgnoreCase(j.v0.O())) {
this.mSdk = j.v0;
} else {
n.h(simpleName, "Invalid mediation provider detected. Please set AppLovin SDK mediation provider to MAX via AppLovinSdk.getInstance(context).setMediationProvider( AppLovinMediationProvider.MAX )");
}
}
private void addAdapter(MaxAdapter maxAdapter, MaxAdapterListener maxAdapterListener, String str, RouterAdLoadType routerAdLoadType, View view) {
synchronized (this.listenersLock) {
try {
MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper = new MediationAdapterRouterListenerWrapper(maxAdapter, maxAdapterListener, routerAdLoadType, view);
List<MediationAdapterRouterListenerWrapper> arrayList = this.listeners.get(str) != null ? this.listeners.get(str) : new ArrayList<>(1);
arrayList.add(mediationAdapterRouterListenerWrapper);
this.listeners.put(str, arrayList);
} catch (Throwable th) {
throw th;
}
}
}
private List<MediationAdapterRouterListenerWrapper> getListenerWrappers(String str) {
if (this.listeners.containsKey(str)) {
return new ArrayList(this.listeners.get(str));
}
return null;
}
private List<MediationAdapterRouterListenerWrapper> getLoadingListenerWrappers(String str) {
ArrayList arrayList = new ArrayList();
synchronized (this.listenersLock) {
try {
List<MediationAdapterRouterListenerWrapper> listenerWrappers = getListenerWrappers(str);
if (listenerWrappers == null || listenerWrappers.size() <= 0) {
return null;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : listenerWrappers) {
if (!isAdLoaded(mediationAdapterRouterListenerWrapper.getAdapter())) {
arrayList.add(mediationAdapterRouterListenerWrapper);
}
}
return arrayList;
} catch (Throwable th) {
throw th;
}
}
}
public static MediationAdapterRouter getSharedInstance(Class cls) {
MediationAdapterRouter mediationAdapterRouter;
synchronized (sharedInstancesLock) {
try {
String name = cls.getName();
mediationAdapterRouter = sharedInstances.get(name);
if (mediationAdapterRouter == null) {
try {
Constructor declaredConstructor = cls.getDeclaredConstructor(new Class[0]);
declaredConstructor.setAccessible(true);
mediationAdapterRouter = (MediationAdapterRouter) declaredConstructor.newInstance(new Object[0]);
} catch (Throwable unused) {
}
sharedInstances.put(name, mediationAdapterRouter);
}
} catch (Throwable th) {
throw th;
}
}
return mediationAdapterRouter;
}
private List<MediationAdapterRouterListenerWrapper> getShowingListenerWrappers(String str) {
ArrayList arrayList = new ArrayList();
synchronized (this.listenersLock) {
try {
List<MediationAdapterRouterListenerWrapper> listenerWrappers = getListenerWrappers(str);
if (listenerWrappers == null || listenerWrappers.size() <= 0) {
return null;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : listenerWrappers) {
if (isAdShowing(mediationAdapterRouterListenerWrapper.getAdapter())) {
arrayList.add(mediationAdapterRouterListenerWrapper);
}
}
return arrayList;
} catch (Throwable th) {
throw th;
}
}
}
private boolean isAdLoaded(MaxAdapter maxAdapter) {
return this.loadedAdapters.contains(maxAdapter);
}
private boolean isAdShowing(MaxAdapter maxAdapter) {
return this.showingAdapters.contains(maxAdapter);
}
public void addAdViewAdapter(MaxAdapter maxAdapter, MaxAdViewAdapterListener maxAdViewAdapterListener, String str, View view) {
addAdapter(maxAdapter, maxAdViewAdapterListener, str, RouterAdLoadType.ADVIEW, view);
}
public void addAppOpenAdapter(MaxAdapter maxAdapter, MaxAppOpenAdapterListener maxAppOpenAdapterListener, String str) {
addAdapter(maxAdapter, maxAppOpenAdapterListener, str, RouterAdLoadType.APPOPEN, null);
}
public void addInterstitialAdapter(MaxAdapter maxAdapter, MaxInterstitialAdapterListener maxInterstitialAdapterListener, String str) {
addAdapter(maxAdapter, maxInterstitialAdapterListener, str, RouterAdLoadType.INTERSTITIAL, null);
}
public void addRewardedAdapter(MaxAdapter maxAdapter, MaxRewardedAdapterListener maxRewardedAdapterListener, String str) {
addAdapter(maxAdapter, maxRewardedAdapterListener, str, RouterAdLoadType.REWARDED, null);
}
public void addShowingAdapter(MaxAdapter maxAdapter) {
this.showingAdapters.add(maxAdapter);
}
public MaxReward getReward(String str) {
synchronized (this.listenersLock) {
try {
List<MediationAdapterRouterListenerWrapper> listenerWrappers = getListenerWrappers(str);
if (listenerWrappers != null && listenerWrappers.size() > 0) {
MaxAdapter adapter = listenerWrappers.get(0).getAdapter();
if (adapter instanceof MediationAdapterBase) {
return ((MediationAdapterBase) adapter).getReward();
}
}
return MaxRewardImpl.createDefault();
} catch (Throwable th) {
throw th;
}
}
}
public abstract void initialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters, Activity activity, MaxAdapter.OnCompletionListener onCompletionListener);
public void onAdClicked(String str) {
List<MediationAdapterRouterListenerWrapper> showingListenerWrappers = getShowingListenerWrappers(str);
if (showingListenerWrappers == null || showingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : showingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.INTERSTITIAL) {
log("Interstitial clicked");
((MaxInterstitialAdapterListener) listener).onInterstitialAdClicked();
} else if (loadType == RouterAdLoadType.APPOPEN) {
log("App open clicked");
((MaxAppOpenAdapterListener) listener).onAppOpenAdClicked();
} else if (loadType == RouterAdLoadType.REWARDED) {
log("Rewarded clicked");
((MaxRewardedAdapterListener) listener).onRewardedAdClicked();
} else if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView clicked");
((MaxAdViewAdapterListener) listener).onAdViewAdClicked();
}
}
}
public void onAdDisplayFailed(String str, MaxAdapterError maxAdapterError) {
List<MediationAdapterRouterListenerWrapper> showingListenerWrappers = getShowingListenerWrappers(str);
if (showingListenerWrappers == null || showingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : showingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.INTERSTITIAL) {
log("Interstitial failed to display with error: " + maxAdapterError.toString());
((MaxInterstitialAdapterListener) listener).onInterstitialAdDisplayFailed(maxAdapterError);
} else if (loadType == RouterAdLoadType.APPOPEN) {
log("App open failed to display with error: " + maxAdapterError.toString());
((MaxAppOpenAdapterListener) listener).onAppOpenAdDisplayFailed(maxAdapterError);
} else if (loadType == RouterAdLoadType.REWARDED) {
log("Rewarded failed to display with error: " + maxAdapterError.toString());
((MaxRewardedAdapterListener) listener).onRewardedAdDisplayFailed(maxAdapterError);
} else if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView failed to display with error: " + maxAdapterError.toString());
((MaxAdViewAdapterListener) listener).onAdViewAdDisplayFailed(maxAdapterError);
}
}
}
public void onAdDisplayed(String str) {
onAdDisplayed(str, null);
}
public void onAdHidden(String str) {
List<MediationAdapterRouterListenerWrapper> showingListenerWrappers = getShowingListenerWrappers(str);
if (showingListenerWrappers == null || showingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : showingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.INTERSTITIAL) {
log("Interstitial hidden");
((MaxInterstitialAdapterListener) listener).onInterstitialAdHidden();
} else if (loadType == RouterAdLoadType.APPOPEN) {
log("App open hidden");
((MaxAppOpenAdapterListener) listener).onAppOpenAdHidden();
} else if (loadType == RouterAdLoadType.REWARDED) {
log("Rewarded hidden");
((MaxRewardedAdapterListener) listener).onRewardedAdHidden();
} else if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView hidden");
((MaxAdViewAdapterListener) listener).onAdViewAdHidden();
}
}
}
public void onAdLoadFailed(String str, MaxAdapterError maxAdapterError) {
List<MediationAdapterRouterListenerWrapper> loadingListenerWrappers = getLoadingListenerWrappers(str);
if (loadingListenerWrappers == null || loadingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : loadingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.INTERSTITIAL) {
log("Interstitial failed to load with error: " + maxAdapterError.toString());
((MaxInterstitialAdapterListener) listener).onInterstitialAdLoadFailed(maxAdapterError);
} else if (loadType == RouterAdLoadType.APPOPEN) {
log("App open failed to load with error: " + maxAdapterError.toString());
((MaxAppOpenAdapterListener) listener).onAppOpenAdLoadFailed(maxAdapterError);
} else if (loadType == RouterAdLoadType.REWARDED) {
log("Rewarded failed to load with error: " + maxAdapterError.toString());
((MaxRewardedAdapterListener) listener).onRewardedAdLoadFailed(maxAdapterError);
} else if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView failed to load with error: " + maxAdapterError.toString());
((MaxAdViewAdapterListener) listener).onAdViewAdLoadFailed(maxAdapterError);
}
}
}
public void onAdLoaded(String str) {
onAdLoaded(str, null);
}
public void onAdViewAdCollapsed(String str) {
List<MediationAdapterRouterListenerWrapper> showingListenerWrappers = getShowingListenerWrappers(str);
if (showingListenerWrappers == null || showingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : showingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView collapsed");
((MaxAdViewAdapterListener) listener).onAdViewAdCollapsed();
}
}
}
public void onAdViewAdExpanded(String str) {
List<MediationAdapterRouterListenerWrapper> showingListenerWrappers = getShowingListenerWrappers(str);
if (showingListenerWrappers == null || showingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : showingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView expanded");
((MaxAdViewAdapterListener) listener).onAdViewAdExpanded();
}
}
}
public void onUserRewarded(String str, MaxReward maxReward) {
List<MediationAdapterRouterListenerWrapper> showingListenerWrappers = getShowingListenerWrappers(str);
if (showingListenerWrappers == null || showingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : showingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.REWARDED) {
log("Rewarded user with reward: " + maxReward);
((MaxRewardedAdapterListener) listener).onUserRewarded(maxReward);
}
}
}
public void removeAdapter(MaxAdapter maxAdapter, String str) {
MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper;
this.loadedAdapters.remove(maxAdapter);
this.showingAdapters.remove(maxAdapter);
synchronized (this.listenersLock) {
try {
List<MediationAdapterRouterListenerWrapper> list = this.listeners.get(str);
if (list != null && list.size() > 0) {
Iterator<MediationAdapterRouterListenerWrapper> it = list.iterator();
while (true) {
if (!it.hasNext()) {
mediationAdapterRouterListenerWrapper = null;
break;
} else {
mediationAdapterRouterListenerWrapper = it.next();
if (mediationAdapterRouterListenerWrapper.getAdapter() == maxAdapter) {
}
}
}
if (mediationAdapterRouterListenerWrapper != null) {
list.remove(mediationAdapterRouterListenerWrapper);
}
}
} finally {
}
}
}
public boolean shouldAlwaysRewardUser(String str) {
synchronized (this.listenersLock) {
try {
List<MediationAdapterRouterListenerWrapper> listenerWrappers = getListenerWrappers(str);
if (listenerWrappers != null && listenerWrappers.size() > 0) {
MaxAdapter adapter = listenerWrappers.get(0).getAdapter();
if (adapter instanceof MediationAdapterBase) {
return ((MediationAdapterBase) adapter).shouldAlwaysRewardUser();
}
}
return false;
} catch (Throwable th) {
throw th;
}
}
}
public void updateAdView(View view, String str) {
synchronized (this.listenersLock) {
try {
List<MediationAdapterRouterListenerWrapper> listenerWrappers = getListenerWrappers(str);
if (listenerWrappers != null && listenerWrappers.size() > 0) {
Iterator<MediationAdapterRouterListenerWrapper> it = listenerWrappers.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
MediationAdapterRouterListenerWrapper next = it.next();
if (next.getAdView() == null) {
next.setAdView(view);
break;
}
}
}
} catch (Throwable th) {
throw th;
}
}
}
public void onAdDisplayed(String str, @Nullable Bundle bundle) {
List<MediationAdapterRouterListenerWrapper> showingListenerWrappers = getShowingListenerWrappers(str);
if (showingListenerWrappers == null || showingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : showingListenerWrappers) {
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.INTERSTITIAL) {
log("Interstitial shown");
((MaxInterstitialAdapterListener) listener).onInterstitialAdDisplayed(bundle);
} else if (loadType == RouterAdLoadType.APPOPEN) {
log("App open shown");
((MaxAppOpenAdapterListener) listener).onAppOpenAdDisplayed(bundle);
} else if (loadType == RouterAdLoadType.REWARDED) {
log("Rewarded shown");
((MaxRewardedAdapterListener) listener).onRewardedAdDisplayed(bundle);
} else if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView shown");
((MaxAdViewAdapterListener) listener).onAdViewAdDisplayed(bundle);
}
}
}
public void onAdLoaded(String str, @Nullable Bundle bundle) {
List<MediationAdapterRouterListenerWrapper> loadingListenerWrappers = getLoadingListenerWrappers(str);
if (loadingListenerWrappers == null || loadingListenerWrappers.size() <= 0) {
return;
}
for (MediationAdapterRouterListenerWrapper mediationAdapterRouterListenerWrapper : loadingListenerWrappers) {
this.loadedAdapters.add(mediationAdapterRouterListenerWrapper.getAdapter());
RouterAdLoadType loadType = mediationAdapterRouterListenerWrapper.getLoadType();
MaxAdapterListener listener = mediationAdapterRouterListenerWrapper.getListener();
if (loadType == RouterAdLoadType.INTERSTITIAL) {
log("Interstitial loaded");
((MaxInterstitialAdapterListener) listener).onInterstitialAdLoaded(bundle);
} else if (loadType == RouterAdLoadType.APPOPEN) {
log("App open loaded");
((MaxAppOpenAdapterListener) listener).onAppOpenAdLoaded(bundle);
} else if (loadType == RouterAdLoadType.REWARDED) {
log("Rewarded loaded");
((MaxRewardedAdapterListener) listener).onRewardedAdLoaded(bundle);
} else if (loadType == RouterAdLoadType.ADVIEW) {
log("AdView loaded");
((MaxAdViewAdapterListener) listener).onAdViewAdLoaded(mediationAdapterRouterListenerWrapper.getAdView(), bundle);
}
}
}
public void log(String str) {
j jVar = this.mSdk;
if (jVar != null) {
jVar.J();
if (n.a()) {
this.mSdk.J().d(this.mTag, str);
}
}
}
public void log(String str, Throwable th) {
j jVar = this.mSdk;
if (jVar != null) {
jVar.J();
if (n.a()) {
this.mSdk.J().a(this.mTag, str, th);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,486 @@
package com.applovin.mediation.adapters;
import android.app.Activity;
import android.content.Context;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.adapter.MaxAdViewAdapter;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.MaxInterstitialAdapter;
import com.applovin.mediation.adapter.MaxRewardedAdapter;
import com.applovin.mediation.adapter.MaxSignalProvider;
import com.applovin.mediation.adapter.listeners.MaxAdViewAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxSignalCollectionListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterInitializationParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterSignalCollectionParameters;
import com.applovin.mediation.adapters.unityads.BuildConfig;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.unity3d.ads.IUnityAdsInitializationListener;
import com.unity3d.ads.IUnityAdsLoadListener;
import com.unity3d.ads.IUnityAdsShowListener;
import com.unity3d.ads.IUnityAdsTokenListener;
import com.unity3d.ads.UnityAds;
import com.unity3d.ads.UnityAdsLoadOptions;
import com.unity3d.ads.UnityAdsShowOptions;
import com.unity3d.ads.metadata.MediationMetaData;
import com.unity3d.ads.metadata.MetaData;
import com.unity3d.services.banners.BannerErrorCode;
import com.unity3d.services.banners.BannerErrorInfo;
import com.unity3d.services.banners.BannerView;
import com.unity3d.services.banners.UnityBannerSize;
import com.vungle.ads.internal.protos.Sdk;
import csdk.gluads.max.EAMax;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes2.dex */
public class UnityAdsMediationAdapter extends MediationAdapterBase implements MaxSignalProvider, MaxInterstitialAdapter, MaxRewardedAdapter, MaxAdViewAdapter {
private static MaxAdapter.InitializationStatus initializationStatus;
private static final AtomicBoolean initialized = new AtomicBoolean();
private BannerView bannerView;
private String biddingAdId;
public UnityAdsMediationAdapter(AppLovinSdk appLovinSdk) {
super(appLovinSdk);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void initialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters, Activity activity, final MaxAdapter.OnCompletionListener onCompletionListener) {
if (EAMax.adapterDisabled(getClass().getName(), onCompletionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
Context context = getContext(activity);
updatePrivacyConsent(maxAdapterInitializationParameters, context);
if (initialized.compareAndSet(false, true)) {
String string = maxAdapterInitializationParameters.getServerParameters().getString("game_id", null);
log("Initializing UnityAds SDK with game id: " + string + "...");
initializationStatus = MaxAdapter.InitializationStatus.INITIALIZING;
MediationMetaData mediationMetaData = new MediationMetaData(context);
mediationMetaData.setName("MAX");
mediationMetaData.setVersion(AppLovinSdk.VERSION);
mediationMetaData.set("adapter_version", getAdapterVersion());
mediationMetaData.commit();
UnityAds.setDebugMode(maxAdapterInitializationParameters.isTesting());
UnityAds.initialize(context, string, maxAdapterInitializationParameters.isTesting(), new IUnityAdsInitializationListener() { // from class: com.applovin.mediation.adapters.UnityAdsMediationAdapter.1
@Override // com.unity3d.ads.IUnityAdsInitializationListener
public void onInitializationComplete() {
UnityAdsMediationAdapter.this.log("UnityAds SDK initialized");
MaxAdapter.InitializationStatus initializationStatus2 = MaxAdapter.InitializationStatus.INITIALIZED_SUCCESS;
MaxAdapter.InitializationStatus unused = UnityAdsMediationAdapter.initializationStatus = initializationStatus2;
onCompletionListener.onCompletion(initializationStatus2, null);
}
@Override // com.unity3d.ads.IUnityAdsInitializationListener
public void onInitializationFailed(UnityAds.UnityAdsInitializationError unityAdsInitializationError, String str) {
UnityAdsMediationAdapter.this.log("UnityAds SDK failed to initialize with error: " + str);
MaxAdapter.InitializationStatus initializationStatus2 = MaxAdapter.InitializationStatus.INITIALIZED_FAILURE;
MaxAdapter.InitializationStatus unused = UnityAdsMediationAdapter.initializationStatus = initializationStatus2;
onCompletionListener.onCompletion(initializationStatus2, str);
}
});
return;
}
log("UnityAds SDK already initialized");
onCompletionListener.onCompletion(initializationStatus, null);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getSdkVersion() {
return UnityAds.getVersion();
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getAdapterVersion() {
return BuildConfig.VERSION_NAME;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void onDestroy() {
BannerView bannerView = this.bannerView;
if (bannerView != null) {
bannerView.destroy();
this.bannerView = null;
}
}
@Override // com.applovin.mediation.adapter.MaxSignalProvider
public void collectSignal(MaxAdapterSignalCollectionParameters maxAdapterSignalCollectionParameters, Activity activity, final MaxSignalCollectionListener maxSignalCollectionListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxSignalCollectionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
log("Collecting signal...");
updatePrivacyConsent(maxAdapterSignalCollectionParameters, activity.getApplicationContext());
UnityAds.getToken(new IUnityAdsTokenListener() { // from class: com.applovin.mediation.adapters.UnityAdsMediationAdapter.2
@Override // com.unity3d.ads.IUnityAdsTokenListener
public void onUnityAdsTokenReady(String str) {
UnityAdsMediationAdapter.this.log("Collected signal");
maxSignalCollectionListener.onSignalCollected(str);
}
});
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void loadInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, final MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse()) ? "bidding " : "");
sb.append("interstitial ad for placement \"");
sb.append(thirdPartyAdPlacementId);
sb.append("\"...");
log(sb.toString());
updatePrivacyConsent(maxAdapterResponseParameters, activity.getApplicationContext());
this.biddingAdId = UUID.randomUUID().toString();
UnityAds.load(thirdPartyAdPlacementId, createAdLoadOptions(maxAdapterResponseParameters), new IUnityAdsLoadListener() { // from class: com.applovin.mediation.adapters.UnityAdsMediationAdapter.3
@Override // com.unity3d.ads.IUnityAdsLoadListener
public void onUnityAdsAdLoaded(String str) {
UnityAdsMediationAdapter.this.log("Interstitial placement \"" + str + "\" loaded");
maxInterstitialAdapterListener.onInterstitialAdLoaded();
}
@Override // com.unity3d.ads.IUnityAdsLoadListener
public void onUnityAdsFailedToLoad(String str, UnityAds.UnityAdsLoadError unityAdsLoadError, String str2) {
UnityAdsMediationAdapter.this.log("Interstitial placement \"" + str + "\" failed to load with error: " + unityAdsLoadError + ": " + str2);
maxInterstitialAdapterListener.onInterstitialAdLoadFailed(UnityAdsMediationAdapter.toMaxError(unityAdsLoadError, str2));
}
});
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void showInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, final MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
log("Showing interstitial ad for placement \"" + thirdPartyAdPlacementId + "\"...");
UnityAds.show(activity, thirdPartyAdPlacementId, createAdShowOptions(), new IUnityAdsShowListener() { // from class: com.applovin.mediation.adapters.UnityAdsMediationAdapter.4
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowFailure(String str, UnityAds.UnityAdsShowError unityAdsShowError, String str2) {
UnityAdsMediationAdapter.this.log("Interstitial placement \"" + str + "\" failed to display with error: " + unityAdsShowError + ": " + str2);
maxInterstitialAdapterListener.onInterstitialAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", unityAdsShowError.ordinal(), str2));
}
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowStart(String str) {
UnityAdsMediationAdapter.this.log("Interstitial placement \"" + str + "\" displayed");
maxInterstitialAdapterListener.onInterstitialAdDisplayed();
}
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowClick(String str) {
UnityAdsMediationAdapter.this.log("Interstitial placement \"" + str + "\" clicked");
maxInterstitialAdapterListener.onInterstitialAdClicked();
}
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowComplete(String str, UnityAds.UnityAdsShowCompletionState unityAdsShowCompletionState) {
UnityAdsMediationAdapter.this.log("Interstitial placement \"" + str + "\" hidden with completion state: " + unityAdsShowCompletionState);
maxInterstitialAdapterListener.onInterstitialAdHidden();
}
});
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void loadRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, final MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse()) ? "bidding " : "");
sb.append("rewarded ad for placement \"");
sb.append(thirdPartyAdPlacementId);
sb.append("\"...");
log(sb.toString());
updatePrivacyConsent(maxAdapterResponseParameters, activity.getApplicationContext());
this.biddingAdId = UUID.randomUUID().toString();
UnityAds.load(thirdPartyAdPlacementId, createAdLoadOptions(maxAdapterResponseParameters), new IUnityAdsLoadListener() { // from class: com.applovin.mediation.adapters.UnityAdsMediationAdapter.5
@Override // com.unity3d.ads.IUnityAdsLoadListener
public void onUnityAdsAdLoaded(String str) {
UnityAdsMediationAdapter.this.log("Rewarded ad placement \"" + str + "\" loaded");
maxRewardedAdapterListener.onRewardedAdLoaded();
}
@Override // com.unity3d.ads.IUnityAdsLoadListener
public void onUnityAdsFailedToLoad(String str, UnityAds.UnityAdsLoadError unityAdsLoadError, String str2) {
UnityAdsMediationAdapter.this.log("Rewarded ad placement \"" + str + "\" failed to load with error: " + unityAdsLoadError + ": " + str2);
maxRewardedAdapterListener.onRewardedAdLoadFailed(UnityAdsMediationAdapter.toMaxError(unityAdsLoadError, str2));
}
});
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void showRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, final MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
log("Showing rewarded ad for placement \"" + thirdPartyAdPlacementId + "\"...");
configureReward(maxAdapterResponseParameters);
UnityAds.show(activity, thirdPartyAdPlacementId, createAdShowOptions(), new IUnityAdsShowListener() { // from class: com.applovin.mediation.adapters.UnityAdsMediationAdapter.6
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowFailure(String str, UnityAds.UnityAdsShowError unityAdsShowError, String str2) {
UnityAdsMediationAdapter.this.log("Rewarded ad placement \"" + str + "\" failed to display with error: " + unityAdsShowError + ": " + str2);
maxRewardedAdapterListener.onRewardedAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", unityAdsShowError.ordinal(), str2));
}
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowStart(String str) {
UnityAdsMediationAdapter.this.log("Rewarded ad placement \"" + str + "\" displayed");
maxRewardedAdapterListener.onRewardedAdDisplayed();
}
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowClick(String str) {
UnityAdsMediationAdapter.this.log("Rewarded ad placement \"" + str + "\" clicked");
maxRewardedAdapterListener.onRewardedAdClicked();
}
@Override // com.unity3d.ads.IUnityAdsShowListener
public void onUnityAdsShowComplete(String str, UnityAds.UnityAdsShowCompletionState unityAdsShowCompletionState) {
UnityAdsMediationAdapter.this.log("Rewarded ad placement \"" + str + "\" hidden with completion state: " + unityAdsShowCompletionState);
if (unityAdsShowCompletionState == UnityAds.UnityAdsShowCompletionState.COMPLETED || UnityAdsMediationAdapter.this.shouldAlwaysRewardUser()) {
maxRewardedAdapterListener.onUserRewarded(UnityAdsMediationAdapter.this.getReward());
}
maxRewardedAdapterListener.onRewardedAdHidden();
}
});
}
@Override // com.applovin.mediation.adapter.MaxAdViewAdapter
public void loadAdViewAd(MaxAdapterResponseParameters maxAdapterResponseParameters, final MaxAdFormat maxAdFormat, Activity activity, final MaxAdViewAdapterListener maxAdViewAdapterListener) {
final String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(AppLovinSdkUtils.isValidString(maxAdapterResponseParameters.getBidResponse()) ? "bidding " : "");
sb.append(maxAdFormat.getLabel());
sb.append(" ad for placement \"");
sb.append(thirdPartyAdPlacementId);
sb.append("\"...");
log(sb.toString());
if (activity == null) {
log(maxAdFormat.getLabel() + " ad placement \"" + thirdPartyAdPlacementId + "\" load failed: Activity is null");
maxAdViewAdapterListener.onAdViewAdLoadFailed(new MaxAdapterError(-5601, "Missing Activity"));
return;
}
updatePrivacyConsent(maxAdapterResponseParameters, activity.getApplicationContext());
this.biddingAdId = UUID.randomUUID().toString();
BannerView bannerView = new BannerView(activity, thirdPartyAdPlacementId, toUnityBannerSize(maxAdFormat));
this.bannerView = bannerView;
bannerView.setListener(new BannerView.IListener() { // from class: com.applovin.mediation.adapters.UnityAdsMediationAdapter.7
@Override // com.unity3d.services.banners.BannerView.IListener
public void onBannerLoaded(BannerView bannerView2) {
UnityAdsMediationAdapter.this.log(maxAdFormat.getLabel() + " ad placement \"" + thirdPartyAdPlacementId + "\" loaded");
maxAdViewAdapterListener.onAdViewAdLoaded(bannerView2);
}
@Override // com.unity3d.services.banners.BannerView.IListener
public void onBannerFailedToLoad(BannerView bannerView2, BannerErrorInfo bannerErrorInfo) {
UnityAdsMediationAdapter.this.log(maxAdFormat.getLabel() + " ad placement \"" + thirdPartyAdPlacementId + "\" failed to load");
maxAdViewAdapterListener.onAdViewAdLoadFailed(UnityAdsMediationAdapter.toMaxError(bannerErrorInfo));
}
@Override // com.unity3d.services.banners.BannerView.IListener
public void onBannerShown(BannerView bannerView2) {
UnityAdsMediationAdapter.this.log(maxAdFormat.getLabel() + " ad placement \"" + thirdPartyAdPlacementId + "\" shown");
maxAdViewAdapterListener.onAdViewAdDisplayed();
}
@Override // com.unity3d.services.banners.BannerView.IListener
public void onBannerClick(BannerView bannerView2) {
UnityAdsMediationAdapter.this.log(maxAdFormat.getLabel() + " ad placement \"" + thirdPartyAdPlacementId + "\" clicked");
maxAdViewAdapterListener.onAdViewAdClicked();
}
@Override // com.unity3d.services.banners.BannerView.IListener
public void onBannerLeftApplication(BannerView bannerView2) {
UnityAdsMediationAdapter.this.log(maxAdFormat.getLabel() + " ad placement \"" + thirdPartyAdPlacementId + "\" left application");
}
});
this.bannerView.load(createAdLoadOptions(maxAdapterResponseParameters));
}
private UnityAdsLoadOptions createAdLoadOptions(MaxAdapterResponseParameters maxAdapterResponseParameters) {
UnityAdsLoadOptions unityAdsLoadOptions = new UnityAdsLoadOptions();
String bidResponse = maxAdapterResponseParameters.getBidResponse();
if (AppLovinSdkUtils.isValidString(bidResponse)) {
unityAdsLoadOptions.setAdMarkup(bidResponse);
}
if (AppLovinSdkUtils.isValidString(this.biddingAdId)) {
unityAdsLoadOptions.setObjectId(this.biddingAdId);
}
return unityAdsLoadOptions;
}
private UnityAdsShowOptions createAdShowOptions() {
UnityAdsShowOptions unityAdsShowOptions = new UnityAdsShowOptions();
if (AppLovinSdkUtils.isValidString(this.biddingAdId)) {
unityAdsShowOptions.setObjectId(this.biddingAdId);
}
return unityAdsShowOptions;
}
private UnityBannerSize toUnityBannerSize(MaxAdFormat maxAdFormat) {
if (maxAdFormat == MaxAdFormat.BANNER) {
return new UnityBannerSize(Sdk.SDKError.Reason.WEBVIEW_ERROR_VALUE, 50);
}
if (maxAdFormat == MaxAdFormat.LEADER) {
return new UnityBannerSize(728, 90);
}
if (maxAdFormat == MaxAdFormat.MREC) {
return new UnityBannerSize(300, 250);
}
throw new IllegalArgumentException("Unsupported ad format: " + maxAdFormat);
}
/* JADX INFO: Access modifiers changed from: private */
public static MaxAdapterError toMaxError(BannerErrorInfo bannerErrorInfo) {
MaxAdapterError maxAdapterError;
BannerErrorCode bannerErrorCode = bannerErrorInfo.errorCode;
if (bannerErrorCode == BannerErrorCode.NO_FILL) {
maxAdapterError = MaxAdapterError.NO_FILL;
} else if (bannerErrorCode == BannerErrorCode.NATIVE_ERROR) {
maxAdapterError = MaxAdapterError.INTERNAL_ERROR;
} else if (bannerErrorCode == BannerErrorCode.WEBVIEW_ERROR) {
maxAdapterError = MaxAdapterError.WEBVIEW_ERROR;
} else {
maxAdapterError = MaxAdapterError.UNSPECIFIED;
}
return new MaxAdapterError(maxAdapterError.getErrorCode(), maxAdapterError.getErrorMessage(), bannerErrorInfo.errorCode.ordinal(), bannerErrorInfo.errorMessage);
}
/* JADX INFO: Access modifiers changed from: private */
public static MaxAdapterError toMaxError(UnityAds.UnityAdsLoadError unityAdsLoadError, String str) {
MaxAdapterError maxAdapterError = MaxAdapterError.UNSPECIFIED;
int i = AnonymousClass8.$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsLoadError[unityAdsLoadError.ordinal()];
if (i == 1) {
maxAdapterError = MaxAdapterError.NOT_INITIALIZED;
} else if (i == 2) {
maxAdapterError = MaxAdapterError.INTERNAL_ERROR;
} else if (i == 3) {
maxAdapterError = MaxAdapterError.INVALID_CONFIGURATION;
} else if (i == 4) {
maxAdapterError = MaxAdapterError.NO_FILL;
} else if (i == 5) {
maxAdapterError = MaxAdapterError.TIMEOUT;
}
return new MaxAdapterError(maxAdapterError.getErrorCode(), maxAdapterError.getErrorMessage(), unityAdsLoadError.ordinal(), str);
}
/* renamed from: com.applovin.mediation.adapters.UnityAdsMediationAdapter$8, reason: invalid class name */
public static /* synthetic */ class AnonymousClass8 {
static final /* synthetic */ int[] $SwitchMap$com$unity3d$ads$UnityAds$UnityAdsLoadError;
static final /* synthetic */ int[] $SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError;
static {
int[] iArr = new int[UnityAds.UnityAdsShowError.values().length];
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError = iArr;
try {
iArr[UnityAds.UnityAdsShowError.NOT_INITIALIZED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError[UnityAds.UnityAdsShowError.NOT_READY.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError[UnityAds.UnityAdsShowError.VIDEO_PLAYER_ERROR.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError[UnityAds.UnityAdsShowError.INVALID_ARGUMENT.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError[UnityAds.UnityAdsShowError.NO_CONNECTION.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError[UnityAds.UnityAdsShowError.ALREADY_SHOWING.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError[UnityAds.UnityAdsShowError.INTERNAL_ERROR.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
int[] iArr2 = new int[UnityAds.UnityAdsLoadError.values().length];
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsLoadError = iArr2;
try {
iArr2[UnityAds.UnityAdsLoadError.INITIALIZE_FAILED.ordinal()] = 1;
} catch (NoSuchFieldError unused8) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsLoadError[UnityAds.UnityAdsLoadError.INTERNAL_ERROR.ordinal()] = 2;
} catch (NoSuchFieldError unused9) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsLoadError[UnityAds.UnityAdsLoadError.INVALID_ARGUMENT.ordinal()] = 3;
} catch (NoSuchFieldError unused10) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsLoadError[UnityAds.UnityAdsLoadError.NO_FILL.ordinal()] = 4;
} catch (NoSuchFieldError unused11) {
}
try {
$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsLoadError[UnityAds.UnityAdsLoadError.TIMEOUT.ordinal()] = 5;
} catch (NoSuchFieldError unused12) {
}
}
}
private static MaxAdapterError toMaxError(UnityAds.UnityAdsShowError unityAdsShowError, String str) {
MaxAdapterError maxAdapterError = MaxAdapterError.UNSPECIFIED;
switch (AnonymousClass8.$SwitchMap$com$unity3d$ads$UnityAds$UnityAdsShowError[unityAdsShowError.ordinal()]) {
case 1:
maxAdapterError = MaxAdapterError.NOT_INITIALIZED;
break;
case 2:
maxAdapterError = MaxAdapterError.AD_NOT_READY;
break;
case 3:
maxAdapterError = MaxAdapterError.WEBVIEW_ERROR;
break;
case 4:
maxAdapterError = MaxAdapterError.INVALID_CONFIGURATION;
break;
case 5:
maxAdapterError = MaxAdapterError.NO_CONNECTION;
break;
case 6:
maxAdapterError = MaxAdapterError.INVALID_LOAD_STATE;
break;
case 7:
maxAdapterError = MaxAdapterError.INTERNAL_ERROR;
break;
}
return new MaxAdapterError(maxAdapterError.getErrorCode(), maxAdapterError.getErrorMessage(), unityAdsShowError.ordinal(), str);
}
private void updatePrivacyConsent(MaxAdapterParameters maxAdapterParameters, Context context) {
MetaData metaData = new MetaData(context);
Boolean hasUserConsent = maxAdapterParameters.hasUserConsent();
if (hasUserConsent != null) {
metaData.set("gdpr.consent", hasUserConsent);
metaData.commit();
}
if (maxAdapterParameters.isDoNotSell() != null) {
metaData.set("privacy.consent", Boolean.valueOf(!r3.booleanValue()));
metaData.commit();
}
metaData.set("privacy.mode", "mixed");
metaData.commit();
}
private Context getContext(Activity activity) {
return activity != null ? activity.getApplicationContext() : getApplicationContext();
}
}

View File

@@ -0,0 +1,948 @@
package com.applovin.mediation.adapters;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.applovin.impl.sdk.utils.BundleUtils;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.adapter.MaxAdViewAdapter;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.mediation.adapter.MaxAdapterError;
import com.applovin.mediation.adapter.MaxInterstitialAdapter;
import com.applovin.mediation.adapter.MaxRewardedAdapter;
import com.applovin.mediation.adapter.MaxSignalProvider;
import com.applovin.mediation.adapter.listeners.MaxAdViewAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxAppOpenAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxInterstitialAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxNativeAdAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxRewardedAdapterListener;
import com.applovin.mediation.adapter.listeners.MaxSignalCollectionListener;
import com.applovin.mediation.adapter.parameters.MaxAdapterInitializationParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterSignalCollectionParameters;
import com.applovin.mediation.nativeAds.MaxNativeAd;
import com.applovin.mediation.nativeAds.MaxNativeAdView;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.vungle.ads.AdConfig;
import com.vungle.ads.BannerAd;
import com.vungle.ads.BannerAdListener;
import com.vungle.ads.BannerAdSize;
import com.vungle.ads.BannerView;
import com.vungle.ads.BaseAd;
import com.vungle.ads.BuildConfig;
import com.vungle.ads.InitializationListener;
import com.vungle.ads.InterstitialAd;
import com.vungle.ads.InterstitialAdListener;
import com.vungle.ads.NativeAd;
import com.vungle.ads.NativeAdListener;
import com.vungle.ads.RewardedAd;
import com.vungle.ads.RewardedAdListener;
import com.vungle.ads.VungleAds;
import com.vungle.ads.VungleError;
import com.vungle.ads.VunglePrivacySettings;
import com.vungle.ads.internal.ui.view.MediaView;
import csdk.gluads.max.EAMax;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes2.dex */
public class VungleMediationAdapter extends MediationAdapterBase implements MaxSignalProvider, MaxInterstitialAdapter, MaxRewardedAdapter, MaxAdViewAdapter {
private static MaxAdapter.InitializationStatus initializationStatus;
private static final AtomicBoolean initialized = new AtomicBoolean();
private InterstitialAd appOpenAd;
private BannerAd bannerAd;
private InterstitialAd interstitialAd;
private NativeAd nativeAd;
private RewardedAd rewardedAd;
public VungleMediationAdapter(AppLovinSdk appLovinSdk) {
super(appLovinSdk);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void initialize(MaxAdapterInitializationParameters maxAdapterInitializationParameters, Activity activity, final MaxAdapter.OnCompletionListener onCompletionListener) {
if (EAMax.adapterDisabled(getClass().getName(), onCompletionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
updateUserPrivacySettings(maxAdapterInitializationParameters);
if (initialized.compareAndSet(false, true)) {
String string = maxAdapterInitializationParameters.getServerParameters().getString("app_id", null);
log("Initializing Vungle SDK with app id: " + string + "...");
initializationStatus = MaxAdapter.InitializationStatus.INITIALIZING;
VungleAds.setIntegrationName(VungleAds.WrapperFramework.max, getAdapterVersion());
VungleAds.init(getContext(activity), string, new InitializationListener() { // from class: com.applovin.mediation.adapters.VungleMediationAdapter.1
@Override // com.vungle.ads.InitializationListener
public void onSuccess() {
VungleMediationAdapter.this.log("Vungle SDK initialized");
MaxAdapter.InitializationStatus unused = VungleMediationAdapter.initializationStatus = MaxAdapter.InitializationStatus.INITIALIZED_SUCCESS;
onCompletionListener.onCompletion(VungleMediationAdapter.initializationStatus, null);
}
@Override // com.vungle.ads.InitializationListener
public void onError(@NonNull VungleError vungleError) {
VungleMediationAdapter.initialized.set(false);
VungleMediationAdapter.this.log("Vungle SDK failed to initialize with error: ", vungleError);
MaxAdapter.InitializationStatus unused = VungleMediationAdapter.initializationStatus = MaxAdapter.InitializationStatus.INITIALIZED_FAILURE;
onCompletionListener.onCompletion(VungleMediationAdapter.initializationStatus, vungleError.getErrorMessage());
}
});
return;
}
log("Vungle SDK already initialized");
onCompletionListener.onCompletion(initializationStatus, null);
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getSdkVersion() {
return getVersionString(BuildConfig.class, "VERSION_NAME");
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public String getAdapterVersion() {
return com.applovin.mediation.adapters.vungle.BuildConfig.VERSION_NAME;
}
@Override // com.applovin.mediation.adapter.MaxAdapter
public void onDestroy() {
BannerAd bannerAd = this.bannerAd;
if (bannerAd != null) {
bannerAd.setAdListener(null);
this.bannerAd.finishAd();
this.bannerAd = null;
}
NativeAd nativeAd = this.nativeAd;
if (nativeAd != null) {
nativeAd.setAdListener(null);
this.nativeAd.unregisterView();
this.nativeAd = null;
}
InterstitialAd interstitialAd = this.interstitialAd;
if (interstitialAd != null) {
interstitialAd.setAdListener(null);
this.interstitialAd = null;
}
RewardedAd rewardedAd = this.rewardedAd;
if (rewardedAd != null) {
rewardedAd.setAdListener(null);
this.rewardedAd = null;
}
InterstitialAd interstitialAd2 = this.appOpenAd;
if (interstitialAd2 != null) {
interstitialAd2.setAdListener(null);
this.appOpenAd = null;
}
}
@Override // com.applovin.mediation.adapter.MaxSignalProvider
public void collectSignal(MaxAdapterSignalCollectionParameters maxAdapterSignalCollectionParameters, Activity activity, MaxSignalCollectionListener maxSignalCollectionListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxSignalCollectionListener)) {
throw new RuntimeException("Adapter is disabled.");
}
log("Collecting signal...");
updateUserPrivacySettings(maxAdapterSignalCollectionParameters);
maxSignalCollectionListener.onSignalCollected(VungleAds.getBiddingToken(getContext(activity)));
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void loadInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
String bidResponse = maxAdapterResponseParameters.getBidResponse();
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(isValidString ? "bidding " : "");
sb.append("interstitial ad for placement: ");
sb.append(thirdPartyAdPlacementId);
sb.append("...");
log(sb.toString());
if (shouldFailAdLoadWhenSdkNotInitialized(maxAdapterResponseParameters) && !VungleAds.isInitialized()) {
log("Vungle SDK not successfully initialized: failing interstitial ad load...");
maxInterstitialAdapterListener.onInterstitialAdLoadFailed(MaxAdapterError.NOT_INITIALIZED);
return;
}
updateUserPrivacySettings(maxAdapterResponseParameters);
InterstitialAd interstitialAd = new InterstitialAd(getContext(activity), thirdPartyAdPlacementId, new AdConfig());
this.interstitialAd = interstitialAd;
interstitialAd.setAdListener(new InterstitialListener(maxInterstitialAdapterListener));
this.interstitialAd.load(bidResponse);
}
@Override // com.applovin.mediation.adapter.MaxInterstitialAdapter
public void showInterstitialAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
InterstitialAd interstitialAd = this.interstitialAd;
if (interstitialAd != null && interstitialAd.canPlayAd().booleanValue()) {
log("Showing interstitial ad for placement: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
this.interstitialAd.play(getContext(activity));
return;
}
log("Interstitial ad is not ready: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
maxInterstitialAdapterListener.onInterstitialAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Interstitial ad is not ready"));
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxAppOpenAdapter
public void loadAppOpenAd(MaxAdapterResponseParameters maxAdapterResponseParameters, @Nullable Activity activity, MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
String bidResponse = maxAdapterResponseParameters.getBidResponse();
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(isValidString ? "bidding " : "");
sb.append("app open ad for placement: ");
sb.append(thirdPartyAdPlacementId);
sb.append("...");
log(sb.toString());
if (shouldFailAdLoadWhenSdkNotInitialized(maxAdapterResponseParameters) && !VungleAds.isInitialized()) {
log("Vungle SDK not successfully initialized: failing app open ad load...");
maxAppOpenAdapterListener.onAppOpenAdLoadFailed(MaxAdapterError.NOT_INITIALIZED);
return;
}
updateUserPrivacySettings(maxAdapterResponseParameters);
InterstitialAd interstitialAd = new InterstitialAd(getContext(activity), thirdPartyAdPlacementId, new AdConfig());
this.appOpenAd = interstitialAd;
interstitialAd.setAdListener(new AppOpenAdListener(maxAppOpenAdapterListener));
this.appOpenAd.load(bidResponse);
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxAppOpenAdapter
public void showAppOpenAd(MaxAdapterResponseParameters maxAdapterResponseParameters, @Nullable Activity activity, MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
InterstitialAd interstitialAd = this.appOpenAd;
if (interstitialAd != null && interstitialAd.canPlayAd().booleanValue()) {
log("Showing app open ad for placement: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
this.appOpenAd.play(getContext(activity));
return;
}
log("App open ad is not ready: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
maxAppOpenAdapterListener.onAppOpenAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "App open ad is not ready"));
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void loadRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
String bidResponse = maxAdapterResponseParameters.getBidResponse();
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(isValidString ? "bidding " : "");
sb.append("rewarded ad for placement: ");
sb.append(thirdPartyAdPlacementId);
sb.append("...");
log(sb.toString());
if (shouldFailAdLoadWhenSdkNotInitialized(maxAdapterResponseParameters) && !VungleAds.isInitialized()) {
log("Vungle SDK not successfully initialized: failing rewarded ad load...");
maxRewardedAdapterListener.onRewardedAdLoadFailed(MaxAdapterError.NOT_INITIALIZED);
return;
}
updateUserPrivacySettings(maxAdapterResponseParameters);
RewardedAd rewardedAd = new RewardedAd(getContext(activity), thirdPartyAdPlacementId, new AdConfig());
this.rewardedAd = rewardedAd;
rewardedAd.setAdListener(new RewardedListener(maxRewardedAdapterListener));
this.rewardedAd.load(bidResponse);
}
@Override // com.applovin.mediation.adapter.MaxRewardedAdapter
public void showRewardedAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxRewardedAdapterListener maxRewardedAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxRewardedAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
RewardedAd rewardedAd = this.rewardedAd;
if (rewardedAd != null && rewardedAd.canPlayAd().booleanValue()) {
log("Showing rewarded ad for placement: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
configureReward(maxAdapterResponseParameters);
this.rewardedAd.play(getContext(activity));
return;
}
log("Rewarded ad is not ready: " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + "...");
maxRewardedAdapterListener.onRewardedAdDisplayFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, "Ad Display Failed", 0, "Rewarded ad is not ready"));
}
@Override // com.applovin.mediation.adapter.MaxAdViewAdapter
public void loadAdViewAd(MaxAdapterResponseParameters maxAdapterResponseParameters, MaxAdFormat maxAdFormat, Activity activity, MaxAdViewAdapterListener maxAdViewAdapterListener) {
String bidResponse = maxAdapterResponseParameters.getBidResponse();
String label = maxAdFormat.getLabel();
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
Context context = getContext(activity);
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
boolean z = maxAdapterResponseParameters.getServerParameters().getBoolean("is_native");
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(isValidString ? "bidding " : "");
sb.append(z ? "native " : "");
sb.append(label);
sb.append(" ad for placement: ");
sb.append(thirdPartyAdPlacementId);
sb.append("...");
log(sb.toString());
if (shouldFailAdLoadWhenSdkNotInitialized(maxAdapterResponseParameters) && !VungleAds.isInitialized()) {
log("Vungle SDK not successfully initialized: failing " + label + " ad load...");
maxAdViewAdapterListener.onAdViewAdLoadFailed(MaxAdapterError.NOT_INITIALIZED);
return;
}
updateUserPrivacySettings(maxAdapterResponseParameters);
if (z) {
NativeAdViewListener nativeAdViewListener = new NativeAdViewListener(maxAdapterResponseParameters, maxAdFormat, context, maxAdViewAdapterListener);
NativeAd nativeAd = new NativeAd(activity, thirdPartyAdPlacementId);
this.nativeAd = nativeAd;
nativeAd.setAdListener(nativeAdViewListener);
this.nativeAd.load(bidResponse);
return;
}
BannerAd bannerAd = new BannerAd(context, thirdPartyAdPlacementId, vungleAdSize(maxAdFormat));
this.bannerAd = bannerAd;
bannerAd.setAdListener(new AdViewAdListener(label, maxAdViewAdapterListener));
this.bannerAd.load(bidResponse);
}
@Override // com.applovin.mediation.adapters.MediationAdapterBase, com.applovin.mediation.adapter.MaxNativeAdAdapter
public void loadNativeAd(MaxAdapterResponseParameters maxAdapterResponseParameters, Activity activity, MaxNativeAdAdapterListener maxNativeAdAdapterListener) {
String bidResponse = maxAdapterResponseParameters.getBidResponse();
boolean isValidString = AppLovinSdkUtils.isValidString(bidResponse);
String thirdPartyAdPlacementId = maxAdapterResponseParameters.getThirdPartyAdPlacementId();
StringBuilder sb = new StringBuilder();
sb.append("Loading ");
sb.append(isValidString ? "bidding " : "");
sb.append("native ad for placement: ");
sb.append(thirdPartyAdPlacementId);
sb.append("...");
log(sb.toString());
if (shouldFailAdLoadWhenSdkNotInitialized(maxAdapterResponseParameters) && !VungleAds.isInitialized()) {
log("Vungle SDK not successfully initialized: failing interstitial ad load...");
maxNativeAdAdapterListener.onNativeAdLoadFailed(MaxAdapterError.NOT_INITIALIZED);
return;
}
updateUserPrivacySettings(maxAdapterResponseParameters);
NativeAd nativeAd = new NativeAd(activity, thirdPartyAdPlacementId);
this.nativeAd = nativeAd;
nativeAd.setAdListener(new NativeListener(maxAdapterResponseParameters, getContext(activity), maxNativeAdAdapterListener));
this.nativeAd.load(bidResponse);
}
private boolean shouldFailAdLoadWhenSdkNotInitialized(MaxAdapterResponseParameters maxAdapterResponseParameters) {
return maxAdapterResponseParameters.getServerParameters().getBoolean("fail_ad_load_when_sdk_not_initialized", true);
}
private void updateUserPrivacySettings(MaxAdapterParameters maxAdapterParameters) {
Boolean hasUserConsent = maxAdapterParameters.hasUserConsent();
if (hasUserConsent != null) {
VunglePrivacySettings.setGDPRStatus(hasUserConsent.booleanValue(), "");
}
if (maxAdapterParameters.isDoNotSell() != null) {
VunglePrivacySettings.setCCPAStatus(!r3.booleanValue());
}
}
private static BannerAdSize vungleAdSize(MaxAdFormat maxAdFormat) {
if (maxAdFormat == MaxAdFormat.BANNER) {
return BannerAdSize.BANNER;
}
if (maxAdFormat == MaxAdFormat.LEADER) {
return BannerAdSize.BANNER_LEADERBOARD;
}
if (maxAdFormat == MaxAdFormat.MREC) {
return BannerAdSize.VUNGLE_MREC;
}
throw new IllegalArgumentException("Unsupported ad view ad format: " + maxAdFormat.getLabel());
}
private Context getContext(@Nullable Activity activity) {
return activity != null ? activity.getApplicationContext() : getApplicationContext();
}
/* JADX INFO: Access modifiers changed from: private */
public List<View> getClickableViews(MaxNativeAdView maxNativeAdView) {
ArrayList arrayList = new ArrayList(6);
if (maxNativeAdView.getTitleTextView() != null) {
arrayList.add(maxNativeAdView.getTitleTextView());
}
if (maxNativeAdView.getAdvertiserTextView() != null) {
arrayList.add(maxNativeAdView.getAdvertiserTextView());
}
if (maxNativeAdView.getBodyTextView() != null) {
arrayList.add(maxNativeAdView.getBodyTextView());
}
if (maxNativeAdView.getCallToActionButton() != null) {
arrayList.add(maxNativeAdView.getCallToActionButton());
}
if (maxNativeAdView.getIconImageView() != null) {
arrayList.add(maxNativeAdView.getIconImageView());
}
if (maxNativeAdView.getMediaContentViewGroup() != null) {
arrayList.add(maxNativeAdView.getMediaContentViewGroup());
}
return arrayList;
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Removed duplicated region for block: B:22:0x0031 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static com.applovin.mediation.adapter.MaxAdapterError toMaxError(com.vungle.ads.VungleError r4) {
/*
int r0 = r4.getCode()
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.UNSPECIFIED
if (r0 == 0) goto L4b
r2 = 6
if (r0 == r2) goto L49
r2 = 2
if (r0 == r2) goto L46
r2 = 3
if (r0 == r2) goto L49
r2 = 10010(0x271a, float:1.4027E-41)
if (r0 == r2) goto L43
r2 = 10011(0x271b, float:1.4028E-41)
if (r0 == r2) goto L40
r2 = 10019(0x2723, float:1.404E-41)
if (r0 == r2) goto L46
r2 = 10020(0x2724, float:1.4041E-41)
if (r0 == r2) goto L40
switch(r0) {
case 6: goto L49;
case 113: goto L43;
case 130: goto L43;
case 207: goto L46;
case 304: goto L3d;
case 3001: goto L43;
case 10001: goto L3a;
case 10003: goto L46;
case 10024: goto L40;
case 10028: goto L46;
case 10038: goto L40;
case 10047: goto L37;
default: goto L24;
}
L24:
switch(r0) {
case 10013: goto L46;
case 10014: goto L34;
case 10015: goto L31;
default: goto L27;
}
L27:
switch(r0) {
case 10031: goto L2e;
case 10032: goto L2e;
case 10033: goto L40;
case 10034: goto L46;
case 10035: goto L46;
default: goto L2a;
}
L2a:
switch(r0) {
case 10040: goto L43;
case 10041: goto L43;
case 10042: goto L31;
default: goto L2d;
}
L2d:
goto L4b
L2e:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.WEBVIEW_ERROR
goto L4b
L31:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.INVALID_LOAD_STATE
goto L4b
L34:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.SERVER_ERROR
goto L4b
L37:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.TIMEOUT
goto L4b
L3a:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.NO_FILL
goto L4b
L3d:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.AD_EXPIRED
goto L4b
L40:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.NO_CONNECTION
goto L4b
L43:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.INTERNAL_ERROR
goto L4b
L46:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.INVALID_CONFIGURATION
goto L4b
L49:
com.applovin.mediation.adapter.MaxAdapterError r1 = com.applovin.mediation.adapter.MaxAdapterError.NOT_INITIALIZED
L4b:
com.applovin.mediation.adapter.MaxAdapterError r2 = new com.applovin.mediation.adapter.MaxAdapterError
int r3 = r1.getErrorCode()
java.lang.String r1 = r1.getErrorMessage()
java.lang.String r4 = r4.getLocalizedMessage()
r2.<init>(r3, r1, r0, r4)
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.applovin.mediation.adapters.VungleMediationAdapter.toMaxError(com.vungle.ads.VungleError):com.applovin.mediation.adapter.MaxAdapterError");
}
/* JADX INFO: Access modifiers changed from: private */
@Nullable
public Bundle maybeCreateExtraInfoBundle(BaseAd baseAd) {
String creativeId = baseAd.getCreativeId();
if (TextUtils.isEmpty(creativeId)) {
return null;
}
Bundle bundle = new Bundle(1);
bundle.putString(CampaignEx.JSON_KEY_CREATIVE_ID, creativeId);
return bundle;
}
public class InterstitialListener implements InterstitialAdListener {
private final MaxInterstitialAdapterListener listener;
public InterstitialListener(MaxInterstitialAdapterListener maxInterstitialAdapterListener) {
if (EAMax.adapterDisabled(getClass().getName(), maxInterstitialAdapterListener)) {
throw new RuntimeException("Adapter is disabled.");
}
this.listener = maxInterstitialAdapterListener;
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLoaded(BaseAd baseAd) {
VungleMediationAdapter.this.log("Interstitial ad loaded");
this.listener.onInterstitialAdLoaded(VungleMediationAdapter.this.maybeCreateExtraInfoBundle(baseAd));
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToLoad(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("Interstitial ad failed to load with error: " + maxError);
this.listener.onInterstitialAdLoadFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdStart(BaseAd baseAd) {
VungleMediationAdapter.this.log("Interstitial ad started");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdImpression(BaseAd baseAd) {
VungleMediationAdapter.this.log("Interstitial ad displayed");
this.listener.onInterstitialAdDisplayed();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToPlay(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("Interstitial ad failed to display with error: " + maxError);
this.listener.onInterstitialAdDisplayFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdClicked(BaseAd baseAd) {
VungleMediationAdapter.this.log("Interstitial ad clicked");
this.listener.onInterstitialAdClicked();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLeftApplication(BaseAd baseAd) {
VungleMediationAdapter.this.log("Interstitial ad left application");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdEnd(BaseAd baseAd) {
VungleMediationAdapter.this.log("Interstitial ad hidden");
this.listener.onInterstitialAdHidden();
}
}
public class AppOpenAdListener implements InterstitialAdListener {
private final MaxAppOpenAdapterListener listener;
public AppOpenAdListener(MaxAppOpenAdapterListener maxAppOpenAdapterListener) {
this.listener = maxAppOpenAdapterListener;
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLoaded(BaseAd baseAd) {
VungleMediationAdapter.this.log("App Open ad loaded");
this.listener.onAppOpenAdLoaded(VungleMediationAdapter.this.maybeCreateExtraInfoBundle(baseAd));
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToLoad(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("App Open ad failed to load with error: " + maxError);
this.listener.onAppOpenAdLoadFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdStart(BaseAd baseAd) {
VungleMediationAdapter.this.log("App Open ad started");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdImpression(BaseAd baseAd) {
VungleMediationAdapter.this.log("App Open ad displayed");
this.listener.onAppOpenAdDisplayed();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToPlay(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("App Open ad failed to display with error: " + maxError);
this.listener.onAppOpenAdDisplayFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdClicked(BaseAd baseAd) {
VungleMediationAdapter.this.log("App Open ad clicked");
this.listener.onAppOpenAdClicked();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLeftApplication(BaseAd baseAd) {
VungleMediationAdapter.this.log("App Open ad left application");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdEnd(BaseAd baseAd) {
VungleMediationAdapter.this.log("App Open ad hidden");
this.listener.onAppOpenAdHidden();
}
}
public class RewardedListener implements RewardedAdListener {
private boolean hasGrantedReward;
private final MaxRewardedAdapterListener listener;
public RewardedListener(MaxRewardedAdapterListener maxRewardedAdapterListener) {
this.listener = maxRewardedAdapterListener;
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLoaded(BaseAd baseAd) {
VungleMediationAdapter.this.log("Rewarded ad loaded");
this.listener.onRewardedAdLoaded(VungleMediationAdapter.this.maybeCreateExtraInfoBundle(baseAd));
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToLoad(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("Rewarded ad failed to load with error: " + maxError);
this.listener.onRewardedAdLoadFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdStart(BaseAd baseAd) {
VungleMediationAdapter.this.log("Rewarded ad started");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdImpression(BaseAd baseAd) {
VungleMediationAdapter.this.log("Rewarded ad displayed");
this.listener.onRewardedAdDisplayed();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToPlay(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("Rewarded ad failed to display with error: " + maxError);
this.listener.onRewardedAdDisplayFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdClicked(BaseAd baseAd) {
VungleMediationAdapter.this.log("Rewarded ad clicked");
this.listener.onRewardedAdClicked();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLeftApplication(BaseAd baseAd) {
VungleMediationAdapter.this.log("Rewarded ad left application");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdEnd(BaseAd baseAd) {
VungleMediationAdapter.this.log("Rewarded ad video completed");
if (this.hasGrantedReward || VungleMediationAdapter.this.shouldAlwaysRewardUser()) {
MaxReward reward = VungleMediationAdapter.this.getReward();
VungleMediationAdapter.this.log("Rewarded user with reward: " + reward);
this.listener.onUserRewarded(reward);
}
VungleMediationAdapter.this.log("Rewarded ad hidden");
this.listener.onRewardedAdHidden();
}
@Override // com.vungle.ads.RewardedAdListener
public void onAdRewarded(BaseAd baseAd) {
VungleMediationAdapter.this.log("User was rewarded");
this.hasGrantedReward = true;
}
}
public class AdViewAdListener implements BannerAdListener {
private final String adFormatLabel;
private final MaxAdViewAdapterListener listener;
public AdViewAdListener(String str, MaxAdViewAdapterListener maxAdViewAdapterListener) {
this.adFormatLabel = str;
this.listener = maxAdViewAdapterListener;
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLoaded(BaseAd baseAd) {
VungleMediationAdapter.this.log("Showing " + this.adFormatLabel + " ad for placement: " + baseAd.getPlacementId() + "...");
if (VungleMediationAdapter.this.bannerAd != null && VungleMediationAdapter.this.bannerAd.getBannerView() != null) {
BannerView bannerView = VungleMediationAdapter.this.bannerAd.getBannerView();
bannerView.setGravity(17);
VungleMediationAdapter.this.log(this.adFormatLabel + " ad loaded");
this.listener.onAdViewAdLoaded(bannerView, VungleMediationAdapter.this.maybeCreateExtraInfoBundle(baseAd));
return;
}
MaxAdapterError maxAdapterError = MaxAdapterError.INVALID_LOAD_STATE;
VungleMediationAdapter.this.log(this.adFormatLabel + " ad failed to load: " + maxAdapterError);
this.listener.onAdViewAdLoadFailed(maxAdapterError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToLoad(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log(this.adFormatLabel + " ad failed to load with error: " + maxError);
this.listener.onAdViewAdLoadFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdStart(BaseAd baseAd) {
VungleMediationAdapter.this.log(this.adFormatLabel + " ad started");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdImpression(BaseAd baseAd) {
VungleMediationAdapter.this.log(this.adFormatLabel + " ad displayed");
this.listener.onAdViewAdDisplayed();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToPlay(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log(this.adFormatLabel + " ad display failed with error: " + maxError);
this.listener.onAdViewAdDisplayFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdClicked(BaseAd baseAd) {
VungleMediationAdapter.this.log(this.adFormatLabel + " ad clicked");
this.listener.onAdViewAdClicked();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLeftApplication(BaseAd baseAd) {
VungleMediationAdapter.this.log(this.adFormatLabel + " ad left application");
}
@Override // com.vungle.ads.BaseAdListener
public void onAdEnd(BaseAd baseAd) {
VungleMediationAdapter.this.log(this.adFormatLabel + " ad hidden");
this.listener.onAdViewAdHidden();
}
}
public class NativeAdViewListener implements NativeAdListener {
private final MaxAdFormat adFormat;
private final Context applicationContext;
private final MaxAdViewAdapterListener listener;
private final Bundle serverParameters;
public NativeAdViewListener(MaxAdapterResponseParameters maxAdapterResponseParameters, MaxAdFormat maxAdFormat, Context context, MaxAdViewAdapterListener maxAdViewAdapterListener) {
this.serverParameters = maxAdapterResponseParameters.getServerParameters();
this.adFormat = maxAdFormat;
this.applicationContext = context;
this.listener = maxAdViewAdapterListener;
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLoaded(BaseAd baseAd) {
MaxNativeAdView maxNativeAdView;
if (VungleMediationAdapter.this.nativeAd != null && VungleMediationAdapter.this.nativeAd == baseAd) {
if (TextUtils.isEmpty(VungleMediationAdapter.this.nativeAd.getAdTitle())) {
VungleMediationAdapter.this.e("Native " + this.adFormat.getLabel() + " ad (" + VungleMediationAdapter.this.nativeAd + ") does not have required assets.");
this.listener.onAdViewAdLoadFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_MISSING_REQUIRED_NATIVE_AD_ASSETS, "Missing Native Ad Assets"));
return;
}
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad loaded: " + VungleMediationAdapter.this.nativeAd.getPlacementId());
MaxVungleNativeAd maxVungleNativeAd = VungleMediationAdapter.this.new MaxVungleNativeAd(new MaxNativeAd.Builder().setAdFormat(this.adFormat).setTitle(VungleMediationAdapter.this.nativeAd.getAdTitle()).setAdvertiser(VungleMediationAdapter.this.nativeAd.getAdSponsoredText()).setBody(VungleMediationAdapter.this.nativeAd.getAdBodyText()).setCallToAction(VungleMediationAdapter.this.nativeAd.getAdCallToActionText()).setIcon(new MaxNativeAd.MaxNativeAdImage(Uri.parse(VungleMediationAdapter.this.nativeAd.getAppIcon()))).setMediaView(new MediaView(this.applicationContext)));
String string = BundleUtils.getString("template", "", this.serverParameters);
if (string.contains("vertical")) {
if (string.equals("vertical")) {
maxNativeAdView = new MaxNativeAdView(maxVungleNativeAd, this.adFormat == MaxAdFormat.LEADER ? "vertical_leader_template" : "vertical_media_banner_template", this.applicationContext);
} else {
maxNativeAdView = new MaxNativeAdView(maxVungleNativeAd, string, this.applicationContext);
}
} else {
if (!AppLovinSdkUtils.isValidString(string)) {
string = "media_banner_template";
}
maxNativeAdView = new MaxNativeAdView(maxVungleNativeAd, string, this.applicationContext);
}
maxVungleNativeAd.prepareForInteraction(VungleMediationAdapter.this.getClickableViews(maxNativeAdView), maxNativeAdView);
this.listener.onAdViewAdLoaded(maxNativeAdView, VungleMediationAdapter.this.maybeCreateExtraInfoBundle(baseAd));
return;
}
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad failed to load: no fill");
this.listener.onAdViewAdLoadFailed(MaxAdapterError.NO_FILL);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToLoad(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad failed to load with error " + maxError + " with placement id: " + baseAd.getPlacementId());
this.listener.onAdViewAdLoadFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdStart(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad start with placement id: " + baseAd.getPlacementId());
}
@Override // com.vungle.ads.BaseAdListener
public void onAdImpression(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad shown with placement id: " + baseAd.getPlacementId());
this.listener.onAdViewAdDisplayed();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToPlay(BaseAd baseAd, VungleError vungleError) {
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad failed to play with error " + VungleMediationAdapter.toMaxError(vungleError) + " with placement id: " + baseAd.getPlacementId());
}
@Override // com.vungle.ads.BaseAdListener
public void onAdClicked(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad clicked with placement id: " + baseAd.getPlacementId());
this.listener.onAdViewAdClicked();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLeftApplication(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad left application with placement id: " + baseAd.getPlacementId());
}
@Override // com.vungle.ads.BaseAdListener
public void onAdEnd(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native " + this.adFormat.getLabel() + " ad end with placement id: " + baseAd.getPlacementId());
}
}
public class NativeListener implements NativeAdListener {
private final Context applicationContext;
private final MaxNativeAdAdapterListener listener;
private final Bundle serverParameters;
public NativeListener(MaxAdapterResponseParameters maxAdapterResponseParameters, Context context, MaxNativeAdAdapterListener maxNativeAdAdapterListener) {
this.serverParameters = maxAdapterResponseParameters.getServerParameters();
this.applicationContext = context;
this.listener = maxNativeAdAdapterListener;
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLoaded(BaseAd baseAd) {
if (VungleMediationAdapter.this.nativeAd == null || VungleMediationAdapter.this.nativeAd != baseAd) {
VungleMediationAdapter.this.log("Native ad failed to load: no fill");
this.listener.onNativeAdLoadFailed(MaxAdapterError.NO_FILL);
return;
}
if (AppLovinSdkUtils.isValidString(BundleUtils.getString("template", "", this.serverParameters)) && TextUtils.isEmpty(VungleMediationAdapter.this.nativeAd.getAdTitle())) {
VungleMediationAdapter.this.e("Native ad (" + VungleMediationAdapter.this.nativeAd + ") does not have required assets.");
this.listener.onNativeAdLoadFailed(new MaxAdapterError(MaxAdapterError.ERROR_CODE_MISSING_REQUIRED_NATIVE_AD_ASSETS, "Missing Native Ad Assets"));
return;
}
VungleMediationAdapter.this.log("Native ad loaded: " + VungleMediationAdapter.this.nativeAd.getPlacementId());
this.listener.onNativeAdLoaded(VungleMediationAdapter.this.new MaxVungleNativeAd(new MaxNativeAd.Builder().setAdFormat(MaxAdFormat.NATIVE).setTitle(VungleMediationAdapter.this.nativeAd.getAdTitle()).setAdvertiser(VungleMediationAdapter.this.nativeAd.getAdSponsoredText()).setBody(VungleMediationAdapter.this.nativeAd.getAdBodyText()).setCallToAction(VungleMediationAdapter.this.nativeAd.getAdCallToActionText()).setIcon(new MaxNativeAd.MaxNativeAdImage(Uri.parse(VungleMediationAdapter.this.nativeAd.getAppIcon()))).setMediaView(new MediaView(this.applicationContext))), VungleMediationAdapter.this.maybeCreateExtraInfoBundle(baseAd));
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToLoad(BaseAd baseAd, VungleError vungleError) {
MaxAdapterError maxError = VungleMediationAdapter.toMaxError(vungleError);
VungleMediationAdapter.this.log("Native ad failed to load with error " + maxError + " with placement id: " + baseAd.getPlacementId());
this.listener.onNativeAdLoadFailed(maxError);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdStart(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native ad start with placement id: " + baseAd.getPlacementId());
}
@Override // com.vungle.ads.BaseAdListener
public void onAdImpression(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native ad shown with placement id: " + baseAd.getPlacementId());
this.listener.onNativeAdDisplayed(null);
}
@Override // com.vungle.ads.BaseAdListener
public void onAdFailedToPlay(BaseAd baseAd, VungleError vungleError) {
VungleMediationAdapter.this.log("Native ad failed to play with error " + VungleMediationAdapter.toMaxError(vungleError) + " with placement id: " + baseAd.getPlacementId());
}
@Override // com.vungle.ads.BaseAdListener
public void onAdClicked(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native ad clicked with placement id: " + baseAd.getPlacementId());
this.listener.onNativeAdClicked();
}
@Override // com.vungle.ads.BaseAdListener
public void onAdLeftApplication(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native ad left application with placement id: " + baseAd.getPlacementId());
}
@Override // com.vungle.ads.BaseAdListener
public void onAdEnd(BaseAd baseAd) {
VungleMediationAdapter.this.log("Native ad end with placement id: " + baseAd.getPlacementId());
}
}
public class MaxVungleNativeAd extends MaxNativeAd {
public MaxVungleNativeAd(MaxNativeAd.Builder builder) {
super(builder);
}
@Override // com.applovin.mediation.nativeAds.MaxNativeAd
public boolean prepareForInteraction(List<View> list, ViewGroup viewGroup) {
NativeAd nativeAd = VungleMediationAdapter.this.nativeAd;
if (nativeAd == null) {
VungleMediationAdapter.this.e("Failed to register native ad views: native ad is null.");
return false;
}
if (!nativeAd.canPlayAd().booleanValue()) {
VungleMediationAdapter.this.e("Failed to play native ad or native ad is registered.");
return false;
}
View mediaView = getMediaView();
if (mediaView == null) {
VungleMediationAdapter.this.e("Failed to register native ad views: mediaView is null.");
return false;
}
if (mediaView.getParent() != null) {
((ViewGroup) mediaView.getParent()).removeView(mediaView);
}
MaxNativeAdView maxNativeAdView = (MaxNativeAdView) viewGroup;
ViewGroup mediaContentViewGroup = maxNativeAdView.getMediaContentViewGroup();
if (mediaContentViewGroup != null) {
mediaContentViewGroup.removeAllViews();
mediaContentViewGroup.addView(mediaView);
}
nativeAd.registerViewForInteraction(maxNativeAdView, (MediaView) mediaView, maxNativeAdView.getIconImageView(), list);
return true;
}
}
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.facebook;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "6.17.0.1";
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.google;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "23.3.0.1";
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.googleadmanager;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "23.3.0.1";
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.inneractive;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "8.3.1.1";
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.ironsource;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "8.3.0.0.2";
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.mintegral;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "16.8.51.1";
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.unityads;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "4.12.2.1";
}

View File

@@ -0,0 +1,6 @@
package com.applovin.mediation.adapters.vungle;
/* loaded from: classes2.dex */
public class BuildConfig {
public static String VERSION_NAME = "7.4.1.1";
}