Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 y.java 源代码,内容仅作参考
package com.ironsource.mediationsdk;
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import com.ironsource.environment.ContextProvider;
import com.ironsource.environment.DeviceConfigurationsDataHolder;
import com.ironsource.environment.a;
import com.ironsource.isadplayer.ISAdPlayer;
import com.ironsource.mediationsdk.D;
import com.ironsource.mediationsdk.IronSource;
import com.ironsource.mediationsdk.adunit.adapter.utility.AdInfo;
import com.ironsource.mediationsdk.adunit.data.DataKeys;
import com.ironsource.mediationsdk.config.ConfigFile;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyBannerLayout;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyInterstitialListener;
import com.ironsource.mediationsdk.demandOnly.ISDemandOnlyRewardedVideoListener;
import com.ironsource.mediationsdk.events.ISErrorListener;
import com.ironsource.mediationsdk.events.PixelEventsManager;
import com.ironsource.mediationsdk.impressionData.ExternalImpressionDataHandler;
import com.ironsource.mediationsdk.logger.IronLog;
import com.ironsource.mediationsdk.logger.IronSourceError;
import com.ironsource.mediationsdk.logger.IronSourceLogger;
import com.ironsource.mediationsdk.logger.IronSourceLoggerManager;
import com.ironsource.mediationsdk.metadata.MetaData;
import com.ironsource.mediationsdk.metadata.MetaDataUtils;
import com.ironsource.mediationsdk.model.BannerPlacement;
import com.ironsource.mediationsdk.model.EmptyBannerPlacement;
import com.ironsource.mediationsdk.model.InterstitialPlacement;
import com.ironsource.mediationsdk.model.NetworkSettings;
import com.ironsource.mediationsdk.model.OfferwallPlacement;
import com.ironsource.mediationsdk.model.Placement;
import com.ironsource.mediationsdk.sdk.InitializationListener;
import com.ironsource.mediationsdk.sdk.LevelPlayInterstitialListener;
import com.ironsource.mediationsdk.sdk.LevelPlayRewardedVideoListener;
import com.ironsource.mediationsdk.sdk.LevelPlayRewardedVideoManualListener;
import com.ironsource.mediationsdk.sdk.RewardedVideoManualListener;
import com.ironsource.mediationsdk.server.HttpFunctions;
import com.ironsource.mediationsdk.server.ServerURL;
import com.ironsource.mediationsdk.utilities.IronSourcePreconditions;
import com.ironsource.mediationsdk.utils.ApplicationGeneralSettings;
import com.ironsource.mediationsdk.utils.ErrorBuilder;
import com.ironsource.mediationsdk.utils.IronSourceAES;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.mediationsdk.utils.IronSourceUtils;
import com.ironsource.mediationsdk.utils.PixelSettings;
import com.ironsource.mediationsdk.utils.j;
import com.ironsource.mediationsdk.utils.k;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
public final class y implements com.ironsource.mediationsdk.utils.h {
public static boolean f45258n0 = false;
public com.ironsource.mediationsdk.adunit.c.h A;
public com.ironsource.mediationsdk.adunit.c.c B;
public IronSourceSegment C;
public final String D;
public int E;
public boolean F;
public boolean G;
public boolean H;
public boolean I;
public boolean J;
public boolean K;
public boolean L;
public ConcurrentHashMap<String, ISDemandOnlyBannerLayout> M;
public Boolean N;
public IronSourceBannerLayout O;
public String P;
public Boolean Q;
public InterfaceC2056s R;
public a0 S;
public G T;
public InitializationListener U;
public AtomicBoolean V;
public boolean W;
public boolean X;
public boolean Y;
public boolean Z;
public final String f45259a;
public boolean f45260a0;
public final String f45261b;
public boolean f45262b0;
public AbstractAdapter f45263c;
public int f45264c0;
public z f45265d;
public CopyOnWriteArraySet<String> f45266d0;
public IronSourceLoggerManager f45267e;
public CopyOnWriteArraySet<String> f45268e0;
public com.ironsource.mediationsdk.utils.k f45269f;
public CopyOnWriteArraySet<String> f45270f0;
public String f45271g;
public com.ironsource.mediationsdk.demandOnly.c f45272g0;
public String f45273h;
public com.ironsource.mediationsdk.demandOnly.e f45274h0;
public String f45275i;
public com.ironsource.sdk.f.a f45276i0;
public Map<String, String> f45277j;
public ExternalImpressionDataHandler f45278j0;
public String f45279k;
public com.ironsource.sdk.controller.x f45280k0;
public com.ironsource.mediationsdk.sdk.f f45281l;
public TokenRepository f45282l0;
public String f45283m;
public ISErrorListener f45284m0;
public com.ironsource.mediationsdk.logger.b f45285n;
public AtomicBoolean f45286o;
public final Object f45287p;
public String f45288q;
public AtomicBoolean f45289r;
public boolean f45290s;
public List<IronSource.AD_UNIT> f45291t;
public Context f45292u;
public Boolean f45293v;
public Set<IronSource.AD_UNIT> f45294w;
public Set<IronSource.AD_UNIT> f45295x;
public boolean f45296y;
public com.ironsource.mediationsdk.adunit.c.g f45297z;
public interface a {
void a(String str);
}
public class b implements ISErrorListener {
public b() {
}
@Override
public final void onError(Throwable th2) {
IronLog.INTERNAL.error(th2.getMessage());
}
}
public static class c {
public static final int[] f45299a;
public static final int[] f45300b;
static {
int[] iArr = new int[j.a.a().length];
f45300b = iArr;
try {
iArr[0] = 1;
} catch (NoSuchFieldError unused) {
}
try {
int[] iArr2 = f45300b;
int i11 = j.a.f45151a;
iArr2[1] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
int[] iArr3 = f45300b;
int i12 = j.a.f45151a;
iArr3[2] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
int[] iArr4 = f45300b;
int i13 = j.a.f45151a;
iArr4[3] = 4;
} catch (NoSuchFieldError unused4) {
}
int[] iArr5 = new int[IronSource.AD_UNIT.values().length];
f45299a = iArr5;
try {
iArr5[IronSource.AD_UNIT.REWARDED_VIDEO.ordinal()] = 1;
} catch (NoSuchFieldError unused5) {
}
try {
f45299a[IronSource.AD_UNIT.INTERSTITIAL.ordinal()] = 2;
} catch (NoSuchFieldError unused6) {
}
try {
f45299a[IronSource.AD_UNIT.OFFERWALL.ordinal()] = 3;
} catch (NoSuchFieldError unused7) {
}
try {
f45299a[IronSource.AD_UNIT.BANNER.ordinal()] = 4;
} catch (NoSuchFieldError unused8) {
}
}
}
public static class d {
public static volatile y f45301a = new y(0);
}
private y() {
this.f45259a = y.class.getName();
this.f45261b = "!SDK-VERSION-STRING!:com.ironsource:mediationsdk:\u200b7.3.0.1";
this.f45287p = new Object();
this.f45269f = null;
this.f45271g = null;
this.f45273h = "";
this.f45288q = null;
this.f45275i = null;
this.f45277j = null;
this.f45279k = null;
this.f45290s = false;
this.f45283m = null;
this.f45293v = null;
this.f45296y = true;
this.D = IronSourceConstants.KEY_SESSION_DEPTH;
this.Q = null;
this.L = false;
this.f45267e = IronSourceLoggerManager.getLogger(0);
com.ironsource.mediationsdk.logger.b bVar = new com.ironsource.mediationsdk.logger.b(null, 1);
this.f45285n = bVar;
this.f45267e.addLogger(bVar);
this.f45281l = new com.ironsource.mediationsdk.sdk.f();
z zVar = new z();
this.f45265d = zVar;
zVar.f45304c = this.f45281l;
this.f45286o = new AtomicBoolean();
this.f45294w = new HashSet();
this.f45295x = new HashSet();
this.G = false;
this.F = false;
this.H = false;
this.f45289r = new AtomicBoolean(true);
this.V = new AtomicBoolean(false);
this.E = 0;
this.I = false;
this.J = false;
this.K = false;
this.f45283m = UUID.randomUUID().toString();
this.N = Boolean.FALSE;
this.f45260a0 = false;
this.P = null;
this.R = null;
this.S = null;
this.U = null;
this.T = null;
this.W = false;
this.f45266d0 = new CopyOnWriteArraySet<>();
this.f45268e0 = new CopyOnWriteArraySet<>();
this.f45270f0 = new CopyOnWriteArraySet<>();
this.M = new ConcurrentHashMap<>();
this.f45272g0 = null;
this.f45274h0 = null;
this.f45276i0 = null;
this.f45264c0 = 1;
this.f45278j0 = new ExternalImpressionDataHandler();
this.f45280k0 = new com.ironsource.sdk.controller.x();
this.f45282l0 = new TokenRepository();
this.f45284m0 = new b();
}
public static boolean A(com.ironsource.mediationsdk.utils.k kVar) {
if (kVar != null && kVar.c()) {
return true;
}
return false;
}
public static boolean B(String str, int i11, int i12) {
if (str != null && str.length() >= i11 && str.length() <= i12) {
return true;
}
return false;
}
public static IronSourceError D(Activity activity, ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, String str) {
String str2;
if (activity == null && ContextProvider.getInstance().getCurrentActiveActivity() == null) {
return new IronSourceError(IronSourceError.ERROR_DO_BN_LOAD_MISSING_ACTIVITY, "Banner was initialized and loaded without Activity");
}
if (iSDemandOnlyBannerLayout != null && !iSDemandOnlyBannerLayout.isDestroyed()) {
if (TextUtils.isEmpty(str)) {
return new IronSourceError(510, "Missing instance Id");
}
return null;
}
if (iSDemandOnlyBannerLayout == null) {
str2 = "Missing banner layout";
} else {
str2 = "Banner layout is destroyed";
}
return new IronSourceError(510, str2);
}
public static void F(int i11, JSONObject jSONObject) {
com.ironsource.mediationsdk.events.e.d().b(new com.ironsource.mediationsdk.events.d(i11, jSONObject));
}
public static boolean e0(String str) {
if (str == null) {
return false;
}
return str.matches("^[a-zA-Z0-9]*$");
}
public static com.ironsource.mediationsdk.utils.k p(Context context, String str) {
if (IronSourceUtils.isInitResponseCached(context)) {
String cachedValueByKeyOfCachedInitResponse = IronSourceUtils.getCachedValueByKeyOfCachedInitResponse(context, "appKey");
String cachedValueByKeyOfCachedInitResponse2 = IronSourceUtils.getCachedValueByKeyOfCachedInitResponse(context, DataKeys.USER_ID);
String cachedValueByKeyOfCachedInitResponse3 = IronSourceUtils.getCachedValueByKeyOfCachedInitResponse(context, "response");
if (cachedValueByKeyOfCachedInitResponse.equals(str)) {
com.ironsource.mediationsdk.utils.k kVar = new com.ironsource.mediationsdk.utils.k(context, cachedValueByKeyOfCachedInitResponse, cachedValueByKeyOfCachedInitResponse2, cachedValueByKeyOfCachedInitResponse3);
kVar.f45169e = k.a.f45236b;
return kVar;
}
}
return null;
}
public static void r(int i11, JSONObject jSONObject) {
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(i11, jSONObject));
}
public static void v(ISDemandOnlyRewardedVideoListener iSDemandOnlyRewardedVideoListener) {
com.ironsource.mediationsdk.demandOnly.i.a().f44580a = iSDemandOnlyRewardedVideoListener;
}
public static void w(JSONObject jSONObject, Object[][] objArr) {
for (int i11 = 0; i11 <= 0; i11++) {
try {
Object[] objArr2 = objArr[0];
jSONObject.put(objArr2[0].toString(), objArr2[1]);
} catch (Exception e11) {
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "IronSourceObject addToDictionary: " + Log.getStackTraceString(e11), 3);
return;
}
}
}
public static void x(boolean z11, int i11, JSONObject jSONObject) {
String str;
boolean z12;
try {
StringBuilder sb2 = new StringBuilder();
if (a.AnonymousClass1.d()) {
sb2.append(IronSourceConstants.IS_APP_LANGUAGE_KOTLIN);
str = a.AnonymousClass1.c();
} else {
str = IronSourceConstants.IS_APP_LANGUAGE_JAVA;
}
sb2.append(str);
sb2.append(String.format(",androidx=%s", Boolean.valueOf(IronSourceUtils.isAndroidXAvailable())));
if (z11) {
Object[] objArr = new Object[1];
if (ContextProvider.getInstance().getCurrentActiveActivity() != null) {
z12 = true;
} else {
z12 = false;
}
objArr[0] = Boolean.valueOf(z12);
sb2.append(String.format(",Activity=%s", objArr));
}
sb2.append(String.format(",cachedUserAgent=%s", Boolean.valueOf(com.ironsource.environment.h.f43808a)));
jSONObject.put(IronSourceConstants.EVENTS_EXT1, sb2.toString());
jSONObject.put(IronSourceConstants.KEY_SESSION_DEPTH, i11);
} catch (Exception e11) {
e11.printStackTrace();
}
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(14, jSONObject));
}
public final synchronized AbstractAdapter C(String str) {
try {
AbstractAdapter abstractAdapter = this.f45263c;
if (abstractAdapter != null && abstractAdapter.getProviderName().equals(str)) {
return this.f45263c;
}
} catch (Exception e11) {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "getOfferwallAdapter exception: " + e11, 1);
}
return null;
}
public final com.ironsource.mediationsdk.utils.k E(Context context, String str, a aVar) {
Vector<Pair<String, String>> vector;
com.ironsource.mediationsdk.utils.k kVar = null;
if (!IronSourceUtils.isNetworkConnected(context)) {
return null;
}
try {
String a11 = a(context);
if (TextUtils.isEmpty(a11)) {
a11 = com.ironsource.environment.h.x(context);
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "using custom identifier", 1);
}
String str2 = a11;
IronSourceSegment ironSourceSegment = this.C;
if (ironSourceSegment != null) {
vector = ironSourceSegment.a();
} else {
vector = null;
}
String stringFromURL = HttpFunctions.getStringFromURL(ServerURL.getCPVProvidersURL(context, this.f45271g, str, str2, this.f45279k, this.W, vector, P()), aVar);
if (stringFromURL == null) {
IronLog.INTERNAL.warning("serverResponseString is null");
return null;
}
if (IronSourceUtils.getSerr() == 1) {
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose("encrypt");
String optString = new JSONObject(stringFromURL).optString("response", null);
if (TextUtils.isEmpty(optString)) {
ironLog.warning("encryptedResponse is empty - return null");
return null;
}
stringFromURL = IronSourceAES.decode(com.ironsource.mediationsdk.utils.e.a().b(), optString);
if (TextUtils.isEmpty(stringFromURL)) {
ironLog.warning("encoded response invalid - return null");
if (!f45258n0) {
f45258n0 = true;
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
try {
mediationAdditionalData.put("status", "false");
mediationAdditionalData.put(IronSourceConstants.EVENTS_ERROR_CODE, 1);
} catch (JSONException e11) {
e11.printStackTrace();
}
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(114, mediationAdditionalData));
}
return null;
}
}
com.ironsource.mediationsdk.utils.k kVar2 = new com.ironsource.mediationsdk.utils.k(context, this.f45271g, str, stringFromURL);
try {
kVar2.f45169e = k.a.f45237c;
if (!kVar2.b()) {
IronLog.INTERNAL.warning("response invalid - return null");
return null;
}
return kVar2;
} catch (Exception e12) {
e = e12;
kVar = kVar2;
IronLog.INTERNAL.warning("exception = " + e);
e.printStackTrace();
return kVar;
}
} catch (Exception e13) {
e = e13;
}
}
public final void G(IronSource.AD_UNIT ad_unit) {
int i11 = c.f45299a[ad_unit.ordinal()];
if (i11 != 1) {
if (i11 != 2) {
if (i11 != 3) {
if (i11 == 4) {
c();
return;
}
return;
}
this.f45265d.a(this.f45271g, this.f45273h);
return;
}
m0();
return;
}
W();
}
public final boolean H(ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, String str) {
if (D.a().b() == D.f.INIT_IN_PROGRESS) {
synchronized (this.f45270f0) {
if (!this.f45270f0.contains(str)) {
this.f45270f0.add(str);
}
this.M.put(str, iSDemandOnlyBannerLayout);
}
return true;
}
return false;
}
public Placement I() {
com.ironsource.mediationsdk.model.s sVar = this.f45269f.f45163c.f44862a;
if (sVar != null) {
return sVar.a();
}
return null;
}
public boolean J() {
com.ironsource.mediationsdk.model.j jVar;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if (kVar != null && (jVar = kVar.f45163c) != null && jVar.f44862a != null) {
return true;
}
return false;
}
public boolean K() {
if (J() && g()) {
return true;
}
return false;
}
public InterstitialPlacement L() {
com.ironsource.mediationsdk.model.l lVar = this.f45269f.f45163c.f44863b;
if (lVar != null) {
return lVar.a();
}
return null;
}
public boolean M() {
com.ironsource.mediationsdk.model.j jVar;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if (kVar != null && (jVar = kVar.f45163c) != null && jVar.f44863b != null) {
return true;
}
return false;
}
public boolean N() {
if (M() && i()) {
return true;
}
return false;
}
public boolean O() {
com.ironsource.mediationsdk.model.j jVar;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if (kVar != null && (jVar = kVar.f45163c) != null && jVar.f44864c != null) {
return true;
}
return false;
}
public final boolean P() {
if (!this.F && !this.G && !this.H) {
return false;
}
return true;
}
public final boolean Q(String str) {
boolean z11 = false;
if (this.G) {
return false;
}
if (f0(str) != j.a.f45154d) {
z11 = true;
}
if (z11) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(this.G, true, 1);
try {
mediationAdditionalData.put("placement", str);
mediationAdditionalData.put(IronSourceConstants.EVENTS_PROGRAMMATIC, 1);
} catch (Exception unused) {
}
com.ironsource.mediationsdk.events.e.d().b(new com.ironsource.mediationsdk.events.d(IronSourceConstants.IS_CHECK_CAPPED_TRUE, mediationAdditionalData));
}
return z11;
}
public final void R() {
InterfaceC2056s b0Var;
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in programmatic mode", 0);
List<NetworkSettings> a02 = a0();
if (a02.size() > 0) {
com.ironsource.mediationsdk.model.s sVar = this.f45269f.f45163c.f44862a;
if (sVar.f44913k.f45095n) {
b0Var = new c0(a02, sVar, this.f45271g, IronSourceUtils.getUserIdForNetworks(), com.ironsource.d.a.a().b(), this.C);
} else {
b0Var = new b0(a02, sVar, this.f45271g, IronSourceUtils.getUserIdForNetworks(), com.ironsource.d.a.a().b(), this.C);
}
this.R = b0Var;
Boolean bool = this.f45293v;
if (bool != null) {
this.R.a(this.f45292u, bool.booleanValue());
return;
}
return;
}
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.f45264c0);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
r(IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.REWARDED_VIDEO, false);
}
public final boolean S(String str) {
if (!j()) {
return false;
}
BannerPlacement bannerPlacement = null;
try {
bannerPlacement = this.f45269f.f45163c.f44865d.a(str);
if (bannerPlacement == null && (bannerPlacement = this.f45269f.f45163c.f44865d.a()) == null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Banner default placement was not found", 3);
return false;
}
} catch (Exception e11) {
e11.printStackTrace();
}
if (bannerPlacement == null) {
return false;
}
return com.ironsource.mediationsdk.utils.j.b(ContextProvider.getInstance().getApplicationContext(), bannerPlacement.getF44790b());
}
public int T(String str) {
com.ironsource.mediationsdk.model.j jVar;
Placement placement;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if (kVar != null && (jVar = kVar.f45163c) != null && jVar.f44862a != null) {
try {
placement = V(str);
if (placement == null) {
try {
placement = I();
if (placement == null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Default placement was not found", 3);
}
} catch (Exception e11) {
e = e11;
e.printStackTrace();
if (placement != null) {
}
}
}
} catch (Exception e12) {
e = e12;
placement = null;
}
if (placement != null) {
return j.a.f45154d;
}
return com.ironsource.mediationsdk.utils.j.b(ContextProvider.getInstance().getApplicationContext(), placement);
}
return j.a.f45154d;
}
public final void U() {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i11 = 0; i11 < this.f45269f.f45157a.f44898a.size(); i11++) {
String str = this.f45269f.f45157a.f44898a.get(i11);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.f45269f.f45160b.a(str));
}
}
if (arrayList.size() > 0) {
synchronized (this.f45268e0) {
this.f45274h0 = new com.ironsource.mediationsdk.demandOnly.e(arrayList, this.f45269f.f45163c.f44862a, this.f45271g, this.f45273h);
}
if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
u(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
Iterator<String> it = this.f45268e0.iterator();
while (it.hasNext()) {
this.f45274h0.a(it.next(), (String) null, false);
}
this.f45268e0.clear();
return;
}
u(IronSource.AD_UNIT.REWARDED_VIDEO, false);
}
public final Placement V(String str) {
com.ironsource.mediationsdk.model.s sVar = this.f45269f.f45163c.f44862a;
if (sVar != null) {
Iterator<Placement> it = sVar.f44903a.iterator();
while (it.hasNext()) {
Placement next = it.next();
if (next.getF44790b().equals(str)) {
return next;
}
}
}
return null;
}
public final void W() {
if (this.F) {
U();
return;
}
com.ironsource.mediationsdk.model.s sVar = this.f45269f.f45163c.f44862a;
this.Y = sVar.f44913k.f45082a;
this.f45264c0 = n(sVar);
if (!this.W && !this.Y) {
R();
} else {
X();
}
}
public final void X() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> a02 = a0();
if (a02.size() > 0) {
com.ironsource.mediationsdk.adunit.c.h hVar = new com.ironsource.mediationsdk.adunit.c.h(a02, this.f45269f.f45163c.f44862a, IronSourceUtils.getUserIdForNetworks(), this.W, com.ironsource.d.a.a().b(), this.C, this.f45269f.d());
this.A = hVar;
Boolean bool = this.f45293v;
if (bool != null) {
hVar.b(bool.booleanValue());
}
if (this.X && this.W) {
this.X = false;
this.A.j();
return;
}
return;
}
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.f45264c0);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
r(IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.REWARDED_VIDEO, false);
}
public final void Y(String str) {
Placement placement;
com.ironsource.mediationsdk.adunit.c.h hVar;
InterfaceC2056s interfaceC2056s;
try {
placement = V(str);
if (placement == null) {
try {
placement = I();
} catch (Exception e11) {
e = e11;
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, "showProgrammaticRewardedVideo()", e);
hVar = this.A;
if (hVar == null) {
}
interfaceC2056s = this.R;
if (interfaceC2056s == null) {
}
}
}
if (placement == null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "showProgrammaticRewardedVideo error: empty default placement in response", 3);
Q.a().a(new IronSourceError(1021, "showProgrammaticRewardedVideo error: empty default placement in response"), (AdInfo) null);
return;
}
} catch (Exception e12) {
e = e12;
placement = null;
}
hVar = this.A;
if (hVar == null && (this.W || this.Y)) {
hVar.a(placement);
return;
}
interfaceC2056s = this.R;
if (interfaceC2056s == null) {
interfaceC2056s.a(placement);
return;
}
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "showProgrammaticRewardedVideo - show called before init completed, managers not initiated yet", 3);
Q.a().a(new IronSourceError(1023, "showProgrammaticRewardedVideo - show called before init completed, managers not initiated yet"), (AdInfo) null);
}
public final InterstitialPlacement Z(String str) {
com.ironsource.mediationsdk.model.l lVar = this.f45269f.f45163c.f44863b;
if (lVar != null) {
Iterator<InterstitialPlacement> it = lVar.f44868a.iterator();
while (it.hasNext()) {
InterstitialPlacement next = it.next();
if (next.getF44790b().equals(str)) {
return next;
}
}
}
return null;
}
public final IronSourceBannerLayout a(Activity activity, ISBannerSize iSBannerSize) {
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "createBanner()", 1);
if (activity == null) {
this.f45267e.log(ironSourceTag, "createBanner() : Activity cannot be null", 3);
return null;
}
ContextProvider.getInstance().updateActivity(activity);
return new IronSourceBannerLayout(activity, iSBannerSize);
}
public final List<NetworkSettings> a0() {
ArrayList arrayList = new ArrayList();
for (int i11 = 0; i11 < this.f45269f.f45157a.f44898a.size(); i11++) {
String str = this.f45269f.f45157a.f44898a.get(i11);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.f45269f.f45160b.a(str));
}
}
return arrayList;
}
public final String b(Context context) {
String str;
com.ironsource.mediationsdk.utils.o oVar;
r(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_CALLED, null);
if (context == null) {
IronLog.API.error("bidding data cannot be retrieved, context required");
return null;
}
D.f b11 = D.a().b();
D.f fVar = D.f.NOT_INIT;
if (b11 == fVar) {
IronLog.API.error("bidding data cannot be retrieved, SDK not initialized");
r(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, null);
return null;
}
if (b11 == D.f.INIT_FAILED) {
IronLog.API.error("bidding data cannot be retrieved, SDK failed to initialize");
r(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, null);
return null;
}
try {
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if (kVar == null) {
kVar = InitServerResponse.a(context);
}
if (b11 == fVar) {
this.f45280k0.a(context);
this.f45280k0.b(IronSourceUtils.getSDKVersion());
this.f45280k0.c(this.f45283m);
this.f45280k0.d(ConfigFile.getConfigFile().getPluginType());
this.f45280k0.a(ISAdPlayer.a());
this.f45280k0.b(IronSourceUtils.isGooglePlayInstalled(context));
}
if (b11 != D.f.INITIATED) {
D.a().a(kVar);
if (kVar != null) {
D.a().a(context, kVar);
}
}
if (kVar == null || !kVar.b()) {
oVar = new com.ironsource.mediationsdk.utils.o();
} else {
oVar = kVar.f45163c.f44866e.f44819c;
if (!oVar.f45253d) {
oVar.f45251b = kVar.f45160b.a(IronSourceConstants.IRONSOURCE_CONFIG_NAME);
}
}
JSONObject a11 = TokenRepository.a(context, oVar);
C2047d.a().a(a11, true);
str = oVar.f45254e ? IronSourceAES.compressAndEncrypt(a11.toString()) : IronSourceAES.encrypt(a11.toString());
} catch (Throwable th2) {
r(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_ENRICH_TOKEN_ERROR, null);
IronLog.API.error("got error during token creation: " + th2.getMessage());
str = null;
}
if (str == null) {
r(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, null);
}
return str;
}
public final List<NetworkSettings> b0() {
ArrayList arrayList = new ArrayList();
for (int i11 = 0; i11 < this.f45269f.f45157a.f44899b.size(); i11++) {
String str = this.f45269f.f45157a.f44899b.get(i11);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.f45269f.f45160b.a(str));
}
}
return arrayList;
}
public final void c() {
if (this.H) {
e();
return;
}
boolean z11 = this.f45269f.f45163c.f44865d.f44858h.f45082a;
this.f45262b0 = z11;
if (z11) {
k0();
} else {
j0();
}
}
public final void c0(String str) {
try {
InterstitialPlacement Z = Z(str);
if (Z == null) {
Z = L();
}
if (Z == null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "showProgrammaticInterstitial error: empty default placement in response", 3);
C2057t.a().a(new IronSourceError(1020, "showProgrammaticInterstitial error: empty default placement in response"), (AdInfo) null);
} else if (this.Z) {
this.f45297z.a(new Placement(Z));
} else {
this.S.a(Z.getF44790b());
}
} catch (Exception e11) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, "showProgrammaticInterstitial()", e11);
}
}
public final synchronized void d(Activity activity, String str, String str2) {
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "loadISDemandOnlyInterstitial() instanceId=" + str, 1);
try {
} catch (Throwable th2) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, "loadDemandOnlyInterstitial", th2);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, new IronSourceError(510, th2.getMessage()));
}
if (!this.J) {
this.f45267e.log(ironSourceTag, "initISDemandOnly() must be called before loadISDemandOnlyInterstitial()", 3);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, new IronSourceError(510, "initISDemandOnly() must be called before loadISDemandOnlyInterstitial()"));
return;
}
if (!this.G) {
this.f45267e.log(ironSourceTag, "Interstitial was initialized in mediation mode. Use loadInterstitial instead", 3);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, new IronSourceError(510, "Interstitial was initialized in mediation mode. Use loadInterstitial instead"));
return;
}
boolean z11 = false;
if (activity != null) {
ContextProvider.getInstance().updateActivity(activity);
} else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
if (str2 != null) {
z11 = true;
}
F(IronSourceConstants.TROUBLESHOOTING_DO_CALLED_IS_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, z11, 1));
this.f45267e.log(ironSourceTag, "Interstitial was initialized and loaded without Activity", 3);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, new IronSourceError(IronSourceError.ERROR_DO_IS_LOAD_MISSING_ACTIVITY, "Interstitial was initialized and loaded without Activity"));
return;
}
D.f b11 = D.a().b();
if (b11 == D.f.INIT_FAILED) {
this.f45267e.log(ironSourceTag, "init() had failed", 3);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
return;
}
if (b11 == D.f.INIT_IN_PROGRESS) {
if (D.a().c()) {
this.f45267e.log(ironSourceTag, "init() had failed", 3);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
return;
}
synchronized (this.f45266d0) {
this.f45266d0.add(str);
}
if (str2 != null) {
F(IronSourceConstants.TROUBLESHOOTING_DO_IAB_IS_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
}
return;
}
if (!N()) {
this.f45267e.log(ironSourceTag, "No interstitial configurations found", 3);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain interstitial data", IronSourceConstants.INTERSTITIAL_AD_UNIT));
return;
}
synchronized (this.f45266d0) {
com.ironsource.mediationsdk.demandOnly.c cVar = this.f45272g0;
if (cVar == null) {
this.f45266d0.add(str);
if (str2 != null) {
F(IronSourceConstants.TROUBLESHOOTING_DO_IAB_IS_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
}
} else if (str2 == null) {
cVar.a(str, (String) null, false);
} else {
cVar.a(str, str2, true);
}
}
}
public final List<NetworkSettings> d0() {
ArrayList arrayList = new ArrayList();
for (int i11 = 0; i11 < this.f45269f.f45157a.f44900c.size(); i11++) {
String str = this.f45269f.f45157a.f44900c.get(i11);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.f45269f.f45160b.a(str));
}
}
return arrayList;
}
public final void e() {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i11 = 0; i11 < this.f45269f.f45157a.f44900c.size(); i11++) {
String str = this.f45269f.f45157a.f44900c.get(i11);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.f45269f.f45160b.a(str));
}
}
if (arrayList.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
F(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.BANNER, false);
return;
}
synchronized (this.f45270f0) {
this.f45276i0 = new com.ironsource.sdk.f.a(arrayList, this.f45269f.f45163c.f44865d, this.f45271g, this.f45273h);
}
Iterator<String> it = this.f45270f0.iterator();
while (it.hasNext()) {
String next = it.next();
this.f45276i0.a(this.M.get(next), next);
}
this.M.clear();
this.f45270f0.clear();
}
public final void f() {
if (this.N.booleanValue()) {
IronLog.INTERNAL.verbose("load banner after init");
this.N = Boolean.FALSE;
a(this.O, this.P);
this.O = null;
this.P = null;
}
}
public final int f0(String str) {
com.ironsource.mediationsdk.model.j jVar;
InterstitialPlacement interstitialPlacement;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if (kVar != null && (jVar = kVar.f45163c) != null && jVar.f44863b != null) {
try {
interstitialPlacement = Z(str);
if (interstitialPlacement == null) {
try {
interstitialPlacement = L();
if (interstitialPlacement == null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Default placement was not found", 3);
}
} catch (Exception e11) {
e = e11;
e.printStackTrace();
if (interstitialPlacement != null) {
}
}
}
} catch (Exception e12) {
e = e12;
interstitialPlacement = null;
}
if (interstitialPlacement != null) {
return j.a.f45154d;
}
return com.ironsource.mediationsdk.utils.j.b(ContextProvider.getInstance().getApplicationContext(), interstitialPlacement);
}
return j.a.f45154d;
}
public final boolean g() {
com.ironsource.mediationsdk.model.q qVar;
ArrayList<String> arrayList;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
return (kVar == null || (qVar = kVar.f45157a) == null || (arrayList = qVar.f44898a) == null || arrayList.size() <= 0) ? false : true;
}
public final void g0() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> b02 = b0();
if (b02.size() > 0) {
com.ironsource.mediationsdk.adunit.c.g gVar = new com.ironsource.mediationsdk.adunit.c.g(b02, this.f45269f.f45163c.f44863b, IronSourceUtils.getUserIdForNetworks(), com.ironsource.d.a.a().b(), this.C, this.f45269f.d());
this.f45297z = gVar;
Boolean bool = this.f45293v;
if (bool != null) {
gVar.b(bool.booleanValue());
}
if (this.f45260a0) {
this.f45260a0 = false;
this.f45297z.j();
return;
}
return;
}
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
F(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.INTERSTITIAL, false);
}
public final void h(String str) {
String str2 = "showInterstitial(" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
try {
if (this.G) {
this.f45267e.log(ironSourceTag, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead", 3);
C2057t.a().a(new IronSourceError(510, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead"), (AdInfo) null);
} else if (M()) {
c0(str);
} else {
C2057t.a().a(ErrorBuilder.buildInitFailedError("showInterstitial can't be called before the Interstitial ad unit initialization completed successfully", IronSourceConstants.INTERSTITIAL_AD_UNIT), (AdInfo) null);
}
} catch (Exception e11) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, str2, e11);
C2057t.a().a(new IronSourceError(510, e11.getMessage()), (AdInfo) null);
}
}
public final BannerPlacement h0(String str) {
com.ironsource.mediationsdk.model.h hVar = this.f45269f.f45163c.f44865d;
if (hVar == null) {
return new EmptyBannerPlacement();
}
if (TextUtils.isEmpty(str)) {
return hVar.a();
}
BannerPlacement a11 = hVar.a(str);
if (a11 != null) {
return a11;
}
return hVar.a();
}
public final boolean i() {
com.ironsource.mediationsdk.model.q qVar;
ArrayList<String> arrayList;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
return (kVar == null || (qVar = kVar.f45157a) == null || (arrayList = qVar.f44899b) == null || arrayList.size() <= 0) ? false : true;
}
public final void i0() {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "Adunit: Interstitial is now initiated - programmatic mode", 0);
List<NetworkSettings> b02 = b0();
if (b02.size() > 0) {
a0 a0Var = new a0(b02, this.f45269f.f45163c.f44863b, this.f45271g, IronSourceUtils.getUserIdForNetworks(), this.f45269f.f45163c.f44863b.f44873f, com.ironsource.d.a.a().b(), this.C);
this.S = a0Var;
Boolean bool = this.f45293v;
if (bool != null) {
a0Var.a(bool.booleanValue());
}
if (this.f45260a0) {
this.f45260a0 = false;
this.S.d();
return;
}
return;
}
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
F(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.INTERSTITIAL, false);
}
public final boolean j() {
com.ironsource.mediationsdk.model.j jVar;
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
return (kVar == null || (jVar = kVar.f45163c) == null || jVar.f44865d == null) ? false : true;
}
public final void j0() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> d02 = d0();
if (d02.size() > 0) {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in programmatic mode", 0);
this.T = new G(d02, new com.ironsource.mediationsdk.utils.j(this.f45271g, IronSourceUtils.getUserIdForNetworks(), this.f45269f.f45163c.f44865d), com.ironsource.d.a.a().b(), this.C);
f();
} else {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
F(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.BANNER, false);
}
}
public final boolean k() {
com.ironsource.mediationsdk.model.q qVar;
ArrayList<String> arrayList;
if (j()) {
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if ((kVar == null || (qVar = kVar.f45157a) == null || (arrayList = qVar.f44900c) == null || arrayList.size() <= 0) ? false : true) {
return true;
}
}
return false;
}
public final void k0() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> d02 = d0();
if (d02.size() > 0) {
this.B = new com.ironsource.mediationsdk.adunit.c.c(d02, this.f45269f.f45163c.f44865d, IronSourceUtils.getUserIdForNetworks(), com.ironsource.d.a.a().b(), this.C, this.f45269f.d());
f();
} else {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
F(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.BANNER, false);
}
}
public final Placement l(String str) {
try {
Placement V = V(str);
if (V == null) {
try {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
V = I();
} catch (Exception unused) {
return V;
}
}
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "getPlacementInfo(placement: " + str + "):" + V, 1);
return V;
} catch (Exception unused2) {
return null;
}
}
public final void l0() {
this.f45267e.log(IronSourceLogger.IronSourceTag.INTERNAL, "Interstitial started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i11 = 0; i11 < this.f45269f.f45157a.f44899b.size(); i11++) {
String str = this.f45269f.f45157a.f44899b.get(i11);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.f45269f.f45160b.a(str));
}
}
if (arrayList.size() > 0) {
synchronized (this.f45266d0) {
this.f45272g0 = new com.ironsource.mediationsdk.demandOnly.c(arrayList, this.f45269f.f45163c.f44863b, this.f45271g, this.f45273h);
}
Iterator<String> it = this.f45266d0.iterator();
while (it.hasNext()) {
this.f45272g0.a(it.next(), (String) null, false);
}
this.f45266d0.clear();
return;
}
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
F(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
u(IronSource.AD_UNIT.INTERSTITIAL, false);
}
public final void m() {
if (this.U != null && this.V.compareAndSet(false, true)) {
IronLog.CALLBACK.verbose("onInitializationCompleted()");
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(IronSourceConstants.TROUBLESHOOTING_INIT_COMPLETED, IronSourceUtils.getMediationAdditionalData(false)));
this.U.onInitializationComplete();
}
}
public final void m0() {
if (this.G) {
l0();
return;
}
boolean z11 = this.f45269f.f45163c.f44863b.f44874g.f45082a;
this.Z = z11;
if (z11) {
g0();
} else {
i0();
}
}
public final int n(com.ironsource.mediationsdk.model.s sVar) {
boolean z11;
if (!this.Y && !this.W && sVar.f44913k.f45095n) {
z11 = true;
} else {
z11 = false;
}
if (!z11) {
return 1;
}
return 2;
}
public final IronSourceError o(D.f fVar) {
if (!this.K) {
return new IronSourceError(510, "ironSource SDK was not initialized");
}
if (!this.H) {
return new IronSourceError(510, "ironSource SDK was not initialized using Demand Only mode");
}
if (fVar == D.f.INIT_FAILED) {
return new IronSourceError(510, "ironSource initialization failed");
}
if (fVar == D.f.INIT_IN_PROGRESS && D.a().c()) {
return new IronSourceError(510, "ironSource initialization in progress");
}
return null;
}
public final com.ironsource.mediationsdk.utils.k q(Context context, String str, a aVar) {
boolean z11;
boolean z12;
boolean z13;
boolean z14;
com.ironsource.mediationsdk.events.i d11;
int i11;
com.ironsource.mediationsdk.events.e d12;
int i12;
synchronized (this.f45287p) {
com.ironsource.mediationsdk.utils.k kVar = this.f45269f;
if (kVar != null) {
return new com.ironsource.mediationsdk.utils.k(kVar);
}
com.ironsource.mediationsdk.utils.k E = E(context, str, aVar);
if (E == null || !E.b()) {
IronSourceLoggerManager logger = IronSourceLoggerManager.getLogger();
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
logger.log(ironSourceTag, "Null or invalid response. Trying to get cached response", 0);
E = p(context, this.f45271g);
if (E != null) {
IronSourceError buildUsingCachedConfigurationError = ErrorBuilder.buildUsingCachedConfigurationError(this.f45271g, str);
this.f45267e.log(ironSourceTag, buildUsingCachedConfigurationError.toString() + ": " + E.toString(), 1);
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(IronSourceConstants.USING_CACHE_FOR_INIT_EVENT, IronSourceUtils.getMediationAdditionalData(false)));
}
}
if (E != null) {
this.f45269f = E;
IronSourceUtils.saveLastResponse(context, E.toString());
com.ironsource.mediationsdk.utils.k kVar2 = this.f45269f;
this.f45285n.setDebugLevel(kVar2.f45163c.f44866e.f44817a.f44847a);
this.f45267e.setLoggerDebugLevel("console", kVar2.f45163c.f44866e.f44817a.f44848b);
if (J()) {
z11 = kVar2.f45163c.f44862a.f44904b.f44833a;
} else {
z11 = false;
}
if (M()) {
z12 = kVar2.f45163c.f44863b.f44869b.f44833a;
} else {
z12 = false;
}
if (j()) {
z13 = kVar2.f45163c.f44865d.f44851a.f44833a;
} else {
z13 = false;
}
if (O()) {
z14 = kVar2.f45163c.f44864c.f44880c.f44833a;
} else {
z14 = false;
}
PixelSettings pixelSettings = kVar2.f45163c.f44866e.f44824h;
boolean f45142a = pixelSettings.getF45142a();
if (z11) {
com.ironsource.mediationsdk.model.e eVar = kVar2.f45163c.f44862a.f44904b;
com.ironsource.mediationsdk.events.i.d().b(eVar.f44837e, context);
com.ironsource.mediationsdk.events.i.d().a(eVar.f44836d, context);
com.ironsource.mediationsdk.events.i.d().b(eVar.f44839g);
com.ironsource.mediationsdk.events.i.d().c(eVar.f44840h);
com.ironsource.mediationsdk.events.i.d().a(eVar.f44838f);
com.ironsource.mediationsdk.events.i.d().a(eVar.f44841i, context);
com.ironsource.mediationsdk.events.i.d().b(eVar.f44842j, context);
com.ironsource.mediationsdk.events.i.d().c(eVar.f44843k, context);
com.ironsource.mediationsdk.events.i.d().d(eVar.f44844l, context);
com.ironsource.mediationsdk.events.i.d().a(kVar2.f45163c.f44866e.f44818b);
com.ironsource.mediationsdk.events.i.d().f44599c = eVar.f44834b;
d11 = com.ironsource.mediationsdk.events.i.d();
i11 = eVar.f44835c;
} else if (z14) {
com.ironsource.mediationsdk.model.e eVar2 = kVar2.f45163c.f44864c.f44880c;
com.ironsource.mediationsdk.events.i.d().b(eVar2.f44837e, context);
com.ironsource.mediationsdk.events.i.d().a(eVar2.f44836d, context);
com.ironsource.mediationsdk.events.i.d().b(eVar2.f44839g);
com.ironsource.mediationsdk.events.i.d().c(eVar2.f44840h);
com.ironsource.mediationsdk.events.i.d().a(eVar2.f44838f);
com.ironsource.mediationsdk.events.i.d().a(eVar2.f44841i, context);
com.ironsource.mediationsdk.events.i.d().b(eVar2.f44842j, context);
com.ironsource.mediationsdk.events.i.d().c(eVar2.f44843k, context);
com.ironsource.mediationsdk.events.i.d().d(eVar2.f44844l, context);
com.ironsource.mediationsdk.events.i.d().a(kVar2.f45163c.f44866e.f44818b);
com.ironsource.mediationsdk.events.i.d().f44599c = eVar2.f44834b;
d11 = com.ironsource.mediationsdk.events.i.d();
i11 = eVar2.f44835c;
} else {
com.ironsource.mediationsdk.events.i.d().f44603g = false;
if (!z12) {
com.ironsource.mediationsdk.model.e eVar3 = kVar2.f45163c.f44863b.f44869b;
com.ironsource.mediationsdk.events.e.d().b(eVar3.f44837e, context);
com.ironsource.mediationsdk.events.e.d().a(eVar3.f44836d, context);
com.ironsource.mediationsdk.events.e.d().b(eVar3.f44839g);
com.ironsource.mediationsdk.events.e.d().c(eVar3.f44840h);
com.ironsource.mediationsdk.events.e.d().a(eVar3.f44838f);
com.ironsource.mediationsdk.events.e.d().a(eVar3.f44841i, context);
com.ironsource.mediationsdk.events.e.d().b(eVar3.f44842j, context);
com.ironsource.mediationsdk.events.e.d().c(eVar3.f44843k, context);
com.ironsource.mediationsdk.events.e.d().d(eVar3.f44844l, context);
com.ironsource.mediationsdk.events.e.d().a(kVar2.f45163c.f44866e.f44818b);
com.ironsource.mediationsdk.events.e.d().f44599c = eVar3.f44834b;
d12 = com.ironsource.mediationsdk.events.e.d();
i12 = eVar3.f44835c;
} else if (z13) {
com.ironsource.mediationsdk.model.e eVar4 = kVar2.f45163c.f44865d.f44851a;
com.ironsource.mediationsdk.events.e.d().b(eVar4.f44837e, context);
com.ironsource.mediationsdk.events.e.d().a(eVar4.f44836d, context);
com.ironsource.mediationsdk.events.e.d().b(eVar4.f44839g);
com.ironsource.mediationsdk.events.e.d().c(eVar4.f44840h);
com.ironsource.mediationsdk.events.e.d().a(eVar4.f44838f);
com.ironsource.mediationsdk.events.e.d().a(eVar4.f44841i, context);
com.ironsource.mediationsdk.events.e.d().b(eVar4.f44842j, context);
com.ironsource.mediationsdk.events.e.d().c(eVar4.f44843k, context);
com.ironsource.mediationsdk.events.e.d().d(eVar4.f44844l, context);
com.ironsource.mediationsdk.events.e.d().a(kVar2.f45163c.f44866e.f44818b);
com.ironsource.mediationsdk.events.e.d().f44599c = eVar4.f44834b;
d12 = com.ironsource.mediationsdk.events.e.d();
i12 = eVar4.f44835c;
} else {
com.ironsource.mediationsdk.events.e.d().f44603g = false;
PixelEventsManager pixelEventsManager = PixelEventsManager.f44646x;
pixelEventsManager.f44603g = f45142a;
if (f45142a) {
pixelEventsManager.a(pixelSettings.getF45143b(), context);
pixelEventsManager.a(pixelSettings.getF45146e(), context);
pixelEventsManager.b(pixelSettings.getF45147f(), context);
pixelEventsManager.f44599c = pixelSettings.getF45144c();
pixelEventsManager.f44600d = pixelSettings.getF45145d();
}
com.ironsource.mediationsdk.events.e.d().f44597a = true;
com.ironsource.mediationsdk.events.i.d().f44597a = true;
pixelEventsManager.f44597a = true;
}
d12.f44600d = i12;
PixelEventsManager pixelEventsManager2 = PixelEventsManager.f44646x;
pixelEventsManager2.f44603g = f45142a;
if (f45142a) {
}
com.ironsource.mediationsdk.events.e.d().f44597a = true;
com.ironsource.mediationsdk.events.i.d().f44597a = true;
pixelEventsManager2.f44597a = true;
}
d11.f44600d = i11;
if (!z12) {
}
d12.f44600d = i12;
PixelEventsManager pixelEventsManager22 = PixelEventsManager.f44646x;
pixelEventsManager22.f44603g = f45142a;
if (f45142a) {
}
com.ironsource.mediationsdk.events.e.d().f44597a = true;
com.ironsource.mediationsdk.events.i.d().f44597a = true;
pixelEventsManager22.f44597a = true;
}
return E;
}
}
public final synchronized void s(AbstractAdapter abstractAdapter) {
this.f45263c = abstractAdapter;
}
public final void t(IronSource.AD_UNIT ad_unit) {
String str = ad_unit + " ad unit has already been initialized";
this.f45267e.log(IronSourceLogger.IronSourceTag.API, str, 3);
IronSourceUtils.sendAutomationLog(str);
}
public final void u(IronSource.AD_UNIT ad_unit, boolean z11) {
int i11 = c.f45299a[ad_unit.ordinal()];
if (i11 != 1) {
if (i11 != 2) {
if (i11 != 3) {
if (i11 == 4) {
if (this.H) {
Iterator<String> it = this.f45270f0.iterator();
while (it.hasNext()) {
String next = it.next();
ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout = this.M.get(next);
if (iSDemandOnlyBannerLayout != null) {
iSDemandOnlyBannerLayout.getListener().a(next, ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", IronSourceConstants.BANNER_AD_UNIT));
}
}
this.f45270f0.clear();
return;
}
if (this.N.booleanValue()) {
this.N = Boolean.FALSE;
C2053p.a().a(IronSource.AD_UNIT.BANNER, new IronSourceError(602, "Init had failed"));
this.O = null;
this.P = null;
return;
}
return;
}
return;
}
if (z11 || O() || this.f45295x.contains(ad_unit)) {
this.f45281l.onOfferwallAvailable(false);
return;
}
return;
}
if (this.G) {
Iterator<String> it2 = this.f45266d0.iterator();
while (it2.hasNext()) {
com.ironsource.mediationsdk.demandOnly.h.a().a(it2.next(), ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
}
this.f45266d0.clear();
return;
}
if (this.f45260a0) {
this.f45260a0 = false;
C2053p.a().a(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
return;
}
return;
}
if (this.F) {
Iterator<String> it3 = this.f45268e0.iterator();
while (it3.hasNext()) {
com.ironsource.mediationsdk.demandOnly.i.a().a(it3.next(), ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
this.f45268e0.clear();
return;
}
if (this.W) {
if (this.X) {
this.X = false;
C2053p.a().a(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
return;
}
if (!z11 && !J() && !this.f45295x.contains(ad_unit)) {
return;
}
Q.a().a(false, (AdInfo) null);
}
public final synchronized void y(boolean z11, IronSource.AD_UNIT... ad_unitArr) {
int i11 = 0;
for (IronSource.AD_UNIT ad_unit : ad_unitArr) {
if (ad_unit.equals(IronSource.AD_UNIT.INTERSTITIAL)) {
this.J = true;
} else if (ad_unit.equals(IronSource.AD_UNIT.BANNER)) {
this.K = true;
} else if (ad_unit.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
this.I = true;
}
}
if (D.a().b() == D.f.INIT_FAILED) {
try {
if (this.f45281l != null) {
int length = ad_unitArr.length;
while (i11 < length) {
IronSource.AD_UNIT ad_unit2 = ad_unitArr[i11];
if (!this.f45294w.contains(ad_unit2)) {
u(ad_unit2, true);
}
i11++;
}
}
return;
} catch (Exception e11) {
e11.printStackTrace();
return;
}
}
if (!this.f45290s) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z11);
int length2 = ad_unitArr.length;
boolean z12 = false;
while (i11 < length2) {
IronSource.AD_UNIT ad_unit3 = ad_unitArr[i11];
if (!this.f45294w.contains(ad_unit3)) {
this.f45294w.add(ad_unit3);
this.f45295x.add(ad_unit3);
try {
mediationAdditionalData.put(ad_unit3.toString(), true);
} catch (Exception e12) {
e12.printStackTrace();
}
z12 = true;
} else {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, ad_unit3 + " ad unit has started initializing.", 3);
}
i11++;
}
if (z12) {
int i12 = this.E + 1;
this.E = i12;
x(z11, i12, mediationAdditionalData);
}
return;
}
D.a().b(z11);
if (this.f45291t == null) {
return;
}
JSONObject mediationAdditionalData2 = IronSourceUtils.getMediationAdditionalData(z11);
boolean z13 = false;
for (IronSource.AD_UNIT ad_unit4 : ad_unitArr) {
if (!this.f45294w.contains(ad_unit4)) {
this.f45294w.add(ad_unit4);
this.f45295x.add(ad_unit4);
try {
mediationAdditionalData2.put(ad_unit4.toString(), true);
} catch (Exception e13) {
e13.printStackTrace();
}
List<IronSource.AD_UNIT> list = this.f45291t;
if (list != null && list.contains(ad_unit4)) {
G(ad_unit4);
} else {
u(ad_unit4, false);
}
z13 = true;
} else {
t(ad_unit4);
}
}
if (z13) {
int i13 = this.E + 1;
this.E = i13;
x(z11, i13, mediationAdditionalData2);
}
return;
}
public final boolean z(ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, String str) {
synchronized (this.f45270f0) {
if (this.f45276i0 == null) {
if (!this.f45270f0.contains(str)) {
this.f45270f0.add(str);
}
this.M.put(str, iSDemandOnlyBannerLayout);
return true;
}
return false;
}
}
public y(byte b11) {
this();
}
public static y a() {
return d.f45301a;
}
@Override
public final void b() {
if (this.N.booleanValue()) {
this.N = Boolean.FALSE;
C2053p.a().a(IronSource.AD_UNIT.BANNER, new IronSourceError(603, "init had failed"));
this.O = null;
this.P = null;
}
if (this.f45260a0) {
this.f45260a0 = false;
C2053p.a().a(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
}
if (this.X) {
this.X = false;
C2053p.a().a(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
synchronized (this.f45266d0) {
Iterator<String> it = this.f45266d0.iterator();
while (it.hasNext()) {
com.ironsource.mediationsdk.demandOnly.h.a().a(it.next(), ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
}
this.f45266d0.clear();
}
synchronized (this.f45268e0) {
Iterator<String> it2 = this.f45268e0.iterator();
while (it2.hasNext()) {
com.ironsource.mediationsdk.demandOnly.i.a().a(it2.next(), ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
this.f45268e0.clear();
}
synchronized (this.f45270f0) {
Iterator<String> it3 = this.f45270f0.iterator();
while (it3.hasNext()) {
String next = it3.next();
ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout = this.M.get(next);
if (iSDemandOnlyBannerLayout != null) {
iSDemandOnlyBannerLayout.getListener().a(next, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.BANNER_AD_UNIT));
}
}
this.f45270f0.clear();
this.M.clear();
}
}
public final synchronized void c(Activity activity, String str, String str2) {
if (str2 != null) {
d(activity, str, str2);
} else {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "adm cannot be null", 3);
com.ironsource.mediationsdk.demandOnly.h.a().a(str, new IronSourceError(510, "adm cannot be null"));
}
}
public final void d(String str) {
try {
String str2 = this.f45259a + ":setMediationType(mediationType:" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
if (B(str, 1, 64) && e0(str)) {
this.f45279k = str;
} else {
this.f45267e.log(ironSourceTag, " mediationType value is invalid - should be alphanumeric and 1-64 chars in length", 1);
}
} catch (Exception e11) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, this.f45259a + ":setMediationType(mediationType:" + str + ")", e11);
}
}
public final void e(String str) {
String str2 = "showRewardedVideo(" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
try {
if (this.F) {
this.f45267e.log(ironSourceTag, "Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", 3);
Q.a().a(ErrorBuilder.buildInitFailedError("Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", IronSourceConstants.REWARDED_VIDEO_AD_UNIT), (AdInfo) null);
} else if (J()) {
Y(str);
} else {
Q.a().a(ErrorBuilder.buildInitFailedError("showRewardedVideo can't be called before the Rewarded Video ad unit initialization completed successfully", IronSourceConstants.REWARDED_VIDEO_AD_UNIT), (AdInfo) null);
}
} catch (Exception e11) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, str2, e11);
Q.a().a(new IronSourceError(510, e11.getMessage()), (AdInfo) null);
}
}
public final synchronized void f(String str) {
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "showISDemandOnlyRewardedVideo() instanceId=" + str, 1);
try {
} catch (Exception e11) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, "showISDemandOnlyRewardedVideo", e11);
com.ironsource.mediationsdk.demandOnly.i.a().b(str, new IronSourceError(510, e11.getMessage()));
}
if (!this.F) {
this.f45267e.log(ironSourceTag, "Rewarded video was initialized in mediation mode. Use showRewardedVideo instead", 3);
com.ironsource.mediationsdk.demandOnly.i.a().b(str, new IronSourceError(508, "Rewarded video was initialized in mediation mode. Use showRewardedVideo instead"));
return;
}
com.ironsource.mediationsdk.demandOnly.e eVar = this.f45274h0;
if (eVar == null) {
this.f45267e.log(ironSourceTag, "Rewarded video was not initiated", 3);
com.ironsource.mediationsdk.demandOnly.i.a().b(str, new IronSourceError(508, "Rewarded video was not initiated"));
} else if (eVar.f44540a.containsKey(str)) {
com.ironsource.mediationsdk.demandOnly.f fVar = eVar.f44540a.get(str);
eVar.a(IronSourceConstants.RV_INSTANCE_SHOW, fVar);
fVar.a();
} else {
com.ironsource.mediationsdk.demandOnly.e.a(1500, str);
com.ironsource.mediationsdk.demandOnly.i.a().b(str, ErrorBuilder.buildNonExistentInstanceError(IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
}
public final synchronized boolean g(String str) {
boolean z11;
com.ironsource.mediationsdk.demandOnly.e eVar = this.f45274h0;
if (eVar != null) {
if (eVar.f44540a.containsKey(str)) {
com.ironsource.mediationsdk.demandOnly.f fVar = eVar.f44540a.get(str);
if (fVar.b()) {
com.ironsource.mediationsdk.demandOnly.e.a(IronSourceConstants.RV_INSTANCE_READY_TRUE, fVar, (Object[][]) null);
z11 = true;
if (z11) {
return true;
}
} else {
com.ironsource.mediationsdk.demandOnly.e.a(IronSourceConstants.RV_INSTANCE_READY_FALSE, fVar, (Object[][]) null);
}
} else {
com.ironsource.mediationsdk.demandOnly.e.a(1500, str);
}
z11 = false;
if (z11) {
}
}
return false;
}
public final boolean h() {
boolean z11;
a0 a0Var;
com.ironsource.mediationsdk.adunit.c.g gVar;
try {
if (this.G) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Interstitial was initialized in demand only mode. Use isISDemandOnlyInterstitialReady instead", 3);
return false;
}
boolean z12 = !this.Z ? (a0Var = this.S) == null || !a0Var.e() : (gVar = this.f45297z) == null || !gVar.h();
try {
com.ironsource.mediationsdk.events.e.d().b(new com.ironsource.mediationsdk.events.d(z12 ? IronSourceConstants.IS_CHECK_READY_TRUE : IronSourceConstants.IS_CHECK_READY_FALSE, IronSourceUtils.getMediationAdditionalData(false, true, 1)));
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "isInterstitialReady():" + z12, 1);
return z12;
} catch (Throwable th2) {
z11 = z12;
th = th2;
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "isInterstitialReady():" + z11, 1);
this.f45267e.logException(ironSourceTag, "isInterstitialReady()", th);
return false;
}
} catch (Throwable th3) {
th = th3;
z11 = false;
}
}
public final synchronized boolean i(String str) {
boolean z11;
com.ironsource.mediationsdk.demandOnly.c cVar = this.f45272g0;
if (cVar != null) {
if (cVar.f44536a.containsKey(str)) {
com.ironsource.mediationsdk.demandOnly.d dVar = cVar.f44536a.get(str);
if (dVar.b()) {
com.ironsource.mediationsdk.demandOnly.c.a(IronSourceConstants.IS_INSTANCE_READY_TRUE, dVar, (Object[][]) null);
z11 = true;
if (z11) {
return true;
}
} else {
com.ironsource.mediationsdk.demandOnly.c.a(IronSourceConstants.IS_INSTANCE_READY_FALSE, dVar, (Object[][]) null);
}
} else {
com.ironsource.mediationsdk.demandOnly.c.a(2500, str);
}
z11 = false;
if (z11) {
}
}
return false;
}
public final void j(String str) {
String str2 = "showOfferwall(" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
try {
if (!O()) {
this.f45281l.onOfferwallShowFailed(ErrorBuilder.buildInitFailedError("showOfferwall can't be called before the Offerwall ad unit initialization completed successfully", IronSourceConstants.OFFERWALL_AD_UNIT));
return;
}
OfferwallPlacement a11 = this.f45269f.f45163c.f44864c.a(str);
if (a11 == null) {
this.f45267e.log(ironSourceTag, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 3);
a11 = this.f45269f.f45163c.f44864c.a();
if (a11 == null) {
this.f45267e.log(ironSourceTag, "Default placement was not found, please make sure you are using the right placements.", 3);
return;
}
}
this.f45265d.a(a11.getF44790b());
} catch (Exception e11) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, str2, e11);
this.f45281l.onOfferwallShowFailed(ErrorBuilder.buildInitFailedError("showOfferwall can't be called before the Offerwall ad unit initialization completed successfully", IronSourceConstants.OFFERWALL_AD_UNIT));
}
}
public final InterstitialPlacement k(String str) {
try {
InterstitialPlacement Z = Z(str);
if (Z == null) {
try {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
Z = L();
} catch (Exception unused) {
return Z;
}
}
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "getPlacementInfo(placement: " + str + "):" + Z, 1);
return Z;
} catch (Exception unused2) {
return null;
}
}
public final boolean l() {
try {
z zVar = this.f45265d;
if (zVar != null) {
return zVar.a();
}
return false;
} catch (Exception unused) {
return false;
}
}
public static String a(Context context) {
String C = com.ironsource.environment.h.C(context);
return !TextUtils.isEmpty(C) ? C : "";
}
public final synchronized void b(Activity activity, String str, String str2) {
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "loadISDemandOnlyRewardedVideo() instanceId=" + str, 1);
try {
} catch (Throwable th2) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, "loadISDemandOnlyRewardedVideo", th2);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, new IronSourceError(510, th2.getMessage()));
}
if (!this.I) {
this.f45267e.log(ironSourceTag, "initISDemandOnly() must be called before loadISDemandOnlyRewardedVideo()", 3);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, new IronSourceError(508, "initISDemandOnly() must be called before loadISDemandOnlyRewardedVideo()"));
return;
}
if (!this.F) {
this.f45267e.log(ironSourceTag, "Rewarded video was initialized in mediation mode", 3);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, new IronSourceError(508, "Rewarded video was initialized in mediation mode"));
return;
}
boolean z11 = false;
if (activity != null) {
ContextProvider.getInstance().updateActivity(activity);
} else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
if (str2 != null) {
z11 = true;
}
r(IronSourceConstants.TROUBLESHOOTING_DO_CALLED_RV_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, z11, 1));
this.f45267e.log(ironSourceTag, "Rewarded video was initialized and loaded without Activity", 3);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, new IronSourceError(IronSourceError.ERROR_DO_RV_LOAD_MISSING_ACTIVITY, "Rewarded video was initialized and loaded without Activity"));
return;
}
D.f b11 = D.a().b();
if (b11 == D.f.INIT_FAILED) {
this.f45267e.log(ironSourceTag, "init() had failed", 3);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
if (b11 == D.f.INIT_IN_PROGRESS) {
if (D.a().c()) {
this.f45267e.log(ironSourceTag, "init() had failed", 3);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
synchronized (this.f45268e0) {
this.f45268e0.add(str);
}
if (str2 != null) {
r(IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, this.f45264c0));
}
return;
}
if (!K()) {
this.f45267e.log(ironSourceTag, "No rewarded video configurations found", 3);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain rewarded video data", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
synchronized (this.f45268e0) {
com.ironsource.mediationsdk.demandOnly.e eVar = this.f45274h0;
if (eVar == null) {
this.f45268e0.add(str);
if (str2 != null) {
r(IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, this.f45264c0));
}
} else if (str2 == null) {
eVar.a(str, (String) null, false);
} else {
eVar.a(str, str2, true);
}
}
}
public final boolean c(String str) {
try {
String str2 = this.f45259a + ":setDynamicUserId(dynamicUserId:" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
com.ironsource.sdk.a.e eVar = new com.ironsource.sdk.a.e();
if (!B(str, 1, 128)) {
eVar.a(ErrorBuilder.buildInvalidKeyValueError(IronSourceConstants.EVENTS_DYNAMIC_USER_ID, IronSourceConstants.SUPERSONIC_CONFIG_NAME, "dynamicUserId is invalid, should be between 1-128 chars in length."));
}
if (!eVar.a()) {
IronSourceLoggerManager.getLogger().log(ironSourceTag, eVar.b().toString(), 2);
return false;
}
this.f45275i = str;
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(52, IronSourceUtils.getJsonForUserId(true)));
return true;
} catch (Exception e11) {
this.f45267e.logException(IronSourceLogger.IronSourceTag.API, this.f45259a + ":setDynamicUserId(dynamicUserId:" + str + ")", e11);
return false;
}
}
public final boolean d() {
boolean z11;
boolean z12;
try {
if (this.F) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Rewarded Video was initialized in demand only mode. Use isISDemandOnlyRewardedVideoAvailable instead", 3);
return false;
}
try {
if (!this.W && !this.Y) {
InterfaceC2056s interfaceC2056s = this.R;
if (interfaceC2056s != null) {
}
z12 = false;
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
w(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_PROGRAMMATIC, Integer.valueOf(this.f45264c0)}});
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(!z12 ? IronSourceConstants.RV_API_HAS_AVAILABILITY_TRUE : IronSourceConstants.RV_API_HAS_AVAILABILITY_FALSE, mediationAdditionalData));
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "isRewardedVideoAvailable():" + z12, 1);
return z12;
}
JSONObject mediationAdditionalData2 = IronSourceUtils.getMediationAdditionalData(false);
w(mediationAdditionalData2, new Object[][]{new Object[]{IronSourceConstants.EVENTS_PROGRAMMATIC, Integer.valueOf(this.f45264c0)}});
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(!z12 ? IronSourceConstants.RV_API_HAS_AVAILABILITY_TRUE : IronSourceConstants.RV_API_HAS_AVAILABILITY_FALSE, mediationAdditionalData2));
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "isRewardedVideoAvailable():" + z12, 1);
return z12;
} catch (Throwable th2) {
z11 = z12;
th = th2;
IronSourceLoggerManager ironSourceLoggerManager = this.f45267e;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "isRewardedVideoAvailable():" + z11, 1);
this.f45267e.logException(ironSourceTag, "isRewardedVideoAvailable()", th);
return false;
}
com.ironsource.mediationsdk.adunit.c.h hVar = this.A;
if (hVar != null) {
}
z12 = false;
} catch (Throwable th3) {
th = th3;
z11 = false;
}
}
public final synchronized void a(Activity activity, ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, String str) {
IronSourceError D = D(activity, iSDemandOnlyBannerLayout, str);
if (D != null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, D.getErrorMessage(), 3);
if (iSDemandOnlyBannerLayout != null) {
iSDemandOnlyBannerLayout.getListener().a(str, D);
}
return;
}
IronSourceError o11 = o(D.a().b());
if (o11 != null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, o11.getErrorMessage(), 3);
iSDemandOnlyBannerLayout.getListener().a(str, o11);
return;
}
ContextProvider.getInstance().updateActivity(activity);
if (H(iSDemandOnlyBannerLayout, str)) {
return;
}
if (!k()) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
iSDemandOnlyBannerLayout.getListener().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain banner data", IronSourceConstants.BANNER_AD_UNIT));
} else {
if (z(iSDemandOnlyBannerLayout, str)) {
return;
}
this.f45276i0.a(iSDemandOnlyBannerLayout, str);
}
}
public final void b(boolean z11) {
this.Q = Boolean.valueOf(z11);
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, "setConsent : " + z11, 1);
C2046c.a().a(z11);
if (this.f45263c != null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.ADAPTER_API, "Offerwall | setConsent(consent:" + z11 + ")", 1);
this.f45263c.setConsent(z11);
}
int i11 = !z11 ? 41 : 40;
this.f45280k0.a(z11);
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(i11, IronSourceUtils.getMediationAdditionalData(false)));
}
public final synchronized void a(Activity activity, ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, String str, String str2) {
IronSourceError D = D(activity, iSDemandOnlyBannerLayout, str);
if (D == null && str2 == null) {
D = new IronSourceError(510, "Missing adm");
}
if (D != null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, D.getErrorMessage(), 3);
if (iSDemandOnlyBannerLayout != null) {
iSDemandOnlyBannerLayout.getListener().a(str, D);
}
return;
}
IronSourceError o11 = o(D.a().b());
if (o11 != null) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, o11.getErrorMessage(), 3);
iSDemandOnlyBannerLayout.getListener().a(str, o11);
return;
}
ContextProvider.getInstance().updateActivity(activity);
if (H(iSDemandOnlyBannerLayout, str)) {
return;
}
if (!k()) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
iSDemandOnlyBannerLayout.getListener().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain banner data", IronSourceConstants.BANNER_AD_UNIT));
} else {
if (z(iSDemandOnlyBannerLayout, str)) {
return;
}
this.f45276i0.a(iSDemandOnlyBannerLayout, str, str2);
}
}
public final synchronized void a(Activity activity, String str, String str2) {
if (str2 != null) {
b(activity, str, str2);
} else {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "adm cannot be null", 3);
com.ironsource.mediationsdk.demandOnly.i.a().a(str, new IronSourceError(510, "adm cannot be null"));
}
}
public final synchronized void a(Context context, String str, InitializationListener initializationListener, IronSource.AD_UNIT... ad_unitArr) {
ArrayList arrayList = new ArrayList();
if (ad_unitArr != null && ad_unitArr.length != 0) {
for (IronSource.AD_UNIT ad_unit : ad_unitArr) {
if (ad_unit.equals(IronSource.AD_UNIT.OFFERWALL)) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, ad_unit + " ad unit cannot be initialized in demand only mode", 3);
} else {
if (ad_unit.equals(IronSource.AD_UNIT.INTERSTITIAL)) {
if (this.J) {
t(ad_unit);
} else {
this.G = true;
if (!arrayList.contains(ad_unit)) {
arrayList.add(ad_unit);
}
}
}
if (ad_unit.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
if (this.I) {
t(ad_unit);
} else {
this.F = true;
if (!arrayList.contains(ad_unit)) {
arrayList.add(ad_unit);
}
}
}
if (ad_unit.equals(IronSource.AD_UNIT.BANNER)) {
if (this.K) {
t(ad_unit);
} else {
this.H = true;
if (!arrayList.contains(ad_unit)) {
arrayList.add(ad_unit);
}
}
}
}
}
if (context != null) {
if (context instanceof Activity) {
ContextProvider.getInstance().updateActivity((Activity) context);
}
ContextProvider.getInstance().updateAppContext(context.getApplicationContext());
}
if (arrayList.size() > 0) {
a(context, str, true, null, (IronSource.AD_UNIT[]) arrayList.toArray(new IronSource.AD_UNIT[arrayList.size()]));
}
}
if (this.I) {
t(IronSource.AD_UNIT.REWARDED_VIDEO);
} else {
this.F = true;
arrayList.add(IronSource.AD_UNIT.REWARDED_VIDEO);
}
if (this.J) {
t(IronSource.AD_UNIT.INTERSTITIAL);
} else {
this.G = true;
arrayList.add(IronSource.AD_UNIT.INTERSTITIAL);
}
if (this.K) {
t(IronSource.AD_UNIT.BANNER);
} else {
this.H = true;
arrayList.add(IronSource.AD_UNIT.BANNER);
}
if (context != null) {
}
if (arrayList.size() > 0) {
}
}
public final synchronized void a(Context context, String str, boolean z11, InitializationListener initializationListener, IronSource.AD_UNIT... ad_unitArr) {
com.ironsource.sdk.a.e eVar;
IronSourceError ironSourceError;
com.ironsource.mediationsdk.utils.k p11;
Context applicationContext;
boolean isInitResponseCached;
ConcurrentHashMap<String, List<String>> c11;
AtomicBoolean atomicBoolean;
IronLog.INTERNAL.verbose();
if (!IronSourcePreconditions.a((Object) context, "Init Failed - provided context is null")) {
a("Provided context is null");
return;
}
if (initializationListener != null) {
this.U = initializationListener;
}
AtomicBoolean atomicBoolean2 = this.f45289r;
if (atomicBoolean2 == null || !atomicBoolean2.compareAndSet(true, false)) {
if (ad_unitArr != null) {
y(z11, ad_unitArr);
if (D.a().b() == D.f.INITIATED && !z11) {
m();
return;
}
} else {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Multiple calls to init without ad units are not allowed", 3);
}
return;
}
if (ad_unitArr != null && ad_unitArr.length != 0) {
for (IronSource.AD_UNIT ad_unit : ad_unitArr) {
this.f45294w.add(ad_unit);
this.f45295x.add(ad_unit);
if (ad_unit.equals(IronSource.AD_UNIT.INTERSTITIAL)) {
this.J = true;
}
if (ad_unit.equals(IronSource.AD_UNIT.BANNER)) {
this.K = true;
}
if (ad_unit.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
this.I = true;
}
}
IronLog.API.info("init(appKey:" + str + ")");
if (context instanceof Activity) {
ContextProvider.getInstance().updateActivity((Activity) context);
}
eVar = new com.ironsource.sdk.a.e();
if (str != null) {
ironSourceError = new IronSourceError(506, "Init Fail - appKey is missing");
} else {
if (B(str, 5, 10)) {
if (!e0(str)) {
ironSourceError = ErrorBuilder.buildInvalidCredentialsError("appKey", str, "should contain only english characters and numbers");
}
if (eVar.a()) {
this.f45271g = str;
}
p11 = p(context, this.f45271g);
if (p11 != null) {
ApplicationGeneralSettings applicationGeneralSettings = p11.f45163c.f44866e.f44822f;
DeviceConfigurationsDataHolder deviceConfigurationsDataHolder = DeviceConfigurationsDataHolder.f43797a;
DeviceConfigurationsDataHolder.a(applicationGeneralSettings.getF45079c());
DeviceConfigurationsDataHolder.c(applicationGeneralSettings.getF45080d());
DeviceConfigurationsDataHolder.a(applicationGeneralSettings.getF45081e());
}
ContextProvider.getInstance().updateAppContext(context.getApplicationContext());
com.ironsource.environment.h.a(context.getApplicationContext(), TimeUnit.HOURS.toMillis(DeviceConfigurationsDataHolder.d()));
this.f45280k0.b(IronSourceUtils.getSDKVersion());
this.f45280k0.a(ISAdPlayer.a());
this.f45280k0.b(IronSourceUtils.isGooglePlayInstalled(context));
applicationContext = ContextProvider.getInstance().getApplicationContext();
isInitResponseCached = IronSourceUtils.isInitResponseCached(applicationContext);
long firstSessionTimestamp = IronSourceUtils.getFirstSessionTimestamp(applicationContext);
if (!isInitResponseCached && firstSessionTimestamp == -1) {
long currentTimeMillis = System.currentTimeMillis();
IronLog.INTERNAL.verbose("get first session timestamp = " + currentTimeMillis);
IronSourceUtils.saveFirstSessionTimestamp(applicationContext, currentTimeMillis);
}
c11 = com.ironsource.d.a.a().c();
if (c11.containsKey("is_deviceid_optout")) {
String str2 = c11.get("is_deviceid_optout").get(0);
if (!TextUtils.isEmpty(str2)) {
DeviceConfigurationsDataHolder.b(!MetaDataUtils.getMetaDataBooleanValue(str2));
}
}
atomicBoolean = this.f45286o;
if (atomicBoolean != null && atomicBoolean.compareAndSet(false, true)) {
com.ironsource.mediationsdk.events.j.a().a(new com.ironsource.mediationsdk.utils.f(context));
com.ironsource.mediationsdk.events.e.d().a(context, this.C);
com.ironsource.mediationsdk.events.i.d().a(context, this.C);
PixelEventsManager.f44646x.a(context, this.C);
}
if (this.f45271g == null) {
D.a().b(D.f.INIT_FAILED);
if (this.f45294w.contains(IronSource.AD_UNIT.REWARDED_VIDEO)) {
Q.a().a(false, (AdInfo) null);
}
if (this.f45294w.contains(IronSource.AD_UNIT.OFFERWALL)) {
this.f45281l.a(false, eVar.b());
}
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, eVar.b().toString(), 1);
return;
}
this.f45280k0.a(context);
this.f45280k0.a(this.f45271g);
this.f45280k0.c(this.f45283m);
this.f45280k0.d(ConfigFile.getConfigFile().getPluginType());
if (this.f45296y) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z11);
if (ad_unitArr != null) {
for (IronSource.AD_UNIT ad_unit2 : ad_unitArr) {
try {
mediationAdditionalData.put(ad_unit2.toString(), true);
} catch (Exception unused) {
}
}
}
int i11 = this.E + 1;
this.E = i11;
x(z11, i11, mediationAdditionalData);
this.f45296y = false;
}
D.a().a(this);
D.a().a(this.f45278j0);
D.a().a(context, str, this.f45273h);
return;
}
ironSourceError = ErrorBuilder.buildInvalidCredentialsError("appKey", str, "length should be between 5-10 characters");
}
eVar.a(ironSourceError);
if (eVar.a()) {
}
p11 = p(context, this.f45271g);
if (p11 != null) {
}
ContextProvider.getInstance().updateAppContext(context.getApplicationContext());
com.ironsource.environment.h.a(context.getApplicationContext(), TimeUnit.HOURS.toMillis(DeviceConfigurationsDataHolder.d()));
this.f45280k0.b(IronSourceUtils.getSDKVersion());
this.f45280k0.a(ISAdPlayer.a());
this.f45280k0.b(IronSourceUtils.isGooglePlayInstalled(context));
applicationContext = ContextProvider.getInstance().getApplicationContext();
isInitResponseCached = IronSourceUtils.isInitResponseCached(applicationContext);
long firstSessionTimestamp2 = IronSourceUtils.getFirstSessionTimestamp(applicationContext);
if (!isInitResponseCached) {
long currentTimeMillis2 = System.currentTimeMillis();
IronLog.INTERNAL.verbose("get first session timestamp = " + currentTimeMillis2);
IronSourceUtils.saveFirstSessionTimestamp(applicationContext, currentTimeMillis2);
}
c11 = com.ironsource.d.a.a().c();
if (c11.containsKey("is_deviceid_optout")) {
}
atomicBoolean = this.f45286o;
if (atomicBoolean != null) {
com.ironsource.mediationsdk.events.j.a().a(new com.ironsource.mediationsdk.utils.f(context));
com.ironsource.mediationsdk.events.e.d().a(context, this.C);
com.ironsource.mediationsdk.events.i.d().a(context, this.C);
PixelEventsManager.f44646x.a(context, this.C);
}
if (this.f45271g == null) {
}
}
for (IronSource.AD_UNIT ad_unit3 : IronSource.AD_UNIT.values()) {
this.f45294w.add(ad_unit3);
}
this.I = true;
this.J = true;
this.K = true;
IronLog.API.info("init(appKey:" + str + ")");
if (context instanceof Activity) {
}
eVar = new com.ironsource.sdk.a.e();
if (str != null) {
}
eVar.a(ironSourceError);
if (eVar.a()) {
}
p11 = p(context, this.f45271g);
if (p11 != null) {
}
ContextProvider.getInstance().updateAppContext(context.getApplicationContext());
com.ironsource.environment.h.a(context.getApplicationContext(), TimeUnit.HOURS.toMillis(DeviceConfigurationsDataHolder.d()));
this.f45280k0.b(IronSourceUtils.getSDKVersion());
this.f45280k0.a(ISAdPlayer.a());
this.f45280k0.b(IronSourceUtils.isGooglePlayInstalled(context));
applicationContext = ContextProvider.getInstance().getApplicationContext();
isInitResponseCached = IronSourceUtils.isInitResponseCached(applicationContext);
long firstSessionTimestamp22 = IronSourceUtils.getFirstSessionTimestamp(applicationContext);
if (!isInitResponseCached) {
}
c11 = com.ironsource.d.a.a().c();
if (c11.containsKey("is_deviceid_optout")) {
}
atomicBoolean = this.f45286o;
if (atomicBoolean != null) {
}
if (this.f45271g == null) {
}
}
public final void a(IronSourceBannerLayout ironSourceBannerLayout, String str) {
IronLog.INTERNAL.verbose("placementName = " + str);
if (this.H) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "Banner was initialized in demand only mode. Use loadISDemandOnlyBanner instead", 3);
C2053p.a().a(IronSource.AD_UNIT.BANNER, ErrorBuilder.buildInitFailedError("Banner was initialized in demand only mode. Use loadISDemandOnlyBanner instead", IronSourceConstants.BANNER_AD_UNIT));
return;
}
if (ironSourceBannerLayout == null || ironSourceBannerLayout.isDestroyed()) {
StringBuilder sb2 = new StringBuilder("loadBanner can't be called - ");
sb2.append(ironSourceBannerLayout == null ? "banner layout is null " : "banner layout is destroyed");
String sb3 = sb2.toString();
this.f45267e.log(IronSourceLogger.IronSourceTag.API, sb3, 3);
C2053p.a().a(IronSource.AD_UNIT.BANNER, ErrorBuilder.buildLoadFailedError(sb3));
return;
}
if (!this.K) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "init() must be called before loadBanner()", 3);
C2053p.a().a(IronSource.AD_UNIT.BANNER, ErrorBuilder.buildLoadFailedError("init() must be called before loadBanner()"));
return;
}
if (ironSourceBannerLayout.getSize().getDescription().equals("CUSTOM") && (ironSourceBannerLayout.getSize().getWidth() <= 0 || ironSourceBannerLayout.getSize().getHeight() <= 0)) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "loadBanner: Unsupported banner size. Height and width must be bigger than 0", 3);
C2053p.a().a(IronSource.AD_UNIT.BANNER, ErrorBuilder.unsupportedBannerSize(""));
return;
}
D.f b11 = D.a().b();
if (b11 == D.f.INIT_FAILED) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
C2053p.a().a(IronSource.AD_UNIT.BANNER, new IronSourceError(600, "Init() had failed"));
return;
}
if (b11 == D.f.INIT_IN_PROGRESS) {
if (D.a().c()) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
C2053p.a().a(IronSource.AD_UNIT.BANNER, new IronSourceError(601, "Init had failed"));
return;
} else {
this.O = ironSourceBannerLayout;
this.N = Boolean.TRUE;
this.P = str;
return;
}
}
if (!k()) {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
C2053p.a().a(IronSource.AD_UNIT.BANNER, new IronSourceError(IronSourceError.ERROR_BN_LOAD_NO_CONFIG, "the server response does not contain banner data"));
return;
}
G g11 = this.T;
if (g11 == null && this.B == null) {
this.O = ironSourceBannerLayout;
this.N = Boolean.TRUE;
this.P = str;
} else if (this.f45262b0) {
this.B.a(ironSourceBannerLayout, new Placement(h0(str)));
} else {
g11.a(ironSourceBannerLayout, h0(str));
}
}
public static void a(ISDemandOnlyInterstitialListener iSDemandOnlyInterstitialListener) {
com.ironsource.mediationsdk.demandOnly.h.a().f44564a = iSDemandOnlyInterstitialListener;
}
public static void a(LevelPlayInterstitialListener levelPlayInterstitialListener) {
IronLog ironLog = IronLog.API;
if (levelPlayInterstitialListener == null) {
ironLog.info("ISListener is null");
} else {
ironLog.info();
}
C2057t.a().a(levelPlayInterstitialListener);
}
public static void a(LevelPlayRewardedVideoListener levelPlayRewardedVideoListener) {
IronLog ironLog = IronLog.API;
if (levelPlayRewardedVideoListener == null) {
ironLog.info("RVListener is null");
} else {
ironLog.info();
}
Q.a().f44102b = levelPlayRewardedVideoListener;
}
public final synchronized void a(LevelPlayRewardedVideoManualListener levelPlayRewardedVideoManualListener) {
IronLog ironLog;
String str;
if (levelPlayRewardedVideoManualListener == null) {
IronLog.API.info("RVListener is null");
} else {
IronLog.API.info();
}
if (!this.I) {
if (levelPlayRewardedVideoManualListener == null) {
this.W = false;
ironLog = IronLog.API;
str = "Disabling rewarded video manual mode";
} else {
this.W = true;
ironLog = IronLog.API;
str = "Enabling rewarded video manual mode";
}
ironLog.info(str);
}
Q.a().f44102b = levelPlayRewardedVideoManualListener;
}
public final synchronized void a(RewardedVideoManualListener rewardedVideoManualListener) {
IronLog ironLog;
String str;
if (rewardedVideoManualListener == null) {
IronLog.API.info("RVListener is null");
} else {
IronLog.API.info();
}
if (!this.I) {
if (rewardedVideoManualListener == null) {
this.W = false;
ironLog = IronLog.API;
str = "Disabling rewarded video manual mode";
} else {
this.W = true;
ironLog = IronLog.API;
str = "Enabling rewarded video manual mode";
}
ironLog.info(str);
}
this.f45281l.f44945a = rewardedVideoManualListener;
Q.a().f44101a = rewardedVideoManualListener;
}
@Override
public final void a(String str) {
try {
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "onInitFailed(reason:" + str + ")", 1);
IronSourceUtils.sendAutomationLog("Mediation init failed");
if (this.f45281l != null) {
Iterator<IronSource.AD_UNIT> it = this.f45294w.iterator();
while (it.hasNext()) {
u(it.next(), true);
}
}
} catch (Exception e11) {
e11.printStackTrace();
}
}
public final void a(String str, List<String> list) {
IronLog ironLog = IronLog.API;
ironLog.verbose("key = " + str + ", values = " + list.toString());
String checkMetaDataKeyValidity = MetaDataUtils.checkMetaDataKeyValidity(str);
String checkMetaDataValueValidity = MetaDataUtils.checkMetaDataValueValidity(list);
if (checkMetaDataKeyValidity.length() > 0) {
ironLog.verbose(checkMetaDataKeyValidity);
return;
}
if (checkMetaDataValueValidity.length() > 0) {
ironLog.verbose(checkMetaDataValueValidity);
return;
}
MetaData formatMetaData = MetaDataUtils.formatMetaData(str, list);
String metaDataKey = formatMetaData.getMetaDataKey();
List<String> metaDataValue = formatMetaData.getMetaDataValue();
if (!MetaDataUtils.isMediationOnlyKey(metaDataKey)) {
C2046c.a().a(metaDataKey, metaDataValue);
} else if (D.a().b() == D.f.INITIATED && MetaDataUtils.isMediationKeysBeforeInit(metaDataKey)) {
ironLog.error("setMetaData with key = " + metaDataKey + " must to be called before init");
} else {
com.ironsource.d.a.a().a(metaDataKey, metaDataValue);
}
try {
ConcurrentHashMap<String, List<String>> concurrentHashMap = C2046c.a().f44444d;
concurrentHashMap.putAll(com.ironsource.d.a.a().c());
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, List<String>> entry : concurrentHashMap.entrySet()) {
jSONObject.put(entry.getKey(), entry.getValue());
}
this.f45280k0.a(jSONObject);
} catch (JSONException e11) {
IronLog.INTERNAL.error("got the following error " + e11.getMessage());
e11.printStackTrace();
}
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(D.a().b() == D.f.INITIATED ? 51 : 50, IronSourceUtils.getJsonForMetaData(str, list, metaDataValue)));
}
public static void a(String str, JSONObject jSONObject) {
String str2 = "networkKey = " + str;
if (jSONObject != null) {
str2 = str2 + " networkData = " + jSONObject;
}
IronLog.API.verbose(str2);
C2046c.a().a(str, jSONObject);
}
@Override
public final void a(List<IronSource.AD_UNIT> list, boolean z11, com.ironsource.mediationsdk.model.j jVar) {
IronLog.INTERNAL.verbose();
try {
this.f45285n.f44777d = jVar.f44866e.f44817a.f44849c;
this.f45291t = list;
this.f45290s = true;
this.f45267e.log(IronSourceLogger.IronSourceTag.API, "onInitSuccess()", 1);
IronSourceUtils.sendAutomationLog("init success");
if (z11) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
try {
mediationAdditionalData.put("revived", true);
} catch (JSONException e11) {
e11.printStackTrace();
}
com.ironsource.mediationsdk.events.i.d().b(new com.ironsource.mediationsdk.events.d(114, mediationAdditionalData));
}
com.ironsource.mediationsdk.events.e.d().b();
com.ironsource.mediationsdk.events.i.d().b();
C2046c a11 = C2046c.a();
String str = this.f45271g;
String str2 = this.f45273h;
a11.f44443c = str;
a11.f44445e = str2;
for (IronSource.AD_UNIT ad_unit : IronSource.AD_UNIT.values()) {
if (this.f45294w.contains(ad_unit)) {
if (list.contains(ad_unit)) {
G(ad_unit);
} else {
u(ad_unit, false);
}
}
}
m();
} catch (Exception e12) {
e12.printStackTrace();
}
}
public static void a(boolean z11) {
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, "setAdaptersDebug : " + z11, 1);
C2046c.a().b(z11);
}
}