正在查看: 哔哩哔哩 v1.6.6 应用的 awr.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 哔哩哔哩 v1.6.6 应用的 awr.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package bl;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import com.tencent.stat.StatReportStrategy;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public class awr {
private static int A = 30000;
private static HashSet<String> B = null;
private static int D = 100000;
private static int E = 30;
private static int F = 10;
private static int G = 100;
private static int H = 30;
private static int I = 1;
private static String J = null;
private static String K = null;
private static String L = null;
private static String M = "mta_channel";
private static int N = 180;
private static String O = null;
private static int P = 1024;
private static long Q = 0;
private static long R = 300000;
private static volatile String S = "http://pingma.qq.com:80/mstat/report";
private static int T = 0;
private static volatile int U = 0;
private static int V = 20;
private static int W = 0;
private static boolean X = false;
private static int Y = 4096;
private static boolean Z = true;
private static String aa = null;
private static boolean ab = false;
private static awu ac = null;
private static awx ad = null;
private static String ae = null;
private static JSONObject af = null;
private static long ah = 800;
private static awq ai = null;
private static boolean aj = true;
private static volatile boolean al = true;
static String c = "__HIBERNATE__";
static String d = "__HIBERNATE__TIME";
static String e = "__MTA_KILL__";
static String f = "";
static boolean g = false;
static int h = 500;
static long i = 10000;
static boolean j = true;
public static boolean k = true;
static volatile String l = "pingma.qq.com:80";
static boolean m = true;
static int n = 0;
static long o = 10000;
static int p = 512;
static awv q = null;
static boolean r = false;
static boolean s = true;
static boolean t = true;
static long f24u = 7;
private static boolean y = false;
private static boolean z = true;
private static axq w = axo.b();
static a a = new a(2);
static a b = new a(1);
private static StatReportStrategy x = StatReportStrategy.APP_LAUNCH;
private static HashSet<String> C = new HashSet<>();
private static HashSet<String> ag = new HashSet<>();
static JSONObject v = new JSONObject();
private static Map<String, Object> ak = new HashMap();
static class a {
int a;
private boolean e = false;
JSONObject b = new JSONObject();
String c = "";
int d = 0;
public void a(Context context) {
axr.b(context, a(), b().toString());
}
public boolean b(Context context) {
if (this.e) {
return true;
}
this.e = true;
String a = axr.a(context, a(), "");
if (TextUtils.isEmpty(a)) {
return false;
}
a(a);
return true;
}
public String a() {
return "com.tencent.mta.cfg.store" + this.a;
}
public a(int i) {
this.a = i;
}
public JSONObject b() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("type", this.a);
jSONObject.put("props", this.b);
jSONObject.put("md5sum", this.c);
jSONObject.put("version", this.d);
} catch (Exception e) {
att.a(e);
}
return jSONObject;
}
private void a(String str) {
try {
if (awr.b()) {
awr.w.h("load config begin:" + str);
}
JSONObject jSONObject = new JSONObject(str);
this.a = jSONObject.optInt("type");
this.b = new JSONObject(jSONObject.optString("props", ""));
this.c = jSONObject.optString("md5sum", "");
this.d = jSONObject.optInt("version", 0);
if (awr.b()) {
awr.w.h("load config end, type=" + this.a + " ,props=" + this.b + " ,version=" + this.d);
}
awr.e();
} catch (JSONException e) {
att.a(e);
}
}
String c() {
return this.b.toString();
}
}
public static StatReportStrategy a() {
return x;
}
public static void a(StatReportStrategy statReportStrategy) {
x = statReportStrategy;
if (statReportStrategy != StatReportStrategy.PERIOD) {
awz.d = 0L;
}
if (b()) {
w.h("Change to statSendStrategy: " + statReportStrategy);
}
}
public static boolean b() {
return y;
}
public static boolean c() {
return z;
}
public static void a(boolean z2) {
z = z2;
if (z2) {
return;
}
w.c("!!!!!!MTA StatService has been disabled!!!!!!");
}
public static int d() {
return A;
}
static boolean a(String str) {
if (B == null || B.size() == 0 || !axo.c(str)) {
return false;
}
return B.contains(str.toLowerCase());
}
static void b(String str) {
if (axo.c(str)) {
String[] split = str.toLowerCase().split(";");
if (split.length > 0) {
if (B == null) {
B = new HashSet<>(split.length);
}
B.addAll(Arrays.asList(split));
}
}
}
public static boolean c(String str) {
if (C == null || C.size() == 0 || !axo.c(str)) {
return false;
}
return C.contains(str.toLowerCase());
}
public static void d(String str) {
if (axo.c(str)) {
String[] split = str.toLowerCase().split(";");
if (split.length > 0) {
if (C == null) {
C = new HashSet<>(split.length);
}
C.addAll(Arrays.asList(split));
}
}
}
static void e() {
if (b != null) {
b(b.b.optString("__INSTANT_EI_LIST__", null));
d(b.b.optString("__DONT_REPORT_EI_LIST__", null));
}
}
public static int f() {
return G;
}
public static int g() {
return H;
}
public static int h() {
return F;
}
public static int i() {
return I;
}
static int j() {
return E;
}
public static int k() {
return D;
}
public static String a(Context context, String str, String str2) {
a(context);
return a(str, str2);
}
public static void a(Context context) {
a.b(context);
b.b(context);
e();
}
private static void G() {
Context a2 = awz.a((Context) null);
if (a2 != null) {
a(a2);
}
}
public static String a(String str, String str2) {
String string;
try {
G();
string = a.b.getString(str);
} catch (Throwable th) {
w.d(th);
}
return string != null ? string : str2;
}
public static String b(String str, String str2) {
String string;
try {
G();
string = b.b.getString(str);
} catch (Throwable unused) {
w.h("can't find SDK Properties key:" + str);
}
return string != null ? string : str2;
}
static void a(Context context, JSONObject jSONObject) {
try {
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String next = keys.next();
if (next.equalsIgnoreCase(Integer.toString(b.a))) {
a(context, b, jSONObject.getJSONObject(next));
e();
} else if (next.equalsIgnoreCase(Integer.toString(a.a))) {
a(context, a, jSONObject.getJSONObject(next));
} else {
if (!next.equalsIgnoreCase("rs")) {
return;
}
StatReportStrategy a2 = StatReportStrategy.a(jSONObject.getInt(next));
if (a2 != null) {
x = a2;
if (b()) {
w.h("Change to ReportStrategy:" + a2.name());
}
}
}
}
} catch (JSONException e2) {
w.b((Throwable) e2);
}
}
static void a(Context context, a aVar, JSONObject jSONObject) {
boolean z2 = false;
try {
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String next = keys.next();
if (next.equalsIgnoreCase("v")) {
int i2 = jSONObject.getInt(next);
if (aVar.d != i2) {
z2 = true;
}
aVar.d = i2;
} else if (next.equalsIgnoreCase("c")) {
String string = jSONObject.getString("c");
if (string.length() > 0) {
aVar.b = new JSONObject(string);
}
} else if (next.equalsIgnoreCase("m")) {
aVar.c = jSONObject.getString("m");
}
}
if (z2) {
ayc a2 = ayc.a(ayb.a());
if (a2 != null) {
a2.a(aVar);
}
if (aVar.a == b.a) {
a(aVar.b);
b(aVar.b);
}
}
a(context, aVar);
} catch (JSONException e2) {
w.b((Throwable) e2);
} catch (Throwable th) {
w.b(th);
}
}
static void a(JSONObject jSONObject) {
try {
int i2 = jSONObject.getInt("rs");
w.b("updateReportStrategy:" + jSONObject + ",sendStrategy:" + i2);
StatReportStrategy a2 = StatReportStrategy.a(i2);
if (a2 != null) {
a(a2);
}
} catch (JSONException unused) {
if (b()) {
w.b("rs not found.");
}
}
}
static void a(Context context, a aVar) throws JSONException {
if (aVar.a == b.a) {
b = aVar;
a(b.b);
e();
} else if (aVar.a == a.a) {
a = aVar;
}
}
static void b(Context context, JSONObject jSONObject) {
JSONObject jSONObject2;
int intValue;
try {
String optString = jSONObject.optString(e);
if (axo.c(optString) && (jSONObject2 = new JSONObject(optString)) != null && jSONObject2.length() != 0) {
boolean z2 = false;
if (!jSONObject2.isNull("sm")) {
Object obj = jSONObject2.get("sm");
if (obj instanceof Integer) {
intValue = ((Integer) obj).intValue();
} else {
intValue = obj instanceof String ? Integer.valueOf((String) obj).intValue() : 0;
}
if (intValue > 0) {
if (b()) {
w.b("match sleepTime:" + intValue + " minutes");
}
axr.b(context, d, System.currentTimeMillis() + (intValue * 60 * 1000));
a(false);
w.c("MTA is disable for current SDK version");
}
}
if (a(jSONObject2, "sv", "3.4.2")) {
w.b("match sdk version:3.4.2");
z2 = true;
}
if (a(jSONObject2, "md", Build.MODEL)) {
w.b("match MODEL:" + Build.MODEL);
z2 = true;
}
if (a(jSONObject2, "av", axo.k(context))) {
w.b("match app version:" + axo.k(context));
z2 = true;
}
if (a(jSONObject2, "mf", Build.MANUFACTURER + "")) {
w.b("match MANUFACTURER:" + Build.MANUFACTURER + "");
z2 = true;
}
if (a(jSONObject2, "osv", Build.VERSION.SDK_INT + "")) {
w.b("match android SDK version:" + Build.VERSION.SDK_INT);
z2 = true;
}
if (a(jSONObject2, "ov", Build.VERSION.SDK_INT + "")) {
w.b("match android SDK version:" + Build.VERSION.SDK_INT);
z2 = true;
}
if (a(jSONObject2, "ui", ayc.a(context).b(context).b())) {
w.b("match imei:" + ayc.a(context).b(context).b());
z2 = true;
}
if (a(jSONObject2, "mid", f(context))) {
w.b("match mid:" + f(context));
z2 = true;
}
if (z2) {
a(axo.b("3.4.2"));
}
}
} catch (Exception e2) {
w.b((Throwable) e2);
}
}
static boolean a(JSONObject jSONObject, String str, String str2) {
if (jSONObject.isNull(str)) {
return false;
}
String optString = jSONObject.optString(str);
return axo.c(str2) && axo.c(optString) && str2.equalsIgnoreCase(optString);
}
static void b(JSONObject jSONObject) {
if (jSONObject == null || jSONObject.length() == 0) {
return;
}
try {
b(ayb.a(), jSONObject);
String string = jSONObject.getString(c);
if (b()) {
w.h("hibernateVer:" + string + ", current version:3.4.2");
}
long b2 = axo.b(string);
if (axo.b("3.4.2") <= b2) {
a(b2);
}
} catch (JSONException unused) {
w.h("__HIBERNATE__ not found.");
}
}
static void a(long j2) {
axr.b(ayb.a(), c, j2);
a(false);
w.c("MTA is disable for current SDK version");
}
public static synchronized String b(Context context) {
synchronized (awr.class) {
if (K != null) {
return K;
}
if (context != null && K == null) {
K = axo.f(context);
}
if (K == null || K.trim().length() == 0) {
w.f("AppKey can not be null or empty, please read Developer's Guide first!");
}
return K;
}
}
public static synchronized String c(Context context) {
synchronized (awr.class) {
if (L != null) {
return L;
}
String a2 = axr.a(context, M, "");
if (TextUtils.isEmpty(a2) || f(a2)) {
a2 = axo.g(context);
}
L = a2;
if (L == null || L.trim().length() == 0) {
w.d("installChannel can not be null or empty, please read Developer's Guide first!");
}
return L;
}
}
private static boolean f(String str) {
return "Wechat_Sdk".equalsIgnoreCase(str) || "QQConnect".equalsIgnoreCase(str);
}
public static String d(Context context) {
return axr.a(context, "mta.acc.qq", f);
}
public static String l() {
return O;
}
public static int m() {
return N;
}
public static int n() {
return P;
}
public static boolean o() {
return k;
}
public static String p() {
return S;
}
static synchronized void a(int i2) {
synchronized (awr.class) {
U = i2;
}
}
public static int q() {
return V;
}
static void r() {
W++;
}
static void b(int i2) {
if (i2 < 0) {
return;
}
W = i2;
}
static int s() {
return W;
}
public static boolean t() {
return Z;
}
public static String e(Context context) {
if (context == null) {
w.e("Context for getCustomUid is null.");
return null;
}
if (aa == null) {
try {
aa = axr.a(context, "MTA_CUSTOM_UID", "");
} catch (ClassCastException e2) {
w.b((Throwable) e2);
}
}
return aa;
}
public static String f(Context context) {
return avw.a(context);
}
public static awu u() {
return ac;
}
public static void b(boolean z2) {
m = z2;
}
protected static awx v() {
return ad;
}
public static String w() {
return ae;
}
public static JSONObject x() {
return af;
}
public static boolean e(String str) {
return ag.contains(str);
}
public static long y() {
return ah;
}
public static boolean z() {
return r;
}
public static boolean A() {
return t;
}
public static boolean B() {
return aj;
}
public static JSONObject C() {
return v;
}
public static Map<String, Object> D() {
return ak;
}
public static void a(String str, Object obj) {
ak.put(str, obj);
}
public static boolean E() {
return al;
}
}