湘游汇 v1.0版本的 MD5 值为:85338391d88b5d57da66e240ece801c7

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


package com.tencent.c.a;

import android.content.Context;
import android.os.Build;
import java.net.URI;
import java.util.Iterator;
import org.cocos2dx.lib.BuildConfig;
import org.json.JSONException;
import org.json.JSONObject;
public class c {
    private static String C;
    private static String D;
    private static com.tencent.c.a.a.b q = com.tencent.c.a.a.n.b();
    static ag f777a = new ag(2);
    static ag b = new ag(1);
    private static d r = d.APP_LAUNCH;
    private static boolean s = false;
    private static boolean t = true;
    private static int u = 30000;
    private static int v = 100000;
    private static int w = 30;
    private static int x = 10;
    private static int y = 100;
    private static int z = 30;
    private static int A = 1;
    static String c = "__HIBERNATE__";
    static String d = "__HIBERNATE__TIME";
    static String e = "__MTA_KILL__";
    private static String B = null;
    private static String E = "mta_channel";
    static String f = BuildConfig.FLAVOR;
    private static int F = 180;
    static boolean g = false;
    static int h = 100;
    static long i = 10000;
    private static int G = 1024;
    static boolean j = true;
    private static long H = 0;
    private static long I = 300000;
    public static boolean k = true;
    static volatile String l = "pingma.qq.com:80";
    private static volatile String J = "http://pingma.qq.com:80/mstat/report";
    private static int K = 0;
    private static volatile int L = 0;
    private static int M = 20;
    private static int N = 0;
    private static boolean O = false;
    private static int P = 4096;
    private static boolean Q = false;
    private static String R = null;
    private static boolean S = false;
    private static ah T = null;
    static boolean m = true;
    static int n = 0;
    static long o = 10000;
    static int p = 512;

    public static d a() {
        return r;
    }

    public static synchronized String a(Context context) {
        String str;
        synchronized (c.class) {
            str = C;
        }
        return str;
    }

    public static String a(String str, String str2) {
        String string;
        try {
            string = b.b.getString(str);
        } catch (Throwable unused) {
            com.tencent.c.a.a.b bVar = q;
            bVar.d("can't find custom key:" + str);
        }
        return string != null ? string : str2;
    }

    public static void a(int i2) {
        if (a(i2, 1, 10080)) {
            F = i2;
        } else {
            q.e("setSendPeriodMinutes can not exceed the range of [1, 7*24*60] minutes.");
        }
    }

    static void a(long j2) {
        com.tencent.c.a.a.s.b(aj.a(), c, j2);
        a(false);
        q.c("MTA is disable for current SDK version");
    }

    public static void a(Context context, ag agVar) {
        if (agVar.f761a != b.f761a) {
            if (agVar.f761a == f777a.f761a) {
                f777a = agVar;
                return;
            }
            return;
        }
        b = agVar;
        a(agVar.b);
        if (b.b.isNull("iplist")) {
            return;
        }
        h.a(context).a(b.b.getString("iplist"));
    }

    static void a(Context context, ag agVar, JSONObject jSONObject) {
        boolean z2 = false;
        try {
            Iterator<String> keys = jSONObject.keys();
            while (keys.hasNext()) {
                String next = keys.next();
                if (next.equalsIgnoreCase("v")) {
                    int i2 = jSONObject.getInt(next);
                    if (agVar.d != i2) {
                        z2 = true;
                    }
                    agVar.d = i2;
                } else if (next.equalsIgnoreCase("c")) {
                    String string = jSONObject.getString("c");
                    if (string.length() > 0) {
                        agVar.b = new JSONObject(string);
                    }
                } else if (next.equalsIgnoreCase("m")) {
                    agVar.c = jSONObject.getString("m");
                }
            }
            if (z2) {
                s a2 = s.a(aj.a());
                if (a2 != null) {
                    a2.a(agVar);
                }
                if (agVar.f761a == b.f761a) {
                    a(agVar.b);
                    b(agVar.b);
                }
            }
            a(context, agVar);
        } catch (Throwable th) {
            q.b(th);
        }
    }

    public static void a(Context context, String str) {
        com.tencent.c.a.a.b bVar;
        String str2;
        if (context == null) {
            bVar = q;
            str2 = "ctx in StatConfig.setAppKey() is null";
        } else if (str != null && str.length() <= 256) {
            C = str;
            return;
        } else {
            bVar = q;
            str2 = "appkey in StatConfig.setAppKey() is null or exceed 256 bytes";
        }
        bVar.e(str2);
    }

    public static void a(Context context, JSONObject jSONObject) {
        JSONObject jSONObject2;
        ag agVar;
        try {
            Iterator<String> keys = jSONObject.keys();
            while (keys.hasNext()) {
                String next = keys.next();
                if (next.equalsIgnoreCase(Integer.toString(b.f761a))) {
                    jSONObject2 = jSONObject.getJSONObject(next);
                    agVar = b;
                } else if (next.equalsIgnoreCase(Integer.toString(f777a.f761a))) {
                    jSONObject2 = jSONObject.getJSONObject(next);
                    agVar = f777a;
                } else if (!next.equalsIgnoreCase("rs")) {
                    return;
                } else {
                    d a2 = d.a(jSONObject.getInt(next));
                    if (a2 != null) {
                        r = a2;
                        if (b()) {
                            com.tencent.c.a.a.b bVar = q;
                            bVar.h("Change to ReportStrategy:" + a2.name());
                        }
                    }
                }
                a(context, agVar, jSONObject2);
            }
        } catch (JSONException e2) {
            q.b((Throwable) e2);
        }
    }

    public static void a(d dVar) {
        r = dVar;
        if (dVar != d.PERIOD) {
            f.c = 0L;
        }
        if (b()) {
            com.tencent.c.a.a.b bVar = q;
            bVar.h("Change to statSendStrategy: " + dVar);
        }
    }

    public static void a(String str) {
        D = str;
    }

    static void a(JSONObject jSONObject) {
        try {
            d a2 = d.a(jSONObject.getInt("rs"));
            if (a2 != null) {
                a(a2);
            }
        } catch (JSONException unused) {
            if (b()) {
                q.b("rs not found.");
            }
        }
    }

    public static void a(boolean z2) {
        t = z2;
        if (z2) {
            return;
        }
        q.c("!!!!!!MTA StatService has been disabled!!!!!!");
    }

    static boolean a(int i2, int i3, int i4) {
        return i2 >= i3 && i2 <= i4;
    }

    static boolean a(JSONObject jSONObject, String str, String str2) {
        if (jSONObject.isNull(str)) {
            return false;
        }
        String optString = jSONObject.optString(str);
        return com.tencent.c.a.a.n.c(str2) && com.tencent.c.a.a.n.c(optString) && str2.equalsIgnoreCase(optString);
    }

    public static synchronized String b(Context context) {
        String str;
        synchronized (c.class) {
            str = D;
        }
        return str;
    }

    public static synchronized void b(int i2) {
        synchronized (c.class) {
            L = i2;
        }
    }

    public static void b(Context context, String str) {
        if (str.length() > 128) {
            q.e("the length of installChannel can not exceed the range of 128 bytes.");
        } else {
            D = str;
        }
    }

    static void b(Context context, JSONObject jSONObject) {
        int i2;
        Integer valueOf;
        try {
            String optString = jSONObject.optString(e);
            if (com.tencent.c.a.a.n.c(optString)) {
                JSONObject jSONObject2 = new JSONObject(optString);
                if (jSONObject2.length() == 0) {
                    return;
                }
                boolean z2 = false;
                if (!jSONObject2.isNull("sm")) {
                    Object obj = jSONObject2.get("sm");
                    if (obj instanceof Integer) {
                        valueOf = (Integer) obj;
                    } else if (obj instanceof String) {
                        valueOf = Integer.valueOf((String) obj);
                    } else {
                        i2 = 0;
                        if (i2 > 0) {
                            if (b()) {
                                com.tencent.c.a.a.b bVar = q;
                                bVar.b("match sleepTime:" + i2 + " minutes");
                            }
                            com.tencent.c.a.a.s.b(context, d, System.currentTimeMillis() + (i2 * 60 * 1000));
                            a(false);
                            q.c("MTA is disable for current SDK version");
                        }
                    }
                    i2 = valueOf.intValue();
                    if (i2 > 0) {
                    }
                }
                if (a(jSONObject2, "sv", "2.0.4")) {
                    q.b("match sdk version:2.0.4");
                    z2 = true;
                }
                if (a(jSONObject2, "md", Build.MODEL)) {
                    com.tencent.c.a.a.b bVar2 = q;
                    bVar2.b("match MODEL:" + Build.MODEL);
                    z2 = true;
                }
                if (a(jSONObject2, "av", com.tencent.c.a.a.n.g(context))) {
                    com.tencent.c.a.a.b bVar3 = q;
                    bVar3.b("match app version:" + com.tencent.c.a.a.n.g(context));
                    z2 = true;
                }
                if (a(jSONObject2, "mf", Build.MANUFACTURER)) {
                    com.tencent.c.a.a.b bVar4 = q;
                    bVar4.b("match MANUFACTURER:" + Build.MANUFACTURER);
                    z2 = true;
                }
                StringBuilder sb = new StringBuilder();
                sb.append(Build.VERSION.SDK_INT);
                if (a(jSONObject2, "osv", sb.toString())) {
                    com.tencent.c.a.a.b bVar5 = q;
                    bVar5.b("match android SDK version:" + Build.VERSION.SDK_INT);
                    z2 = true;
                }
                StringBuilder sb2 = new StringBuilder();
                sb2.append(Build.VERSION.SDK_INT);
                if (a(jSONObject2, "ov", sb2.toString())) {
                    com.tencent.c.a.a.b bVar6 = q;
                    bVar6.b("match android SDK version:" + Build.VERSION.SDK_INT);
                    z2 = true;
                }
                if (a(jSONObject2, "ui", s.a(context).b(context).b())) {
                    com.tencent.c.a.a.b bVar7 = q;
                    bVar7.b("match imei:" + s.a(context).b(context).b());
                    z2 = true;
                }
                if (a(jSONObject2, "mid", e(context))) {
                    com.tencent.c.a.a.b bVar8 = q;
                    bVar8.b("match mid:" + e(context));
                    z2 = true;
                }
                if (z2) {
                    a(com.tencent.c.a.a.n.b("2.0.4"));
                }
            }
        } catch (Exception e2) {
            q.b((Throwable) e2);
        }
    }

    public static void b(String str) {
        if (str == null || str.length() == 0) {
            q.e("statReportUrl cannot be null or empty.");
            return;
        }
        J = str;
        try {
            l = new URI(J).getHost();
        } catch (Exception e2) {
            q.d(e2);
        }
        if (b()) {
            com.tencent.c.a.a.b bVar = q;
            bVar.b("url:" + J + ", domain:" + l);
        }
    }

    static void b(JSONObject jSONObject) {
        if (jSONObject == null || jSONObject.length() == 0) {
            return;
        }
        try {
            b(aj.a(), jSONObject);
            String string = jSONObject.getString(c);
            if (b()) {
                com.tencent.c.a.a.b bVar = q;
                bVar.h("hibernateVer:" + string + ", current version:2.0.4");
            }
            long b2 = com.tencent.c.a.a.n.b(string);
            if (com.tencent.c.a.a.n.b("2.0.4") <= b2) {
                a(b2);
            }
        } catch (JSONException unused) {
            q.h("__HIBERNATE__ not found.");
        }
    }

    public static void b(boolean z2) {
        j = z2;
    }

    public static boolean b() {
        return s;
    }

    public static String c(Context context) {
        return com.tencent.c.a.a.s.a(context, "mta.acc.qq", f);
    }

    public static void c(int i2) {
        if (i2 < 0) {
            return;
        }
        N = i2;
    }

    public static boolean c() {
        return t;
    }

    public static int d() {
        return u;
    }

    public static String d(Context context) {
        if (context == null) {
            q.e("Context for getCustomUid is null.");
            return null;
        }
        if (R == null) {
            R = com.tencent.c.a.a.s.a(context, "MTA_CUSTOM_UID", BuildConfig.FLAVOR);
        }
        return R;
    }

    public static int e() {
        return y;
    }

    public static String e(Context context) {
        return context != null ? com.tencent.a.a.a.a.g.a(context).a().a() : "0";
    }

    public static int f() {
        return z;
    }

    public static int g() {
        return x;
    }

    public static int h() {
        return A;
    }

    public static int i() {
        return w;
    }

    public static int j() {
        return v;
    }

    public static int k() {
        return F;
    }

    public static boolean l() {
        return k;
    }

    public static String m() {
        return J;
    }

    public static int n() {
        return M;
    }

    public static void o() {
        N++;
    }

    public static int p() {
        return N;
    }

    public static boolean q() {
        return Q;
    }

    public static ah r() {
        return T;
    }
}