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

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


package com.applovin.impl.mediation.d;

import android.app.Activity;
import android.content.Context;
import android.os.SystemClock;
import androidx.annotation.NonNull;
import androidx.fragment.app.s;
import com.applovin.impl.mediation.MaxAdWaterfallInfoImpl;
import com.applovin.impl.mediation.MaxErrorImpl;
import com.applovin.impl.mediation.MaxMediatedNetworkInfoImpl;
import com.applovin.impl.mediation.MaxNetworkResponseInfoImpl;
import com.applovin.impl.mediation.ads.a;
import com.applovin.impl.sdk.e.q;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.l;
import com.applovin.impl.sdk.utils.t;
import com.applovin.impl.sdk.x;
import com.applovin.mediation.MaxAd;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.MaxAdListener;
import com.applovin.mediation.MaxError;
import com.applovin.mediation.MaxErrorCode;
import com.applovin.mediation.MaxNetworkResponseInfo;
import com.applovin.sdk.AppLovinSdkUtils;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONArray;
import org.json.JSONObject;
public class f extends com.applovin.impl.sdk.e.d {
    private static final AtomicBoolean axl = new AtomicBoolean();
    private final List<MaxNetworkResponseInfo> alc;
    private final String alf;
    private final String axG;
    private final MaxAdFormat axH;
    private final JSONObject axI;
    private final List<com.applovin.impl.mediation.b.a> axJ;
    private final a.InterfaceC0142a axK;
    private final WeakReference<Context> axL;
    private long startTimeMillis;

    public class a extends com.applovin.impl.sdk.e.d {
        private final com.applovin.impl.mediation.b.a amu;
        private final int axM;
        private final List<com.applovin.impl.mediation.b.a> axN;
        private final long startTimeMillis;

        public a(int i, List<com.applovin.impl.mediation.b.a> list) {
            super(r3.tag, r3.sdk, r3.axG);
            f.this = r3;
            this.startTimeMillis = SystemClock.elapsedRealtime();
            this.axM = i;
            this.amu = list.get(i);
            this.axN = list;
        }

        public void a(com.applovin.impl.mediation.b.a aVar, MaxNetworkResponseInfo.AdLoadState adLoadState, long j, MaxError maxError) {
            f.this.alc.add(new MaxNetworkResponseInfoImpl(adLoadState, new MaxMediatedNetworkInfoImpl(com.applovin.impl.mediation.e.c.a(aVar.vH(), this.sdk)), aVar.getCredentials(), aVar.isBidding(), j, aVar.getBCode(), maxError));
        }

        public void ci(String str) {
        }

        @Override
        public void run() {
            if (x.FL()) {
                x xVar = this.logger;
                String str = this.tag;
                xVar.f(str, "Loading ad " + (this.axM + 1) + " of " + this.axN.size() + " from " + this.amu.yR() + " for " + f.this.axH.getLabel() + " ad unit " + f.this.axG);
            }
            ci("started to load ad");
            Context context = (Context) f.this.axL.get();
            this.sdk.CU().loadThirdPartyMediatedAd(f.this.axG, this.amu, context instanceof Activity ? (Activity) context : this.sdk.Db(), new com.applovin.impl.mediation.e.a(f.this.axK) {
                {
                    a.this = this;
                }

                @Override
                public void onAdLoadFailed(@NonNull String str2, @NonNull MaxError maxError) {
                    long elapsedRealtime = SystemClock.elapsedRealtime() - a.this.startTimeMillis;
                    x unused = ((com.applovin.impl.sdk.e.d) a.this).logger;
                    if (x.FL()) {
                        x xVar2 = ((com.applovin.impl.sdk.e.d) a.this).logger;
                        String str3 = ((com.applovin.impl.sdk.e.d) a.this).tag;
                        StringBuilder j = myobfuscated.a0.a.j("Ad failed to load in ", elapsedRealtime, " ms for ");
                        j.append(f.this.axH.getLabel());
                        j.append(" ad unit ");
                        j.append(f.this.axG);
                        j.append(" with error: ");
                        j.append(maxError);
                        xVar2.f(str3, j.toString());
                    }
                    a aVar = a.this;
                    aVar.ci("failed to load ad: " + maxError.getCode());
                    a aVar2 = a.this;
                    aVar2.a(aVar2.amu, MaxNetworkResponseInfo.AdLoadState.FAILED_TO_LOAD, elapsedRealtime, maxError);
                    if (a.this.axM >= a.this.axN.size() - 1) {
                        f.this.f(new MaxErrorImpl(-5001, "MAX returned eligible ads from mediated networks, but all ads failed to load. Inspect getWaterfall() for more info."));
                        return;
                    }
                    a aVar3 = a.this;
                    ((com.applovin.impl.sdk.e.d) a.this).sdk.Cj().a((com.applovin.impl.sdk.e.d) new a(aVar3.axM + 1, a.this.axN), q.a.MEDIATION);
                }

                @Override
                public void onAdLoaded(@NonNull MaxAd maxAd) {
                    a.this.ci("loaded ad");
                    long elapsedRealtime = SystemClock.elapsedRealtime() - a.this.startTimeMillis;
                    x unused = ((com.applovin.impl.sdk.e.d) a.this).logger;
                    if (x.FL()) {
                        x xVar2 = ((com.applovin.impl.sdk.e.d) a.this).logger;
                        String str2 = ((com.applovin.impl.sdk.e.d) a.this).tag;
                        StringBuilder j = myobfuscated.a0.a.j("Ad loaded in ", elapsedRealtime, "ms for ");
                        j.append(f.this.axH.getLabel());
                        j.append(" ad unit ");
                        j.append(f.this.axG);
                        xVar2.f(str2, j.toString());
                    }
                    com.applovin.impl.mediation.b.a aVar = (com.applovin.impl.mediation.b.a) maxAd;
                    a.this.a(aVar, MaxNetworkResponseInfo.AdLoadState.AD_LOADED, elapsedRealtime, null);
                    int i = a.this.axM;
                    while (true) {
                        i++;
                        if (i >= a.this.axN.size()) {
                            f.this.h(aVar);
                            return;
                        } else {
                            a aVar2 = a.this;
                            aVar2.a((com.applovin.impl.mediation.b.a) aVar2.axN.get(i), MaxNetworkResponseInfo.AdLoadState.AD_LOAD_NOT_ATTEMPTED, -1L, null);
                        }
                    }
                }
            });
        }
    }

    public f(String str, MaxAdFormat maxAdFormat, Map<String, Object> map, JSONObject jSONObject, Context context, n nVar, a.InterfaceC0142a interfaceC0142a) {
        super("TaskProcessMediationWaterfall", nVar, str);
        this.axG = str;
        this.axH = maxAdFormat;
        this.axI = jSONObject;
        this.axK = interfaceC0142a;
        this.axL = new WeakReference<>(context);
        this.alf = JsonUtils.getString(jSONObject, "mcode", "");
        JSONArray jSONArray = JsonUtils.getJSONArray(jSONObject, "ads", new JSONArray());
        this.axJ = new ArrayList(jSONArray.length());
        for (int i = 0; i < jSONArray.length(); i++) {
            this.axJ.add(com.applovin.impl.mediation.b.a.a(i, map, JsonUtils.getJSONObject(jSONArray, i, (JSONObject) null), jSONObject, nVar));
        }
        this.alc = new ArrayList(this.axJ.size());
    }

    public void Ab() {
        t.a("MAX SDK Not Initialized In Test Mode", "Test ads may not load. Please force close and restart the app if you experience issues.", this.sdk.Db());
    }

    public void f(MaxError maxError) {
        if (maxError.getCode() == 204) {
            this.sdk.Cm().a(com.applovin.impl.sdk.d.c.aUo);
        } else if (maxError.getCode() == -5001) {
            this.sdk.Cm().a(com.applovin.impl.sdk.d.c.aUp);
        } else {
            this.sdk.Cm().a(com.applovin.impl.sdk.d.c.aUq);
        }
        ArrayList arrayList = new ArrayList(this.alc.size());
        for (MaxNetworkResponseInfo maxNetworkResponseInfo : this.alc) {
            if (maxNetworkResponseInfo.getAdLoadState() == MaxNetworkResponseInfo.AdLoadState.FAILED_TO_LOAD) {
                arrayList.add(maxNetworkResponseInfo);
            }
        }
        if (arrayList.size() > 0) {
            StringBuilder sb = new StringBuilder("======FAILED AD LOADS======\n");
            int i = 0;
            while (i < arrayList.size()) {
                MaxNetworkResponseInfo maxNetworkResponseInfo2 = (MaxNetworkResponseInfo) arrayList.get(i);
                i++;
                sb.append(i);
                sb.append(") ");
                sb.append(maxNetworkResponseInfo2.getMediatedNetwork().getName());
                sb.append("\n..code: ");
                sb.append(maxNetworkResponseInfo2.getError().getCode());
                sb.append("\n..message: ");
                sb.append(maxNetworkResponseInfo2.getError().getMessage());
                sb.append("\n");
            }
            ((MaxErrorImpl) maxError).setAdLoadFailureInfo(sb.toString());
        }
        long elapsedRealtime = SystemClock.elapsedRealtime() - this.startTimeMillis;
        if (x.FL()) {
            x xVar = this.logger;
            String str = this.tag;
            StringBuilder j = myobfuscated.a0.a.j("Waterfall failed in ", elapsedRealtime, "ms for ");
            j.append(this.axH.getLabel());
            j.append(" ad unit ");
            j.append(this.axG);
            j.append(" with error: ");
            j.append(maxError);
            xVar.g(str, j.toString());
        }
        ((MaxErrorImpl) maxError).setWaterfall(new MaxAdWaterfallInfoImpl(null, JsonUtils.getString(this.axI, "waterfall_name", ""), JsonUtils.getString(this.axI, "waterfall_test_name", ""), elapsedRealtime, this.alc, JsonUtils.optList(JsonUtils.getJSONArray(this.axI, "mwf_info_urls", null), Collections.EMPTY_LIST), this.alf));
        l.a(this.axK, this.axG, maxError);
    }

    public void h(com.applovin.impl.mediation.b.a aVar) {
        this.sdk.CY().l(aVar);
        long elapsedRealtime = SystemClock.elapsedRealtime() - this.startTimeMillis;
        if (x.FL()) {
            x xVar = this.logger;
            String str = this.tag;
            StringBuilder j = myobfuscated.a0.a.j("Waterfall loaded in ", elapsedRealtime, "ms from ");
            j.append(aVar.yR());
            j.append(" for ");
            j.append(this.axH.getLabel());
            j.append(" ad unit ");
            j.append(this.axG);
            xVar.g(str, j.toString());
        }
        aVar.setWaterfall(new MaxAdWaterfallInfoImpl(aVar, elapsedRealtime, this.alc, this.alf));
        l.a((MaxAdListener) this.axK, (MaxAd) aVar);
    }

    @Override
    public void run() {
        MaxErrorImpl maxErrorImpl;
        this.startTimeMillis = SystemClock.elapsedRealtime();
        if (this.axI.optBoolean("is_testing", false) && !this.sdk.Da().isEnabled() && axl.compareAndSet(false, true)) {
            AppLovinSdkUtils.runOnUiThread(new myobfuscated.w4.a(this, 10));
        }
        if (this.axJ.size() > 0) {
            if (x.FL()) {
                this.logger.f(this.tag, "Starting waterfall for " + this.axH.getLabel() + " ad unit " + this.axG + " with " + this.axJ.size() + " ad(s)...");
            }
            this.sdk.Cj().b(new a(0, this.axJ));
            return;
        }
        if (x.FL()) {
            this.logger.h(this.tag, "No ads were returned from the server for " + this.axH.getLabel() + " ad unit " + this.axG);
        }
        t.a(this.axG, this.axH, this.axI, this.sdk);
        JSONObject jSONObject = JsonUtils.getJSONObject(this.axI, "settings", new JSONObject());
        long j = JsonUtils.getLong(jSONObject, "alfdcs", 0L);
        if (com.applovin.impl.mediation.e.c.b(this.axI, this.axG, this.sdk)) {
            maxErrorImpl = new MaxErrorImpl(MaxErrorCode.INVALID_AD_UNIT_ID, defpackage.e.m(new StringBuilder("Ad Unit ID "), this.axG, " is invalid or disabled.\nMake sure to use an Ad Unit ID from the MAX dashboard that is enabled and configured for the current application.\nFor more information, see https://dash.applovin.com/documentation/mediation/max/get-started-with-max#step-2:-create-an-ad-unit\nNote: New ad units cannot load ads until 30-60 minutes after they are created"));
            if (t.b(n.getApplicationContext(), this.sdk) && ((Boolean) this.sdk.a(com.applovin.impl.sdk.c.b.aSC)).booleanValue()) {
                j = 0;
            }
        } else {
            maxErrorImpl = new MaxErrorImpl(204, "MAX returned no eligible ads from any mediated networks for this app/device");
        }
        if (j <= 0) {
            f(maxErrorImpl);
            return;
        }
        long millis = TimeUnit.SECONDS.toMillis(j);
        s sVar = new s(5, this, maxErrorImpl);
        if (JsonUtils.getBoolean(jSONObject, "alfdcs_iba", Boolean.FALSE).booleanValue()) {
            com.applovin.impl.sdk.utils.f.a(millis, this.sdk, sVar);
        } else {
            AppLovinSdkUtils.runOnUiThreadDelayed(sVar, millis);
        }
    }
}