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

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


package com.moat.analytics.mobile.iro;

import android.os.Handler;
import android.os.Looper;
import com.tapjoy.TapjoyConstants;
import java.util.Iterator;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
public final class t {
    private static final Queue<b> f397 = new ConcurrentLinkedQueue();
    private static t f398;
    private Handler f410;
    private long f401 = TapjoyConstants.SESSION_ID_INACTIVITY_TIME;
    private long f399 = 60000;
    volatile int f402 = c.f418;
    volatile boolean f404 = false;
    volatile boolean f405 = false;
    volatile int f407 = 200;
    volatile int f400 = 10;
    private final AtomicBoolean f408 = new AtomicBoolean(false);
    private volatile long f409 = 0;
    private final AtomicInteger f403 = new AtomicInteger(0);
    private final AtomicBoolean f406 = new AtomicBoolean(false);

    interface a {
        void mo287() throws o;
    }

    interface e {
        void mo352(i iVar) throws o;
    }

    public static final class c {
        public static final int f418 = 1;
        public static final int f419 = 2;

        static {
            int[] iArr = {1, 2};
        }
    }

    public static synchronized t m341() {
        t tVar;
        synchronized (t.class) {
            if (f398 == null) {
                f398 = new t();
            }
            tVar = f398;
        }
        return tVar;
    }

    private t() {
        try {
            this.f410 = new Handler(Looper.getMainLooper());
        } catch (Exception e2) {
            o.m312(e2);
        }
    }

    public final void m350() {
        if (System.currentTimeMillis() - this.f409 > this.f401) {
            m343(0L);
        }
    }

    public void m343(final long j) {
        if (this.f406.compareAndSet(false, true)) {
            com.moat.analytics.mobile.iro.b.m204(3, "OnOff", this, "Performing status check.");
            new Thread() {
                @Override
                public final void run() {
                    Looper.prepare();
                    Handler handler = new Handler();
                    handler.postDelayed(new d("IRO", handler, new e() {
                        @Override
                        public final void mo352(i iVar) throws o {
                            synchronized (t.f397) {
                                boolean z = ((j) MoatAnalytics.getInstance()).f343;
                                if (t.this.f402 != iVar.m282() || (t.this.f402 == c.f418 && z)) {
                                    t.this.f402 = iVar.m282();
                                    if (t.this.f402 == c.f418 && z) {
                                        t.this.f402 = c.f419;
                                    }
                                    if (t.this.f402 == c.f419) {
                                        com.moat.analytics.mobile.iro.b.m204(3, "OnOff", this, "Moat enabled - Version 2.4.0");
                                    }
                                    for (b bVar : t.f397) {
                                        if (t.this.f402 == c.f419) {
                                            bVar.f415.mo287();
                                        }
                                    }
                                }
                                while (!t.f397.isEmpty()) {
                                    t.f397.remove();
                                }
                            }
                        }
                    }), j);
                    Looper.loop();
                }
            }.start();
        }
    }

    public final void m351(a aVar) throws o {
        if (this.f402 == c.f419) {
            aVar.mo287();
            return;
        }
        m339();
        f397.add(new b(Long.valueOf(System.currentTimeMillis()), aVar));
        if (!this.f408.compareAndSet(false, true)) {
            return;
        }
        this.f410.postDelayed(new Runnable() {
            @Override
            public final void run() {
                try {
                    if (t.f397.size() > 0) {
                        t.m339();
                        t.this.f410.postDelayed(this, 60000L);
                    } else {
                        t.this.f408.compareAndSet(true, false);
                        t.this.f410.removeCallbacks(this);
                    }
                } catch (Exception e2) {
                    o.m312(e2);
                }
            }
        }, 60000L);
    }

    public static void m339() {
        synchronized (f397) {
            long currentTimeMillis = System.currentTimeMillis();
            Iterator<b> it = f397.iterator();
            while (it.hasNext()) {
                if (currentTimeMillis - it.next().f417.longValue() >= 60000) {
                    it.remove();
                }
            }
            if (f397.size() >= 15) {
                for (int i = 0; i < 5; i++) {
                    f397.remove();
                }
            }
        }
    }

    class d implements Runnable {
        private final Handler f420;
        private final AnonymousClass5.AnonymousClass2 f421;
        private final String f422;

        private d(String str, Handler handler, AnonymousClass5.AnonymousClass2 anonymousClass2) {
            this.f421 = anonymousClass2;
            this.f420 = handler;
            this.f422 = "https://z.moatads.com/" + str + "/android/" + "2bc3418b93f01686fcbd1ebebcc04694651821b2".substring(0, 7) + "/status.json";
        }

        private String m354() {
            try {
                return l.m308(this.f422 + "?ts=" + System.currentTimeMillis() + "&v=2.4.0").get();
            } catch (Exception e) {
                return null;
            }
        }

        @Override
        public final void run() {
            try {
                String m354 = m354();
                final i iVar = new i(m354);
                t.this.f404 = iVar.m279();
                t.this.f405 = iVar.m281();
                t.this.f407 = iVar.m280();
                t.this.f400 = iVar.m283();
                new Handler(Looper.getMainLooper()).post(new Runnable() {
                    @Override
                    public final void run() {
                        try {
                            mo352(iVar);
                        } catch (Exception e) {
                            o.m312(e);
                        }
                    }
                });
                t.this.f409 = System.currentTimeMillis();
                t.this.f406.compareAndSet(true, false);
                if (m354 == null) {
                    if (t.this.f403.incrementAndGet() < 10) {
                        t.this.m343(t.this.f399);
                    }
                } else {
                    t.this.f403.set(0);
                }
            } catch (Exception e) {
                o.m312(e);
            }
            this.f420.removeCallbacks(this);
            Looper myLooper = Looper.myLooper();
            if (myLooper != null) {
                myLooper.quit();
            }
        }
    }

    public class b {
        final a f415;
        final Long f417;

        b(Long l, a aVar) {
            this.f417 = l;
            this.f415 = aVar;
        }
    }
}