酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

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


package com.d.a.a.e;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import com.huawei.hms.framework.common.ContainerUtils;
import com.kugou.svplayer.worklog.WorkLog;
import org.json.JSONObject;

public class u {
    public static void a(final Context context, Bundle bundle) {
        com.d.a.a.c.b.a.a().a("1".equals(n.b(context, "isGetCert", "1")), bundle, new com.d.a.a.c.b.b() {
            @Override
            public void a(String str, String str2, JSONObject jSONObject) {
                try {
                    if (jSONObject.has("resultcode") && "103000".equals(jSONObject.getString("resultcode"))) {
                        f.a("UmcConfigUtil", "uniConfig resultCode" + jSONObject.getString("resultcode"));
                        n.a(context, "isGetCert", "0");
                        u.b(context, jSONObject);
                    }
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
        });
    }

    public static void b(Context context, JSONObject jSONObject) {
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        try {
            synchronized (u.class) {
                n.a(context, "getConfigDate", t.b());
                if (jSONObject.has("client_valid")) {
                    n.a(context, "client_valid", System.currentTimeMillis() + (Integer.valueOf(jSONObject.getString("client_valid")).intValue() * 60 * 60 * 1000));
                }
                if (jSONObject.has("Configlist")) {
                    JSONObject jSONObject2 = jSONObject.getJSONObject("Configlist");
                    String str7 = null;
                    if (jSONObject2.has("CHANGE_HOST")) {
                        String string = jSONObject2.getString("CHANGE_HOST");
                        if (string.contains("M005")) {
                            String[] split = string.split(ContainerUtils.FIELD_DELIMITER);
                            int length = split.length;
                            int i = 0;
                            while (true) {
                                if (i >= length) {
                                    str5 = null;
                                    break;
                                }
                                str5 = split[i];
                                if (str5.contains("M005")) {
                                    break;
                                } else {
                                    i++;
                                }
                            }
                            if (!TextUtils.isEmpty(str5)) {
                                if (str5.contains(",")) {
                                    str6 = str5.substring(str5.indexOf(ContainerUtils.KEY_VALUE_DELIMITER) + 1, str5.indexOf(","));
                                    str = str5.substring(str5.lastIndexOf(ContainerUtils.KEY_VALUE_DELIMITER) + 1, str5.length());
                                } else {
                                    if (!str5.contains("https") && !str5.contains("HTTPS")) {
                                        if (str5.contains("http") || str5.contains("HTTP")) {
                                            str6 = str5.substring(str5.lastIndexOf(ContainerUtils.KEY_VALUE_DELIMITER) + 1, str5.length());
                                            str = null;
                                        }
                                    }
                                    str = str5.substring(str5.lastIndexOf(ContainerUtils.KEY_VALUE_DELIMITER) + 1, str5.length());
                                    str6 = null;
                                }
                                f.a("UmcConfigUtil", "HTTP:" + str6 + "||||||||HTTPS:" + str);
                                n.a(context, "httpHost", str6);
                                n.a(context, "httpsHost", str);
                            }
                            str6 = null;
                            str = null;
                            f.a("UmcConfigUtil", "HTTP:" + str6 + "||||||||HTTPS:" + str);
                            n.a(context, "httpHost", str6);
                            n.a(context, "httpsHost", str);
                        } else {
                            str = null;
                        }
                        if (string.contains("M007")) {
                            String[] split2 = string.split(ContainerUtils.FIELD_DELIMITER);
                            int length2 = split2.length;
                            int i2 = 0;
                            while (true) {
                                if (i2 >= length2) {
                                    str2 = null;
                                    break;
                                }
                                str2 = split2[i2];
                                if (str2.contains("M007")) {
                                    break;
                                } else {
                                    i2++;
                                }
                            }
                            if (!TextUtils.isEmpty(str2)) {
                                str2 = str2.substring(str2.lastIndexOf(ContainerUtils.KEY_VALUE_DELIMITER) + 1, str2.length());
                            }
                            f.a("UmcConfigUtil", "HTTPS:" + str2);
                            n.a(context, "logHost", str2);
                        } else {
                            str2 = null;
                        }
                    } else {
                        n.a(context, "httpHost", "");
                        n.a(context, "httpsHost", "");
                        n.a(context, "logHost", "");
                        str = null;
                        str2 = null;
                    }
                    if (jSONObject2.has("HOST_CERT_INFO")) {
                        String string2 = jSONObject2.getString("HOST_CERT_INFO");
                        String[] split3 = string2.split(ContainerUtils.FIELD_DELIMITER);
                        if (TextUtils.isEmpty(str2) || !str2.contains(WorkLog.SEPARATOR_KEY_VALUE)) {
                            str3 = str2;
                        } else {
                            str3 = str2.substring(0, str2.indexOf(WorkLog.SEPARATOR_KEY_VALUE));
                            f.a("UmcConfigUtil", "logHostWithoutHost:" + str3);
                        }
                        if (!TextUtils.isEmpty(str2) && string2.contains(str3)) {
                            int length3 = split3.length;
                            int i3 = 0;
                            while (true) {
                                if (i3 >= length3) {
                                    break;
                                }
                                String str8 = split3[i3];
                                if (!TextUtils.isEmpty(str2) && str8.contains(str3)) {
                                    str7 = str8;
                                    break;
                                }
                                i3++;
                            }
                            if (!TextUtils.isEmpty(str7)) {
                                str7 = str7.substring(str7.indexOf(WorkLog.SEPARATOR_KEY_VALUE), str7.indexOf(","));
                            }
                            f.a("UmcConfigUtil", "log CERT:");
                            n.a(context, "https://" + str2 + "/log/logReport", str7);
                        }
                        if (string2.contains("log1.cmpassport.com")) {
                            int length4 = split3.length;
                            int i4 = 0;
                            while (true) {
                                if (i4 >= length4) {
                                    break;
                                }
                                String str9 = split3[i4];
                                if (str9.contains("log1.cmpassport.com")) {
                                    str7 = str9;
                                    break;
                                }
                                i4++;
                            }
                            if (!TextUtils.isEmpty(str7)) {
                                str7 = str7.substring(str7.indexOf(WorkLog.SEPARATOR_KEY_VALUE), str7.indexOf(","));
                            }
                            f.a("UmcConfigUtil", "log1 CERT:");
                            n.a(context, "https://log1.cmpassport.com:9443/log/logReport", str7);
                        }
                        if (TextUtils.isEmpty(str) || !str.contains(WorkLog.SEPARATOR_KEY_VALUE)) {
                            str4 = str;
                        } else {
                            str4 = str.substring(0, str.indexOf(WorkLog.SEPARATOR_KEY_VALUE));
                            f.a("UmcConfigUtil", "httpsHostWithoutPort:" + str4);
                        }
                        if (!TextUtils.isEmpty(str) && string2.contains(str4)) {
                            int length5 = split3.length;
                            int i5 = 0;
                            while (true) {
                                if (i5 >= length5) {
                                    break;
                                }
                                String str10 = split3[i5];
                                if (!TextUtils.isEmpty(str) && str10.contains(str4)) {
                                    str7 = str10;
                                    break;
                                }
                                i5++;
                            }
                            if (!TextUtils.isEmpty(str7)) {
                                str7 = str7.substring(str7.indexOf(WorkLog.SEPARATOR_KEY_VALUE), str7.indexOf(","));
                            }
                            f.a("UmcConfigUtil", "httpsHost CERT:");
                            n.a(context, "https://" + str + "/unisdk/", str7);
                        }
                        if (string2.contains("onekey1.cmpassport.com")) {
                            int length6 = split3.length;
                            int i6 = 0;
                            while (true) {
                                if (i6 >= length6) {
                                    break;
                                }
                                String str11 = split3[i6];
                                if (str11.contains("onekey1.cmpassport.com")) {
                                    str7 = str11;
                                    break;
                                }
                                i6++;
                            }
                            if (!TextUtils.isEmpty(str7)) {
                                str7 = str7.substring(str7.indexOf(WorkLog.SEPARATOR_KEY_VALUE), str7.indexOf(","));
                            }
                            f.a("UmcConfigUtil", "omekey1 CERT:");
                            n.a(context, "https://onekey1.cmpassport.com/unisdk/", str7);
                        }
                    }
                    if (jSONObject2.has("CLOSE_CERT_VERIFY")) {
                        n.a(context, "CLOSE_CERT_VERIFY", jSONObject2.getString("CLOSE_CERT_VERIFY"));
                    } else {
                        n.a(context, "CLOSE_CERT_VERIFY", "0");
                    }
                    if (jSONObject2.has("CLOSE_FRIEND_WAPKS")) {
                        n.a(context, "CLOSE_FRIEND_WAPKS", jSONObject2.getString("CLOSE_FRIEND_WAPKS"));
                    } else {
                        n.a(context, "CLOSE_FRIEND_WAPKS", "0");
                    }
                    if (jSONObject2.has("CLOSE_LOGS_VERSION")) {
                        n.a(context, "CLOSE_LOGS_VERSION", jSONObject2.getString("CLOSE_LOGS_VERSION"));
                    } else {
                        n.a(context, "CLOSE_LOGS_VERSION", "0");
                    }
                    if (jSONObject2.has("LOGS_CONTROL")) {
                        String[] split4 = jSONObject2.getString("LOGS_CONTROL").replace("h", "").split(ContainerUtils.FIELD_DELIMITER);
                        if (split4.length > 0 && !TextUtils.isEmpty(split4[0])) {
                            n.a(context, "maxFailedLogTimes", Integer.parseInt(split4[0]));
                        }
                        if (1 < split4.length && !TextUtils.isEmpty(split4[1])) {
                            n.a(context, "pauseTime", Integer.parseInt(split4[1]));
                        }
                    } else {
                        n.a(context, "maxFailedLogTimes", 0);
                        n.a(context, "pauseTime", 0);
                    }
                    if (jSONObject2.has("CLOSE_IPV4_LIST")) {
                        n.a(context, "CLOSE_IPV4_LIST", jSONObject2.getString("CLOSE_IPV4_LIST"));
                    } else {
                        n.a(context, "CLOSE_IPV4_LIST", "0");
                    }
                    if (jSONObject2.has("CLOSE_IPV6_LIST")) {
                        n.a(context, "CLOSE_IPV6_LIST", jSONObject2.getString("CLOSE_IPV6_LIST"));
                    } else {
                        n.a(context, "CLOSE_IPV6_LIST", "1");
                    }
                    if (jSONObject2.has("CLOSE_M001_SDKVERSION_LIST")) {
                        n.a(context, "CLOSE_M001_SDKVERSION_LIST", jSONObject2.getString("CLOSE_M001_SDKVERSION_LIST"));
                    } else {
                        n.a(context, "CLOSE_M001_SDKVERSION_LIST", "0");
                    }
                    if (jSONObject2.has("CLOSE_M001_APPID_LIST")) {
                        n.a(context, "CLOSE_M001_APPID_LIST", jSONObject2.getString("CLOSE_M001_APPID_LIST"));
                    } else {
                        n.a(context, "CLOSE_M001_APPID_LIST", "0");
                    }
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public static boolean a(Context context) {
        synchronized (u.class) {
            boolean z = true;
            if (!t.b().equals(n.b(context, "getConfigDate", ""))) {
                return true;
            }
            if (System.currentTimeMillis() < n.b(context, "client_valid", 0L)) {
                z = false;
            }
            return z;
        }
    }

    public static boolean b(Context context) {
        boolean equals;
        synchronized (u.class) {
            try {
                try {
                    equals = "1".equals(n.b(context, "CLOSE_IPV4_LIST", "0"));
                } catch (Exception unused) {
                    return false;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return equals;
    }

    public static boolean c(Context context) {
        boolean equals;
        synchronized (u.class) {
            try {
                try {
                    equals = "1".equals(n.b(context, "CLOSE_IPV6_LIST", "1"));
                } catch (Exception unused) {
                    return true;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return equals;
    }

    public static String d(Context context) {
        String str;
        synchronized (u.class) {
            try {
                try {
                    String b2 = n.b(context, "httpHost", (String) null);
                    if (TextUtils.isEmpty(b2)) {
                        str = "http://www.cmpassport.com/unisdk/";
                    } else {
                        str = "http://" + b2 + "/unisdk/";
                    }
                } catch (Exception e2) {
                    f.a("UmcConfigUtil", "http:" + e2.toString());
                    return "http://www.cmpassport.com/unisdk/";
                }
            } finally {
            }
        }
        return str;
    }

    public static String e(Context context) {
        String str;
        synchronized (u.class) {
            try {
                try {
                    String b2 = n.b(context, "httpsHost", (String) null);
                    if (TextUtils.isEmpty(b2)) {
                        str = "https://onekey1.cmpassport.com/unisdk/";
                    } else {
                        str = "https://" + b2 + "/unisdk/";
                    }
                } catch (Exception e2) {
                    f.a("UmcConfigUtil", "https:" + e2.toString());
                    return "https://onekey1.cmpassport.com/unisdk/";
                }
            } finally {
            }
        }
        return str;
    }

    public static String f(Context context) {
        String str;
        synchronized (u.class) {
            try {
                try {
                    String b2 = n.b(context, "logHost", "");
                    if (TextUtils.isEmpty(b2)) {
                        str = "https://log1.cmpassport.com:9443/log/logReport";
                    } else {
                        str = "https://" + b2 + "/log/logReport";
                    }
                } catch (Exception e2) {
                    e2.printStackTrace();
                    return "https://log1.cmpassport.com:9443/log/logReport";
                }
            } finally {
            }
        }
        return str;
    }

    public static boolean g(Context context) {
        boolean equals;
        synchronized (u.class) {
            try {
                try {
                    equals = "1".equals(n.b(context, "CLOSE_CERT_VERIFY", "1"));
                } catch (Exception e2) {
                    f.a("UmcConfigUtil", "isCloseCert:" + e2.toString());
                    return true;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return equals;
    }

    public static boolean h(Context context) {
        boolean contains;
        synchronized (u.class) {
            try {
                try {
                    contains = n.b(context, "CLOSE_FRIEND_WAPKS", "").contains("CU");
                } catch (Exception e2) {
                    f.a("UmcConfigUtil", "isCloseCUCCWork:" + e2.toString());
                    return false;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return contains;
    }

    public static boolean i(Context context) {
        boolean contains;
        synchronized (u.class) {
            try {
                try {
                    contains = n.b(context, "CLOSE_FRIEND_WAPKS", "").contains("CT");
                } catch (Exception unused) {
                    return false;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return contains;
    }

    public static boolean j(Context context) {
        boolean equals;
        synchronized (u.class) {
            try {
                try {
                    equals = "1".equals(n.b(context, "CLOSE_LOGS_VERSION", "0"));
                } catch (Exception unused) {
                    return false;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return equals;
    }

    public static int k(Context context) {
        int b2;
        synchronized (u.class) {
            b2 = n.b(context, "maxFailedLogTimes", 0);
        }
        return b2;
    }

    public static int l(Context context) {
        int b2;
        synchronized (u.class) {
            b2 = n.b(context, "pauseTime", 0) * 60 * 60 * 1000;
        }
        return b2;
    }

    public static String a(Context context, String str) {
        String b2;
        synchronized (u.class) {
            try {
                try {
                    b2 = n.b(context, str, "");
                } catch (Exception unused) {
                    return "";
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return b2;
    }
}