QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

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


package com.tencent.odk.player;

import android.content.Context;
import android.text.TextUtils;
import com.facebook.common.util.UriUtil;
import com.tencent.common.http.NetUtils;
import com.tencent.odk.player.client.a.m;
import com.tencent.odk.player.client.d.i;
import com.tencent.odk.player.client.repository.b;
import com.tencent.odk.player.client.repository.c;
import com.tencent.odk.player.client.repository.vo.ReportStrategy;
import com.tencent.omg.mid.local.LocalMid;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;

public class StatConfig {

    private static String f76383a = "http://mtrace.qq.com/mkvcollect";

    private static String f76384b = "https://mtrace.qq.com/mkvcollect";

    private static boolean f76385c = true;

    private static volatile String f76386d = "https://btrace.qq.com/kvcollect";
    private static boolean e = false;
    private static int f = 100000;
    private static int g = 30;
    private static int h = 10;
    private static ExecutorService i;
    private static ExecutorService j;
    private static ScheduledExecutorService k;

    private static String a(String str, String str2) {
        StringBuilder sb = new StringBuilder(str.length() + str2.length() + 10);
        if (!str.startsWith(UriUtil.HTTP_SCHEME)) {
            sb.append(NetUtils.SCHEME_HTTP);
        }
        sb.append(str);
        if (!str.endsWith("/") && !str2.startsWith("/")) {
            sb.append("/");
        }
        sb.append(str2);
        return sb.toString();
    }

    public static boolean enableHttps() {
        return f76385c;
    }

    public static String getAppKey(Context context) {
        return c.c(context);
    }

    public static String getBossReportUrl() {
        return f76386d;
    }

    public static ScheduledExecutorService getCheckOperatorExecutor() {
        return k;
    }

    public static String getCustomUserId(Context context) {
        return c.e(context);
    }

    public static ExecutorService getDbOperatorThreadPool() {
        return j;
    }

    public static int getMaxBatchReportCount() {
        return g;
    }

    public static int getMaxSendRetryCount() {
        return h;
    }

    public static int getMaxStoreEventCount() {
        return f;
    }

    public static String getMid(Context context) {
        return LocalMid.a(context).a();
    }

    public static ReportStrategy getReportStrategy(Context context) {
        return b.c(context);
    }

    public static ExecutorService getSendDataThreadPool() {
        return i;
    }

    public static String getStatReportUrl() {
        return f76385c ? f76384b : f76383a;
    }

    public static String getVersion(Context context) {
        return c.g(context);
    }

    public static boolean isDebugEnable() {
        return e;
    }

    public static void setAppKey(String str) {
        if (TextUtils.isEmpty(str) || str.length() > 256) {
            i.b("appkey in StatConfig.setAppKey() is null or exceed 256 bytes");
        } else {
            c.a(str);
        }
    }

    public static void setBossReportHost(String str) {
        if (TextUtils.isEmpty(str)) {
            i.b("setBossReportUrl host cannot be null or empty.");
            return;
        }
        String a2 = a(str, "kvcollect");
        try {
            new URL(a2);
            f76386d = a2;
            i.d("setBossReportUrl url:" + f76386d + ", host:" + str);
        } catch (MalformedURLException e2) {
            i.b("setBossReportUrl setBossReportHost " + e2);
        }
    }

    public static void setBossReportUrl(String str) {
        if (TextUtils.isEmpty(str)) {
            i.b("setBossReportUrl host cannot be null or empty.");
            return;
        }
        if (str.endsWith("/")) {
            str = str.substring(0, str.length() - 1);
        }
        try {
            new URL(str);
            f76386d = str;
            i.d("setBossReportHost url:" + f76386d);
        } catch (MalformedURLException e2) {
            i.b("setBossReportUrl " + str + e2);
        }
    }

    public static void setCheckOperatorExecutor(ScheduledExecutorService scheduledExecutorService) {
        k = scheduledExecutorService;
    }

    public static void setCustomUserId(Context context, String str) {
        c.b(str);
    }

    public static void setDbOperatorThreadPool(ExecutorService executorService) {
        j = executorService;
    }

    public static void setDebugEnable(boolean z) {
        e = z;
    }

    public static void setEnbleHttps(boolean z) {
        f76385c = z;
    }

    public static void setInstallChannel(String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        if (str.length() > 128) {
            i.b("the length of installChannel can not exceed the range of 128 bytes.");
        } else {
            c.c(str);
        }
    }

    public static void setLogCallback(LogCallback logCallback) {
        i.a(logCallback);
    }

    public static void setMaxBatchReportCount(int i2) {
        if (i2 < 2 || i2 > 100) {
            i.b("setMaxBatchReportCount can not exceed the range of [2,100].");
        } else {
            g = i2;
        }
    }

    public static void setMaxSendRetryCount(int i2) {
        if (i2 < 1 || i2 > 1000) {
            i.b("setMaxSendRetryCount can not exceed the range of [1,1000].");
        } else {
            h = i2;
        }
    }

    public static void setMaxStoreEventCount(int i2) {
        if (i2 < 5000 || i2 > 100000) {
            i.b("setMaxStoreEventCount can not exceed the range of [5000, 100000].");
        } else {
            f = i2;
        }
    }

    public static void setMtaReportHost(String str) {
        m.b(str);
    }

    public static void setMtaReportUrl(String str) {
        m.a(str);
    }

    public static void setReportStrategy(Context context, int i2) {
        b.a(context, ReportStrategy.a(i2));
    }

    public static void setSendDataThreadPool(ExecutorService executorService) {
        i = executorService;
    }

    public static void setStatReportHost(String str) {
        if (TextUtils.isEmpty(str)) {
            i.b("setStatReportHost host cannot be null or empty.");
            return;
        }
        String a2 = a(str, "mkvcollect");
        try {
            new URL(a2);
            f76383a = a2;
            i.d("setStatReportHost url:" + f76383a + ", host:" + str);
        } catch (MalformedURLException e2) {
            i.b("setStatReportHost " + str + " " + e2.toString());
        }
    }

    public static void setStatReportUrl(String str) {
        if (TextUtils.isEmpty(str)) {
            i.b("statReportUrl cannot be null or empty.");
            return;
        }
        try {
            new URL(str);
            f76383a = str;
            i.d("setStatReportUrl:" + f76383a);
        } catch (Exception e2) {
            i.b("setStatReportUrl " + str + " " + e2.toString());
        }
    }

    public static void setVersion(String str) {
        c.d(str);
    }
}