Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f

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


package com.adcolony.sdk;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.work.PeriodicWorkRequest;
import com.adcolony.sdk.AdColonyAdView;
import com.adcolony.sdk.AdColonyInterstitial;
import com.adcolony.sdk.e0;
import com.adcolony.sdk.o;
import com.adcolony.sdk.s;
import com.adcolony.sdk.v;
import com.applovin.sdk.AppLovinEventTypes;
import com.iab.omid.library.adcolony.Omid;
import com.iab.omid.library.adcolony.adsession.Partner;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import com.tapjoy.TJAdUnitConstants;
import com.tapjoy.TapjoyAuctionFlags;
import com.tapjoy.TapjoyConstants;
import com.unity3d.ads.metadata.MediationMetaData;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;

public class k {
    static String Z = "https://adc3-launch.adcolony.com/v4/launch";

    private static volatile String f23778a0 = "";
    private boolean A;
    private boolean B;
    private boolean C;
    private boolean E;
    private boolean F;
    private boolean G;
    private boolean H;
    private boolean I;
    private boolean J;
    private boolean K;
    private boolean L;
    private int M;
    private Application.ActivityLifecycleCallbacks O;
    private boolean T;
    private int X;

    private i0 f23779a;

    private com.adcolony.sdk.t f23780b;

    private t0 f23781c;

    private com.adcolony.sdk.d f23782d;

    private com.adcolony.sdk.r f23783e;

    private com.adcolony.sdk.w f23784f;

    private x0 f23785g;

    private v0 f23786h;

    private g0 f23787i;

    private com.adcolony.sdk.q f23788j;

    private m0 f23789k;

    private com.adcolony.sdk.c f23790l;

    private com.adcolony.sdk.z f23791m;

    private AdColonyAdView f23792n;

    private AdColonyInterstitial f23793o;

    private AdColonyRewardListener f23794p;

    private AdColonyAppOptions f23796r;

    private h0 f23797s;

    private f1 f23798t;

    private String f23801w;

    private String f23802x;

    private String f23803y;

    private HashMap<String, AdColonyCustomMessageListener> f23795q = new HashMap<>();

    private HashMap<String, AdColonyZone> f23799u = new HashMap<>();

    private HashMap<Integer, c1> f23800v = new HashMap<>();

    private String f23804z = "";
    private com.adcolony.sdk.f D = new com.adcolony.sdk.f();
    private int N = 1;
    private Partner P = null;
    private f1 Q = new f1();
    private long R = 500;
    private long S = 500;
    private long U = 20000;
    private long V = PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS;
    private long W = 15000;
    private boolean Y = false;

    public class a implements j0 {
        public a(k kVar) {
        }

        @Override
        public void a(h0 h0Var) {
            f1 b11 = c0.b();
            c0.b(b11, "crc32", z0.a(c0.h(h0Var.a(), "data")));
            h0Var.a(b11).c();
        }
    }

    public class a0 implements j0 {
        public a0() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.a(true, true);
        }
    }

    public class b implements j0 {
        public b(k kVar) {
        }

        @Override
        public void a(h0 h0Var) {
            int d11 = c0.d(h0Var.a(), "number");
            f1 b11 = c0.b();
            c0.a(b11, "uuids", z0.a(d11));
            h0Var.a(b11).c();
        }
    }

    public class b0 implements j0 {
        public b0(k kVar) {
        }

        @Override
        public void a(h0 h0Var) {
            f1 b11 = c0.b();
            c0.a(b11, "sha1", z0.b(c0.h(h0Var.a(), "data")));
            h0Var.a(b11).c();
        }
    }

    public class c implements j0 {

        public class a implements com.adcolony.sdk.y<String> {

            final h0 f23807a;

            public a(h0 h0Var) {
                this.f23807a = h0Var;
            }

            @Override
            public void a(@NonNull String str) {
                f1 b11 = c0.b();
                c0.a(b11, "advertiser_id", k.this.n().f());
                c0.b(b11, "limit_ad_tracking", k.this.n().A());
                this.f23807a.a(b11).c();
            }

            @Override
            public void a(@NonNull Throwable th2) {
                new e0.a().a("Device.query_advertiser_info").a(" failed with error: ").a(Log.getStackTraceString(th2)).a(e0.f23705g);
            }
        }

        public c() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.n().a(com.adcolony.sdk.a.a(), new a(h0Var));
        }
    }

    public class d implements j0 {
        public d() {
        }

        @Override
        public void a(h0 h0Var) {
            s0 a11 = k.this.q().a();
            k.this.n().c(c0.h(h0Var.a(), MediationMetaData.KEY_VERSION));
            if (a11 != null) {
                a11.e(k.this.n().o());
            }
        }
    }

    public class e implements j0 {
        public e() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.Q = c0.f(h0Var.a(), "signals");
        }
    }

    public class f implements j0 {

        public class a implements com.adcolony.sdk.x<o.b> {

            final h0 f23812a;

            public a(f fVar, h0 h0Var) {
                this.f23812a = h0Var;
            }

            @Override
            public void a(o.b bVar) {
                f1 b11 = c0.b();
                if (bVar != null) {
                    c0.a(b11, "odt", bVar.b());
                }
                this.f23812a.a(b11).c();
            }
        }

        public f() {
        }

        @Override
        public void a(h0 h0Var) {
            if (k.this.G()) {
                o0.c().a(new a(this, h0Var), k.this.g());
                return;
            }
            o.b b11 = o0.c().b();
            f1 b12 = c0.b();
            if (b11 != null) {
                c0.a(b12, "odt", b11.b());
            }
            h0Var.a(b12).c();
        }
    }

    public class g implements j0 {
        public g(k kVar) {
        }

        @Override
        public void a(h0 h0Var) {
            o0.c().a();
        }
    }

    public class h implements j0 {
        public h() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.f23791m.a(h0Var);
        }
    }

    public class i implements Runnable {
        public i() {
        }

        @Override
        public void run() {
            Context a11 = com.adcolony.sdk.a.a();
            if (!k.this.L && a11 != null) {
                try {
                    Omid.activate(a11.getApplicationContext());
                    k.this.L = true;
                } catch (IllegalArgumentException unused) {
                    new e0.a().a("IllegalArgumentException when activating Omid").a(e0.f23707i);
                    k.this.L = false;
                }
            }
            if (k.this.L && k.this.P == null) {
                try {
                    k.this.P = Partner.createPartner("AdColony", "4.8.0");
                } catch (IllegalArgumentException unused2) {
                    new e0.a().a("IllegalArgumentException when creating Omid Partner").a(e0.f23707i);
                    k.this.L = false;
                }
            }
        }
    }

    public class j implements Runnable {

        public class a implements s.a {
            public a() {
            }

            @Override
            public void a(com.adcolony.sdk.s sVar, h0 h0Var, Map<String, List<String>> map) {
                k.this.a(sVar);
            }
        }

        public j() {
        }

        @Override
        public void run() {
            f1 b11 = c0.b();
            c0.a(b11, "url", k.Z);
            c0.a(b11, "content_type", "application/json");
            c0.a(b11, AppLovinEventTypes.USER_VIEWED_CONTENT, k.this.n().t().toString());
            c0.a(b11, "url", k.Z);
            if (k.this.Y) {
                f1 b12 = c0.b();
                c0.a(b12, "request", "la-req-01");
                c0.a(b12, "response", "la-res-01");
                c0.a(b11, "dictionaries_mapping", b12);
            }
            k.this.f23780b.a(new com.adcolony.sdk.s(new h0("WebServices.post", 0, b11), new a()));
        }
    }

    public class C0474k implements v.c {
        public C0474k(k kVar) {
        }

        @Override
        public void a() {
            o0.c().d();
        }
    }

    public class l implements Runnable {

        final Context f23817a;

        final h0 f23818b;

        public l(Context context, h0 h0Var) {
            this.f23817a = context;
            this.f23818b = h0Var;
        }

        @Override
        public void run() {
            com.adcolony.sdk.j a11 = com.adcolony.sdk.j.a(this.f23817a.getApplicationContext(), this.f23818b);
            k.this.f23800v.put(Integer.valueOf(a11.getAdc3ModuleId()), a11);
        }
    }

    public class m implements Runnable {
        public m() {
        }

        @Override
        public void run() {
            if (com.adcolony.sdk.a.b().x().f()) {
                k.this.K();
            }
        }
    }

    public class n implements s.a {
        public n() {
        }

        @Override
        public void a(com.adcolony.sdk.s sVar, h0 h0Var, Map<String, List<String>> map) {
            k.this.N();
        }
    }

    public class o implements Runnable {
        public o() {
        }

        @Override
        public void run() {
            k.this.L();
        }
    }

    public class p implements AdColonyInterstitial.f {
        public p() {
        }

        @Override
        public void a() {
            k.this.b();
        }
    }

    public class q implements AdColonyAdView.c {
        public q() {
        }

        @Override
        public void a() {
            k.this.b();
        }
    }

    public class r implements com.adcolony.sdk.x<n0> {
        public r(k kVar) {
        }

        @Override
        public void a(n0 n0Var) {
            o0.c().a(n0Var);
        }
    }

    public class s implements Runnable {

        final h0 f23825a;

        public s(h0 h0Var) {
            this.f23825a = h0Var;
        }

        @Override
        public void run() {
            k.this.f23794p.onReward(new AdColonyReward(this.f23825a));
        }
    }

    public class u implements j0 {
        public u() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.c(h0Var);
        }
    }

    public class v implements j0 {
        public v() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.a(h0Var);
        }
    }

    public class w implements j0 {
        public w() {
        }

        @Override
        public void a(h0 h0Var) {
            s0 a11 = k.this.q().a();
            k.this.D.a(true);
            if (k.this.J) {
                f1 b11 = c0.b();
                f1 b12 = c0.b();
                c0.a(b12, TapjoyConstants.TJC_APP_VERSION_NAME, z0.c());
                c0.a(b11, "app_bundle_info", b12);
                new h0("AdColony.on_update", 1, b11).c();
                k.this.J = false;
            }
            if (k.this.K) {
                new h0("AdColony.on_install", 1).c();
            }
            f1 a12 = h0Var.a();
            if (a11 != null) {
                a11.f(c0.h(a12, "app_session_id"));
            }
            if (AdColonyEventTracker.a()) {
                AdColonyEventTracker.b();
            }
            Integer i11 = a12.i("base_download_threads");
            if (i11 != null) {
                k.this.f23780b.a(i11.intValue());
            }
            Integer i12 = a12.i("concurrent_requests");
            if (i12 != null) {
                k.this.f23780b.b(i12.intValue());
            }
            Integer i13 = a12.i("threads_keep_alive_time");
            if (i13 != null) {
                k.this.f23780b.c(i13.intValue());
            }
            double h11 = a12.h("thread_pool_scaling_factor");
            if (!Double.isNaN(h11)) {
                k.this.f23780b.a(h11);
            }
            k.this.f23791m.b();
            k.this.M();
        }
    }

    public class x implements j0 {
        public x() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.b(h0Var);
        }
    }

    public class y implements j0 {
        public y() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.e(h0Var);
        }
    }

    public class z implements j0 {
        public z() {
        }

        @Override
        public void a(h0 h0Var) {
            k.this.f(h0Var);
        }
    }

    public void K() {
        new Thread(new j()).start();
    }

    public boolean L() {
        this.f23779a.a();
        return true;
    }

    public void M() {
        f1 b11 = c0.b();
        c0.a(b11, TapjoyAuctionFlags.AUCTION_TYPE, "AdColony.on_configuration_completed");
        e1 e1Var = new e1();
        Iterator<String> it = C().keySet().iterator();
        while (it.hasNext()) {
            e1Var.b(it.next());
        }
        f1 b12 = c0.b();
        c0.a(b12, "zone_ids", e1Var);
        c0.a(b11, TJAdUnitConstants.String.MESSAGE, b12);
        new h0("CustomMessage.controller_send", 0, b11).c();
    }

    public void N() {
        if (!a(this.f23802x) && !com.adcolony.sdk.l.H) {
            new e0.a().a("Downloaded controller sha1 does not match, retrying.").a(e0.f23704f);
            S();
            return;
        }
        if (!this.F && !this.I) {
            z0.b(new o());
        }
        if (this.F && this.I) {
            Q();
        }
    }

    private void O() {
        Application application;
        Context a11 = com.adcolony.sdk.a.a();
        if (a11 != null && this.O == null) {
            this.O = new t();
            if (a11 instanceof Application) {
                application = (Application) a11;
            } else {
                application = ((Activity) a11).getApplication();
            }
            application.registerActivityLifecycleCallbacks(this.O);
        }
    }

    private void S() {
        if (com.adcolony.sdk.a.b().x().f()) {
            int i11 = this.M + 1;
            this.M = i11;
            this.N = Math.min(this.N * i11, 120);
            z0.a(new m(), this.N * 1000);
            return;
        }
        new e0.a().a("Max launch server download attempts hit, or AdColony is no longer").a(" active.").a(e0.f23705g);
    }

    public x0 A() {
        if (this.f23785g == null) {
            x0 x0Var = new x0();
            this.f23785g = x0Var;
            x0Var.a();
        }
        return this.f23785g;
    }

    public HashMap<Integer, c1> B() {
        return this.f23800v;
    }

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

    public boolean D() {
        if (this.f23796r != null) {
            return true;
        }
        return false;
    }

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

    public boolean F() {
        return this.C;
    }

    public boolean G() {
        return this.T;
    }

    public boolean H() {
        return this.Y;
    }

    public boolean I() {
        return this.D.a();
    }

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

    public void P() {
        this.D.a(false);
        this.f23782d.b();
        Object option = this.f23796r.getOption("force_ad_id");
        if ((option instanceof String) && !((String) option).isEmpty()) {
            R();
        }
        AdColony.a(com.adcolony.sdk.a.a(), this.f23796r);
        T();
        this.f23799u.clear();
        this.f23779a.a();
    }

    public void Q() {
        this.X = 0;
        for (AdColonyInterstitial adColonyInterstitial : this.f23782d.f().values()) {
            if (adColonyInterstitial.m()) {
                this.X++;
                adColonyInterstitial.a(new p());
            }
        }
        for (AdColonyAdView adColonyAdView : this.f23782d.d().values()) {
            this.X++;
            adColonyAdView.setOnDestroyListenerOrCall(new q());
        }
        if (this.X == 0) {
            P();
        }
    }

    public void R() {
        synchronized (this.f23782d.f()) {
            Iterator<AdColonyInterstitial> it = this.f23782d.f().values().iterator();
            while (it.hasNext()) {
                it.next().p();
            }
            this.f23782d.f().clear();
        }
    }

    public void T() {
        a(1);
        Iterator<c1> it = this.f23800v.values().iterator();
        while (it.hasNext()) {
            this.f23779a.b(it.next());
        }
        this.f23800v.clear();
    }

    public AdColonyAppOptions u() {
        if (this.f23796r == null) {
            this.f23796r = new AdColonyAppOptions();
        }
        return this.f23796r;
    }

    public String v() {
        return f23778a0;
    }

    public AdColonyRewardListener w() {
        return this.f23794p;
    }

    public t0 x() {
        if (this.f23781c == null) {
            t0 t0Var = new t0();
            this.f23781c = t0Var;
            t0Var.d();
        }
        return this.f23781c;
    }

    public long y() {
        return this.R;
    }

    public v0 z() {
        if (this.f23786h == null) {
            v0 v0Var = new v0();
            this.f23786h = v0Var;
            v0Var.e();
        }
        return this.f23786h;
    }

    public String f() {
        return this.f23804z;
    }

    public long g() {
        return this.S;
    }

    public long h() {
        return this.V;
    }

    public long i() {
        return this.W;
    }

    public AdColonyInterstitial j() {
        return this.f23793o;
    }

    public AdColonyAdView k() {
        return this.f23792n;
    }

    public com.adcolony.sdk.c l() {
        return this.f23790l;
    }

    public HashMap<String, AdColonyCustomMessageListener> m() {
        return this.f23795q;
    }

    public com.adcolony.sdk.q n() {
        if (this.f23788j == null) {
            com.adcolony.sdk.q qVar = new com.adcolony.sdk.q();
            this.f23788j = qVar;
            qVar.M();
        }
        return this.f23788j;
    }

    public com.adcolony.sdk.r o() {
        if (this.f23783e == null) {
            this.f23783e = new com.adcolony.sdk.r();
        }
        return this.f23783e;
    }

    public com.adcolony.sdk.w p() {
        if (this.f23784f == null) {
            com.adcolony.sdk.w wVar = new com.adcolony.sdk.w();
            this.f23784f = wVar;
            wVar.b();
        }
        return this.f23784f;
    }

    public g0 q() {
        if (this.f23787i == null) {
            g0 g0Var = new g0();
            this.f23787i = g0Var;
            g0Var.c();
        }
        return this.f23787i;
    }

    public i0 r() {
        if (this.f23779a == null) {
            i0 i0Var = new i0();
            this.f23779a = i0Var;
            i0Var.a();
        }
        return this.f23779a;
    }

    public m0 s() {
        if (this.f23789k == null) {
            this.f23789k = new m0();
        }
        return this.f23789k;
    }

    public Partner t() {
        return this.P;
    }

    public void f(h0 h0Var) {
        AdColonyZone adColonyZone;
        if (this.C) {
            return;
        }
        String h11 = c0.h(h0Var.a(), "zone_id");
        if (this.f23799u.containsKey(h11)) {
            adColonyZone = this.f23799u.get(h11);
        } else {
            AdColonyZone adColonyZone2 = new AdColonyZone(h11);
            this.f23799u.put(h11, adColonyZone2);
            adColonyZone = adColonyZone2;
        }
        adColonyZone.a(h0Var);
    }

    public void d(h0 h0Var) {
        this.f23797s = h0Var;
    }

    public boolean e(h0 h0Var) {
        if (this.f23794p == null) {
            return false;
        }
        z0.b(new s(h0Var));
        return true;
    }

    public boolean c(h0 h0Var) {
        Context a11 = com.adcolony.sdk.a.a();
        if (a11 == null) {
            return false;
        }
        try {
            int j11 = h0Var.a().j("id");
            if (j11 > 0) {
                a(j11);
            }
            z0.b(new l(a11, h0Var));
            return true;
        } catch (RuntimeException e11) {
            new e0.a().a(e11.toString() + ": during WebView initialization.").a(" Disabling AdColony.").a(e0.f23706h);
            AdColony.disable();
            return false;
        }
    }

    public void b(boolean z11) {
        this.D.a(false);
        this.C = z11;
    }

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

    public long d() {
        return this.U;
    }

    public void e(boolean z11) {
        this.A = z11;
    }

    public void b(h0 h0Var) {
        f1 b11 = this.f23796r.b();
        c0.a(b11, "app_id", this.f23796r.a());
        f1 b12 = c0.b();
        c0.a(b12, "options", b11);
        h0Var.a(b12).c();
    }

    public f1 e() {
        return this.Q;
    }

    public void a(AdColonyAppOptions adColonyAppOptions, boolean z11) {
        boolean z12;
        this.C = z11;
        this.f23796r = adColonyAppOptions;
        this.f23779a = new i0();
        new com.adcolony.sdk.m();
        com.adcolony.sdk.q qVar = new com.adcolony.sdk.q();
        this.f23788j = qVar;
        qVar.M();
        com.adcolony.sdk.t tVar = new com.adcolony.sdk.t();
        this.f23780b = tVar;
        tVar.a();
        t0 t0Var = new t0();
        this.f23781c = t0Var;
        t0Var.d();
        com.adcolony.sdk.d dVar = new com.adcolony.sdk.d();
        this.f23782d = dVar;
        dVar.h();
        this.f23783e = new com.adcolony.sdk.r();
        com.adcolony.sdk.w wVar = new com.adcolony.sdk.w();
        this.f23784f = wVar;
        wVar.b();
        g0 g0Var = new g0();
        this.f23787i = g0Var;
        g0Var.c();
        v0 v0Var = new v0();
        this.f23786h = v0Var;
        v0Var.e();
        x0 x0Var = new x0();
        this.f23785g = x0Var;
        x0Var.a();
        this.f23789k = new m0();
        this.f23791m = new com.adcolony.sdk.z();
        this.f23789k.b();
        AdColony.a(com.adcolony.sdk.a.a(), adColonyAppOptions);
        if (!z11) {
            this.G = new File(this.f23786h.a() + "026ae9c9824b3e483fa6c71fa88f57ae27816141").exists();
            boolean exists = new File(this.f23786h.a() + "7bf3a1e7bbd31e612eda3310c2cdb8075c43c6b5").exists();
            this.H = exists;
            if (this.G && exists) {
                if (c0.h(c0.c(this.f23786h.a() + "026ae9c9824b3e483fa6c71fa88f57ae27816141"), "sdkVersion").equals(this.f23788j.I())) {
                    z12 = true;
                    this.F = z12;
                    com.adcolony.sdk.v.a().a(new C0474k(this));
                    if (this.G) {
                        f1 c11 = c0.c(this.f23786h.a() + "026ae9c9824b3e483fa6c71fa88f57ae27816141");
                        this.f23798t = c11;
                        b(c11);
                    }
                    a(this.F);
                    O();
                }
            }
            z12 = false;
            this.F = z12;
            com.adcolony.sdk.v.a().a(new C0474k(this));
            if (this.G) {
            }
            a(this.F);
            O();
        }
        com.adcolony.sdk.a.a("Module.load", new u());
        com.adcolony.sdk.a.a("Module.unload", new v());
        com.adcolony.sdk.a.a("AdColony.on_configured", new w());
        com.adcolony.sdk.a.a("AdColony.get_app_info", new x());
        com.adcolony.sdk.a.a("AdColony.v4vc_reward", new y());
        com.adcolony.sdk.a.a("AdColony.zone_info", new z());
        com.adcolony.sdk.a.a("AdColony.probe_launch_server", new a0());
        com.adcolony.sdk.a.a("Crypto.sha1", new b0(this));
        com.adcolony.sdk.a.a("Crypto.crc32", new a(this));
        com.adcolony.sdk.a.a("Crypto.uuid", new b(this));
        com.adcolony.sdk.a.a("Device.query_advertiser_info", new c());
        com.adcolony.sdk.a.a("AdColony.controller_version", new d());
        com.adcolony.sdk.a.a("AdColony.provide_signals", new e());
        com.adcolony.sdk.a.a("AdColony.odt_calculate", new f());
        com.adcolony.sdk.a.a("AdColony.odt_cache", new g(this));
        com.adcolony.sdk.a.a("AdColony.heartbeat", new h());
        int b11 = z0.b(this.f23786h);
        this.J = b11 == 1;
        this.K = b11 == 2;
        z0.b(new i());
    }

    public void b() {
        int i11 = this.X - 1;
        this.X = i11;
        if (i11 == 0) {
            P();
        }
    }

    private void b(f1 f1Var) {
        if (!com.adcolony.sdk.l.H) {
            f1 f11 = c0.f(f1Var, "logging");
            g0.f23728h = c0.a(f11, "send_level", 1);
            g0.f23726f = c0.b(f11, "log_private");
            g0.f23727g = c0.a(f11, "print_level", 3);
            this.f23787i.b(c0.a(f11, "modules"));
            this.f23787i.c(c0.e(f11, "included_fields"));
        }
        f1 f12 = c0.f(f1Var, TtmlNode.TAG_METADATA);
        n().a(f12);
        x().a(c0.d(f12, "session_timeout"));
        f23778a0 = c0.h(f1Var, "pie");
        this.f23804z = c0.h(c0.f(f1Var, "controller"), MediationMetaData.KEY_VERSION);
        this.R = c0.a(f12, "signals_timeout", this.R);
        this.S = c0.a(f12, "calculate_odt_timeout", this.S);
        this.T = c0.a(f12, "async_odt_query", this.T);
        this.U = c0.a(f12, "ad_request_timeout", this.U);
        this.V = c0.a(f12, "controller_heartbeat_interval", this.V);
        this.W = c0.a(f12, "controller_heartbeat_timeout", this.W);
        this.Y = c0.a(f12, "enable_compression", false);
        com.adcolony.sdk.v.a().a(f12.n("odt_config"), new r(this));
    }

    private boolean c(f1 f1Var) {
        if (f1Var == null) {
            return false;
        }
        try {
            try {
                f1 f11 = c0.f(f1Var, "controller");
                this.f23801w = c0.h(f11, "url");
                this.f23802x = c0.h(f11, "sha1");
                this.f23803y = c0.h(f1Var, "status");
                b(f1Var);
                if (AdColonyEventTracker.a()) {
                    AdColonyEventTracker.b();
                }
            } catch (Exception unused) {
            }
        } catch (Exception unused2) {
            new File(this.f23786h.a() + "026ae9c9824b3e483fa6c71fa88f57ae27816141").delete();
        }
        if (this.f23803y.equals("disable") && !com.adcolony.sdk.l.H) {
            try {
                new File(this.f23786h.a() + "7bf3a1e7bbd31e612eda3310c2cdb8075c43c6b5").delete();
            } catch (Exception unused3) {
            }
            new e0.a().a("Launch server response with disabled status. Disabling AdColony ").a("until next launch.").a(e0.f23705g);
            AdColony.disable();
            return false;
        }
        if ((!this.f23801w.equals("") && !this.f23803y.equals("")) || com.adcolony.sdk.l.H) {
            return true;
        }
        new e0.a().a("Missing controller status or URL. Disabling AdColony until next ").a("launch.").a(e0.f23707i);
        return false;
    }

    public class t implements Application.ActivityLifecycleCallbacks {

        private final Set<Integer> f23827a = new HashSet();

        public t() {
        }

        @Override
        public void onActivityCreated(@NonNull Activity activity, Bundle bundle) {
            if (!k.this.f23781c.f()) {
                k.this.f23781c.c(true);
            }
            com.adcolony.sdk.a.a(activity);
        }

        @Override
        public void onActivityPaused(@NonNull Activity activity) {
            com.adcolony.sdk.a.f23477d = false;
            k.this.f23781c.d(false);
        }

        @Override
        public void onActivityResumed(@NonNull Activity activity) {
            ScheduledExecutorService scheduledExecutorService;
            this.f23827a.add(Integer.valueOf(activity.hashCode()));
            com.adcolony.sdk.a.f23477d = true;
            com.adcolony.sdk.a.a(activity);
            s0 a11 = k.this.q().a();
            Context a12 = com.adcolony.sdk.a.a();
            if (a12 != null && k.this.f23781c.e() && (a12 instanceof com.adcolony.sdk.b) && !((com.adcolony.sdk.b) a12).f23534d) {
                return;
            }
            com.adcolony.sdk.a.a(activity);
            if (k.this.f23797s != null) {
                if (!Objects.equals(c0.h(k.this.f23797s.a(), "m_origin"), "")) {
                    k.this.f23797s.a(k.this.f23797s.a()).c();
                }
                k.this.f23797s = null;
            }
            k.this.B = false;
            k.this.f23781c.g(false);
            if (k.this.E && !k.this.f23781c.f()) {
                k.this.f23781c.c(true);
            }
            k.this.f23781c.d(true);
            k.this.f23783e.c();
            if (a11 == null || (scheduledExecutorService = a11.f23977b) == null || scheduledExecutorService.isShutdown() || a11.f23977b.isTerminated()) {
                AdColony.a(activity, com.adcolony.sdk.a.b().f23796r);
            }
        }

        @Override
        public void onActivityStarted(@NonNull Activity activity) {
            k.this.f23781c.e(true);
        }

        @Override
        public void onActivityStopped(@NonNull Activity activity) {
            this.f23827a.remove(Integer.valueOf(activity.hashCode()));
            if (this.f23827a.isEmpty()) {
                k.this.f23781c.e(false);
            }
        }

        @Override
        public void onActivityDestroyed(@NonNull Activity activity) {
        }

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

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

    public void c(boolean z11) {
        this.B = z11;
    }

    public com.adcolony.sdk.d c() {
        if (this.f23782d == null) {
            com.adcolony.sdk.d dVar = new com.adcolony.sdk.d();
            this.f23782d = dVar;
            dVar.h();
        }
        return this.f23782d;
    }

    private boolean a(boolean z11) {
        return a(z11, false);
    }

    public boolean a(boolean z11, boolean z12) {
        if (!com.adcolony.sdk.a.c()) {
            return false;
        }
        this.I = z12;
        this.F = z11;
        if (z11 && !z12) {
            if (!L()) {
                return false;
            }
            this.I = true;
        }
        K();
        return true;
    }

    private boolean a(f1 f1Var) {
        if (!this.F) {
            return true;
        }
        f1 f1Var2 = this.f23798t;
        if (f1Var2 != null && c0.h(c0.f(f1Var2, "controller"), "sha1").equals(c0.h(c0.f(f1Var, "controller"), "sha1"))) {
            return false;
        }
        new e0.a().a("Controller sha1 does not match, downloading new controller.").a(e0.f23705g);
        return true;
    }

    public void a(h0 h0Var) {
        a(c0.d(h0Var.a(), "id"));
    }

    public void a(com.adcolony.sdk.s sVar) {
        if (sVar.f23973n) {
            f1 a11 = c0.a(sVar.f23972m, "Parsing launch response");
            c0.a(a11, "sdkVersion", n().I());
            c0.j(a11, this.f23786h.a() + "026ae9c9824b3e483fa6c71fa88f57ae27816141");
            if (!c(a11)) {
                if (this.F) {
                    return;
                }
                new e0.a().a("Incomplete or disabled launch server response. ").a("Disabling AdColony until next launch.").a(e0.f23706h);
                b(true);
                return;
            }
            if (a(a11)) {
                f1 b11 = c0.b();
                c0.a(b11, "url", this.f23801w);
                c0.a(b11, "filepath", this.f23786h.a() + "7bf3a1e7bbd31e612eda3310c2cdb8075c43c6b5");
                this.f23780b.a(new com.adcolony.sdk.s(new h0("WebServices.download", 0, b11), new n()));
            }
            this.f23798t = a11;
            return;
        }
        S();
    }

    private boolean a(String str) {
        Context a11 = com.adcolony.sdk.a.a();
        if (a11 == null) {
            return false;
        }
        File file = new File(a11.getFilesDir().getAbsolutePath() + "/adc3/7bf3a1e7bbd31e612eda3310c2cdb8075c43c6b5");
        if (file.exists()) {
            return z0.a(str, file);
        }
        return false;
    }

    public void a() {
        this.f23782d.a();
        P();
    }

    public void a(AdColonyAppOptions adColonyAppOptions) {
        this.D.a(false);
        this.f23782d.b();
        R();
        AdColony.a(com.adcolony.sdk.a.a(), adColonyAppOptions);
        T();
        this.f23799u.clear();
        this.f23796r = adColonyAppOptions;
        this.f23779a.a();
        a(true, true);
    }

    public boolean a(k0 k0Var) {
        this.f23800v.remove(Integer.valueOf(k0Var.getAdc3ModuleId()));
        return this.f23779a.b(k0Var);
    }

    public boolean a(int i11) {
        this.f23800v.remove(Integer.valueOf(i11));
        return this.f23779a.b(i11);
    }

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

    public void a(com.adcolony.sdk.c cVar) {
        this.f23790l = cVar;
    }

    public void a(AdColonyAdView adColonyAdView) {
        this.f23792n = adColonyAdView;
    }

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

    public void a(long j11) {
        this.D.a(j11);
    }
}