畅玩新葡京 v8.2.8版本的 MD5 值为:1e36e0a7adef719a26e0a466b52c398d
以下内容为反编译后的 XiongMao.java 源代码,内容仅作参考
package com.xiongmao.security.xiongmao.android.sdk;
import android.content.Context;
import android.os.Process;
import com.xiongmao.security.xiongmao.android.sdk.listener.XiongMaoGetSessionListener;
import com.xiongmao.security.xiongmao.android.sdk.listener.XiongMaoInitExListener;
import com.xiongmao.security.xiongmao.android.sdk.traceroute.b;
import com.xiongmao.security.xiongmao.android.sdk.traceroute.e;
import com.xiongmao.security.xiongmao.android.sdk.umid.UMID;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.net.URL;
import java.util.Arrays;
import java.util.Random;
public class XiongMao {
static int a = 1;
static int b = 2;
private static XiongMaoUtil e = new XiongMaoUtil();
private static int f = 0;
private static boolean g = false;
private static byte[] h = new byte[8];
static {
System.loadLibrary("xiongmao");
}
public static int GetSession(StringBuffer stringBuffer) {
stringBuffer.setLength(0);
String sessionRaw = getSessionRaw();
int indexOf = sessionRaw.indexOf("|");
if (indexOf == -1 || indexOf >= sessionRaw.length()) {
return -1;
}
stringBuffer.append(sessionRaw.substring(indexOf + 1, sessionRaw.length()));
return Integer.valueOf(sessionRaw.substring(0, indexOf)).intValue();
}
public static void GetSessionWithCallback(final XiongMaoGetSessionListener xiongMaoGetSessionListener) {
new Thread(new Runnable() {
@Override
public void run() {
StringBuffer stringBuffer = new StringBuffer();
while (XiongMao.GetSession(stringBuffer) != 0) {
try {
Thread.sleep(100L);
} catch (InterruptedException unused) {
}
}
XiongMaoGetSessionListener.this.OnGetSessionFinished(stringBuffer.toString());
}
}).start();
}
private static int a(int i, String str, String str2, String str3, String str4, String str5, StringBuffer stringBuffer, StringBuffer stringBuffer2) {
if (str == null || str2 == null || str3 == null || str4 == null || str5 == null || str.length() == 0 || str2.length() == 0 || str3.length() == 0 || str4.length() == 0 || str5.length() == 0) {
return -1;
}
String trim = getProxyRaw(i, str, str2, str3, str4, str5).trim();
if (e.a(trim)) {
return Integer.valueOf(trim).intValue();
}
int indexOf = trim.indexOf("|");
if (indexOf <= 0 || indexOf >= trim.length()) {
return -1;
}
stringBuffer.setLength(0);
stringBuffer.append(trim.substring(0, indexOf));
stringBuffer2.setLength(0);
stringBuffer2.append(trim.substring(indexOf + 1, trim.length()));
return 0;
}
static int b() {
return d();
}
public static void b(Context context, String str, String str2, b bVar) {
try {
new com.xiongmao.security.xiongmao.android.sdk.traceroute.a(context, str, str2, bVar).a();
} catch (RuntimeException unused) {
}
}
private static void c() {
new Thread(new Runnable() {
@Override
public void run() {
if (XiongMao.e.b() && new Random().nextInt(100) < XiongMao.e.r()) {
XiongMao.b();
}
Context n = XiongMao.e.n();
if (XiongMao.e.d()) {
XiongMao.reportInfo(13, "umid", new UMID(n).b(), 1);
}
}
}).start();
}
private static int d() {
new Thread(new Runnable() {
@Override
public void run() {
String[] strArr;
b bVar = new b() {
@Override
public void a(String str) {
if (XiongMao.e.c()) {
XiongMao.reportInfo(14, "diag", str, 0);
}
}
};
for (String str : new String[]{"www.baidu.com", "www.qq.com", "www.163.com", "www.taobao.com"}) {
if (e.b(str) == null) {
break;
}
XiongMao.b(null, str, "80", bVar);
}
for (int i = 1; i < XiongMao.e.q() + 1; i++) {
String format = String.format("a%06d.excaliburdx.com", Integer.valueOf(i));
if (e.b(format) == null) {
return;
}
XiongMao.b(null, format, "10800", bVar);
}
}
}).start();
return 0;
}
private static native String getIpInfo();
public static int getLocalIpInfo(StringBuffer stringBuffer, StringBuffer stringBuffer2) {
int indexOf;
String trim = getIpInfo().trim();
if (e.a(trim) || (indexOf = trim.indexOf("|")) <= 0 || indexOf >= trim.length()) {
return -1;
}
stringBuffer.setLength(0);
stringBuffer.append(trim.substring(0, indexOf));
stringBuffer2.setLength(0);
stringBuffer2.append(trim.substring(indexOf + 1, trim.length()));
return 0;
}
private static native String getProxyRaw(int i, String str, String str2, String str3, String str4, String str5);
public static int getProxyTcpByDomain(String str, String str2, String str3, String str4, StringBuffer stringBuffer, StringBuffer stringBuffer2) {
return a(a, str, str2, "1", str3, str4, stringBuffer, stringBuffer2);
}
public static int getProxyTcpByIp(String str, String str2, String str3, String str4, StringBuffer stringBuffer, StringBuffer stringBuffer2) {
return a(a, str, str2, "2", str3, str4, stringBuffer, stringBuffer2);
}
public static int getProxyUdpByDomain(String str, String str2, String str3, String str4, StringBuffer stringBuffer, StringBuffer stringBuffer2) {
return a(b, str, str2, "1", str3, str4, stringBuffer, stringBuffer2);
}
public static int getProxyUdpByIP(String str, String str2, String str3, String str4, StringBuffer stringBuffer, StringBuffer stringBuffer2) {
return a(b, str, str2, "2", str3, str4, stringBuffer, stringBuffer2);
}
private static native String getRealFetchedIp();
private static native String getRealFetchedPort();
private static native String getSessionRaw();
public static URL getXiongMaoURL(URL url) {
return g ? e.a(url) : url;
}
public static int initEx(String str, String str2) {
if (g) {
return 0;
}
if (e.n() != null) {
e.o();
e.p();
new UMID(e.n()).a();
}
int initExRaw = initExRaw(str, str2, 0);
if (initExRaw == 0) {
g = true;
if (e.n() != null) {
c();
}
}
return initExRaw;
}
private static native int initExRaw(String str, String str2, int i);
public static void initExWithCallback(final String str, final String str2, final XiongMaoInitExListener xiongMaoInitExListener) {
new Thread(new Runnable() {
@Override
public void run() {
xiongMaoInitExListener.OnInitExFinished(XiongMao.initEx(str, str2));
}
}).start();
}
public static native int reportInfo(int i, String str, String str2, int i2);
public static int reportUserData(int i, String str, int i2) {
int i3;
String str2;
if (i < -1) {
return -1;
}
if (-1 == i) {
i3 = 9;
str2 = "jaq_data";
} else {
i3 = i + 10000;
str2 = "user_data";
}
reportInfo(i3, str2, str, i2);
return 0;
}
public static byte[] safeDecrypt(byte[] bArr) {
if (f == 0 || bArr == null || bArr.length <= 8) {
return null;
}
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(safeDecryptRaw(Arrays.copyOfRange(bArr, 8, bArr.length)));
return byteArrayOutputStream.toByteArray();
} catch (Exception e2) {
e2.printStackTrace();
return null;
}
}
private static native byte[] safeDecryptRaw(byte[] bArr);
public static byte[] safeEncrypt(byte[] bArr) {
if (f == 0 || bArr == null || bArr.length == 0) {
return null;
}
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(h);
byteArrayOutputStream.write(safeEncryptRaw(bArr));
return byteArrayOutputStream.toByteArray();
} catch (Exception e2) {
e2.printStackTrace();
return null;
}
}
private static native byte[] safeEncryptRaw(byte[] bArr);
public static int securityInit(String str) {
try {
if (f == 1) {
return 5002;
}
FileInputStream fileInputStream = new FileInputStream(str);
int available = fileInputStream.available();
byte[] bArr = new byte[1024];
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
while (true) {
int read = fileInputStream.read(bArr);
if (read == -1) {
break;
}
byteArrayOutputStream.write(bArr, 0, read);
}
fileInputStream.close();
byte[] byteArray = byteArrayOutputStream.toByteArray();
if (byteArray[0] == 75 && byteArray[1] == 78 && byteArray[2] == 84) {
int securityInitRaw = securityInitRaw(byteArray, available);
if (securityInitRaw != 0) {
return securityInitRaw;
}
h = Arrays.copyOfRange(byteArray, 8, 16);
f = 1;
return securityInitRaw;
}
return 5004;
} catch (Exception e2) {
e2.printStackTrace();
return 5005;
}
}
private static native int securityInitRaw(byte[] bArr, int i);
public static void startNetworkDiagnosis(final String str, int i, final b bVar) {
final Context n = e.n();
n = (n.checkPermission("android.permission.ACCESS_NETWORK_STATE", Process.myPid(), Process.myUid()) == -1 || n.checkPermission("android.permission.ACCESS_WIFI_STATE", Process.myPid(), Process.myUid()) == -1) ? null : null;
final String str2 = "" + i;
new Thread(new Runnable() {
@Override
public void run() {
XiongMao.b(n, str, str2, bVar);
}
}).start();
}
public static byte[] whiteboxEncrypt(byte[] bArr) {
if (f == 0 || bArr == null || bArr.length == 0) {
return null;
}
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(h);
byteArrayOutputStream.write(whiteboxEncryptRaw(bArr));
return byteArrayOutputStream.toByteArray();
} catch (Exception e2) {
e2.printStackTrace();
return null;
}
}
private static native byte[] whiteboxEncryptRaw(byte[] bArr);
public static byte[] whiteboxSign(byte[] bArr) {
if (f == 0 || bArr == null || bArr.length == 0) {
return null;
}
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(h);
byteArrayOutputStream.write(whiteboxSignRaw(bArr));
return byteArrayOutputStream.toByteArray();
} catch (Exception e2) {
e2.printStackTrace();
return null;
}
}
private static native byte[] whiteboxSignRaw(byte[] bArr);
}