正在查看: Barstool v5.21.2 应用的 ApsAdController.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Barstool v5.21.2 应用的 ApsAdController.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.amazon.aps.ads;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.ViewGroup;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.amazon.aps.ads.activity.ApsInterstitialActivity;
import com.amazon.aps.ads.listeners.ApsAdListener;
import com.amazon.aps.ads.model.ApsAdFormat;
import com.amazon.aps.shared.APSAnalytics;
import com.amazon.aps.shared.analytics.APSEventSeverity;
import com.amazon.aps.shared.analytics.APSEventType;
import com.amazon.device.ads.AdType;
import com.amazon.device.ads.DTBAdMRAIDController;
import com.amazon.device.ads.DtbOmSdkSessionManager;
import java.lang.ref.WeakReference;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
@Metadata(d1 = {"\u0000c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0010\b\u0016\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u000e\u0010\u001a\u001a\u00020\u001b2\u0006\u0010\u001c\u001a\u00020\u001dJ\u000e\u0010\u001e\u001a\u00020\u001b2\u0006\u0010\f\u001a\u00020\rJ\u001e\u0010\u001f\u001a\u00020\u001b2\u0006\u0010 \u001a\u00020!2\u0006\u0010\"\u001a\u00020#2\u0006\u0010$\u001a\u00020#J\u0010\u0010\u001f\u001a\u00020\u001b2\u0006\u0010\f\u001a\u00020\rH\u0002J\u001e\u0010\u001f\u001a\u00020\u001b2\u0006\u0010%\u001a\u00020\b2\u0006\u0010\"\u001a\u00020#2\u0006\u0010$\u001a\u00020#J\u000e\u0010&\u001a\u00020\u001b2\u0006\u0010 \u001a\u00020!J\u0010\u0010&\u001a\u00020\u001b2\u0006\u0010\f\u001a\u00020\rH\u0002J\u000e\u0010&\u001a\u00020\u001b2\u0006\u0010%\u001a\u00020\bJ\u000e\u0010'\u001a\u00020\u001b2\u0006\u0010%\u001a\u00020\bJ\u0014\u0010(\u001a\u00020\u001b2\f\u0010)\u001a\b\u0012\u0004\u0012\u00020\u001b0*J\u0006\u0010+\u001a\u00020\u001bJ\b\u0010,\u001a\u00020\u001bH\u0002R\u0014\u0010\u0007\u001a\u00020\bX\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\nR\u0010\u0010\u000b\u001a\u0004\u0018\u00010\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\rX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u000f\u001a\u00020\u0010X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0011R\u001e\u0010\u0014\u001a\u00020\u00132\u0006\u0010\u0012\u001a\u00020\u0013@BX\u0086.¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u001e\u0010\u0018\u001a\u00020\u00172\u0006\u0010\u0012\u001a\u00020\u0017@BX\u0086\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u0018\u0010\u0019¨\u0006-"}, d2 = {"Lcom/amazon/aps/ads/ApsAdController;", "", "context", "Landroid/content/Context;", "listener", "Lcom/amazon/aps/ads/listeners/ApsAdListener;", "(Landroid/content/Context;Lcom/amazon/aps/ads/listeners/ApsAdListener;)V", "HTTPS_WEB_URL", "", "getHTTPS_WEB_URL", "()Ljava/lang/String;", "TAG", "apsAd", "Lcom/amazon/aps/ads/ApsAd;", "apsAdListener", "apsAdListenerInternal", "com/amazon/aps/ads/ApsAdController$apsAdListenerInternal$1", "Lcom/amazon/aps/ads/ApsAdController$apsAdListenerInternal$1;", "<set-?>", "Lcom/amazon/aps/ads/ApsAdView;", "apsAdView", "getApsAdView", "()Lcom/amazon/aps/ads/ApsAdView;", "", "isAdAvailable", "()Z", "addInViewGroup", "", "parent", "Landroid/view/ViewGroup;", "fetchAd", "fetchBannerAd", "extraInfo", "Landroid/os/Bundle;", "width", "", "height", "extraInfoAsString", "fetchInterstitialAd", "fetchRewardedAd", "safeCall", "action", "Lkotlin/Function0;", "show", "startOMSDKSession", "DTBAndroidSDK_release"}, k = 1, mv = {1, 6, 0}, xi = ConstraintLayout.LayoutParams.Table.LAYOUT_CONSTRAINT_VERTICAL_CHAINSTYLE)
public class ApsAdController {
private final String HTTPS_WEB_URL;
private final String TAG;
private ApsAd apsAd;
private final ApsAdListener apsAdListener;
private final ApsAdController$apsAdListenerInternal$1 apsAdListenerInternal;
private ApsAdView apsAdView;
private final Context context;
private boolean isAdAvailable;
@Metadata(k = 3, mv = {1, 6, 0}, xi = ConstraintLayout.LayoutParams.Table.LAYOUT_CONSTRAINT_VERTICAL_CHAINSTYLE)
public class WhenMappings {
public static final int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[ApsAdFormat.values().length];
iArr[ApsAdFormat.LEADERBOARD.ordinal()] = 1;
iArr[ApsAdFormat.MREC.ordinal()] = 2;
iArr[ApsAdFormat.BANNER_SMART.ordinal()] = 3;
iArr[ApsAdFormat.BANNER.ordinal()] = 4;
iArr[ApsAdFormat.REWARDED_VIDEO.ordinal()] = 5;
iArr[ApsAdFormat.INTERSTITIAL.ordinal()] = 6;
iArr[ApsAdFormat.INSTREAM_VIDEO.ordinal()] = 7;
$EnumSwitchMapping$0 = iArr;
}
}
public ApsAdController(Context context, ApsAdListener apsAdListener) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(apsAdListener, "listener");
this.context = context;
this.HTTPS_WEB_URL = "https://c.amazon-adsystem.com/";
this.TAG = Reflection.getOrCreateKotlinClass(getClass()).getSimpleName();
this.apsAdListener = apsAdListener;
ApsAdUtils.checkNullAndLogInvalidArg(context, apsAdListener);
this.apsAdListenerInternal = new ApsAdListener() {
@Override
public void onAdLoaded(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5869invoke();
return Unit.INSTANCE;
}
public final void m5869invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onAdLoaded called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onAdLoaded(apsAd);
}
});
}
@Override
public void onAdFailedToLoad(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5868invoke();
return Unit.INSTANCE;
}
public final void m5868invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onAdFailedToLoad called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onAdFailedToLoad(apsAd);
}
});
}
@Override
public void onAdClicked(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5865invoke();
return Unit.INSTANCE;
}
public final void m5865invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onAdClicked called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onAdClicked(apsAd);
}
});
}
@Override
public void onImpressionFired(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5871invoke();
return Unit.INSTANCE;
}
public final void m5871invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onImpressionFired called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onImpressionFired(apsAd);
}
});
}
@Override
public void onAdError(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5867invoke();
return Unit.INSTANCE;
}
public final void m5867invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onAdError called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onAdError(apsAd);
}
});
}
@Override
public void onAdOpen(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5870invoke();
return Unit.INSTANCE;
}
public final void m5870invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onAdOpen called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onAdOpen(apsAd);
}
});
}
@Override
public void onAdClosed(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5866invoke();
return Unit.INSTANCE;
}
public final void m5866invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onAdClosed called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onAdClosed(apsAd);
}
});
}
@Override
public void onVideoCompleted(final ApsAd apsAd) {
ApsAdController apsAdController = ApsAdController.this;
final ApsAdController apsAdController2 = ApsAdController.this;
apsAdController.safeCall(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m5872invoke();
return Unit.INSTANCE;
}
public final void m5872invoke() {
String str;
ApsAdListener apsAdListener2;
str = ApsAdController.this.TAG;
ApsLog.d(str, "onVideoCompleted called");
apsAdListener2 = ApsAdController.this.apsAdListener;
apsAdListener2.onVideoCompleted(apsAd);
}
});
}
};
}
public final String getHTTPS_WEB_URL() {
return this.HTTPS_WEB_URL;
}
public final ApsAdView getApsAdView() {
ApsAdView apsAdView = this.apsAdView;
if (apsAdView != null) {
return apsAdView;
}
Intrinsics.throwUninitializedPropertyAccessException("apsAdView");
return null;
}
public final boolean getIsAdAvailable() {
return this.isAdAvailable;
}
public final void fetchAd(ApsAd apsAd) {
Intrinsics.checkNotNullParameter(apsAd, "apsAd");
ApsAdUtils.checkNullAndLogInvalidArg(apsAd);
try {
this.apsAd = apsAd;
ApsAdFormat apsAdFormat = apsAd.getApsAdFormat();
switch (apsAdFormat == null ? -1 : WhenMappings.$EnumSwitchMapping$0[apsAdFormat.ordinal()]) {
case 1:
case 2:
case 3:
case 4:
fetchBannerAd(apsAd);
break;
case 5:
case 6:
fetchInterstitialAd(apsAd);
break;
case 7:
ApsAdUtils.throwExceptionOrRemoteLog("InStream video adFormat not supported");
break;
}
} catch (RuntimeException e) {
APSAnalytics.logEvent(APSEventSeverity.FATAL, APSEventType.EXCEPTION, "API failure:ApsAdController - fetchAd", e);
}
}
public final void show() {
try {
if (getApsAdView().getMraidHandler() == null) {
APSAnalytics.logEvent(APSEventSeverity.FATAL, APSEventType.EXCEPTION, "There is no controller before showing the interstitial ad");
return;
}
DTBAdMRAIDController mraidHandler = getApsAdView().getMraidHandler();
if (mraidHandler != null) {
mraidHandler.startOMSDKSession();
}
ApsLog.d(this.TAG, "Starting the Aps interstitial activity");
ApsInterstitialActivity.INSTANCE.setAdViewRefPassed(new WeakReference<>(getApsAdView()));
this.context.startActivity(new Intent(this.context, (Class<?>) ApsInterstitialActivity.class));
ApsLog.d(this.TAG, "Sending the ApsAdView in live data");
} catch (RuntimeException e) {
APSAnalytics.logEvent(APSEventSeverity.FATAL, APSEventType.EXCEPTION, "API failure:ApsAdController - show", e);
}
}
private final void startOMSDKSession() {
try {
DtbOmSdkSessionManager omSdkManager = getApsAdView().getOmSdkManager();
if (omSdkManager == null) {
return;
}
if (!getApsAdView().getIsVideo()) {
omSdkManager.initHtmlDisplayOmAdSession(getApsAdView(), getHTTPS_WEB_URL());
} else {
omSdkManager.initJavaScriptOmAdSession(getApsAdView(), getHTTPS_WEB_URL());
}
omSdkManager.registerAdView(getApsAdView());
omSdkManager.startAdSession();
omSdkManager.displayAdEventLoaded();
} catch (RuntimeException e) {
APSAnalytics.logEvent(APSEventSeverity.FATAL, APSEventType.EXCEPTION, "Unable to start OM SDK session for Interstitial ad", e);
}
}
public final void addInViewGroup(ViewGroup parent) {
Intrinsics.checkNotNullParameter(parent, "parent");
try {
ApsAd apsAd = this.apsAd;
if (apsAd != null) {
if (apsAd == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
}
ApsAd apsAd2 = this.apsAd;
ApsAd apsAd3 = null;
if (apsAd2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
apsAd2 = null;
}
if (apsAd2.getAdView() != null) {
ApsAd apsAd4 = this.apsAd;
if (apsAd4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
} else {
apsAd3 = apsAd4;
}
parent.addView(apsAd3.getAdView());
}
}
} catch (RuntimeException e) {
APSAnalytics.logEvent(APSEventSeverity.FATAL, APSEventType.EXCEPTION, "API failure:ApsAdController - addInViewGroup", e);
}
}
private final void fetchInterstitialAd(ApsAd apsAd) {
this.apsAdView = new ApsAdView(this.context, ApsAdFormat.INTERSTITIAL, this.apsAdListenerInternal);
getApsAdView().setApsAd(apsAd);
getApsAdView().fetchAd(apsAd.getBidInfo(), apsAd.getRenderingBundle());
apsAd.setAdView(getApsAdView());
}
private final void fetchBannerAd(ApsAd apsAd) {
this.apsAdView = new ApsAdView(this.context, ApsAdFormat.BANNER, this.apsAdListenerInternal);
getApsAdView().fetchAd(apsAd);
}
public final void fetchBannerAd(Bundle extraInfo, int width, int height) {
Intrinsics.checkNotNullParameter(extraInfo, "extraInfo");
this.apsAd = new ApsAd(extraInfo, ApsAdFormatUtils.getAdFormat(AdType.DISPLAY, height, width));
this.apsAdView = new ApsAdView(this.context, ApsAdFormat.BANNER, this.apsAdListenerInternal);
ApsAd apsAd = this.apsAd;
ApsAd apsAd2 = null;
if (apsAd == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
apsAd = null;
}
apsAd.setAdView(getApsAdView());
ApsAdView apsAdView = getApsAdView();
ApsAd apsAd3 = this.apsAd;
if (apsAd3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
} else {
apsAd2 = apsAd3;
}
apsAdView.setApsAd(apsAd2);
getApsAdView().fetchAd(extraInfo);
}
public final void fetchBannerAd(String extraInfoAsString, int width, int height) {
Intrinsics.checkNotNullParameter(extraInfoAsString, "extraInfoAsString");
this.apsAd = new ApsAd(extraInfoAsString, ApsAdFormatUtils.getAdFormat(AdType.DISPLAY, height, width));
this.apsAdView = new ApsAdView(this.context, ApsAdFormat.BANNER, this.apsAdListenerInternal);
ApsAd apsAd = this.apsAd;
ApsAd apsAd2 = null;
if (apsAd == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
apsAd = null;
}
apsAd.setAdView(getApsAdView());
ApsAdView apsAdView = getApsAdView();
ApsAd apsAd3 = this.apsAd;
if (apsAd3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
} else {
apsAd2 = apsAd3;
}
apsAdView.setApsAd(apsAd2);
getApsAdView().fetchAd(extraInfoAsString);
}
public final void fetchInterstitialAd(Bundle extraInfo) {
Intrinsics.checkNotNullParameter(extraInfo, "extraInfo");
this.apsAd = new ApsAd(extraInfo, ApsAdFormatUtils.getAdFormat(AdType.INTERSTITIAL, 9999, 9999));
this.apsAdView = new ApsAdView(this.context, ApsAdFormat.INTERSTITIAL, this.apsAdListenerInternal);
ApsAd apsAd = this.apsAd;
ApsAd apsAd2 = null;
if (apsAd == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
apsAd = null;
}
apsAd.setAdView(getApsAdView());
ApsAdView apsAdView = getApsAdView();
ApsAd apsAd3 = this.apsAd;
if (apsAd3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
} else {
apsAd2 = apsAd3;
}
apsAdView.setApsAd(apsAd2);
getApsAdView().fetchAd(extraInfo);
}
public final void fetchInterstitialAd(String extraInfoAsString) {
Intrinsics.checkNotNullParameter(extraInfoAsString, "extraInfoAsString");
this.apsAd = new ApsAd(extraInfoAsString, ApsAdFormatUtils.getAdFormat(AdType.INTERSTITIAL, 9999, 9999));
this.apsAdView = new ApsAdView(this.context, ApsAdFormat.INTERSTITIAL, this.apsAdListenerInternal);
ApsAd apsAd = this.apsAd;
ApsAd apsAd2 = null;
if (apsAd == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
apsAd = null;
}
apsAd.setAdView(getApsAdView());
ApsAdView apsAdView = getApsAdView();
ApsAd apsAd3 = this.apsAd;
if (apsAd3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
} else {
apsAd2 = apsAd3;
}
apsAdView.setApsAd(apsAd2);
getApsAdView().fetchAd(extraInfoAsString);
}
public final void fetchRewardedAd(String extraInfoAsString) {
Intrinsics.checkNotNullParameter(extraInfoAsString, "extraInfoAsString");
this.apsAd = new ApsAd(extraInfoAsString, ApsAdFormatUtils.getAdFormat(AdType.VIDEO, 9999, 9999));
this.apsAdView = new ApsAdView(this.context, ApsAdFormat.REWARDED_VIDEO, this.apsAdListenerInternal);
ApsAd apsAd = this.apsAd;
ApsAd apsAd2 = null;
if (apsAd == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
apsAd = null;
}
apsAd.setAdView(getApsAdView());
ApsAdView apsAdView = getApsAdView();
ApsAd apsAd3 = this.apsAd;
if (apsAd3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("apsAd");
} else {
apsAd2 = apsAd3;
}
apsAdView.setApsAd(apsAd2);
getApsAdView().fetchAd(extraInfoAsString);
}
public final void safeCall(Function0<Unit> action) {
Intrinsics.checkNotNullParameter(action, "action");
try {
action.invoke();
} catch (AbstractMethodError unused) {
APSAnalytics.logEvent(APSEventSeverity.FATAL, APSEventType.EXCEPTION, "AbstractMethodError listener method not implemented:ApsAdController - safeCall");
} catch (Exception e) {
APSAnalytics.logEvent(APSEventSeverity.FATAL, APSEventType.EXCEPTION, "Unexpected exception:ApsAdController - safeCall", e);
}
}
}