Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package com.tencent.wxop.stat.common;
import java.io.File;
/* loaded from: classes.dex */
public class StatConstants {
public static final String LOG_TAG = "MtaSDK";
public static final String MTA_COOPERATION_TAG = "wxop_";
public static final String MTA_REPORT_FULL_URL = "http://pingma.qq.com:80/mstat/report";
public static final String MTA_SERVER = "pingma.qq.com:80";
public static final String MTA_SERVER_HOST = "pingma.qq.com";
public static final int MTA_SERVER_PORT = 80;
public static final String MTA_STAT_URL = "/mstat/report";
public static final int SDK_ONLINE_CONFIG_TYPE = 1;
public static final int STAT_DB_VERSION = 3;
public static final int USER_ONLINE_CONFIG_TYPE = 2;
public static final String VERSION = "2.0.4";
public static final int XG_PRO_VERSION = 1;
public static final String MTA_STORAGE_PRE_TAG = "tencent.mta" + File.separator + "datawxop_";
public static String DATABASE_NAME = "wxop_tencent_analysis.db";
}

View File

@@ -0,0 +1,188 @@
package com.tencent.wxop.stat.common;
import android.util.Log;
import com.tencent.wxop.stat.StatConfig;
/* loaded from: classes.dex */
public final class StatLogger {
private String a;
private boolean b;
private int c;
public StatLogger() {
this.a = "default";
this.b = true;
this.c = 2;
}
public StatLogger(String str) {
this.a = "default";
this.b = true;
this.c = 2;
this.a = str;
}
private String a() {
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
if (stackTrace == null) {
return null;
}
for (StackTraceElement stackTraceElement : stackTrace) {
if (!stackTraceElement.isNativeMethod() && !stackTraceElement.getClassName().equals(Thread.class.getName()) && !stackTraceElement.getClassName().equals(StatLogger.class.getName())) {
return "[" + Thread.currentThread().getName() + "(" + Thread.currentThread().getId() + "): " + stackTraceElement.getFileName() + ":" + stackTraceElement.getLineNumber() + "]";
}
}
return null;
}
public final void d(Object obj) {
if (isDebugEnable()) {
debug(obj);
}
}
public final void debug(Object obj) {
String str;
if (this.c <= 3) {
String a = a();
if (a == null) {
str = obj.toString();
} else {
str = a + " - " + obj;
}
Log.d(this.a, str);
com.tencent.wxop.stat.g customLogger = StatConfig.getCustomLogger();
if (customLogger != null) {
customLogger.e(str);
}
}
}
public final void e(Object obj) {
if (isDebugEnable()) {
error(obj);
}
}
public final void e(Throwable th) {
if (isDebugEnable()) {
error(th);
}
}
public final void error(Object obj) {
String str;
if (this.c <= 6) {
String a = a();
if (a == null) {
str = obj.toString();
} else {
str = a + " - " + obj;
}
Log.e(this.a, str);
com.tencent.wxop.stat.g customLogger = StatConfig.getCustomLogger();
if (customLogger != null) {
customLogger.d(str);
}
}
}
public final void error(Throwable th) {
if (this.c <= 6) {
Log.e(this.a, "", th);
com.tencent.wxop.stat.g customLogger = StatConfig.getCustomLogger();
if (customLogger != null) {
customLogger.d(th);
}
}
}
public final int getLogLevel() {
return this.c;
}
public final void i(Object obj) {
if (isDebugEnable()) {
info(obj);
}
}
public final void info(Object obj) {
String str;
if (this.c <= 4) {
String a = a();
if (a == null) {
str = obj.toString();
} else {
str = a + " - " + obj;
}
Log.i(this.a, str);
com.tencent.wxop.stat.g customLogger = StatConfig.getCustomLogger();
if (customLogger != null) {
customLogger.a(str);
}
}
}
public final boolean isDebugEnable() {
return this.b;
}
public final void setDebugEnable(boolean z) {
this.b = z;
}
public final void setLogLevel(int i) {
this.c = i;
}
public final void setTag(String str) {
this.a = str;
}
public final void v(Object obj) {
if (isDebugEnable()) {
verbose(obj);
}
}
public final void verbose(Object obj) {
String str;
if (this.c <= 2) {
String a = a();
if (a == null) {
str = obj.toString();
} else {
str = a + " - " + obj;
}
Log.v(this.a, str);
com.tencent.wxop.stat.g customLogger = StatConfig.getCustomLogger();
if (customLogger != null) {
customLogger.b(str);
}
}
}
public final void w(Object obj) {
if (isDebugEnable()) {
warn(obj);
}
}
public final void warn(Object obj) {
String str;
if (this.c <= 5) {
String a = a();
if (a == null) {
str = obj.toString();
} else {
str = a + " - " + obj;
}
Log.w(this.a, str);
com.tencent.wxop.stat.g customLogger = StatConfig.getCustomLogger();
if (customLogger != null) {
customLogger.c(str);
}
}
}
}

View File

@@ -0,0 +1,70 @@
package com.tencent.wxop.stat.common;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class a {
private String a;
private String b;
private String c;
private String d;
private int e;
private int f;
private long g;
public a() {
this.a = null;
this.b = null;
this.c = null;
this.d = "0";
this.f = 0;
this.g = 0L;
}
public a(String str, String str2, int i) {
this.a = null;
this.b = null;
this.c = null;
this.d = "0";
this.f = 0;
this.g = 0L;
this.a = str;
this.b = str2;
this.e = i;
}
JSONObject a() {
JSONObject jSONObject = new JSONObject();
try {
r.a(jSONObject, "ui", this.a);
r.a(jSONObject, "mc", this.b);
r.a(jSONObject, "mid", this.d);
r.a(jSONObject, "aid", this.c);
jSONObject.put("ts", this.g);
jSONObject.put("ver", this.f);
} catch (JSONException unused) {
}
return jSONObject;
}
public void a(int i) {
this.e = i;
}
public String b() {
return this.a;
}
public String c() {
return this.b;
}
public int d() {
return this.e;
}
public String toString() {
return a().toString();
}
}

View File

@@ -0,0 +1,76 @@
package com.tencent.wxop.stat.common;
import android.content.Context;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class b {
static d a;
private static StatLogger d = l.b();
private static JSONObject e = new JSONObject();
Integer b;
String c;
public b(Context context) {
this.b = null;
this.c = null;
try {
a(context);
this.b = l.k(context.getApplicationContext());
this.c = com.tencent.wxop.stat.a.a(context).b();
} catch (Throwable th) {
d.e(th);
}
}
static synchronized d a(Context context) {
d dVar;
synchronized (b.class) {
if (a == null) {
a = new d(context.getApplicationContext());
}
dVar = a;
}
return dVar;
}
public static void a(Context context, Map<String, String> map) {
if (map == null) {
return;
}
for (Map.Entry entry : new HashMap(map).entrySet()) {
e.put((String) entry.getKey(), entry.getValue());
}
}
public void a(JSONObject jSONObject, Thread thread) {
String str;
String str2;
JSONObject jSONObject2 = new JSONObject();
try {
if (a != null) {
a.a(jSONObject2, thread);
}
r.a(jSONObject2, "cn", this.c);
if (this.b != null) {
jSONObject2.put("tn", this.b);
}
if (thread == null) {
str = "ev";
str2 = jSONObject2;
} else {
str = "errkv";
str2 = jSONObject2.toString();
}
jSONObject.put(str, str2);
if (e == null || e.length() <= 0) {
return;
}
jSONObject.put("eva", e);
} catch (Throwable th) {
d.e(th);
}
}
}

View File

@@ -0,0 +1,138 @@
package com.tencent.wxop.stat.common;
import android.content.Context;
import android.os.Build;
import android.util.DisplayMetrics;
import com.tencent.wxop.stat.StatConfig;
import com.tencent.wxop.stat.au;
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
import com.ubt.jimu.unity.bluetooth.MyUnityListener;
import java.util.Locale;
import java.util.TimeZone;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
class d {
String a;
String b;
DisplayMetrics c;
int d;
String e;
String f;
String g;
String h;
String i;
String j;
String k;
int l;
String m;
String n;
Context o;
private String p;
private String q;
private String r;
private String s;
private d(Context context) {
this.b = StatConstants.VERSION;
this.d = Build.VERSION.SDK_INT;
this.e = Build.MODEL;
this.f = Build.MANUFACTURER;
this.g = Locale.getDefault().getLanguage();
this.l = 0;
this.m = null;
this.n = null;
this.o = null;
this.p = null;
this.q = null;
this.r = null;
this.s = null;
this.o = context.getApplicationContext();
this.c = l.d(this.o);
this.a = l.h(this.o);
this.h = StatConfig.getInstallChannel(this.o);
this.i = l.g(this.o);
this.j = TimeZone.getDefault().getID();
this.l = l.m(this.o);
this.k = l.n(this.o);
this.m = this.o.getPackageName();
if (this.d >= 14) {
this.p = l.t(this.o);
}
this.q = l.s(this.o).toString();
this.r = l.r(this.o);
this.s = l.d();
this.n = l.A(this.o);
}
void a(JSONObject jSONObject, Thread thread) {
String localMidOnly;
String str;
if (thread == null) {
if (this.c != null) {
jSONObject.put("sr", this.c.widthPixels + "*" + this.c.heightPixels);
jSONObject.put("dpi", this.c.xdpi + "*" + this.c.ydpi);
}
if (com.tencent.wxop.stat.a.a(this.o).e()) {
JSONObject jSONObject2 = new JSONObject();
r.a(jSONObject2, "bs", r.d(this.o));
r.a(jSONObject2, "ss", r.e(this.o));
if (jSONObject2.length() > 0) {
r.a(jSONObject, "wf", jSONObject2.toString());
}
}
JSONArray a = r.a(this.o, 10);
if (a != null && a.length() > 0) {
r.a(jSONObject, "wflist", a.toString());
}
localMidOnly = this.p;
str = "sen";
} else {
r.a(jSONObject, "thn", thread.getName());
r.a(jSONObject, "qq", StatConfig.getQQ(this.o));
r.a(jSONObject, "cui", StatConfig.getCustomUserId(this.o));
if (l.c(this.r) && this.r.split("/").length == 2) {
r.a(jSONObject, "fram", this.r.split("/")[0]);
}
if (l.c(this.s) && this.s.split("/").length == 2) {
r.a(jSONObject, MyUnityListener.CALLER, this.s.split("/")[0]);
}
if (au.a(this.o).b(this.o) != null) {
jSONObject.put("ui", au.a(this.o).b(this.o).b());
}
localMidOnly = StatConfig.getLocalMidOnly(this.o);
str = "mid";
}
r.a(jSONObject, str, localMidOnly);
r.a(jSONObject, "pcn", l.o(this.o));
r.a(jSONObject, "osn", Build.VERSION.RELEASE);
r.a(jSONObject, "av", this.a);
r.a(jSONObject, "ch", this.h);
r.a(jSONObject, "mf", this.f);
r.a(jSONObject, "sv", this.b);
r.a(jSONObject, "osd", Build.DISPLAY);
r.a(jSONObject, "prod", Build.PRODUCT);
r.a(jSONObject, "tags", Build.TAGS);
r.a(jSONObject, JockstickDataConverter.ID, Build.ID);
r.a(jSONObject, "fng", Build.FINGERPRINT);
r.a(jSONObject, "lch", this.n);
r.a(jSONObject, "ov", Integer.toString(this.d));
jSONObject.put("os", 1);
r.a(jSONObject, "op", this.i);
r.a(jSONObject, "lg", this.g);
r.a(jSONObject, "md", this.e);
r.a(jSONObject, "tz", this.j);
int i = this.l;
if (i != 0) {
jSONObject.put("jb", i);
}
r.a(jSONObject, "sd", this.k);
r.a(jSONObject, "apn", this.m);
r.a(jSONObject, "cpu", this.q);
r.a(jSONObject, "abi", Build.CPU_ABI);
r.a(jSONObject, "abi2", Build.CPU_ABI2);
r.a(jSONObject, "ram", this.r);
r.a(jSONObject, "rom", this.s);
}
}

View File

@@ -0,0 +1,18 @@
package com.tencent.wxop.stat.common;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/* loaded from: classes.dex */
public class e {
ExecutorService a;
public e() {
this.a = null;
this.a = Executors.newSingleThreadExecutor();
}
public void a(Runnable runnable) {
this.a.execute(runnable);
}
}

View File

@@ -0,0 +1,55 @@
package com.tencent.wxop.stat.common;
import android.util.Base64;
import com.ijm.dataencryption.de.DataDecryptTool;
/* loaded from: classes.dex */
public class f {
static byte[] a() {
return Base64.decode("MDNhOTc2NTExZTJjYmUzYTdmMjY4MDhmYjdhZjNjMDU=", 0);
}
public static byte[] a(byte[] bArr) {
return a(bArr, a());
}
static byte[] a(byte[] bArr, byte[] bArr2) {
int[] iArr = new int[DataDecryptTool.DECRYPT_ALL_FILE];
int[] iArr2 = new int[DataDecryptTool.DECRYPT_ALL_FILE];
int length = bArr2.length;
if (length <= 0 || length > 256) {
throw new IllegalArgumentException("key must be between 1 and 256 bytes");
}
for (int i = 0; i < 256; i++) {
iArr[i] = i;
iArr2[i] = bArr2[i % length];
}
int i2 = 0;
for (int i3 = 0; i3 < 256; i3++) {
i2 = (i2 + iArr[i3] + iArr2[i3]) & 255;
int i4 = iArr[i3];
iArr[i3] = iArr[i2];
iArr[i2] = i4;
}
byte[] bArr3 = new byte[bArr.length];
int i5 = 0;
int i6 = 0;
for (int i7 = 0; i7 < bArr.length; i7++) {
i5 = (i5 + 1) & 255;
i6 = (i6 + iArr[i5]) & 255;
int i8 = iArr[i5];
iArr[i5] = iArr[i6];
iArr[i6] = i8;
bArr3[i7] = (byte) (iArr[(iArr[i5] + iArr[i6]) & 255] ^ bArr[i7]);
}
return bArr3;
}
public static byte[] b(byte[] bArr) {
return b(bArr, a());
}
static byte[] b(byte[] bArr, byte[] bArr2) {
return a(bArr, bArr2);
}
}

View File

@@ -0,0 +1,79 @@
package com.tencent.wxop.stat.common;
import android.content.Context;
import android.os.Build;
import android.provider.Settings;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public class g {
private static volatile g c;
private int a = 10;
private int b;
private Context d;
private boolean e;
private g(Context context) {
this.b = 0;
this.d = null;
this.e = false;
this.d = context.getApplicationContext();
try {
this.e = r.a(this.d, "android.permission.WRITE_SETTINGS");
if (!this.e || Build.VERSION.SDK_INT < 23) {
return;
}
Method declaredMethod = Settings.System.class.getDeclaredMethod("canWrite", Context.class);
declaredMethod.setAccessible(true);
this.e = ((Boolean) declaredMethod.invoke(null, this.d)).booleanValue();
} catch (Throwable th) {
int i = this.b;
this.b = i + 1;
if (i < this.a) {
th.printStackTrace();
}
}
}
public static g a(Context context) {
if (c == null) {
synchronized (g.class) {
if (c == null) {
c = new g(context);
}
}
}
return c;
}
public String a(String str) {
try {
return Settings.System.getString(this.d.getContentResolver(), str);
} catch (Throwable th) {
int i = this.b;
this.b = i + 1;
if (i >= this.a) {
return null;
}
th.printStackTrace();
return null;
}
}
public boolean a(String str, String str2) {
if (!this.e) {
return false;
}
try {
return Settings.System.putString(this.d.getContentResolver(), str, str2);
} catch (Throwable th) {
int i = this.b;
this.b = i + 1;
if (i >= this.a) {
return false;
}
th.printStackTrace();
return false;
}
}
}

View File

@@ -0,0 +1,58 @@
package com.tencent.wxop.stat.common;
/* loaded from: classes.dex */
public class h {
static final /* synthetic */ boolean a = !h.class.desiredAssertionStatus();
private h() {
}
public static byte[] a(byte[] bArr, int i) {
return a(bArr, 0, bArr.length, i);
}
public static byte[] a(byte[] bArr, int i, int i2, int i3) {
j jVar = new j(i3, new byte[(i2 * 3) / 4]);
if (!jVar.a(bArr, i, i2, true)) {
throw new IllegalArgumentException("bad base-64");
}
int i4 = jVar.b;
byte[] bArr2 = jVar.a;
if (i4 == bArr2.length) {
return bArr2;
}
byte[] bArr3 = new byte[i4];
System.arraycopy(bArr2, 0, bArr3, 0, i4);
return bArr3;
}
public static byte[] b(byte[] bArr, int i) {
return b(bArr, 0, bArr.length, i);
}
public static byte[] b(byte[] bArr, int i, int i2, int i3) {
k kVar = new k(i3, null);
int i4 = (i2 / 3) * 4;
if (!kVar.d) {
int i5 = i2 % 3;
if (i5 != 0) {
if (i5 == 1) {
i4 += 2;
} else if (i5 == 2) {
i4 += 3;
}
}
} else if (i2 % 3 > 0) {
i4 += 4;
}
if (kVar.e && i2 > 0) {
i4 += (((i2 - 1) / 57) + 1) * (kVar.f ? 2 : 1);
}
kVar.a = new byte[i4];
kVar.a(bArr, i, i2, true);
if (a || kVar.b == i4) {
return kVar.a;
}
throw new AssertionError();
}
}

View File

@@ -0,0 +1,10 @@
package com.tencent.wxop.stat.common;
/* loaded from: classes.dex */
abstract class i {
public byte[] a;
public int b;
i() {
}
}

View File

@@ -0,0 +1,33 @@
package com.tencent.wxop.stat.common;
/* loaded from: classes.dex */
class j extends i {
private static final int[] c = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
private static final int[] d = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
private int e;
private int f;
private final int[] g;
public j(int i, byte[] bArr) {
this.a = bArr;
this.g = (i & 8) == 0 ? c : d;
this.e = 0;
this.f = 0;
}
/* JADX WARN: Code restructure failed: missing block: B:27:0x0107, code lost:
if (r5 != 4) goto L72;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public boolean a(byte[] r18, int r19, int r20, boolean r21) {
/*
Method dump skipped, instructions count: 292
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.wxop.stat.common.j.a(byte[], int, int, boolean):boolean");
}
}

View File

@@ -0,0 +1,46 @@
package com.tencent.wxop.stat.common;
/* loaded from: classes.dex */
class k extends i {
static final /* synthetic */ boolean g = !h.class.desiredAssertionStatus();
private static final byte[] h = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47};
private static final byte[] i = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 95};
int c;
public final boolean d;
public final boolean e;
public final boolean f;
private final byte[] j;
private int k;
private final byte[] l;
public k(int i2, byte[] bArr) {
this.a = bArr;
this.d = (i2 & 1) == 0;
this.e = (i2 & 2) == 0;
this.f = (i2 & 4) != 0;
this.l = (i2 & 8) == 0 ? h : i;
this.j = new byte[2];
this.c = 0;
this.k = this.e ? 19 : -1;
}
/* JADX ERROR: JadxOverflowException in pass: RegionMakerVisitor
jadx.core.utils.exceptions.JadxOverflowException: Regions count limit reached
at jadx.core.utils.ErrorsCounter.addError(ErrorsCounter.java:59)
at jadx.core.utils.ErrorsCounter.error(ErrorsCounter.java:31)
at jadx.core.dex.attributes.nodes.NotificationAttrNode.addError(NotificationAttrNode.java:19)
*/
/* JADX WARN: Removed duplicated region for block: B:20:0x0097 */
/* JADX WARN: Removed duplicated region for block: B:30:0x00e9 A[SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public boolean a(byte[] r18, int r19, int r20, boolean r21) {
/*
Method dump skipped, instructions count: 529
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.wxop.stat.common.k.a(byte[], int, int, boolean):boolean");
}
}

View File

@@ -0,0 +1,657 @@
package com.tencent.wxop.stat.common;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Proxy;
import android.os.Environment;
import android.os.Process;
import android.os.StatFs;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.WindowManager;
import com.ijm.dataencryption.de.DataDecryptTool;
import com.tencent.wxop.stat.StatConfig;
import com.tencent.wxop.stat.StatSpecifyReportedInfo;
import com.ubt.jimu.base.util.FileUtil;
import com.ubt.jimu.diy.model.CategoryModel;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileReader;
import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.zip.GZIPInputStream;
import org.apache.http.HttpHost;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class l {
private static String a = null;
private static String b = null;
private static String c = null;
private static String d = null;
private static Random e = null;
private static DisplayMetrics f = null;
private static String g = null;
private static String h = "";
private static String i = "";
private static int j = -1;
private static StatLogger k = null;
private static String l = null;
private static String m = null;
private static volatile int n = -1;
private static String o = null;
private static String p = null;
private static long q = -1;
private static String r = "";
private static o s = null;
private static String t = "__MTA_FIRST_ACTIVATE__";
private static int u = -1;
private static long v = -1;
private static int w = 0;
private static String x = "";
public static String A(Context context) {
if (context == null) {
return null;
}
Intent intent = new Intent("android.intent.action.MAIN");
intent.addCategory("android.intent.category.HOME");
ResolveInfo resolveActivity = context.getPackageManager().resolveActivity(intent, 0);
ActivityInfo activityInfo = resolveActivity.activityInfo;
if (activityInfo == null || activityInfo.packageName.equals("android")) {
return null;
}
return resolveActivity.activityInfo.packageName;
}
private static long B(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService("activity");
ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
activityManager.getMemoryInfo(memoryInfo);
return memoryInfo.availMem;
}
public static int a() {
return g().nextInt(Integer.MAX_VALUE);
}
public static int a(Context context, boolean z) {
if (z) {
w = y(context);
}
return w;
}
public static Long a(String str, String str2, int i2, int i3, Long l2) {
if (str != null && str2 != null) {
if (str2.equalsIgnoreCase(".") || str2.equalsIgnoreCase("|")) {
str2 = "\\" + str2;
}
String[] split = str.split(str2);
if (split.length == i3) {
try {
Long l3 = 0L;
for (String str3 : split) {
l3 = Long.valueOf(i2 * (l3.longValue() + Long.valueOf(str3).longValue()));
}
return l3;
} catch (NumberFormatException unused) {
}
}
}
return l2;
}
public static String a(int i2) {
Calendar calendar = Calendar.getInstance();
calendar.roll(6, i2);
return new SimpleDateFormat("yyyyMMdd").format(calendar.getTime());
}
public static String a(long j2) {
return new SimpleDateFormat("yyyyMMdd").format(new Date(j2));
}
public static String a(Context context, String str) {
if (StatConfig.isEnableConcurrentProcess()) {
if (m == null) {
m = o(context);
}
if (m != null) {
return str + "_" + m;
}
}
return str;
}
public static String a(String str) {
if (str == null) {
return "0";
}
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(str.getBytes());
byte[] digest = messageDigest.digest();
StringBuffer stringBuffer = new StringBuffer();
for (byte b2 : digest) {
int i2 = b2 & 255;
if (i2 < 16) {
stringBuffer.append("0");
}
stringBuffer.append(Integer.toHexString(i2));
}
return stringBuffer.toString();
} catch (Throwable unused) {
return "0";
}
}
public static HttpHost a(Context context) {
NetworkInfo activeNetworkInfo;
String extraInfo;
if (context == null) {
return null;
}
try {
} catch (Throwable th) {
k.e(th);
}
if (context.getPackageManager().checkPermission("android.permission.ACCESS_NETWORK_STATE", context.getPackageName()) != 0 || (activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo()) == null) {
return null;
}
if ((activeNetworkInfo.getTypeName() != null && activeNetworkInfo.getTypeName().equalsIgnoreCase("WIFI")) || (extraInfo = activeNetworkInfo.getExtraInfo()) == null) {
return null;
}
if (!extraInfo.equals("cmwap") && !extraInfo.equals("3gwap") && !extraInfo.equals("uniwap")) {
if (extraInfo.equals("ctwap")) {
return new HttpHost("10.0.0.200", 80);
}
String defaultHost = Proxy.getDefaultHost();
if (defaultHost != null && defaultHost.trim().length() > 0) {
return new HttpHost(defaultHost, Proxy.getDefaultPort());
}
return null;
}
return new HttpHost("10.0.0.172", 80);
}
public static void a(Context context, int i2) {
w = i2;
q.b(context, "mta.qq.com.difftime", i2);
}
public static boolean a(StatSpecifyReportedInfo statSpecifyReportedInfo) {
if (statSpecifyReportedInfo == null) {
return false;
}
return c(statSpecifyReportedInfo.getAppKey());
}
public static byte[] a(byte[] bArr) {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bArr);
GZIPInputStream gZIPInputStream = new GZIPInputStream(byteArrayInputStream);
byte[] bArr2 = new byte[FileUtil.ZIP_BUFFER_SIZE];
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bArr.length * 2);
while (true) {
int read = gZIPInputStream.read(bArr2);
if (read == -1) {
byte[] byteArray = byteArrayOutputStream.toByteArray();
byteArrayInputStream.close();
gZIPInputStream.close();
byteArrayOutputStream.close();
return byteArray;
}
byteArrayOutputStream.write(bArr2, 0, read);
}
}
public static long b(String str) {
return a(str, ".", 100, 3, 0L).longValue();
}
public static synchronized StatLogger b() {
StatLogger statLogger;
synchronized (l.class) {
if (k == null) {
StatLogger statLogger2 = new StatLogger(StatConstants.LOG_TAG);
k = statLogger2;
statLogger2.setDebugEnable(false);
}
statLogger = k;
}
return statLogger;
}
public static synchronized String b(Context context) {
synchronized (l.class) {
if (a != null && a.trim().length() != 0) {
return a;
}
String a2 = r.a(context);
a = a2;
if (a2 == null || a.trim().length() == 0) {
a = Integer.toString(g().nextInt(Integer.MAX_VALUE));
}
return a;
}
}
public static long c() {
try {
Calendar calendar = Calendar.getInstance();
calendar.set(11, 0);
calendar.set(12, 0);
calendar.set(13, 0);
calendar.set(14, 0);
return calendar.getTimeInMillis() + 86400000;
} catch (Throwable th) {
k.e(th);
return System.currentTimeMillis() + 86400000;
}
}
public static synchronized String c(Context context) {
String str;
synchronized (l.class) {
if (c == null || c.trim().length() == 0) {
c = r.b(context);
}
str = c;
}
return str;
}
public static boolean c(String str) {
return (str == null || str.trim().length() == 0) ? false : true;
}
public static DisplayMetrics d(Context context) {
if (f == null) {
f = new DisplayMetrics();
((WindowManager) context.getApplicationContext().getSystemService("window")).getDefaultDisplay().getMetrics(f);
}
return f;
}
public static String d() {
if (c(p)) {
return p;
}
long e2 = e() / 1000000;
StatFs statFs = new StatFs(Environment.getDataDirectory().getPath());
String str = String.valueOf((statFs.getBlockSize() * statFs.getAvailableBlocks()) / 1000000) + "/" + String.valueOf(e2);
p = str;
return str;
}
public static long e() {
StatFs statFs = new StatFs(Environment.getDataDirectory().getPath());
return statFs.getBlockCount() * statFs.getBlockSize();
}
public static boolean e(Context context) {
NetworkInfo[] allNetworkInfo;
try {
} catch (Throwable th) {
k.e(th);
}
if (!r.a(context, "android.permission.ACCESS_WIFI_STATE")) {
k.warn("can not get the permission of android.permission.ACCESS_WIFI_STATE");
return false;
}
ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService("connectivity");
if (connectivityManager != null && (allNetworkInfo = connectivityManager.getAllNetworkInfo()) != null) {
for (int i2 = 0; i2 < allNetworkInfo.length; i2++) {
if (allNetworkInfo[i2].getTypeName().equalsIgnoreCase("WIFI") && allNetworkInfo[i2].isConnected()) {
return true;
}
}
}
return false;
}
public static String f(Context context) {
if (context == null) {
return null;
}
return context.getClass().getName();
}
public static String g(Context context) {
TelephonyManager telephonyManager;
String str = g;
if (str != null) {
return str;
}
try {
if (!r.a(context, "android.permission.READ_PHONE_STATE")) {
k.e("Could not get permission of android.permission.READ_PHONE_STATE");
} else if (i(context) && (telephonyManager = (TelephonyManager) context.getSystemService("phone")) != null) {
g = telephonyManager.getSimOperator();
}
} catch (Throwable th) {
k.e(th);
}
return g;
}
private static synchronized Random g() {
Random random;
synchronized (l.class) {
if (e == null) {
e = new Random();
}
random = e;
}
return random;
}
private static long h() {
long j2 = q;
if (j2 > 0) {
return j2;
}
long j3 = 1;
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("/proc/meminfo"), UnityActivity.BLOCKLY_TYPE_NONE);
j3 = Integer.valueOf(bufferedReader.readLine().split("\\s+")[1]).intValue() * DataDecryptTool.DECRYPT_SP_FILE;
bufferedReader.close();
} catch (Exception unused) {
}
q = j3;
return j3;
}
public static String h(Context context) {
if (c(h)) {
return h;
}
try {
String str = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
h = str;
if (str == null) {
return "";
}
} catch (Throwable th) {
k.e(th);
}
return h;
}
public static boolean i(Context context) {
return context.getPackageManager().checkPermission("android.permission.READ_PHONE_STATE", context.getPackageName()) == 0;
}
public static String j(Context context) {
try {
if (r.a(context, "android.permission.INTERNET") && r.a(context, "android.permission.ACCESS_NETWORK_STATE")) {
NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) {
String typeName = activeNetworkInfo.getTypeName();
String extraInfo = activeNetworkInfo.getExtraInfo();
if (typeName != null) {
if (typeName.equalsIgnoreCase("WIFI")) {
return "WIFI";
}
if (typeName.equalsIgnoreCase("MOBILE")) {
if (extraInfo == null) {
return "MOBILE";
}
} else if (extraInfo == null) {
return typeName;
}
return extraInfo;
}
}
} else {
k.e("can not get the permission of android.permission.ACCESS_WIFI_STATE");
}
} catch (Throwable th) {
k.e(th);
}
return "";
}
public static Integer k(Context context) {
try {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
if (telephonyManager != null) {
return Integer.valueOf(telephonyManager.getNetworkType());
}
return null;
} catch (Throwable unused) {
return null;
}
}
public static String l(Context context) {
String str;
if (c(i)) {
return i;
}
try {
str = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
i = str;
} catch (Throwable th) {
k.e(th);
}
if (str == null) {
return CategoryModel.unknown;
}
if (i.length() == 0) {
return CategoryModel.unknown;
}
return i;
}
public static int m(Context context) {
int i2 = j;
if (i2 != -1) {
return i2;
}
try {
if (p.a()) {
j = 1;
}
} catch (Throwable th) {
k.e(th);
}
j = 0;
return 0;
}
public static String n(Context context) {
String path;
if (c(l)) {
return l;
}
try {
} catch (Throwable th) {
k.e(th);
}
if (!r.a(context, "android.permission.WRITE_EXTERNAL_STORAGE")) {
k.warn("can not get the permission of android.permission.WRITE_EXTERNAL_STORAGE");
return null;
}
String externalStorageState = Environment.getExternalStorageState();
if (externalStorageState != null && externalStorageState.equals("mounted") && (path = Environment.getExternalStorageDirectory().getPath()) != null) {
StatFs statFs = new StatFs(path);
long availableBlocks = (statFs.getAvailableBlocks() * statFs.getBlockSize()) / 1000000;
String str = String.valueOf(availableBlocks) + "/" + String.valueOf((statFs.getBlockCount() * statFs.getBlockSize()) / 1000000);
l = str;
return str;
}
return null;
}
static String o(Context context) {
if (m != null) {
return m;
}
int myPid = Process.myPid();
Iterator<ActivityManager.RunningAppProcessInfo> it = ((ActivityManager) context.getSystemService("activity")).getRunningAppProcesses().iterator();
while (true) {
if (!it.hasNext()) {
break;
}
ActivityManager.RunningAppProcessInfo next = it.next();
if (next.pid == myPid) {
m = next.processName;
break;
}
}
return m;
}
public static String p(Context context) {
return a(context, StatConstants.DATABASE_NAME);
}
public static synchronized Integer q(Context context) {
Integer valueOf;
synchronized (l.class) {
if (n <= 0) {
n = q.a(context, "MTA_EVENT_INDEX", 0);
q.b(context, "MTA_EVENT_INDEX", n + 1000);
} else if (n % 1000 == 0) {
try {
int i2 = n + 1000;
if (n >= 2147383647) {
i2 = 0;
}
q.b(context, "MTA_EVENT_INDEX", i2);
} catch (Throwable th) {
k.w(th);
}
}
int i3 = n + 1;
n = i3;
valueOf = Integer.valueOf(i3);
}
return valueOf;
}
public static String r(Context context) {
try {
return String.valueOf(B(context) / 1000000) + "/" + String.valueOf(h() / 1000000);
} catch (Throwable th) {
th.printStackTrace();
return null;
}
}
public static JSONObject s(Context context) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("n", m.a());
String d2 = m.d();
if (d2 != null && d2.length() > 0) {
jSONObject.put("na", d2);
}
int b2 = m.b();
if (b2 > 0) {
jSONObject.put("fx", b2 / 1000000);
}
int c2 = m.c();
if (c2 > 0) {
jSONObject.put("fn", c2 / 1000000);
}
} catch (Throwable th) {
Log.w(StatConstants.LOG_TAG, "get cpu error", th);
}
return jSONObject;
}
public static String t(Context context) {
List<Sensor> sensorList;
if (c(r)) {
return r;
}
try {
SensorManager sensorManager = (SensorManager) context.getSystemService("sensor");
if (sensorManager != null && (sensorList = sensorManager.getSensorList(-1)) != null) {
StringBuilder sb = new StringBuilder(sensorList.size() * 10);
for (int i2 = 0; i2 < sensorList.size(); i2++) {
sb.append(sensorList.get(i2).getType());
if (i2 != sensorList.size() - 1) {
sb.append(",");
}
}
r = sb.toString();
}
} catch (Throwable th) {
k.e(th);
}
return r;
}
public static synchronized int u(Context context) {
synchronized (l.class) {
if (u != -1) {
return u;
}
v(context);
return u;
}
}
public static void v(Context context) {
int a2 = q.a(context, t, 1);
u = a2;
if (a2 == 1) {
q.b(context, t, 0);
}
}
public static boolean w(Context context) {
if (v < 0) {
v = q.a(context, "mta.qq.com.checktime", 0L);
}
return Math.abs(System.currentTimeMillis() - v) > 86400000;
}
public static void x(Context context) {
v = System.currentTimeMillis();
q.b(context, "mta.qq.com.checktime", v);
}
public static int y(Context context) {
return q.a(context, "mta.qq.com.difftime", 0);
}
public static boolean z(Context context) {
ActivityManager activityManager;
if (context == null || (activityManager = (ActivityManager) context.getSystemService("activity")) == null) {
return false;
}
String packageName = context.getPackageName();
Iterator<ActivityManager.RunningAppProcessInfo> it = activityManager.getRunningAppProcesses().iterator();
while (true) {
if (!it.hasNext()) {
break;
}
ActivityManager.RunningAppProcessInfo next = it.next();
if (next.processName.startsWith(packageName)) {
if (next.importance == 400) {
return true;
}
}
}
return false;
}
}

View File

@@ -0,0 +1,78 @@
package com.tencent.wxop.stat.common;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
/* loaded from: classes.dex */
class m {
static int a() {
try {
return new File("/sys/devices/system/cpu/").listFiles(new n()).length;
} catch (Exception e) {
e.printStackTrace();
return 1;
}
}
static int b() {
StatLogger statLogger;
int i = 0;
try {
String str = "";
InputStream inputStream = new ProcessBuilder("/system/bin/cat", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq").start().getInputStream();
byte[] bArr = new byte[24];
while (inputStream.read(bArr) != -1) {
str = str + new String(bArr);
}
inputStream.close();
String trim = str.trim();
if (trim.length() > 0) {
i = Integer.valueOf(trim).intValue();
}
} catch (Exception e) {
statLogger = l.k;
statLogger.e((Throwable) e);
}
return i * 1000;
}
static int c() {
StatLogger statLogger;
int i = 0;
try {
String str = "";
InputStream inputStream = new ProcessBuilder("/system/bin/cat", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq").start().getInputStream();
byte[] bArr = new byte[24];
while (inputStream.read(bArr) != -1) {
str = str + new String(bArr);
}
inputStream.close();
String trim = str.trim();
if (trim.length() > 0) {
i = Integer.valueOf(trim).intValue();
}
} catch (Throwable th) {
statLogger = l.k;
statLogger.e(th);
}
return i * 1000;
}
static String d() {
String[] strArr = {"", ""};
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("/proc/cpuinfo"), UnityActivity.BLOCKLY_TYPE_NONE);
String[] split = bufferedReader.readLine().split("\\s+");
for (int i = 2; i < split.length; i++) {
strArr[0] = strArr[0] + split[i] + " ";
}
bufferedReader.close();
} catch (IOException unused) {
}
return strArr[0];
}
}

View File

@@ -0,0 +1,16 @@
package com.tencent.wxop.stat.common;
import java.io.File;
import java.io.FileFilter;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
class n implements FileFilter {
n() {
}
@Override // java.io.FileFilter
public boolean accept(File file) {
return Pattern.matches("cpu[0-9]", file.getName());
}
}

View File

@@ -0,0 +1,5 @@
package com.tencent.wxop.stat.common;
/* loaded from: classes.dex */
class o {
}

View File

@@ -0,0 +1,30 @@
package com.tencent.wxop.stat.common;
import java.io.File;
/* loaded from: classes.dex */
class p {
private static int a = -1;
public static boolean a() {
int i = a;
if (i == 1) {
return true;
}
if (i == 0) {
return false;
}
String[] strArr = {"/bin", "/system/bin/", "/system/xbin/", "/system/sbin/", "/sbin/", "/vendor/bin/"};
for (int i2 = 0; i2 < 6; i2++) {
try {
if (new File(strArr[i2] + "su").exists()) {
a = 1;
return true;
}
} catch (Exception unused) {
}
}
a = 0;
return false;
}
}

View File

@@ -0,0 +1,56 @@
package com.tencent.wxop.stat.common;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
/* loaded from: classes.dex */
public class q {
private static SharedPreferences a;
public static int a(Context context, String str, int i) {
return a(context).getInt(l.a(context, StatConstants.MTA_COOPERATION_TAG + str), i);
}
public static long a(Context context, String str, long j) {
return a(context).getLong(l.a(context, StatConstants.MTA_COOPERATION_TAG + str), j);
}
static synchronized SharedPreferences a(Context context) {
SharedPreferences sharedPreferences;
synchronized (q.class) {
SharedPreferences sharedPreferences2 = context.getSharedPreferences(".mta-wxop", 0);
a = sharedPreferences2;
if (sharedPreferences2 == null) {
a = PreferenceManager.getDefaultSharedPreferences(context);
}
sharedPreferences = a;
}
return sharedPreferences;
}
public static String a(Context context, String str, String str2) {
return a(context).getString(l.a(context, StatConstants.MTA_COOPERATION_TAG + str), str2);
}
public static void b(Context context, String str, int i) {
String a2 = l.a(context, StatConstants.MTA_COOPERATION_TAG + str);
SharedPreferences.Editor edit = a(context).edit();
edit.putInt(a2, i);
edit.commit();
}
public static void b(Context context, String str, long j) {
String a2 = l.a(context, StatConstants.MTA_COOPERATION_TAG + str);
SharedPreferences.Editor edit = a(context).edit();
edit.putLong(a2, j);
edit.commit();
}
public static void b(Context context, String str, String str2) {
String a2 = l.a(context, StatConstants.MTA_COOPERATION_TAG + str);
SharedPreferences.Editor edit = a(context).edit();
edit.putString(a2, str2);
edit.commit();
}
}

View File

@@ -0,0 +1,158 @@
package com.tencent.wxop.stat.common;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class r {
private static String a = "";
public static String a(Context context) {
try {
if (a(context, "android.permission.READ_PHONE_STATE")) {
String deviceId = ((TelephonyManager) context.getSystemService("phone")).getDeviceId();
if (deviceId != null) {
return deviceId;
}
} else {
Log.e(StatConstants.LOG_TAG, "Could not get permission of android.permission.READ_PHONE_STATE");
}
return null;
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "get device id error", th);
return null;
}
}
public static String a(String str) {
if (str == null) {
return null;
}
if (Build.VERSION.SDK_INT < 8) {
return str;
}
try {
return new String(f.b(h.a(str.getBytes("UTF-8"), 0)), "UTF-8");
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "decode error", th);
return str;
}
}
public static JSONArray a(Context context, int i) {
return null;
}
public static void a(JSONObject jSONObject, String str, String str2) {
if (str2 != null) {
try {
if (str2.length() > 0) {
jSONObject.put(str, str2);
}
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "jsonPut error", th);
}
}
}
public static boolean a(Context context, String str) {
try {
return context.getPackageManager().checkPermission(str, context.getPackageName()) == 0;
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "checkPermission error", th);
return false;
}
}
public static String b(Context context) {
if (!a(context, "android.permission.ACCESS_WIFI_STATE")) {
Log.e(StatConstants.LOG_TAG, "Could not get permission of android.permission.ACCESS_WIFI_STATE");
return "";
}
try {
WifiManager wifiManager = (WifiManager) context.getSystemService("wifi");
return wifiManager == null ? "" : wifiManager.getConnectionInfo().getMacAddress();
} catch (Exception e) {
Log.e(StatConstants.LOG_TAG, "get wifi address error", e);
return "";
}
}
public static String b(String str) {
if (str == null) {
return null;
}
if (Build.VERSION.SDK_INT < 8) {
return str;
}
try {
return new String(h.b(f.a(str.getBytes("UTF-8")), 0), "UTF-8");
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "encode error", th);
return str;
}
}
public static WifiInfo c(Context context) {
WifiManager wifiManager;
if (!a(context, "android.permission.ACCESS_WIFI_STATE") || (wifiManager = (WifiManager) context.getApplicationContext().getSystemService("wifi")) == null) {
return null;
}
return wifiManager.getConnectionInfo();
}
public static String d(Context context) {
try {
WifiInfo c = c(context);
if (c != null) {
return c.getBSSID();
}
return null;
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "encode error", th);
return null;
}
}
public static String e(Context context) {
try {
WifiInfo c = c(context);
if (c != null) {
return c.getSSID();
}
return null;
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "encode error", th);
return null;
}
}
public static boolean f(Context context) {
try {
if (a(context, "android.permission.INTERNET") && a(context, "android.permission.ACCESS_NETWORK_STATE")) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
if (connectivityManager != null) {
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
if (activeNetworkInfo != null && activeNetworkInfo.isAvailable()) {
return true;
}
Log.w(StatConstants.LOG_TAG, "Network error");
return false;
}
} else {
Log.e(StatConstants.LOG_TAG, "can not get the permisson of android.permission.INTERNET");
}
} catch (Throwable th) {
Log.e(StatConstants.LOG_TAG, "isNetworkAvailable error", th);
}
return false;
}
}