- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
843 lines
37 KiB
Java
843 lines
37 KiB
Java
package com.applovin.impl.mediation.ads;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.view.ViewGroup;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.lifecycle.Lifecycle;
|
|
import com.applovin.impl.gc;
|
|
import com.applovin.impl.ge;
|
|
import com.applovin.impl.ie;
|
|
import com.applovin.impl.j8;
|
|
import com.applovin.impl.jn;
|
|
import com.applovin.impl.la;
|
|
import com.applovin.impl.lf;
|
|
import com.applovin.impl.mediation.MaxErrorImpl;
|
|
import com.applovin.impl.mediation.MediationServiceImpl;
|
|
import com.applovin.impl.mediation.ads.MaxFullscreenAdImpl;
|
|
import com.applovin.impl.mediation.ads.a;
|
|
import com.applovin.impl.mediation.d;
|
|
import com.applovin.impl.sdk.a;
|
|
import com.applovin.impl.sdk.j;
|
|
import com.applovin.impl.sdk.n;
|
|
import com.applovin.impl.sdk.utils.CollectionUtils;
|
|
import com.applovin.impl.tm;
|
|
import com.applovin.impl.v;
|
|
import com.applovin.impl.ve;
|
|
import com.applovin.impl.yp;
|
|
import com.applovin.mediation.MaxAd;
|
|
import com.applovin.mediation.MaxAdFormat;
|
|
import com.applovin.mediation.MaxAdListener;
|
|
import com.applovin.mediation.MaxAdRevenueListener;
|
|
import com.applovin.mediation.MaxError;
|
|
import com.applovin.mediation.MaxReward;
|
|
import com.applovin.mediation.MaxRewardedAdListener;
|
|
import com.applovin.mediation.adapter.MaxAdapterError;
|
|
import com.applovin.sdk.AppLovinSdkUtils;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class MaxFullscreenAdImpl extends com.applovin.impl.mediation.ads.a implements a.InterfaceC0037a, v.b {
|
|
private final b a;
|
|
private final WeakReference b;
|
|
private final c c;
|
|
private final com.applovin.impl.mediation.b d;
|
|
private final Object e;
|
|
private ie f;
|
|
private d g;
|
|
private final AtomicBoolean h;
|
|
private final AtomicBoolean i;
|
|
private boolean j;
|
|
private boolean k;
|
|
private String l;
|
|
private String m;
|
|
private WeakReference n;
|
|
private WeakReference o;
|
|
private WeakReference p;
|
|
|
|
public interface b {
|
|
Activity getActivity();
|
|
}
|
|
|
|
public class c implements MaxAdListener, MaxRewardedAdListener, MaxAdRevenueListener, a.InterfaceC0026a {
|
|
private c() {
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void b(MaxAd maxAd) {
|
|
if (MaxFullscreenAdImpl.this.k) {
|
|
MaxFullscreenAdImpl.this.d();
|
|
return;
|
|
}
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onAdLoaded(ad=" + maxAd + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
gc.f(MaxFullscreenAdImpl.this.adListener, maxAd, true);
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdListener
|
|
public void onAdClicked(MaxAd maxAd) {
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onAdClicked(ad=" + maxAd + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
gc.a(MaxFullscreenAdImpl.this.adListener, maxAd, true);
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdListener
|
|
public void onAdDisplayFailed(final MaxAd maxAd, final MaxError maxError) {
|
|
final boolean z = MaxFullscreenAdImpl.this.k;
|
|
MaxFullscreenAdImpl.this.k = false;
|
|
final ie ieVar = (ie) maxAd;
|
|
MaxFullscreenAdImpl.this.a(d.IDLE, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$c$$ExternalSyntheticLambda0
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.c.this.a(maxAd, z, ieVar, maxError);
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdListener
|
|
public void onAdDisplayed(MaxAd maxAd) {
|
|
final ie ieVar = (ie) maxAd;
|
|
MaxFullscreenAdImpl.this.k = false;
|
|
MaxFullscreenAdImpl.this.sdk.f().a(ieVar);
|
|
if (((Integer) MaxFullscreenAdImpl.this.sdk.a(ve.V7)).intValue() > 0) {
|
|
MaxFullscreenAdImpl.this.sdk.j0().b(new jn(MaxFullscreenAdImpl.this.sdk, "ReportAdHiddenCallbackNotCalled", new Runnable() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$c$$ExternalSyntheticLambda3
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
MaxFullscreenAdImpl.c.this.a(ieVar);
|
|
}
|
|
}), tm.b.TIMEOUT, TimeUnit.SECONDS.toMillis(r1.intValue()));
|
|
}
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onAdDisplayed(ad=" + maxAd + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
gc.c(MaxFullscreenAdImpl.this.adListener, maxAd, true);
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdListener
|
|
public void onAdHidden(final MaxAd maxAd) {
|
|
MaxFullscreenAdImpl.this.k = false;
|
|
MaxFullscreenAdImpl.this.a(d.IDLE, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$c$$ExternalSyntheticLambda1
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.c.this.a(maxAd);
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdListener
|
|
public void onAdLoadFailed(final String str, final MaxError maxError) {
|
|
MaxFullscreenAdImpl.this.c();
|
|
MaxFullscreenAdImpl.this.a(d.IDLE, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$c$$ExternalSyntheticLambda5
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.c.this.a(str, maxError);
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdListener
|
|
public void onAdLoaded(final MaxAd maxAd) {
|
|
ie ieVar;
|
|
synchronized (MaxFullscreenAdImpl.this.e) {
|
|
ieVar = MaxFullscreenAdImpl.this.f;
|
|
}
|
|
MaxFullscreenAdImpl.this.sdk.C().a(MaxFullscreenAdImpl.this.adUnitId);
|
|
MaxFullscreenAdImpl.this.a((ie) maxAd);
|
|
if (!MaxFullscreenAdImpl.this.h.compareAndSet(true, false)) {
|
|
MaxFullscreenAdImpl.this.a(d.READY, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$c$$ExternalSyntheticLambda4
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.c.this.b(maxAd);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
MaxFullscreenAdImpl.this.extraParameters.remove("expired_ad_ad_unit_id");
|
|
if (MaxFullscreenAdImpl.this.i.compareAndSet(true, false)) {
|
|
MaxFullscreenAdImpl.this.d();
|
|
}
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onExpiredAdReloaded(expiredAd=" + ieVar + ", newAd=" + maxAd + "), listener=" + MaxFullscreenAdImpl.this.expirationListener);
|
|
}
|
|
gc.a(MaxFullscreenAdImpl.this.expirationListener, (MaxAd) ieVar, maxAd, true);
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdRequestListener
|
|
public void onAdRequestStarted(String str) {
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdRequestListener.onAdRequestStarted(adUnitId=" + str + "), listener=" + MaxFullscreenAdImpl.this.requestListener);
|
|
}
|
|
gc.a(MaxFullscreenAdImpl.this.requestListener, str, true);
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxAdRevenueListener
|
|
public void onAdRevenuePaid(MaxAd maxAd) {
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdRevenueListener.onAdRevenuePaid(ad=" + maxAd + "), listener=" + MaxFullscreenAdImpl.this.revenueListener);
|
|
}
|
|
gc.a(MaxFullscreenAdImpl.this.revenueListener, maxAd, true);
|
|
}
|
|
|
|
@Override // com.applovin.mediation.MaxRewardedAdListener
|
|
public void onUserRewarded(MaxAd maxAd, MaxReward maxReward) {
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxRewardedAdListener.onUserRewarded(ad=" + maxAd + ", reward=" + maxReward + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
gc.a(MaxFullscreenAdImpl.this.adListener, maxAd, maxReward, true);
|
|
}
|
|
|
|
public /* synthetic */ c(MaxFullscreenAdImpl maxFullscreenAdImpl, a aVar) {
|
|
this();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(MaxAd maxAd, boolean z, ie ieVar, MaxError maxError) {
|
|
MaxFullscreenAdImpl.this.a(maxAd);
|
|
if (!z && ieVar.w0() && MaxFullscreenAdImpl.this.sdk.K().d(MaxFullscreenAdImpl.this.adUnitId)) {
|
|
AppLovinSdkUtils.runOnUiThread(true, new Runnable() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$c$$ExternalSyntheticLambda2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
MaxFullscreenAdImpl.c.this.a();
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onAdDisplayFailed(ad=" + maxAd + ", error=" + maxError + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
gc.a(MaxFullscreenAdImpl.this.adListener, maxAd, maxError, true);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(ie ieVar) {
|
|
if (ieVar.w().get()) {
|
|
return;
|
|
}
|
|
MaxFullscreenAdImpl.this.sdk.E().a(la.B, ieVar);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(String str, MaxError maxError) {
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onAdLoadFailed(adUnitId=" + str + ", error=" + maxError + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
gc.a(MaxFullscreenAdImpl.this.adListener, str, maxError, true);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(MaxAd maxAd) {
|
|
MaxFullscreenAdImpl.this.a(maxAd);
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onAdHidden(ad=" + maxAd + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
gc.e(MaxFullscreenAdImpl.this.adListener, maxAd, true);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a() {
|
|
MaxFullscreenAdImpl.this.k = true;
|
|
MaxFullscreenAdImpl.this.loadAd();
|
|
}
|
|
}
|
|
|
|
public enum d {
|
|
IDLE,
|
|
LOADING,
|
|
READY,
|
|
SHOWING,
|
|
DESTROYED
|
|
}
|
|
|
|
public interface e {
|
|
void a();
|
|
|
|
default void a(MaxError maxError) {
|
|
}
|
|
}
|
|
|
|
public MaxFullscreenAdImpl(String str, MaxAdFormat maxAdFormat, b bVar, String str2, j jVar, Context context) {
|
|
super(str, maxAdFormat, str2, jVar);
|
|
this.e = new Object();
|
|
this.f = null;
|
|
this.g = d.IDLE;
|
|
this.h = new AtomicBoolean();
|
|
this.i = new AtomicBoolean();
|
|
this.n = new WeakReference(null);
|
|
this.o = new WeakReference(null);
|
|
this.p = new WeakReference(null);
|
|
this.a = bVar;
|
|
this.c = new c(this, null);
|
|
this.d = new com.applovin.impl.mediation.b(jVar);
|
|
this.b = new WeakReference(context);
|
|
jVar.h().a(this);
|
|
n.g(str2, "Created new " + str2 + " (" + this + ")");
|
|
}
|
|
|
|
@Override // com.applovin.impl.mediation.ads.a
|
|
public void destroy() {
|
|
a(d.DESTROYED, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$$ExternalSyntheticLambda0
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.this.b();
|
|
}
|
|
});
|
|
}
|
|
|
|
public boolean isReady() {
|
|
boolean z;
|
|
synchronized (this.e) {
|
|
try {
|
|
ie ieVar = this.f;
|
|
z = ieVar != null && ieVar.c0() && this.g == d.READY;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
if (!z) {
|
|
this.sdk.C().c(this.adUnitId);
|
|
}
|
|
return z;
|
|
}
|
|
|
|
public void loadAd() {
|
|
loadAd(d.b.PUBLISHER_INITIATED);
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.a.InterfaceC0037a
|
|
public void onAdExpired(j8 j8Var) {
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "Ad expired " + getAdUnitId());
|
|
}
|
|
this.h.set(true);
|
|
b bVar = this.a;
|
|
Activity activity = bVar != null ? bVar.getActivity() : null;
|
|
if (activity == null && (activity = this.sdk.e().b()) == null) {
|
|
c();
|
|
this.c.onAdLoadFailed(this.adUnitId, MaxAdapterError.MISSING_ACTIVITY);
|
|
} else {
|
|
this.extraParameters.put("expired_ad_ad_unit_id", getAdUnitId());
|
|
this.sdk.Q().loadAd(this.adUnitId, null, this.adFormat, d.b.EXPIRED, this.localExtraParameters, this.extraParameters, activity, this.c);
|
|
}
|
|
}
|
|
|
|
@Override // com.applovin.impl.v.b
|
|
public void onCreativeIdGenerated(String str, String str2) {
|
|
ie ieVar = this.f;
|
|
if (ieVar == null || !ieVar.S().equalsIgnoreCase(str)) {
|
|
return;
|
|
}
|
|
this.f.h(str2);
|
|
gc.b(this.adReviewListener, str2, this.f);
|
|
}
|
|
|
|
public void showAd(final String str, final String str2, final Activity activity) {
|
|
ie ieVar;
|
|
List b2 = this.sdk.l0().b();
|
|
if (!this.sdk.l0().d() || b2 == null || (ieVar = this.f) == null || b2.contains(ieVar.c())) {
|
|
if (activity == null) {
|
|
activity = this.sdk.n0();
|
|
}
|
|
if (a(activity, str)) {
|
|
a(d.SHOWING, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$$ExternalSyntheticLambda5
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.this.a(str, str2, activity);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
final String str3 = "Attempting to show ad from <" + this.f.c() + "> which is not in the list of selected ad networks " + b2;
|
|
n.h(this.tag, str3);
|
|
a(d.IDLE, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$$ExternalSyntheticLambda4
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.this.b(str3);
|
|
}
|
|
});
|
|
}
|
|
|
|
@NonNull
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this.tag);
|
|
sb.append("{adUnitId='");
|
|
sb.append(this.adUnitId);
|
|
sb.append('\'');
|
|
sb.append(", adListener=");
|
|
Object obj = this.adListener;
|
|
if (obj == this.a) {
|
|
obj = "this";
|
|
}
|
|
sb.append(obj);
|
|
sb.append(", revenueListener=");
|
|
sb.append(this.revenueListener);
|
|
sb.append(", requestListener");
|
|
sb.append(this.requestListener);
|
|
sb.append(", adReviewListener");
|
|
sb.append(this.adReviewListener);
|
|
sb.append(", isReady=");
|
|
sb.append(isReady());
|
|
sb.append('}');
|
|
return sb.toString();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void b() {
|
|
synchronized (this.e) {
|
|
try {
|
|
if (this.f != null) {
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "Destroying ad for '" + this.adUnitId + "'; current ad: " + this.f + "...");
|
|
}
|
|
this.sdk.Q().destroyAd(this.f);
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
this.sdk.h().b(this);
|
|
this.d.a();
|
|
super.destroy();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void d() {
|
|
Activity activity = (Activity) this.n.get();
|
|
if (activity == null) {
|
|
activity = this.sdk.n0();
|
|
}
|
|
Activity activity2 = activity;
|
|
if (this.j) {
|
|
showAd(this.l, this.m, (ViewGroup) this.o.get(), (Lifecycle) this.p.get(), activity2);
|
|
} else {
|
|
showAd(this.l, this.m, activity2);
|
|
}
|
|
}
|
|
|
|
public void loadAd(d.b bVar) {
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "Loading ad for '" + this.adUnitId + "'...");
|
|
}
|
|
if (this.g == d.DESTROYED) {
|
|
boolean c2 = yp.c(this.sdk);
|
|
this.sdk.E().a(la.L, "attemptingToLoadDestroyedAd", (Map) CollectionUtils.hashMap("details", "debug=" + c2));
|
|
if (c2) {
|
|
throw new IllegalStateException("Failed to load new ad - this instance is already destroyed for ad unit ID: " + this.adUnitId);
|
|
}
|
|
}
|
|
if (!isReady()) {
|
|
b bVar2 = this.a;
|
|
a(d.LOADING, new a(bVar2 != null ? bVar2.getActivity() : null, (Context) this.b.get(), bVar));
|
|
return;
|
|
}
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "An ad is already loaded for '" + this.adUnitId + "'");
|
|
}
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdLoaded(ad=" + this.f + "), listener=" + this.adListener);
|
|
}
|
|
gc.f(this.adListener, (MaxAd) this.f, true);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void c(String str) {
|
|
ie ieVar = this.f;
|
|
a((MaxAd) ieVar);
|
|
MaxErrorImpl maxErrorImpl = new MaxErrorImpl(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, str);
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdDisplayFailed(ad=" + ieVar + ", error=" + maxErrorImpl + "), listener=" + this.adListener);
|
|
}
|
|
gc.a(this.adListener, (MaxAd) ieVar, (MaxError) maxErrorImpl, true);
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl, ieVar);
|
|
}
|
|
|
|
public class a implements e {
|
|
final /* synthetic */ Activity a;
|
|
final /* synthetic */ Context b;
|
|
final /* synthetic */ d.b c;
|
|
|
|
public a(Activity activity, Context context, d.b bVar) {
|
|
this.a = activity;
|
|
this.b = context;
|
|
this.c = bVar;
|
|
}
|
|
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public void a() {
|
|
Context context = this.a;
|
|
if (context == null && (context = this.b) == null) {
|
|
if (MaxFullscreenAdImpl.this.sdk.n0() != null) {
|
|
context = MaxFullscreenAdImpl.this.sdk.n0();
|
|
} else {
|
|
context = j.l();
|
|
}
|
|
}
|
|
Context context2 = context;
|
|
MediationServiceImpl Q = MaxFullscreenAdImpl.this.sdk.Q();
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
Q.loadAd(maxFullscreenAdImpl.adUnitId, null, maxFullscreenAdImpl.adFormat, this.c, maxFullscreenAdImpl.localExtraParameters, maxFullscreenAdImpl.extraParameters, context2, maxFullscreenAdImpl.c);
|
|
}
|
|
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public void a(MaxError maxError) {
|
|
if (((Boolean) MaxFullscreenAdImpl.this.sdk.a(ve.U7)).booleanValue()) {
|
|
n nVar = MaxFullscreenAdImpl.this.logger;
|
|
if (n.a()) {
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl = MaxFullscreenAdImpl.this;
|
|
maxFullscreenAdImpl.logger.a(maxFullscreenAdImpl.tag, "MaxAdListener.onAdLoadFailed(adUnitId=" + MaxFullscreenAdImpl.this.adUnitId + ", error=" + maxError + "), listener=" + MaxFullscreenAdImpl.this.adListener);
|
|
}
|
|
MaxFullscreenAdImpl maxFullscreenAdImpl2 = MaxFullscreenAdImpl.this;
|
|
gc.a(maxFullscreenAdImpl2.adListener, maxFullscreenAdImpl2.adUnitId, maxError, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void c() {
|
|
ie ieVar;
|
|
if (this.h.compareAndSet(true, false)) {
|
|
synchronized (this.e) {
|
|
ieVar = this.f;
|
|
this.f = null;
|
|
}
|
|
this.sdk.Q().destroyAd(ieVar);
|
|
this.extraParameters.remove("expired_ad_ad_unit_id");
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void b(String str) {
|
|
ie ieVar = this.f;
|
|
a((MaxAd) ieVar);
|
|
MaxErrorImpl maxErrorImpl = new MaxErrorImpl(MaxAdapterError.ERROR_CODE_AD_DISPLAY_FAILED, str);
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdDisplayFailed(ad=" + ieVar + ", error=" + maxErrorImpl + "), listener=" + this.adListener);
|
|
}
|
|
gc.a(this.adListener, (MaxAd) ieVar, (MaxError) maxErrorImpl, true);
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl, ieVar);
|
|
}
|
|
|
|
public void showAd(final String str, final String str2, final ViewGroup viewGroup, final Lifecycle lifecycle, Activity activity) {
|
|
ie ieVar;
|
|
if (viewGroup != null && lifecycle != null) {
|
|
if (!viewGroup.isShown() && ((Boolean) this.sdk.a(ve.M7)).booleanValue()) {
|
|
n.h(this.tag, "Attempting to show ad when containerView and/or its ancestors are not visible");
|
|
MaxErrorImpl maxErrorImpl = new MaxErrorImpl(-1, "Attempting to show ad when containerView and/or its ancestors are not visible");
|
|
gc.a(this.adListener, (MaxAd) this.f, (MaxError) maxErrorImpl, true);
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl, this.f);
|
|
return;
|
|
}
|
|
List b2 = this.sdk.l0().b();
|
|
if (this.sdk.l0().d() && b2 != null && (ieVar = this.f) != null && !b2.contains(ieVar.c())) {
|
|
final String str3 = "Attempting to show ad from <" + this.f.c() + "> which is not in the list of selected ad networks " + b2;
|
|
n.h(this.tag, str3);
|
|
a(d.IDLE, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$$ExternalSyntheticLambda1
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.this.c(str3);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
if (activity == null) {
|
|
activity = this.sdk.n0();
|
|
}
|
|
final Activity activity2 = activity;
|
|
if (a(activity2, str)) {
|
|
a(d.SHOWING, new e() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$$ExternalSyntheticLambda2
|
|
@Override // com.applovin.impl.mediation.ads.MaxFullscreenAdImpl.e
|
|
public final void a() {
|
|
MaxFullscreenAdImpl.this.a(str, str2, activity2, viewGroup, lifecycle);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
n.h(this.tag, "Attempting to show ad with null containerView or lifecycle.");
|
|
MaxErrorImpl maxErrorImpl2 = new MaxErrorImpl(-1, "Attempting to show ad with null containerView or lifecycle.");
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdDisplayFailed(ad=" + this.f + ", error=" + maxErrorImpl2 + "), listener=" + this.adListener);
|
|
}
|
|
gc.a(this.adListener, (MaxAd) this.f, (MaxError) maxErrorImpl2, true);
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl2, this.f);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void a(ie ieVar) {
|
|
if (this.sdk.f().a(ieVar, this)) {
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "Handle ad loaded for regular ad: " + ieVar);
|
|
}
|
|
this.f = ieVar;
|
|
return;
|
|
}
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "Loaded an expired ad, running expire logic...");
|
|
}
|
|
onAdExpired(ieVar);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(String str, String str2, Activity activity) {
|
|
a(str, str2);
|
|
this.j = false;
|
|
this.n = new WeakReference(activity);
|
|
this.sdk.Q().showFullscreenAd(this.f, activity, this.c);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(String str, String str2, Activity activity, ViewGroup viewGroup, Lifecycle lifecycle) {
|
|
a(str, str2);
|
|
this.j = true;
|
|
this.n = new WeakReference(activity);
|
|
this.o = new WeakReference(viewGroup);
|
|
this.p = new WeakReference(lifecycle);
|
|
this.sdk.Q().showFullscreenAd(this.f, viewGroup, lifecycle, activity, this.c);
|
|
}
|
|
|
|
private boolean a(Activity activity, final String str) {
|
|
if (activity == null && MaxAdFormat.APP_OPEN != this.adFormat) {
|
|
throw new IllegalArgumentException("Attempting to show ad without a valid activity.");
|
|
}
|
|
if (this.g == d.DESTROYED) {
|
|
boolean c2 = yp.c(this.sdk);
|
|
this.sdk.E().a(la.L, "attemptingToShowDestroyedAd", (Map) CollectionUtils.hashMap("details", "debug=" + c2));
|
|
if (c2) {
|
|
throw new IllegalStateException("Attempting to show ad that is destroyed for ad unit ID: " + this.adUnitId);
|
|
}
|
|
}
|
|
if (!isReady()) {
|
|
String str2 = "Attempting to show ad before it is ready - please check ad readiness using " + this.tag + "#isReady()";
|
|
n.h(this.tag, str2);
|
|
MaxErrorImpl maxErrorImpl = new MaxErrorImpl(-24, str2);
|
|
lf lfVar = new lf(this.adUnitId, this.adFormat, str);
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdDisplayFailed(ad=" + lfVar + ", error=" + maxErrorImpl + "), listener=" + this.adListener);
|
|
}
|
|
gc.a(this.adListener, (MaxAd) lfVar, (MaxError) maxErrorImpl, true);
|
|
if (this.f != null) {
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl, this.f);
|
|
}
|
|
return false;
|
|
}
|
|
Long l = (Long) this.sdk.a(ve.w7);
|
|
Long l2 = (Long) this.sdk.a(ve.p7);
|
|
if (l.longValue() > 0 && (this.f.getTimeToLiveMillis() < l2.longValue() || this.h.get())) {
|
|
this.i.set(true);
|
|
this.sdk.j0().a(new jn(this.sdk, "handleShowOnLoadTimeoutError", new Runnable() { // from class: com.applovin.impl.mediation.ads.MaxFullscreenAdImpl$$ExternalSyntheticLambda3
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
MaxFullscreenAdImpl.this.a(str);
|
|
}
|
|
}), tm.b.TIMEOUT, l.longValue());
|
|
return false;
|
|
}
|
|
if (yp.a(j.l()) != 0 && this.sdk.g0().shouldFailAdDisplayIfDontKeepActivitiesIsEnabled()) {
|
|
if (!yp.c(this.sdk)) {
|
|
if (((Boolean) this.sdk.a(ve.L7)).booleanValue()) {
|
|
n.h(this.tag, "Ad failed to display! Please disable the \"Don't Keep Activities\" setting in your developer settings!");
|
|
MaxErrorImpl maxErrorImpl2 = new MaxErrorImpl(-5602, "Ad failed to display! Please disable the \"Don't Keep Activities\" setting in your developer settings!");
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdDisplayFailed(ad=" + this.f + ", error=" + maxErrorImpl2 + "), listener=" + this.adListener);
|
|
}
|
|
gc.a(this.adListener, (MaxAd) this.f, (MaxError) maxErrorImpl2, true);
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl2, this.f);
|
|
return false;
|
|
}
|
|
} else {
|
|
throw new IllegalStateException("Ad failed to display! Please disable the \"Don't Keep Activities\" setting in your developer settings!");
|
|
}
|
|
}
|
|
if (!this.sdk.C().d() && !this.sdk.C().c()) {
|
|
return true;
|
|
}
|
|
n.h(this.tag, "Attempting to show ad when another fullscreen ad is already showing");
|
|
MaxErrorImpl maxErrorImpl3 = new MaxErrorImpl(-23, "Attempting to show ad when another fullscreen ad is already showing");
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdDisplayFailed(ad=" + this.f + ", error=" + maxErrorImpl3 + "), listener=" + this.adListener);
|
|
}
|
|
gc.a(this.adListener, (MaxAd) this.f, (MaxError) maxErrorImpl3, true);
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl3, this.f);
|
|
return false;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(String str) {
|
|
if (this.i.compareAndSet(true, false)) {
|
|
n.h(this.tag, "Failed to show an ad. Failed to load an ad in time to show.");
|
|
this.sdk.C().c(this.adUnitId);
|
|
MaxErrorImpl maxErrorImpl = new MaxErrorImpl(-24, "Failed to show an ad. Failed to load an ad in time to show.");
|
|
lf lfVar = new lf(this.adUnitId, this.adFormat, str);
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "MaxAdListener.onAdDisplayFailed(ad=" + lfVar + ", error=" + maxErrorImpl + "), listener=" + this.adListener);
|
|
}
|
|
gc.a(this.adListener, (MaxAd) lfVar, (MaxError) maxErrorImpl, true);
|
|
if (this.f != null) {
|
|
this.sdk.Q().processAdDisplayErrorPostbackForUserError(maxErrorImpl, this.f);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void a(String str, String str2) {
|
|
this.d.e(this.f);
|
|
this.f.g(str);
|
|
this.f.f(str2);
|
|
this.l = str;
|
|
this.m = str2;
|
|
this.sdk.w().d(this.f);
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "Showing ad for '" + this.adUnitId + "'; loaded ad: " + this.f + "...");
|
|
}
|
|
a((ge) this.f);
|
|
}
|
|
|
|
private void a() {
|
|
ie ieVar;
|
|
synchronized (this.e) {
|
|
ieVar = this.f;
|
|
this.f = null;
|
|
}
|
|
this.sdk.Q().destroyAd(ieVar);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void a(d dVar, e eVar) {
|
|
boolean z;
|
|
MaxErrorImpl maxErrorImpl = new MaxErrorImpl(-1);
|
|
d dVar2 = this.g;
|
|
synchronized (this.e) {
|
|
try {
|
|
d dVar3 = d.IDLE;
|
|
if (dVar2 == dVar3) {
|
|
if (dVar != d.LOADING && dVar != d.DESTROYED) {
|
|
if (dVar == d.SHOWING) {
|
|
n.h(this.tag, "No ad is loading or loaded");
|
|
} else if (n.a()) {
|
|
this.logger.b(this.tag, "Unable to transition to: " + dVar);
|
|
}
|
|
z = false;
|
|
}
|
|
z = true;
|
|
} else {
|
|
d dVar4 = d.LOADING;
|
|
if (dVar2 == dVar4) {
|
|
if (dVar != dVar3) {
|
|
if (dVar == dVar4) {
|
|
maxErrorImpl = new MaxErrorImpl(-26, "An ad is already loading");
|
|
n.h(this.tag, maxErrorImpl.getMessage());
|
|
} else if (dVar != d.READY) {
|
|
if (dVar == d.SHOWING) {
|
|
n.h(this.tag, "An ad is not ready to be shown yet");
|
|
} else if (dVar != d.DESTROYED) {
|
|
if (n.a()) {
|
|
this.logger.b(this.tag, "Unable to transition to: " + dVar);
|
|
}
|
|
}
|
|
}
|
|
z = false;
|
|
}
|
|
z = true;
|
|
} else {
|
|
d dVar5 = d.READY;
|
|
if (dVar2 == dVar5) {
|
|
if (dVar != dVar3) {
|
|
if (dVar == dVar4) {
|
|
n.h(this.tag, "An ad is already loaded");
|
|
} else if (dVar == dVar5) {
|
|
if (n.a()) {
|
|
this.logger.b(this.tag, "An ad is already marked as ready");
|
|
}
|
|
} else if (dVar != d.SHOWING && dVar != d.DESTROYED) {
|
|
if (n.a()) {
|
|
this.logger.b(this.tag, "Unable to transition to: " + dVar);
|
|
}
|
|
}
|
|
z = false;
|
|
}
|
|
z = true;
|
|
} else {
|
|
d dVar6 = d.SHOWING;
|
|
if (dVar2 == dVar6) {
|
|
if (dVar != dVar3) {
|
|
if (dVar == dVar4) {
|
|
maxErrorImpl = new MaxErrorImpl(-27, "Can not load another ad while the ad is showing");
|
|
n.h(this.tag, maxErrorImpl.getMessage());
|
|
} else if (dVar == dVar5) {
|
|
if (n.a()) {
|
|
this.logger.b(this.tag, "An ad is already showing, ignoring");
|
|
}
|
|
} else if (dVar == dVar6) {
|
|
n.h(this.tag, "The ad is already showing, not showing another one");
|
|
} else if (dVar != d.DESTROYED) {
|
|
if (n.a()) {
|
|
this.logger.b(this.tag, "Unable to transition to: " + dVar);
|
|
}
|
|
}
|
|
}
|
|
z = true;
|
|
} else if (dVar2 == d.DESTROYED) {
|
|
n.h(this.tag, "No operations are allowed on a destroyed instance");
|
|
} else if (n.a()) {
|
|
this.logger.b(this.tag, "Unknown state: " + this.g);
|
|
}
|
|
z = false;
|
|
}
|
|
}
|
|
}
|
|
if (z) {
|
|
if (n.a()) {
|
|
this.logger.a(this.tag, "Transitioning from " + this.g + " to " + dVar + "...");
|
|
}
|
|
this.g = dVar;
|
|
} else if (n.a()) {
|
|
this.logger.k(this.tag, "Not allowed to transition from " + this.g + " to " + dVar);
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
if (z) {
|
|
eVar.a();
|
|
} else {
|
|
eVar.a(maxErrorImpl);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void a(MaxAd maxAd) {
|
|
this.sdk.f().a((ie) maxAd);
|
|
this.d.a();
|
|
a();
|
|
this.sdk.T().a((ge) maxAd);
|
|
}
|
|
}
|