正在查看: PrestMan MX v1.0.0 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: PrestMan MX v1.0.0 应用的 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 f8204h;
private Context f8205a;
private List<String> f8208d;
private String f8206b = "";
private String f8207c = "";
private Map<String, String> f8209e = new HashMap();
private List<String> f8210f = new ArrayList();
private List<String> f8211g = new ArrayList();
private b(Context context) {
this.f8208d = null;
this.f8205a = context;
this.f8208d = new ArrayList();
new HashMap();
new ArrayList();
new ArrayList();
}
public static b a(Context context) {
if (f8204h == null) {
synchronized (b.class) {
try {
if (f8204h == null) {
f8204h = new b(context);
}
} finally {
}
}
}
return f8204h;
}
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 i5) {
try {
if (this.f8208d.size() == 0) {
return 0;
}
int i6 = i5 + 1;
return i6 < this.f8208d.size() ? i6 : 0;
} catch (Throwable th) {
f.a(th);
return 0;
}
}
public synchronized String c() {
try {
String a5 = com.datavisor.vangogh.util.c.c().a(this.f8205a);
if (h.b(a5)) {
return "https://" + a5;
}
return "https://" + this.f8207c;
} catch (Throwable th) {
f.a(th);
return null;
}
}
public synchronized int d() {
return this.f8208d.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.f8208d.clear();
this.f8209e = new HashMap();
this.f8210f = new ArrayList();
this.f8211g = new ArrayList();
Map<String, String> e5 = e(this.f8206b);
if (e5 == null) {
return;
}
String str2 = "";
String str3 = e5.get("first") == null ? "" : e5.get("first");
String str4 = e5.get("second") == null ? "" : e5.get("second");
String str5 = e5.get("third") == null ? "" : e5.get("third");
if (e5.get("port") != null) {
str2 = e5.get("port");
}
if ("gw-dv".equals(str4)) {
try {
a(str3, str5);
b(str3, str5);
List<String> list2 = this.f8210f;
if (list2 != null) {
this.f8208d.addAll(list2);
}
List<String> list3 = this.f8211g;
if (list3 != null) {
this.f8208d.addAll(list3);
}
} catch (Throwable th) {
f.a(th);
}
this.f8208d.add(str5 + ".gw-dv." + str3);
if (!"vip".equals(str3)) {
this.f8208d.add(str5 + ".gw-dv.vip");
}
if (!"io".equals(str3)) {
this.f8208d.add(str5 + ".gw-dv.io");
}
if (!"xyz".equals(str3)) {
this.f8208d.add(str5 + ".gw-dv.xyz");
}
list = this.f8208d;
str = str5 + ".cdn-gw-dv.vip";
} else {
this.f8208d.add(str5 + "." + str4 + "." + str3);
list = this.f8208d;
str = str5 + ".cdn-" + str4 + "." + str3;
}
list.add(str);
if (h.b(str2)) {
for (int i5 = 0; i5 < this.f8208d.size(); i5++) {
String str6 = this.f8208d.get(i5);
this.f8208d.set(i5, str6 + ":" + str2);
}
}
} catch (Throwable th2) {
f.a(th2);
}
}
public synchronized String a(int i5) {
try {
String a5 = com.datavisor.vangogh.util.c.c().a(this.f8205a);
if (h.b(a5)) {
return "https://" + a5;
}
if (this.f8208d.size() == 0) {
return null;
}
if (i5 >= this.f8208d.size()) {
i5 = 0;
}
return "https://" + this.f8208d.get(i5);
} catch (Throwable th) {
f.a(th);
return null;
}
}
public synchronized String b() {
try {
String a5 = com.datavisor.vangogh.util.c.c().a(this.f8205a);
if (h.b(a5)) {
return "https://" + a5;
}
return "https://" + this.f8206b;
} catch (Throwable th) {
f.a(th);
return null;
}
}
public synchronized void c(String str) {
this.f8207c = 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.f8206b = d(str);
e();
c.a(a());
}
private void b(String str, String str2) {
try {
String a5 = a(str2);
HashMap hashMap = new HashMap();
int i5 = 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(a5) ? (String[]) hashMap.get(a5) : null;
String d5 = k0.d(this.f8205a, "SPVANGOGHEIPS");
try {
if (h.b(d5)) {
JSONArray jSONArray = new JSONArray(d5);
strArr = new String[jSONArray.length()];
for (int i6 = 0; i6 < jSONArray.length(); i6++) {
strArr[i6] = jSONArray.getString(i6);
}
}
} catch (Throwable th) {
f.a(th);
}
if (strArr != null) {
strArr2 = strArr;
}
if (strArr2 != null && strArr2.length != 0) {
while (i5 < strArr2.length) {
StringBuilder sb = new StringBuilder();
sb.append("eip");
int i7 = i5 + 1;
sb.append(i7);
sb.append("-");
sb.append(str2);
sb.append(".gw-dv.");
sb.append(str);
String sb2 = sb.toString();
this.f8209e.put(sb2, strArr2[i5]);
this.f8211g.add(sb2);
i5 = i7;
}
return;
}
f.a("aryEips is null or empty");
} catch (Throwable th2) {
f.a(th2);
}
}
public synchronized Map<String, String> a() {
return this.f8209e;
}
private void a(String str, String str2) {
try {
String a5 = a(str2);
HashMap hashMap = new HashMap();
int i5 = 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(a5) ? (String[]) hashMap.get(a5) : null;
String d5 = k0.d(this.f8205a, "SPANYCASTIPS");
try {
if (h.b(d5)) {
JSONArray jSONArray = new JSONArray(d5);
strArr = new String[jSONArray.length()];
for (int i6 = 0; i6 < jSONArray.length(); i6++) {
strArr[i6] = jSONArray.getString(i6);
}
}
} catch (Throwable th) {
f.a(th);
}
if (strArr != null) {
strArr2 = strArr;
}
if (strArr2 != null && strArr2.length != 0) {
while (i5 < strArr2.length) {
StringBuilder sb = new StringBuilder();
sb.append("anycast");
int i7 = i5 + 1;
sb.append(i7);
sb.append("-");
sb.append(str2);
sb.append(".gw-dv.");
sb.append(str);
String sb2 = sb.toString();
this.f8209e.put(sb2, strArr2[i5]);
this.f8210f.add(sb2);
i5 = i7;
}
return;
}
f.a("aryAnycastIps is null or empty");
} catch (Throwable th2) {
f.a(th2);
}
}
}