Wolves Themes v1.0版本的 MD5 值为:cddc92b47f6b7c4a195c9625507eb51c

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


package com.adcolony.sdk;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import com.adcolony.sdk.p;
import com.amazon.device.ads.WebRequest;
import com.applovin.sdk.AppLovinEventTypes;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.integralads.avid.library.adcolony.BuildConfig;
import com.integralads.avid.library.adcolony.session.ExternalAvidAdSessionContext;
import com.ironsource.mediationsdk.utils.GeneralPropertiesWorker;
import com.mopub.common.GpsHelper;
import com.tapjoy.TJAdUnitConstants;
import com.tapjoy.TapjoyConstants;
import com.vungle.warren.network.VungleApiClient;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.json.JSONObject;
public class l implements p.a {
    private static volatile String J = "";
    static final String a = "026ae9c9824b3e483fa6c71fa88f57ae27816141";
    static final String b = "7bf3a1e7bbd31e612eda3310c2cdb8075c43c6b5";
    static String f = "https://adc3-launch.adcolony.com/v4/launch";
    private af A;
    private JSONObject B;
    private String E;
    private String F;
    private String G;
    private String H;
    private boolean K;
    private boolean L;
    private boolean M;
    private boolean N;
    private boolean O;
    private boolean P;
    private boolean Q;
    private boolean R;
    private boolean S;
    private boolean T;
    private boolean U;
    private int V;
    private Application.ActivityLifecycleCallbacks Y;
    private ExternalAvidAdSessionContext Z;
    n c;
    av d;
    aj e;
    boolean g;
    private m h;
    private ag i;
    private q j;
    private ao k;
    private d l;
    private o m;
    private t n;
    private at o;
    private ar p;
    private ADCCrashReportManager q;
    private ac r;
    private c s;
    private bc t;
    private AdColonyInterstitial u;
    private AdColonyRewardListener v;
    private AdColonyAppOptions x;
    private af y;
    private boolean z;
    private HashMap<String, AdColonyCustomMessageListener> w = new HashMap<>();
    private HashMap<String, AdColonyZone> C = new HashMap<>();
    private HashMap<Integer, bb> D = new HashMap<>();
    private String I = "";
    private int W = 1;
    private final int X = 120;

    Activity a() {
        return a.c();
    }

    public void a(AdColonyAppOptions adColonyAppOptions, boolean z) {
        boolean z2;
        this.M = z;
        this.x = adColonyAppOptions;
        this.q = new ADCCrashReportManager();
        this.i = new ag();
        this.h = new m();
        this.j = new q();
        this.j.a();
        this.k = new ao();
        this.k.a();
        this.l = new d();
        this.l.a();
        this.m = new o();
        this.n = new t();
        this.n.a();
        this.r = new ac();
        ac acVar = this.r;
        ac.a();
        this.p = new ar();
        this.p.a();
        this.o = new at();
        this.o.a();
        this.c = new n();
        this.c.e();
        this.e = new aj();
        this.E = this.e.c();
        AdColony.a(a.c(), adColonyAppOptions);
        if (!z) {
            this.Q = new File(this.p.g() + a).exists();
            this.R = new File(this.p.g() + b).exists();
            if (this.Q && this.R) {
                if (y.b(y.c(this.p.g() + a), GeneralPropertiesWorker.SDK_VERSION).equals(this.c.D())) {
                    z2 = true;
                    this.P = z2;
                    if (this.Q) {
                        this.B = y.c(this.p.g() + a);
                        b(this.B);
                    }
                    e(this.P);
                    J();
                }
            }
            z2 = false;
            this.P = z2;
            if (this.Q) {
            }
            e(this.P);
            J();
        }
        a.a("Module.load", new ah() {
            @Override
            public void a(af afVar) {
                l.this.a(afVar);
            }
        });
        a.a("Module.unload", new ah() {
            @Override
            public void a(af afVar) {
                l.this.f(afVar);
            }
        });
        a.a("AdColony.on_configured", new ah() {
            @Override
            public void a(af afVar) {
                l.this.N = true;
                if (l.this.T) {
                    JSONObject a2 = y.a();
                    JSONObject a3 = y.a();
                    y.a(a3, TapjoyConstants.TJC_APP_VERSION_NAME, az.b());
                    y.a(a2, "app_bundle_info", a3);
                    new af("AdColony.on_update", 1, a2).b();
                    l.this.T = false;
                }
                if (l.this.U) {
                    new af("AdColony.on_install", 1).b();
                }
                if (ac.l != null) {
                    ac.l.b(y.b(afVar.c(), "app_session_id"));
                }
                if (AdColonyEventTracker.b()) {
                    AdColonyEventTracker.a();
                }
            }
        });
        a.a("AdColony.get_app_info", new ah() {
            @Override
            public void a(af afVar) {
                l.this.g(afVar);
            }
        });
        a.a("AdColony.v4vc_reward", new ah() {
            @Override
            public void a(af afVar) {
                l.this.d(afVar);
            }
        });
        a.a("AdColony.zone_info", new ah() {
            @Override
            public void a(af afVar) {
                l.this.e(afVar);
            }
        });
        a.a("AdColony.probe_launch_server", new ah() {
            @Override
            public void a(af afVar) {
                l.this.a(true, true);
            }
        });
        a.a("Crypto.sha1", new ah() {
            @Override
            public void a(af afVar) {
                JSONObject a2 = y.a();
                y.a(a2, "sha1", az.c(y.b(afVar.c(), "data")));
                afVar.a(a2).b();
            }
        });
        a.a("Crypto.crc32", new ah() {
            @Override
            public void a(af afVar) {
                JSONObject a2 = y.a();
                y.b(a2, "crc32", az.b(y.b(afVar.c(), "data")));
                afVar.a(a2).b();
            }
        });
        a.a("Crypto.uuid", new ah() {
            @Override
            public void a(af afVar) {
                int c = y.c(afVar.c(), "number");
                JSONObject a2 = y.a();
                y.a(a2, "uuids", az.a(c));
                afVar.a(a2).b();
            }
        });
        a.a("Device.query_advertiser_info", new ah() {
            @Override
            public void a(final af afVar) {
                if (a.d()) {
                    az.b.execute(new Runnable() {
                        @Override
                        public void run() {
                            l.this.a(a.c(), afVar);
                        }
                    });
                }
            }
        });
        a.a("AdColony.controller_version", new ah() {
            @Override
            public void a(af afVar) {
                l.this.c.g = y.b(afVar.c(), "version");
                if (ac.l != null) {
                    ac.l.a(l.this.c.g);
                }
                aa aaVar = aa.d;
                aaVar.b("Controller version: " + l.this.c.g);
            }
        });
        int a2 = az.a(this.p);
        this.T = a2 == 1;
        this.U = a2 == 2;
    }

    private boolean E() {
        if (this.M || !this.c.d().contains("arm") || ADCNative.nativeNeonSupported()) {
            return true;
        }
        aa.g.b("ARM architechture without NEON support. Disabling AdColony.");
        a(true);
        return false;
    }

    private boolean e(boolean z) {
        return a(z, false);
    }

    public String b() {
        return this.I;
    }

    public JSONObject c() {
        return this.B;
    }

    public boolean a(boolean z, boolean z2) {
        if (a.d()) {
            File file = new File(this.p.c() + "/../lib/libImmEndpointWarpJ.so");
            this.c.d = file.exists();
            this.S = z2;
            this.P = z;
            if (!z || z2 || I()) {
                F();
                return true;
            }
            return false;
        }
        return false;
    }

    public void F() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                JSONObject a2 = y.a();
                y.a(a2, "url", l.f);
                y.a(a2, "content_type", WebRequest.CONTENT_TYPE_JSON);
                y.a(a2, AppLovinEventTypes.USER_VIEWED_CONTENT, l.this.c.a(l.this.c).toString());
                aa aaVar = aa.b;
                aaVar.b("Launch: " + l.this.c.a(l.this.c).toString());
                aa.d.a("Saving Launch to ").a(l.this.p.g()).b(l.a);
                new p(new af("WebServices.post", 0, a2), l.this);
            }
        }).start();
    }

    private boolean a(JSONObject jSONObject) {
        if (!this.P) {
            aa.f.b("Non-standard launch. Downloading new controller.");
            return true;
        } else if (this.B == null || !y.b(y.f(this.B, "controller"), "sha1").equals(y.b(y.f(jSONObject, "controller"), "sha1"))) {
            aa.f.b("Controller sha1 does not match, downloading new controller.");
            return true;
        } else {
            return false;
        }
    }

    public void f(af afVar) {
        a(y.c(afVar.c(), "id"));
    }

    public void a(boolean z) {
        this.M = z;
    }

    public void g(af afVar) {
        JSONObject jSONObject = this.x.d;
        y.a(jSONObject, "app_id", this.x.a);
        y.a(jSONObject, "zone_ids", this.x.c);
        JSONObject a2 = y.a();
        y.a(a2, "options", jSONObject);
        afVar.a(a2).b();
    }

    boolean a(final af afVar) {
        if (a.d()) {
            try {
                final int c = afVar.c().has("id") ? y.c(afVar.c(), "id") : 0;
                if (c <= 0) {
                    c = this.i.d();
                }
                a(c);
                boolean d = y.d(afVar.c(), "is_webview");
                final boolean d2 = y.d(afVar.c(), "is_display_module");
                if (d) {
                    az.a(new Runnable() {
                        @Override
                        public void run() {
                            bb bbVar = new bb(a.c().getApplicationContext(), l.this.i.d(), d2);
                            bb bbVar2 = bbVar;
                            bbVar2.a(true, afVar);
                            l.this.D.put(Integer.valueOf(bbVar.a()), bbVar2);
                        }
                    });
                } else {
                    final ExecutorService newSingleThreadExecutor = Executors.newSingleThreadExecutor();
                    newSingleThreadExecutor.submit(new Runnable() {
                        @Override
                        public void run() {
                            JSONObject f2 = y.f(afVar.c(), TJAdUnitConstants.String.VIDEO_INFO);
                            l a2 = a.a();
                            if (c == 1 && a2.d() != null) {
                                y.a(f2, "options", a2.d().d());
                            }
                            l.this.i.a(new ADCVMModule(a.c(), c, y.b(afVar.c(), "filepath"), f2, newSingleThreadExecutor));
                        }
                    });
                    JSONObject a2 = y.a();
                    y.a(a2, "success", true);
                    y.b(a2, "id", c);
                    afVar.a(a2).b();
                }
                return true;
            } catch (RuntimeException e) {
                aa aaVar = aa.h;
                aaVar.b("Failed to create AdUnit file://" + y.b(afVar.c(), "filepath"));
                aa.h.b(e.toString());
                e.printStackTrace();
                return false;
            }
        }
        return false;
    }

    public void b(af afVar) {
        this.y = afVar;
    }

    public void c(af afVar) {
        this.A = afVar;
    }

    private void G() {
        if (a.a().l().g()) {
            this.V++;
            int i = 120;
            if (this.W * this.V <= 120) {
                i = this.V * this.W;
            }
            this.W = i;
            az.a(new Runnable() {
                @Override
                public void run() {
                    new Handler().postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            if (a.a().l().g()) {
                                l.this.F();
                            }
                        }
                    }, l.this.W * 1000);
                }
            });
            return;
        }
        aa.f.b("Max launch server download attempts hit, or AdColony is no longer active.");
    }

    @Override
    public void a(p pVar, af afVar, Map<String, List<String>> map) {
        if (pVar.b.equals(f)) {
            if (pVar.d) {
                aa aaVar = aa.b;
                aaVar.b("Launch: " + pVar.c);
                JSONObject a2 = y.a(pVar.c);
                y.a(a2, GeneralPropertiesWorker.SDK_VERSION, this.c.D());
                if (a2 == null) {
                    return;
                }
                y.h(a2, this.p.g() + a);
                if (!c(a2)) {
                    if (this.P) {
                        return;
                    }
                    aa.g.b("Incomplete or disabled launch server response. Disabling AdColony until next launch.");
                    a(true);
                    return;
                }
                if (a(a2)) {
                    aa.d.b("Controller missing or out of date. Downloading new controller.");
                    JSONObject a3 = y.a();
                    y.a(a3, "url", this.F);
                    y.a(a3, "filepath", this.p.g() + b);
                    new p(new af("WebServices.download", 0, a3), this);
                }
                this.B = a2;
                return;
            }
            G();
        } else if (pVar.b.equals(this.F)) {
            if (!c(this.G)) {
                aa.e.b("Downloaded controller sha1 does not match expected value, retrying.");
                G();
            } else if (this.P || this.S) {
            } else {
                az.a(new Runnable() {
                    @Override
                    public void run() {
                        boolean I = l.this.I();
                        aa aaVar2 = aa.b;
                        aaVar2.b("Loaded library. Success=" + I);
                    }
                });
            }
        }
    }

    private boolean H() {
        if (!this.O) {
            try {
                System.loadLibrary("js");
                System.loadLibrary(BuildConfig.SDK_NAME);
            } catch (UnsatisfiedLinkError unused) {
                a(true);
                aa.g.b("Expecting libadcolony.so in libs folder but it was not found. Disabling AdColony until next launch.");
                return false;
            }
        }
        this.O = true;
        return true;
    }

    public boolean I() {
        if (H()) {
            this.q.a();
            this.q.b();
            this.i.a();
            E();
            return true;
        }
        return false;
    }

    private boolean c(String str) {
        if (a.d()) {
            File file = new File(a.c().getFilesDir().getAbsolutePath() + "/adc3/" + b);
            if (file.exists()) {
                return az.a(str, file);
            }
            return false;
        }
        return false;
    }

    public boolean a(Context context, af afVar) {
        AdvertisingIdClient.Info info;
        if (context == null) {
            return false;
        }
        try {
            info = AdvertisingIdClient.getAdvertisingIdInfo(context);
        } catch (Exception e) {
            e.printStackTrace();
            if (Build.MANUFACTURER.equals(VungleApiClient.MANUFACTURER_AMAZON)) {
                return false;
            }
            aa.e.b("Advertising ID is not available. Collecting Android ID instead of Advertising ID.");
            return false;
        } catch (NoClassDefFoundError unused) {
            aa.e.b("Google Play Services ads dependencies are missing. Collecting Android ID instead of Advertising ID.");
            return false;
        } catch (NoSuchMethodError unused2) {
            aa.e.b("Google Play Services is out of date, please update to GPS 4.0+. Collecting Android ID instead of Advertising ID.");
            info = null;
        }
        if (info == null) {
            return false;
        }
        this.c.a = info.getId();
        ac.l.g.put(GpsHelper.ADVERTISING_ID_KEY, this.c.a);
        this.c.c = info.isLimitAdTrackingEnabled();
        this.c.b = true;
        if (afVar != null) {
            JSONObject a2 = y.a();
            y.a(a2, "advertiser_id", this.c.c());
            y.a(a2, "limit_ad_tracking", this.c.g());
            afVar.a(a2).b();
        }
        return true;
    }

    public void a(AdColonyAppOptions adColonyAppOptions) {
        synchronized (this.l.c()) {
            for (Map.Entry<String, AdColonyInterstitial> entry : this.l.c().entrySet()) {
                AdColonyInterstitial value = entry.getValue();
                value.a(true);
                value.getListener().onExpiring(value);
            }
            this.l.c().clear();
        }
        this.N = false;
        a(1);
        this.C.clear();
        this.x = adColonyAppOptions;
        this.i.a();
        a(true, true);
    }

    public boolean a(int i) {
        if (this.i.a(i) == null) {
            return false;
        }
        if (this.D.containsKey(Integer.valueOf(i))) {
            bb bbVar = this.D.get(Integer.valueOf(i));
            if (bbVar.g()) {
                bbVar.loadUrl("about:blank");
                bbVar.clearCache(true);
                bbVar.removeAllViews();
                bbVar.a(true);
            }
            this.D.remove(Integer.valueOf(i));
        }
        if (this.A != null) {
            this.A.b();
            this.A = null;
            this.z = false;
        }
        aa.d.a("Destroying module with id = ").b(i);
        return true;
    }

    private void b(JSONObject jSONObject) {
        if (!ADCVMModule.a) {
            JSONObject f2 = y.f(jSONObject, "logging");
            ac.k = y.a(f2, "send_level", 1);
            ac.a = y.d(f2, "log_private");
            ac.i = y.a(f2, "print_level", 3);
            ADCCrashReportManager.a = y.d(f2, "enable_crash_reporting");
            if (ADCCrashReportManager.a && H()) {
                this.q.a();
                this.q.b();
            }
            this.r.a(y.g(f2, "modules"));
        }
        this.c.a(y.f(jSONObject, "metadata"));
        this.I = y.b(y.f(jSONObject, "controller"), "version");
    }

    private boolean c(JSONObject jSONObject) {
        if (jSONObject == null) {
            aa.d.b("Launch response verification failed - response is null or unknown");
            return false;
        }
        try {
            try {
                JSONObject f2 = y.f(jSONObject, "controller");
                this.F = y.b(f2, "url");
                this.G = y.b(f2, "sha1");
                this.H = y.b(jSONObject, "status");
                J = y.b(jSONObject, "pie");
                if (AdColonyEventTracker.b()) {
                    AdColonyEventTracker.a();
                }
                b(jSONObject);
            } catch (Exception unused) {
                new File(this.p.g() + a).delete();
            }
        } catch (Exception unused2) {
        }
        if (this.H.equals("disable")) {
            try {
                new File(this.p.g() + b).delete();
            } catch (Exception unused3) {
            }
            aa.f.b("Launch server response with disabled status. Disabling AdColony until next launch.");
            a(true);
            return false;
        } else if (this.F.equals("") || this.H.equals("")) {
            aa.g.b("Missing controller status or URL. Disabling AdColony until next launch.");
            return false;
        } else {
            return true;
        }
    }

    boolean d(final af afVar) {
        if (this.v != null) {
            az.a(new Runnable() {
                @Override
                public void run() {
                    l.this.v.onReward(new AdColonyReward(afVar));
                }
            });
            return true;
        }
        return false;
    }

    void e(af afVar) {
        AdColonyZone adColonyZone;
        if (this.M) {
            aa.f.b("AdColony is disabled. Ignoring zone_info message.");
            return;
        }
        String b2 = y.b(afVar.c(), "zone_id");
        if (this.C.containsKey(b2)) {
            adColonyZone = this.C.get(b2);
        } else {
            AdColonyZone adColonyZone2 = new AdColonyZone(b2);
            this.C.put(b2, adColonyZone2);
            adColonyZone = adColonyZone2;
        }
        adColonyZone.a(afVar);
    }

    private void J() {
        if (a.d() && this.Y == null) {
            this.Y = new Application.ActivityLifecycleCallbacks() {
                @Override
                public void onActivityDestroyed(Activity activity) {
                }

                @Override
                public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
                }

                @Override
                public void onActivityStarted(Activity activity) {
                }

                @Override
                public void onActivityStopped(Activity activity) {
                }

                @Override
                public void onActivityResumed(Activity activity) {
                    a.b = true;
                    a.a(activity);
                    if (a.d() && l.this.k.e() && (a.c() instanceof b) && !((b) a.c()).g) {
                        aa.d.b("Ignoring onActivityResumed");
                        return;
                    }
                    aa.d.b("onActivityResumed() Activity Lifecycle Callback");
                    a.a(activity);
                    if (l.this.y != null) {
                        l.this.y.a(l.this.y.c()).b();
                        l.this.y = null;
                    }
                    l.this.L = false;
                    l.this.k.d(true);
                    l.this.k.e(true);
                    l.this.k.f(false);
                    if (l.this.g && !l.this.k.g()) {
                        l.this.k.a(true);
                    }
                    l.this.m.a();
                    if (ac.l == null || ac.l.d == null || ac.l.d.isShutdown()) {
                        AdColony.a(activity, a.a().x);
                    }
                }

                @Override
                public void onActivityPaused(Activity activity) {
                    a.b = false;
                    l.this.k.d(false);
                    l.this.k.e(true);
                    a.a().c.E();
                }

                @Override
                public void onActivityCreated(Activity activity, Bundle bundle) {
                    if (!l.this.k.g()) {
                        l.this.k.a(true);
                    }
                    a.a(activity);
                }
            };
            a.c().getApplication().registerActivityLifecycleCallbacks(this.Y);
        }
    }

    public AdColonyAppOptions d() {
        if (this.x == null) {
            this.x = new AdColonyAppOptions();
        }
        return this.x;
    }

    public boolean e() {
        return this.x != null;
    }

    public void b(@NonNull AdColonyAppOptions adColonyAppOptions) {
        this.x = adColonyAppOptions;
    }

    public HashMap<String, AdColonyZone> f() {
        return this.C;
    }

    public void b(boolean z) {
        this.L = z;
    }

    public boolean g() {
        return this.L;
    }

    public boolean h() {
        return this.M;
    }

    public AdColonyRewardListener i() {
        return this.v;
    }

    public void a(AdColonyRewardListener adColonyRewardListener) {
        this.v = adColonyRewardListener;
    }

    public t j() {
        if (this.n == null) {
            this.n = new t();
            this.n.a();
        }
        return this.n;
    }

    public ADCCrashReportManager k() {
        if (this.q == null) {
            this.q = new ADCCrashReportManager();
        }
        this.q.a();
        return this.q;
    }

    public ao l() {
        if (this.k == null) {
            this.k = new ao();
            this.k.a();
        }
        return this.k;
    }

    public d m() {
        if (this.l == null) {
            this.l = new d();
            this.l.a();
        }
        return this.l;
    }

    public n n() {
        if (this.c == null) {
            this.c = new n();
            this.c.e();
        }
        return this.c;
    }

    public ar o() {
        if (this.p == null) {
            this.p = new ar();
            this.p.a();
        }
        return this.p;
    }

    public aj p() {
        if (this.e == null) {
            this.e = new aj();
        }
        return this.e;
    }

    public ag q() {
        if (this.i == null) {
            this.i = new ag();
            this.i.a();
        }
        return this.i;
    }

    public o r() {
        if (this.m == null) {
            this.m = new o();
        }
        return this.m;
    }

    public c s() {
        return this.s;
    }

    public void a(c cVar) {
        this.s = cVar;
    }

    public bc t() {
        return this.t;
    }

    public void a(bc bcVar) {
        this.t = bcVar;
    }

    public AdColonyInterstitial u() {
        return this.u;
    }

    public void a(AdColonyInterstitial adColonyInterstitial) {
        this.u = adColonyInterstitial;
    }

    public String v() {
        return this.E;
    }

    public void a(String str) {
        this.E = str;
    }

    public boolean w() {
        return this.K;
    }

    public void c(boolean z) {
        this.K = z;
    }

    public HashMap<Integer, bb> x() {
        return this.D;
    }

    public boolean y() {
        return this.z;
    }

    public void d(boolean z) {
        this.z = z;
    }

    void b(@NonNull String str) {
        f = str;
    }

    public HashMap<String, AdColonyCustomMessageListener> z() {
        return this.w;
    }

    public boolean A() {
        return this.N;
    }

    public boolean B() {
        return this.O;
    }

    public static String C() {
        return J;
    }

    public ExternalAvidAdSessionContext D() {
        if (this.Z == null) {
            this.Z = new ExternalAvidAdSessionContext("3.3.0", true);
        }
        return this.Z;
    }
}