Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9

以下内容为反编译后的 n.java 源代码,内容仅作参考


package com.applovin.impl.sdk;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import com.applovin.impl.mediation.MediationServiceImpl;
import com.applovin.impl.privacy.a.c;
import com.applovin.impl.privacy.a.d;
import com.applovin.impl.privacy.cmp.CmpServiceImpl;
import com.applovin.impl.sdk.array.ArrayService;
import com.applovin.impl.sdk.e.l;
import com.applovin.impl.sdk.e.q;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdService;
import com.applovin.impl.sdk.network.PostbackServiceImpl;
import com.applovin.impl.sdk.network.d;
import com.applovin.impl.sdk.r;
import com.applovin.impl.sdk.utils.AppLovinSdkExtraParameterKey;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.adapter.MaxAdapter;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkConfiguration;
import com.applovin.sdk.AppLovinSdkSettings;
import com.applovin.sdk.AppLovinSdkUtils;
import com.applovin.sdk.AppLovinTargetingData;
import com.applovin.sdk.AppLovinUserSegment;
import com.picsart.studio.apiv3.model.parsers.ExplainJsonParser;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import myobfuscated.d4.g0;
import org.json.JSONException;
import org.json.JSONObject;
public class n {
    public static n aBr;
    private static final boolean aBt;
    private static volatile a aBu;
    protected static Context hr;
    private boolean aBB;
    private AppLovinSdkSettings aBC;
    private AppLovinUserSegment aBD;
    private AppLovinTargetingData aBE;
    private String aBF;
    private volatile AppLovinNativeAdService aBH;
    private volatile EventServiceImpl aBJ;
    private volatile UserServiceImpl aBL;
    private volatile CmpServiceImpl aBN;
    private volatile AppLovinSdk aBP;
    private volatile com.applovin.impl.sdk.e.q aBR;
    private volatile com.applovin.impl.sdk.c.c aBT;
    private volatile com.applovin.impl.sdk.network.b aBV;
    private volatile com.applovin.impl.sdk.d.d aBX;
    private volatile com.applovin.impl.sdk.d.g aBZ;
    private String aBw;
    private WeakReference<Activity> aBx;
    private long aBy;
    private long aBz;
    private volatile ae aCA;
    private volatile com.applovin.impl.sdk.network.d aCC;
    private volatile k aCE;
    private volatile com.applovin.impl.sdk.utils.p aCG;
    private volatile i aCI;
    private volatile com.applovin.impl.privacy.a.c aCK;
    private volatile com.applovin.impl.privacy.b.b aCM;
    private volatile com.applovin.impl.a.a.a aCO;
    private volatile com.applovin.impl.sdk.a.f aCQ;
    private volatile w aCS;
    private volatile ArrayService aCU;
    private volatile r aCW;
    private volatile com.applovin.impl.adview.l aCY;
    private volatile q aCb;
    private volatile o aCd;
    private volatile p aCf;
    private volatile Boolean aCh;
    private volatile aa aCi;
    private volatile com.applovin.impl.sdk.c.e aCk;
    private volatile m aCm;
    private volatile com.applovin.impl.sdk.utils.s aCo;
    private volatile d aCq;
    private volatile b aCs;
    private volatile t aCu;
    private volatile SessionTracker aCw;
    private volatile u aCy;
    private String aDI;
    private AppLovinSdk.SdkInitializationListener aDJ;
    private AppLovinSdk.SdkInitializationListener aDK;
    private AppLovinSdkConfiguration aDL;
    private volatile PostbackServiceImpl aDa;
    private volatile com.applovin.impl.sdk.network.f aDc;
    private volatile f aDe;
    private volatile com.applovin.impl.mediation.f aDg;
    private volatile com.applovin.impl.mediation.e aDi;
    private volatile MediationServiceImpl aDk;
    private volatile com.applovin.impl.mediation.a.d aDm;
    private volatile com.applovin.impl.mediation.h aDo;
    private volatile com.applovin.impl.mediation.debugger.b aDq;
    private volatile y aDs;
    private volatile com.applovin.impl.mediation.d aDu;
    private volatile com.applovin.impl.mediation.debugger.ui.testmode.c aDw;
    private List<MaxAdFormat> aDy;
    private volatile AppLovinAdServiceImpl age;
    private volatile x logger;
    private static final Object aBv = new Object();
    private static final long aBs = System.currentTimeMillis();
    private final AtomicBoolean aBA = new AtomicBoolean();
    private final Object aBG = new Object();
    private final Object aBI = new Object();
    private final Object aBK = new Object();
    private final Object aBM = new Object();
    private final Object aBO = new Object();
    private final Object aBQ = new Object();
    private final Object aBS = new Object();
    private final Object aBU = new Object();
    private final Object aBW = new Object();
    private final Object aBY = new Object();
    private final Object aCa = new Object();
    private final Object aCc = new Object();
    private final Object aCe = new Object();
    private final Object aCg = new Object();
    private final Object aCj = new Object();
    private final Object aCl = new Object();
    private final Object aCn = new Object();
    private final Object aCp = new Object();
    private final Object aCr = new Object();
    private final Object aCt = new Object();
    private final Object aCv = new Object();
    private final Object aCx = new Object();
    private final Object aCz = new Object();
    private final Object aCB = new Object();
    private final Object aCD = new Object();
    private final Object aCF = new Object();
    private final Object aCH = new Object();
    private final Object aCJ = new Object();
    private final Object aCL = new Object();
    private final Object aCN = new Object();
    private final Object aCP = new Object();
    private final Object aCR = new Object();
    private final Object aCT = new Object();
    private final Object aCV = new Object();
    private final Object aCX = new Object();
    private final Object aCZ = new Object();
    private final Object aDb = new Object();
    private final Object aDd = new Object();
    private final Object aDf = new Object();
    private final Object aDh = new Object();
    private final Object aDj = new Object();
    private final Object aDl = new Object();
    private final Object aDn = new Object();
    private final Object aDp = new Object();
    private final Object aDr = new Object();
    private final Object aDt = new Object();
    private final Object aDv = new Object();
    private final Object aDx = new Object();
    private final Object aDz = new Object();
    private final AtomicBoolean aDA = new AtomicBoolean(true);
    private final AtomicBoolean aDB = new AtomicBoolean();
    private boolean aDC = false;
    private boolean iV = false;
    private boolean aDD = false;
    private boolean aDE = false;
    private boolean aDF = false;
    private boolean aDG = false;
    private int aDH = 0;

    static {
        boolean z = false;
        try {
            AppLovinSdkUtils.runOnUiThread(new myobfuscated.g9.g(0));
            z = true;
        } catch (Throwable unused) {
        }
        aBt = z;
    }

    private void BF() {
        this.aCk = new com.applovin.impl.sdk.c.e(this);
        this.aBT = new com.applovin.impl.sdk.c.c(this);
        this.logger = new x(this);
        this.aCu = new t(this);
        this.aCq = new d(this);
        this.aCs = new b(this);
        this.aBJ = new EventServiceImpl(this);
        this.aBL = new UserServiceImpl(this);
        this.aBR = new com.applovin.impl.sdk.e.q(this);
        this.aBV = new com.applovin.impl.sdk.network.b(this);
        this.aBX = new com.applovin.impl.sdk.d.d(this);
        this.aBZ = new com.applovin.impl.sdk.d.g(this);
        this.aCQ = new com.applovin.impl.sdk.a.f(this);
        this.aCG = new com.applovin.impl.sdk.utils.p(this);
        if (((Boolean) a(com.applovin.impl.sdk.c.b.aPU)).booleanValue()) {
            this.aCb = new q(this);
            this.aCf = new p(this);
        } else {
            this.aCd = new o(this);
        }
        Dc();
        this.aCY = new com.applovin.impl.adview.l(this);
        this.age = new AppLovinAdServiceImpl(this);
        this.aBH = new AppLovinNativeAdService(this);
        this.aCw = new SessionTracker(this);
        this.aCy = new u(this);
        this.aCA = new ae(this);
        this.aDa = new PostbackServiceImpl(this);
        this.aDe = new f(this);
        this.aDg = new com.applovin.impl.mediation.f(this);
        this.aDi = new com.applovin.impl.mediation.e(this);
        this.aDk = new MediationServiceImpl(this);
        this.aDm = new com.applovin.impl.mediation.a.d(this);
        this.aDs = new y(this);
        this.aDq = new com.applovin.impl.mediation.debugger.b(this);
        this.aDo = new com.applovin.impl.mediation.h();
        this.aDu = new com.applovin.impl.mediation.d(this);
        this.aCm = new m(this);
        this.aCI = new i(this);
        this.aDw = new com.applovin.impl.mediation.debugger.ui.testmode.c(this);
        this.aCK = new com.applovin.impl.privacy.a.c(this);
        this.aCM = new com.applovin.impl.privacy.b.b(this);
        this.aCO = new com.applovin.impl.a.a.a(this);
        this.aCS = new w(this);
        this.aCU = new ArrayService(this);
        this.aCW = new r(this);
        this.aDc = new com.applovin.impl.sdk.network.f(this);
        this.aCE = new k(this);
        this.aCo = new com.applovin.impl.sdk.utils.s(this);
    }

    public void BG() {
        Context context = hr;
        x Ci = Ci();
        com.applovin.impl.sdk.c.e Ct = Ct();
        com.applovin.impl.sdk.e.q Cj = Cj();
        com.applovin.impl.privacy.a.c CG = CG();
        E(context);
        Cz();
        CR();
        CM();
        CT().a(MaxAdapter.InitializationStatus.INITIALIZING);
        if (this.aBC.isExceptionHandlerEnabled() && ((Boolean) a(com.applovin.impl.sdk.c.b.aLP)).booleanValue()) {
            AppLovinExceptionHandler.shared().addSdk(this);
            AppLovinExceptionHandler.shared().enable();
        }
        if (((Boolean) a(com.applovin.impl.sdk.c.b.aPA)).booleanValue()) {
            this.aCC = new com.applovin.impl.sdk.network.d(context);
        }
        if (TextUtils.isEmpty(this.aBw)) {
            x.I("AppLovinSdk", "Unable to find AppLovin SDK key. Please add  meta-data android:name=\"applovin.sdk.key\" android:value=\"YOUR_SDK_KEY_HERE\" into AndroidManifest.xml.");
            x.I("AppLovinSdk", "Called with an invalid SDK key from: " + Log.getStackTraceString(new Throwable("")));
        }
        if (this.aBw.length() != 86 && com.applovin.impl.sdk.utils.t.b(context, this)) {
            x.I("AppLovinSdk", "Please double-check that you entered your SDK key correctly (" + this.aBw + ") : " + Log.getStackTraceString(new Throwable("")));
        }
        if ("HSrCHRtOan6wp2kwOIGJC1RDtuSrF2mWVbio2aBcMHX9KF3iTJ1lLSzCKP1ZSo5yNolPNw1kCTtWpxELFF4ah1".equalsIgnoreCase(this.aBw)) {
            x.I("AppLovinSdk", "Cross Promo SDK has been deprecated and is no longer supported");
            if (com.applovin.impl.sdk.utils.t.b(context, this)) {
                throw new RuntimeException("Cross Promo SDK has been deprecated and is no longer supported");
            }
            return;
        }
        if (com.applovin.impl.sdk.utils.t.Mw()) {
            x.I("AppLovinSdk", "Failed to find class for name: com.applovin.sdk.AppLovinSdk. Please ensure proguard rules have not been omitted from the build.");
        }
        if (!com.applovin.impl.sdk.utils.t.R(this)) {
            x.I("AppLovinSdk", "Detected non-Android core JSON library. Please double-check that none of your third party libraries include custom implementation of org.json.JSONObject.");
        }
        if (com.applovin.impl.sdk.utils.t.ae(context)) {
            this.aBC.setVerboseLogging(true);
        }
        Ck().a(com.applovin.impl.sdk.c.b.aLC, Boolean.valueOf(this.aBC.isVerboseLoggingEnabled()));
        SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        com.applovin.impl.sdk.c.d<String> dVar = com.applovin.impl.sdk.c.d.aSU;
        if (TextUtils.isEmpty((String) Ct.b((com.applovin.impl.sdk.c.d<com.applovin.impl.sdk.c.d<String>>) dVar, (com.applovin.impl.sdk.c.d<String>) null, defaultSharedPreferences))) {
            this.aDD = true;
            Ct.a((com.applovin.impl.sdk.c.d<com.applovin.impl.sdk.c.d<String>>) dVar, (com.applovin.impl.sdk.c.d<String>) Boolean.toString(true), defaultSharedPreferences);
        } else {
            Ct.a((com.applovin.impl.sdk.c.d<com.applovin.impl.sdk.c.d<String>>) dVar, (com.applovin.impl.sdk.c.d<String>) Boolean.toString(false), defaultSharedPreferences);
        }
        com.applovin.impl.sdk.c.d<Boolean> dVar2 = com.applovin.impl.sdk.c.d.aSV;
        if (((Boolean) Ct.b(dVar2, Boolean.FALSE)).booleanValue()) {
            if (x.FL()) {
                Ci.f("AppLovinSdk", "Initializing SDK for non-maiden launch");
            }
            this.aDE = true;
        } else {
            if (x.FL()) {
                Ci.f("AppLovinSdk", "Initializing SDK for maiden launch");
            }
            Ct.a(dVar2, Boolean.TRUE);
            Ct.a(com.applovin.impl.sdk.c.d.aTg, Boolean.valueOf(CG.isEnabled()));
        }
        com.applovin.impl.sdk.c.d<String> dVar3 = com.applovin.impl.sdk.c.d.aSW;
        String str = (String) Ct.b(dVar3, null);
        if (StringUtils.isValidString(str)) {
            if (AppLovinSdk.VERSION_CODE > com.applovin.impl.sdk.utils.t.dO(str)) {
                Ct.a(dVar3, AppLovinSdk.VERSION);
            }
        } else {
            Ct.a(dVar3, AppLovinSdk.VERSION);
        }
        boolean aa = com.applovin.impl.sdk.utils.i.aa(getApplicationContext());
        int parseInt = StringUtils.parseInt(this.aBC.getExtraParameters().get(AppLovinSdkExtraParameterKey.INITIALIZATION_DELAY_MILLIS), ((Integer) a(com.applovin.impl.sdk.c.b.aQG)).intValue());
        com.applovin.impl.sdk.e.ab abVar = new com.applovin.impl.sdk.e.ab(this, true, "scheduleAdLoadIntegrationError", new myobfuscated.w1.o(this, 13));
        q.a aVar = q.a.CORE;
        long j = parseInt;
        Cj.a(abVar, aVar, j);
        Cj.a(new com.applovin.impl.sdk.e.ab(this, true, "sdkInit", new myobfuscated.d4.a(this, aa, Ci, CG)), aVar, j);
    }

    private void BJ() {
        com.applovin.impl.sdk.e.q Cj = Cj();
        int i = this.aDH + 1;
        this.aDH = i;
        Cj.a((com.applovin.impl.sdk.e.d) new com.applovin.impl.sdk.e.l(i, this, new l.a() {
            {
                n.this = this;
            }

            @Override
            public void H(JSONObject jSONObject) {
                boolean z = jSONObject != null && jSONObject.length() > 0;
                n.this.E(jSONObject);
                g.o(n.this);
                com.applovin.impl.sdk.utils.i.a(jSONObject, z, n.this);
                n.this.CX().h(JsonUtils.getBoolean(jSONObject, "smd", Boolean.FALSE).booleanValue(), JsonUtils.getInt(jSONObject, "smd_delay_sec", 2));
                n nVar = n.this;
                nVar.aDy = nVar.G(jSONObject);
                if (z) {
                    List<String> explode = CollectionUtils.explode(JsonUtils.getString(jSONObject, "eaaui", ""));
                    n nVar2 = n.this;
                    nVar2.aDL = new SdkConfigurationImpl(explode, nVar2);
                }
                n.this.Da().f(jSONObject);
                n.this.F(jSONObject);
                com.applovin.impl.sdk.utils.l.bl(((Boolean) n.this.a(com.applovin.impl.sdk.c.b.aSv)).booleanValue());
                com.applovin.impl.sdk.utils.l.bm(((Boolean) n.this.a(com.applovin.impl.sdk.c.b.aSw)).booleanValue());
                if (!n.this.BM()) {
                    n.this.cA("Initializing SDK in non-MAX environment...");
                } else if (n.this.CG().Ap() == d.a.UNIFIED) {
                    Activity Db = n.this.Db();
                    if (n.this.aDB.compareAndSet(false, true)) {
                        n.this.CG().As();
                        n.this.CG().a(Db, new c.b() {
                            {
                                AnonymousClass2.this = this;
                            }

                            @Override
                            public void onFlowCompleted(c.a aVar) {
                                n.this.Ci();
                                if (x.FL()) {
                                    x Ci = n.this.Ci();
                                    Ci.f("AppLovinSdk", "Unified flow completed with status: " + aVar);
                                }
                                if (!aVar.Au()) {
                                    n.this.cA("Initializing SDK in MAX environment...");
                                    return;
                                }
                                n.this.Ci();
                                if (x.FL()) {
                                    n.this.Ci().f("AppLovinSdk", "Re-initializing SDK with the updated privacy settings...");
                                }
                                n.this.BI();
                                n.this.BP();
                            }
                        });
                    } else {
                        n.this.cA("Initializing SDK in MAX environment...");
                    }
                } else {
                    n.this.cA("Initializing SDK in MAX environment...");
                }
                if (!((Boolean) n.this.a(com.applovin.impl.sdk.c.b.aPA)).booleanValue() || z || !com.applovin.impl.sdk.utils.i.aa(n.getApplicationContext())) {
                    n.this.BK();
                    return;
                }
                n.this.Ci();
                if (x.FL()) {
                    n.this.Ci().g("AppLovinSdk", "SDK initialized with no internet connection - listening for connection");
                }
                n.this.BR();
            }
        }), q.a.CORE);
    }

    public void BK() {
        Long l = (Long) a(com.applovin.impl.sdk.c.b.aPJ);
        if (l.longValue() >= 0 && this.aBA.compareAndSet(false, true)) {
            com.applovin.impl.sdk.utils.v.a(l.longValue(), false, this, new myobfuscated.e.i(this, 16));
        }
    }

    public void BR() {
        final com.applovin.impl.sdk.network.d G = G(hr);
        G.a(new d.a() {
            {
                n.this = this;
            }

            @Override
            public void Dm() {
                n.this.Ci();
                if (x.FL()) {
                    n.this.Ci().g("AppLovinSdk", "Connected to internet - re-initializing SDK");
                }
                synchronized (n.this.aDz) {
                    try {
                        if (!n.this.aDC) {
                            n.this.BI();
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
                G.b(this);
            }

            @Override
            public void Dn() {
            }
        });
    }

    private Map<String, String> Ce() {
        try {
            return JsonUtils.toStringMap(new JSONObject((String) a(com.applovin.impl.sdk.c.b.aQH)));
        } catch (JSONException unused) {
            return Collections.emptyMap();
        }
    }

    private boolean Cp() {
        if (this.aCh == null) {
            this.aCh = (Boolean) a(com.applovin.impl.sdk.c.b.aPU);
        }
        return Boolean.TRUE.equals(this.aCh);
    }

    private void Dc() {
        if (!aa.N(hr) || this.aDG) {
            return;
        }
        try {
            this.aCi = new aa(this);
        } catch (Throwable th) {
            x.f("AppLovinSdk", "Failed to initialize Privacy Sandbox Service", th);
            this.aDG = true;
        }
    }

    public static long Dd() {
        return aBs;
    }

    public static boolean De() {
        return aBt;
    }

    public void Di() {
        b(com.applovin.impl.sdk.c.d.aTA);
    }

    public void Dj() {
        com.applovin.impl.sdk.e.q Cj = Cj();
        int i = this.aDH + 1;
        this.aDH = i;
        Cj.a((com.applovin.impl.sdk.e.d) new com.applovin.impl.sdk.e.l(i, this, new l.a() {
            {
                n.this = this;
            }

            @Override
            public void H(JSONObject jSONObject) {
                if (jSONObject != null && jSONObject.length() > 0) {
                    n.this.E(jSONObject);
                }
                n.this.aBA.set(false);
                n.this.BK();
            }
        }), q.a.CORE);
    }

    public void Dk() {
        if (Cj().isInitialized()) {
            return;
        }
        Ci();
        if (x.FL()) {
            Ci().f("AppLovinSdk", "Timing out adapters init...");
        }
        Cj().LF();
        BQ();
    }

    public void Dl() {
        if (BM()) {
            v.w(this);
        }
    }

    public static a E(Context context) {
        if (aBu == null) {
            synchronized (aBv) {
                try {
                    if (aBu == null) {
                        aBu = new a(context);
                    }
                } finally {
                }
            }
        }
        return aBu;
    }

    public void E(JSONObject jSONObject) {
        this.aBz = System.currentTimeMillis();
        com.applovin.impl.sdk.utils.i.j(jSONObject, this);
        com.applovin.impl.sdk.utils.i.i(jSONObject, this);
        com.applovin.impl.sdk.utils.i.k(jSONObject, this);
        com.applovin.impl.mediation.e.b.d(jSONObject, this);
        com.applovin.impl.mediation.e.b.e(jSONObject, this);
        com.applovin.impl.mediation.e.b.f(jSONObject, this);
        com.applovin.impl.mediation.e.b.A(jSONObject);
    }

    public static void F(Context context) {
        if (context == null) {
            return;
        }
        hr = context.getApplicationContext();
    }

    public void F(JSONObject jSONObject) {
        for (String str : JsonUtils.getList(jSONObject, "error_messages", Collections.emptyList())) {
            x.I("AppLovinSdk", str);
        }
    }

    public List<MaxAdFormat> G(JSONObject jSONObject) {
        List<String> asList = Arrays.asList(JsonUtils.getString(jSONObject, "eaf", "").split(","));
        ArrayList arrayList = new ArrayList(asList.size());
        for (String str : asList) {
            MaxAdFormat formatFromString = MaxAdFormat.formatFromString(str);
            if (formatFromString != null) {
                arrayList.add(formatFromString);
            }
        }
        return arrayList;
    }

    public void a(AppLovinSdk.SdkInitializationListener sdkInitializationListener) {
        Ci();
        if (x.FL()) {
            Ci().f("AppLovinSdk", "Calling back publisher's initialization completion handler...");
        }
        sdkInitializationListener.onSdkInitialized(this.aDL);
    }

    public void a(boolean z, x xVar, com.applovin.impl.privacy.a.c cVar) {
        synchronized (this.aDz) {
            try {
                if (!((Boolean) a(com.applovin.impl.sdk.c.b.aPB)).booleanValue() || z) {
                    BI();
                }
                if (((Boolean) a(com.applovin.impl.sdk.c.b.aPA)).booleanValue() && !z) {
                    if (x.FL()) {
                        xVar.g("AppLovinSdk", "SDK initialized with no internet connection - listening for connection");
                    }
                    BR();
                }
                if (cVar.Ap() == d.a.TERMS) {
                    if (BM()) {
                        if (x.FL()) {
                            xVar.f("AppLovinSdk", "MAX mediation detected... Generating consent flow...");
                        }
                        cVar.As();
                        cVar.a(Db(), new c.b() {
                            {
                                n.this = this;
                            }

                            @Override
                            public void onFlowCompleted(c.a aVar) {
                            }
                        });
                    } else if (x.FL()) {
                        xVar.f("AppLovinSdk", "non-MAX mediation detected, mediation provider is: " + this.aBF);
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public static String b(String str, List<String> list) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        Context applicationContext = getApplicationContext();
        return c(applicationContext.getResources().getIdentifier(str, "string", applicationContext.getPackageName()), list);
    }

    public void b(AppLovinSdk.SdkInitializationListener sdkInitializationListener) {
        sdkInitializationListener.onSdkInitialized(this.aDL);
    }

    public static String c(int i, List<String> list) {
        String string = getApplicationContext().getResources().getString(i);
        return list != null ? String.format(string, list.toArray()) : string;
    }

    public static void c(n nVar) {
        nVar.BG();
    }

    public void cA(String str) {
        Ci();
        if (x.FL()) {
            Ci().f("AppLovinSdk", str);
        }
        Cj().b(new com.applovin.impl.sdk.e.p(this));
    }

    public void cC(String str) {
        Cv().cB(str);
    }

    public void cD(String str) {
        Ck().a(com.applovin.impl.sdk.c.b.aQj, str);
    }

    public static String cm(String str) {
        return b(str, (List<String>) null);
    }

    public static String gA(int i) {
        return c(i, (List<String>) null);
    }

    public static Context getApplicationContext() {
        return hr;
    }

    public static void i(n nVar, AppLovinSdk.SdkInitializationListener sdkInitializationListener) {
        nVar.b(sdkInitializationListener);
    }

    public void BH() {
        synchronized (this.aDz) {
            try {
                if (!this.aDC && !this.iV) {
                    BI();
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public void BI() {
        synchronized (this.aDz) {
            this.aDC = true;
            Cj().LE();
            BJ();
        }
    }

    public boolean BL() {
        boolean z;
        synchronized (this.aDz) {
            z = this.aDC;
        }
        return z;
    }

    public boolean BM() {
        return StringUtils.containsIgnoreCase(getMediationProvider(), "max");
    }

    public boolean BN() {
        return com.applovin.impl.sdk.utils.t.dM("com.unity3d.player.UnityPlayerActivity");
    }

    public void BO() {
        String str = (String) Ct().b(com.applovin.impl.sdk.c.d.aSW, null);
        if (StringUtils.isValidString(str)) {
            if (AppLovinSdk.VERSION_CODE < com.applovin.impl.sdk.utils.t.dO(str)) {
                x.I("AppLovinSdk", defpackage.a.m(new StringBuilder("Current version ("), AppLovinSdk.VERSION, ") is older than earlier installed version (", str, "), which may cause compatibility issues."));
            }
        }
    }

    public void BP() {
        CC().Bz();
    }

    public void BQ() {
        AppLovinSdk.SdkInitializationListener sdkInitializationListener;
        if ((CG().Aq() && CG().Ap() == d.a.UNIFIED) || (sdkInitializationListener = this.aDJ) == null) {
            return;
        }
        if (isEnabled()) {
            this.aDJ = null;
            this.aDK = null;
            CT().a(MaxAdapter.InitializationStatus.INITIALIZED_SUCCESS);
        } else if (this.aDK == sdkInitializationListener) {
            return;
        } else {
            CT().a(MaxAdapter.InitializationStatus.INITIALIZED_FAILURE);
            if (((Boolean) a(com.applovin.impl.sdk.c.b.aLM)).booleanValue()) {
                this.aDJ = null;
            } else {
                this.aDK = sdkInitializationListener;
            }
        }
        AppLovinSdkUtils.runOnUiThreadDelayed(new g0(10, this, sdkInitializationListener), Math.max(0L, ((Long) a(com.applovin.impl.sdk.c.b.aLN)).longValue()));
    }

    public void BS() {
        x.I("AppLovinSdk", "Resetting SDK state...");
        com.applovin.impl.sdk.d.d Cm = Cm();
        com.applovin.impl.sdk.d.c cVar = com.applovin.impl.sdk.d.c.aUf;
        long b = Cm.b(cVar);
        Ck().KG();
        Ck().KE();
        Cm().KO();
        Cm().b(cVar, b + 1);
        if (this.aDA.compareAndSet(true, false)) {
            BI();
        } else {
            this.aDA.set(true);
        }
    }

    public long BT() {
        if (this.aBz == 0) {
            return -1L;
        }
        return System.currentTimeMillis() - this.aBz;
    }

    public String BU() {
        return Cv().BU();
    }

    public String BV() {
        return Cv().BV();
    }

    public String BW() {
        return Cv().Mo();
    }

    public AppLovinTargetingDataImpl BX() {
        return (AppLovinTargetingDataImpl) this.aBE;
    }

    public AppLovinAdServiceImpl BY() {
        if (this.age == null) {
            synchronized (this.aBG) {
                try {
                    if (this.age == null) {
                        this.age = new AppLovinAdServiceImpl(this);
                    }
                } finally {
                }
            }
        }
        return this.age;
    }

    public AppLovinNativeAdService BZ() {
        if (this.aBH == null) {
            synchronized (this.aBI) {
                try {
                    if (this.aBH == null) {
                        this.aBH = new AppLovinNativeAdService(this);
                    }
                } finally {
                }
            }
        }
        return this.aBH;
    }

    public u CA() {
        if (this.aCy == null) {
            synchronized (this.aCz) {
                try {
                    if (this.aCy == null) {
                        this.aCy = new u(this);
                    }
                } finally {
                }
            }
        }
        return this.aCy;
    }

    public ae CB() {
        if (this.aCA == null) {
            synchronized (this.aCB) {
                try {
                    if (this.aCA == null) {
                        this.aCA = new ae(this);
                    }
                } finally {
                }
            }
        }
        return this.aCA;
    }

    public k CC() {
        if (this.aCE == null) {
            synchronized (this.aCF) {
                try {
                    if (this.aCE == null) {
                        this.aCE = new k(this);
                    }
                } finally {
                }
            }
        }
        return this.aCE;
    }

    public com.applovin.impl.sdk.utils.p CD() {
        if (this.aCG == null) {
            synchronized (this.aCH) {
                try {
                    if (this.aCG == null) {
                        this.aCG = new com.applovin.impl.sdk.utils.p(this);
                    }
                } finally {
                }
            }
        }
        return this.aCG;
    }

    public i CE() {
        if (this.aCI == null) {
            synchronized (this.aCJ) {
                try {
                    if (this.aCI == null) {
                        this.aCI = new i(this);
                    }
                } finally {
                }
            }
        }
        return this.aCI;
    }

    public AppLovinSdkSettings.TermsAndPrivacyPolicyFlowSettings CF() {
        return getSettings().getBackingConsentFlowSettings();
    }

    public com.applovin.impl.privacy.a.c CG() {
        if (this.aCK == null) {
            synchronized (this.aCL) {
                try {
                    if (this.aCK == null) {
                        this.aCK = new com.applovin.impl.privacy.a.c(this);
                    }
                } finally {
                }
            }
        }
        return this.aCK;
    }

    public com.applovin.impl.privacy.b.b CH() {
        if (this.aCM == null) {
            synchronized (this.aCN) {
                try {
                    if (this.aCM == null) {
                        this.aCM = new com.applovin.impl.privacy.b.b(this);
                    }
                } finally {
                }
            }
        }
        return this.aCM;
    }

    public CmpServiceImpl CI() {
        if (this.aBN == null) {
            synchronized (this.aBO) {
                try {
                    if (this.aBN == null) {
                        this.aBN = new CmpServiceImpl(this);
                    }
                } finally {
                }
            }
        }
        return this.aBN;
    }

    public com.applovin.impl.a.a.a CJ() {
        if (this.aCO == null) {
            synchronized (this.aCP) {
                try {
                    if (this.aCO == null) {
                        this.aCO = new com.applovin.impl.a.a.a(this);
                    }
                } finally {
                }
            }
        }
        return this.aCO;
    }

    public com.applovin.impl.sdk.a.f CK() {
        if (this.aCQ == null) {
            synchronized (this.aCR) {
                try {
                    if (this.aCQ == null) {
                        this.aCQ = new com.applovin.impl.sdk.a.f(this);
                    }
                } finally {
                }
            }
        }
        return this.aCQ;
    }

    public w CL() {
        if (this.aCS == null) {
            synchronized (this.aCT) {
                try {
                    if (this.aCS == null) {
                        this.aCS = new w(this);
                    }
                } finally {
                }
            }
        }
        return this.aCS;
    }

    public ArrayService CM() {
        if (this.aCU == null) {
            synchronized (this.aCV) {
                try {
                    if (this.aCU == null) {
                        this.aCU = new ArrayService(this);
                    }
                } finally {
                }
            }
        }
        return this.aCU;
    }

    public r CN() {
        if (this.aCW == null) {
            synchronized (this.aCX) {
                try {
                    if (this.aCW == null) {
                        this.aCW = new r(this);
                    }
                } finally {
                }
            }
        }
        return this.aCW;
    }

    public com.applovin.impl.adview.l CO() {
        if (this.aCY == null) {
            synchronized (this.aCZ) {
                try {
                    if (this.aCY == null) {
                        this.aCY = new com.applovin.impl.adview.l(this);
                    }
                } finally {
                }
            }
        }
        return this.aCY;
    }

    public PostbackServiceImpl CP() {
        if (this.aDa == null) {
            synchronized (this.aDb) {
                try {
                    if (this.aDa == null) {
                        this.aDa = new PostbackServiceImpl(this);
                    }
                } finally {
                }
            }
        }
        return this.aDa;
    }

    public com.applovin.impl.sdk.network.f CQ() {
        if (this.aDc == null) {
            synchronized (this.aDd) {
                try {
                    if (this.aDc == null) {
                        this.aDc = new com.applovin.impl.sdk.network.f(this);
                    }
                } finally {
                }
            }
        }
        return this.aDc;
    }

    public f CR() {
        if (this.aDe == null) {
            synchronized (this.aDf) {
                try {
                    if (this.aDe == null) {
                        this.aDe = new f(this);
                    }
                } finally {
                }
            }
        }
        return this.aDe;
    }

    public com.applovin.impl.mediation.f CS() {
        if (this.aDg == null) {
            synchronized (this.aDh) {
                try {
                    if (this.aDg == null) {
                        this.aDg = new com.applovin.impl.mediation.f(this);
                    }
                } finally {
                }
            }
        }
        return this.aDg;
    }

    public com.applovin.impl.mediation.e CT() {
        if (this.aDi == null) {
            synchronized (this.aDj) {
                try {
                    if (this.aDi == null) {
                        this.aDi = new com.applovin.impl.mediation.e(this);
                    }
                } finally {
                }
            }
        }
        return this.aDi;
    }

    public MediationServiceImpl CU() {
        if (this.aDk == null) {
            synchronized (this.aDl) {
                try {
                    if (this.aDk == null) {
                        this.aDk = new MediationServiceImpl(this);
                    }
                } finally {
                }
            }
        }
        return this.aDk;
    }

    public com.applovin.impl.mediation.a.d CV() {
        if (this.aDm == null) {
            synchronized (this.aDn) {
                try {
                    if (this.aDm == null) {
                        this.aDm = new com.applovin.impl.mediation.a.d(this);
                    }
                } finally {
                }
            }
        }
        return this.aDm;
    }

    public com.applovin.impl.mediation.h CW() {
        if (this.aDo == null) {
            synchronized (this.aDp) {
                try {
                    if (this.aDo == null) {
                        this.aDo = new com.applovin.impl.mediation.h();
                    }
                } finally {
                }
            }
        }
        return this.aDo;
    }

    public com.applovin.impl.mediation.debugger.b CX() {
        if (this.aDq == null) {
            synchronized (this.aDr) {
                try {
                    if (this.aDq == null) {
                        this.aDq = new com.applovin.impl.mediation.debugger.b(this);
                    }
                } finally {
                }
            }
        }
        return this.aDq;
    }

    public y CY() {
        if (this.aDs == null) {
            synchronized (this.aDt) {
                try {
                    if (this.aDs == null) {
                        this.aDs = new y(this);
                    }
                } finally {
                }
            }
        }
        return this.aDs;
    }

    public com.applovin.impl.mediation.d CZ() {
        if (this.aDu == null) {
            synchronized (this.aDv) {
                try {
                    if (this.aDu == null) {
                        this.aDu = new com.applovin.impl.mediation.d(this);
                    }
                } finally {
                }
            }
        }
        return this.aDu;
    }

    public EventServiceImpl Ca() {
        if (this.aBJ == null) {
            synchronized (this.aBK) {
                try {
                    if (this.aBJ == null) {
                        this.aBJ = new EventServiceImpl(this);
                    }
                } finally {
                }
            }
        }
        return this.aBJ;
    }

    public UserServiceImpl Cb() {
        if (this.aBL == null) {
            synchronized (this.aBM) {
                try {
                    if (this.aBL == null) {
                        this.aBL = new UserServiceImpl(this);
                    }
                } finally {
                }
            }
        }
        return this.aBL;
    }

    public void Cc() {
        if (StringUtils.isValidString(this.aDI)) {
            return;
        }
        this.aDI = "max";
        Ci();
        if (x.FL()) {
            Ci().f("AppLovinSdk", "Detected mediation provider: MAX");
        }
    }

    public String Cd() {
        if (StringUtils.isValidString(this.aDI)) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        Map<String, String> Ce = Ce();
        List<String> b = b(com.applovin.impl.sdk.c.b.aQJ);
        Boolean bool = (Boolean) a(com.applovin.impl.sdk.c.b.aQK);
        if (!Ce.isEmpty() || bool.booleanValue()) {
            try {
                StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
                Integer num = (Integer) a(com.applovin.impl.sdk.c.b.aQI);
                for (StackTraceElement stackTraceElement : stackTrace) {
                    if (num.intValue() <= 0) {
                        break;
                    }
                    String className = stackTraceElement.getClassName();
                    Iterator<String> it = b.iterator();
                    while (true) {
                        if (it.hasNext()) {
                            if (className.startsWith(it.next())) {
                                break;
                            }
                        } else {
                            break;
                        }
                    }
                }
            } catch (Throwable th) {
                CN().d("AppLovinSdk", "detectMediationProvider", th);
            }
            this.aDI = "unknown";
            Ci();
            if (x.FL()) {
                Ci().h("AppLovinSdk", "Unable to detect mediation provider");
            }
            if (arrayList.isEmpty()) {
                return null;
            }
            String join = StringUtils.join(",", arrayList);
            if (((Boolean) a(com.applovin.impl.sdk.c.b.aQL)).booleanValue()) {
                CN().a(r.a.GENERIC, "detectMediationProvider", (Map<String, String>) CollectionUtils.hashMap(ExplainJsonParser.DETAILS, join));
                return null;
            }
            return join;
        }
        return null;
    }

    public Activity Cf() {
        WeakReference<Activity> weakReference = this.aBx;
        if (weakReference != null) {
            return weakReference.get();
        }
        return null;
    }

    public boolean Cg() {
        return this.aDE;
    }

    public a Ch() {
        return E(hr);
    }

    public x Ci() {
        if (this.logger == null) {
            synchronized (this.aBQ) {
                try {
                    if (this.logger == null) {
                        this.logger = new x(this);
                    }
                } finally {
                }
            }
        }
        return this.logger;
    }

    public com.applovin.impl.sdk.e.q Cj() {
        if (this.aBR == null) {
            synchronized (this.aBS) {
                try {
                    if (this.aBR == null) {
                        this.aBR = new com.applovin.impl.sdk.e.q(this);
                    }
                } finally {
                }
            }
        }
        return this.aBR;
    }

    public com.applovin.impl.sdk.c.c Ck() {
        if (this.aBT == null) {
            synchronized (this.aBU) {
                try {
                    if (this.aBT == null) {
                        this.aBT = new com.applovin.impl.sdk.c.c(this);
                    }
                } finally {
                }
            }
        }
        return this.aBT;
    }

    public com.applovin.impl.sdk.network.b Cl() {
        if (this.aBV == null) {
            synchronized (this.aBW) {
                try {
                    if (this.aBV == null) {
                        this.aBV = new com.applovin.impl.sdk.network.b(this);
                    }
                } finally {
                }
            }
        }
        return this.aBV;
    }

    public com.applovin.impl.sdk.d.d Cm() {
        if (this.aBX == null) {
            synchronized (this.aBY) {
                try {
                    if (this.aBX == null) {
                        this.aBX = new com.applovin.impl.sdk.d.d(this);
                    }
                } finally {
                }
            }
        }
        return this.aBX;
    }

    public com.applovin.impl.sdk.d.g Cn() {
        if (this.aBZ == null) {
            synchronized (this.aCa) {
                try {
                    if (this.aBZ == null) {
                        this.aBZ = new com.applovin.impl.sdk.d.g(this);
                    }
                } finally {
                }
            }
        }
        return this.aBZ;
    }

    public o Co() {
        if (this.aCd == null) {
            synchronized (this.aCe) {
                try {
                    if (this.aCd == null) {
                        this.aCd = new o(this);
                    }
                } finally {
                }
            }
        }
        return this.aCd;
    }

    public q Cq() {
        if (Cp() && this.aCb == null) {
            synchronized (this.aCc) {
                try {
                    if (this.aCb == null) {
                        this.aCb = new q(this);
                    }
                } finally {
                }
            }
        }
        return this.aCb;
    }

    public p Cr() {
        if (Cp() && this.aCf == null) {
            synchronized (this.aCg) {
                try {
                    if (this.aCf == null) {
                        this.aCf = new p(this);
                    }
                } finally {
                }
            }
        }
        return this.aCf;
    }

    public aa Cs() {
        if (this.aCi == null) {
            synchronized (this.aCj) {
                try {
                    if (this.aCi == null) {
                        Dc();
                    }
                } finally {
                }
            }
        }
        return this.aCi;
    }

    public com.applovin.impl.sdk.c.e Ct() {
        if (this.aCk == null) {
            synchronized (this.aCl) {
                try {
                    if (this.aCk == null) {
                        this.aCk = new com.applovin.impl.sdk.c.e(this);
                    }
                } finally {
                }
            }
        }
        return this.aCk;
    }

    public m Cu() {
        if (this.aCm == null) {
            synchronized (this.aCn) {
                try {
                    if (this.aCm == null) {
                        this.aCm = new m(this);
                    }
                } finally {
                }
            }
        }
        return this.aCm;
    }

    public com.applovin.impl.sdk.utils.s Cv() {
        if (this.aCo == null) {
            synchronized (this.aCp) {
                try {
                    if (this.aCo == null) {
                        this.aCo = new com.applovin.impl.sdk.utils.s(this);
                    }
                } finally {
                }
            }
        }
        return this.aCo;
    }

    public d Cw() {
        if (this.aCq == null) {
            synchronized (this.aCr) {
                try {
                    if (this.aCq == null) {
                        this.aCq = new d(this);
                    }
                } finally {
                }
            }
        }
        return this.aCq;
    }

    public b Cx() {
        if (this.aCs == null) {
            synchronized (this.aCt) {
                try {
                    if (this.aCs == null) {
                        this.aCs = new b(this);
                    }
                } finally {
                }
            }
        }
        return this.aCs;
    }

    public t Cy() {
        if (this.aCu == null) {
            synchronized (this.aCv) {
                try {
                    if (this.aCu == null) {
                        this.aCu = new t(this);
                    }
                } finally {
                }
            }
        }
        return this.aCu;
    }

    public SessionTracker Cz() {
        if (this.aCw == null) {
            synchronized (this.aCx) {
                try {
                    if (this.aCw == null) {
                        this.aCw = new SessionTracker(this);
                    }
                } finally {
                }
            }
        }
        return this.aCw;
    }

    public com.applovin.impl.mediation.debugger.ui.testmode.c Da() {
        if (this.aDw == null) {
            synchronized (this.aDx) {
                try {
                    if (this.aDw == null) {
                        this.aDw = new com.applovin.impl.mediation.debugger.ui.testmode.c(this);
                    }
                } finally {
                }
            }
        }
        return this.aDw;
    }

    public Activity Db() {
        Activity AU = E(getApplicationContext()).AU();
        return AU != null ? AU : Cf();
    }

    public long Df() {
        return this.aBy;
    }

    public boolean Dg() {
        return this.aDD;
    }

    public String Dh() {
        return this.aDI;
    }

    public com.applovin.impl.sdk.network.d G(Context context) {
        if (this.aCC == null) {
            synchronized (this.aCD) {
                try {
                    if (this.aCC == null) {
                        this.aCC = new com.applovin.impl.sdk.network.d(context);
                    }
                } finally {
                }
            }
        }
        return this.aCC;
    }

    public <T> T a(com.applovin.impl.sdk.c.b<T> bVar) {
        return (T) Ck().a(bVar);
    }

    public <T> T a(com.applovin.impl.sdk.c.d<T> dVar) {
        return (T) b((com.applovin.impl.sdk.c.d<com.applovin.impl.sdk.c.d<T>>) dVar, (com.applovin.impl.sdk.c.d<T>) null);
    }

    public <T> T a(String str, T t, Class<?> cls, SharedPreferences sharedPreferences) {
        return (T) com.applovin.impl.sdk.c.e.a(str, t, cls, sharedPreferences);
    }

    public void a(SharedPreferences sharedPreferences) {
        Ct().a(sharedPreferences);
    }

    public <T> void a(com.applovin.impl.sdk.c.d<T> dVar, T t) {
        Ct().a(dVar, t);
    }

    public <T> void a(com.applovin.impl.sdk.c.d<T> dVar, T t, SharedPreferences sharedPreferences) {
        Ct().a((com.applovin.impl.sdk.c.d<com.applovin.impl.sdk.c.d<T>>) dVar, (com.applovin.impl.sdk.c.d<T>) t, sharedPreferences);
    }

    public void a(AppLovinSdk appLovinSdk) {
        this.aBP = appLovinSdk;
    }

    public void a(String str, AppLovinSdkSettings appLovinSdkSettings, Context context) {
        this.aBw = str;
        this.aBy = System.currentTimeMillis();
        this.aDC = true;
        this.aBC = appLovinSdkSettings;
        this.aBD = new h();
        this.aBE = new AppLovinTargetingDataImpl();
        this.aDL = new SdkConfigurationImpl(null, this);
        hr = context.getApplicationContext();
        if (!De()) {
            throw new RuntimeException("As of version 12.0.0, the AppLovin MAX SDK requires Java 8. For more information visit our docs: https://dash.applovin.com/documentation/mediation/android/getting-started/integration");
        }
        if (context instanceof Activity) {
            this.aBx = new WeakReference<>((Activity) context);
        }
        if (aBr == null) {
            aBr = this;
        } else {
            x.I("AppLovinSdk", "Multiple SDK instances detected");
        }
        StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
        SharedPreferences sharedPreferences = context.getSharedPreferences("com.applovin.sdk.1", 0);
        boolean z = sharedPreferences.getBoolean("com.applovin.sdk." + com.applovin.impl.sdk.utils.t.dL(str) + ".lisvib", false);
        this.aBB = z;
        if (z) {
            com.applovin.impl.sdk.utils.t.i(new myobfuscated.q3.f(this, 14));
        } else {
            BF();
            BG();
        }
        StrictMode.setThreadPolicy(allowThreadDiskReads);
    }

    public <T> void a(String str, T t, SharedPreferences.Editor editor) {
        Ct().a(str, (String) t, editor);
    }

    public boolean a(com.applovin.impl.sdk.c.b<String> bVar, MaxAdFormat maxAdFormat) {
        return c(bVar).contains(maxAdFormat);
    }

    public void aL(boolean z) {
        synchronized (this.aDz) {
            this.aDC = false;
            this.iV = z;
        }
        if (z) {
            List<String> b = b(com.applovin.impl.sdk.c.a.aKg);
            if (b.isEmpty()) {
                Cj().LF();
                BQ();
                return;
            }
            Long l = (Long) a(com.applovin.impl.sdk.c.a.aKh);
            com.applovin.impl.sdk.e.ab abVar = new com.applovin.impl.sdk.e.ab(this, true, "timeoutInitAdapters", new myobfuscated.g9.e(2, this));
            Ci();
            if (x.FL()) {
                x Ci = Ci();
                Ci.f("AppLovinSdk", "Waiting for required adapters to init: " + b + " - timing out in " + l + "ms...");
            }
            Cj().a(abVar, q.a.TIMEOUT, l.longValue(), true);
        }
    }

    public <T> T b(com.applovin.impl.sdk.c.d<T> dVar, T t) {
        return (T) Ct().b(dVar, t);
    }

    public <T> T b(com.applovin.impl.sdk.c.d<T> dVar, T t, SharedPreferences sharedPreferences) {
        return (T) Ct().b((com.applovin.impl.sdk.c.d<com.applovin.impl.sdk.c.d<T>>) dVar, (com.applovin.impl.sdk.c.d<T>) t, sharedPreferences);
    }

    public List<String> b(com.applovin.impl.sdk.c.b<String> bVar) {
        return Ck().b(bVar);
    }

    public <T> void b(com.applovin.impl.sdk.c.d<T> dVar) {
        Ct().b(dVar);
    }

    public void bN(long j) {
        Cu().bL(j);
    }

    public List<MaxAdFormat> c(com.applovin.impl.sdk.c.b<String> bVar) {
        return Ck().c(bVar);
    }

    public void cB(String str) {
        Ci();
        if (x.FL()) {
            com.appsflyer.internal.c.A("Setting user id: ", str, Ci(), "AppLovinSdk");
        }
        if (StringUtils.isValidString(str) && str.length() > com.applovin.impl.sdk.utils.t.gY(8)) {
            x.I("AppLovinSdk", "Provided user id longer than supported (" + str.length() + " bytes, " + com.applovin.impl.sdk.utils.t.gY(8) + " maximum)");
        }
        if (com.applovin.impl.sdk.utils.t.Mq() && this.aBB) {
            com.applovin.impl.sdk.utils.t.i(new myobfuscated.g9.c(2, this, str));
        } else {
            Cv().cB(str);
        }
    }

    public void e(com.applovin.impl.mediation.b.f fVar) {
        if (Cj().isInitialized()) {
            return;
        }
        List<String> b = b(com.applovin.impl.sdk.c.a.aKg);
        if (b.size() <= 0 || !CT().ug().keySet().containsAll(b)) {
            return;
        }
        Ci();
        if (x.FL()) {
            Ci().f("AppLovinSdk", "All required adapters initialized");
        }
        Cj().LF();
        BQ();
    }

    public boolean f(MaxAdFormat maxAdFormat) {
        List<MaxAdFormat> list = this.aDy;
        return (list == null || list.size() <= 0 || this.aDy.contains(maxAdFormat)) ? false : true;
    }

    public AppLovinSdkConfiguration getConfiguration() {
        return this.aDL;
    }

    public String getMediationProvider() {
        String str = (String) a(com.applovin.impl.sdk.c.d.aTA);
        return StringUtils.isValidString(str) ? str : this.aBF;
    }

    public String getSdkKey() {
        return this.aBw;
    }

    public AppLovinSdkSettings getSettings() {
        return this.aBC;
    }

    public AppLovinUserSegment getUserSegment() {
        return this.aBD;
    }

    public AppLovinSdk getWrappingSdk() {
        return this.aBP;
    }

    public void initializeSdk(AppLovinSdk.SdkInitializationListener sdkInitializationListener) {
        if (!isEnabled()) {
            this.aDJ = sdkInitializationListener;
        } else if (sdkInitializationListener != null) {
            AppLovinSdkUtils.runOnUiThread(new myobfuscated.h4.e(8, this, sdkInitializationListener));
        }
    }

    public boolean isEnabled() {
        boolean z;
        synchronized (this.aDz) {
            z = this.iV;
        }
        return z;
    }

    public void setMediationProvider(String str) {
        Ci();
        if (x.FL()) {
            defpackage.e.v("setMediationProvider(mediationProvider=", str, ")", Ci(), "AppLovinSdk");
        }
        if (str != null && (str.isEmpty() || str.length() > 64 || !StringUtils.isAlphaNumeric(str))) {
            x.I("AppLovinSdk", "Mediation provider set to invalid value: " + str + ". Please use a valid mediation provider (e.g., AppLovinMediationProvider.MAX)");
            return;
        }
        this.aBF = str;
        if (com.applovin.impl.sdk.utils.t.Mq() && this.aBB) {
            com.applovin.impl.sdk.utils.t.i(new myobfuscated.g9.e(1, this));
        } else {
            b(com.applovin.impl.sdk.c.d.aTA);
        }
    }

    public void setPluginVersion(String str) {
        x.E("AppLovinSdk", "Setting plugin version: " + str);
        if (com.applovin.impl.sdk.utils.t.Mq() && this.aBB) {
            com.applovin.impl.sdk.utils.t.i(new g0(9, this, str));
        } else {
            Ck().a(com.applovin.impl.sdk.c.b.aQj, str);
        }
    }

    public void showCreativeDebugger() {
        CJ().showCreativeDebugger();
    }

    public void showMediationDebugger() {
        showMediationDebugger(null);
    }

    public void showMediationDebugger(Map<String, List<?>> map) {
        CX().showMediationDebugger(map);
    }

    @NonNull
    public String toString() {
        StringBuilder sb = new StringBuilder("CoreSdk{sdkKey='");
        sb.append(this.aBw);
        sb.append("', enabled=");
        sb.append(this.iV);
        sb.append(", isFirstSession=");
        return defpackage.d.s(sb, this.aDD, '}');
    }
}