Apk Done v1.0版本的 MD5 值为:44cfb8e1ce639995aa7f0de6a3a6388b
以下内容为反编译后的 H.java 源代码,内容仅作参考
package com.ironsource.mediationsdk;
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.ironsource.environment.ContextProvider;
import com.ironsource.environment.a;
import com.ironsource.mediationsdk.C1353f;
import com.ironsource.mediationsdk.IronSource;
import com.ironsource.mediationsdk.M;
import com.ironsource.mediationsdk.adunit.data.DataKeys;
import com.ironsource.mediationsdk.config.ConfigFile;
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.InterstitialPlacement;
import com.ironsource.mediationsdk.model.NetworkSettings;
import com.ironsource.mediationsdk.model.Placement;
import com.ironsource.mediationsdk.sdk.ISDemandOnlyInterstitialListener;
import com.ironsource.mediationsdk.sdk.ISDemandOnlyRewardedVideoListener;
import com.ironsource.mediationsdk.sdk.InitializationListener;
import com.ironsource.mediationsdk.sdk.RewardedVideoListener;
import com.ironsource.mediationsdk.sdk.RewardedVideoManualListener;
import com.ironsource.mediationsdk.server.HttpFunctions;
import com.ironsource.mediationsdk.server.ServerURL;
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.k;
import com.ironsource.mediationsdk.utils.l;
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.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
public final class H implements com.ironsource.mediationsdk.utils.i {
private static boolean ap = false;
S A;
P B;
com.ironsource.mediationsdk.adunit.c.g C;
com.ironsource.mediationsdk.adunit.c.h D;
boolean E;
boolean F;
boolean G;
boolean H;
boolean I;
boolean J;
boolean K;
int L;
C1366s M;
C1364q N;
com.ironsource.mediationsdk.impressionData.a O;
private final String P;
private final String Q;
private AbstractAdapter R;
private AtomicBoolean S;
private final Object T;
private AtomicBoolean U;
private boolean V;
private List<IronSource.AD_UNIT> W;
private Set<IronSource.AD_UNIT> X;
private Set<IronSource.AD_UNIT> Y;
private boolean Z;
final String a;
private final String aa;
private boolean ab;
private boolean ac;
private Boolean ad;
private IronSourceBannerLayout ae;
private String af;
private InitializationListener ag;
private AtomicBoolean ah;
private boolean ai;
private CopyOnWriteArraySet<String> aj;
private CopyOnWriteArraySet<String> ak;
private CopyOnWriteArraySet<String> al;
private C1368u am;
private com.ironsource.d.b an;
private ai ao;
ab b;
E c;
O d;
C1358k e;
IronSourceLoggerManager f;
com.ironsource.mediationsdk.sdk.i g;
com.ironsource.mediationsdk.logger.b h;
com.ironsource.mediationsdk.utils.l i;
public String j;
public String k;
String l;
public String m;
public Map<String, String> n;
public String o;
public String p;
Context q;
Boolean r;
IronSourceSegment s;
int t;
boolean u;
boolean v;
boolean w;
boolean x;
Boolean y;
InterfaceC1373z z;
public static class AnonymousClass1 {
static final int[] a;
static final int[] b;
static {
int[] iArr = new int[k.a.a().length];
b = iArr;
try {
int i = k.a.a;
iArr[0] = 1;
} catch (NoSuchFieldError unused) {
}
try {
int[] iArr2 = b;
int i2 = k.a.b;
iArr2[1] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
int[] iArr3 = b;
int i3 = k.a.c;
iArr3[2] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
int[] iArr4 = b;
int i4 = k.a.d;
iArr4[3] = 4;
} catch (NoSuchFieldError unused4) {
}
int[] iArr5 = new int[IronSource.AD_UNIT.values().length];
a = iArr5;
try {
iArr5[IronSource.AD_UNIT.REWARDED_VIDEO.ordinal()] = 1;
} catch (NoSuchFieldError unused5) {
}
try {
a[IronSource.AD_UNIT.INTERSTITIAL.ordinal()] = 2;
} catch (NoSuchFieldError unused6) {
}
try {
a[IronSource.AD_UNIT.OFFERWALL.ordinal()] = 3;
} catch (NoSuchFieldError unused7) {
}
try {
a[IronSource.AD_UNIT.BANNER.ordinal()] = 4;
} catch (NoSuchFieldError unused8) {
}
}
}
public interface a {
void a(String str);
}
public static class b {
static volatile H a = new H((byte) 0);
}
private H() {
this.a = getClass().getName();
this.P = "!SDK-VERSION-STRING!:com.ironsource:mediationsdk:\u200b7.2.1.1";
this.Q = "Activity=";
this.T = new Object();
this.i = null;
this.j = null;
this.k = null;
this.l = null;
this.m = null;
this.n = null;
this.o = null;
this.V = false;
this.p = null;
this.r = null;
this.Z = true;
this.aa = IronSourceConstants.KEY_SESSION_DEPTH;
this.y = null;
this.f = IronSourceLoggerManager.getLogger(0);
com.ironsource.mediationsdk.logger.b bVar = new com.ironsource.mediationsdk.logger.b(null, 1);
this.h = bVar;
this.f.addLogger(bVar);
this.g = new com.ironsource.mediationsdk.sdk.i();
ab abVar = new ab();
this.b = abVar;
abVar.m = this.g;
E e = new E();
this.c = e;
com.ironsource.mediationsdk.sdk.i iVar = this.g;
e.m = iVar;
e.n.a = iVar;
O o = new O();
this.d = o;
o.b = this.g;
this.S = new AtomicBoolean();
this.X = new HashSet();
this.Y = new HashSet();
this.v = false;
this.u = false;
this.ab = false;
this.U = new AtomicBoolean(true);
this.ah = new AtomicBoolean(false);
this.t = 0;
this.w = false;
this.x = false;
this.ac = false;
this.p = UUID.randomUUID().toString();
this.ad = Boolean.FALSE;
this.J = false;
this.af = null;
this.z = null;
this.A = null;
this.ag = null;
this.B = null;
this.E = false;
this.F = false;
this.H = false;
this.K = false;
this.aj = new CopyOnWriteArraySet<>();
this.ak = new CopyOnWriteArraySet<>();
this.al = new CopyOnWriteArraySet<>();
this.M = null;
this.am = null;
this.N = null;
this.e = null;
this.L = 1;
this.O = new com.ironsource.mediationsdk.impressionData.a();
this.an = new com.ironsource.d.b();
this.ao = new ai();
}
H(byte b2) {
this();
}
private void A() {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.i.a.e.size(); i++) {
String str = this.i.a.e.get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.i.b.a(str));
}
}
if (arrayList.size() > 0) {
synchronized (this.al) {
this.N = new C1364q(arrayList, this.i.c.d, this.j, this.k);
}
this.al.clear();
return;
}
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
b(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.BANNER, false);
}
private void B() {
if (this.ad.booleanValue()) {
this.ad = Boolean.FALSE;
a(this.ae, this.af);
this.ae = null;
this.af = null;
}
}
private boolean C() {
com.ironsource.mediationsdk.utils.l lVar = this.i;
return (lVar == null || lVar.c == null || this.i.c.d == null) ? false : true;
}
private static boolean D() {
return ContextProvider.getInstance().getCurrentActiveActivity() != null;
}
private void E() {
if (this.ag == null || !this.ah.compareAndSet(false, true)) {
return;
}
IronLog.CALLBACK.verbose("onInitializationCompleted()");
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.TROUBLESHOOTING_INIT_COMPLETED, IronSourceUtils.getMediationAdditionalData(false)));
this.ag.onInitializationComplete();
}
private int a(com.ironsource.mediationsdk.model.o oVar) {
return !this.ai && !this.F && oVar.l.n ? 2 : 1;
}
public static H a() {
return b.a;
}
private com.ironsource.mediationsdk.utils.l a(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");
String str2 = this.j;
if (str2 != null && cachedValueByKeyOfCachedInitResponse.equals(str2) && cachedValueByKeyOfCachedInitResponse2.equals(str)) {
com.ironsource.mediationsdk.utils.l lVar = new com.ironsource.mediationsdk.utils.l(context, cachedValueByKeyOfCachedInitResponse, cachedValueByKeyOfCachedInitResponse2, cachedValueByKeyOfCachedInitResponse3);
lVar.e = l.a.b;
return lVar;
}
}
return null;
}
public static String a(Context context) {
String[] C = com.ironsource.environment.h.C(context);
return (C == null || C.length != 2) ? "" : C[0];
}
private static String a(String str, int i) {
if (i == 0) {
return null;
}
int i2 = AnonymousClass1.b[i - 1];
if (i2 == 1 || i2 == 2 || i2 == 3) {
return "placement " + str + " is capped";
}
return null;
}
public static void a(int i, JSONObject jSONObject) {
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(i, jSONObject));
}
private void a(IronSource.AD_UNIT ad_unit) {
String str = ad_unit + " ad unit has already been initialized";
this.f.log(IronSourceLogger.IronSourceTag.API, str, 3);
IronSourceUtils.sendAutomationLog(str);
}
private void a(IronSource.AD_UNIT ad_unit, boolean z) {
int i = AnonymousClass1.a[ad_unit.ordinal()];
if (i == 1) {
if (this.u) {
Iterator<String> it = this.ak.iterator();
while (it.hasNext()) {
Z.a().a(it.next(), ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
this.ak.clear();
} else if (this.F) {
if (this.G) {
this.G = false;
C1363p.a().a(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
} else if (z || d() || this.Y.contains(ad_unit)) {
this.g.onRewardedVideoAvailabilityChanged(false);
}
} else if (i == 2) {
if (!this.v) {
if (this.J) {
this.J = false;
C1363p.a().a(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
return;
}
return;
}
Iterator<String> it2 = this.aj.iterator();
while (it2.hasNext()) {
A.a().a(it2.next(), ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", "Interstitial"));
}
this.aj.clear();
} else if (i == 3) {
if (z || i() || this.Y.contains(ad_unit)) {
this.g.onOfferwallAvailable(false);
}
} else if (i != 4) {
} else {
synchronized (this.ad) {
if (this.ad.booleanValue()) {
this.ad = Boolean.FALSE;
C1357j.a().a(this.ae, new IronSourceError(602, "Init had failed"));
this.ae = null;
this.af = null;
}
}
}
}
public static void a(ISDemandOnlyInterstitialListener iSDemandOnlyInterstitialListener) {
A.a().a = iSDemandOnlyInterstitialListener;
}
public static void a(ISDemandOnlyRewardedVideoListener iSDemandOnlyRewardedVideoListener) {
Z.a().a = iSDemandOnlyRewardedVideoListener;
}
public static void a(String str, com.ironsource.d.a aVar) {
if (str != null) {
try {
if (str.length() > 64) {
aVar.a(ErrorBuilder.buildInvalidKeyValueError("segment", IronSourceConstants.SUPERSONIC_CONFIG_NAME, "segment value should not exceed 64 characters."));
}
} catch (Exception unused) {
aVar.a(ErrorBuilder.buildInvalidKeyValueError("segment", IronSourceConstants.SUPERSONIC_CONFIG_NAME, "segment value should not exceed 64 characters."));
}
}
}
public static void a(String str, JSONObject jSONObject) {
String str2 = "networkKey = " + str;
if (jSONObject != null) {
str2 = str2 + " networkData = " + jSONObject;
}
IronLog.API.verbose(str2);
C1351d.a().a(str, jSONObject);
}
private void a(ArrayList<NetworkSettings> arrayList) {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in programmatic mode", 0);
this.B = new P(arrayList, new com.ironsource.mediationsdk.c.b(this.j, IronSourceUtils.getUserIdForNetworks(), this.i.c.d), com.ironsource.mediationsdk.utils.k.a().b(), this.s);
B();
}
public static void a(JSONObject jSONObject, Object[][] objArr) {
for (int i = 0; i <= 0; i++) {
try {
Object[] objArr2 = objArr[0];
jSONObject.put(objArr2[0].toString(), objArr2[1]);
} catch (Exception e) {
IronSourceLoggerManager logger = IronSourceLoggerManager.getLogger();
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
logger.log(ironSourceTag, "IronSourceObject addToDictionary: " + Log.getStackTraceString(e), 3);
return;
}
}
}
public static void a(boolean z) {
IronSourceLoggerManager logger = IronSourceLoggerManager.getLogger();
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
logger.log(ironSourceTag, "setAdaptersDebug : " + z, 1);
C1351d.a().b(z);
}
private synchronized void a(boolean z, IronSource.AD_UNIT... ad_unitArr) {
String str;
String str2;
int i = 0;
for (IronSource.AD_UNIT ad_unit : ad_unitArr) {
if (ad_unit.equals(IronSource.AD_UNIT.INTERSTITIAL)) {
this.x = true;
} else if (ad_unit.equals(IronSource.AD_UNIT.BANNER)) {
this.ac = true;
} else if (ad_unit.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
this.w = true;
}
}
if (M.a().b() == M.a.INIT_FAILED) {
try {
if (this.g != null) {
int length = ad_unitArr.length;
while (i < length) {
IronSource.AD_UNIT ad_unit2 = ad_unitArr[i];
if (!this.X.contains(ad_unit2)) {
a(ad_unit2, true);
}
i++;
}
}
return;
} catch (Exception e) {
e.printStackTrace();
return;
}
} else if (!this.V) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z);
int length2 = ad_unitArr.length;
boolean z2 = false;
while (i < length2) {
IronSource.AD_UNIT ad_unit3 = ad_unitArr[i];
if (this.X.contains(ad_unit3)) {
this.f.log(IronSourceLogger.IronSourceTag.API, ad_unit3 + " ad unit has started initializing.", 3);
} else {
this.X.add(ad_unit3);
this.Y.add(ad_unit3);
try {
mediationAdditionalData.put(ad_unit3.toString(), true);
} catch (Exception e2) {
e2.printStackTrace();
}
z2 = true;
}
i++;
}
if (z2) {
try {
StringBuilder sb = new StringBuilder();
String str3 = ",androidx=" + IronSourceUtils.isAndroidXAvailable();
String str4 = ",Activity=" + D();
if (a.AnonymousClass1.d()) {
sb.append(IronSourceConstants.IS_APP_LANGUAGE_KOTLIN);
str2 = a.AnonymousClass1.c();
} else {
str2 = IronSourceConstants.IS_APP_LANGUAGE_JAVA;
}
sb.append(str2);
sb.append(str3);
if (m()) {
sb.append(str4);
}
mediationAdditionalData.put(IronSourceConstants.EVENTS_EXT1, sb.toString());
int i2 = this.t + 1;
this.t = i2;
mediationAdditionalData.put(IronSourceConstants.KEY_SESSION_DEPTH, i2);
} catch (Exception e3) {
e3.printStackTrace();
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(14, mediationAdditionalData));
}
return;
} else {
M.a().b(z);
if (this.W == null) {
return;
}
JSONObject mediationAdditionalData2 = IronSourceUtils.getMediationAdditionalData(z);
boolean z3 = false;
for (IronSource.AD_UNIT ad_unit4 : ad_unitArr) {
if (this.X.contains(ad_unit4)) {
a(ad_unit4);
} else {
this.X.add(ad_unit4);
this.Y.add(ad_unit4);
try {
mediationAdditionalData2.put(ad_unit4.toString(), true);
} catch (Exception e4) {
e4.printStackTrace();
}
if (this.W == null || !this.W.contains(ad_unit4)) {
a(ad_unit4, false);
} else {
b(ad_unit4);
}
z3 = true;
}
}
if (z3) {
try {
StringBuilder sb2 = new StringBuilder();
String str5 = ",androidx=" + IronSourceUtils.isAndroidXAvailable();
String str6 = ",Activity=" + D();
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(str5);
if (m()) {
sb2.append(str6);
}
mediationAdditionalData2.put(IronSourceConstants.EVENTS_EXT1, sb2.toString());
int i3 = this.t + 1;
this.t = i3;
mediationAdditionalData2.put(IronSourceConstants.KEY_SESSION_DEPTH, i3);
} catch (Exception e5) {
e5.printStackTrace();
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(14, mediationAdditionalData2));
}
return;
}
}
private static boolean a(AbstractC1349b abstractC1349b) {
return abstractC1349b.k > 0 && abstractC1349b.l > 0;
}
private static boolean a(String str, int i, int i2) {
return str != null && str.length() >= i && str.length() <= i2;
}
private com.ironsource.mediationsdk.utils.l b(Context context, String str, a aVar) {
com.ironsource.mediationsdk.utils.l lVar = null;
if (IronSourceUtils.isNetworkConnected(context)) {
try {
String a2 = a(context);
if (TextUtils.isEmpty(a2)) {
a2 = com.ironsource.environment.h.x(context);
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "using custom identifier", 1);
}
String stringFromURL = HttpFunctions.getStringFromURL(ServerURL.getCPVProvidersURL(context, this.j, str, a2, this.o, this.F, this.s != null ? this.s.a() : null), aVar);
if (stringFromURL == null) {
IronLog.INTERNAL.warning("serverResponseString is null");
return null;
}
if (IronSourceUtils.getSerr() == 1) {
IronLog.INTERNAL.verbose("encrypt");
String optString = new JSONObject(stringFromURL).optString("response", null);
if (TextUtils.isEmpty(optString)) {
IronLog.INTERNAL.warning("encryptedResponse is empty - return null");
return null;
}
stringFromURL = IronSourceAES.decode(com.ironsource.mediationsdk.utils.g.a().b(), optString);
if (TextUtils.isEmpty(stringFromURL)) {
IronLog.INTERNAL.warning("encoded response invalid - return null");
if (!ap) {
ap = true;
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
try {
mediationAdditionalData.put(IronSourceConstants.EVENTS_STATUS, "false");
mediationAdditionalData.put(IronSourceConstants.EVENTS_ERROR_CODE, 1);
} catch (JSONException e) {
e.printStackTrace();
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(114, mediationAdditionalData));
}
return null;
}
}
com.ironsource.mediationsdk.utils.l lVar2 = new com.ironsource.mediationsdk.utils.l(context, this.j, str, stringFromURL);
try {
lVar2.e = l.a.c;
if (lVar2.b()) {
return lVar2;
}
IronLog.INTERNAL.warning("response invalid - return null");
return null;
} catch (Exception e2) {
e = e2;
lVar = lVar2;
IronLog ironLog = IronLog.INTERNAL;
ironLog.warning("exception = " + e);
e.printStackTrace();
return lVar;
}
} catch (Exception e3) {
e = e3;
IronLog ironLog2 = IronLog.INTERNAL;
ironLog2.warning("exception = " + e);
e.printStackTrace();
return lVar;
}
}
return null;
}
private static void b(int i, JSONObject jSONObject) {
com.ironsource.mediationsdk.a.d.e().b(new com.ironsource.mediationsdk.a.c(i, jSONObject));
}
private void b(IronSource.AD_UNIT ad_unit) {
int i = AnonymousClass1.a[ad_unit.ordinal()];
if (i == 1) {
q();
} else if (i == 2) {
y();
} else if (i == 3) {
this.d.a(this.j, this.k);
} else if (i != 4) {
} else {
z();
}
}
private void n() {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in programmatic mode", 0);
List<NetworkSettings> s = s();
if (s.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.L);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
a((int) IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
this.z = this.i.c.a.l.n ? new I(s, this.i.c.a, this.j, IronSourceUtils.getUserIdForNetworks(), com.ironsource.mediationsdk.utils.k.a().b(), this.s) : new V(s, this.i.c.a, this.j, IronSourceUtils.getUserIdForNetworks(), com.ironsource.mediationsdk.utils.k.a().b(), this.s);
Boolean bool = this.r;
if (bool != null) {
this.z.a(this.q, bool.booleanValue());
if (this.r.booleanValue()) {
this.b.a(this.q, false);
}
}
}
private void o() {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.i.a.a.size(); i++) {
String str = this.i.a.a.get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.i.b.a(str));
}
}
if (arrayList.size() <= 0) {
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
synchronized (this.ak) {
this.am = new C1368u(arrayList, this.i.c.a, this.j, this.k);
}
if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
Iterator<String> it = this.ak.iterator();
while (it.hasNext()) {
this.am.a(it.next(), (String) null, false);
}
this.ak.clear();
}
private Placement p(String str) {
com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
if (oVar != null) {
Iterator<Placement> it = oVar.a.iterator();
while (it.hasNext()) {
Placement next = it.next();
if (next.getPlacementName().equals(str)) {
return next;
}
}
}
return null;
}
private void p() {
NetworkSettings a2;
NetworkSettings a3;
NetworkSettings a4;
com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
int i = oVar.e;
for (int i2 = 0; i2 < this.i.a.a.size(); i2++) {
String str = this.i.a.a.get(i2);
if (!TextUtils.isEmpty(str) && (a4 = this.i.b.a(str)) != null) {
ac acVar = new ac(a4, i);
if (a(acVar)) {
acVar.s = this.b;
acVar.n = i2 + 1;
this.b.a((AbstractC1349b) acVar);
}
}
}
if (this.b.c.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, this.L);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
a((int) IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
this.b.n = oVar.b.a();
this.b.b = oVar.c;
this.b.o = oVar.h;
String c = this.i.c();
if (!TextUtils.isEmpty(c) && (a3 = this.i.b.a(c)) != null) {
ac acVar2 = new ac(a3, i);
if (a(acVar2)) {
acVar2.s = this.b;
ab abVar = this.b;
IronSourceLoggerManager ironSourceLoggerManager = abVar.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
ironSourceLoggerManager.log(ironSourceTag, acVar2.d + " is set as backfill", 0);
abVar.d = acVar2;
}
}
String d = this.i.d();
if (!TextUtils.isEmpty(d) && (a2 = this.i.b.a(d)) != null) {
ac acVar3 = new ac(a2, i);
if (a(acVar3)) {
acVar3.s = this.b;
ab abVar2 = this.b;
IronSourceLoggerManager ironSourceLoggerManager2 = abVar2.h;
IronSourceLogger.IronSourceTag ironSourceTag2 = IronSourceLogger.IronSourceTag.INTERNAL;
ironSourceLoggerManager2.log(ironSourceTag2, acVar3.d + " is set as premium", 0);
abVar2.e = acVar3;
}
}
ab abVar3 = this.b;
abVar3.p = new C1371x(oVar.i, abVar3);
this.b.a(this.j, IronSourceUtils.getUserIdForNetworks());
}
private void q() {
if (this.u) {
o();
return;
}
com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
this.E = oVar.l.a || this.F;
this.ai = oVar.l.b;
int a2 = a(oVar);
this.L = a2;
a((int) IronSourceConstants.TROUBLESHOOTING_RV_FORK, IronSourceUtils.getMediationAdditionalData(false, this.E, a2));
if (this.F || this.ai) {
r();
} else if (this.E) {
n();
} else {
p();
}
}
private void q(String str) {
Placement placement;
InterfaceC1373z interfaceC1373z;
try {
placement = p(str);
if (placement == null) {
try {
placement = b();
} catch (Exception e) {
e = e;
this.f.logException(IronSourceLogger.IronSourceTag.API, "showProgrammaticRewardedVideo()", e);
if (this.D == null) {
}
interfaceC1373z = this.z;
if (interfaceC1373z == null) {
}
}
}
if (placement == null) {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "showProgrammaticRewardedVideo error: empty default placement in response", 3);
this.g.onRewardedVideoAdShowFailed(new IronSourceError(IronSourceError.ERROR_RV_EMPTY_DEFAULT_PLACEMENT, "showProgrammaticRewardedVideo error: empty default placement in response"));
return;
}
} catch (Exception e2) {
e = e2;
placement = null;
}
if (this.D == null && (this.F || this.ai)) {
this.D.a(placement);
return;
}
interfaceC1373z = this.z;
if (interfaceC1373z == null) {
interfaceC1373z.a(placement);
return;
}
this.f.log(IronSourceLogger.IronSourceTag.API, "showProgrammaticRewardedVideo - show called before init completed, managers not initiated yet", 3);
this.g.onRewardedVideoAdShowFailed(new IronSourceError(IronSourceError.ERROR_RV_SHOW_CALLED_WRONG_STATE, "showProgrammaticRewardedVideo - show called before init completed, managers not initiated yet"));
}
private Placement r(String str) {
Placement p = p(str);
if (p == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 3);
p = b();
if (p == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Default placement was not found, please make sure you are using the right placements.", 3);
return null;
}
}
String a2 = a(p.getPlacementName(), com.ironsource.mediationsdk.utils.k.b(ContextProvider.getInstance().getApplicationContext(), p));
if (TextUtils.isEmpty(a2)) {
return p;
}
this.f.log(IronSourceLogger.IronSourceTag.API, a2, 1);
this.g.onRewardedVideoAdShowFailed(ErrorBuilder.buildCappedPerPlacementError(a2));
return null;
}
private void r() {
IronLog.INTERNAL.verbose("");
List<NetworkSettings> s = s();
if (s.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.L);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
a((int) IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
com.ironsource.mediationsdk.adunit.c.h hVar = new com.ironsource.mediationsdk.adunit.c.h(s, this.i.c.a, IronSourceUtils.getUserIdForNetworks(), this.F, com.ironsource.mediationsdk.utils.k.a().b(), this.s);
this.D = hVar;
Boolean bool = this.r;
if (bool != null) {
hVar.b(bool.booleanValue());
}
if (this.G && this.F) {
this.G = false;
this.D.e();
}
}
private InterstitialPlacement s(String str) {
com.ironsource.mediationsdk.model.h hVar = this.i.c.b;
if (hVar != null) {
Iterator<InterstitialPlacement> it = hVar.a.iterator();
while (it.hasNext()) {
InterstitialPlacement next = it.next();
if (next.getPlacementName().equals(str)) {
return next;
}
}
}
return null;
}
private List<NetworkSettings> s() {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.i.a.a.size(); i++) {
String str = this.i.a.a.get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.i.b.a(str));
}
}
return arrayList;
}
private List<NetworkSettings> t() {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.i.a.d.size(); i++) {
String str = this.i.a.d.get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.i.b.a(str));
}
}
return arrayList;
}
private void t(String str) {
InterstitialPlacement interstitialPlacement;
try {
interstitialPlacement = s(str);
if (interstitialPlacement == null) {
try {
interstitialPlacement = e();
} catch (Exception e) {
e = e;
this.f.logException(IronSourceLogger.IronSourceTag.API, "showProgrammaticInterstitial()", e);
if (this.I) {
}
}
}
if (interstitialPlacement == null) {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "showProgrammaticInterstitial error: empty default placement in response", 3);
this.g.onInterstitialAdShowFailed(new IronSourceError(IronSourceError.ERROR_IS_EMPTY_DEFAULT_PLACEMENT, "showProgrammaticInterstitial error: empty default placement in response"));
return;
}
} catch (Exception e2) {
e = e2;
interstitialPlacement = null;
}
if (this.I) {
this.A.a(interstitialPlacement.getPlacementName());
} else {
this.C.a(new Placement(interstitialPlacement));
}
}
private InterstitialPlacement u(String str) {
InterstitialPlacement s = s(str);
if (s == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 3);
s = e();
if (s == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Default placement was not found, please make sure you are using the right placements.", 3);
return null;
}
}
String a2 = a(s.getPlacementName(), w(s.getPlacementName()));
if (TextUtils.isEmpty(a2)) {
return s;
}
this.f.log(IronSourceLogger.IronSourceTag.API, a2, 1);
this.g.e = s;
this.g.onInterstitialAdShowFailed(ErrorBuilder.buildCappedPerPlacementError(a2));
return null;
}
private void u() {
IronLog.INTERNAL.verbose("");
List<NetworkSettings> t = t();
if (t.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.INTERSTITIAL, false);
return;
}
com.ironsource.mediationsdk.adunit.c.g gVar = new com.ironsource.mediationsdk.adunit.c.g(t, this.i.c.b, IronSourceUtils.getUserIdForNetworks(), com.ironsource.mediationsdk.utils.k.a().b(), this.s);
this.C = gVar;
Boolean bool = this.r;
if (bool != null) {
gVar.b(bool.booleanValue());
}
if (this.J) {
this.J = false;
this.C.e();
}
}
private void v() {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Adunit: Interstitial is now initiated - programmatic mode", 0);
List<NetworkSettings> t = t();
if (t.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.INTERSTITIAL, false);
return;
}
S s = new S(t, this.i.c.b, this.j, IronSourceUtils.getUserIdForNetworks(), this.i.c.b.f, com.ironsource.mediationsdk.utils.k.a().b(), this.s);
this.A = s;
Boolean bool = this.r;
if (bool != null) {
s.a(bool.booleanValue());
if (this.r.booleanValue()) {
this.c.a(this.q, false);
}
}
if (this.J) {
this.J = false;
this.A.d();
}
}
private static boolean v(String str) {
if (str == null) {
return false;
}
return str.matches("^[a-zA-Z0-9]*$");
}
private int w(String str) {
com.ironsource.mediationsdk.utils.l lVar = this.i;
if (lVar == null || lVar.c == null || this.i.c.b == null) {
return k.a.d;
}
InterstitialPlacement interstitialPlacement = null;
try {
interstitialPlacement = s(str);
if (interstitialPlacement == null && (interstitialPlacement = e()) == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Default placement was not found", 3);
}
} catch (Exception e) {
e.printStackTrace();
}
return interstitialPlacement == null ? k.a.d : com.ironsource.mediationsdk.utils.k.b(ContextProvider.getInstance().getApplicationContext(), interstitialPlacement);
}
private void w() {
NetworkSettings a2;
com.ironsource.mediationsdk.model.h hVar = this.i.c.b;
int i = hVar.e;
this.c.n.a(IronSource.AD_UNIT.INTERSTITIAL, hVar.f);
for (int i2 = 0; i2 < this.i.a.d.size(); i2++) {
String str = this.i.a.d.get(i2);
if (!TextUtils.isEmpty(str) && (a2 = this.i.b.a(str)) != null) {
F f = new F(a2, i);
if (a(f)) {
f.s = this.c;
f.n = i2 + 1;
this.c.a((AbstractC1349b) f);
}
}
}
if (this.c.c.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.INTERSTITIAL, false);
return;
}
this.c.b = hVar.c;
this.c.a(this.j, IronSourceUtils.getUserIdForNetworks());
if (this.J) {
this.J = false;
this.c.c();
}
}
private com.ironsource.mediationsdk.model.f x(String str) {
com.ironsource.mediationsdk.model.f a2;
com.ironsource.mediationsdk.model.e eVar = this.i.c.d;
if (eVar == null) {
return null;
}
return (TextUtils.isEmpty(str) || (a2 = eVar.a(str)) == null) ? eVar.a() : a2;
}
private void x() {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Interstitial started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.i.a.d.size(); i++) {
String str = this.i.a.d.get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.i.b.a(str));
}
}
if (arrayList.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.INTERSTITIAL, false);
return;
}
synchronized (this.aj) {
this.M = new C1366s(arrayList, this.i.c.b, this.j, this.k);
}
Iterator<String> it = this.aj.iterator();
while (it.hasNext()) {
this.M.a(it.next(), (String) null, false);
}
this.aj.clear();
}
private void y() {
if (this.v) {
x();
return;
}
com.ironsource.mediationsdk.model.h hVar = this.i.c.b;
this.H = hVar.i.a;
this.I = hVar.i.b;
b(IronSourceConstants.TROUBLESHOOTING_IS_FORK, IronSourceUtils.getMediationAdditionalData(false, this.H, 1));
if (!this.H) {
w();
} else if (this.I) {
u();
} else {
v();
}
}
private void z() {
NetworkSettings a2;
if (this.ab) {
A();
return;
}
synchronized (this.ad) {
this.K = this.i.c.d.g.a;
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose("mIsBnProgrammatic = " + this.K);
IronLog ironLog2 = IronLog.INTERNAL;
ironLog2.verbose("mIsBnLoadBeforeInitCompleted = " + this.ad);
b(IronSourceConstants.TROUBLESHOOTING_BN_FORK, IronSourceUtils.getMediationAdditionalData(false, this.K, 1));
ArrayList<NetworkSettings> arrayList = new ArrayList<>();
for (int i = 0; i < this.i.a.e.size(); i++) {
String str = this.i.a.e.get(i);
if (!TextUtils.isEmpty(str) && (a2 = this.i.b.a(str)) != null) {
arrayList.add(a2);
}
}
if (arrayList.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, this.K, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
b(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.BANNER, false);
} else if (this.K) {
a(arrayList);
} else {
this.e = new C1358k(arrayList, this.j, IronSourceUtils.getUserIdForNetworks(), this.i.c.d.b, this.i.c.d.e, this.i.c.d.f);
B();
}
}
}
public final com.ironsource.mediationsdk.utils.l a(Context context, String str, a aVar) {
com.ironsource.mediationsdk.a.h e;
boolean c;
com.ironsource.mediationsdk.a.d e2;
boolean c2;
synchronized (this.T) {
if (this.i != null) {
return new com.ironsource.mediationsdk.utils.l(this.i);
}
com.ironsource.mediationsdk.utils.l b2 = b(context, str, aVar);
if (b2 == null || !b2.b()) {
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "Null or invalid response. Trying to get cached response", 0);
b2 = a(context, str);
if (b2 != null) {
IronSourceError buildUsingCachedConfigurationError = ErrorBuilder.buildUsingCachedConfigurationError(this.j, str);
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
ironSourceLoggerManager.log(ironSourceTag, buildUsingCachedConfigurationError.toString() + ": " + b2.toString(), 1);
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.USING_CACHE_FOR_INIT_EVENT, IronSourceUtils.getMediationAdditionalData(false)));
}
}
if (b2 != null) {
this.i = b2;
IronSourceUtils.saveLastResponse(context, b2.toString());
com.ironsource.mediationsdk.utils.l lVar = this.i;
this.h.setDebugLevel(lVar.c.e.a().a);
this.f.setLoggerDebugLevel("console", lVar.c.e.a().b);
boolean b3 = d() ? lVar.c.a.b.b() : false;
boolean b4 = h() ? lVar.c.b.b.b() : false;
boolean b5 = C() ? lVar.c.d.a.b() : false;
boolean b6 = i() ? lVar.c.c.c.b() : false;
com.ironsource.mediationsdk.utils.j h = lVar.c.e.h();
boolean z = h.a;
if (b3) {
com.ironsource.sdk.g.d dVar = lVar.c.a.b;
com.ironsource.mediationsdk.a.h.e().b(dVar.e(), context);
com.ironsource.mediationsdk.a.h.e().a(dVar.d(), context);
com.ironsource.mediationsdk.a.h.e().b(dVar.g());
com.ironsource.mediationsdk.a.h.e().c(dVar.h());
com.ironsource.mediationsdk.a.h.e().a(dVar.f());
com.ironsource.mediationsdk.a.h.e().a(dVar.i(), context);
com.ironsource.mediationsdk.a.h.e().b(dVar.j(), context);
com.ironsource.mediationsdk.a.h.e().c(dVar.k(), context);
com.ironsource.mediationsdk.a.h.e().d(dVar.l(), context);
com.ironsource.mediationsdk.a.h.e().a(lVar.c.e.b());
e = com.ironsource.mediationsdk.a.h.e();
c = dVar.c();
} else if (b6) {
com.ironsource.sdk.g.d dVar2 = lVar.c.c.c;
com.ironsource.mediationsdk.a.h.e().b(dVar2.e(), context);
com.ironsource.mediationsdk.a.h.e().a(dVar2.d(), context);
com.ironsource.mediationsdk.a.h.e().b(dVar2.g());
com.ironsource.mediationsdk.a.h.e().c(dVar2.h());
com.ironsource.mediationsdk.a.h.e().a(dVar2.f());
com.ironsource.mediationsdk.a.h.e().a(dVar2.i(), context);
com.ironsource.mediationsdk.a.h.e().b(dVar2.j(), context);
com.ironsource.mediationsdk.a.h.e().c(dVar2.k(), context);
com.ironsource.mediationsdk.a.h.e().d(dVar2.l(), context);
com.ironsource.mediationsdk.a.h.e().a(lVar.c.e.b());
e = com.ironsource.mediationsdk.a.h.e();
c = dVar2.c();
} else {
com.ironsource.mediationsdk.a.h.e().f = false;
if (!b4) {
com.ironsource.sdk.g.d dVar3 = lVar.c.b.b;
com.ironsource.mediationsdk.a.d.e().b(dVar3.e(), context);
com.ironsource.mediationsdk.a.d.e().a(dVar3.d(), context);
com.ironsource.mediationsdk.a.d.e().b(dVar3.g());
com.ironsource.mediationsdk.a.d.e().c(dVar3.h());
com.ironsource.mediationsdk.a.d.e().a(dVar3.f());
com.ironsource.mediationsdk.a.d.e().a(dVar3.i(), context);
com.ironsource.mediationsdk.a.d.e().b(dVar3.j(), context);
com.ironsource.mediationsdk.a.d.e().c(dVar3.k(), context);
com.ironsource.mediationsdk.a.d.e().d(dVar3.l(), context);
com.ironsource.mediationsdk.a.d.e().a(lVar.c.e.b());
e2 = com.ironsource.mediationsdk.a.d.e();
c2 = dVar3.c();
} else if (b5) {
com.ironsource.sdk.g.d dVar4 = lVar.c.d.a;
com.ironsource.mediationsdk.a.d.e().b(dVar4.e(), context);
com.ironsource.mediationsdk.a.d.e().a(dVar4.d(), context);
com.ironsource.mediationsdk.a.d.e().b(dVar4.g());
com.ironsource.mediationsdk.a.d.e().c(dVar4.h());
com.ironsource.mediationsdk.a.d.e().a(dVar4.f());
com.ironsource.mediationsdk.a.d.e().a(dVar4.i(), context);
com.ironsource.mediationsdk.a.d.e().b(dVar4.j(), context);
com.ironsource.mediationsdk.a.d.e().c(dVar4.k(), context);
com.ironsource.mediationsdk.a.d.e().d(dVar4.l(), context);
com.ironsource.mediationsdk.a.d.e().a(lVar.c.e.b());
e2 = com.ironsource.mediationsdk.a.d.e();
c2 = dVar4.c();
} else {
com.ironsource.mediationsdk.a.d.e().f = false;
com.ironsource.mediationsdk.a.g.w.f = z;
if (z) {
com.ironsource.mediationsdk.a.g.w.a(h.b, context);
com.ironsource.mediationsdk.a.g.w.a(h.d, context);
com.ironsource.mediationsdk.a.g.w.b(h.e, context);
com.ironsource.mediationsdk.a.g.w.c = h.c;
}
com.ironsource.mediationsdk.a.d.e().a = true;
com.ironsource.mediationsdk.a.h.e().a = true;
com.ironsource.mediationsdk.a.g.w.a = true;
}
e2.c = c2;
com.ironsource.mediationsdk.a.g.w.f = z;
if (z) {
}
com.ironsource.mediationsdk.a.d.e().a = true;
com.ironsource.mediationsdk.a.h.e().a = true;
com.ironsource.mediationsdk.a.g.w.a = true;
}
e.c = c;
if (!b4) {
}
e2.c = c2;
com.ironsource.mediationsdk.a.g.w.f = z;
if (z) {
}
com.ironsource.mediationsdk.a.d.e().a = true;
com.ironsource.mediationsdk.a.h.e().a = true;
com.ironsource.mediationsdk.a.g.w.a = true;
}
return b2;
}
}
public final synchronized void a(Activity activity, IronSourceBannerLayout ironSourceBannerLayout, String str, String str2) {
IronSourceError buildLoadFailedError;
IronSourceBannerLayout ironSourceBannerLayout2;
if (str2 == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "adm cannot be null", 3);
} else if (!this.ac) {
this.f.log(IronSourceLogger.IronSourceTag.API, "initISDemandOnly() must be called before loadISDemandOnlyBannerWithAdm()", 3);
ironSourceBannerLayout.a(new IronSourceError(510, "initISDemandOnly() must be called before loadISDemandOnlyBannerWithAdm()"));
} else if (!this.ab) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Banner was initialized in mediation mode. Use loadBanner instead", 3);
ironSourceBannerLayout.a(new IronSourceError(510, "Banner was initialized in mediation mode. Use loadBanner instead"));
} else {
boolean z = false;
if (activity != null) {
ContextProvider.getInstance().updateActivity(activity);
} else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
if (str2 != null) {
z = true;
}
b(IronSourceConstants.TROUBLESHOOTING_DO_CALLED_BN_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, z, 1));
this.f.log(IronSourceLogger.IronSourceTag.API, "Banner was initialized and loaded without Activity", 3);
ironSourceBannerLayout.a(new IronSourceError(IronSourceError.ERROR_DO_BN_LOAD_MISSING_ACTIVITY, "Banner was initialized and loaded without Activity"));
return;
}
M.a b2 = M.a().b();
if (b2 == M.a.INIT_FAILED) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
ironSourceBannerLayout.a(ErrorBuilder.buildInitFailedError("init() had failed", "Banner"));
} else if (b2 == M.a.INIT_IN_PROGRESS) {
if (M.a().c()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
ironSourceBannerLayout.a(ErrorBuilder.buildInitFailedError("init() had failed", "Banner"));
return;
}
synchronized (this.ad) {
this.al.add(str);
}
if (str2 != null) {
b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_BN_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
}
} else {
synchronized (this.al) {
if (this.N == null) {
this.al.add(str);
if (str2 != null) {
b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_BN_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
}
} else if (!C()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "No Banner configurations found", 3);
ironSourceBannerLayout.a(ErrorBuilder.buildInitFailedError("the server response does not contain Banner data", "Banner"));
} else {
if (str2 != null) {
C1364q c1364q = this.N;
c1364q.b = ironSourceBannerLayout;
if (c1364q.c.containsKey(str)) {
if (ironSourceBannerLayout != null && !ironSourceBannerLayout.isDestroyed()) {
z = true;
if (z) {
buildLoadFailedError = ErrorBuilder.buildGenericError("validateBannerLayout fail");
if (c1364q.b != null) {
ironSourceBannerLayout2 = c1364q.b;
ironSourceBannerLayout2.a(buildLoadFailedError);
}
} else {
C1365r c1365r = c1364q.c.get(str);
c1364q.a = c1365r;
if (c1365r == null) {
buildLoadFailedError = ErrorBuilder.buildLoadFailedError("loadISDemandOnlyBannerWithAdm smash is no exist");
IronLog.INTERNAL.error(buildLoadFailedError.getErrorMessage());
if (c1364q.b != null) {
ironSourceBannerLayout2 = c1364q.b;
ironSourceBannerLayout2.a(buildLoadFailedError);
}
} else if (c1365r.i()) {
C1353f.a();
JSONObject a2 = C1353f.a(str2);
C1353f.a aVar = new C1353f.a();
try {
C1353f.a();
aVar = C1353f.a(a2);
} catch (Exception e) {
IronSourceError buildLoadFailedError2 = ErrorBuilder.buildLoadFailedError("loadISDemandOnlyBannerWithAdm: unable to get auction data from response. Exception=" + e.getLocalizedMessage());
IronLog.INTERNAL.error(buildLoadFailedError2.getErrorMessage());
if (c1364q.b != null) {
c1364q.b.a(buildLoadFailedError2);
}
}
C1353f.a();
com.ironsource.mediationsdk.server.b a3 = C1353f.a(c1365r.d(), aVar.b);
if (a3 == null) {
IronSourceError buildLoadFailedError3 = ErrorBuilder.buildLoadFailedError("loadISDemandOnlyBannerWithAdm invalid enriched adm");
IronLog.INTERNAL.error(buildLoadFailedError3.getErrorMessage());
c1364q.a(IronSourceConstants.BN_INSTANCE_LOAD_ERROR, c1365r);
if (c1364q.b != null) {
c1364q.b.a(buildLoadFailedError3);
}
return;
}
c1365r.a(a3.b());
c1365r.b(aVar.a);
c1365r.a(aVar.d);
c1364q.a(3002, c1365r);
c1365r.a(ironSourceBannerLayout, a3.b(), aVar.a, aVar.d, a3.d());
} else {
buildLoadFailedError = ErrorBuilder.buildLoadFailedError("loadISDemandOnlyBannerWithAdm in IAB flow must be called by bidder instances");
IronLog.INTERNAL.error(buildLoadFailedError.getErrorMessage());
C1364q.a((int) IronSourceConstants.BN_INSTANCE_LOAD_ERROR, c1365r, (Object[][]) null);
if (c1364q.b != null) {
ironSourceBannerLayout2 = c1364q.b;
ironSourceBannerLayout2.a(buildLoadFailedError);
}
}
}
}
C1364q.a((int) IronSourceConstants.BN_BANNER_LAYOUT_IS_NULL_OR_DESTROYED, str);
if (z) {
}
} else {
C1364q.a((int) IronSourceConstants.BN_INSTANCE_NOT_FOUND, str);
buildLoadFailedError = ErrorBuilder.buildNonExistentInstanceError("Banner");
if (c1364q.b != null) {
ironSourceBannerLayout2 = c1364q.b;
ironSourceBannerLayout2.a(buildLoadFailedError);
}
}
} else {
this.f.log(IronSourceLogger.IronSourceTag.API, "Banner support bidding mode only", 3);
ironSourceBannerLayout.a(ErrorBuilder.buildInitFailedError("Banner support bidding mode only", "Banner"));
}
}
}
}
}
}
public final synchronized void a(Activity activity, String str, String str2) {
if (str2 != null) {
b(activity, str, str2);
return;
}
this.f.log(IronSourceLogger.IronSourceTag.API, "adm cannot be null", 3);
Z.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.f.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.x) {
a(ad_unit);
} else {
this.v = true;
if (!arrayList.contains(ad_unit)) {
arrayList.add(ad_unit);
}
}
}
if (ad_unit.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
if (this.w) {
a(ad_unit);
} else {
this.u = true;
if (!arrayList.contains(ad_unit)) {
arrayList.add(ad_unit);
}
}
}
if (ad_unit.equals(IronSource.AD_UNIT.BANNER)) {
if (this.ac) {
a(ad_unit);
} else {
this.ab = 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.w) {
a(IronSource.AD_UNIT.REWARDED_VIDEO);
} else {
this.u = true;
arrayList.add(IronSource.AD_UNIT.REWARDED_VIDEO);
}
if (this.x) {
a(IronSource.AD_UNIT.INTERSTITIAL);
} else {
this.v = true;
arrayList.add(IronSource.AD_UNIT.INTERSTITIAL);
}
if (this.ac) {
a(IronSource.AD_UNIT.BANNER);
} else {
this.ab = true;
arrayList.add(IronSource.AD_UNIT.BANNER);
}
if (context != null) {
}
if (arrayList.size() > 0) {
}
}
public final synchronized void a(Context context, String str, boolean z, InitializationListener initializationListener, IronSource.AD_UNIT... ad_unitArr) {
com.ironsource.d.a aVar;
IronSourceError ironSourceError;
Context applicationContext;
boolean isInitResponseCached;
com.ironsource.mediationsdk.utils.l a2;
ConcurrentHashMap<String, List<String>> d;
String str2;
IronLog.INTERNAL.verbose("");
if (initializationListener != null) {
this.ag = initializationListener;
}
if (this.U == null || !this.U.compareAndSet(true, false)) {
if (ad_unitArr != null) {
a(z, ad_unitArr);
if (M.a().b() == M.a.INITIATED && !z) {
E();
return;
}
} else {
this.f.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.X.add(ad_unit);
this.Y.add(ad_unit);
if (ad_unit.equals(IronSource.AD_UNIT.INTERSTITIAL)) {
this.x = true;
}
if (ad_unit.equals(IronSource.AD_UNIT.BANNER)) {
this.ac = true;
}
if (ad_unit.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
this.w = true;
}
}
IronLog.API.info("init(appKey:" + str + ")");
if (context instanceof Activity) {
ContextProvider.getInstance().updateActivity((Activity) context);
}
ContextProvider.getInstance().updateAppContext(context.getApplicationContext());
com.ironsource.environment.h.q();
this.an.b(IronSourceUtils.getSDKVersion());
this.an.a(com.ironsource.c.a.a());
this.an.b(IronSourceUtils.isGooglePlayInstalled(context));
aVar = new com.ironsource.d.a();
if (str != null) {
ironSourceError = new IronSourceError(506, "Init Fail - appKey is missing");
} else if (a(str, 5, 10)) {
if (!v(str)) {
ironSourceError = ErrorBuilder.buildInvalidCredentialsError("appKey", str, "should contain only english characters and numbers");
}
if (aVar.a()) {
this.j = str;
}
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);
}
a2 = a(ContextProvider.getInstance().getApplicationContext(), this.k);
if (a2 != null) {
com.ironsource.environment.g gVar = com.ironsource.environment.g.a;
com.ironsource.environment.g.a(a2.c.e.f().c);
}
d = com.ironsource.mediationsdk.utils.k.a().d();
if (d.containsKey("is_deviceid_optout")) {
String str3 = d.get("is_deviceid_optout").get(0);
if (!TextUtils.isEmpty(str3)) {
boolean z2 = !MetaDataUtils.getMetaDataBooleanValue(str3);
com.ironsource.environment.g gVar2 = com.ironsource.environment.g.a;
com.ironsource.environment.g.b(z2);
}
}
if (this.S != null && this.S.compareAndSet(false, true)) {
com.ironsource.mediationsdk.a.i.a().a(new com.ironsource.mediationsdk.utils.h(context));
com.ironsource.mediationsdk.a.d.e().a(context, this.s);
com.ironsource.mediationsdk.a.h.e().a(context, this.s);
com.ironsource.mediationsdk.a.g.w.a(context, this.s);
}
if (this.j == null) {
M.a().a(M.a.INIT_FAILED);
if (this.X.contains(IronSource.AD_UNIT.REWARDED_VIDEO)) {
this.g.onRewardedVideoAvailabilityChanged(false);
}
if (this.X.contains(IronSource.AD_UNIT.OFFERWALL)) {
this.g.a(false, aVar.b());
}
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, aVar.b().toString(), 1);
return;
}
this.an.a(context);
this.an.a(this.j);
this.an.c(this.p);
this.an.d(ConfigFile.getConfigFile().getPluginType());
if (this.Z) {
StringBuilder sb = new StringBuilder();
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z);
try {
String str4 = ",androidx=" + IronSourceUtils.isAndroidXAvailable();
String str5 = ",Activity=" + D();
if (a.AnonymousClass1.d()) {
sb.append(IronSourceConstants.IS_APP_LANGUAGE_KOTLIN);
str2 = a.AnonymousClass1.c();
} else {
str2 = IronSourceConstants.IS_APP_LANGUAGE_JAVA;
}
sb.append(str2);
sb.append(str4);
if (m()) {
sb.append(str5);
}
mediationAdditionalData.put(IronSourceConstants.EVENTS_EXT1, sb.toString());
if (ad_unitArr != null) {
for (IronSource.AD_UNIT ad_unit2 : ad_unitArr) {
mediationAdditionalData.put(ad_unit2.toString(), true);
}
}
int i = this.t + 1;
this.t = i;
mediationAdditionalData.put(IronSourceConstants.KEY_SESSION_DEPTH, i);
} catch (Exception e) {
e.printStackTrace();
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(14, mediationAdditionalData));
this.Z = false;
}
if (this.X.contains(IronSource.AD_UNIT.INTERSTITIAL)) {
M.a().a(this.c);
}
M.a().a(this);
M.a().a(this.O);
M.a().a(context, str, this.k);
return;
} else {
ironSourceError = ErrorBuilder.buildInvalidCredentialsError("appKey", str, "length should be between 5-10 characters");
}
aVar.a(ironSourceError);
if (aVar.a()) {
}
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);
}
a2 = a(ContextProvider.getInstance().getApplicationContext(), this.k);
if (a2 != null) {
}
d = com.ironsource.mediationsdk.utils.k.a().d();
if (d.containsKey("is_deviceid_optout")) {
}
if (this.S != null) {
com.ironsource.mediationsdk.a.i.a().a(new com.ironsource.mediationsdk.utils.h(context));
com.ironsource.mediationsdk.a.d.e().a(context, this.s);
com.ironsource.mediationsdk.a.h.e().a(context, this.s);
com.ironsource.mediationsdk.a.g.w.a(context, this.s);
}
if (this.j == null) {
}
}
for (IronSource.AD_UNIT ad_unit3 : IronSource.AD_UNIT.values()) {
this.X.add(ad_unit3);
}
this.w = true;
this.x = true;
this.ac = true;
IronLog.API.info("init(appKey:" + str + ")");
if (context instanceof Activity) {
}
ContextProvider.getInstance().updateAppContext(context.getApplicationContext());
com.ironsource.environment.h.q();
this.an.b(IronSourceUtils.getSDKVersion());
this.an.a(com.ironsource.c.a.a());
this.an.b(IronSourceUtils.isGooglePlayInstalled(context));
aVar = new com.ironsource.d.a();
if (str != null) {
}
aVar.a(ironSourceError);
if (aVar.a()) {
}
applicationContext = ContextProvider.getInstance().getApplicationContext();
isInitResponseCached = IronSourceUtils.isInitResponseCached(applicationContext);
long firstSessionTimestamp22 = IronSourceUtils.getFirstSessionTimestamp(applicationContext);
if (!isInitResponseCached) {
}
a2 = a(ContextProvider.getInstance().getApplicationContext(), this.k);
if (a2 != null) {
}
d = com.ironsource.mediationsdk.utils.k.a().d();
if (d.containsKey("is_deviceid_optout")) {
}
if (this.S != null) {
}
if (this.j == null) {
}
}
public final synchronized void a(AbstractAdapter abstractAdapter) {
this.R = abstractAdapter;
}
public final void a(IronSourceBannerLayout ironSourceBannerLayout, String str) {
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose("placementName = " + str);
if (ironSourceBannerLayout == null || ironSourceBannerLayout.isDestroyed()) {
StringBuilder sb = new StringBuilder("loadBanner can't be called - ");
sb.append(ironSourceBannerLayout == null ? "banner layout is null " : "banner layout is destroyed");
String sb2 = sb.toString();
this.f.log(IronSourceLogger.IronSourceTag.API, sb2, 3);
C1357j.a().a(ironSourceBannerLayout, ErrorBuilder.buildLoadFailedError(sb2));
} else if (!this.ac) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() must be called before loadBanner()", 3);
C1357j.a().a(ironSourceBannerLayout, ErrorBuilder.buildLoadFailedError("init() must be called before loadBanner()"));
} else if (ironSourceBannerLayout.getSize().getDescription().equals("CUSTOM") && (ironSourceBannerLayout.getSize().getWidth() <= 0 || ironSourceBannerLayout.getSize().getHeight() <= 0)) {
this.f.log(IronSourceLogger.IronSourceTag.API, "loadBanner: Unsupported banner size. Height and width must be bigger than 0", 3);
C1357j.a().a(ironSourceBannerLayout, ErrorBuilder.unsupportedBannerSize(""));
} else {
M.a b2 = M.a().b();
if (b2 == M.a.INIT_FAILED) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
C1357j.a().a(ironSourceBannerLayout, new IronSourceError(600, "Init() had failed"));
} else if (b2 == M.a.INIT_IN_PROGRESS) {
if (M.a().c()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
C1357j.a().a(ironSourceBannerLayout, new IronSourceError(601, "Init had failed"));
return;
}
this.ae = ironSourceBannerLayout;
this.ad = Boolean.TRUE;
this.af = str;
} else {
synchronized (this.ad) {
if (this.e == null && this.B == null) {
this.ae = ironSourceBannerLayout;
this.ad = Boolean.TRUE;
this.af = str;
} else if (!C()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
C1357j.a().a(ironSourceBannerLayout, new IronSourceError(615, "No banner configurations found"));
} else if (this.K) {
this.B.a(ironSourceBannerLayout, x(str));
} else {
this.e.a(ironSourceBannerLayout, x(str));
}
}
}
}
}
public final void a(RewardedVideoListener rewardedVideoListener) {
this.f.log(IronSourceLogger.IronSourceTag.API, rewardedVideoListener == null ? "setRewardedVideoListener(RVListener:null)" : "setRewardedVideoListener(RVListener)", 1);
this.g.a = rewardedVideoListener;
aa.a().a = rewardedVideoListener;
}
public final synchronized void a(RewardedVideoManualListener rewardedVideoManualListener) {
if (this.w) {
IronLog.API.error("setManualLoadRewardedVideo - this method needs to be called before init");
} else if (rewardedVideoManualListener == null) {
IronLog.API.error("setManualLoadRewardedVideo - listener can not be null");
this.F = false;
} else {
this.f.log(IronSourceLogger.IronSourceTag.API, "setting RewardedVideo to manual mode", 1);
this.F = true;
C1363p.a().b = rewardedVideoManualListener;
a((RewardedVideoListener) rewardedVideoManualListener);
}
}
@Override
public final void a(String str) {
try {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "onInitFailed(reason:" + str + ")", 1);
IronSourceUtils.sendAutomationLog("Mediation init failed");
if (this.g != null) {
for (IronSource.AD_UNIT ad_unit : this.X) {
a(ad_unit, true);
}
}
} catch (Exception e) {
e.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.API.verbose(checkMetaDataKeyValidity);
} else if (checkMetaDataValueValidity.length() > 0) {
IronLog.API.verbose(checkMetaDataValueValidity);
} else {
MetaData formatMetaData = MetaDataUtils.formatMetaData(str, list);
String metaDataKey = formatMetaData.getMetaDataKey();
List<String> metaDataValue = formatMetaData.getMetaDataValue();
if (!MetaDataUtils.isMediationOnlyKey(metaDataKey)) {
C1351d.a().a(metaDataKey, metaDataValue);
} else if (M.a().b() == M.a.INITIATED && MetaDataUtils.isMediationKeysBeforeInit(metaDataKey)) {
IronLog ironLog2 = IronLog.API;
ironLog2.error("setMetaData with key = " + metaDataKey + " must to be called before init");
} else {
com.ironsource.mediationsdk.utils.k.a().a(metaDataKey, metaDataValue);
}
try {
ConcurrentHashMap<String, List<String>> concurrentHashMap = C1351d.a().c;
concurrentHashMap.putAll(com.ironsource.mediationsdk.utils.k.a().d());
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, List<String>> entry : concurrentHashMap.entrySet()) {
jSONObject.put(entry.getKey(), entry.getValue());
}
this.an.a(jSONObject);
} catch (JSONException e) {
IronLog ironLog3 = IronLog.INTERNAL;
ironLog3.error("got the following error " + e.getMessage());
e.printStackTrace();
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(M.a().b() == M.a.INITIATED ? 51 : 50, IronSourceUtils.getJsonForMetaData(str, list, metaDataValue)));
}
}
public final void a(String str, boolean z) {
IronLog ironLog = IronLog.API;
ironLog.verbose("userId = " + str + ", isFromPublisher = " + z);
this.k = str;
if (z) {
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(52, IronSourceUtils.getJsonForUserId(false)));
}
}
@Override
public final void a(List<IronSource.AD_UNIT> list, boolean z, com.ironsource.mediationsdk.model.g gVar) {
IronSource.AD_UNIT[] values;
IronLog.INTERNAL.verbose("");
try {
this.W = list;
this.V = true;
this.f.log(IronSourceLogger.IronSourceTag.API, "onInitSuccess()", 1);
IronSourceUtils.sendAutomationLog("init success");
if (z) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
try {
mediationAdditionalData.put("revived", true);
} catch (JSONException e) {
e.printStackTrace();
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(114, mediationAdditionalData));
}
Activity currentActiveActivity = ContextProvider.getInstance().getCurrentActiveActivity();
if (currentActiveActivity != null) {
String screenSizeParams = AdapterUtils.getScreenSizeParams(currentActiveActivity);
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(IronSourceConstants.EVENTS_EXT1, screenSizeParams);
} catch (JSONException e2) {
e2.printStackTrace();
}
com.ironsource.mediationsdk.a.d.e().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.TROUBLESHOOTING_SCREEN_SIZE, jSONObject));
}
com.ironsource.mediationsdk.a.d.e().d();
com.ironsource.mediationsdk.a.h.e().d();
C1351d a2 = C1351d.a();
String str = this.j;
String str2 = this.k;
a2.a = str;
a2.b = str2;
for (IronSource.AD_UNIT ad_unit : IronSource.AD_UNIT.values()) {
if (this.X.contains(ad_unit)) {
if (list.contains(ad_unit)) {
b(ad_unit);
} else {
a(ad_unit, false);
}
}
}
E();
} catch (Exception e3) {
e3.printStackTrace();
}
}
public final synchronized AbstractAdapter b(String str) {
try {
if (this.R != null && this.R.getProviderName().equals(str)) {
return this.R;
}
} catch (Exception e) {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
ironSourceLoggerManager.log(ironSourceTag, "getOfferwallAdapter exception: " + e, 1);
}
return null;
}
public Placement b() {
com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
if (oVar != null) {
return oVar.a();
}
return null;
}
public final String b(Context context) {
String str;
com.ironsource.mediationsdk.utils.p tokenSettings;
JSONObject jSONObject;
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_CALLED, (JSONObject) null);
if (context == null) {
IronLog.API.error("bidding data cannot be retrieved, context required");
return null;
}
M.a b2 = M.a().b();
if (b2 == M.a.NOT_INIT) {
IronLog.API.error("bidding data cannot be retrieved, SDK not initialized");
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (JSONObject) null);
return null;
} else if (b2 == M.a.INIT_FAILED) {
IronLog.API.error("bidding data cannot be retrieved, SDK failed to initialize");
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (JSONObject) null);
return null;
} else {
try {
com.ironsource.mediationsdk.utils.l a2 = this.i != null ? this.i : D.a(context);
if (b2 == M.a.NOT_INIT) {
this.an.a(context);
this.an.b(IronSourceUtils.getSDKVersion());
this.an.c(this.p);
this.an.d(ConfigFile.getConfigFile().getPluginType());
this.an.a(com.ironsource.c.a.a());
this.an.b(IronSourceUtils.isGooglePlayInstalled(context));
}
if (b2 != M.a.INITIATED) {
M.a().a(a2);
if (a2 != null) {
M.a().a(context, a2);
}
}
if (a2 == null || !a2.b()) {
tokenSettings = new com.ironsource.mediationsdk.utils.p();
} else {
tokenSettings = a2.c.e.c();
if (!tokenSettings.d) {
tokenSettings.b = a2.b.a(IronSourceConstants.IRONSOURCE_CONFIG_NAME);
}
}
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(tokenSettings, "tokenSettings");
if (tokenSettings.d) {
com.ironsource.environment.f.b bVar = new com.ironsource.environment.f.b();
Intrinsics.checkNotNullParameter(context, "context");
JSONObject a3 = C1360m.a(context, bVar.a);
Intrinsics.checkNotNullExpressionValue(a3, "mGlobalDataReader.getDat…s(context, mTokenKeyList)");
jSONObject = com.ironsource.environment.f.b.a(a3);
} else {
NetworkSettings it = tokenSettings.b;
if (it != null) {
C1351d a4 = C1351d.a();
Intrinsics.checkNotNullExpressionValue(it, "it");
AbstractAdapter a5 = a4.a(it, it.getApplicationSettings(), true, false);
if (a5 != null) {
jSONObject = C1353f.a().a(a5.getPlayerBiddingData(), tokenSettings.c, tokenSettings.a);
}
}
jSONObject = null;
}
C1353f.a().a(jSONObject, true);
str = tokenSettings.e ? IronSourceAES.compressAndEncrypt(jSONObject.toString()) : IronSourceAES.encrypt(jSONObject.toString());
} catch (Throwable th) {
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_ENRICH_TOKEN_ERROR, (JSONObject) null);
IronLog.API.error("got error during token creation: " + th.getMessage());
str = null;
}
if (str == null) {
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (JSONObject) null);
}
return str;
}
}
public final synchronized void b(Activity activity, String str, String str2) {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "loadISDemandOnlyRewardedVideo() instanceId=" + str, 1);
if (!this.w) {
this.f.log(IronSourceLogger.IronSourceTag.API, "initISDemandOnly() must be called before loadISDemandOnlyRewardedVideo()", 3);
Z.a().a(str, new IronSourceError(508, "initISDemandOnly() must be called before loadISDemandOnlyRewardedVideo()"));
} else if (!this.u) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Rewarded video was initialized in mediation mode", 3);
Z.a().a(str, new IronSourceError(508, "Rewarded video was initialized in mediation mode"));
} else {
boolean z = false;
if (activity != null) {
ContextProvider.getInstance().updateActivity(activity);
} else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
if (str2 != null) {
z = true;
}
a((int) IronSourceConstants.TROUBLESHOOTING_DO_CALLED_RV_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, z, 1));
this.f.log(IronSourceLogger.IronSourceTag.API, "Rewarded video was initialized and loaded without Activity", 3);
Z.a().a(str, new IronSourceError(IronSourceError.ERROR_DO_RV_LOAD_MISSING_ACTIVITY, "Rewarded video was initialized and loaded without Activity"));
return;
}
M.a b2 = M.a().b();
if (b2 == M.a.INIT_FAILED) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
Z.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
} else if (b2 == M.a.INIT_IN_PROGRESS) {
if (M.a().c()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
Z.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
synchronized (this.ak) {
this.ak.add(str);
}
if (str2 != null) {
a((int) IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, this.L));
}
} else {
synchronized (this.ak) {
if (this.am == null) {
this.ak.add(str);
if (str2 != null) {
a((int) IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, this.L));
}
} else if (!d()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "No rewarded video configurations found", 3);
Z.a().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain rewarded video data", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
} else if (str2 == null) {
this.am.a(str, (String) null, false);
} else {
this.am.a(str, str2, true);
}
}
}
}
}
public final void b(boolean z) {
this.y = Boolean.valueOf(z);
IronSourceLoggerManager logger = IronSourceLoggerManager.getLogger();
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
logger.log(ironSourceTag, "setConsent : " + z, 1);
C1351d.a().a(z);
if (this.R != null) {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag2 = IronSourceLogger.IronSourceTag.ADAPTER_API;
ironSourceLoggerManager.log(ironSourceTag2, "Offerwall | setConsent(consent:" + z + ")", 1);
this.R.setConsent(z);
}
int i = z ? 40 : 41;
this.an.a(z);
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(i, IronSourceUtils.getMediationAdditionalData(false)));
}
public final synchronized void c(Activity activity, String str, String str2) {
if (str2 != null) {
d(activity, str, str2);
return;
}
this.f.log(IronSourceLogger.IronSourceTag.API, "adm cannot be null", 3);
A.a().a(str, new IronSourceError(510, "adm cannot be null"));
}
public final boolean c() {
boolean z;
boolean z2;
try {
if (this.u) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Rewarded Video was initialized in demand only mode. Use isISDemandOnlyRewardedVideoAvailable instead", 3);
return false;
}
try {
if (!this.F && !this.ai) {
if (!this.E) {
z2 = this.b.c();
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
if (this.E) {
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(z2 ? IronSourceConstants.RV_API_HAS_AVAILABILITY_TRUE : IronSourceConstants.RV_API_HAS_AVAILABILITY_FALSE, mediationAdditionalData));
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "isRewardedVideoAvailable():" + z2, 1);
return z2;
}
if (this.z != null) {
}
z2 = false;
JSONObject mediationAdditionalData2 = IronSourceUtils.getMediationAdditionalData(false);
if (this.E) {
a(mediationAdditionalData2, new Object[][]{new Object[]{IronSourceConstants.EVENTS_PROGRAMMATIC, Integer.valueOf(this.L)}});
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(z2 ? IronSourceConstants.RV_API_HAS_AVAILABILITY_TRUE : IronSourceConstants.RV_API_HAS_AVAILABILITY_FALSE, mediationAdditionalData2));
IronSourceLoggerManager ironSourceLoggerManager2 = this.f;
IronSourceLogger.IronSourceTag ironSourceTag2 = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager2.log(ironSourceTag2, "isRewardedVideoAvailable():" + z2, 1);
return z2;
}
JSONObject mediationAdditionalData22 = IronSourceUtils.getMediationAdditionalData(false);
if (this.E) {
}
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(z2 ? IronSourceConstants.RV_API_HAS_AVAILABILITY_TRUE : IronSourceConstants.RV_API_HAS_AVAILABILITY_FALSE, mediationAdditionalData22));
IronSourceLoggerManager ironSourceLoggerManager22 = this.f;
IronSourceLogger.IronSourceTag ironSourceTag22 = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager22.log(ironSourceTag22, "isRewardedVideoAvailable():" + z2, 1);
return z2;
} catch (Throwable th) {
z = z2;
th = th;
IronSourceLoggerManager ironSourceLoggerManager3 = this.f;
IronSourceLogger.IronSourceTag ironSourceTag3 = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager3.log(ironSourceTag3, "isRewardedVideoAvailable():" + z, 1);
this.f.logException(IronSourceLogger.IronSourceTag.API, "isRewardedVideoAvailable()", th);
return false;
}
if (this.D != null) {
}
z2 = false;
} catch (Throwable th2) {
th = th2;
z = false;
}
}
public final boolean c(String str) {
try {
this.f.log(IronSourceLogger.IronSourceTag.API, this.a + ":setDynamicUserId(dynamicUserId:" + str + ")", 1);
com.ironsource.d.a aVar = new com.ironsource.d.a();
if (!a(str, 1, 128)) {
aVar.a(ErrorBuilder.buildInvalidKeyValueError(IronSourceConstants.EVENTS_DYNAMIC_USER_ID, IronSourceConstants.SUPERSONIC_CONFIG_NAME, "dynamicUserId is invalid, should be between 1-128 chars in length."));
}
if (!aVar.a()) {
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, aVar.b().toString(), 2);
return false;
}
this.m = str;
com.ironsource.mediationsdk.a.h.e().b(new com.ironsource.mediationsdk.a.c(52, IronSourceUtils.getJsonForUserId(true)));
return true;
} catch (Exception e) {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.logException(ironSourceTag, this.a + ":setDynamicUserId(dynamicUserId:" + str + ")", e);
return false;
}
}
public final synchronized void d(Activity activity, String str, String str2) {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "loadISDemandOnlyInterstitial() instanceId=" + str, 1);
if (!this.x) {
this.f.log(IronSourceLogger.IronSourceTag.API, "initISDemandOnly() must be called before loadISDemandOnlyInterstitial()", 3);
A.a().a(str, new IronSourceError(510, "initISDemandOnly() must be called before loadISDemandOnlyInterstitial()"));
} else if (!this.v) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Interstitial was initialized in mediation mode. Use loadInterstitial instead", 3);
A.a().a(str, new IronSourceError(510, "Interstitial was initialized in mediation mode. Use loadInterstitial instead"));
} else {
boolean z = false;
if (activity != null) {
ContextProvider.getInstance().updateActivity(activity);
} else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
if (str2 != null) {
z = true;
}
b(IronSourceConstants.TROUBLESHOOTING_DO_CALLED_IS_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, z, 1));
this.f.log(IronSourceLogger.IronSourceTag.API, "Interstitial was initialized and loaded without Activity", 3);
A.a().a(str, new IronSourceError(IronSourceError.ERROR_DO_IS_LOAD_MISSING_ACTIVITY, "Interstitial was initialized and loaded without Activity"));
return;
}
M.a b2 = M.a().b();
if (b2 == M.a.INIT_FAILED) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
A.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
} else if (b2 == M.a.INIT_IN_PROGRESS) {
if (M.a().c()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
A.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
return;
}
synchronized (this.aj) {
this.aj.add(str);
}
if (str2 != null) {
b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_IS_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
}
} else {
synchronized (this.aj) {
if (this.M == null) {
this.aj.add(str);
if (str2 != null) {
b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_IS_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
}
} else if (!h()) {
this.f.log(IronSourceLogger.IronSourceTag.API, "No interstitial configurations found", 3);
A.a().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain interstitial data", "Interstitial"));
} else if (str2 == null) {
this.M.a(str, (String) null, false);
} else {
this.M.a(str, str2, true);
}
}
}
}
}
public final void d(String str) {
try {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, this.a + ":setMediationType(mediationType:" + str + ")", 1);
if (a(str, 1, 64) && v(str)) {
this.o = str;
} else {
this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, " mediationType value is invalid - should be alphanumeric and 1-64 chars in length", 1);
}
} catch (Exception e) {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.logException(ironSourceTag, this.a + ":setMediationType(mediationType:" + str + ")", e);
}
}
public boolean d() {
com.ironsource.mediationsdk.utils.l lVar = this.i;
return (lVar == null || lVar.c == null || this.i.c.a == null) ? false : true;
}
public InterstitialPlacement e() {
com.ironsource.mediationsdk.model.h hVar = this.i.c.b;
if (hVar != null) {
return hVar.a();
}
return null;
}
public final void e(String str) {
String str2 = "showRewardedVideo(" + str + ")";
this.f.log(IronSourceLogger.IronSourceTag.API, str2, 1);
try {
if (this.u) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", 3);
this.g.onRewardedVideoAdShowFailed(ErrorBuilder.buildInitFailedError("Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
} else if (!d()) {
this.g.onRewardedVideoAdShowFailed(ErrorBuilder.buildInitFailedError("showRewardedVideo can't be called before the Rewarded Video ad unit initialization completed successfully", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
} else if (this.E) {
q(str);
} else {
Placement r = r(str);
if (r != null) {
this.b.a(r);
this.b.a(r.getPlacementName());
}
}
} catch (Exception e) {
this.f.logException(IronSourceLogger.IronSourceTag.API, str2, e);
this.g.onRewardedVideoAdShowFailed(new IronSourceError(510, e.getMessage()));
}
}
@Override
public final void f() {
synchronized (this.ad) {
if (this.ad.booleanValue()) {
this.ad = Boolean.FALSE;
C1357j.a().a(this.ae, new IronSourceError(603, "init had failed"));
this.ae = null;
this.af = null;
}
}
if (this.J) {
this.J = false;
C1363p.a().a(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
}
if (this.G) {
this.G = false;
C1363p.a().a(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
synchronized (this.aj) {
Iterator<String> it = this.aj.iterator();
while (it.hasNext()) {
A.a().a(it.next(), ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
}
this.aj.clear();
}
synchronized (this.ak) {
Iterator<String> it2 = this.ak.iterator();
while (it2.hasNext()) {
Z.a().a(it2.next(), ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
this.ak.clear();
}
}
public final synchronized void f(String str) {
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "showISDemandOnlyRewardedVideo() instanceId=" + str, 1);
try {
} catch (Exception e) {
this.f.logException(IronSourceLogger.IronSourceTag.API, "showISDemandOnlyRewardedVideo", e);
Z.a().b(str, new IronSourceError(510, e.getMessage()));
}
if (!this.u) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Rewarded video was initialized in mediation mode. Use showRewardedVideo instead", 3);
Z.a().b(str, new IronSourceError(508, "Rewarded video was initialized in mediation mode. Use showRewardedVideo instead"));
} else if (this.am == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Rewarded video was not initiated", 3);
Z.a().b(str, new IronSourceError(508, "Rewarded video was not initiated"));
} else {
C1368u c1368u = this.am;
if (c1368u.a.containsKey(str)) {
C1369v c1369v = c1368u.a.get(str);
c1368u.a(IronSourceConstants.RV_INSTANCE_SHOW, c1369v);
c1369v.a();
return;
}
C1368u.a(1500, str);
Z.a().b(str, ErrorBuilder.buildNonExistentInstanceError(IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
}
public final boolean g() {
boolean z;
boolean z2;
try {
if (this.v) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Interstitial was initialized in demand only mode. Use isISDemandOnlyInterstitialReady instead", 3);
return false;
}
if (!this.H) {
if (this.c != null) {
}
} else if (this.I) {
if (this.C != null) {
}
} else {
z2 = this.A != null && this.A.e();
}
try {
com.ironsource.mediationsdk.a.d.e().b(new com.ironsource.mediationsdk.a.c(z2 ? IronSourceConstants.IS_CHECK_READY_TRUE : IronSourceConstants.IS_CHECK_READY_FALSE, IronSourceUtils.getMediationAdditionalData(false, this.H, 1)));
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "isInterstitialReady():" + z2, 1);
return z2;
} catch (Throwable th) {
z = z2;
th = th;
IronSourceLoggerManager ironSourceLoggerManager2 = this.f;
IronSourceLogger.IronSourceTag ironSourceTag2 = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager2.log(ironSourceTag2, "isInterstitialReady():" + z, 1);
this.f.logException(IronSourceLogger.IronSourceTag.API, "isInterstitialReady()", th);
return false;
}
} catch (Throwable th2) {
th = th2;
z = false;
}
}
public final synchronized boolean g(String str) {
boolean z;
if (this.am != null) {
C1368u c1368u = this.am;
if (c1368u.a.containsKey(str)) {
C1369v c1369v = c1368u.a.get(str);
if (c1369v.b()) {
C1368u.a((int) IronSourceConstants.RV_INSTANCE_READY_TRUE, c1369v, (Object[][]) null);
z = true;
if (z) {
return true;
}
} else {
C1368u.a((int) IronSourceConstants.RV_INSTANCE_READY_FALSE, c1369v, (Object[][]) null);
}
} else {
C1368u.a(1500, str);
}
z = false;
if (z) {
}
}
return false;
}
public final void h(String str) {
String str2 = "showInterstitial(" + str + ")";
this.f.log(IronSourceLogger.IronSourceTag.API, str2, 1);
try {
if (this.v) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead", 3);
this.g.onInterstitialAdShowFailed(new IronSourceError(510, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead"));
} else if (!h()) {
this.g.onInterstitialAdShowFailed(ErrorBuilder.buildInitFailedError("showInterstitial can't be called before the Interstitial ad unit initialization completed successfully", "Interstitial"));
} else if (this.H) {
t(str);
} else {
InterstitialPlacement u = u(str);
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
try {
if (u != null) {
str = u.getPlacementName();
}
mediationAdditionalData.put(IronSourceConstants.EVENTS_PLACEMENT_NAME, str);
} catch (JSONException e) {
e.printStackTrace();
}
com.ironsource.mediationsdk.a.d.e().b(new com.ironsource.mediationsdk.a.c(2100, mediationAdditionalData));
if (u != null) {
this.c.a(u);
E e2 = this.c;
u.getPlacementName();
e2.d();
}
}
} catch (Exception e3) {
this.f.logException(IronSourceLogger.IronSourceTag.API, str2, e3);
this.g.onInterstitialAdShowFailed(new IronSourceError(510, e3.getMessage()));
}
}
public boolean h() {
com.ironsource.mediationsdk.utils.l lVar = this.i;
return (lVar == null || lVar.c == null || this.i.c.b == null) ? false : true;
}
public boolean i() {
com.ironsource.mediationsdk.utils.l lVar = this.i;
return (lVar == null || lVar.c == null || this.i.c.c == null) ? false : true;
}
public final synchronized boolean i(String str) {
boolean z;
if (this.M != null) {
C1366s c1366s = this.M;
if (c1366s.a.containsKey(str)) {
C1367t c1367t = c1366s.a.get(str);
if (c1367t.b()) {
C1366s.a((int) IronSourceConstants.IS_INSTANCE_READY_TRUE, c1367t, (Object[][]) null);
z = true;
if (z) {
return true;
}
} else {
C1366s.a((int) IronSourceConstants.IS_INSTANCE_READY_FALSE, c1367t, (Object[][]) null);
}
} else {
C1366s.a((int) IronSourceConstants.IS_INSTANCE_NOT_FOUND, str);
}
z = false;
if (z) {
}
}
return false;
}
public final void j(String str) {
String str2 = "showOfferwall(" + str + ")";
this.f.log(IronSourceLogger.IronSourceTag.API, str2, 1);
try {
if (!i()) {
this.g.onOfferwallShowFailed(ErrorBuilder.buildInitFailedError("showOfferwall can't be called before the Offerwall ad unit initialization completed successfully", IronSourceConstants.OFFERWALL_AD_UNIT));
return;
}
com.ironsource.mediationsdk.model.j a2 = this.i.c.c.a(str);
if (a2 == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 3);
a2 = this.i.c.c.a();
if (a2 == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Default placement was not found, please make sure you are using the right placements.", 3);
return;
}
}
this.d.a(a2.b);
} catch (Exception e) {
this.f.logException(IronSourceLogger.IronSourceTag.API, str2, e);
this.g.onOfferwallShowFailed(ErrorBuilder.buildInitFailedError("showOfferwall can't be called before the Offerwall ad unit initialization completed successfully", IronSourceConstants.OFFERWALL_AD_UNIT));
}
}
public final boolean j() {
try {
if (this.d != null) {
return this.d.a();
}
return false;
} catch (Exception unused) {
return false;
}
}
public final InterstitialPlacement k(String str) {
try {
InterstitialPlacement s = s(str);
if (s == null) {
try {
this.f.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
s = e();
} catch (Exception unused) {
return s;
}
}
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "getPlacementInfo(placement: " + str + "):" + s, 1);
return s;
} catch (Exception unused2) {
return null;
}
}
public final String k() {
return this.j;
}
public final Placement l(String str) {
try {
Placement p = p(str);
if (p == null) {
try {
this.f.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
p = b();
} catch (Exception unused) {
return p;
}
}
IronSourceLoggerManager ironSourceLoggerManager = this.f;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "getPlacementInfo(placement: " + str + "):" + p, 1);
return p;
} catch (Exception unused2) {
return null;
}
}
public final String l() {
String str;
String str2;
JSONObject a2;
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_CALLED, (JSONObject) null);
IronLog.API.info("");
com.ironsource.mediationsdk.utils.l lVar = this.i;
if (lVar == null) {
IronLog.API.error("bidding data cannot be retrieved, SDK not initialized");
} else {
NetworkSettings a3 = lVar.b.a(IronSourceConstants.IRONSOURCE_CONFIG_NAME);
if (a3 != null) {
JSONObject jSONObject = new JSONObject();
AbstractAdapter a4 = C1351d.a().a(a3, a3.getApplicationSettings(), true, false);
if (a4 != null) {
try {
jSONObject = a4.getPlayerBiddingData();
} catch (Exception e) {
e = e;
str = null;
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_ENRICH_TOKEN_ERROR, (JSONObject) null);
IronLog.API.error("got error during creating the token: " + e.getMessage());
str2 = str;
if (str2 == null) {
}
return str2;
}
}
com.ironsource.mediationsdk.utils.p c = this.i.c.e.c();
if (c.d) {
a2 = new com.ironsource.environment.f.b().a();
C1353f.a().a(a2, true);
} else {
a2 = C1353f.a().a(jSONObject, c.c, c.a);
}
IronLog.INTERNAL.verbose("bidding data: " + a2);
if (a2 != null) {
IronLog.INTERNAL.verbose("raw biddingData length: " + a2.toString().length());
str2 = c.e ? IronSourceAES.compressAndEncrypt(a2.toString()) : IronSourceAES.encrypt(a2.toString());
if (str2 != null) {
try {
IronLog.INTERNAL.verbose("biddingData length: " + str2.length());
} catch (Exception e2) {
str = str2;
e = e2;
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_ENRICH_TOKEN_ERROR, (JSONObject) null);
IronLog.API.error("got error during creating the token: " + e.getMessage());
str2 = str;
if (str2 == null) {
}
return str2;
}
}
if (str2 == null) {
a((int) IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (JSONObject) null);
}
return str2;
}
}
}
str2 = null;
if (str2 == null) {
}
return str2;
}
public final boolean m() {
return this.u || this.v;
}
public final boolean m(String str) {
if (this.v) {
return false;
}
boolean z = w(str) != k.a.d;
if (z) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(this.v, this.H, 1);
try {
mediationAdditionalData.put(IronSourceConstants.EVENTS_PLACEMENT_NAME, str);
if (this.H) {
mediationAdditionalData.put(IronSourceConstants.EVENTS_PROGRAMMATIC, 1);
}
} catch (Exception unused) {
}
com.ironsource.mediationsdk.a.d.e().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.IS_CHECK_CAPPED_TRUE, mediationAdditionalData));
}
return z;
}
public final boolean n(String str) {
if (C()) {
com.ironsource.mediationsdk.model.f fVar = null;
try {
fVar = this.i.c.d.a(str);
if (fVar == null && (fVar = this.i.c.d.a()) == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Banner default placement was not found", 3);
return false;
}
} catch (Exception e) {
e.printStackTrace();
}
if (fVar == null) {
return false;
}
return com.ironsource.mediationsdk.utils.k.b(ContextProvider.getInstance().getApplicationContext(), fVar.getPlacementName());
}
return false;
}
public int o(String str) {
com.ironsource.mediationsdk.utils.l lVar = this.i;
if (lVar == null || lVar.c == null || this.i.c.a == null) {
return k.a.d;
}
Placement placement = null;
try {
placement = p(str);
if (placement == null && (placement = b()) == null) {
this.f.log(IronSourceLogger.IronSourceTag.API, "Default placement was not found", 3);
}
} catch (Exception e) {
e.printStackTrace();
}
return placement == null ? k.a.d : com.ironsource.mediationsdk.utils.k.b(ContextProvider.getInstance().getApplicationContext(), placement);
}
}