Files
Daniel Elliott c080f0d97f Add Discord community version (64-bit only)
- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
2026-02-18 15:48:36 -08:00

3496 lines
137 KiB
Java

package com.ironsource.mediationsdk;
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.ironsource.a4;
import com.ironsource.adqualitysdk.sdk.IronSourceAdQuality;
import com.ironsource.af;
import com.ironsource.ah;
import com.ironsource.aj;
import com.ironsource.b7;
import com.ironsource.ca;
import com.ironsource.ce;
import com.ironsource.ch;
import com.ironsource.cr;
import com.ironsource.d4;
import com.ironsource.da;
import com.ironsource.e1;
import com.ironsource.el;
import com.ironsource.en;
import com.ironsource.environment.ContextProvider;
import com.ironsource.fd;
import com.ironsource.fl;
import com.ironsource.fo;
import com.ironsource.g1;
import com.ironsource.gf;
import com.ironsource.hi;
import com.ironsource.i9;
import com.ironsource.is;
import com.ironsource.ja;
import com.ironsource.jg;
import com.ironsource.ji;
import com.ironsource.jl;
import com.ironsource.kb;
import com.ironsource.kp;
import com.ironsource.l8;
import com.ironsource.lj;
import com.ironsource.m8;
import com.ironsource.mediationsdk.IronSource;
import com.ironsource.mediationsdk.adquality.AdQualityBridge;
import com.ironsource.mediationsdk.adunit.adapter.utility.AdInfo;
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.demandOnly.h;
import com.ironsource.mediationsdk.events.ISErrorListener;
import com.ironsource.mediationsdk.impressionData.ImpressionDataListener;
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.logger.LogListener;
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.s;
import com.ironsource.mediationsdk.sdk.InitializationListener;
import com.ironsource.mediationsdk.sdk.LevelPlayInterstitialListener;
import com.ironsource.mediationsdk.sdk.LevelPlayRewardedVideoBaseListener;
import com.ironsource.mediationsdk.sdk.LevelPlayRewardedVideoListener;
import com.ironsource.mediationsdk.sdk.LevelPlayRewardedVideoManualListener;
import com.ironsource.mediationsdk.sdk.SegmentListener;
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.n6;
import com.ironsource.os;
import com.ironsource.pp;
import com.ironsource.ps;
import com.ironsource.qe;
import com.ironsource.qq;
import com.ironsource.rk;
import com.ironsource.rp;
import com.ironsource.rq;
import com.ironsource.rt;
import com.ironsource.sd;
import com.ironsource.se;
import com.ironsource.sl;
import com.ironsource.st;
import com.ironsource.t8;
import com.ironsource.te;
import com.ironsource.to;
import com.ironsource.ts;
import com.ironsource.ui;
import com.ironsource.ul;
import com.ironsource.vi;
import com.ironsource.wa;
import com.ironsource.wm;
import com.ironsource.x7;
import com.ironsource.xa;
import com.ironsource.xh;
import com.ironsource.yc;
import com.ironsource.z5;
import com.ironsource.zb;
import com.ironsource.zn;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class p implements ui, en, ca, ca.b, ca.c, ca.a {
private static boolean t0;
private Set<IronSource.AD_UNIT> A;
private boolean B;
private IronSourceSegment C;
private final String D;
private int E;
private boolean F;
private boolean G;
private boolean H;
private boolean I;
private boolean J;
private boolean K;
private boolean L;
private Boolean M;
private IronSourceBannerLayout N;
private String O;
private Boolean P;
private se Q;
private w R;
private xh S;
private kp T;
private z5 U;
private InitializationListener V;
private wm W;
private AtomicBoolean X;
private boolean Y;
private boolean Z;
private final String a;
private boolean a0;
private final String b;
private boolean b0;
private final ce c;
private boolean c0;
private final ce.a d;
private int d0;
private final qe e;
private final ConcurrentHashMap<String, h.d> e0;
private final sd f;
private final ConcurrentHashMap<String, h.b> f0;
private final jg.a g;
private final ConcurrentHashMap<String, h.d> g0;
private IronSourceLoggerManager h;
private com.ironsource.mediationsdk.demandOnly.f h0;
private rk i;
private com.ironsource.mediationsdk.demandOnly.k i0;
private com.ironsource.mediationsdk.logger.b j;
private com.ironsource.mediationsdk.demandOnly.c j0;
private AtomicBoolean k;
private zb k0;
private final Object l;
private vi l0;
private cr m;
private fd m0;
private String n;
private boolean n0;
private String o;
private AdQualityBridge o0;
private String p;
private final AtomicBoolean p0;
private String q;
ISErrorListener q0;
private Map<String, String> r;
af<ISDemandOnlyInterstitialListener> r0;
private String s;
af<ISDemandOnlyRewardedVideoListener> s0;
private AtomicBoolean t;
private boolean u;
private List<IronSource.AD_UNIT> v;
private String w;
private Context x;
private Boolean y;
private Set<IronSource.AD_UNIT> z;
public class a implements ISErrorListener {
public a() {
}
@Override // com.ironsource.mediationsdk.events.ISErrorListener
public void onError(Throwable th) {
IronLog.INTERNAL.error(th.getMessage());
}
}
public static /* synthetic */ class b {
static final /* synthetic */ int[] a;
static final /* synthetic */ int[] b;
static final /* synthetic */ int[] c;
static {
int[] iArr = new int[fo.b.values().length];
c = iArr;
try {
iArr[fo.b.CAPPED_PER_DELIVERY.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
c[fo.b.CAPPED_PER_COUNT.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
c[fo.b.CAPPED_PER_PACE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
c[fo.b.NOT_CAPPED.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
int[] iArr2 = new int[s.d.values().length];
b = iArr2;
try {
iArr2[s.d.INIT_FAILED.ordinal()] = 1;
} catch (NoSuchFieldError unused5) {
}
try {
b[s.d.INIT_IN_PROGRESS.ordinal()] = 2;
} catch (NoSuchFieldError unused6) {
}
int[] iArr3 = new int[IronSource.AD_UNIT.values().length];
a = iArr3;
try {
iArr3[IronSource.AD_UNIT.REWARDED_VIDEO.ordinal()] = 1;
} catch (NoSuchFieldError unused7) {
}
try {
a[IronSource.AD_UNIT.INTERSTITIAL.ordinal()] = 2;
} catch (NoSuchFieldError unused8) {
}
try {
a[IronSource.AD_UNIT.BANNER.ordinal()] = 3;
} catch (NoSuchFieldError unused9) {
}
try {
a[IronSource.AD_UNIT.NATIVE_AD.ordinal()] = 4;
} catch (NoSuchFieldError unused10) {
}
}
}
public interface c {
void a(String str);
}
public static class d {
static volatile p a = new p(null);
private d() {
}
}
private p() {
this(el.N().f(), el.I().b(), el.N().x(), el.N().t(), el.I().o());
}
public p(ce ceVar, ce.a aVar, qe qeVar, sd sdVar, jg.a aVar2) {
this.a = getClass().getName();
this.b = "!SDK-VERSION-STRING!:com.ironsource:mediationsdk:\u200b8.4.0";
this.l = new Object();
this.m = null;
this.n = null;
this.o = "";
this.p = null;
this.q = null;
this.r = null;
this.s = null;
this.u = false;
this.y = null;
this.B = true;
this.D = "sessionDepth";
this.P = null;
this.n0 = false;
this.c = ceVar;
this.d = aVar;
this.e = qeVar;
this.f = sdVar;
this.g = aVar2;
w();
this.k = new AtomicBoolean();
this.z = new HashSet();
this.A = new HashSet();
this.G = false;
this.F = false;
this.H = false;
this.t = new AtomicBoolean(true);
this.X = new AtomicBoolean(false);
this.p0 = new AtomicBoolean(false);
this.E = 0;
this.I = false;
this.J = false;
this.K = false;
this.L = false;
this.w = IronSourceUtils.getSessionId();
this.M = Boolean.FALSE;
this.b0 = false;
this.O = null;
this.Q = null;
this.V = null;
this.W = null;
this.R = null;
this.Y = false;
this.e0 = new ConcurrentHashMap<>();
this.g0 = new ConcurrentHashMap<>();
this.f0 = new ConcurrentHashMap<>();
this.h0 = null;
this.i0 = null;
this.j0 = null;
this.d0 = 1;
this.k0 = new zb();
vi viVar = new vi();
this.l0 = viVar;
this.m0 = new fd(viVar);
this.q0 = new a();
this.o0 = null;
this.r0 = new af.a();
this.s0 = new af.b();
}
public /* synthetic */ p(a aVar) {
this();
}
private boolean A() {
cr crVar = this.m;
return (crVar == null || crVar.j() == null || this.m.j().a() == null || this.m.j().a().size() <= 0) ? false : true;
}
private synchronized boolean C() {
return this.u;
}
private boolean D() {
cr crVar = this.m;
return (crVar == null || crVar.c() == null || this.m.c().d() == null) ? false : true;
}
private boolean E() {
return D() && G();
}
private boolean G() {
cr crVar = this.m;
return (crVar == null || crVar.j() == null || this.m.j().b() == null || this.m.j().b().size() <= 0) ? false : true;
}
private boolean H() {
cr crVar = this.m;
return (crVar == null || crVar.c() == null || this.m.c().e() == null) ? false : true;
}
private boolean I() {
return H() && J();
}
private boolean J() {
cr crVar = this.m;
return (crVar == null || crVar.j() == null || this.m.j().c() == null || this.m.j().c().isEmpty()) ? false : true;
}
private boolean L() {
cr crVar = this.m;
return (crVar == null || crVar.c() == null || this.m.c().f() == null) ? false : true;
}
private boolean M() {
return L() && N();
}
private boolean N() {
cr crVar = this.m;
return (crVar == null || crVar.j() == null || this.m.j().d() == null || this.m.j().d().size() <= 0) ? false : true;
}
private void T() {
if (this.V == null || !this.X.compareAndSet(false, true)) {
return;
}
IronLog.CALLBACK.verbose("onInitializationCompleted()");
rp.i().a(new kb(IronSourceConstants.TROUBLESHOOTING_INIT_COMPLETED, IronSourceUtils.getMediationAdditionalData(false)));
this.V.onInitializationComplete();
}
private void V() {
ConcurrentHashMap<String, List<String>> c2 = lj.b().c();
if (c2.containsKey(com.ironsource.mediationsdk.metadata.a.c)) {
if (TextUtils.isEmpty(c2.get(com.ironsource.mediationsdk.metadata.a.c).get(0))) {
return;
}
ja.a.b(!MetaDataUtils.getMetaDataBooleanValue(r0));
}
}
private boolean W() {
return this.o0 == null && this.p0.get() && this.m.c().a().a() && AdQualityBridge.adQualityAvailable();
}
private void X() {
if (this.H) {
Z();
return;
}
boolean h = this.m.c().c().d().h();
this.c0 = h;
if (h) {
Y();
} else {
f0();
}
}
private void Y() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> a2 = a(this.m.j().a());
if (a2.size() > 0) {
this.U = new z5(a2, this.m.c().c(), IronSourceUtils.getUserIdForNetworks(), lj.b(), this.C);
v();
} else {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
a(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.BANNER, false);
}
}
private void Z() {
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.m.j().a().size(); i++) {
String str = this.m.j().a().get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.m.k().b(str));
}
}
if (arrayList.isEmpty()) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
a(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.BANNER, false);
return;
}
synchronized (this.f0) {
try {
n6 c2 = this.m.c().c();
da.a aVar = new da.a("Mediation");
if (c2.l()) {
aVar.a("isOneFlow", 1);
}
this.j0 = new com.ironsource.mediationsdk.demandOnly.c(arrayList, c2, n(), o(), new da.b(ji.i(), aVar));
} catch (Throwable th) {
throw th;
}
}
for (h.b bVar : this.f0.values()) {
this.j0.a(bVar.g(), bVar.c());
}
this.f0.clear();
}
private int a(pp ppVar) {
return (this.a0 || this.Y || !ppVar.k().e()) ? 1 : 2;
}
private cr a(Context context, String str, c cVar) {
cr crVar = null;
if (!IronSourceUtils.isNetworkConnected(context)) {
return null;
}
try {
String b2 = b(context);
if (TextUtils.isEmpty(b2)) {
b2 = this.c.J(context);
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "using custom identifier", 1);
}
String str2 = b2;
IronSourceSegment ironSourceSegment = this.C;
String sendPostRequest = HttpFunctions.sendPostRequest(ServerURL.buildInitURL(context, n(), str, str2, q(), this.Y, ironSourceSegment != null ? ironSourceSegment.getSegmentData() : null, B()), ah.a().toString(), cVar);
if (sendPostRequest == null) {
IronLog.INTERNAL.warning("serverResponseString is null");
return null;
}
if (IronSourceUtils.isEncryptedResponse()) {
IronLog ironLog = IronLog.INTERNAL;
ironLog.verbose("encrypt");
JSONObject jSONObject = new JSONObject(sendPostRequest);
String optString = jSONObject.optString(cr.n, null);
if (TextUtils.isEmpty(optString)) {
ironLog.warning("encryptedResponse is empty - return null");
return null;
}
sendPostRequest = a(optString, Boolean.valueOf(jSONObject.optBoolean("compression", false)));
if (TextUtils.isEmpty(sendPostRequest)) {
ironLog.warning("encoded response invalid - return null");
U();
return null;
}
}
cr crVar2 = new cr(context, n(), str, sendPostRequest);
try {
crVar2.a(cr.a.SERVER);
if (crVar2.p()) {
return crVar2;
}
IronLog.INTERNAL.warning("response invalid - return null");
return null;
} catch (Exception e) {
e = e;
crVar = crVar2;
i9.d().a(e);
IronLog.INTERNAL.warning("exception = " + e);
return crVar;
}
} catch (Exception e2) {
e = e2;
}
}
private com.ironsource.mediationsdk.demandOnly.f a(List<NetworkSettings> list) {
hi d2 = this.m.c().d();
da.a aVar = new da.a("Mediation");
if (d2.k()) {
aVar.a("isOneFlow", 1);
}
return new com.ironsource.mediationsdk.demandOnly.f(list, d2, com.ironsource.mediationsdk.c.b(), this.r0, n(), o(), new da.b(ji.i(), aVar));
}
private IronSourceError a(s.d dVar) {
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 (dVar == s.d.INIT_FAILED) {
return new IronSourceError(510, "ironSource initialization failed");
}
if (dVar == s.d.INIT_IN_PROGRESS && s.c().d()) {
return new IronSourceError(510, "ironSource initialization in progress");
}
return null;
}
private String a(String str, Boolean bool) {
return bool.booleanValue() ? IronSourceAES.decryptAndDecompress(xa.b().c(), str) : IronSourceAES.decode(xa.b().c(), str);
}
private List<NetworkSettings> a(ArrayList<String> arrayList) {
ArrayList arrayList2 = new ArrayList();
for (int i = 0; i < arrayList.size(); i++) {
String str = arrayList.get(i);
if (!TextUtils.isEmpty(str)) {
arrayList2.add(this.m.k().b(str));
}
}
return arrayList2;
}
private void a(int i, JSONObject jSONObject) {
ji.i().a(new kb(i, jSONObject));
}
private void a(a4 a4Var, Context context, cr crVar) {
ji.i().a(a4Var.c(), context);
ji.i().b(a4Var.d(), context);
ji.i().b(a4Var.f());
ji.i().a(a4Var.e());
ji.i().c(a4Var.a());
ji.i().c(a4Var.i(), context);
ji.i().a(a4Var.h(), context);
ji.i().b(a4Var.j(), context);
ji.i().d(a4Var.g(), context);
ji.i().a(crVar.c().b().i());
ji.i().a(a4Var.k());
ji.i().d(a4Var.b());
}
private void a(cr crVar) {
this.j.setDebugLevel(crVar.c().b().g().b());
this.h.setLoggerDebugLevel("console", crVar.c().b().g().a());
}
/* JADX WARN: Removed duplicated region for block: B:21:0x00c8 */
/* JADX WARN: Removed duplicated region for block: B:24:? A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private void a(com.ironsource.cr r8, android.content.Context r9) {
/*
r7 = this;
boolean r0 = r7.L()
r1 = 0
if (r0 == 0) goto L18
com.ironsource.m8 r0 = r8.c()
com.ironsource.pp r0 = r0.f()
com.ironsource.a4 r0 = r0.n()
boolean r0 = r0.l()
goto L19
L18:
r0 = r1
L19:
boolean r2 = r7.D()
if (r2 == 0) goto L30
com.ironsource.m8 r2 = r8.c()
com.ironsource.hi r2 = r2.d()
com.ironsource.a4 r2 = r2.j()
boolean r2 = r2.l()
goto L31
L30:
r2 = r1
L31:
boolean r3 = r7.y()
if (r3 == 0) goto L48
com.ironsource.m8 r3 = r8.c()
com.ironsource.n6 r3 = r3.c()
com.ironsource.a4 r3 = r3.h()
boolean r3 = r3.l()
goto L49
L48:
r3 = r1
L49:
boolean r4 = r7.H()
if (r4 == 0) goto L60
com.ironsource.m8 r4 = r8.c()
com.ironsource.jl r4 = r4.e()
com.ironsource.a4 r4 = r4.g()
boolean r4 = r4.l()
goto L61
L60:
r4 = r1
L61:
com.ironsource.m8 r5 = r8.c()
com.ironsource.t3 r5 = r5.b()
com.ironsource.ao r5 = r5.h()
boolean r6 = r5.i()
if (r0 == 0) goto L83
com.ironsource.m8 r0 = r8.c()
com.ironsource.pp r0 = r0.f()
com.ironsource.a4 r0 = r0.n()
r7.b(r0, r9, r8)
goto L8a
L83:
com.ironsource.rp r0 = com.ironsource.rp.i()
r0.b(r1)
L8a:
if (r2 == 0) goto L9c
com.ironsource.m8 r0 = r8.c()
com.ironsource.hi r0 = r0.d()
com.ironsource.a4 r0 = r0.j()
L98:
r7.a(r0, r9, r8)
goto Lc1
L9c:
if (r3 == 0) goto Lab
com.ironsource.m8 r0 = r8.c()
com.ironsource.n6 r0 = r0.c()
com.ironsource.a4 r0 = r0.h()
goto L98
Lab:
if (r4 == 0) goto Lba
com.ironsource.m8 r0 = r8.c()
com.ironsource.jl r0 = r0.e()
com.ironsource.a4 r0 = r0.g()
goto L98
Lba:
com.ironsource.ji r8 = com.ironsource.ji.i()
r8.b(r1)
Lc1:
com.ironsource.zn r8 = com.ironsource.zn.P
r8.b(r6)
if (r6 == 0) goto Leb
java.lang.String r0 = r5.j()
r8.b(r0, r9)
int[] r0 = r5.l()
r8.c(r0, r9)
int[] r0 = r5.k()
r8.a(r0, r9)
boolean r9 = r5.g()
r8.a(r9)
int r9 = r5.h()
r8.d(r9)
Leb:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.a(com.ironsource.cr, android.content.Context):void");
}
private void a(d4 d4Var) {
ja jaVar = ja.a;
jaVar.c(d4Var.g());
jaVar.a(d4Var.f());
jaVar.a(d4Var.j());
this.f.a(d4Var);
}
private void a(IronSource.AD_UNIT ad_unit) {
String str = ad_unit + " ad unit has already been initialized";
this.h.log(IronSourceLogger.IronSourceTag.API, str, 3);
IronSourceUtils.sendAutomationLog(str);
}
private void a(IronSource.AD_UNIT ad_unit, boolean z) {
ConcurrentHashMap concurrentHashMap;
int i = b.a[ad_unit.ordinal()];
if (i == 1) {
if (!this.F) {
if (this.Y) {
if (this.Z) {
this.Z = false;
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
return;
}
if (z || L() || this.A.contains(ad_unit)) {
to.a().a(false, (AdInfo) null);
return;
}
return;
}
Iterator<h.d> it = this.g0.values().iterator();
while (it.hasNext()) {
String c2 = it.next().c();
this.s0.a(c2).onRewardedVideoAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
concurrentHashMap = this.g0;
} else if (i != 2) {
if (i != 3) {
return;
}
if (!this.H) {
if (this.M.booleanValue()) {
this.M = Boolean.FALSE;
n.a().b(IronSource.AD_UNIT.BANNER, new IronSourceError(IronSourceError.ERROR_BN_INIT_FAILED_AFTER_LOAD, "init() had failed"));
this.N = null;
this.O = null;
return;
}
return;
}
for (h.b bVar : this.f0.values()) {
ISDemandOnlyBannerLayout g = bVar.g();
if (g != null) {
g.getListener().a(bVar.c(), ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", "Banner"));
}
}
concurrentHashMap = this.f0;
} else {
if (!this.G) {
if (this.b0) {
this.b0 = false;
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
return;
}
return;
}
Iterator<h.d> it2 = this.e0.values().iterator();
while (it2.hasNext()) {
String c3 = it2.next().c();
this.r0.a(c3).onInterstitialAdLoadFailed(c3, ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", "Interstitial"));
}
concurrentHashMap = this.e0;
}
concurrentHashMap.clear();
}
private synchronized void a(h.d dVar, ISDemandOnlyInterstitialListener iSDemandOnlyInterstitialListener) {
String c2 = dVar.c();
IronLog ironLog = IronLog.API;
ironLog.info("instanceId=" + c2);
try {
} catch (Throwable th) {
i9.d().a(th);
IronLog.API.error(th.getMessage());
iSDemandOnlyInterstitialListener.onInterstitialAdLoadFailed(c2, new IronSourceError(510, th.getMessage()));
}
if (!this.J) {
ironLog.error("initISDemandOnly() must be called before loadISDemandOnlyInterstitial()");
iSDemandOnlyInterstitialListener.onInterstitialAdLoadFailed(c2, new IronSourceError(510, "initISDemandOnly() must be called before loadISDemandOnlyInterstitial()"));
return;
}
if (!this.G) {
ironLog.error("Interstitial was initialized in mediation mode. Use loadInterstitial instead");
iSDemandOnlyInterstitialListener.onInterstitialAdLoadFailed(c2, new IronSourceError(510, "Interstitial was initialized in mediation mode. Use loadInterstitial instead"));
return;
}
s.d a2 = s.c().a();
if (a2 == s.d.INIT_FAILED) {
ironLog.error("init() had failed");
iSDemandOnlyInterstitialListener.onInterstitialAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
return;
}
IronSourceError a3 = dVar.a();
if (a3 != null) {
if (a3.getErrorCode() == 1060) {
b(IronSourceConstants.TROUBLESHOOTING_DO_CALLED_IS_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, !TextUtils.isEmpty(dVar.b()), 1));
}
ironLog.error(a3.toString());
iSDemandOnlyInterstitialListener.onInterstitialAdLoadFailed(c2, a3);
return;
}
e(dVar.e());
if (a2 == s.d.INIT_IN_PROGRESS) {
if (s.c().d()) {
ironLog.error("init() had failed");
iSDemandOnlyInterstitialListener.onInterstitialAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
} else {
synchronized (this.e0) {
this.e0.put(dVar.c(), dVar);
}
if (!TextUtils.isEmpty(dVar.c())) {
a(83003, IronSourceUtils.getMediationAdditionalData(true, !TextUtils.isEmpty(dVar.b()), 1));
}
}
return;
}
if (!E()) {
ironLog.error("No interstitial configurations found");
iSDemandOnlyInterstitialListener.onInterstitialAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("the server response does not contain interstitial data", "Interstitial"));
return;
}
synchronized (this.e0) {
try {
com.ironsource.mediationsdk.demandOnly.f fVar = this.h0;
if (fVar != null) {
fVar.a(dVar);
return;
}
this.e0.put(dVar.c(), dVar);
if (!TextUtils.isEmpty(dVar.b())) {
a(83003, IronSourceUtils.getMediationAdditionalData(true, !TextUtils.isEmpty(dVar.b()), 1));
}
} finally {
}
}
}
private synchronized void a(wm wmVar) {
this.W = wmVar;
}
private void a(String str, l8 l8Var) {
if (a(str, 1, 128)) {
return;
}
l8Var.a(ErrorBuilder.buildInvalidKeyValueError(IronSourceConstants.EVENTS_DYNAMIC_USER_ID, "dynamicUserId is invalid, should be between 1-128 chars in length."));
}
private void a(JSONObject jSONObject, Object[][] objArr) {
if (objArr != null) {
try {
for (Object[] objArr2 : objArr) {
jSONObject.put(objArr2[0].toString(), objArr2[1]);
}
} catch (Exception e) {
i9.d().a(e);
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "IronSourceObject addToDictionary: " + Log.getStackTraceString(e), 3);
}
}
}
private void a(boolean z, String str) {
if (z) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(this.F, true, this.d0);
if (str != null) {
a(mediationAdditionalData, new Object[][]{new Object[]{"placement", str}});
}
b(IronSourceConstants.RV_API_IS_CAPPED_TRUE, mediationAdditionalData);
}
}
/* JADX WARN: Removed duplicated region for block: B:11:0x005a */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private void a(boolean r6, boolean r7, int r8, org.json.JSONObject r9, boolean r10) {
/*
r5 = this;
java.lang.StringBuilder r0 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L25
r0.<init>() // Catch: java.lang.Exception -> L25
r1 = 0
r2 = 1
if (r7 == 0) goto L27
java.lang.String r6 = ",Activity=%s"
java.lang.Object[] r3 = new java.lang.Object[r2] // Catch: java.lang.Exception -> L25
com.ironsource.environment.ContextProvider r4 = com.ironsource.environment.ContextProvider.getInstance() // Catch: java.lang.Exception -> L25
android.app.Activity r4 = r4.getCurrentActiveActivity() // Catch: java.lang.Exception -> L25
if (r4 == 0) goto L19
r4 = r2
goto L1a
L19:
r4 = r1
L1a:
java.lang.Boolean r4 = java.lang.Boolean.valueOf(r4) // Catch: java.lang.Exception -> L25
r3[r1] = r4 // Catch: java.lang.Exception -> L25
java.lang.String r6 = java.lang.String.format(r6, r3) // Catch: java.lang.Exception -> L25
goto L30
L25:
r6 = move-exception
goto L65
L27:
if (r6 != 0) goto L33
java.lang.String r6 = ","
r0.append(r6) // Catch: java.lang.Exception -> L25
java.lang.String r6 = "init_context_flow"
L30:
r0.append(r6) // Catch: java.lang.Exception -> L25
L33:
java.lang.String r6 = ",cachedUserAgent=%s"
java.lang.Object[] r3 = new java.lang.Object[r2] // Catch: java.lang.Exception -> L25
com.ironsource.ce r4 = r5.c // Catch: java.lang.Exception -> L25
boolean r4 = r4.q() // Catch: java.lang.Exception -> L25
java.lang.Boolean r4 = java.lang.Boolean.valueOf(r4) // Catch: java.lang.Exception -> L25
r3[r1] = r4 // Catch: java.lang.Exception -> L25
java.lang.String r6 = java.lang.String.format(r6, r3) // Catch: java.lang.Exception -> L25
r0.append(r6) // Catch: java.lang.Exception -> L25
java.lang.String r6 = "ext1"
java.lang.String r0 = r0.toString() // Catch: java.lang.Exception -> L25
r9.put(r6, r0) // Catch: java.lang.Exception -> L25
java.lang.String r6 = "sessionDepth"
r9.put(r6, r8) // Catch: java.lang.Exception -> L25
if (r10 == 0) goto L75
if (r7 == 0) goto L5f
java.lang.String r6 = "isMultipleAdObjects"
goto L61
L5f:
java.lang.String r6 = "isMultipleAdUnits"
L61:
r9.put(r6, r2) // Catch: java.lang.Exception -> L25
goto L75
L65:
com.ironsource.i9 r7 = com.ironsource.i9.d()
r7.a(r6)
com.ironsource.mediationsdk.logger.IronLog r7 = com.ironsource.mediationsdk.logger.IronLog.INTERNAL
java.lang.String r6 = r6.toString()
r7.error(r6)
L75:
com.ironsource.kb r6 = new com.ironsource.kb
r7 = 14
r6.<init>(r7, r9)
com.ironsource.rp r7 = com.ironsource.rp.i()
r7.a(r6)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.a(boolean, boolean, int, org.json.JSONObject, boolean):void");
}
private synchronized void a(boolean z, boolean z2, boolean z3, IronSource.AD_UNIT... ad_unitArr) {
JSONObject mediationAdditionalData;
try {
int i = 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;
} else if (ad_unit.equals(IronSource.AD_UNIT.NATIVE_AD)) {
this.L = true;
}
}
if (s.c().a() == s.d.INIT_FAILED) {
try {
if (this.i != null) {
int length = ad_unitArr.length;
while (i < length) {
IronSource.AD_UNIT ad_unit2 = ad_unitArr[i];
if (!this.z.contains(ad_unit2)) {
a(ad_unit2, true);
}
i++;
}
}
} catch (Exception e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
return;
}
if (!C()) {
mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z2);
int length2 = ad_unitArr.length;
while (i < length2) {
IronSource.AD_UNIT ad_unit3 = ad_unitArr[i];
if (this.z.contains(ad_unit3)) {
this.h.log(IronSourceLogger.IronSourceTag.API, ad_unit3 + " ad unit has started initializing.", 3);
} else {
this.z.add(ad_unit3);
this.A.add(ad_unit3);
try {
mediationAdditionalData.put(ad_unit3.toString(), true);
} catch (Exception e2) {
i9.d().a(e2);
IronLog.INTERNAL.error(e2.toString());
}
}
i++;
}
JSONObject jSONObject = mediationAdditionalData;
int i2 = 1 + this.E;
this.E = i2;
a(z, z2, i2, jSONObject, z3);
return;
}
if (this.v == null) {
return;
}
try {
new fl().a(this.m.c().b().d().b(), B());
} catch (Exception e3) {
i9.d().a(e3);
IronLog.INTERNAL.error(e3.toString());
}
mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z2);
for (IronSource.AD_UNIT ad_unit4 : ad_unitArr) {
if (this.z.contains(ad_unit4)) {
a(ad_unit4);
} else {
this.z.add(ad_unit4);
this.A.add(ad_unit4);
try {
mediationAdditionalData.put(ad_unit4.toString(), true);
} catch (Exception e4) {
i9.d().a(e4);
IronLog.INTERNAL.error(e4.toString());
}
List<IronSource.AD_UNIT> list = this.v;
if (list == null || !list.contains(ad_unit4)) {
a(ad_unit4, false);
} else {
b(ad_unit4);
}
}
}
JSONObject jSONObject2 = mediationAdditionalData;
int i22 = 1 + this.E;
this.E = i22;
a(z, z2, i22, jSONObject2, z3);
return;
} catch (Throwable th) {
throw th;
}
throw th;
}
private boolean a(h.b bVar) {
if (s.c().a() != s.d.INIT_IN_PROGRESS) {
return false;
}
synchronized (this.f0) {
this.f0.put(bVar.c(), bVar);
}
return true;
}
private boolean a(String str, int i, int i2) {
return str != null && str.length() >= i && str.length() <= i2;
}
private void a0() {
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "Interstitial started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.m.j().b().size(); i++) {
String str = this.m.j().b().get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.m.k().b(str));
}
}
if (arrayList.isEmpty()) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
a(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.INTERSTITIAL, false);
return;
}
synchronized (this.e0) {
this.h0 = a((List<NetworkSettings>) arrayList);
}
Iterator<h.d> it = this.e0.values().iterator();
while (it.hasNext()) {
this.h0.a(it.next());
}
this.e0.clear();
}
private com.ironsource.mediationsdk.demandOnly.k b(List<NetworkSettings> list) {
pp f = this.m.c().f();
da.a aVar = new da.a("Mediation");
if (f.d()) {
aVar.a("isOneFlow", 1);
}
return new com.ironsource.mediationsdk.demandOnly.k(list, f, com.ironsource.mediationsdk.c.b(), this.s0, n(), o(), new da.b(rp.i(), aVar));
}
private void b(int i, JSONObject jSONObject) {
rp.i().a(new kb(i, jSONObject));
}
private void b(a4 a4Var, Context context, cr crVar) {
rp.i().a(a4Var.c(), context);
rp.i().b(a4Var.d(), context);
rp.i().b(a4Var.f());
rp.i().a(a4Var.e());
rp.i().c(a4Var.a());
rp.i().c(a4Var.i(), context);
rp.i().a(a4Var.h(), context);
rp.i().b(a4Var.j(), context);
rp.i().d(a4Var.g(), context);
rp.i().a(crVar.c().b().i());
rp.i().a(a4Var.k());
rp.i().d(a4Var.b());
}
private void b(IronSource.AD_UNIT ad_unit) {
int i = b.a[ad_unit.ordinal()];
if (i == 1) {
g0();
} else if (i == 2) {
c0();
} else {
if (i != 3) {
return;
}
X();
}
}
private boolean b(cr crVar) {
return crVar != null && crVar.o();
}
private boolean b(h.b bVar) {
synchronized (this.f0) {
try {
if (this.j0 != null) {
return false;
}
this.f0.put(bVar.c(), bVar);
return true;
} catch (Throwable th) {
throw th;
}
}
}
private boolean b(List<IronSource.AD_UNIT> list, boolean z, m8 m8Var) {
IronLog.INTERNAL.verbose();
try {
this.j.a(m8Var.b().g().d());
this.v = list;
c(true);
this.h.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) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
rp.i().a(new kb(114, mediationAdditionalData));
}
int b2 = m8Var.b().e().b();
if (b2 >= 0) {
t8 t8Var = new t8();
t8Var.a(b2);
t8Var.a(b2, this.m.k().d());
}
ji.i().h();
rp.i().h();
com.ironsource.mediationsdk.c.b().b(n(), o());
for (IronSource.AD_UNIT ad_unit : IronSource.AD_UNIT.values()) {
if (this.z.contains(ad_unit)) {
if (list.contains(ad_unit)) {
b(ad_unit);
} else {
a(ad_unit, false);
}
}
}
if (x() && W()) {
AdQualityBridge adQualityBridge = new AdQualityBridge(ContextProvider.getInstance().getApplicationContext(), n(), o(), new e1(), this.m.c().b().g().a());
this.o0 = adQualityBridge;
IronSourceSegment ironSourceSegment = this.C;
if (ironSourceSegment != null) {
adQualityBridge.setSegment(ironSourceSegment);
}
}
T();
wm r = r();
if (r != null) {
r.a(this.m);
}
return true;
} catch (Exception e2) {
i9.d().a(e2);
IronLog.INTERNAL.error(e2.toString());
wm r2 = r();
if (r2 != null) {
r2.onInitFailed(new IronSourceError(IronSourceError.ERROR_LEGACY_INIT_POST_FAILED, "onInitSuccess() had failed"));
}
return false;
}
}
private void b0() {
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in demand only mode", 0);
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.m.j().d().size(); i++) {
String str = this.m.j().d().get(i);
if (!TextUtils.isEmpty(str)) {
arrayList.add(this.m.k().b(str));
}
}
if (arrayList.isEmpty()) {
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
synchronized (this.g0) {
this.i0 = b(arrayList);
}
if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
Iterator<h.d> it = this.g0.values().iterator();
while (it.hasNext()) {
this.i0.a(it.next());
}
this.g0.clear();
}
private synchronized void c(boolean z) {
this.u = z;
}
private void c0() {
if (this.G) {
a0();
} else {
d0();
}
}
private void d(Activity activity, String str) {
try {
InterstitialPlacement m = m(str);
if (m == null) {
m = i();
}
if (m == null) {
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "showProgrammaticInterstitial error: empty default placement in response", 3);
gf.a().a(new IronSourceError(1020, "showProgrammaticInterstitial error: empty default placement in response"), (AdInfo) null);
return;
}
if (activity != null) {
e(activity);
} else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
this.h.log(IronSourceLogger.IronSourceTag.API, "Activity must be provided in showInterstitial when initializing SDK with context", 3);
gf.a().a(new IronSourceError(510, "Activity must be provided in showInterstitial when initializing SDK with context"), (AdInfo) null);
return;
}
this.S.a(activity, new Placement(m));
} catch (Exception e) {
i9.d().a(e);
this.h.logException(IronSourceLogger.IronSourceTag.API, "showProgrammaticInterstitial()", e);
}
}
private void d(Context context) {
AtomicBoolean atomicBoolean = this.k;
if (atomicBoolean == null || !atomicBoolean.compareAndSet(false, true)) {
return;
}
is.a().a(new yc(context));
ji.i().a(context, this.C);
rp.i().a(context, this.C);
zn.P.a(context, this.C);
}
private void d0() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> a2 = a(this.m.j().b());
if (a2.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
a(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.INTERSTITIAL, false);
return;
}
xh xhVar = new xh(a2, this.m.c().d(), IronSourceUtils.getUserIdForNetworks(), lj.b(), this.C);
this.S = xhVar;
Boolean bool = this.y;
if (bool != null) {
xhVar.a(this.x, bool.booleanValue());
}
if (this.b0) {
this.b0 = false;
this.S.A();
}
}
private void e(Activity activity) {
ContextProvider.getInstance().updateActivity(activity);
IronLog.INTERNAL.verbose("activity is updated to: " + activity.hashCode());
}
/* JADX WARN: Removed duplicated region for block: B:14:0x003d */
/* JADX WARN: Removed duplicated region for block: B:25:0x0076 */
/* JADX WARN: Removed duplicated region for block: B:27:0x007a */
/* JADX WARN: Removed duplicated region for block: B:29:0x0041 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private void e(android.app.Activity r7, java.lang.String r8) {
/*
r6 = this;
r0 = 3
r1 = 0
com.ironsource.mediationsdk.model.Placement r8 = r6.p(r8) // Catch: java.lang.Exception -> L29
if (r8 != 0) goto Lf
com.ironsource.mediationsdk.model.Placement r8 = r6.j() // Catch: java.lang.Exception -> Ld
goto Lf
Ld:
r2 = move-exception
goto L2b
Lf:
if (r8 != 0) goto L3b
java.lang.String r2 = "showProgrammaticRewardedVideo error: empty default placement in response"
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r3 = r6.h // Catch: java.lang.Exception -> Ld
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r4 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.INTERNAL // Catch: java.lang.Exception -> Ld
r3.log(r4, r2, r0) // Catch: java.lang.Exception -> Ld
com.ironsource.mediationsdk.logger.IronSourceError r3 = new com.ironsource.mediationsdk.logger.IronSourceError // Catch: java.lang.Exception -> Ld
r4 = 1021(0x3fd, float:1.431E-42)
r3.<init>(r4, r2) // Catch: java.lang.Exception -> Ld
com.ironsource.to r2 = com.ironsource.to.a() // Catch: java.lang.Exception -> Ld
r2.a(r3, r1) // Catch: java.lang.Exception -> Ld
return
L29:
r2 = move-exception
r8 = r1
L2b:
com.ironsource.i9 r3 = com.ironsource.i9.d()
r3.a(r2)
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r3 = r6.h
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r4 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API
java.lang.String r5 = "showProgrammaticRewardedVideo()"
r3.logException(r4, r5, r2)
L3b:
if (r7 == 0) goto L41
r6.e(r7)
goto L62
L41:
com.ironsource.environment.ContextProvider r2 = com.ironsource.environment.ContextProvider.getInstance()
android.app.Activity r2 = r2.getCurrentActiveActivity()
if (r2 != 0) goto L62
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r7 = r6.h
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r8 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API
java.lang.String r2 = "Activity must be provided in showRewardedVideo when initializing SDK with context"
r7.log(r8, r2, r0)
com.ironsource.to r7 = com.ironsource.to.a()
java.lang.String r8 = "Rewarded Video"
com.ironsource.mediationsdk.logger.IronSourceError r8 = com.ironsource.mediationsdk.utils.ErrorBuilder.buildInitFailedError(r2, r8)
r7.a(r8, r1)
return
L62:
com.ironsource.kp r2 = r6.T
if (r2 == 0) goto L72
boolean r3 = r6.Y
if (r3 != 0) goto L6e
boolean r3 = r6.a0
if (r3 == 0) goto L72
L6e:
r2.a(r7, r8)
goto L91
L72:
com.ironsource.se r2 = r6.Q
if (r2 == 0) goto L7a
r2.a(r7, r8)
goto L91
L7a:
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r7 = r6.h
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r8 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API
java.lang.String r2 = "showProgrammaticRewardedVideo - show called before init completed, managers not initiated yet"
r7.log(r8, r2, r0)
com.ironsource.mediationsdk.logger.IronSourceError r7 = new com.ironsource.mediationsdk.logger.IronSourceError
r8 = 1023(0x3ff, float:1.434E-42)
r7.<init>(r8, r2)
com.ironsource.to r8 = com.ironsource.to.a()
r8.a(r7, r1)
L91:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.e(android.app.Activity, java.lang.String):void");
}
private void e0() {
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in programmatic mode", 0);
List<NetworkSettings> a2 = a(this.m.j().d());
if (a2.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.d0);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
b(IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
q qVar = new q(a2, this.m.c().f(), n(), IronSourceUtils.getUserIdForNetworks(), lj.b().a(), this.C);
this.Q = qVar;
Boolean bool = this.y;
if (bool != null) {
qVar.a(this.x, bool.booleanValue());
}
}
private void f0() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> a2 = a(this.m.j().a());
if (a2.size() > 0) {
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in programmatic mode", 0);
this.R = new w(a2, new k(n(), IronSourceUtils.getUserIdForNetworks(), this.m.c().c()), lj.b().a(), this.C);
v();
} else {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
a(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.BANNER, false);
}
}
private void g0() {
if (this.F) {
b0();
return;
}
pp f = this.m.c().f();
this.a0 = f.k().h();
this.d0 = a(f);
if (this.Y || this.a0) {
h0();
} else {
e0();
}
}
private void h0() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> a2 = a(this.m.j().d());
if (a2.size() <= 0) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.d0);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
b(IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
return;
}
kp kpVar = new kp(a2, this.m.c().f(), IronSourceUtils.getUserIdForNetworks(), this.Y, lj.b(), this.C);
this.T = kpVar;
Boolean bool = this.y;
if (bool != null) {
kpVar.a(this.x, bool.booleanValue());
}
if (this.Z && this.Y) {
this.Z = false;
this.T.A();
}
}
private InterstitialPlacement i() {
hi d2 = this.m.c().d();
if (d2 != null) {
return d2.a();
}
return null;
}
private Placement j() {
pp f = this.m.c().f();
if (f != null) {
return f.a();
}
return null;
}
private b7 k(String str) {
b7 a2;
n6 c2 = this.m.c().c();
return c2 == null ? new wa() : (TextUtils.isEmpty(str) || (a2 = c2.a(str)) == null) ? c2.j() : a2;
}
private da k() {
return new da.b(rp.i(), new da.a("IronSource"));
}
/* JADX WARN: Removed duplicated region for block: B:11:0x0044 */
/* JADX WARN: Removed duplicated region for block: B:14:0x0047 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private com.ironsource.fo.b l(java.lang.String r5) {
/*
r4 = this;
com.ironsource.cr r0 = r4.m
if (r0 == 0) goto L4c
com.ironsource.m8 r0 = r0.c()
if (r0 == 0) goto L4c
com.ironsource.cr r0 = r4.m
com.ironsource.m8 r0 = r0.c()
com.ironsource.hi r0 = r0.d()
if (r0 != 0) goto L17
goto L4c
L17:
com.ironsource.mediationsdk.model.InterstitialPlacement r5 = r4.m(r5) // Catch: java.lang.Exception -> L30
if (r5 != 0) goto L42
com.ironsource.mediationsdk.model.InterstitialPlacement r5 = r4.i() // Catch: java.lang.Exception -> L2e
if (r5 != 0) goto L42
java.lang.String r0 = "Default placement was not found"
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r1 = r4.h // Catch: java.lang.Exception -> L2e
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r2 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API // Catch: java.lang.Exception -> L2e
r3 = 3
r1.log(r2, r0, r3) // Catch: java.lang.Exception -> L2e
goto L42
L2e:
r0 = move-exception
goto L32
L30:
r0 = move-exception
r5 = 0
L32:
com.ironsource.i9 r1 = com.ironsource.i9.d()
r1.a(r0)
com.ironsource.mediationsdk.logger.IronLog r1 = com.ironsource.mediationsdk.logger.IronLog.INTERNAL
java.lang.String r0 = r0.toString()
r1.error(r0)
L42:
if (r5 != 0) goto L47
com.ironsource.fo$b r5 = com.ironsource.fo.b.NOT_CAPPED
return r5
L47:
com.ironsource.fo$b r5 = r4.a(r5)
return r5
L4c:
com.ironsource.fo$b r5 = com.ironsource.fo.b.NOT_CAPPED
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.l(java.lang.String):com.ironsource.fo$b");
}
private InterstitialPlacement m(String str) {
hi d2 = this.m.c().d();
if (d2 != null) {
return d2.a(str);
}
return null;
}
public static p m() {
return d.a;
}
/* JADX WARN: Removed duplicated region for block: B:11:0x0044 */
/* JADX WARN: Removed duplicated region for block: B:14:0x0047 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private com.ironsource.fo.b o(java.lang.String r5) {
/*
r4 = this;
com.ironsource.cr r0 = r4.m
if (r0 == 0) goto L4c
com.ironsource.m8 r0 = r0.c()
if (r0 == 0) goto L4c
com.ironsource.cr r0 = r4.m
com.ironsource.m8 r0 = r0.c()
com.ironsource.pp r0 = r0.f()
if (r0 != 0) goto L17
goto L4c
L17:
com.ironsource.mediationsdk.model.Placement r5 = r4.p(r5) // Catch: java.lang.Exception -> L30
if (r5 != 0) goto L42
com.ironsource.mediationsdk.model.Placement r5 = r4.j() // Catch: java.lang.Exception -> L2e
if (r5 != 0) goto L42
java.lang.String r0 = "Default placement was not found"
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r1 = r4.h // Catch: java.lang.Exception -> L2e
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r2 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API // Catch: java.lang.Exception -> L2e
r3 = 3
r1.log(r2, r0, r3) // Catch: java.lang.Exception -> L2e
goto L42
L2e:
r0 = move-exception
goto L32
L30:
r0 = move-exception
r5 = 0
L32:
com.ironsource.i9 r1 = com.ironsource.i9.d()
r1.a(r0)
com.ironsource.mediationsdk.logger.IronLog r1 = com.ironsource.mediationsdk.logger.IronLog.INTERNAL
java.lang.String r0 = r0.toString()
r1.error(r0)
L42:
if (r5 != 0) goto L47
com.ironsource.fo$b r5 = com.ironsource.fo.b.NOT_CAPPED
return r5
L47:
com.ironsource.fo$b r5 = r4.a(r5)
return r5
L4c:
com.ironsource.fo$b r5 = com.ironsource.fo.b.NOT_CAPPED
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.o(java.lang.String):com.ironsource.fo$b");
}
private Placement p(String str) {
pp f = this.m.c().f();
if (f != null) {
return f.a(str);
}
return null;
}
private synchronized wm r() {
return this.W;
}
private boolean u(String str) {
if (str == null) {
return false;
}
return str.matches("^[a-zA-Z0-9]*$");
}
private l8 v(String str) {
IronSourceError ironSourceError;
String str2;
l8 l8Var = new l8();
if (str != null) {
if (a(str, 5, 10)) {
str2 = u(str) ? "length should be between 5-10 characters" : "should contain only english characters and numbers";
return l8Var;
}
ironSourceError = ErrorBuilder.buildInvalidCredentialsError("appKey", str, str2);
} else {
ironSourceError = new IronSourceError(IronSourceError.ERROR_CODE_INVALID_KEY_VALUE, "Init Fail - appKey is missing");
}
l8Var.a(ironSourceError);
return l8Var;
}
private void v() {
if (this.M.booleanValue()) {
IronLog.INTERNAL.verbose("load banner after init");
this.M = Boolean.FALSE;
a(this.N, this.O);
this.N = null;
this.O = null;
}
}
private void w() {
this.h = IronSourceLoggerManager.getLogger(0);
com.ironsource.mediationsdk.logger.b bVar = new com.ironsource.mediationsdk.logger.b(null, 1);
this.j = bVar;
this.h.addLogger(bVar);
this.i = new rk();
}
private boolean x() {
try {
IronLog.INTERNAL.verbose("AdQuality SDK exist: " + IronSourceAdQuality.class.getName());
return true;
} catch (Throwable th) {
i9.d().a(th);
IronLog.INTERNAL.verbose("No AdQuality SDK found");
return false;
}
}
private boolean y() {
cr crVar = this.m;
return (crVar == null || crVar.c() == null || this.m.c().c() == null) ? false : true;
}
private boolean z() {
return y() && A();
}
public boolean B() {
return this.F || this.G || this.H;
}
public boolean F() {
boolean z;
try {
if (this.G) {
this.h.log(IronSourceLogger.IronSourceTag.API, "Interstitial was initialized in demand only mode. Use isISDemandOnlyInterstitialReady instead", 3);
return false;
}
xh xhVar = this.S;
boolean z2 = xhVar != null && xhVar.u();
try {
ji.i().a(new kb(z2 ? IronSourceConstants.IS_CHECK_READY_TRUE : IronSourceConstants.IS_CHECK_READY_FALSE, IronSourceUtils.getMediationAdditionalData(false, true, 1)));
this.h.log(IronSourceLogger.IronSourceTag.API, "isInterstitialReady():" + z2, 1);
return z2;
} catch (Throwable th) {
z = z2;
th = th;
i9.d().a(th);
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "isInterstitialReady():" + z, 1);
this.h.logException(ironSourceTag, "isInterstitialReady()", th);
return false;
}
} catch (Throwable th2) {
th = th2;
z = false;
}
}
/* JADX WARN: Code restructure failed: missing block: B:36:0x0033, code lost:
if (r3.u() != false) goto L23;
*/
/* JADX WARN: Removed duplicated region for block: B:22:0x0056 */
/* JADX WARN: Removed duplicated region for block: B:27:0x0059 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public boolean K() {
/*
r9 = this;
java.lang.String r0 = "isRewardedVideoAvailable():"
r1 = 1
r2 = 0
boolean r3 = r9.F // Catch: java.lang.Throwable -> L13
if (r3 == 0) goto L17
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r3 = r9.h // Catch: java.lang.Throwable -> L13
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r4 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API // Catch: java.lang.Throwable -> L13
java.lang.String r5 = "Rewarded Video was initialized in demand only mode. Use isISDemandOnlyRewardedVideoAvailable instead"
r6 = 3
r3.log(r4, r5, r6) // Catch: java.lang.Throwable -> L13
return r2
L13:
r3 = move-exception
r4 = r2
goto L81
L17:
boolean r3 = r9.Y // Catch: java.lang.Throwable -> L13
if (r3 != 0) goto L2b
boolean r3 = r9.a0 // Catch: java.lang.Throwable -> L13
if (r3 == 0) goto L20
goto L2b
L20:
com.ironsource.se r3 = r9.Q // Catch: java.lang.Throwable -> L13
if (r3 == 0) goto L37
boolean r3 = r3.d() // Catch: java.lang.Throwable -> L13
if (r3 == 0) goto L37
goto L35
L2b:
com.ironsource.kp r3 = r9.T // Catch: java.lang.Throwable -> L13
if (r3 == 0) goto L37
boolean r3 = r3.u() // Catch: java.lang.Throwable -> L13
if (r3 == 0) goto L37
L35:
r3 = r1
goto L38
L37:
r3 = r2
L38:
org.json.JSONObject r4 = com.ironsource.mediationsdk.utils.IronSourceUtils.getMediationAdditionalData(r2) // Catch: java.lang.Throwable -> L7d
java.lang.Object[][] r5 = new java.lang.Object[r1][] // Catch: java.lang.Throwable -> L7d
r6 = 2
java.lang.Object[] r6 = new java.lang.Object[r6] // Catch: java.lang.Throwable -> L7d
java.lang.String r7 = "programmatic"
r6[r2] = r7 // Catch: java.lang.Throwable -> L7d
int r7 = r9.d0 // Catch: java.lang.Throwable -> L7d
java.lang.Integer r7 = java.lang.Integer.valueOf(r7) // Catch: java.lang.Throwable -> L7d
r6[r1] = r7 // Catch: java.lang.Throwable -> L7d
r5[r2] = r6 // Catch: java.lang.Throwable -> L7d
r9.a(r4, r5) // Catch: java.lang.Throwable -> L7d
com.ironsource.kb r5 = new com.ironsource.kb // Catch: java.lang.Throwable -> L7d
if (r3 == 0) goto L59
r6 = 1101(0x44d, float:1.543E-42)
goto L5b
L59:
r6 = 1102(0x44e, float:1.544E-42)
L5b:
r5.<init>(r6, r4) // Catch: java.lang.Throwable -> L7d
com.ironsource.rp r4 = com.ironsource.rp.i() // Catch: java.lang.Throwable -> L7d
r4.a(r5) // Catch: java.lang.Throwable -> L7d
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r4 = r9.h // Catch: java.lang.Throwable -> L7d
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r5 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API // Catch: java.lang.Throwable -> L7d
java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> L7d
r6.<init>() // Catch: java.lang.Throwable -> L7d
r6.append(r0) // Catch: java.lang.Throwable -> L7d
r6.append(r3) // Catch: java.lang.Throwable -> L7d
java.lang.String r6 = r6.toString() // Catch: java.lang.Throwable -> L7d
r4.log(r5, r6, r1) // Catch: java.lang.Throwable -> L7d
r2 = r3
goto La5
L7d:
r4 = move-exception
r8 = r4
r4 = r3
r3 = r8
L81:
com.ironsource.i9 r5 = com.ironsource.i9.d()
r5.a(r3)
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r5 = r9.h
com.ironsource.mediationsdk.logger.IronSourceLogger$IronSourceTag r6 = com.ironsource.mediationsdk.logger.IronSourceLogger.IronSourceTag.API
java.lang.StringBuilder r7 = new java.lang.StringBuilder
r7.<init>()
r7.append(r0)
r7.append(r4)
java.lang.String r0 = r7.toString()
r5.log(r6, r0, r1)
com.ironsource.mediationsdk.logger.IronSourceLoggerManager r0 = r9.h
java.lang.String r1 = "isRewardedVideoAvailable()"
r0.logException(r6, r1, r3)
La5:
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.K():boolean");
}
public boolean O() {
return C();
}
public void P() {
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "loadInterstitial()", 1);
try {
if (this.G) {
this.h.log(ironSourceTag, "Interstitial was initialized in demand only mode. Use loadISDemandOnlyInterstitial instead", 3);
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("Interstitial was initialized in demand only mode. Use loadISDemandOnlyInterstitial instead", "Interstitial"));
return;
}
if (!this.J) {
this.h.log(ironSourceTag, "init() must be called before loadInterstitial()", 3);
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() must be called before loadInterstitial()", "Interstitial"));
return;
}
s.d a2 = s.c().a();
if (a2 == s.d.INIT_FAILED) {
this.h.log(ironSourceTag, "init() had failed", 3);
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
return;
}
if (a2 == s.d.INIT_IN_PROGRESS) {
if (!s.c().d()) {
this.b0 = true;
return;
} else {
this.h.log(ironSourceTag, "init() had failed", 3);
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
return;
}
}
if (!E()) {
this.h.log(ironSourceTag, "No interstitial configurations found", 3);
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("the server response does not contain interstitial data", "Interstitial"));
return;
}
xh xhVar = this.S;
if (xhVar == null) {
this.b0 = true;
} else {
xhVar.A();
}
} catch (Throwable th) {
i9.d().a(th);
this.h.logException(IronSourceLogger.IronSourceTag.API, "loadInterstitial()", th);
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, new IronSourceError(510, th.getMessage()));
}
}
public void Q() {
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "loadRewardedVideo()", 1);
try {
if (this.F) {
this.h.log(ironSourceTag, "Rewarded Video was initialized in demand only mode. Use loadISDemandOnlyRewardedVideo instead", 3);
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("Rewarded Video was initialized in demand only mode. Use loadISDemandOnlyRewardedVideo instead", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
if (!this.Y && !this.n0) {
this.h.log(ironSourceTag, "Rewarded Video is not initiated with manual load", 3);
return;
}
if (!this.I) {
this.h.log(ironSourceTag, "init() must be called before loadRewardedVideo()", 3);
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() must be called before loadRewardedVideo()", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
s.d a2 = s.c().a();
if (a2 == s.d.INIT_FAILED) {
this.h.log(ironSourceTag, "init() had failed", 3);
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
if (a2 == s.d.INIT_IN_PROGRESS) {
if (!s.c().d()) {
this.Z = true;
return;
} else {
this.h.log(ironSourceTag, "init() had failed", 3);
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
}
if (!M()) {
this.h.log(ironSourceTag, "No rewarded video configurations found", 3);
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("the server response does not contain rewarded video data", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
kp kpVar = this.T;
if (kpVar == null) {
this.Z = true;
} else {
kpVar.A();
}
} catch (Throwable th) {
i9.d().a(th);
this.h.logException(IronSourceLogger.IronSourceTag.API, "loadRewardedVideo()", th);
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, new IronSourceError(510, th.getMessage()));
}
}
public void R() {
xh xhVar = this.S;
if (xhVar != null) {
xhVar.a((ts) null);
}
kp kpVar = this.T;
if (kpVar != null) {
kpVar.a((ts) null);
}
z5 z5Var = this.U;
if (z5Var != null) {
z5Var.a((ts) null);
}
this.n0 = false;
}
public void S() {
IronLog.API.info("removing all impression data listeners");
lj.b().d();
se seVar = this.Q;
if (seVar != null) {
seVar.c();
}
w wVar = this.R;
if (wVar != null) {
wVar.c();
}
}
public void U() {
if (t0) {
return;
}
t0 = true;
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
try {
mediationAdditionalData.put("status", "false");
mediationAdditionalData.put("errorCode", 1);
} catch (JSONException e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
rp.i().a(new kb(114, mediationAdditionalData));
}
public cr a(Context context, String str) {
if (ch.a(context)) {
x7 c2 = ch.c(context);
String d2 = c2.d();
String f = c2.f();
String e = c2.e();
if (d2.equals(str)) {
cr crVar = new cr(context, d2, f, e);
crVar.a(cr.a.CACHE);
return crVar;
}
}
return null;
}
public fo.b a(InterstitialPlacement interstitialPlacement) {
return this.e.a(ContextProvider.getInstance().getApplicationContext(), interstitialPlacement, IronSource.AD_UNIT.INTERSTITIAL);
}
public fo.b a(Placement placement) {
return this.e.a(ContextProvider.getInstance().getApplicationContext(), placement, IronSource.AD_UNIT.REWARDED_VIDEO);
}
@Override // com.ironsource.ca.a
public ISDemandOnlyBannerLayout a(Activity activity, ISBannerSize iSBannerSize) {
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "createBannerForDemandOnly()", 1);
if (activity == null) {
this.h.log(ironSourceTag, "createBannerForDemandOnly() : Activity cannot be null", 3);
return null;
}
ContextProvider.getInstance().updateActivity(activity);
return new ISDemandOnlyBannerLayout(activity, iSBannerSize);
}
public synchronized IronSourceError a(Context context, String str, boolean z, InitializationListener initializationListener, wm wmVar, IronSource.AD_UNIT... ad_unitArr) {
IronLog.INTERNAL.verbose("GitHash: 8b48d21");
com.ironsource.j.a.a(context);
if (!aj.a((Object) context, "Init Failed - provided context is null")) {
d("Provided context is null");
return new IronSourceError(2000, "Provided context is null");
}
this.g.a(context);
boolean z2 = context instanceof Activity;
if (z2) {
e((Activity) context);
}
if (initializationListener != null) {
this.V = initializationListener;
}
if (!z) {
this.p0.set(true);
}
AtomicBoolean atomicBoolean = this.t;
if (atomicBoolean == null || !atomicBoolean.compareAndSet(true, false)) {
if (ad_unitArr != null) {
a(z2, z, wmVar != null, ad_unitArr);
if (C() && !z) {
T();
}
} else {
this.h.log(IronSourceLogger.IronSourceTag.API, "Multiple calls to init without ad units are not allowed", 3);
}
qq b2 = rq.a.b();
if (C()) {
return new IronSourceError(IronSourceError.ERROR_INIT_ALREADY_FINISHED, "Already finished init");
}
if (b2 == qq.INIT_FAILED) {
return new IronSourceError(IronSourceError.ERROR_LEGACY_INIT_FAILED, "Legacy init failed");
}
if (b2 == qq.NOT_INIT) {
return new IronSourceError(2020, "Already called new init");
}
if (wmVar != null) {
a(wmVar);
}
return new IronSourceError(IronSourceError.ERROR_OLD_API_INIT_IN_PROGRESS, "Old Api init in progress");
}
rq.a.a(wmVar == null);
if ((ad_unitArr == null || ad_unitArr.length == 0) && wmVar == null) {
for (IronSource.AD_UNIT ad_unit : IronSource.AD_UNIT.values()) {
this.z.add(ad_unit);
}
this.I = true;
this.J = true;
this.K = true;
this.L = true;
} else {
for (IronSource.AD_UNIT ad_unit2 : ad_unitArr) {
this.z.add(ad_unit2);
this.A.add(ad_unit2);
if (ad_unit2.equals(IronSource.AD_UNIT.INTERSTITIAL)) {
this.J = true;
}
if (ad_unit2.equals(IronSource.AD_UNIT.BANNER)) {
this.K = true;
}
if (ad_unit2.equals(IronSource.AD_UNIT.NATIVE_AD)) {
this.L = true;
}
if (ad_unit2.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
this.I = true;
}
}
}
IronLog.API.info("init(appKey:" + str + ")");
l8 v = v(str);
if (v.b()) {
this.n = str;
}
cr a2 = a(context, this.n);
if (a2 != null) {
IronLog.INTERNAL.verbose("init cache exists");
a(a2.c().b().e());
} else {
IronLog.INTERNAL.verbose("init cache does not exist");
}
ContextProvider.getInstance().updateAppContext(context.getApplicationContext());
this.d.a(context.getApplicationContext(), TimeUnit.HOURS.toMillis(ja.a.d()));
this.l0.f(IronSourceUtils.getSDKVersion());
this.l0.a(te.a());
this.l0.b(IronSourceUtils.isGooglePlayInstalled(context));
this.l0.a(g1.a());
V();
d(context);
if (this.n == null) {
s.c().f();
if (this.z.contains(IronSource.AD_UNIT.REWARDED_VIDEO)) {
to.a().a(false, (AdInfo) null);
}
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, v.a().toString(), 1);
return new IronSourceError(IronSourceError.ERROR_OLD_INIT_API_APP_KEY_IS_NULL, "App key is null");
}
this.l0.a(context);
this.l0.b(this.n);
this.l0.h(this.w);
this.l0.g(ConfigFile.getConfigFile().getPluginType());
if (this.B) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z);
if (ad_unitArr != null) {
for (IronSource.AD_UNIT ad_unit3 : ad_unitArr) {
try {
mediationAdditionalData.put(ad_unit3.toString(), true);
} catch (Exception e) {
i9.d().a(e);
}
}
}
int i = this.E + 1;
this.E = i;
a(z2, z, i, mediationAdditionalData, wmVar != null);
this.B = false;
}
return null;
}
@Override // com.ironsource.ca
public String a(Context context) {
st j;
da k = k();
qq a2 = rq.a.a();
k.a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_CALLED_IN_INIT_STATUS, a2);
if (context == null) {
IronLog.API.error("bidding data cannot be retrieved, context required");
k.a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_CALLED_WITHOUT_CONTEXT, (qq) null);
return null;
}
if (a2 == qq.NOT_INIT) {
IronLog.API.error("bidding data cannot be retrieved, SDK not initialized");
return null;
}
s.c().g();
cr crVar = this.m;
boolean e = (crVar == null || (j = crVar.c().b().j()) == null) ? true : j.e();
JSONObject a3 = new rt().a(context);
com.ironsource.mediationsdk.d.b().a(a3, true);
String jSONObject = a3.toString();
String compressAndEncrypt = e ? IronSourceAES.compressAndEncrypt(jSONObject) : IronSourceAES.encrypt(jSONObject);
if (compressAndEncrypt == null) {
k.a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (qq) null);
}
return compressAndEncrypt;
}
public String a(String str, fo.b bVar) {
if (bVar == null) {
return null;
}
int i = b.c[bVar.ordinal()];
if (i != 1 && i != 2 && i != 3) {
return null;
}
return "placement " + str + " is capped";
}
public HashSet<String> a(String str, String str2) {
cr crVar = this.m;
return crVar == null ? new HashSet<>() : crVar.k().a(str, str2);
}
/* JADX WARN: Removed duplicated region for block: B:10:0x004a A[Catch: all -> 0x000d, TryCatch #0 {all -> 0x000d, blocks: (B:3:0x0001, B:5:0x0009, B:8:0x0046, B:10:0x004a, B:12:0x0054, B:14:0x0058, B:15:0x005c, B:17:0x0064, B:18:0x0067, B:20:0x006f, B:22:0x0073, B:23:0x0077, B:25:0x007f, B:26:0x0082, B:28:0x008a, B:30:0x008e, B:33:0x0092, B:35:0x009a, B:32:0x009d, B:41:0x00a2, B:43:0x00a6, B:44:0x00ac, B:50:0x0012, B:52:0x0016, B:53:0x0023, B:55:0x0027, B:56:0x0034, B:58:0x0038, B:59:0x003e, B:60:0x002d, B:61:0x001c), top: B:2:0x0001 }] */
/* JADX WARN: Removed duplicated region for block: B:41:0x00a2 A[Catch: all -> 0x000d, TryCatch #0 {all -> 0x000d, blocks: (B:3:0x0001, B:5:0x0009, B:8:0x0046, B:10:0x004a, B:12:0x0054, B:14:0x0058, B:15:0x005c, B:17:0x0064, B:18:0x0067, B:20:0x006f, B:22:0x0073, B:23:0x0077, B:25:0x007f, B:26:0x0082, B:28:0x008a, B:30:0x008e, B:33:0x0092, B:35:0x009a, B:32:0x009d, B:41:0x00a2, B:43:0x00a6, B:44:0x00ac, B:50:0x0012, B:52:0x0016, B:53:0x0023, B:55:0x0027, B:56:0x0034, B:58:0x0038, B:59:0x003e, B:60:0x002d, B:61:0x001c), top: B:2:0x0001 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public synchronized java.util.List<com.ironsource.mediationsdk.IronSource.AD_UNIT> a(android.content.Context r5, java.lang.String r6, boolean r7, com.ironsource.mediationsdk.IronSource.AD_UNIT... r8) {
/*
r4 = this;
monitor-enter(r4)
java.util.ArrayList r6 = new java.util.ArrayList // Catch: java.lang.Throwable -> Ld
r6.<init>() // Catch: java.lang.Throwable -> Ld
r0 = 1
if (r8 == 0) goto L10
int r1 = r8.length // Catch: java.lang.Throwable -> Ld
if (r1 != 0) goto L46
goto L10
Ld:
r5 = move-exception
goto Lb9
L10:
if (r7 == 0) goto L46
boolean r7 = r4.I // Catch: java.lang.Throwable -> Ld
if (r7 == 0) goto L1c
com.ironsource.mediationsdk.IronSource$AD_UNIT r7 = com.ironsource.mediationsdk.IronSource.AD_UNIT.REWARDED_VIDEO // Catch: java.lang.Throwable -> Ld
r4.a(r7) // Catch: java.lang.Throwable -> Ld
goto L23
L1c:
r4.F = r0 // Catch: java.lang.Throwable -> Ld
com.ironsource.mediationsdk.IronSource$AD_UNIT r7 = com.ironsource.mediationsdk.IronSource.AD_UNIT.REWARDED_VIDEO // Catch: java.lang.Throwable -> Ld
r6.add(r7) // Catch: java.lang.Throwable -> Ld
L23:
boolean r7 = r4.J // Catch: java.lang.Throwable -> Ld
if (r7 == 0) goto L2d
com.ironsource.mediationsdk.IronSource$AD_UNIT r7 = com.ironsource.mediationsdk.IronSource.AD_UNIT.INTERSTITIAL // Catch: java.lang.Throwable -> Ld
r4.a(r7) // Catch: java.lang.Throwable -> Ld
goto L34
L2d:
r4.G = r0 // Catch: java.lang.Throwable -> Ld
com.ironsource.mediationsdk.IronSource$AD_UNIT r7 = com.ironsource.mediationsdk.IronSource.AD_UNIT.INTERSTITIAL // Catch: java.lang.Throwable -> Ld
r6.add(r7) // Catch: java.lang.Throwable -> Ld
L34:
boolean r7 = r4.K // Catch: java.lang.Throwable -> Ld
if (r7 == 0) goto L3e
com.ironsource.mediationsdk.IronSource$AD_UNIT r7 = com.ironsource.mediationsdk.IronSource.AD_UNIT.BANNER // Catch: java.lang.Throwable -> Ld
r4.a(r7) // Catch: java.lang.Throwable -> Ld
goto La0
L3e:
r4.H = r0 // Catch: java.lang.Throwable -> Ld
com.ironsource.mediationsdk.IronSource$AD_UNIT r7 = com.ironsource.mediationsdk.IronSource.AD_UNIT.BANNER // Catch: java.lang.Throwable -> Ld
r6.add(r7) // Catch: java.lang.Throwable -> Ld
goto La0
L46:
int r7 = r8.length // Catch: java.lang.Throwable -> Ld
r1 = 0
L48:
if (r1 >= r7) goto La0
r2 = r8[r1] // Catch: java.lang.Throwable -> Ld
com.ironsource.mediationsdk.IronSource$AD_UNIT r3 = com.ironsource.mediationsdk.IronSource.AD_UNIT.INTERSTITIAL // Catch: java.lang.Throwable -> Ld
boolean r3 = r2.equals(r3) // Catch: java.lang.Throwable -> Ld
if (r3 == 0) goto L67
boolean r3 = r4.J // Catch: java.lang.Throwable -> Ld
if (r3 == 0) goto L5c
r4.a(r2) // Catch: java.lang.Throwable -> Ld
goto L67
L5c:
r4.G = r0 // Catch: java.lang.Throwable -> Ld
boolean r3 = r6.contains(r2) // Catch: java.lang.Throwable -> Ld
if (r3 != 0) goto L67
r6.add(r2) // Catch: java.lang.Throwable -> Ld
L67:
com.ironsource.mediationsdk.IronSource$AD_UNIT r3 = com.ironsource.mediationsdk.IronSource.AD_UNIT.REWARDED_VIDEO // Catch: java.lang.Throwable -> Ld
boolean r3 = r2.equals(r3) // Catch: java.lang.Throwable -> Ld
if (r3 == 0) goto L82
boolean r3 = r4.I // Catch: java.lang.Throwable -> Ld
if (r3 == 0) goto L77
r4.a(r2) // Catch: java.lang.Throwable -> Ld
goto L82
L77:
r4.F = r0 // Catch: java.lang.Throwable -> Ld
boolean r3 = r6.contains(r2) // Catch: java.lang.Throwable -> Ld
if (r3 != 0) goto L82
r6.add(r2) // Catch: java.lang.Throwable -> Ld
L82:
com.ironsource.mediationsdk.IronSource$AD_UNIT r3 = com.ironsource.mediationsdk.IronSource.AD_UNIT.BANNER // Catch: java.lang.Throwable -> Ld
boolean r3 = r2.equals(r3) // Catch: java.lang.Throwable -> Ld
if (r3 == 0) goto L9d
boolean r3 = r4.K // Catch: java.lang.Throwable -> Ld
if (r3 == 0) goto L92
r4.a(r2) // Catch: java.lang.Throwable -> Ld
goto L9d
L92:
r4.H = r0 // Catch: java.lang.Throwable -> Ld
boolean r3 = r6.contains(r2) // Catch: java.lang.Throwable -> Ld
if (r3 != 0) goto L9d
r6.add(r2) // Catch: java.lang.Throwable -> Ld
L9d:
int r1 = r1 + 1
goto L48
La0:
if (r5 == 0) goto Lb7
boolean r7 = r5 instanceof android.app.Activity // Catch: java.lang.Throwable -> Ld
if (r7 == 0) goto Lac
r7 = r5
android.app.Activity r7 = (android.app.Activity) r7 // Catch: java.lang.Throwable -> Ld
r4.e(r7) // Catch: java.lang.Throwable -> Ld
Lac:
com.ironsource.environment.ContextProvider r7 = com.ironsource.environment.ContextProvider.getInstance() // Catch: java.lang.Throwable -> Ld
android.content.Context r5 = r5.getApplicationContext() // Catch: java.lang.Throwable -> Ld
r7.updateAppContext(r5) // Catch: java.lang.Throwable -> Ld
Lb7:
monitor-exit(r4)
return r6
Lb9:
monitor-exit(r4)
throw r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.a(android.content.Context, java.lang.String, boolean, com.ironsource.mediationsdk.IronSource$AD_UNIT[]):java.util.List");
}
@Override // com.ironsource.en
public void a() {
if (this.M.booleanValue()) {
this.M = Boolean.FALSE;
n.a().b(IronSource.AD_UNIT.BANNER, new IronSourceError(IronSourceError.ERROR_BN_LOAD_WHILE_LONG_INITIATION, "init() had failed"));
this.N = null;
this.O = null;
}
if (this.b0) {
this.b0 = false;
n.a().b(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
}
if (this.Z) {
this.Z = false;
n.a().b(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
synchronized (this.e0) {
try {
Iterator<h.d> it = this.e0.values().iterator();
while (it.hasNext()) {
String c2 = it.next().c();
this.r0.a(c2).onInterstitialAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("init() had failed", "Interstitial"));
}
this.e0.clear();
} finally {
}
}
synchronized (this.g0) {
try {
Iterator<h.d> it2 = this.g0.values().iterator();
while (it2.hasNext()) {
String c3 = it2.next().c();
this.s0.a(c3).onRewardedVideoAdLoadFailed(c3, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
}
this.g0.clear();
} finally {
}
}
synchronized (this.f0) {
try {
for (h.b bVar : this.f0.values()) {
ISDemandOnlyBannerLayout g = bVar.g();
if (g != null) {
g.getListener().a(bVar.c(), ErrorBuilder.buildInitFailedError("init() had failed", "Banner"));
}
}
this.f0.clear();
} finally {
}
}
}
public void a(long j, cr.a aVar) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(B());
try {
mediationAdditionalData.put(IronSourceConstants.EVENTS_DURATION, j);
mediationAdditionalData.put("sessionDepth", this.E);
mediationAdditionalData.put(IronSourceConstants.EVENTS_EXT1, aVar.a());
} catch (Exception e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
rp.i().a(new kb(IronSourceConstants.INIT_COMPLETE, mediationAdditionalData));
}
public void a(Activity activity) {
try {
this.h.log(IronSourceLogger.IronSourceTag.API, "onPause()", 1);
ContextProvider.getInstance().onPause(activity);
} catch (Throwable th) {
i9.d().a(th);
this.h.logException(IronSourceLogger.IronSourceTag.API, "onPause()", th);
}
}
@Override // com.ironsource.ca.a
public synchronized void a(Activity activity, ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, String str) {
h.b a2 = new h.c().b(str).a(activity).a(iSDemandOnlyBannerLayout).a(IronSource.AD_UNIT.BANNER).a();
IronSourceError a3 = a2.a();
if (a3 != null) {
this.h.log(IronSourceLogger.IronSourceTag.API, a3.getErrorMessage(), 3);
if (iSDemandOnlyBannerLayout != null) {
iSDemandOnlyBannerLayout.getListener().a(str, a3);
}
return;
}
IronSourceError a4 = a(s.c().a());
if (a4 != null) {
this.h.log(IronSourceLogger.IronSourceTag.API, a4.getErrorMessage(), 3);
iSDemandOnlyBannerLayout.getListener().a(str, a4);
return;
}
ContextProvider.getInstance().updateActivity(activity);
if (a(a2)) {
return;
}
if (!z()) {
this.h.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
iSDemandOnlyBannerLayout.getListener().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain banner data", "Banner"));
} else {
if (b(a2)) {
return;
}
this.j0.a(iSDemandOnlyBannerLayout, str);
}
}
@Override // com.ironsource.ca.a
public synchronized void a(Activity activity, ISDemandOnlyBannerLayout iSDemandOnlyBannerLayout, String str, String str2) {
h.b a2 = new h.c().b(str).a(activity).a(true).a(str2).a(iSDemandOnlyBannerLayout).a(IronSource.AD_UNIT.BANNER).a();
IronSourceError a3 = a2.a();
if (a3 != null) {
this.h.log(IronSourceLogger.IronSourceTag.API, a3.getErrorMessage(), 3);
if (iSDemandOnlyBannerLayout != null) {
iSDemandOnlyBannerLayout.getListener().a(str, a3);
}
return;
}
IronSourceError a4 = a(s.c().a());
if (a4 != null) {
this.h.log(IronSourceLogger.IronSourceTag.API, a4.getErrorMessage(), 3);
iSDemandOnlyBannerLayout.getListener().a(str, a4);
return;
}
ContextProvider.getInstance().updateActivity(activity);
if (a(a2)) {
return;
}
if (!z()) {
this.h.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
iSDemandOnlyBannerLayout.getListener().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain banner data", "Banner"));
} else {
if (b(a2)) {
return;
}
this.j0.a(iSDemandOnlyBannerLayout, str, str2);
}
}
@Override // com.ironsource.ca.b
public synchronized void a(Activity activity, String str) {
a(new h.c().b(str).a(activity, ContextProvider.getInstance().getCurrentActiveActivity()).a(IronSource.AD_UNIT.INTERSTITIAL).b(), this.r0.a(str));
}
@Override // com.ironsource.ca.c
public synchronized void a(Activity activity, String str, String str2) {
a(new h.c().b(str).a(str2).a(activity, ContextProvider.getInstance().getCurrentActiveActivity()).a(true).a(IronSource.AD_UNIT.REWARDED_VIDEO).b(), this.s0.a(str));
}
public synchronized void a(Context context, String str, boolean z, InitializationListener initializationListener, IronSource.AD_UNIT... ad_unitArr) {
if (a(context, str, z, initializationListener, null, ad_unitArr) == null) {
s.c().a(this);
s.c().a(this.k0);
s.c().a(context, str, this.o, ad_unitArr);
}
}
@Override // com.ironsource.ca
public synchronized void a(Context context, String str, IronSource.AD_UNIT... ad_unitArr) {
List<IronSource.AD_UNIT> a2 = a(context, str, true, ad_unitArr);
if (!a2.isEmpty()) {
a(context, str, true, (InitializationListener) null, (IronSource.AD_UNIT[]) a2.toArray(new IronSource.AD_UNIT[a2.size()]));
}
}
@Override // com.ironsource.ui
public void a(Context context, boolean z) {
this.x = context;
this.y = Boolean.valueOf(z);
xh xhVar = this.S;
if (xhVar != null) {
xhVar.a(context, z);
}
if (this.a0) {
kp kpVar = this.T;
if (kpVar != null) {
kpVar.a(context, z);
return;
}
return;
}
se seVar = this.Q;
if (seVar != null) {
seVar.a(context, z);
}
}
public void a(IronSource.AD_UNIT ad_unit, WaterfallConfiguration waterfallConfiguration) {
if (ad_unit == null) {
IronLog.API.error("AdUnit should not be null.");
return;
}
IronLog ironLog = IronLog.API;
Object[] objArr = new Object[2];
objArr[0] = ad_unit.name();
objArr[1] = waterfallConfiguration == null ? "NULL" : waterfallConfiguration.toString();
ironLog.info(String.format("(%s, %s)", objArr));
kb kbVar = new kb(53, IronSourceUtils.getMediationAdditionalData(false));
kbVar.a(IronSourceConstants.EVENTS_EXT1, waterfallConfiguration == null ? "" : waterfallConfiguration.toJsonString());
rp.i().a(kbVar, ad_unit);
this.l0.a(ad_unit, waterfallConfiguration);
}
public void a(IronSource.AD_UNIT ad_unit, ts tsVar) {
z5 z5Var;
kp kpVar;
xh xhVar;
if (this.n0) {
if (ad_unit == IronSource.AD_UNIT.INTERSTITIAL && (xhVar = this.S) != null) {
xhVar.a(tsVar);
}
if (ad_unit == IronSource.AD_UNIT.REWARDED_VIDEO && (kpVar = this.T) != null) {
kpVar.a(tsVar);
}
if (ad_unit != IronSource.AD_UNIT.BANNER || (z5Var = this.U) == null) {
return;
}
z5Var.a(tsVar);
}
}
public void a(IronSourceBannerLayout ironSourceBannerLayout) {
z5 z5Var;
this.h.log(IronSourceLogger.IronSourceTag.API, "destroyBanner()", 1);
try {
if (!this.c0 || (z5Var = this.U) == null) {
w wVar = this.R;
if (wVar != null) {
wVar.a(ironSourceBannerLayout);
}
} else {
z5Var.a(ironSourceBannerLayout);
}
} catch (Throwable th) {
i9.d().a(th);
this.h.logException(IronSourceLogger.IronSourceTag.API, "destroyBanner()", th);
}
}
public void a(IronSourceBannerLayout ironSourceBannerLayout, String str) {
IronLog.INTERNAL.verbose("placementName = " + str);
if (this.H) {
this.h.log(IronSourceLogger.IronSourceTag.API, "Banner was initialized in demand only mode. Use loadISDemandOnlyBanner instead", 3);
n.a().b(IronSource.AD_UNIT.BANNER, ErrorBuilder.buildInitFailedError("Banner was initialized in demand only mode. Use loadISDemandOnlyBanner instead", "Banner"));
return;
}
if (ironSourceBannerLayout == null || ironSourceBannerLayout.isDestroyed()) {
StringBuilder sb = new StringBuilder();
sb.append("loadBanner can't be called - ");
sb.append(ironSourceBannerLayout == null ? "banner layout is null " : "banner layout is destroyed");
String sb2 = sb.toString();
this.h.log(IronSourceLogger.IronSourceTag.API, sb2, 3);
n.a().b(IronSource.AD_UNIT.BANNER, ErrorBuilder.buildLoadFailedError(sb2));
return;
}
if (!this.K) {
this.h.log(IronSourceLogger.IronSourceTag.API, "init() must be called before loadBanner()", 3);
n.a().b(IronSource.AD_UNIT.BANNER, ErrorBuilder.buildLoadFailedError("init() must be called before loadBanner()"));
return;
}
if (ironSourceBannerLayout.getSize().getDescription().equals(l.f) && (ironSourceBannerLayout.getSize().getWidth() <= 0 || ironSourceBannerLayout.getSize().getHeight() <= 0)) {
this.h.log(IronSourceLogger.IronSourceTag.API, "loadBanner: Unsupported banner size. Height and width must be bigger than 0", 3);
n.a().b(IronSource.AD_UNIT.BANNER, ErrorBuilder.unsupportedBannerSize(""));
return;
}
s.d a2 = s.c().a();
if (a2 == s.d.INIT_FAILED) {
this.h.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
n.a().b(IronSource.AD_UNIT.BANNER, new IronSourceError(600, "Init() had failed"));
return;
}
if (a2 == s.d.INIT_IN_PROGRESS) {
if (s.c().d()) {
this.h.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
n.a().b(IronSource.AD_UNIT.BANNER, new IronSourceError(IronSourceError.ERROR_BN_LOAD_AFTER_LONG_INITIATION, "Init() had failed"));
return;
} else {
this.N = ironSourceBannerLayout;
this.M = Boolean.TRUE;
this.O = str;
return;
}
}
if (!z()) {
this.h.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
n.a().b(IronSource.AD_UNIT.BANNER, new IronSourceError(IronSourceError.ERROR_BN_LOAD_NO_CONFIG, "the server response does not contain banner data"));
return;
}
w wVar = this.R;
if (wVar == null && this.U == null) {
this.N = ironSourceBannerLayout;
this.M = Boolean.TRUE;
this.O = str;
} else if (this.c0) {
this.U.a(ironSourceBannerLayout, new Placement(k(str)));
} else {
wVar.a(ironSourceBannerLayout, k(str));
}
}
public void a(IronSourceSegment ironSourceSegment) {
this.C = ironSourceSegment;
kp kpVar = this.T;
if (kpVar != null) {
kpVar.a(ironSourceSegment);
}
se seVar = this.Q;
if (seVar != null) {
seVar.a(ironSourceSegment);
}
xh xhVar = this.S;
if (xhVar != null) {
xhVar.a(ironSourceSegment);
}
w wVar = this.R;
if (wVar != null) {
wVar.a(ironSourceSegment);
}
z5 z5Var = this.U;
if (z5Var != null) {
z5Var.a(ironSourceSegment);
}
AdQualityBridge adQualityBridge = this.o0;
if (adQualityBridge != null) {
adQualityBridge.setSegment(ironSourceSegment);
}
ji.i().a(this.C);
rp.i().a(this.C);
zn.P.a(this.C);
}
@Override // com.ironsource.ca.b
public void a(ISDemandOnlyInterstitialListener iSDemandOnlyInterstitialListener) {
this.r0.a((af<ISDemandOnlyInterstitialListener>) iSDemandOnlyInterstitialListener);
}
@Override // com.ironsource.ca.c
public void a(ISDemandOnlyRewardedVideoListener iSDemandOnlyRewardedVideoListener) {
this.s0.a((af<ISDemandOnlyRewardedVideoListener>) iSDemandOnlyRewardedVideoListener);
}
public void a(h.d dVar, ISDemandOnlyRewardedVideoListener iSDemandOnlyRewardedVideoListener) {
String c2 = dVar.c();
IronLog ironLog = IronLog.API;
ironLog.info("instanceId=" + c2);
try {
} catch (Throwable th) {
i9.d().a(th);
IronLog.API.error(th.getMessage());
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, new IronSourceError(510, th.getMessage()));
}
if (!this.I) {
ironLog.error("initISDemandOnly() must be called before loadDemandOnlyRewardedVideo()");
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, new IronSourceError(510, "initISDemandOnly() must be called before loadDemandOnlyRewardedVideo()"));
return;
}
if (!this.F) {
ironLog.error("Rewarded video was initialized in mediation mode");
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, new IronSourceError(510, "Rewarded video was initialized in mediation mode"));
return;
}
s.d a2 = s.c().a();
if (a2 == s.d.INIT_FAILED) {
ironLog.error("init() had failed");
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
IronSourceError a3 = dVar.a();
if (a3 != null) {
if (a3.getErrorCode() == 1060) {
b(81321, IronSourceUtils.getMediationAdditionalData(true, !TextUtils.isEmpty(dVar.b()), 1));
}
ironLog.error(a3.toString());
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, a3);
return;
}
e(dVar.e());
if (a2 == s.d.INIT_IN_PROGRESS) {
if (s.c().d()) {
ironLog.error("init() had failed");
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
synchronized (this.g0) {
this.g0.put(c2, dVar);
}
if (TextUtils.isEmpty(dVar.b())) {
return;
}
b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, !TextUtils.isEmpty(dVar.b()), 1));
return;
}
if (!M()) {
ironLog.error("No rewarded video configurations found");
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, ErrorBuilder.buildInitFailedError("the server response does not contain rewarded video data", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
return;
}
synchronized (this.g0) {
try {
com.ironsource.mediationsdk.demandOnly.k kVar = this.i0;
if (kVar != null) {
kVar.a(dVar);
return;
}
this.g0.put(c2, dVar);
if (!TextUtils.isEmpty(dVar.b())) {
b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, !TextUtils.isEmpty(dVar.b()), 1));
}
return;
} finally {
}
}
i9.d().a(th);
IronLog.API.error(th.getMessage());
iSDemandOnlyRewardedVideoListener.onRewardedVideoAdLoadFailed(c2, new IronSourceError(510, th.getMessage()));
}
@Override // com.ironsource.tg
public void a(ImpressionDataListener impressionDataListener) {
if (aj.a((Object) impressionDataListener, "removeImpressionDataListener - listener is null")) {
lj.b().b(impressionDataListener);
se seVar = this.Q;
if (seVar != null) {
seVar.a(impressionDataListener);
}
w wVar = this.R;
if (wVar != null) {
wVar.a(impressionDataListener);
}
IronLog.API.info("remove impression data listener from " + impressionDataListener.getClass().getSimpleName());
}
}
@Override // com.ironsource.al
public void a(LogListener logListener) {
if (logListener == null) {
this.h.log(IronSourceLogger.IronSourceTag.API, "setLogListener(LogListener:null)", 1);
return;
}
this.j.a(logListener);
this.h.log(IronSourceLogger.IronSourceTag.API, "setLogListener(LogListener:" + logListener.getClass().getSimpleName() + ")", 1);
}
public void a(LevelPlayInterstitialListener levelPlayInterstitialListener) {
IronLog.API.info();
gf.a().a(levelPlayInterstitialListener);
}
public void a(LevelPlayRewardedVideoListener levelPlayRewardedVideoListener) {
IronLog.API.info();
to.a().a(levelPlayRewardedVideoListener);
}
public synchronized void a(LevelPlayRewardedVideoManualListener levelPlayRewardedVideoManualListener) {
String str;
try {
IronLog ironLog = IronLog.API;
ironLog.info();
if (!this.I) {
if (levelPlayRewardedVideoManualListener == null) {
this.Y = false;
str = "Disabling rewarded video manual mode";
} else {
this.Y = true;
str = "Enabling rewarded video manual mode";
}
ironLog.info(str);
}
to.a().a(levelPlayRewardedVideoManualListener);
} catch (Throwable th) {
throw th;
}
}
public void a(SegmentListener segmentListener) {
rk rkVar = this.i;
if (rkVar != null) {
rkVar.a(segmentListener);
s.c().a(this.i);
}
}
@Override // com.ironsource.ca.c
public synchronized void a(String str) {
IronLog ironLog = IronLog.API;
ironLog.info("instanceId=" + str);
ISDemandOnlyRewardedVideoListener a2 = this.s0.a(str);
try {
} catch (Exception e) {
i9.d().a(e);
IronLog.API.error(e.getMessage());
if (a2 != null) {
a2.onRewardedVideoAdShowFailed(str, new IronSourceError(510, e.getMessage()));
}
}
if (!this.F) {
ironLog.error("Rewarded video was initialized in mediation mode. Use showRewardedVideo instead");
a2.onRewardedVideoAdShowFailed(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "Rewarded video was initialized in mediation mode. Use showRewardedVideo instead"));
return;
}
com.ironsource.mediationsdk.demandOnly.k kVar = this.i0;
if (kVar != null) {
kVar.b(str);
} else {
ironLog.error("Rewarded video was not initiated");
a2.onRewardedVideoAdShowFailed(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "Rewarded video was not initiated"));
}
}
public 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)) {
com.ironsource.mediationsdk.c.b().a(metaDataKey, metaDataValue);
} else if (C() && MetaDataUtils.isMediationKeysBeforeInit(metaDataKey)) {
ironLog.error("setMetaData with key = " + metaDataKey + " must to be called before init");
} else {
lj.b().a(metaDataKey, metaDataValue);
}
try {
ConcurrentHashMap<String, List<String>> c2 = com.ironsource.mediationsdk.c.b().c();
c2.putAll(lj.b().c());
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, List<String>> entry : c2.entrySet()) {
jSONObject.put(entry.getKey(), entry.getValue());
}
this.m0.a(jSONObject);
this.l0.a(jSONObject);
} catch (JSONException e) {
i9.d().a(e);
IronLog.INTERNAL.error("got the following error " + e.getMessage());
}
rp.i().a(new kb(C() ? 51 : 50, IronSourceUtils.getJsonForMetaData(str, list, metaDataValue)));
}
public void a(String str, JSONObject jSONObject) {
if (aj.a((Object) jSONObject, "setAdRevenueData - impressionData is null") && aj.a((Object) str, "setAdRevenueData - dataSource is null")) {
this.k0.a(str, jSONObject);
}
}
@Override // com.ironsource.en
public void a(List<IronSource.AD_UNIT> list, boolean z, m8 m8Var) {
b(list, z, m8Var);
}
@Override // com.ironsource.ui
public void a(Map<String, String> map) {
if (map != null) {
try {
if (map.size() == 0) {
return;
}
this.h.log(IronSourceLogger.IronSourceTag.API, this.a + ":setRewardedVideoServerParameters(params:" + map.toString() + ")", 1);
this.r = new HashMap(map);
} catch (Exception e) {
i9.d().a(e);
this.h.logException(IronSourceLogger.IronSourceTag.API, this.a + ":setRewardedVideoServerParameters(params:" + map.toString() + ")", e);
}
}
}
@Override // com.ironsource.ui
public void a(boolean z) {
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, "setAdaptersDebug : " + z, 1);
com.ironsource.mediationsdk.c.b().a(z);
}
public boolean a(b7 b7Var) {
return this.e.b(ContextProvider.getInstance().getApplicationContext(), b7Var, IronSource.AD_UNIT.BANNER);
}
public boolean a(boolean z, cr crVar) {
if (C()) {
return true;
}
synchronized (this.l) {
this.m = crVar;
}
return b(crVar.g(), z, crVar.c());
}
public cr b(Context context, String str, c cVar) {
synchronized (this.l) {
try {
cr crVar = this.m;
if (crVar != null) {
return new cr(crVar);
}
cr a2 = a(context, str, cVar);
if (a2 == null || !a2.p()) {
IronSourceLoggerManager logger = IronSourceLoggerManager.getLogger();
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
logger.log(ironSourceTag, "Null or invalid response. Trying to get cached response", 0);
a2 = a(context, n());
if (a2 != null) {
IronSourceError buildUsingCachedConfigurationError = ErrorBuilder.buildUsingCachedConfigurationError(n(), str);
this.h.log(ironSourceTag, buildUsingCachedConfigurationError.toString() + ": " + a2.toString(), 1);
rp.i().a(new kb(IronSourceConstants.USING_CACHE_FOR_INIT_EVENT, IronSourceUtils.getMediationAdditionalData(false)));
}
}
if (a2 != null) {
this.m = a2;
IronSourceUtils.saveLastResponse(context, a2.toString());
b(this.m, context);
ji.i().c(true);
rp.i().c(true);
zn.P.c(true);
}
return a2;
} catch (Throwable th) {
throw th;
}
}
}
public IronSourceBannerLayout b(Activity activity, ISBannerSize iSBannerSize) {
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "createBanner()", 1);
if (activity == null) {
this.h.log(ironSourceTag, "createBanner() : Activity cannot be null", 3);
return null;
}
ContextProvider.getInstance().updateActivity(activity);
return new IronSourceBannerLayout(activity, iSBannerSize);
}
@Override // com.ironsource.ui
public String b(Context context) {
String p = this.c.p(context);
return !TextUtils.isEmpty(p) ? p : "";
}
@Override // com.ironsource.ui
public void b() {
this.r = null;
}
public void b(Activity activity) {
try {
this.h.log(IronSourceLogger.IronSourceTag.API, "onResume()", 1);
ContextProvider.getInstance().onResume(activity);
} catch (Throwable th) {
i9.d().a(th);
this.h.logException(IronSourceLogger.IronSourceTag.API, "onResume()", th);
}
}
@Override // com.ironsource.ca.c
public synchronized void b(Activity activity, String str) {
a(new h.c().b(str).a(activity, ContextProvider.getInstance().getCurrentActiveActivity()).a(IronSource.AD_UNIT.REWARDED_VIDEO).b(), this.s0.a(str));
}
@Override // com.ironsource.ca.b
public synchronized void b(Activity activity, String str, String str2) {
a(new h.c().b(str).a(activity, ContextProvider.getInstance().getCurrentActiveActivity()).a(IronSource.AD_UNIT.INTERSTITIAL).a(true).a(str2).b(), this.r0.a(str));
}
public void b(cr crVar, Context context) {
a(crVar);
a(crVar, context);
}
public void b(IronSourceBannerLayout ironSourceBannerLayout) {
a(ironSourceBannerLayout, "");
}
@Override // com.ironsource.tg
public void b(ImpressionDataListener impressionDataListener) {
if (aj.a((Object) impressionDataListener, "addImpressionDataListener - listener is null")) {
lj.b().a(impressionDataListener);
se seVar = this.Q;
if (seVar != null) {
seVar.b(impressionDataListener);
}
w wVar = this.R;
if (wVar != null) {
wVar.b(impressionDataListener);
}
IronLog.API.info("add impression data listener to " + impressionDataListener.getClass().getSimpleName());
}
}
@Override // com.ironsource.ca.b
public void b(String str) {
this.h.log(IronSourceLogger.IronSourceTag.API, "showDemandOnlyInterstitial() instanceId=" + str, 1);
ISDemandOnlyInterstitialListener a2 = this.r0.a(str);
try {
if (!this.G) {
IronLog.API.error("Interstitial was initialized in mediation mode. Use showInterstitial instead");
a2.onInterstitialAdShowFailed(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "Interstitial was initialized in mediation mode. Use showInterstitial instead"));
return;
}
com.ironsource.mediationsdk.demandOnly.f fVar = this.h0;
if (fVar != null) {
fVar.a(str);
} else {
IronLog.API.error("Interstitial was not initiated");
a2.onInterstitialAdShowFailed(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "Interstitial was not initiated"));
}
} catch (Exception e) {
i9.d().a(e);
IronLog.API.error(e.getMessage());
if (a2 != null) {
a2.onInterstitialAdShowFailed(str, ErrorBuilder.buildInitFailedError("showISDemandOnlyInterstitial can't be called before the Interstitial ad unit initialization completed successfully", "Interstitial"));
}
}
}
public void b(String str, JSONObject jSONObject) {
v vVar = new v(str, jSONObject);
IronLog.API.verbose(vVar.toString());
com.ironsource.mediationsdk.c.b().a(vVar);
}
public void b(boolean z) {
this.P = Boolean.valueOf(z);
IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, "setConsent : " + z, 1);
com.ironsource.mediationsdk.c.b().b(z);
this.l0.a(z);
rp.i().a(new kb(z ? 40 : 41, IronSourceUtils.getMediationAdditionalData(false)));
}
@Override // com.ironsource.ui
public void c() {
this.h.log(IronSourceLogger.IronSourceTag.API, "removeRewardedVideoListener()", 1);
to.a().a((LevelPlayRewardedVideoBaseListener) null);
}
public void c(Activity activity) {
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, "showInterstitial()", 1);
try {
if (this.G) {
this.h.log(ironSourceTag, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead", 3);
gf.a().a(new IronSourceError(510, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead"), (AdInfo) null);
} else {
if (!D()) {
gf.a().a(ErrorBuilder.buildInitFailedError("showInterstitial can't be called before the Interstitial ad unit initialization completed successfully", "Interstitial"), (AdInfo) null);
return;
}
InterstitialPlacement i = i();
if (i != null) {
c(activity, i.getPlacementName());
} else {
gf.a().a(new IronSourceError(1020, "showInterstitial error: empty default placement in response"), (AdInfo) null);
}
}
} catch (Exception e) {
i9.d().a(e);
this.h.logException(IronSourceLogger.IronSourceTag.API, "showInterstitial()", e);
gf.a().a(new IronSourceError(510, e.getMessage()), (AdInfo) null);
}
}
public void c(Activity activity, String str) {
String str2 = "showInterstitial(" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
try {
if (this.G) {
this.h.log(ironSourceTag, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead", 3);
gf.a().a(new IronSourceError(510, "Interstitial was initialized in demand only mode. Use showISDemandOnlyInterstitial instead"), (AdInfo) null);
} else if (D()) {
d(activity, str);
} else {
gf.a().a(ErrorBuilder.buildInitFailedError("showInterstitial can't be called before the Interstitial ad unit initialization completed successfully", "Interstitial"), (AdInfo) null);
}
} catch (Exception e) {
i9.d().a(e);
this.h.logException(IronSourceLogger.IronSourceTag.API, str2, e);
gf.a().a(new IronSourceError(510, e.getMessage()), (AdInfo) null);
}
}
public void c(Context context) {
os osVar = os.a;
osVar.b();
if (!C()) {
osVar.a(IronSourceConstants.errorCode_TEST_SUITE_SDK_NOT_INITIALIZED);
IronLog.API.error("TestSuite cannot be launched, SDK not initialized");
return;
}
if (!b(this.m)) {
osVar.a(IronSourceConstants.errorCode_TEST_SUITE_DISABLED);
IronLog.API.error("TestSuite cannot be launched, Please contact your account manager to enable it");
return;
}
if (!IronSourceUtils.isNetworkConnected(context)) {
osVar.a(IronSourceConstants.errorCode_TEST_SUITE_NO_NETWORK_CONNECTIVITY);
IronLog.API.error("TestSuite cannot be launched, No network connectivity");
return;
}
xh xhVar = this.S;
if (xhVar != null) {
xhVar.J();
}
kp kpVar = this.T;
if (kpVar != null) {
kpVar.J();
}
z5 z5Var = this.U;
if (z5Var != null) {
z5Var.J();
this.U.T();
}
new ps().a(context, n(), this.m.i(), IronSourceUtils.getSDKVersion(), this.m.c().g().b(), g(), this.Y);
this.n0 = true;
osVar.c();
}
@Override // com.ironsource.ca.a
public void c(String str) {
this.h.log(IronSourceLogger.IronSourceTag.API, "destroyBanner()", 1);
try {
com.ironsource.mediationsdk.demandOnly.c cVar = this.j0;
if (cVar != null) {
cVar.a(str);
}
} catch (Throwable th) {
i9.d().a(th);
this.h.logException(IronSourceLogger.IronSourceTag.API, "destroyISDemandOnlyBanner()", th);
}
}
@Override // com.ironsource.ui
public void d() {
this.h.log(IronSourceLogger.IronSourceTag.API, "removeInterstitialListener()", 1);
gf.a().a((LevelPlayInterstitialListener) null);
}
public void d(Activity activity) {
if (!L()) {
to.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);
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "showRewardedVideo can't be called before the Rewarded Video ad unit initialization completed successfully", 3);
return;
}
Placement j = j();
if (j != null) {
f(activity, j.getPlacementName());
return;
}
this.h.log(IronSourceLogger.IronSourceTag.INTERNAL, "showRewardedVideo error: empty default placement in response", 3);
to.a().a(new IronSourceError(1021, "showRewardedVideo error: empty default placement in response"), (AdInfo) null);
}
@Override // com.ironsource.en
public void d(String str) {
try {
this.h.log(IronSourceLogger.IronSourceTag.API, "onInitFailed(reason:" + str + ")", 1);
IronSourceUtils.sendAutomationLog("Mediation init failed");
if (this.i != null) {
Iterator<IronSource.AD_UNIT> it = this.z.iterator();
while (it.hasNext()) {
a(it.next(), true);
}
}
wm r = r();
if (r != null) {
r.onInitFailed(new IronSourceError(IronSourceError.ERROR_LEGACY_INIT_FAILED, "Legacy init failed"));
}
} catch (Exception e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
}
public String e() {
String str;
if (this.L) {
s c2 = s.c();
int i = b.b[c2.a().ordinal()];
if (i != 1) {
if (i != 2) {
str = "";
} else if (!c2.d()) {
str = "init() not finished yet";
}
}
str = "init() had failed";
} else {
str = "init() must be called first";
}
return (I() || !str.isEmpty()) ? str : "No Native Ad configurations found";
}
@Override // com.ironsource.ui
public boolean e(String str) {
try {
String str2 = this.a + ":setDynamicUserId(dynamicUserId:" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
l8 l8Var = new l8();
a(str, l8Var);
if (!l8Var.b()) {
IronSourceLoggerManager.getLogger().log(ironSourceTag, l8Var.a().toString(), 2);
return false;
}
this.q = str;
rp.i().a(new kb(52, IronSourceUtils.getJsonForUserId(true)));
return true;
} catch (Exception e) {
i9.d().a(e);
this.h.logException(IronSourceLogger.IronSourceTag.API, this.a + ":setDynamicUserId(dynamicUserId:" + str + ")", e);
return false;
}
}
public sl f() {
IronLog.INTERNAL.verbose();
List<NetworkSettings> a2 = a(this.m.j().c());
if (a2.size() > 0) {
return new sl(a2, this.m.c().e(), IronSourceUtils.getUserIdForNetworks(), lj.b(), this.C);
}
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
a(mediationAdditionalData, new Object[][]{new Object[]{"errorCode", 1010}});
a(IronSourceConstants.TROUBLESHOOTING_NT_INIT_FAILED, mediationAdditionalData);
return null;
}
public void f(Activity activity, String str) {
String str2 = "showRewardedVideo(" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
try {
if (this.F) {
this.h.log(ironSourceTag, "Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", 3);
to.a().a(ErrorBuilder.buildInitFailedError("Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", IronSourceConstants.REWARDED_VIDEO_AD_UNIT), (AdInfo) null);
} else if (L()) {
e(activity, str);
} else {
to.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 e) {
i9.d().a(e);
this.h.logException(IronSourceLogger.IronSourceTag.API, str2, e);
to.a().a(new IronSourceError(510, e.getMessage()), (AdInfo) null);
}
}
@Override // com.ironsource.ca.b
public synchronized boolean f(String str) {
boolean z;
com.ironsource.mediationsdk.demandOnly.f fVar = this.h0;
if (fVar != null) {
z = fVar.b(str);
}
return z;
}
@Override // com.ironsource.ui
public InterstitialPlacement g(String str) {
InterstitialPlacement interstitialPlacement;
try {
interstitialPlacement = m(str);
if (interstitialPlacement == null) {
try {
this.h.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
interstitialPlacement = i();
} catch (Exception e) {
e = e;
i9.d().a(e);
return interstitialPlacement;
}
}
this.h.log(IronSourceLogger.IronSourceTag.API, "getPlacementInfo(placement: " + str + "):" + interstitialPlacement, 1);
} catch (Exception e2) {
e = e2;
interstitialPlacement = null;
}
return interstitialPlacement;
}
public Boolean g() {
return this.P;
}
public cr h() {
return this.m;
}
@Override // com.ironsource.ui
public void h(String str) {
try {
String str2 = this.a + ":setMediationType(mediationType:" + str + ")";
IronSourceLoggerManager ironSourceLoggerManager = this.h;
IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
ironSourceLoggerManager.log(ironSourceTag, str2, 1);
if (a(str, 1, 64) && u(str)) {
this.s = str;
this.l0.e(str);
} else {
this.h.log(ironSourceTag, " mediationType value is invalid - should be alphanumeric and 1-64 chars in length", 1);
}
} catch (Exception e) {
i9.d().a(e);
this.h.logException(IronSourceLogger.IronSourceTag.API, this.a + ":setMediationType(mediationType:" + str + ")", e);
}
}
@Override // com.ironsource.ui
public Placement i(String str) {
Placement placement;
try {
placement = p(str);
if (placement == null) {
try {
this.h.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
placement = j();
} catch (Exception e) {
e = e;
i9.d().a(e);
return placement;
}
}
this.h.log(IronSourceLogger.IronSourceTag.API, "getPlacementInfo(placement: " + str + "):" + placement, 1);
} catch (Exception e2) {
e = e2;
placement = null;
}
return placement;
}
@Override // com.ironsource.ca.c
public synchronized boolean j(String str) {
boolean z;
com.ironsource.mediationsdk.demandOnly.k kVar = this.i0;
if (kVar != null) {
z = kVar.a(str);
}
return z;
}
public String l() {
return this.q;
}
public ul n(String str) {
ul a2;
jl e = this.m.c().e();
if (e == null) {
return null;
}
return (TextUtils.isEmpty(str) || (a2 = e.a(str)) == null) ? e.e() : a2;
}
public String n() {
return this.n;
}
public String o() {
return this.o;
}
public List<IronSource.AD_UNIT> p() {
ArrayList arrayList = new ArrayList();
Set<IronSource.AD_UNIT> set = this.z;
if (set != null) {
arrayList.addAll(set);
}
return arrayList;
}
public String q() {
return this.s;
}
public boolean q(String str) {
if (!y()) {
return false;
}
b7 b7Var = null;
try {
b7Var = this.m.c().c().a(str);
if (b7Var == null && (b7Var = this.m.c().c().j()) == null) {
this.h.log(IronSourceLogger.IronSourceTag.API, "Banner default placement was not found", 3);
return false;
}
} catch (Exception e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
if (b7Var == null) {
return false;
}
return a(b7Var);
}
public boolean r(String str) {
if (this.G) {
return false;
}
boolean z = l(str) != fo.b.NOT_CAPPED;
if (z) {
JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(this.G, true, 1);
try {
mediationAdditionalData.put("placement", str);
mediationAdditionalData.put(IronSourceConstants.EVENTS_PROGRAMMATIC, 1);
} catch (Exception e) {
i9.d().a(e);
}
ji.i().a(new kb(IronSourceConstants.IS_CHECK_CAPPED_TRUE, mediationAdditionalData));
}
return z;
}
public Map<String, String> s() {
return this.r;
}
/* JADX WARN: Code restructure failed: missing block: B:8:0x0015, code lost:
if (r0 != 3) goto L10;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public boolean s(java.lang.String r4) {
/*
r3 = this;
com.ironsource.fo$b r0 = r3.o(r4)
if (r0 == 0) goto L17
int[] r1 = com.ironsource.mediationsdk.p.b.c
int r0 = r0.ordinal()
r0 = r1[r0]
r1 = 1
if (r0 == r1) goto L18
r2 = 2
if (r0 == r2) goto L18
r2 = 3
if (r0 == r2) goto L18
L17:
r1 = 0
L18:
r3.a(r1, r4)
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.p.s(java.lang.String):boolean");
}
public IronSourceSegment t() {
return this.C;
}
public void t(String str) {
IronLog.API.verbose("userId = " + str);
this.o = str;
rp.i().a(new kb(52, IronSourceUtils.getJsonForUserId(false)));
AdQualityBridge adQualityBridge = this.o0;
if (adQualityBridge != null) {
adQualityBridge.changeUserId(str);
}
}
public String u() {
return this.w;
}
}