导航菜单

页面标题

页面副标题

TruCred v1.1.3 - b.java 源代码

正在查看: TruCred v1.1.3 应用的 b.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.datavisor.vangogh.util.network;

import android.content.Context;
import android.util.Base64;
import com.datavisor.vangogh.util.f;
import com.datavisor.vangogh.util.h;
import com.datavisorobfus.k0;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;

public class b {

    private static volatile b f950h;

    private Context f951a;

    private List<String> f954d;

    private String f952b = "";

    private String f953c = "";

    private Map<String, String> f955e = new HashMap();

    private List<String> f956f = new ArrayList();

    private List<String> f957g = new ArrayList();

    private b(Context context) {
        this.f954d = null;
        this.f951a = context;
        this.f954d = new ArrayList();
        new HashMap();
        new ArrayList();
        new ArrayList();
    }

    public static b a(Context context) {
        if (f950h == null) {
            synchronized (b.class) {
                try {
                    if (f950h == null) {
                        f950h = new b(context);
                    }
                } finally {
                }
            }
        }
        return f950h;
    }

    private java.util.Map<java.lang.String, java.lang.String> e(java.lang.String r10) {
        throw new UnsupportedOperationException("Method not decompiled: com.datavisor.vangogh.util.network.b.e(java.lang.String):java.util.Map");
    }

    public synchronized int b(int i2) {
        try {
            if (this.f954d.size() == 0) {
                return 0;
            }
            int i3 = i2 + 1;
            return i3 < this.f954d.size() ? i3 : 0;
        } catch (Throwable th) {
            f.a(th);
            return 0;
        }
    }

    public synchronized String c() {
        try {
            String a2 = com.datavisor.vangogh.util.c.c().a(this.f951a);
            if (h.b(a2)) {
                return "https://" + a2;
            }
            return "https://" + this.f953c;
        } catch (Throwable th) {
            f.a(th);
            return null;
        }
    }

    public synchronized int d() {
        return this.f954d.size();
    }

    private String d(String str) {
        try {
            if (h.b(str)) {
                if (str.substring(str.length() - 1).equals(".")) {
                    str = str.substring(0, str.length() - 1);
                }
                return str.contains(".:") ? str.replace(".:", ":") : str;
            }
        } catch (Throwable unused) {
        }
        return "";
    }

    private void e() {
        List<String> list;
        String str;
        try {
            this.f954d.clear();
            this.f955e = new HashMap();
            this.f956f = new ArrayList();
            this.f957g = new ArrayList();
            Map<String, String> e2 = e(this.f952b);
            if (e2 == null) {
                return;
            }
            String str2 = "";
            String str3 = e2.get("first") == null ? "" : e2.get("first");
            String str4 = e2.get("second") == null ? "" : e2.get("second");
            String str5 = e2.get("third") == null ? "" : e2.get("third");
            if (e2.get("port") != null) {
                str2 = e2.get("port");
            }
            if ("gw-dv".equals(str4)) {
                try {
                    a(str3, str5);
                    b(str3, str5);
                    List<String> list2 = this.f956f;
                    if (list2 != null) {
                        this.f954d.addAll(list2);
                    }
                    List<String> list3 = this.f957g;
                    if (list3 != null) {
                        this.f954d.addAll(list3);
                    }
                } catch (Throwable th) {
                    f.a(th);
                }
                this.f954d.add(str5 + ".gw-dv." + str3);
                if (!"vip".equals(str3)) {
                    this.f954d.add(str5 + ".gw-dv.vip");
                }
                if (!"io".equals(str3)) {
                    this.f954d.add(str5 + ".gw-dv.io");
                }
                if (!"xyz".equals(str3)) {
                    this.f954d.add(str5 + ".gw-dv.xyz");
                }
                list = this.f954d;
                str = str5 + ".cdn-gw-dv.vip";
            } else {
                this.f954d.add(str5 + "." + str4 + "." + str3);
                list = this.f954d;
                str = str5 + ".cdn-" + str4 + "." + str3;
            }
            list.add(str);
            if (h.b(str2)) {
                for (int i2 = 0; i2 < this.f954d.size(); i2++) {
                    String str6 = this.f954d.get(i2);
                    this.f954d.set(i2, str6 + ":" + str2);
                }
            }
        } catch (Throwable th2) {
            f.a(th2);
        }
    }

    public synchronized String a(int i2) {
        try {
            String a2 = com.datavisor.vangogh.util.c.c().a(this.f951a);
            if (h.b(a2)) {
                return "https://" + a2;
            }
            if (this.f954d.size() == 0) {
                return null;
            }
            if (i2 >= this.f954d.size()) {
                i2 = 0;
            }
            return "https://" + this.f954d.get(i2);
        } catch (Throwable th) {
            f.a(th);
            return null;
        }
    }

    public synchronized String b() {
        try {
            String a2 = com.datavisor.vangogh.util.c.c().a(this.f951a);
            if (h.b(a2)) {
                return "https://" + a2;
            }
            return "https://" + this.f952b;
        } catch (Throwable th) {
            f.a(th);
            return null;
        }
    }

    public synchronized void c(String str) {
        this.f953c = str;
    }

    public String a(String str) {
        String str2 = new HashSet(Collections.singletonList(new String(Base64.decode("YWlyYXNpYQ==", 2)))).contains(str) ? "SGHIGHFLOW" : new HashSet(Arrays.asList(new String(Base64.decode("em9tYXRvLXpvbWF0bw==", 2)), new String(Base64.decode("em9tYXRvLXJpZGVy", 2)), new String(Base64.decode("cGF5ZmF6eg==", 2)), new String(Base64.decode("YXBheWxhdGVy", 2)), new String(Base64.decode("dG9rb3BlZGlh", 2)), new String(Base64.decode("YmxpYmxp", 2)), new String(Base64.decode("YXRvbWU=", 2)), new String(Base64.decode("Z29qZWs=", 2)), new String(Base64.decode("YmxpYmxpLXNlbGxlcg==", 2)), new String(Base64.decode("YWR2YW5jZS1kZW1v", 2)))).contains(str) ? "SGOTHER" : new HashSet(Arrays.asList(new String(Base64.decode("bmVv", 2)), new String(Base64.decode("dGFza3JhYmJpdA==", 2)), new String(Base64.decode("YnJpZ2h0aG9yaXpvbnM=", 2)), new String(Base64.decode("bmFzYWZjdQ==", 2)), new String(Base64.decode("bXliYW1idQ==", 2)), new String(Base64.decode("dHJpcGFkdmlzb3I=", 2)), new String(Base64.decode("aGFwcHltb25leQ==", 2)))).contains(str) ? "US" : new HashSet(Collections.singletonList(new String(Base64.decode("Ym9va2luZw==", 2)))).contains(str) ? "EU" : "";
        if (h.a(str2)) {
            if (str.endsWith("-sg")) {
                return "SGOTHER";
            }
            if (str.endsWith("-sg2")) {
                return "SGHIGHFLOW";
            }
            if (str.endsWith("-us")) {
                return "US";
            }
            if (str.endsWith("-eu")) {
                return "EU";
            }
        }
        return str2;
    }

    public synchronized void b(String str) {
        this.f952b = d(str);
        e();
        c.a(a());
    }

    private void b(String str, String str2) {
        try {
            String a2 = a(str2);
            HashMap hashMap = new HashMap();
            int i2 = 0;
            hashMap.put("SGHIGHFLOW", new String[0]);
            hashMap.put("SGOTHER", new String[0]);
            hashMap.put("US", new String[]{new String(Base64.decode("NTIuNDIuMTgzLjExNQ==", 2))});
            hashMap.put("EU", new String[]{new String(Base64.decode("NTIuMjA5Ljc4Ljg4", 2))});
            String[] strArr = null;
            String[] strArr2 = h.b(a2) ? (String[]) hashMap.get(a2) : null;
            String d2 = k0.d(this.f951a, "SPVANGOGHEIPS");
            try {
                if (h.b(d2)) {
                    JSONArray jSONArray = new JSONArray(d2);
                    strArr = new String[jSONArray.length()];
                    for (int i3 = 0; i3 < jSONArray.length(); i3++) {
                        strArr[i3] = jSONArray.getString(i3);
                    }
                }
            } catch (Throwable th) {
                f.a(th);
            }
            if (strArr != null) {
                strArr2 = strArr;
            }
            if (strArr2 != null && strArr2.length != 0) {
                while (i2 < strArr2.length) {
                    StringBuilder sb = new StringBuilder();
                    sb.append("eip");
                    int i4 = i2 + 1;
                    sb.append(i4);
                    sb.append("-");
                    sb.append(str2);
                    sb.append(".gw-dv.");
                    sb.append(str);
                    String sb2 = sb.toString();
                    this.f955e.put(sb2, strArr2[i2]);
                    this.f957g.add(sb2);
                    i2 = i4;
                }
                return;
            }
            f.a("aryEips is null or empty");
        } catch (Throwable th2) {
            f.a(th2);
        }
    }

    public synchronized Map<String, String> a() {
        return this.f955e;
    }

    private void a(String str, String str2) {
        try {
            String a2 = a(str2);
            HashMap hashMap = new HashMap();
            int i2 = 0;
            hashMap.put("SGHIGHFLOW", new String[]{new String(Base64.decode("MTMuMjQ4LjE5NS4xODI=", 2)), new String(Base64.decode("NzYuMjIzLjgwLjE0NQ==", 2))});
            hashMap.put("SGOTHER", new String[]{new String(Base64.decode("NzUuMi40Mi4xNDM=", 2)), new String(Base64.decode("OTkuODMuMTUyLjE3OQ==", 2))});
            hashMap.put("US", new String[]{new String(Base64.decode("MTUuMTk3LjE1Ni4xNjY=", 2)), new String(Base64.decode("My4zMy4xNTYuMTc2", 2))});
            hashMap.put("EU", new String[]{new String(Base64.decode("MTMuMjQ4LjE0OC4xNTU=", 2)), new String(Base64.decode("NzYuMjIzLjI1LjE0Mw==", 2))});
            String[] strArr = null;
            String[] strArr2 = h.b(a2) ? (String[]) hashMap.get(a2) : null;
            String d2 = k0.d(this.f951a, "SPANYCASTIPS");
            try {
                if (h.b(d2)) {
                    JSONArray jSONArray = new JSONArray(d2);
                    strArr = new String[jSONArray.length()];
                    for (int i3 = 0; i3 < jSONArray.length(); i3++) {
                        strArr[i3] = jSONArray.getString(i3);
                    }
                }
            } catch (Throwable th) {
                f.a(th);
            }
            if (strArr != null) {
                strArr2 = strArr;
            }
            if (strArr2 != null && strArr2.length != 0) {
                while (i2 < strArr2.length) {
                    StringBuilder sb = new StringBuilder();
                    sb.append("anycast");
                    int i4 = i2 + 1;
                    sb.append(i4);
                    sb.append("-");
                    sb.append(str2);
                    sb.append(".gw-dv.");
                    sb.append(str);
                    String sb2 = sb.toString();
                    this.f955e.put(sb2, strArr2[i2]);
                    this.f956f.add(sb2);
                    i2 = i4;
                }
                return;
            }
            f.a("aryAnycastIps is null or empty");
        } catch (Throwable th2) {
            f.a(th2);
        }
    }
}