导航菜单

页面标题

页面副标题

Fancy Optimizer v4.6.3 - J.java 源代码

正在查看: Fancy Optimizer v4.6.3 应用的 J.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.ironsource.mediationsdk;

import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.ironsource.environment.ContextProvider;
import com.ironsource.environment.a;
import com.ironsource.mediationsdk.IronSource;
import com.ironsource.mediationsdk.O;
import com.ironsource.mediationsdk.adunit.adapter.utility.AdInfo;
import com.ironsource.mediationsdk.adunit.data.DataKeys;
import com.ironsource.mediationsdk.config.ConfigFile;
import com.ironsource.mediationsdk.logger.IronLog;
import com.ironsource.mediationsdk.logger.IronSourceError;
import com.ironsource.mediationsdk.logger.IronSourceLogger;
import com.ironsource.mediationsdk.logger.IronSourceLoggerManager;
import com.ironsource.mediationsdk.metadata.MetaData;
import com.ironsource.mediationsdk.metadata.MetaDataUtils;
import com.ironsource.mediationsdk.model.InterstitialPlacement;
import com.ironsource.mediationsdk.model.NetworkSettings;
import com.ironsource.mediationsdk.model.Placement;
import com.ironsource.mediationsdk.sdk.ISDemandOnlyInterstitialListener;
import com.ironsource.mediationsdk.sdk.ISDemandOnlyRewardedVideoListener;
import com.ironsource.mediationsdk.sdk.InitializationListener;
import com.ironsource.mediationsdk.sdk.LevelPlayInterstitialListener;
import com.ironsource.mediationsdk.sdk.LevelPlayRewardedVideoListener;
import com.ironsource.mediationsdk.sdk.LevelPlayRewardedVideoManualListener;
import com.ironsource.mediationsdk.sdk.RewardedVideoManualListener;
import com.ironsource.mediationsdk.server.HttpFunctions;
import com.ironsource.mediationsdk.server.ServerURL;
import com.ironsource.mediationsdk.utils.ErrorBuilder;
import com.ironsource.mediationsdk.utils.IronSourceAES;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.mediationsdk.utils.IronSourceUtils;
import com.ironsource.mediationsdk.utils.k;
import com.ironsource.mediationsdk.utils.l;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;

public final class J implements com.ironsource.mediationsdk.utils.i {
    private static boolean ap = false;
    U A;
    R B;
    com.ironsource.mediationsdk.adunit.c.g C;
    com.ironsource.mediationsdk.adunit.c.h D;
    boolean E;
    boolean F;
    boolean G;
    boolean H;
    boolean I;
    boolean J;
    boolean K;
    int L;
    C0130u M;
    C0128s N;
    com.ironsource.mediationsdk.impressionData.a O;
    private final String P;
    private final String Q;
    private AbstractAdapter R;
    private AtomicBoolean S;
    private final Object T;
    private AtomicBoolean U;
    private boolean V;
    private List<IronSource.AD_UNIT> W;
    private Set<IronSource.AD_UNIT> X;
    private Set<IronSource.AD_UNIT> Y;
    private boolean Z;
    final String a;
    private final String aa;
    private boolean ab;
    private boolean ac;
    private Boolean ad;
    private IronSourceBannerLayout ae;

    private String f6af;

    private InitializationListener f7ag;

    private AtomicBoolean f8ah;

    private boolean f9ai;

    private CopyOnWriteArraySet<String> f10aj;
    private CopyOnWriteArraySet<String> ak;
    private CopyOnWriteArraySet<String> al;
    private C0132w am;
    private com.ironsource.d.b an;
    private ak ao;
    ad b;
    G c;
    Q d;
    C0122m e;
    IronSourceLoggerManager f;
    com.ironsource.mediationsdk.sdk.j g;
    com.ironsource.mediationsdk.logger.b h;
    com.ironsource.mediationsdk.utils.l i;
    public String j;
    public String k;
    String l;
    public String m;
    public Map<String, String> n;
    public String o;
    public String p;
    Context q;
    Boolean r;
    IronSourceSegment s;
    int t;
    boolean u;
    boolean v;
    boolean w;
    boolean x;
    Boolean y;
    B z;

    public static class AnonymousClass1 {
        static final int[] a;
        static final int[] b;

        static {
            int[] iArr = new int[k.a.a().length];
            b = iArr;
            try {
                iArr[0] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                b[1] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                b[2] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                b[3] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            int[] iArr2 = new int[IronSource.AD_UNIT.values().length];
            a = iArr2;
            try {
                iArr2[IronSource.AD_UNIT.REWARDED_VIDEO.ordinal()] = 1;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                a[IronSource.AD_UNIT.INTERSTITIAL.ordinal()] = 2;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                a[IronSource.AD_UNIT.OFFERWALL.ordinal()] = 3;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                a[IronSource.AD_UNIT.BANNER.ordinal()] = 4;
            } catch (NoSuchFieldError unused8) {
            }
        }
    }

    public interface a {
        void a(String str);
    }

    public static class b {
        static volatile J a = new J(0);
    }

    private J() {
        this.a = J.class.getName();
        this.P = "!SDK-VERSION-STRING!:com.ironsource:mediationsdk:\u200b7.2.3.1";
        this.Q = "Activity=";
        this.T = new Object();
        this.i = null;
        this.j = null;
        this.k = null;
        this.l = null;
        this.m = null;
        this.n = null;
        this.o = null;
        this.V = false;
        this.p = null;
        this.r = null;
        this.Z = true;
        this.aa = IronSourceConstants.KEY_SESSION_DEPTH;
        this.y = null;
        this.f = IronSourceLoggerManager.getLogger(0);
        com.ironsource.mediationsdk.logger.b bVar = new com.ironsource.mediationsdk.logger.b(null, 1);
        this.h = bVar;
        this.f.addLogger(bVar);
        this.g = new com.ironsource.mediationsdk.sdk.j();
        ad adVar = new ad();
        this.b = adVar;
        adVar.m = this.g;
        G g = new G();
        this.c = g;
        g.m = this.g;
        Q q = new Q();
        this.d = q;
        q.b = this.g;
        this.S = new AtomicBoolean();
        this.X = new HashSet();
        this.Y = new HashSet();
        this.v = false;
        this.u = false;
        this.ab = false;
        this.U = new AtomicBoolean(true);
        this.f8ah = new AtomicBoolean(false);
        this.t = 0;
        this.w = false;
        this.x = false;
        this.ac = false;
        this.p = UUID.randomUUID().toString();
        this.ad = Boolean.FALSE;
        this.J = false;
        this.f6af = null;
        this.z = null;
        this.A = null;
        this.f7ag = null;
        this.B = null;
        this.E = false;
        this.F = false;
        this.H = false;
        this.K = false;
        this.f10aj = new CopyOnWriteArraySet<>();
        this.ak = new CopyOnWriteArraySet<>();
        this.al = new CopyOnWriteArraySet<>();
        this.M = null;
        this.am = null;
        this.N = null;
        this.e = null;
        this.L = 1;
        this.O = new com.ironsource.mediationsdk.impressionData.a();
        this.an = new com.ironsource.d.b();
        this.ao = new ak();
    }

    private void A() {
        if (this.v) {
            z();
            return;
        }
        com.ironsource.mediationsdk.utils.c cVar = this.i.c.b.i;
        boolean z = cVar.a;
        this.H = z;
        this.I = cVar.b;
        b(IronSourceConstants.TROUBLESHOOTING_IS_FORK, IronSourceUtils.getMediationAdditionalData(false, z, 1));
        if (!this.H) {
            y();
        } else if (this.I) {
            w();
        } else {
            x();
        }
    }

    private void B() {
        NetworkSettings a2;
        if (this.ab) {
            C();
            return;
        }
        synchronized (this.ad) {
            this.K = this.i.c.d.g.a;
            IronLog ironLog = IronLog.INTERNAL;
            ironLog.verbose("mIsBnProgrammatic = " + this.K);
            ironLog.verbose("mIsBnLoadBeforeInitCompleted = " + this.ad);
            b(IronSourceConstants.TROUBLESHOOTING_BN_FORK, IronSourceUtils.getMediationAdditionalData(false, this.K, 1));
            ArrayList<NetworkSettings> arrayList = new ArrayList<>();
            for (int i = 0; i < this.i.a.e.size(); i++) {
                String str = this.i.a.e.get(i);
                if (!TextUtils.isEmpty(str) && (a2 = this.i.b.a(str)) != null) {
                    arrayList.add(a2);
                }
            }
            if (arrayList.size() <= 0) {
                JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, this.K, 1);
                a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
                b(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
                a(IronSource.AD_UNIT.BANNER, false);
            } else if (this.K) {
                a(arrayList);
            } else {
                com.ironsource.mediationsdk.model.e eVar = this.i.c.d;
                this.e = new C0122m(arrayList, this.j, IronSourceUtils.getUserIdForNetworks(), eVar.b, eVar.e, eVar.f);
                D();
            }
        }
    }

    private void C() {
        this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in demand only mode", 0);
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < this.i.a.e.size(); i++) {
            String str = this.i.a.e.get(i);
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(this.i.b.a(str));
            }
        }
        if (arrayList.size() > 0) {
            synchronized (this.al) {
                this.N = new C0128s(arrayList, this.i.c.d, this.j, this.k);
            }
            this.al.clear();
            return;
        }
        JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
        a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
        b(IronSourceConstants.TROUBLESHOOTING_BN_INIT_FAILED, mediationAdditionalData);
        a(IronSource.AD_UNIT.BANNER, false);
    }

    private void D() {
        if (this.ad.booleanValue()) {
            this.ad = Boolean.FALSE;
            a(this.ae, this.f6af);
            this.ae = null;
            this.f6af = null;
        }
    }

    private boolean E() {
        com.ironsource.mediationsdk.model.m mVar;
        ArrayList<String> arrayList;
        com.ironsource.mediationsdk.utils.l lVar = this.i;
        return (lVar == null || (mVar = lVar.a) == null || (arrayList = mVar.a) == null || arrayList.size() <= 0) ? false : true;
    }

    private boolean F() {
        com.ironsource.mediationsdk.model.m mVar;
        ArrayList<String> arrayList;
        com.ironsource.mediationsdk.utils.l lVar = this.i;
        return (lVar == null || (mVar = lVar.a) == null || (arrayList = mVar.d) == null || arrayList.size() <= 0) ? false : true;
    }

    private boolean G() {
        com.ironsource.mediationsdk.model.g gVar;
        com.ironsource.mediationsdk.utils.l lVar = this.i;
        return (lVar == null || (gVar = lVar.c) == null || gVar.d == null) ? false : true;
    }

    private boolean H() {
        com.ironsource.mediationsdk.model.m mVar;
        ArrayList<String> arrayList;
        if (G()) {
            com.ironsource.mediationsdk.utils.l lVar = this.i;
            if ((lVar == null || (mVar = lVar.a) == null || (arrayList = mVar.e) == null || arrayList.size() <= 0) ? false : true) {
                return true;
            }
        }
        return false;
    }

    private static boolean I() {
        return ContextProvider.getInstance().getCurrentActiveActivity() != null;
    }

    private void J() {
        if (this.f7ag == null || !this.f8ah.compareAndSet(false, true)) {
            return;
        }
        IronLog.CALLBACK.verbose("onInitializationCompleted()");
        com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.TROUBLESHOOTING_INIT_COMPLETED, IronSourceUtils.getMediationAdditionalData(false)));
        this.f7ag.onInitializationComplete();
    }

    private int a(com.ironsource.mediationsdk.model.o oVar) {
        return !this.f9ai && !this.F && oVar.l.n ? 2 : 1;
    }

    private Placement p(String str) {
        com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
        if (oVar != null) {
            Iterator<Placement> it = oVar.a.iterator();
            while (it.hasNext()) {
                Placement next = it.next();
                if (next.getPlacementName().equals(str)) {
                    return next;
                }
            }
        }
        return null;
    }

    private void q() {
        this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in demand only mode", 0);
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < this.i.a.a.size(); i++) {
            String str = this.i.a.a.get(i);
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(this.i.b.a(str));
            }
        }
        if (arrayList.size() <= 0) {
            a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
            return;
        }
        synchronized (this.ak) {
            this.am = new C0132w(arrayList, this.i.c.a, this.j, this.k);
        }
        if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
            a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
            return;
        }
        Iterator<String> it = this.ak.iterator();
        while (it.hasNext()) {
            this.am.a(it.next(), (String) null, false);
        }
        this.ak.clear();
    }

    private Placement r(String str) {
        Placement p = p(str);
        if (p == null) {
            IronSourceLoggerManager ironSourceLoggerManager = this.f;
            IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
            ironSourceLoggerManager.log(ironSourceTag, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 3);
            p = b();
            if (p == null) {
                this.f.log(ironSourceTag, "Default placement was not found, please make sure you are using the right placements.", 3);
                return null;
            }
        }
        String a2 = a(p.getPlacementName(), com.ironsource.mediationsdk.utils.k.b(ContextProvider.getInstance().getApplicationContext(), p));
        if (TextUtils.isEmpty(a2)) {
            return p;
        }
        this.f.log(IronSourceLogger.IronSourceTag.API, a2, 1);
        ac.a().a(ErrorBuilder.buildCappedPerPlacementError(a2), (AdInfo) null);
        return null;
    }

    private InterstitialPlacement s(String str) {
        com.ironsource.mediationsdk.model.h hVar = this.i.c.b;
        if (hVar != null) {
            Iterator<InterstitialPlacement> it = hVar.a.iterator();
            while (it.hasNext()) {
                InterstitialPlacement next = it.next();
                if (next.getPlacementName().equals(str)) {
                    return next;
                }
            }
        }
        return null;
    }

    private void t() {
        IronLog.INTERNAL.verbose();
        List<NetworkSettings> u = u();
        if (u.size() <= 0) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.L);
            a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
            a(IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
            a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
            return;
        }
        com.ironsource.mediationsdk.adunit.c.h hVar = new com.ironsource.mediationsdk.adunit.c.h(u, this.i.c.a, IronSourceUtils.getUserIdForNetworks(), this.F, com.ironsource.mediationsdk.utils.k.a().b(), this.s);
        this.D = hVar;
        Boolean bool = this.r;
        if (bool != null) {
            hVar.b(bool.booleanValue());
        }
        if (this.G && this.F) {
            this.G = false;
            this.D.d();
        }
    }

    private InterstitialPlacement u(String str) {
        InterstitialPlacement s = s(str);
        if (s == null) {
            IronSourceLoggerManager ironSourceLoggerManager = this.f;
            IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
            ironSourceLoggerManager.log(ironSourceTag, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 3);
            s = g();
            if (s == null) {
                this.f.log(ironSourceTag, "Default placement was not found, please make sure you are using the right placements.", 3);
                return null;
            }
        }
        String a2 = a(s.getPlacementName(), w(s.getPlacementName()));
        if (TextUtils.isEmpty(a2)) {
            return s;
        }
        this.f.log(IronSourceLogger.IronSourceTag.API, a2, 1);
        this.g.e = s;
        D.a().a(ErrorBuilder.buildCappedPerPlacementError(a2), (AdInfo) null);
        return null;
    }

    private List<NetworkSettings> v() {
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < this.i.a.d.size(); i++) {
            String str = this.i.a.d.get(i);
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(this.i.b.a(str));
            }
        }
        return arrayList;
    }

    private int w(java.lang.String r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.w(java.lang.String):int");
    }

    private com.ironsource.mediationsdk.model.f x(String str) {
        com.ironsource.mediationsdk.model.f a2;
        com.ironsource.mediationsdk.model.e eVar = this.i.c.d;
        if (eVar == null) {
            return null;
        }
        return (TextUtils.isEmpty(str) || (a2 = eVar.a(str)) == null) ? eVar.a() : a2;
    }

    private void y() {
        NetworkSettings a2;
        com.ironsource.mediationsdk.model.h hVar = this.i.c.b;
        int i = hVar.e;
        this.c.n.a(IronSource.AD_UNIT.INTERSTITIAL, hVar.f);
        for (int i2 = 0; i2 < this.i.a.d.size(); i2++) {
            String str = this.i.a.d.get(i2);
            if (!TextUtils.isEmpty(str) && (a2 = this.i.b.a(str)) != null) {
                H h = new H(a2, i);
                if (a(h)) {
                    G g = this.c;
                    h.s = g;
                    h.n = i2 + 1;
                    g.a((AbstractC0111b) h);
                }
            }
        }
        if (this.c.c.size() <= 0) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
            a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
            b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
            a(IronSource.AD_UNIT.INTERSTITIAL, false);
            return;
        }
        int i3 = hVar.c;
        G g2 = this.c;
        g2.b = i3;
        g2.a(this.j, IronSourceUtils.getUserIdForNetworks());
        if (this.J) {
            this.J = false;
            this.c.c();
        }
    }

    private void z() {
        this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Interstitial started in demand only mode", 0);
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < this.i.a.d.size(); i++) {
            String str = this.i.a.d.get(i);
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(this.i.b.a(str));
            }
        }
        if (arrayList.size() <= 0) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, 1);
            a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
            b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
            a(IronSource.AD_UNIT.INTERSTITIAL, false);
            return;
        }
        synchronized (this.f10aj) {
            this.M = new C0130u(arrayList, this.i.c.b, this.j, this.k);
        }
        Iterator<String> it = this.f10aj.iterator();
        while (it.hasNext()) {
            this.M.a(it.next(), (String) null, false);
        }
        this.f10aj.clear();
    }

    public final synchronized AbstractAdapter b(String str) {
        try {
            AbstractAdapter abstractAdapter = this.R;
            if (abstractAdapter != null && abstractAdapter.getProviderName().equals(str)) {
                return this.R;
            }
        } catch (Exception e) {
            this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "getOfferwallAdapter exception: " + e, 1);
        }
        return null;
    }

    public final synchronized void c(Activity activity, String str, String str2) {
        if (str2 != null) {
            d(activity, str, str2);
        } else {
            this.f.log(IronSourceLogger.IronSourceTag.API, "adm cannot be null", 3);
            C.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, "adm cannot be null"));
        }
    }

    public final synchronized void d(Activity activity, String str, String str2) {
        IronSourceLoggerManager ironSourceLoggerManager = this.f;
        IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
        ironSourceLoggerManager.log(ironSourceTag, "loadISDemandOnlyInterstitial() instanceId=" + str, 1);
        try {
        } catch (Throwable th2) {
            this.f.logException(IronSourceLogger.IronSourceTag.API, "loadDemandOnlyInterstitial", th2);
            C.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, th2.getMessage()));
        }
        if (!this.x) {
            this.f.log(ironSourceTag, "initISDemandOnly() must be called before loadISDemandOnlyInterstitial()", 3);
            C.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, "initISDemandOnly() must be called before loadISDemandOnlyInterstitial()"));
            return;
        }
        if (!this.v) {
            this.f.log(ironSourceTag, "Interstitial was initialized in mediation mode. Use loadInterstitial instead", 3);
            C.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, "Interstitial was initialized in mediation mode. Use loadInterstitial instead"));
            return;
        }
        boolean z = false;
        if (activity != null) {
            ContextProvider.getInstance().updateActivity(activity);
        } else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
            if (str2 != null) {
                z = true;
            }
            b(IronSourceConstants.TROUBLESHOOTING_DO_CALLED_IS_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, z, 1));
            this.f.log(ironSourceTag, "Interstitial was initialized and loaded without Activity", 3);
            C.a().a(str, new IronSourceError(IronSourceError.ERROR_DO_IS_LOAD_MISSING_ACTIVITY, "Interstitial was initialized and loaded without Activity"));
            return;
        }
        O.a b2 = O.a().b();
        if (b2 == O.a.INIT_FAILED) {
            this.f.log(ironSourceTag, "init() had failed", 3);
            C.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
            return;
        }
        if (b2 == O.a.INIT_IN_PROGRESS) {
            if (O.a().c()) {
                this.f.log(ironSourceTag, "init() had failed", 3);
                C.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
                return;
            }
            synchronized (this.f10aj) {
                this.f10aj.add(str);
            }
            if (str2 != null) {
                b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_IS_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
            }
            return;
        }
        if (!j()) {
            this.f.log(ironSourceTag, "No interstitial configurations found", 3);
            C.a().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain interstitial data", IronSourceConstants.INTERSTITIAL_AD_UNIT));
            return;
        }
        synchronized (this.f10aj) {
            C0130u c0130u = this.M;
            if (c0130u == null) {
                this.f10aj.add(str);
                if (str2 != null) {
                    b(IronSourceConstants.TROUBLESHOOTING_DO_IAB_IS_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, 1));
                }
            } else if (str2 == null) {
                c0130u.a(str, (String) null, false);
            } else {
                c0130u.a(str, str2, true);
            }
        }
    }

    public final void e(String str) {
        String m = android.support.v4.media.b.m("showRewardedVideo(", str, ")");
        IronSourceLoggerManager ironSourceLoggerManager = this.f;
        IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
        ironSourceLoggerManager.log(ironSourceTag, m, 1);
        try {
            if (this.u) {
                this.f.log(ironSourceTag, "Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", 3);
                ac.a().a(ErrorBuilder.buildInitFailedError("Rewarded Video was initialized in demand only mode. Use showISDemandOnlyRewardedVideo instead", IronSourceConstants.REWARDED_VIDEO_AD_UNIT), (AdInfo) null);
                return;
            }
            if (!d()) {
                ac.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);
                return;
            }
            if (this.E) {
                q(str);
                return;
            }
            Placement r = r(str);
            if (r != null) {
                this.b.a(r);
                this.b.a(r.getPlacementName());
            }
        } catch (Exception e) {
            this.f.logException(IronSourceLogger.IronSourceTag.API, m, e);
            ac.a().a(new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, e.getMessage()), (AdInfo) null);
        }
    }

    @Override
    public final void f() {
        synchronized (this.ad) {
            if (this.ad.booleanValue()) {
                this.ad = Boolean.FALSE;
                C0121l.a().a(this.ae, new IronSourceError(IronSourceError.ERROR_BN_LOAD_WHILE_LONG_INITIATION, "init had failed"), false);
                this.ae = null;
                this.f6af = null;
            }
        }
        if (this.J) {
            this.J = false;
            C0127r.a().a(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
        }
        if (this.G) {
            this.G = false;
            C0127r.a().a(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
        }
        synchronized (this.f10aj) {
            Iterator<String> it = this.f10aj.iterator();
            while (it.hasNext()) {
                C.a().a(it.next(), ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
            }
            this.f10aj.clear();
        }
        synchronized (this.ak) {
            Iterator<String> it2 = this.ak.iterator();
            while (it2.hasNext()) {
                ab.a().a(it2.next(), ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
            }
            this.ak.clear();
        }
    }

    public InterstitialPlacement g() {
        com.ironsource.mediationsdk.model.h hVar = this.i.c.b;
        if (hVar != null) {
            return hVar.a();
        }
        return null;
    }

    public final void h(java.lang.String r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.h(java.lang.String):void");
    }

    public boolean i() {
        com.ironsource.mediationsdk.model.g gVar;
        com.ironsource.mediationsdk.utils.l lVar = this.i;
        return (lVar == null || (gVar = lVar.c) == null || gVar.b == null) ? false : true;
    }

    public final void j(String str) {
        String m = android.support.v4.media.b.m("showOfferwall(", str, ")");
        IronSourceLoggerManager ironSourceLoggerManager = this.f;
        IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
        ironSourceLoggerManager.log(ironSourceTag, m, 1);
        try {
            if (!k()) {
                this.g.onOfferwallShowFailed(ErrorBuilder.buildInitFailedError("showOfferwall can't be called before the Offerwall ad unit initialization completed successfully", IronSourceConstants.OFFERWALL_AD_UNIT));
                return;
            }
            com.ironsource.mediationsdk.model.j a2 = this.i.c.c.a(str);
            if (a2 == null) {
                this.f.log(ironSourceTag, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 3);
                a2 = this.i.c.c.a();
                if (a2 == null) {
                    this.f.log(ironSourceTag, "Default placement was not found, please make sure you are using the right placements.", 3);
                    return;
                }
            }
            this.d.a(a2.b);
        } catch (Exception e) {
            this.f.logException(IronSourceLogger.IronSourceTag.API, m, e);
            this.g.onOfferwallShowFailed(ErrorBuilder.buildInitFailedError("showOfferwall can't be called before the Offerwall ad unit initialization completed successfully", IronSourceConstants.OFFERWALL_AD_UNIT));
        }
    }

    public final InterstitialPlacement k(String str) {
        try {
            InterstitialPlacement s = s(str);
            if (s == null) {
                try {
                    this.f.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
                    s = g();
                } catch (Exception unused) {
                    return s;
                }
            }
            this.f.log(IronSourceLogger.IronSourceTag.API, "getPlacementInfo(placement: " + str + "):" + s, 1);
            return s;
        } catch (Exception unused2) {
            return null;
        }
    }

    public final Placement l(String str) {
        try {
            Placement p = p(str);
            if (p == null) {
                try {
                    this.f.log(IronSourceLogger.IronSourceTag.API, "Placement is not valid, please make sure you are using the right placements, using the default placement.", 2);
                    p = b();
                } catch (Exception unused) {
                    return p;
                }
            }
            this.f.log(IronSourceLogger.IronSourceTag.API, "getPlacementInfo(placement: " + str + "):" + p, 1);
            return p;
        } catch (Exception unused2) {
            return null;
        }
    }

    public final String m() {
        return this.j;
    }

    public final java.lang.String n() {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.n():java.lang.String");
    }

    public int o(java.lang.String r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.o(java.lang.String):int");
    }

    public J(byte b2) {
        this();
    }

    public static J a() {
        return b.a;
    }

    private void p() {
        this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Rewarded Video started in programmatic mode", 0);
        List<NetworkSettings> u = u();
        if (u.size() <= 0) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, this.L);
            a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
            a(IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
            a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
            return;
        }
        com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
        this.z = oVar.l.n ? new K(u, oVar, this.j, IronSourceUtils.getUserIdForNetworks(), com.ironsource.mediationsdk.utils.k.a().b(), this.s) : new X(u, oVar, this.j, IronSourceUtils.getUserIdForNetworks(), com.ironsource.mediationsdk.utils.k.a().b(), this.s);
        Boolean bool = this.r;
        if (bool != null) {
            this.z.a(this.q, bool.booleanValue());
            if (this.r.booleanValue()) {
                this.b.a(this.q, false);
            }
        }
    }

    private void q(java.lang.String r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.q(java.lang.String):void");
    }

    private void r() {
        NetworkSettings a2;
        NetworkSettings a3;
        NetworkSettings a4;
        com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
        int i = oVar.e;
        for (int i2 = 0; i2 < this.i.a.a.size(); i2++) {
            String str = this.i.a.a.get(i2);
            if (!TextUtils.isEmpty(str) && (a4 = this.i.b.a(str)) != null) {
                ae aeVar = new ae(a4, i);
                if (a(aeVar)) {
                    ad adVar = this.b;
                    aeVar.s = adVar;
                    aeVar.n = i2 + 1;
                    adVar.a((AbstractC0111b) aeVar);
                }
            }
        }
        if (this.b.c.size() <= 0) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, false, this.L);
            a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
            a(IronSourceConstants.TROUBLESHOOTING_RV_INIT_FAILED, mediationAdditionalData);
            a(IronSource.AD_UNIT.REWARDED_VIDEO, false);
            return;
        }
        boolean a5 = oVar.b.a();
        ad adVar2 = this.b;
        adVar2.n = a5;
        adVar2.b = oVar.c;
        adVar2.o = oVar.h;
        String c = this.i.c();
        if (!TextUtils.isEmpty(c) && (a3 = this.i.b.a(c)) != null) {
            ae aeVar2 = new ae(a3, i);
            if (a(aeVar2)) {
                ad adVar3 = this.b;
                aeVar2.s = adVar3;
                adVar3.h.log(IronSourceLogger.IronSourceTag.INTERNAL, android.support.v4.media.c.j(new StringBuilder(), aeVar2.d, " is set as backfill"), 0);
                adVar3.d = aeVar2;
            }
        }
        String d = this.i.d();
        if (!TextUtils.isEmpty(d) && (a2 = this.i.b.a(d)) != null) {
            ae aeVar3 = new ae(a2, i);
            if (a(aeVar3)) {
                ad adVar4 = this.b;
                aeVar3.s = adVar4;
                adVar4.h.log(IronSourceLogger.IronSourceTag.INTERNAL, android.support.v4.media.c.j(new StringBuilder(), aeVar3.d, " is set as premium"), 0);
                adVar4.e = aeVar3;
            }
        }
        ad adVar5 = this.b;
        adVar5.p = new C0135z(oVar.i, adVar5);
        this.b.a(this.j, IronSourceUtils.getUserIdForNetworks());
    }

    private void s() {
        if (this.u) {
            q();
            return;
        }
        com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
        com.ironsource.mediationsdk.utils.c cVar = oVar.l;
        this.E = cVar.a || this.F;
        this.f9ai = cVar.b;
        int a2 = a(oVar);
        this.L = a2;
        a(IronSourceConstants.TROUBLESHOOTING_RV_FORK, IronSourceUtils.getMediationAdditionalData(false, this.E, a2));
        if (this.F || this.f9ai) {
            t();
        } else if (this.E) {
            p();
        } else {
            r();
        }
    }

    private void t(java.lang.String r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.t(java.lang.String):void");
    }

    private List<NetworkSettings> u() {
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < this.i.a.a.size(); i++) {
            String str = this.i.a.a.get(i);
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(this.i.b.a(str));
            }
        }
        return arrayList;
    }

    private static boolean v(String str) {
        if (str == null) {
            return false;
        }
        return str.matches("^[a-zA-Z0-9]*$");
    }

    private void w() {
        IronLog.INTERNAL.verbose();
        List<NetworkSettings> v = v();
        if (v.size() <= 0) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
            a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
            b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
            a(IronSource.AD_UNIT.INTERSTITIAL, false);
            return;
        }
        com.ironsource.mediationsdk.adunit.c.g gVar = new com.ironsource.mediationsdk.adunit.c.g(v, this.i.c.b, IronSourceUtils.getUserIdForNetworks(), com.ironsource.mediationsdk.utils.k.a().b(), this.s);
        this.C = gVar;
        Boolean bool = this.r;
        if (bool != null) {
            gVar.b(bool.booleanValue());
        }
        if (this.J) {
            this.J = false;
            this.C.d();
        }
    }

    private void x() {
        this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Adunit: Interstitial is now initiated - programmatic mode", 0);
        List<NetworkSettings> v = v();
        if (v.size() <= 0) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false, true, 1);
            a(mediationAdditionalData, new Object[][]{new Object[]{IronSourceConstants.EVENTS_ERROR_CODE, 1010}});
            b(IronSourceConstants.TROUBLESHOOTING_IS_INIT_FAILED, mediationAdditionalData);
            a(IronSource.AD_UNIT.INTERSTITIAL, false);
            return;
        }
        U u = new U(v, this.i.c.b, this.j, IronSourceUtils.getUserIdForNetworks(), this.i.c.b.f, com.ironsource.mediationsdk.utils.k.a().b(), this.s);
        this.A = u;
        Boolean bool = this.r;
        if (bool != null) {
            u.a(bool.booleanValue());
            if (this.r.booleanValue()) {
                this.c.a(this.q, false);
            }
        }
        if (this.J) {
            this.J = false;
            this.A.e();
        }
    }

    public Placement b() {
        com.ironsource.mediationsdk.model.o oVar = this.i.c.a;
        if (oVar != null) {
            return oVar.a();
        }
        return null;
    }

    public final boolean c() {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.c():boolean");
    }

    public final void d(String str) {
        try {
            String str2 = this.a + ":setMediationType(mediationType:" + str + ")";
            IronSourceLoggerManager ironSourceLoggerManager = this.f;
            IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.INTERNAL;
            ironSourceLoggerManager.log(ironSourceTag, str2, 1);
            if (a(str, 1, 64) && v(str)) {
                this.o = str;
            } else {
                this.f.log(ironSourceTag, " mediationType value is invalid - should be alphanumeric and 1-64 chars in length", 1);
            }
        } catch (Exception e) {
            this.f.logException(IronSourceLogger.IronSourceTag.API, android.support.v4.media.c.k(new StringBuilder(), this.a, ":setMediationType(mediationType:", str, ")"), e);
        }
    }

    public final synchronized void f(String str) {
        IronSourceLoggerManager ironSourceLoggerManager = this.f;
        IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
        ironSourceLoggerManager.log(ironSourceTag, "showISDemandOnlyRewardedVideo() instanceId=" + str, 1);
        try {
        } catch (Exception e) {
            this.f.logException(IronSourceLogger.IronSourceTag.API, "showISDemandOnlyRewardedVideo", e);
            ab.a().b(str, new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, e.getMessage()));
        }
        if (!this.u) {
            this.f.log(ironSourceTag, "Rewarded video was initialized in mediation mode. Use showRewardedVideo instead", 3);
            ab.a().b(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "Rewarded video was initialized in mediation mode. Use showRewardedVideo instead"));
            return;
        }
        C0132w c0132w = this.am;
        if (c0132w == null) {
            this.f.log(ironSourceTag, "Rewarded video was not initiated", 3);
            ab.a().b(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "Rewarded video was not initiated"));
        } else if (c0132w.a.containsKey(str)) {
            C0133x c0133x = c0132w.a.get(str);
            c0132w.a(IronSourceConstants.RV_INSTANCE_SHOW, c0133x);
            c0133x.a();
        } else {
            C0132w.a(IronSourceConstants.RV_INSTANCE_NOT_FOUND, str);
            ab.a().b(str, ErrorBuilder.buildNonExistentInstanceError(IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
        }
    }

    public final synchronized boolean g(java.lang.String r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.g(java.lang.String):boolean");
    }

    public final synchronized boolean i(java.lang.String r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.i(java.lang.String):boolean");
    }

    public boolean k() {
        com.ironsource.mediationsdk.model.g gVar;
        com.ironsource.mediationsdk.utils.l lVar = this.i;
        return (lVar == null || (gVar = lVar.c) == null || gVar.c == null) ? false : true;
    }

    public final boolean l() {
        try {
            Q q = this.d;
            if (q != null) {
                return q.a();
            }
            return false;
        } catch (Exception unused) {
            return false;
        }
    }

    public final boolean m(String str) {
        if (this.v) {
            return false;
        }
        boolean z = w(str) != k.a.d;
        if (z) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(this.v, this.H, 1);
            try {
                mediationAdditionalData.put("placement", str);
                if (this.H) {
                    mediationAdditionalData.put(IronSourceConstants.EVENTS_PROGRAMMATIC, 1);
                }
            } catch (Exception unused) {
            }
            com.ironsource.mediationsdk.a.d.d().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.IS_CHECK_CAPPED_TRUE, mediationAdditionalData));
        }
        return z;
    }

    public final boolean n(String str) {
        if (!G()) {
            return false;
        }
        com.ironsource.mediationsdk.model.f fVar = null;
        try {
            fVar = this.i.c.d.a(str);
            if (fVar == null && (fVar = this.i.c.d.a()) == null) {
                this.f.log(IronSourceLogger.IronSourceTag.API, "Banner default placement was not found", 3);
                return false;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (fVar == null) {
            return false;
        }
        return com.ironsource.mediationsdk.utils.k.b(ContextProvider.getInstance().getApplicationContext(), fVar.getPlacementName());
    }

    public final boolean o() {
        return this.u || this.v;
    }

    private com.ironsource.mediationsdk.utils.l a(Context context, String str) {
        if (IronSourceUtils.isInitResponseCached(context)) {
            String cachedValueByKeyOfCachedInitResponse = IronSourceUtils.getCachedValueByKeyOfCachedInitResponse(context, "appKey");
            String cachedValueByKeyOfCachedInitResponse2 = IronSourceUtils.getCachedValueByKeyOfCachedInitResponse(context, DataKeys.USER_ID);
            String cachedValueByKeyOfCachedInitResponse3 = IronSourceUtils.getCachedValueByKeyOfCachedInitResponse(context, "response");
            String str2 = this.j;
            if (str2 != null && cachedValueByKeyOfCachedInitResponse.equals(str2) && cachedValueByKeyOfCachedInitResponse2.equals(str)) {
                com.ironsource.mediationsdk.utils.l lVar = new com.ironsource.mediationsdk.utils.l(context, cachedValueByKeyOfCachedInitResponse, cachedValueByKeyOfCachedInitResponse2, cachedValueByKeyOfCachedInitResponse3);
                lVar.e = l.a.b;
                return lVar;
            }
        }
        return null;
    }

    private com.ironsource.mediationsdk.utils.l b(Context context, String str, a aVar) {
        com.ironsource.mediationsdk.utils.l lVar = null;
        if (!IronSourceUtils.isNetworkConnected(context)) {
            return null;
        }
        try {
            String a2 = a(context);
            if (TextUtils.isEmpty(a2)) {
                a2 = com.ironsource.environment.h.x(context);
                IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "using custom identifier", 1);
            }
            String str2 = a2;
            IronSourceSegment ironSourceSegment = this.s;
            String stringFromURL = HttpFunctions.getStringFromURL(ServerURL.getCPVProvidersURL(context, this.j, str, str2, this.o, this.F, ironSourceSegment != null ? ironSourceSegment.a() : null), aVar);
            if (stringFromURL == null) {
                IronLog.INTERNAL.warning("serverResponseString is null");
                return null;
            }
            if (IronSourceUtils.getSerr() == 1) {
                IronLog ironLog = IronLog.INTERNAL;
                ironLog.verbose("encrypt");
                String optString = new JSONObject(stringFromURL).optString("response", null);
                if (TextUtils.isEmpty(optString)) {
                    ironLog.warning("encryptedResponse is empty - return null");
                    return null;
                }
                stringFromURL = IronSourceAES.decode(com.ironsource.mediationsdk.utils.g.a().b(), optString);
                if (TextUtils.isEmpty(stringFromURL)) {
                    ironLog.warning("encoded response invalid - return null");
                    if (!ap) {
                        ap = true;
                        JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
                        try {
                            mediationAdditionalData.put(IronSourceConstants.EVENTS_STATUS, "false");
                            mediationAdditionalData.put(IronSourceConstants.EVENTS_ERROR_CODE, 1);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                        com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.FIRST_INSTANCE_RESULT, mediationAdditionalData));
                    }
                    return null;
                }
            }
            com.ironsource.mediationsdk.utils.l lVar2 = new com.ironsource.mediationsdk.utils.l(context, this.j, str, stringFromURL);
            try {
                lVar2.e = l.a.c;
                if (lVar2.b()) {
                    return lVar2;
                }
                IronLog.INTERNAL.warning("response invalid - return null");
                return null;
            } catch (Exception e2) {
                e = e2;
                lVar = lVar2;
                IronLog.INTERNAL.warning("exception = " + e);
                e.printStackTrace();
                return lVar;
            }
        } catch (Exception e3) {
            e = e3;
        }
    }

    public final boolean c(String str) {
        try {
            String str2 = this.a + ":setDynamicUserId(dynamicUserId:" + str + ")";
            IronSourceLoggerManager ironSourceLoggerManager = this.f;
            IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
            ironSourceLoggerManager.log(ironSourceTag, str2, 1);
            com.ironsource.d.a aVar = new com.ironsource.d.a();
            if (!a(str, 1, 128)) {
                aVar.a(ErrorBuilder.buildInvalidKeyValueError(IronSourceConstants.EVENTS_DYNAMIC_USER_ID, IronSourceConstants.SUPERSONIC_CONFIG_NAME, "dynamicUserId is invalid, should be between 1-128 chars in length."));
            }
            if (!aVar.a()) {
                IronSourceLoggerManager.getLogger().log(ironSourceTag, aVar.b().toString(), 2);
                return false;
            }
            this.m = str;
            com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(52, IronSourceUtils.getJsonForUserId(true)));
            return true;
        } catch (Exception e) {
            this.f.logException(IronSourceLogger.IronSourceTag.API, android.support.v4.media.c.k(new StringBuilder(), this.a, ":setDynamicUserId(dynamicUserId:", str, ")"), e);
            return false;
        }
    }

    public final com.ironsource.mediationsdk.utils.l a(android.content.Context r11, java.lang.String r12, com.ironsource.mediationsdk.J.a r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.a(android.content.Context, java.lang.String, com.ironsource.mediationsdk.J$a):com.ironsource.mediationsdk.utils.l");
    }

    public final String b(Context context) {
        String str;
        com.ironsource.mediationsdk.utils.p pVar;
        JSONObject a2;
        AbstractAdapter a3;
        a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_CALLED, (JSONObject) null);
        if (context == null) {
            IronLog.API.error("bidding data cannot be retrieved, context required");
            return null;
        }
        O.a b2 = O.a().b();
        O.a aVar = O.a.NOT_INIT;
        if (b2 == aVar) {
            IronLog.API.error("bidding data cannot be retrieved, SDK not initialized");
            a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (JSONObject) null);
            return null;
        }
        if (b2 == O.a.INIT_FAILED) {
            IronLog.API.error("bidding data cannot be retrieved, SDK failed to initialize");
            a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (JSONObject) null);
            return null;
        }
        try {
            com.ironsource.mediationsdk.utils.l lVar = this.i;
            if (lVar == null) {
                lVar = F.a(context);
            }
            if (b2 == aVar) {
                this.an.a(context);
                this.an.b(IronSourceUtils.getSDKVersion());
                this.an.c(this.p);
                this.an.d(ConfigFile.getConfigFile().getPluginType());
                this.an.a(com.ironsource.c.a.a());
                this.an.b(IronSourceUtils.isGooglePlayInstalled(context));
            }
            if (b2 != O.a.INITIATED) {
                O.a().a(lVar);
                if (lVar != null) {
                    O.a().a(context, lVar);
                }
            }
            if (lVar == null || !lVar.b()) {
                pVar = new com.ironsource.mediationsdk.utils.p();
            } else {
                pVar = lVar.c.e.c();
                if (!pVar.d) {
                    pVar.b = lVar.b.a(IronSourceConstants.IRONSOURCE_CONFIG_NAME);
                }
            }
            if (pVar.d) {
                JSONObject a4 = C0124o.a(context, new com.ironsource.environment.f.b().a);
                kotlin.jvm.internal.j.d(a4, "mGlobalDataReader.getDat…s(context, mTokenKeyList)");
                a2 = com.ironsource.environment.f.b.a(a4);
            } else {
                NetworkSettings networkSettings = pVar.b;
                a2 = (networkSettings == null || (a3 = C0113d.a().a(networkSettings, networkSettings.getApplicationSettings(), true, false)) == null) ? null : C0115f.a().a(a3.getPlayerBiddingData(), pVar.c, pVar.a);
            }
            C0115f.a().a(a2, true);
            str = pVar.e ? IronSourceAES.compressAndEncrypt(a2.toString()) : IronSourceAES.encrypt(a2.toString());
        } catch (Throwable th2) {
            a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_ENRICH_TOKEN_ERROR, (JSONObject) null);
            IronLog.API.error("got error during token creation: " + th2.getMessage());
            str = null;
        }
        if (str == null) {
            a(IronSourceConstants.TROUBLESHOOTING_DO_GET_BIDDING_DATA_RETURNED_NULL, (JSONObject) null);
        }
        return str;
    }

    public static String a(Context context) {
        String[] C = com.ironsource.environment.h.C(context);
        return (C == null || C.length != 2) ? "" : C[0];
    }

    private static void b(int i, JSONObject jSONObject) {
        com.ironsource.mediationsdk.a.d.d().b(new com.ironsource.mediationsdk.a.c(i, jSONObject));
    }

    private static String a(String str, int i) {
        if (i == 0) {
            return null;
        }
        int i2 = AnonymousClass1.b[i - 1];
        if (i2 == 1 || i2 == 2 || i2 == 3) {
            return android.support.v4.media.b.m("placement ", str, " is capped");
        }
        return null;
    }

    public final synchronized void b(Activity activity, String str, String str2) {
        IronSourceLoggerManager ironSourceLoggerManager = this.f;
        IronSourceLogger.IronSourceTag ironSourceTag = IronSourceLogger.IronSourceTag.API;
        ironSourceLoggerManager.log(ironSourceTag, "loadISDemandOnlyRewardedVideo() instanceId=" + str, 1);
        try {
        } catch (Throwable th2) {
            this.f.logException(IronSourceLogger.IronSourceTag.API, "loadISDemandOnlyRewardedVideo", th2);
            ab.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, th2.getMessage()));
        }
        if (!this.w) {
            this.f.log(ironSourceTag, "initISDemandOnly() must be called before loadISDemandOnlyRewardedVideo()", 3);
            ab.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "initISDemandOnly() must be called before loadISDemandOnlyRewardedVideo()"));
            return;
        }
        if (!this.u) {
            this.f.log(ironSourceTag, "Rewarded video was initialized in mediation mode", 3);
            ab.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_INIT_FAILED, "Rewarded video was initialized in mediation mode"));
            return;
        }
        boolean z = false;
        if (activity != null) {
            ContextProvider.getInstance().updateActivity(activity);
        } else if (ContextProvider.getInstance().getCurrentActiveActivity() == null) {
            if (str2 != null) {
                z = true;
            }
            a(IronSourceConstants.TROUBLESHOOTING_DO_CALLED_RV_LOAD_WITH_NO_ACTIVITY, IronSourceUtils.getMediationAdditionalData(true, z, 1));
            this.f.log(ironSourceTag, "Rewarded video was initialized and loaded without Activity", 3);
            ab.a().a(str, new IronSourceError(IronSourceError.ERROR_DO_RV_LOAD_MISSING_ACTIVITY, "Rewarded video was initialized and loaded without Activity"));
            return;
        }
        O.a b2 = O.a().b();
        if (b2 == O.a.INIT_FAILED) {
            this.f.log(ironSourceTag, "init() had failed", 3);
            ab.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
            return;
        }
        if (b2 == O.a.INIT_IN_PROGRESS) {
            if (O.a().c()) {
                this.f.log(ironSourceTag, "init() had failed", 3);
                ab.a().a(str, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
                return;
            }
            synchronized (this.ak) {
                this.ak.add(str);
            }
            if (str2 != null) {
                a(IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, this.L));
            }
            return;
        }
        if (!e()) {
            this.f.log(ironSourceTag, "No rewarded video configurations found", 3);
            ab.a().a(str, ErrorBuilder.buildInitFailedError("the server response does not contain rewarded video data", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
            return;
        }
        synchronized (this.ak) {
            C0132w c0132w = this.am;
            if (c0132w == null) {
                this.ak.add(str);
                if (str2 != null) {
                    a(IronSourceConstants.TROUBLESHOOTING_DO_IAB_RV_LOAD_FAILED_INIT_IN_PROGRESS, IronSourceUtils.getMediationAdditionalData(true, true, this.L));
                }
            } else if (str2 == null) {
                c0132w.a(str, (String) null, false);
            } else {
                c0132w.a(str, str2, true);
            }
        }
    }

    private void b(IronSource.AD_UNIT ad_unit) {
        int i = AnonymousClass1.a[ad_unit.ordinal()];
        if (i == 1) {
            s();
            return;
        }
        if (i == 2) {
            A();
        } else if (i == 3) {
            this.d.a(this.j, this.k);
        } else {
            if (i != 4) {
                return;
            }
            B();
        }
    }

    public final void b(boolean z) {
        this.y = Boolean.valueOf(z);
        IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, "setConsent : " + z, 1);
        C0113d.a().a(z);
        if (this.R != null) {
            this.f.log(IronSourceLogger.IronSourceTag.ADAPTER_API, "Offerwall | setConsent(consent:" + z + ")", 1);
            this.R.setConsent(z);
        }
        int i = !z ? 41 : 40;
        this.an.a(z);
        com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(i, IronSourceUtils.getMediationAdditionalData(false)));
    }

    public boolean e() {
        return d() && E();
    }

    public final boolean h() {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.h():boolean");
    }

    public boolean j() {
        return i() && F();
    }

    public boolean d() {
        com.ironsource.mediationsdk.model.g gVar;
        com.ironsource.mediationsdk.utils.l lVar = this.i;
        return (lVar == null || (gVar = lVar.c) == null || gVar.a == null) ? false : true;
    }

    public static void a(int i, JSONObject jSONObject) {
        com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(i, jSONObject));
    }

    public final synchronized void a(android.app.Activity r9, com.ironsource.mediationsdk.ISDemandOnlyBannerLayout r10, java.lang.String r11, java.lang.String r12) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.a(android.app.Activity, com.ironsource.mediationsdk.ISDemandOnlyBannerLayout, java.lang.String, java.lang.String):void");
    }

    public final synchronized void a(Activity activity, String str, String str2) {
        if (str2 != null) {
            b(activity, str, str2);
        } else {
            this.f.log(IronSourceLogger.IronSourceTag.API, "adm cannot be null", 3);
            ab.a().a(str, new IronSourceError(IronSourceError.ERROR_CODE_GENERIC, "adm cannot be null"));
        }
    }

    public final synchronized void a(android.content.Context r8, java.lang.String r9, com.ironsource.mediationsdk.sdk.InitializationListener r10, com.ironsource.mediationsdk.IronSource.AD_UNIT... r11) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.a(android.content.Context, java.lang.String, com.ironsource.mediationsdk.sdk.InitializationListener, com.ironsource.mediationsdk.IronSource$AD_UNIT[]):void");
    }

    public final synchronized void a(android.content.Context r9, java.lang.String r10, boolean r11, com.ironsource.mediationsdk.sdk.InitializationListener r12, com.ironsource.mediationsdk.IronSource.AD_UNIT... r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.ironsource.mediationsdk.J.a(android.content.Context, java.lang.String, boolean, com.ironsource.mediationsdk.sdk.InitializationListener, com.ironsource.mediationsdk.IronSource$AD_UNIT[]):void");
    }

    public final synchronized void a(AbstractAdapter abstractAdapter) {
        this.R = abstractAdapter;
    }

    private void a(IronSource.AD_UNIT ad_unit) {
        String str = ad_unit + " ad unit has already been initialized";
        this.f.log(IronSourceLogger.IronSourceTag.API, str, 3);
        IronSourceUtils.sendAutomationLog(str);
    }

    private void a(IronSource.AD_UNIT ad_unit, boolean z) {
        int i = AnonymousClass1.a[ad_unit.ordinal()];
        if (i == 1) {
            if (this.u) {
                Iterator<String> it = this.ak.iterator();
                while (it.hasNext()) {
                    ab.a().a(it.next(), ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
                }
                this.ak.clear();
                return;
            }
            if (this.F) {
                if (this.G) {
                    this.G = false;
                    C0127r.a().a(IronSource.AD_UNIT.REWARDED_VIDEO, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.REWARDED_VIDEO_AD_UNIT));
                    return;
                }
                return;
            }
            if (z || d() || this.Y.contains(ad_unit)) {
                ac.a().a(false, (AdInfo) null);
                return;
            }
            return;
        }
        if (i == 2) {
            if (!this.v) {
                if (this.J) {
                    this.J = false;
                    C0127r.a().a(IronSource.AD_UNIT.INTERSTITIAL, ErrorBuilder.buildInitFailedError("init() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
                    return;
                }
                return;
            }
            Iterator<String> it2 = this.f10aj.iterator();
            while (it2.hasNext()) {
                C.a().a(it2.next(), ErrorBuilder.buildInitFailedError("initISDemandOnly() had failed", IronSourceConstants.INTERSTITIAL_AD_UNIT));
            }
            this.f10aj.clear();
            return;
        }
        if (i == 3) {
            if (z || k() || this.Y.contains(ad_unit)) {
                this.g.onOfferwallAvailable(false);
                return;
            }
            return;
        }
        if (i != 4) {
            return;
        }
        synchronized (this.ad) {
            if (this.ad.booleanValue()) {
                this.ad = Boolean.FALSE;
                C0121l.a().a(this.ae, new IronSourceError(IronSourceError.ERROR_BN_INIT_FAILED_AFTER_LOAD, "Init had failed"), false);
                this.ae = null;
                this.f6af = null;
            }
        }
    }

    public final void a(IronSourceBannerLayout ironSourceBannerLayout, String str) {
        IronLog.INTERNAL.verbose("placementName = " + str);
        if (ironSourceBannerLayout == null || ironSourceBannerLayout.isDestroyed()) {
            String concat = "loadBanner can't be called - ".concat(ironSourceBannerLayout == null ? "banner layout is null " : "banner layout is destroyed");
            this.f.log(IronSourceLogger.IronSourceTag.API, concat, 3);
            C0121l.a().a(ironSourceBannerLayout, ErrorBuilder.buildLoadFailedError(concat), false);
            return;
        }
        if (!this.ac) {
            this.f.log(IronSourceLogger.IronSourceTag.API, "init() must be called before loadBanner()", 3);
            C0121l.a().a(ironSourceBannerLayout, ErrorBuilder.buildLoadFailedError("init() must be called before loadBanner()"), false);
            return;
        }
        if (ironSourceBannerLayout.getSize().getDescription().equals("CUSTOM") && (ironSourceBannerLayout.getSize().getWidth() <= 0 || ironSourceBannerLayout.getSize().getHeight() <= 0)) {
            this.f.log(IronSourceLogger.IronSourceTag.API, "loadBanner: Unsupported banner size. Height and width must be bigger than 0", 3);
            C0121l.a().a(ironSourceBannerLayout, ErrorBuilder.unsupportedBannerSize(""), false);
            return;
        }
        O.a b2 = O.a().b();
        if (b2 == O.a.INIT_FAILED) {
            this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
            C0121l.a().a(ironSourceBannerLayout, new IronSourceError(600, "Init() had failed"), false);
            return;
        }
        if (b2 == O.a.INIT_IN_PROGRESS) {
            if (O.a().c()) {
                this.f.log(IronSourceLogger.IronSourceTag.API, "init() had failed", 3);
                C0121l.a().a(ironSourceBannerLayout, new IronSourceError(IronSourceError.ERROR_BN_LOAD_AFTER_LONG_INITIATION, "Init had failed"), false);
                return;
            } else {
                this.ae = ironSourceBannerLayout;
                this.ad = Boolean.TRUE;
                this.f6af = str;
                return;
            }
        }
        if (!H()) {
            this.f.log(IronSourceLogger.IronSourceTag.API, "No banner configurations found", 3);
            C0121l.a().a(ironSourceBannerLayout, new IronSourceError(IronSourceError.ERROR_BN_LOAD_NO_CONFIG, "the server response does not contain banner data"), false);
            return;
        }
        synchronized (this.ad) {
            C0122m c0122m = this.e;
            if (c0122m == null && this.B == null) {
                this.ae = ironSourceBannerLayout;
                this.ad = Boolean.TRUE;
                this.f6af = str;
            } else if (this.K) {
                this.B.a(ironSourceBannerLayout, x(str));
            } else {
                c0122m.a(ironSourceBannerLayout, x(str));
            }
        }
    }

    public static void a(ISDemandOnlyInterstitialListener iSDemandOnlyInterstitialListener) {
        C.a().a = iSDemandOnlyInterstitialListener;
    }

    public static void a(ISDemandOnlyRewardedVideoListener iSDemandOnlyRewardedVideoListener) {
        ab.a().a = iSDemandOnlyRewardedVideoListener;
    }

    public static void a(LevelPlayInterstitialListener levelPlayInterstitialListener) {
        IronLog ironLog = IronLog.API;
        if (levelPlayInterstitialListener == null) {
            ironLog.info("ISListener is null");
        } else {
            ironLog.info();
        }
        D.a().a(levelPlayInterstitialListener);
    }

    public static void a(LevelPlayRewardedVideoListener levelPlayRewardedVideoListener) {
        IronLog ironLog = IronLog.API;
        if (levelPlayRewardedVideoListener == null) {
            ironLog.info("RVListener is null");
        } else {
            ironLog.info();
        }
        ac.a().b = levelPlayRewardedVideoListener;
    }

    public final synchronized void a(LevelPlayRewardedVideoManualListener levelPlayRewardedVideoManualListener) {
        IronLog ironLog;
        String str;
        if (levelPlayRewardedVideoManualListener == null) {
            IronLog.API.info("RVListener is null");
        } else {
            IronLog.API.info();
        }
        if (!this.w) {
            if (levelPlayRewardedVideoManualListener == null) {
                this.F = false;
                ironLog = IronLog.API;
                str = "Disabling rewarded video manual mode";
            } else {
                this.F = true;
                ironLog = IronLog.API;
                str = "Enabling rewarded video manual mode";
            }
            ironLog.info(str);
        }
        ac.a().b = levelPlayRewardedVideoManualListener;
    }

    public final synchronized void a(RewardedVideoManualListener rewardedVideoManualListener) {
        IronLog ironLog;
        String str;
        if (rewardedVideoManualListener == null) {
            IronLog.API.info("RVListener is null");
        } else {
            IronLog.API.info();
        }
        if (!this.w) {
            if (rewardedVideoManualListener == null) {
                this.F = false;
                ironLog = IronLog.API;
                str = "Disabling rewarded video manual mode";
            } else {
                this.F = true;
                ironLog = IronLog.API;
                str = "Enabling rewarded video manual mode";
            }
            ironLog.info(str);
        }
        this.g.a = rewardedVideoManualListener;
        ac.a().a = rewardedVideoManualListener;
    }

    @Override
    public final void a(String str) {
        try {
            this.f.log(IronSourceLogger.IronSourceTag.API, "onInitFailed(reason:" + str + ")", 1);
            IronSourceUtils.sendAutomationLog("Mediation init failed");
            if (this.g != null) {
                Iterator<IronSource.AD_UNIT> it = this.X.iterator();
                while (it.hasNext()) {
                    a(it.next(), true);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void a(String str, com.ironsource.d.a aVar) {
        if (str != null) {
            try {
                if (str.length() > 64) {
                    aVar.a(ErrorBuilder.buildInvalidKeyValueError("segment", IronSourceConstants.SUPERSONIC_CONFIG_NAME, "segment value should not exceed 64 characters."));
                }
            } catch (Exception unused) {
                aVar.a(ErrorBuilder.buildInvalidKeyValueError("segment", IronSourceConstants.SUPERSONIC_CONFIG_NAME, "segment value should not exceed 64 characters."));
            }
        }
    }

    public final void a(String str, List<String> list) {
        IronLog ironLog = IronLog.API;
        StringBuilder n = android.support.v4.media.c.n("key = ", str, ", values = ");
        n.append(list.toString());
        ironLog.verbose(n.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)) {
            C0113d.a().a(metaDataKey, metaDataValue);
        } else if (O.a().b() == O.a.INITIATED && MetaDataUtils.isMediationKeysBeforeInit(metaDataKey)) {
            ironLog.error("setMetaData with key = " + metaDataKey + " must to be called before init");
        } else {
            com.ironsource.mediationsdk.utils.k.a().a(metaDataKey, metaDataValue);
        }
        try {
            ConcurrentHashMap<String, List<String>> concurrentHashMap = C0113d.a().c;
            concurrentHashMap.putAll(com.ironsource.mediationsdk.utils.k.a().d());
            JSONObject jSONObject = new JSONObject();
            for (Map.Entry<String, List<String>> entry : concurrentHashMap.entrySet()) {
                jSONObject.put(entry.getKey(), entry.getValue());
            }
            this.an.a(jSONObject);
        } catch (JSONException e) {
            IronLog.INTERNAL.error("got the following error " + e.getMessage());
            e.printStackTrace();
        }
        com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(O.a().b() == O.a.INITIATED ? 51 : 50, IronSourceUtils.getJsonForMetaData(str, list, metaDataValue)));
    }

    public static void a(String str, JSONObject jSONObject) {
        String l = android.support.v4.media.b.l("networkKey = ", str);
        if (jSONObject != null) {
            l = l + " networkData = " + jSONObject;
        }
        IronLog.API.verbose(l);
        C0113d.a().a(str, jSONObject);
    }

    public final void a(String str, boolean z) {
        IronLog.API.verbose("userId = " + str + ", isFromPublisher = " + z);
        this.k = str;
        if (z) {
            com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(52, IronSourceUtils.getJsonForUserId(false)));
        }
    }

    private void a(ArrayList<NetworkSettings> arrayList) {
        this.f.log(IronSourceLogger.IronSourceTag.INTERNAL, "Banner started in programmatic mode", 0);
        this.B = new R(arrayList, new com.ironsource.mediationsdk.c.b(this.j, IronSourceUtils.getUserIdForNetworks(), this.i.c.d), com.ironsource.mediationsdk.utils.k.a().b(), this.s);
        D();
    }

    @Override
    public final void a(List<IronSource.AD_UNIT> list, boolean z, com.ironsource.mediationsdk.model.g gVar) {
        IronLog.INTERNAL.verbose();
        try {
            this.W = list;
            this.V = true;
            this.f.log(IronSourceLogger.IronSourceTag.API, "onInitSuccess()", 1);
            IronSourceUtils.sendAutomationLog("init success");
            if (z) {
                JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(false);
                try {
                    mediationAdditionalData.put("revived", true);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.FIRST_INSTANCE_RESULT, mediationAdditionalData));
            }
            Activity currentActiveActivity = ContextProvider.getInstance().getCurrentActiveActivity();
            if (currentActiveActivity != null) {
                String screenSizeParams = AdapterUtils.getScreenSizeParams(currentActiveActivity);
                JSONObject jSONObject = new JSONObject();
                try {
                    jSONObject.put(IronSourceConstants.EVENTS_EXT1, screenSizeParams);
                } catch (JSONException e2) {
                    e2.printStackTrace();
                }
                com.ironsource.mediationsdk.a.d.d().b(new com.ironsource.mediationsdk.a.c(IronSourceConstants.TROUBLESHOOTING_SCREEN_SIZE, jSONObject));
            }
            com.ironsource.mediationsdk.a.d.d().c();
            com.ironsource.mediationsdk.a.h.d().c();
            C0113d a2 = C0113d.a();
            String str = this.j;
            String str2 = this.k;
            a2.a = str;
            a2.b = str2;
            for (IronSource.AD_UNIT ad_unit : IronSource.AD_UNIT.values()) {
                if (this.X.contains(ad_unit)) {
                    if (list.contains(ad_unit)) {
                        b(ad_unit);
                    } else {
                        a(ad_unit, false);
                    }
                }
            }
            J();
        } catch (Exception e3) {
            e3.printStackTrace();
        }
    }

    public static void a(JSONObject jSONObject, Object[][] objArr) {
        for (int i = 0; i <= 0; i++) {
            try {
                Object[] objArr2 = objArr[0];
                jSONObject.put(objArr2[0].toString(), objArr2[1]);
            } catch (Exception e) {
                IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.INTERNAL, "IronSourceObject addToDictionary: " + Log.getStackTraceString(e), 3);
                return;
            }
        }
    }

    public static void a(boolean z) {
        IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.API, "setAdaptersDebug : " + z, 1);
        C0113d.a().b(z);
    }

    private synchronized void a(boolean z, IronSource.AD_UNIT... ad_unitArr) {
        String str;
        String str2;
        int i = 0;
        for (IronSource.AD_UNIT ad_unit : ad_unitArr) {
            if (ad_unit.equals(IronSource.AD_UNIT.INTERSTITIAL)) {
                this.x = true;
            } else if (ad_unit.equals(IronSource.AD_UNIT.BANNER)) {
                this.ac = true;
            } else if (ad_unit.equals(IronSource.AD_UNIT.REWARDED_VIDEO)) {
                this.w = true;
            }
        }
        if (O.a().b() == O.a.INIT_FAILED) {
            try {
                if (this.g != null) {
                    int length = ad_unitArr.length;
                    while (i < length) {
                        IronSource.AD_UNIT ad_unit2 = ad_unitArr[i];
                        if (!this.X.contains(ad_unit2)) {
                            a(ad_unit2, true);
                        }
                        i++;
                    }
                }
                return;
            } catch (Exception e) {
                e.printStackTrace();
                return;
            }
        }
        if (!this.V) {
            JSONObject mediationAdditionalData = IronSourceUtils.getMediationAdditionalData(z);
            int length2 = ad_unitArr.length;
            boolean z2 = false;
            while (i < length2) {
                IronSource.AD_UNIT ad_unit3 = ad_unitArr[i];
                if (this.X.contains(ad_unit3)) {
                    this.f.log(IronSourceLogger.IronSourceTag.API, ad_unit3 + " ad unit has started initializing.", 3);
                } else {
                    this.X.add(ad_unit3);
                    this.Y.add(ad_unit3);
                    try {
                        mediationAdditionalData.put(ad_unit3.toString(), true);
                    } catch (Exception e2) {
                        e2.printStackTrace();
                    }
                    z2 = true;
                }
                i++;
            }
            if (z2) {
                try {
                    StringBuilder sb = new StringBuilder();
                    String str3 = ",androidx=" + IronSourceUtils.isAndroidXAvailable();
                    String str4 = ",Activity=" + I();
                    if (a.AnonymousClass1.d()) {
                        sb.append(IronSourceConstants.IS_APP_LANGUAGE_KOTLIN);
                        str2 = a.AnonymousClass1.c();
                    } else {
                        str2 = IronSourceConstants.IS_APP_LANGUAGE_JAVA;
                    }
                    sb.append(str2);
                    sb.append(str3);
                    if (o()) {
                        sb.append(str4);
                    }
                    mediationAdditionalData.put(IronSourceConstants.EVENTS_EXT1, sb.toString());
                    int i2 = this.t + 1;
                    this.t = i2;
                    mediationAdditionalData.put(IronSourceConstants.KEY_SESSION_DEPTH, i2);
                } catch (Exception e3) {
                    e3.printStackTrace();
                }
                com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(14, mediationAdditionalData));
            }
            return;
        }
        O.a().b(z);
        if (this.W == null) {
            return;
        }
        JSONObject mediationAdditionalData2 = IronSourceUtils.getMediationAdditionalData(z);
        boolean z3 = false;
        for (IronSource.AD_UNIT ad_unit4 : ad_unitArr) {
            if (this.X.contains(ad_unit4)) {
                a(ad_unit4);
            } else {
                this.X.add(ad_unit4);
                this.Y.add(ad_unit4);
                try {
                    mediationAdditionalData2.put(ad_unit4.toString(), true);
                } catch (Exception e4) {
                    e4.printStackTrace();
                }
                List<IronSource.AD_UNIT> list = this.W;
                if (list == null || !list.contains(ad_unit4)) {
                    a(ad_unit4, false);
                } else {
                    b(ad_unit4);
                }
                z3 = true;
            }
        }
        if (z3) {
            try {
                StringBuilder sb2 = new StringBuilder();
                String str5 = ",androidx=" + IronSourceUtils.isAndroidXAvailable();
                String str6 = ",Activity=" + I();
                if (a.AnonymousClass1.d()) {
                    sb2.append(IronSourceConstants.IS_APP_LANGUAGE_KOTLIN);
                    str = a.AnonymousClass1.c();
                } else {
                    str = IronSourceConstants.IS_APP_LANGUAGE_JAVA;
                }
                sb2.append(str);
                sb2.append(str5);
                if (o()) {
                    sb2.append(str6);
                }
                mediationAdditionalData2.put(IronSourceConstants.EVENTS_EXT1, sb2.toString());
                int i3 = this.t + 1;
                this.t = i3;
                mediationAdditionalData2.put(IronSourceConstants.KEY_SESSION_DEPTH, i3);
            } catch (Exception e5) {
                e5.printStackTrace();
            }
            com.ironsource.mediationsdk.a.h.d().b(new com.ironsource.mediationsdk.a.c(14, mediationAdditionalData2));
        }
        return;
    }

    private static boolean a(AbstractC0111b abstractC0111b) {
        return abstractC0111b.k > 0 && abstractC0111b.l > 0;
    }

    private static boolean a(String str, int i, int i2) {
        return str != null && str.length() >= i && str.length() <= i2;
    }
}