50度灰 v5.8.2版本的 MD5 值为:9fe3d350fdc75fa1a3ec45509fa0107e
以下内容为反编译后的 ba.java 源代码,内容仅作参考
package com.flurry.sdk;
import android.content.Context;
import android.os.Build;
import com.flurry.sdk.bb;
import com.flurry.sdk.di;
import com.flurry.sdk.dk;
import com.google.android.exoplayer2.extractor.ogg.DefaultOggSeeker;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.zip.CRC32;
public class ba {
public static final String f2659a = "com.flurry.sdk.ba";
private static ba f2660c;
public String f2661b;
private ct<List<bb>> f2662d;
private List<bb> f2663e;
private boolean f2664f;
private ba() {
}
private byte[] d() throws IOException {
IOException e2;
Closeable closeable;
Closeable closeable2 = null;
try {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
try {
List<bb> list = this.f2663e;
if (list != null && !list.isEmpty()) {
dataOutputStream.writeShort(1);
dataOutputStream.writeShort(1);
dataOutputStream.writeLong(System.currentTimeMillis());
dataOutputStream.writeUTF(ck.a().f2893b);
dataOutputStream.writeUTF(cb.a().e());
dataOutputStream.writeShort(cl.b());
dataOutputStream.writeShort(3);
cb.a();
dataOutputStream.writeUTF(cb.d());
dataOutputStream.writeBoolean(bs.a().f());
ArrayList<ag> arrayList = new ArrayList();
for (Map.Entry entry : Collections.unmodifiableMap(bs.a().f2792a).entrySet()) {
ag agVar = new ag();
agVar.f2535a = ((ca) entry.getKey()).f2854d;
if (((ca) entry.getKey()).f2855e) {
agVar.f2536b = new String((byte[]) entry.getValue());
} else {
agVar.f2536b = em.b((byte[]) entry.getValue());
}
arrayList.add(agVar);
}
dataOutputStream.writeShort(arrayList.size());
for (ag agVar2 : arrayList) {
dataOutputStream.writeShort(agVar2.f2535a);
byte[] bytes = agVar2.f2536b.getBytes();
dataOutputStream.writeShort(bytes.length);
dataOutputStream.write(bytes);
}
dataOutputStream.writeShort(6);
dataOutputStream.writeShort(at.f2587b - 1);
dataOutputStream.writeUTF(Build.MODEL);
dataOutputStream.writeShort(at.f2588c - 1);
dataOutputStream.writeUTF(Build.BOARD);
dataOutputStream.writeShort(at.f2589d - 1);
dataOutputStream.writeUTF(Build.ID);
dataOutputStream.writeShort(at.f2590e - 1);
dataOutputStream.writeUTF(Build.DEVICE);
dataOutputStream.writeShort(at.f2591f - 1);
dataOutputStream.writeUTF(Build.PRODUCT);
dataOutputStream.writeShort(at.f2592g - 1);
dataOutputStream.writeUTF(Build.VERSION.RELEASE);
dataOutputStream.writeShort(this.f2663e.size());
for (bb bbVar : this.f2663e) {
dataOutputStream.write(bbVar.f2667a);
}
byte[] byteArray = byteArrayOutputStream.toByteArray();
CRC32 crc32 = new CRC32();
crc32.update(byteArray);
dataOutputStream.writeInt((int) crc32.getValue());
byte[] byteArray2 = byteArrayOutputStream.toByteArray();
em.a(dataOutputStream);
return byteArray2;
}
byte[] byteArray3 = byteArrayOutputStream.toByteArray();
em.a(dataOutputStream);
return byteArray3;
} catch (IOException e3) {
e2 = e3;
db.a(6, f2659a, "Error when generating report", e2);
throw e2;
}
} catch (Throwable th) {
th = th;
closeable2 = closeable;
em.a(closeable2);
throw th;
}
} catch (IOException e4) {
e2 = e4;
} catch (Throwable th2) {
th = th2;
em.a(closeable2);
throw th;
}
}
public static synchronized ba a() {
ba baVar;
synchronized (ba.class) {
if (f2660c == null) {
ba baVar2 = new ba();
f2660c = baVar2;
Context context = ck.a().f2892a;
baVar2.f2662d = new ct<>(context.getFileStreamPath(".yflurrypulselogging." + Long.toString(em.g(ck.a().f2893b), 16)), ".yflurrypulselogging.", 1, new dz<List<bb>>() {
@Override
public final dw<List<bb>> a(int i) {
return new dv(new bb.a());
}
});
baVar2.f2664f = ((Boolean) eg.a().a("UseHttps")).booleanValue();
String str = f2659a;
db.a(4, str, "initSettings, UseHttps = " + baVar2.f2664f);
List<bb> a2 = baVar2.f2662d.a();
baVar2.f2663e = a2;
if (a2 == null) {
baVar2.f2663e = new ArrayList();
}
}
baVar = f2660c;
}
return baVar;
}
public final synchronized void b() {
try {
a(d());
} catch (IOException unused) {
db.a(6, f2659a, "Report not send due to exception in generate data");
}
}
public final synchronized void a(az azVar) {
try {
this.f2663e.add(new bb(azVar.d()));
db.a(4, f2659a, "Saving persistent Pulse logging data.");
this.f2662d.a(this.f2663e);
} catch (IOException unused) {
db.a(6, f2659a, "Error when generating pulse log report in addReport part");
}
}
private synchronized void a(byte[] bArr) {
if (!by.a().f2828c) {
db.a(5, f2659a, "Reports were not sent! No Internet connection!");
return;
}
if (bArr != 0 && bArr.length != 0) {
String str = this.f2661b;
if (str == null) {
str = "https://data.flurry.com/pcr.do";
}
String str2 = f2659a;
db.a(4, str2, "PulseLoggingManager: start upload data " + Arrays.toString(bArr) + " to " + str);
di diVar = new di();
diVar.f3019g = str;
diVar.u = DefaultOggSeeker.MATCH_BYTE_RANGE;
diVar.h = dk.a.kPost;
diVar.k = true;
diVar.a("Content-Type", com.tencent.cos.xml.common.a.n);
diVar.f3005c = new ds();
diVar.f3004b = bArr;
diVar.f3003a = new di.a<byte[], Void>() {
@Override
public final void a(di<byte[], Void> diVar2, Void r4) {
int i = diVar2.f3020q;
if (i <= 0) {
db.e(ba.f2659a, "Server Error: ".concat(String.valueOf(i)));
} else if (i < 200 || i >= 300) {
db.a(3, ba.f2659a, "Pulse logging report sent unsuccessfully, HTTP response:".concat(String.valueOf(i)));
} else {
db.a(3, ba.f2659a, "Pulse logging report sent successfully HTTP response:".concat(String.valueOf(i)));
ba.this.f2663e.clear();
ba.this.f2662d.a(ba.this.f2663e);
}
}
};
cg.a().a((Object) this, (ba) diVar);
return;
}
db.a(3, f2659a, "No report need be sent");
}
}