九游游戏中心HD v4.6.8.1版本的 MD5 值为:78c397802cc5ffdcc7f5502ede90502e

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


package com.d.a;

import com.UCMobile.Apollo.ApolloMetaData;
import com.d.a.e;
import java.util.ArrayList;
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.json.JSONArray;
import org.json.JSONObject;
public final class c {
    int A;
    public final ReadWriteLock B;
    ArrayList<String> C;
    ArrayList<String> D;
    boolean E;
    int F;
    public final String I;
    public long J;
    boolean K;
    public final String L;
    public AtomicBoolean M;
    private long P;
    public final String f4006a;
    public final String b;
    public final int c;
    public final int d;
    public final int e;
    public final int f;
    public final int g;
    public final int h;
    public final int i;
    public final int j;
    public final int k;
    public final int l;
    public final int m;
    public final int n;
    long o;
    public final String p;
    public String q;
    public final String r;
    public final String s;
    public final boolean t;
    boolean u;
    String v;
    int w;
    String x;
    int y;
    int z;
    private static boolean Q = false;
    static boolean G = true;
    public static long H = 0;
    public static long N = 3600000;
    private static AtomicBoolean R = new AtomicBoolean(false);
    public static long O = 120000;
    private static AtomicLong S = new AtomicLong();

    private static class a {
        static c f4007a = new c((byte) 0);
    }

    c(byte b) {
        this();
    }

    public static c a() {
        return a.f4007a;
    }

    private c() {
        this.f4006a = "http://";
        this.b = "\n";
        this.c = 4;
        this.d = 2;
        this.e = 4;
        this.f = 1;
        this.g = 3;
        this.h = 8;
        this.i = 300;
        this.j = 3;
        this.k = 25;
        this.l = 50;
        this.m = 29;
        this.n = 10;
        this.o = 0L;
        this.P = 0L;
        this.p = "a-1.6.3";
        this.q = "";
        this.r = com.taobao.dp.client.b.OS;
        this.s = "2.0";
        this.t = false;
        this.B = new ReentrantReadWriteLock();
        this.I = "datacollection.com";
        this.J = 0L;
        this.K = true;
        this.L = "httpdns_HttpDnsArgs";
        this.M = new AtomicBoolean(false);
        this.u = false;
        this.F = 0;
        this.y = 12000;
        this.z = 12000;
        this.E = false;
        H = new Random().nextInt(100);
        this.A = new Random().nextInt(100);
        this.C = new ArrayList<>();
        this.D = new ArrayList<>();
        this.D.add("110.75.114.7");
        this.D.add("42.156.162.8");
        this.v = "httpdns.danuoyi.tbcache.com";
        this.x = "/multi_dns_resolve";
        this.w = 80;
        this.J = System.currentTimeMillis();
    }

    public static void b() {
        if (c()) {
            e.a.f4011a.a("datacollection.com");
        }
    }

    public static boolean c() {
        return H < -1;
    }

    public final void a(ArrayList<String> arrayList) {
        this.B.writeLock().lock();
        this.C.clear();
        int size = arrayList.size();
        if (size > 0) {
            G = false;
        }
        for (int i = 0; i < size; i++) {
            this.C.add(arrayList.get(i));
        }
        this.B.writeLock().unlock();
    }

    public final String d() {
        return ((("http://" + this.v) + ":") + String.valueOf(this.w)) + this.x;
    }

    public static boolean e() {
        return Q;
    }

    public final void a(int i) {
        if (i == 3) {
            this.B.writeLock().lock();
            this.C.clear();
            this.B.writeLock().unlock();
        }
        this.B.writeLock().lock();
        if (this.F == 0) {
            this.J = System.currentTimeMillis();
        }
        this.F++;
        this.B.writeLock().unlock();
    }

    public final void f() {
        this.B.writeLock().lock();
        this.F = 0;
        this.J = System.currentTimeMillis();
        this.B.writeLock().unlock();
    }

    public final void a(boolean z) {
        this.B.writeLock().lock();
        if (this.E != z) {
            this.E = z;
        }
        this.B.writeLock().unlock();
    }

    public final long g() {
        this.B.readLock().lock();
        long j = this.P;
        this.B.readLock().unlock();
        return j;
    }

    public final void a(long j) {
        this.B.writeLock().lock();
        this.P = j;
        this.B.writeLock().unlock();
    }

    public final JSONObject h() {
        JSONObject jSONObject = new JSONObject();
        JSONArray jSONArray = new JSONArray();
        this.B.readLock().lock();
        for (int i = 0; i < this.C.size(); i++) {
            try {
                try {
                    JSONObject jSONObject2 = new JSONObject();
                    jSONObject2.put(ApolloMetaData.KEY_IP, this.C.get(i));
                    jSONArray.put(jSONObject2);
                } catch (Exception e) {
                    f.b("httpdns", "create server Json failed: " + e.getMessage());
                    this.B.readLock().unlock();
                    if (jSONObject.length() > 0) {
                        return jSONObject;
                    }
                }
            } catch (Throwable th) {
                this.B.readLock().unlock();
                if (jSONObject.length() > 0) {
                    return jSONObject;
                }
                throw th;
            }
        }
        if (jSONArray.length() > 0) {
            jSONObject.put("host", this.v);
            jSONObject.put("port", this.w);
            jSONObject.put("ips", jSONArray);
        }
        this.B.readLock().unlock();
        if (jSONObject.length() > 0) {
            return jSONObject;
        }
        return null;
    }

    public final boolean i() {
        this.B.readLock().lock();
        boolean z = this.K;
        this.B.readLock().unlock();
        return z;
    }

    public static void j() {
        R.set(true);
        S.set(System.currentTimeMillis());
    }

    public static void k() {
        R.set(false);
    }

    public static boolean l() {
        return R.get() && System.currentTimeMillis() - S.get() > O;
    }

    public final boolean m() {
        if (this.F <= 0 || this.J + 1800000 >= System.currentTimeMillis()) {
            return false;
        }
        f.b("httpdns", "[clearFailCount] - true.");
        f();
        return true;
    }
}