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