手机管家 v7.2.0版本的 MD5 值为:dd92ba71696e35a4b841cd1b5de53cd3
以下内容为反编译后的 bob.java 源代码,内容仅作参考
package tcs;
import android.content.Context;
import android.util.SparseArray;
import com.tencent.kingkong.database.SQLiteDatabase;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public final class bob implements boa {
private static bob ghy = null;
private boolean akA;
private bny ghA;
private Context ghB;
private SparseArray<bnz> ghz = new SparseArray<>(5);
private List<bns> aIt = new ArrayList(5);
private boolean akN = true;
public static synchronized bob cE(Context context) {
bob bobVar;
synchronized (bob.class) {
if (ghy == null) {
ghy = new bob(context, true);
bms.o(" create uphandler up:true", new Object[0]);
}
bobVar = ghy;
}
return bobVar;
}
public static synchronized bob m(Context context, boolean z) {
bob bobVar;
synchronized (bob.class) {
if (ghy == null) {
ghy = new bob(context, z);
bms.o(" create uphandler up: %b", Boolean.valueOf(z));
}
if (ghy.a() != z) {
ghy.D(z);
bms.o(" change uphandler up: %b", Boolean.valueOf(z));
}
bobVar = ghy;
}
return bobVar;
}
private bob(Context context, boolean z) {
this.ghB = null;
this.akA = true;
Context applicationContext = context != null ? context.getApplicationContext() : null;
if (applicationContext != null) {
this.ghB = applicationContext;
} else {
this.ghB = context;
}
this.akA = z;
this.ghA = bny.cD(this.ghB);
}
@Override
public final synchronized boolean a(int i, bnz bnzVar) {
boolean z;
if (bnzVar == null) {
z = false;
} else {
this.ghz.append(i, bnzVar);
z = true;
}
return z;
}
@Override
public final synchronized boolean a(bns bnsVar) {
boolean z;
if (bnsVar == null) {
z = false;
} else {
if (!this.aIt.contains(bnsVar)) {
this.aIt.add(bnsVar);
}
z = true;
}
return z;
}
@Override
public final void a(bnt bntVar) {
boolean z;
Throwable th;
int i;
boolean z2;
bmc agK;
String lH;
if (!a() || !b()) {
if (bntVar.c() == 2) {
bms.o(" Not UpProc real event sync 2 DB done false", new Object[0]);
bntVar.D(false);
}
if (bntVar.b != 0) {
bms.o(" Not UpProc not req: %d", Integer.valueOf(bntVar.c()));
return;
}
bms.o(" NotUpProc com req start ", new Object[0]);
}
if (!bmt.cA(this.ghB)) {
bms.j(" doUpload network is disabled!", new Object[0]);
if (bntVar.c() == 2) {
bntVar.D(false);
return;
}
return;
}
a(com.tencent.beacon.b.h.cn(this.ghB));
if (bntVar == null) {
bms.k(" upData == null ", new Object[0]);
return;
}
int c = bntVar.c();
String dZ = bntVar.dZ();
if (dZ == null || SQLiteDatabase.KeyEmpty.equals(dZ.trim())) {
bms.k(" url error", new Object[0]);
if (bntVar.c() == 2) {
bntVar.D(false);
}
b(c, -1, 0L, 0L, false, "url error");
return;
}
byte[] b = b(bntVar);
String db = bntVar.db();
String str = db != null ? "?rid=" + db : null;
bmc ahm = bmc.ahm();
if (ahm != null && (lH = ahm.lH()) != null && !SQLiteDatabase.KeyEmpty.equals(lH)) {
str = str == null ? "?sid=" + lH : str + "&sid=" + lH;
}
String str2 = str != null ? dZ + str : dZ;
bms.o(" start upload cmd: %d url:%s datas:%s", Integer.valueOf(c), str2, bntVar.getClass().toString());
if (b == null) {
bms.j(" sendData is null", new Object[0]);
b(c, -1, 0L, 0L, false, "sendData error");
return;
}
bny ais = ais();
if (ais == null) {
bms.k(" reqH error", new Object[0]);
b(c, -1, 0L, 0L, false, "reqHandler error");
return;
}
com.tencent.beacon.b.f.af(this.ghB);
bnx bnxVar = new bnx();
com.tencent.beacon.b.d.ahD().oP();
System.currentTimeMillis();
try {
try {
byte[] a = ais.a(str2, b, bnxVar, bntVar);
byte[] a2 = (a == null && c == 100 && !"http://strategy.beacon.qq.com/analytics/upload".equals(str2)) ? ais.a("http://strategy.beacon.qq.com/analytics/upload", b, bnxVar, bntVar) : a;
long a3 = bnxVar.a();
long cu = bnxVar.cu();
bmi ac = ac(a2);
if (ac != null) {
i = ac.b;
try {
z = ac.eER == 0;
} catch (Throwable th2) {
th = th2;
z2 = false;
try {
b(c, i, bnxVar.a(), bnxVar.cu(), false, th.toString().replace("java.lang.Exception: ", SQLiteDatabase.KeyEmpty));
bnxVar.iw();
bntVar.vo();
bnxVar.dZ();
bnxVar.c();
bms.k(" req error %s", th.toString());
bntVar.D(z2);
return;
} catch (Throwable th3) {
th = th3;
z = z2;
bntVar.D(z);
throw th;
}
}
try {
bms.i("response.cmd:%d response.result:%d", Integer.valueOf(ac.b), Byte.valueOf(ac.eER));
} catch (Throwable th4) {
th = th4;
z2 = z;
b(c, i, bnxVar.a(), bnxVar.cu(), false, th.toString().replace("java.lang.Exception: ", SQLiteDatabase.KeyEmpty));
bnxVar.iw();
bntVar.vo();
bnxVar.dZ();
bnxVar.c();
bms.k(" req error %s", th.toString());
bntVar.D(z2);
return;
}
} else {
i = -1;
z = false;
}
if (bntVar != null && ac != null) {
com.tencent.beacon.b.d ahD = com.tencent.beacon.b.d.ahD();
if (ahD != null) {
if (ac.Rc != null) {
ahD.bi(ac.Rc.trim());
}
ahD.a(ac.e - new Date().getTime());
bms.o(" fix ip:%s tmgap: %d", ahD.ir(), Long.valueOf(ahD.oP()));
}
if ((ac.b == 101 || ac.b == 103 || ac.b == 105) && (agK = bma.ci(this.ghB).agK()) != null && (agK.oU() == null || (ac.Rm != null && !agK.oU().equals(ac.Rm)))) {
agK.bi(ac.Rm);
}
byte[] bArr = ac.agT;
if (bArr != null) {
SparseArray<bnz> aho = aho();
if (aho != null && aho.size() > 0) {
int c2 = bntVar.c();
int i2 = ac.b;
if (ac.eER == 0 && c2 > 0 && c2 <= 5) {
bmu bmuVar = new bmu(this.ghB);
try {
if (SQLiteDatabase.KeyEmpty.equals(com.tencent.beacon.b.j.cs(this.ghB).b()) && !bmc.ahm().Mi()) {
bma.agG().a(new bnw(this.ghB));
bmuVar.wC();
}
} catch (Exception e) {
}
}
if (i2 != 0) {
switch (c2) {
case 4:
if (i2 != 105) {
bms.j(" UNMATCH req: %d , rep: %d", Integer.valueOf(c2), Integer.valueOf(i2));
break;
}
a(aho, i2, bArr);
break;
case 100:
if (i2 != 101) {
bms.j(" UNMATCH req: %d , rep: %d", Integer.valueOf(c2), Integer.valueOf(i2));
break;
}
a(aho, i2, bArr);
break;
case 102:
if (i2 != 103) {
bms.j(" UNMATCH req: %d , rep: %d", Integer.valueOf(c2), Integer.valueOf(i2));
break;
}
a(aho, i2, bArr);
break;
default:
bms.j(" unknown req: %d ", Integer.valueOf(c2));
break;
}
} else {
bms.o(" response no datas ", new Object[0]);
}
} else {
bms.o(" no handler! ", new Object[0]);
}
} else {
bms.o(" no response! ", new Object[0]);
}
}
b(c, i, a3, cu, z, null);
bnxVar.iw();
bntVar.vo();
bnxVar.dZ();
bnxVar.c();
new StringBuilder().append((int) ac.eER).toString();
bntVar.D(z);
} catch (Throwable th5) {
th = th5;
i = -1;
z2 = false;
}
} catch (Throwable th6) {
th = th6;
z = false;
}
}
private static byte[] b(bnt bntVar) {
if (bntVar != null) {
try {
bmh ahO = bntVar.ahO();
if (ahO != null) {
bms.i(" RequestPackage info appkey:%s sdkid:%s appVersion:%s cmd: %d", ahO.OT, ahO.Rc, ahO.Rb, Integer.valueOf(ahO.f));
bna bnaVar = new bna();
bnaVar.a(1);
bnaVar.bi("test");
bnaVar.a("test");
bnaVar.v("detail", ahO);
byte[] a = bnaVar.a();
bmc ahm = bmc.ahm();
if (ahm != null) {
return blx.a(a, ahm.ahv(), ahm.ahu(), ahm.ahw());
}
}
} catch (Throwable th) {
bms.k(" parseSendDatas error", new Object[0]);
bms.i(th);
bntVar.b();
}
}
return null;
}
private static bmi ac(byte[] bArr) {
byte[] bArr2;
if (bArr != null) {
try {
bmc ahm = bmc.ahm();
if (ahm != null) {
bArr2 = blx.b(bArr, ahm.ahv(), ahm.ahu(), ahm.ahw());
} else {
bArr2 = null;
}
if (bArr2 != null) {
bna bnaVar = new bna();
bnaVar.aO(bArr2);
bmi bmiVar = new bmi();
bms.i(" covert to ResponsePackage ", new Object[0]);
return (bmi) bnaVar.x("detail", bmiVar);
}
} catch (Throwable th) {
bms.i(th);
}
}
return null;
}
private void b(int i, int i2, long j, long j2, boolean z, String str) {
bns[] aio = aio();
if (aio != null) {
for (bns bnsVar : aio) {
bnsVar.a(i, i2, j, j2, z, str);
}
}
}
private synchronized bns[] aio() {
return (this.aIt == null || this.aIt.size() <= 0) ? null : (bns[]) this.aIt.toArray(new bns[0]);
}
private synchronized bny ais() {
return this.ghA;
}
private synchronized SparseArray<bnz> aho() {
SparseArray<bnz> sparseArray;
if (this.ghz == null || this.ghz.size() <= 0) {
sparseArray = null;
} else {
new bmw();
sparseArray = bmw.f(this.ghz);
}
return sparseArray;
}
private boolean a(SparseArray<bnz> sparseArray, int i, byte[] bArr) {
if (sparseArray == null || bArr == null) {
return true;
}
switch (i) {
case 103:
try {
bms.h(" process CMD_RESPONSE_GEN_QIMEI", new Object[0]);
bmx bmxVar = new bmx(bArr);
bml bmlVar = new bml();
bmlVar.a(bmxVar);
if (bmlVar.a != null) {
com.tencent.beacon.b.j.cs(this.ghB).a(bmlVar.a);
new bmu(this.ghB).a(bmlVar.a);
}
bms.o(" Qimei:%s imei:%s imsi:%s aid:%s mac:%s ", bmlVar.a, bmlVar.OT, bmlVar.Rc, bmlVar.Ri, bmlVar.Rb);
} catch (Throwable th) {
bms.i(th);
}
return true;
default:
bnz bnzVar = sparseArray.get(i);
if (bnzVar == null) {
bms.j(" no handler key:%d", Integer.valueOf(i));
return false;
}
try {
bms.i(" key:%d handler: %s", Integer.valueOf(i), bnzVar.getClass().toString());
bnzVar.a(i, bArr, true);
return true;
} catch (Throwable th2) {
bms.i(th2);
bms.k(" handle error key:%d", Integer.valueOf(i));
return false;
}
}
}
public final synchronized boolean a() {
return this.akA;
}
private synchronized void D(boolean z) {
this.akA = z;
}
public final synchronized boolean b() {
return bmt.cj(this.ghB) ? true : this.akN;
}
}