Initial commit
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
package com.tencent.bugly.crashreport.common.strategy;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.tencent.bugly.proguard.z;
|
||||
import java.util.Map;
|
||||
|
||||
/* compiled from: BUGLY */
|
||||
/* loaded from: classes.dex */
|
||||
public class StrategyBean implements Parcelable {
|
||||
public static final Parcelable.Creator<StrategyBean> CREATOR = new Parcelable.Creator<StrategyBean>() { // from class: com.tencent.bugly.crashreport.common.strategy.StrategyBean.1
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ StrategyBean createFromParcel(Parcel parcel) {
|
||||
return new StrategyBean(parcel);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* bridge */ /* synthetic */ StrategyBean[] newArray(int i) {
|
||||
return new StrategyBean[i];
|
||||
}
|
||||
};
|
||||
public static String a = "http://rqd.uu.qq.com/rqd/sync";
|
||||
public static String b = "http://android.bugly.qq.com/rqd/async";
|
||||
public static String c = "http://android.bugly.qq.com/rqd/async";
|
||||
public static String d;
|
||||
public long e;
|
||||
public long f;
|
||||
public boolean g;
|
||||
public boolean h;
|
||||
public boolean i;
|
||||
public boolean j;
|
||||
public boolean k;
|
||||
public boolean l;
|
||||
public boolean m;
|
||||
public boolean n;
|
||||
public boolean o;
|
||||
public long p;
|
||||
public long q;
|
||||
public String r;
|
||||
public String s;
|
||||
public String t;
|
||||
public String u;
|
||||
public Map<String, String> v;
|
||||
public int w;
|
||||
public long x;
|
||||
public long y;
|
||||
|
||||
public StrategyBean() {
|
||||
this.e = -1L;
|
||||
this.f = -1L;
|
||||
this.g = true;
|
||||
this.h = true;
|
||||
this.i = true;
|
||||
this.j = true;
|
||||
this.k = false;
|
||||
this.l = true;
|
||||
this.m = true;
|
||||
this.n = true;
|
||||
this.o = true;
|
||||
this.q = 30000L;
|
||||
this.r = b;
|
||||
this.s = c;
|
||||
this.t = a;
|
||||
this.w = 10;
|
||||
this.x = 300000L;
|
||||
this.y = -1L;
|
||||
this.f = System.currentTimeMillis();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("S(@L@L");
|
||||
sb.append("@)");
|
||||
d = sb.toString();
|
||||
sb.setLength(0);
|
||||
sb.append("*^@K#K");
|
||||
sb.append("@!");
|
||||
this.u = sb.toString();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeLong(this.f);
|
||||
parcel.writeByte(this.g ? (byte) 1 : (byte) 0);
|
||||
parcel.writeByte(this.h ? (byte) 1 : (byte) 0);
|
||||
parcel.writeByte(this.i ? (byte) 1 : (byte) 0);
|
||||
parcel.writeString(this.r);
|
||||
parcel.writeString(this.s);
|
||||
parcel.writeString(this.u);
|
||||
z.b(parcel, this.v);
|
||||
parcel.writeByte(this.j ? (byte) 1 : (byte) 0);
|
||||
parcel.writeByte(this.k ? (byte) 1 : (byte) 0);
|
||||
parcel.writeByte(this.n ? (byte) 1 : (byte) 0);
|
||||
parcel.writeByte(this.o ? (byte) 1 : (byte) 0);
|
||||
parcel.writeLong(this.q);
|
||||
parcel.writeByte(this.l ? (byte) 1 : (byte) 0);
|
||||
parcel.writeByte(this.m ? (byte) 1 : (byte) 0);
|
||||
parcel.writeLong(this.p);
|
||||
parcel.writeInt(this.w);
|
||||
parcel.writeLong(this.x);
|
||||
parcel.writeLong(this.y);
|
||||
}
|
||||
|
||||
public StrategyBean(Parcel parcel) {
|
||||
this.e = -1L;
|
||||
this.f = -1L;
|
||||
boolean z = true;
|
||||
this.g = true;
|
||||
this.h = true;
|
||||
this.i = true;
|
||||
this.j = true;
|
||||
this.k = false;
|
||||
this.l = true;
|
||||
this.m = true;
|
||||
this.n = true;
|
||||
this.o = true;
|
||||
this.q = 30000L;
|
||||
this.r = b;
|
||||
this.s = c;
|
||||
this.t = a;
|
||||
this.w = 10;
|
||||
this.x = 300000L;
|
||||
this.y = -1L;
|
||||
try {
|
||||
d = "S(@L@L@)";
|
||||
this.f = parcel.readLong();
|
||||
this.g = parcel.readByte() == 1;
|
||||
this.h = parcel.readByte() == 1;
|
||||
this.i = parcel.readByte() == 1;
|
||||
this.r = parcel.readString();
|
||||
this.s = parcel.readString();
|
||||
this.u = parcel.readString();
|
||||
this.v = z.b(parcel);
|
||||
this.j = parcel.readByte() == 1;
|
||||
this.k = parcel.readByte() == 1;
|
||||
this.n = parcel.readByte() == 1;
|
||||
this.o = parcel.readByte() == 1;
|
||||
this.q = parcel.readLong();
|
||||
this.l = parcel.readByte() == 1;
|
||||
if (parcel.readByte() != 1) {
|
||||
z = false;
|
||||
}
|
||||
this.m = z;
|
||||
this.p = parcel.readLong();
|
||||
this.w = parcel.readInt();
|
||||
this.x = parcel.readLong();
|
||||
this.y = parcel.readLong();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
202
sources/com/tencent/bugly/crashreport/common/strategy/a.java
Normal file
202
sources/com/tencent/bugly/crashreport/common/strategy/a.java
Normal file
@@ -0,0 +1,202 @@
|
||||
package com.tencent.bugly.crashreport.common.strategy;
|
||||
|
||||
import android.content.Context;
|
||||
import com.tencent.bugly.crashreport.biz.b;
|
||||
import com.tencent.bugly.proguard.ar;
|
||||
import com.tencent.bugly.proguard.as;
|
||||
import com.tencent.bugly.proguard.o;
|
||||
import com.tencent.bugly.proguard.p;
|
||||
import com.tencent.bugly.proguard.r;
|
||||
import com.tencent.bugly.proguard.w;
|
||||
import com.tencent.bugly.proguard.x;
|
||||
import com.tencent.bugly.proguard.z;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* compiled from: BUGLY */
|
||||
/* loaded from: classes.dex */
|
||||
public final class a {
|
||||
public static int a = 1000;
|
||||
private static a b;
|
||||
private static String h;
|
||||
private final List<com.tencent.bugly.a> c;
|
||||
private Context g;
|
||||
private StrategyBean f = null;
|
||||
private final StrategyBean e = new StrategyBean();
|
||||
private final w d = w.a();
|
||||
|
||||
private a(Context context, List<com.tencent.bugly.a> list) {
|
||||
this.g = context;
|
||||
this.c = list;
|
||||
}
|
||||
|
||||
public static StrategyBean d() {
|
||||
byte[] bArr;
|
||||
List<r> a2 = p.a().a(2);
|
||||
if (a2 == null || a2.size() <= 0 || (bArr = a2.get(0).g) == null) {
|
||||
return null;
|
||||
}
|
||||
return (StrategyBean) z.a(bArr, StrategyBean.CREATOR);
|
||||
}
|
||||
|
||||
public final StrategyBean c() {
|
||||
StrategyBean strategyBean = this.f;
|
||||
return strategyBean != null ? strategyBean : this.e;
|
||||
}
|
||||
|
||||
public final synchronized boolean b() {
|
||||
return this.f != null;
|
||||
}
|
||||
|
||||
public static synchronized a a(Context context, List<com.tencent.bugly.a> list) {
|
||||
a aVar;
|
||||
synchronized (a.class) {
|
||||
if (b == null) {
|
||||
b = new a(context, list);
|
||||
}
|
||||
aVar = b;
|
||||
}
|
||||
return aVar;
|
||||
}
|
||||
|
||||
public final void a(long j) {
|
||||
this.d.a(new Thread() { // from class: com.tencent.bugly.crashreport.common.strategy.a.1
|
||||
@Override // java.lang.Thread, java.lang.Runnable
|
||||
public final void run() {
|
||||
try {
|
||||
Map<String, byte[]> a2 = p.a().a(a.a, (o) null, true);
|
||||
if (a2 != null) {
|
||||
byte[] bArr = a2.get("device");
|
||||
byte[] bArr2 = a2.get("gateway");
|
||||
if (bArr != null) {
|
||||
com.tencent.bugly.crashreport.common.info.a.a(a.this.g).e(new String(bArr));
|
||||
}
|
||||
if (bArr2 != null) {
|
||||
com.tencent.bugly.crashreport.common.info.a.a(a.this.g).d(new String(bArr2));
|
||||
}
|
||||
}
|
||||
a.this.f = a.d();
|
||||
if (a.this.f != null && !z.a(a.h) && z.c(a.h)) {
|
||||
a.this.f.r = a.h;
|
||||
a.this.f.s = a.h;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
if (!x.a(th)) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
a aVar = a.this;
|
||||
aVar.a(aVar.f, false);
|
||||
}
|
||||
}, j);
|
||||
}
|
||||
|
||||
public static synchronized a a() {
|
||||
a aVar;
|
||||
synchronized (a.class) {
|
||||
aVar = b;
|
||||
}
|
||||
return aVar;
|
||||
}
|
||||
|
||||
protected final void a(StrategyBean strategyBean, boolean z) {
|
||||
x.c("[Strategy] Notify %s", b.class.getName());
|
||||
b.a(strategyBean, z);
|
||||
for (com.tencent.bugly.a aVar : this.c) {
|
||||
try {
|
||||
x.c("[Strategy] Notify %s", aVar.getClass().getName());
|
||||
aVar.onServerStrategyChanged(strategyBean);
|
||||
} catch (Throwable th) {
|
||||
if (!x.a(th)) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(String str) {
|
||||
if (!z.a(str) && z.c(str)) {
|
||||
h = str;
|
||||
} else {
|
||||
x.d("URL user set is invalid.", new Object[0]);
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(as asVar) {
|
||||
if (asVar == null) {
|
||||
return;
|
||||
}
|
||||
StrategyBean strategyBean = this.f;
|
||||
if (strategyBean == null || asVar.h != strategyBean.p) {
|
||||
StrategyBean strategyBean2 = new StrategyBean();
|
||||
strategyBean2.g = asVar.a;
|
||||
strategyBean2.i = asVar.c;
|
||||
strategyBean2.h = asVar.b;
|
||||
if (z.a(h) || !z.c(h)) {
|
||||
if (z.c(asVar.d)) {
|
||||
x.c("[Strategy] Upload url changes to %s", asVar.d);
|
||||
strategyBean2.r = asVar.d;
|
||||
}
|
||||
if (z.c(asVar.e)) {
|
||||
x.c("[Strategy] Exception upload url changes to %s", asVar.e);
|
||||
strategyBean2.s = asVar.e;
|
||||
}
|
||||
}
|
||||
ar arVar = asVar.f;
|
||||
if (arVar != null && !z.a(arVar.a)) {
|
||||
strategyBean2.u = asVar.f.a;
|
||||
}
|
||||
long j = asVar.h;
|
||||
if (j != 0) {
|
||||
strategyBean2.p = j;
|
||||
}
|
||||
Map<String, String> map = asVar.g;
|
||||
if (map != null && map.size() > 0) {
|
||||
Map<String, String> map2 = asVar.g;
|
||||
strategyBean2.v = map2;
|
||||
String str = map2.get("B11");
|
||||
if (str != null && str.equals("1")) {
|
||||
strategyBean2.j = true;
|
||||
} else {
|
||||
strategyBean2.j = false;
|
||||
}
|
||||
String str2 = asVar.g.get("B3");
|
||||
if (str2 != null) {
|
||||
strategyBean2.y = Long.valueOf(str2).longValue();
|
||||
}
|
||||
int i = asVar.i;
|
||||
strategyBean2.q = i;
|
||||
strategyBean2.x = i;
|
||||
String str3 = asVar.g.get("B27");
|
||||
if (str3 != null && str3.length() > 0) {
|
||||
try {
|
||||
int parseInt = Integer.parseInt(str3);
|
||||
if (parseInt > 0) {
|
||||
strategyBean2.w = parseInt;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (!x.a(e)) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
String str4 = asVar.g.get("B25");
|
||||
if (str4 != null && str4.equals("1")) {
|
||||
strategyBean2.l = true;
|
||||
} else {
|
||||
strategyBean2.l = false;
|
||||
}
|
||||
}
|
||||
x.a("[Strategy] enableCrashReport:%b, enableQuery:%b, enableUserInfo:%b, enableAnr:%b, enableBlock:%b, enableSession:%b, enableSessionTimer:%b, sessionOverTime:%d, enableCocos:%b, strategyLastUpdateTime:%d", Boolean.valueOf(strategyBean2.g), Boolean.valueOf(strategyBean2.i), Boolean.valueOf(strategyBean2.h), Boolean.valueOf(strategyBean2.j), Boolean.valueOf(strategyBean2.k), Boolean.valueOf(strategyBean2.n), Boolean.valueOf(strategyBean2.o), Long.valueOf(strategyBean2.q), Boolean.valueOf(strategyBean2.l), Long.valueOf(strategyBean2.p));
|
||||
this.f = strategyBean2;
|
||||
p.a().b(2);
|
||||
r rVar = new r();
|
||||
rVar.b = 2;
|
||||
rVar.a = strategyBean2.e;
|
||||
rVar.e = strategyBean2.f;
|
||||
rVar.g = z.a(strategyBean2);
|
||||
p.a().a(rVar);
|
||||
a(strategyBean2, true);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user