Active IQ v6.7.1版本的 MD5 值为:5082594ca2b69fbfbe64e6d6ee2159a7
以下内容为反编译后的 iq.java 源代码,内容仅作参考
package com.flurry.sdk;
import android.content.Context;
import android.os.Build;
import com.flurry.sdk.ir;
import com.flurry.sdk.ku;
import com.flurry.sdk.kw;
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 iq {
public static final String a = "com.flurry.sdk.iq";
private static iq c;
public String b;
private kg<List<ir>> d;
private List<ir> e;
private boolean f;
private iq() {
}
public static synchronized iq a() {
iq iqVar;
synchronized (iq.class) {
if (c == null) {
iq iqVar2 = new iq();
c = iqVar2;
Context context = jy.a().a;
iqVar2.d = new kg<>(context.getFileStreamPath(".yflurrypulselogging." + Long.toString(ly.i(jy.a().d), 16)), ".yflurrypulselogging.", 1, new ll<List<ir>>() {
@Override
public final li<List<ir>> a(int i) {
return new lh(new ir.a());
}
});
iqVar2.f = ((Boolean) ls.a().a("UseHttps")).booleanValue();
String str = a;
kn.a(4, str, "initSettings, UseHttps = " + iqVar2.f);
iqVar2.e = iqVar2.d.a();
if (iqVar2.e == null) {
iqVar2.e = new ArrayList();
}
}
iqVar = c;
}
return iqVar;
}
public final synchronized void a(ip ipVar) {
try {
this.e.add(new ir(ipVar.d()));
kn.a(4, a, "Saving persistent Pulse logging data.");
this.d.a(this.e);
} catch (IOException unused) {
kn.a(6, a, "Error when generating pulse log report in addReport part");
}
}
public final synchronized void b() {
try {
a(d());
} catch (IOException unused) {
kn.a(6, a, "Report not send due to exception in generate data");
}
}
private synchronized void a(byte[] bArr) {
if (!jo.a().b) {
kn.a(5, a, "Reports were not sent! No Internet connection!");
return;
}
if (bArr != 0 && bArr.length != 0) {
String str = this.b != null ? this.b : "https://data.flurry.com/pcr.do";
String str2 = a;
kn.a(4, str2, "PulseLoggingManager: start upload data " + Arrays.toString(bArr) + " to " + str);
ku kuVar = new ku();
kuVar.g = str;
kuVar.u = 100000;
kuVar.h = kw.a.kPost;
kuVar.k = true;
kuVar.a("Content-Type", "application/octet-stream");
kuVar.c = new le();
kuVar.b = bArr;
kuVar.a = new ku.a<byte[], Void>() {
@Override
public final void a(ku<byte[], Void> kuVar2, Void r5) {
int i = kuVar2.q;
if (i <= 0) {
String str3 = iq.a;
kn.e(str3, "Server Error: " + i);
} else if (i < 200 || i >= 300) {
String str4 = iq.a;
kn.a(3, str4, "Pulse logging report sent unsuccessfully, HTTP response:" + i);
} else {
String str5 = iq.a;
kn.a(3, str5, "Pulse logging report sent successfully HTTP response:" + i);
iq.this.e.clear();
iq.this.d.a(iq.this.e);
}
}
};
jw.a().a((Object) this, (iq) kuVar);
return;
}
kn.a(3, a, "No report need be sent");
}
private byte[] d() throws IOException {
IOException e;
try {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
try {
if (this.e != null && !this.e.isEmpty()) {
dataOutputStream.writeShort(1);
dataOutputStream.writeShort(1);
dataOutputStream.writeLong(System.currentTimeMillis());
dataOutputStream.writeUTF(jy.a().d);
dataOutputStream.writeUTF(jr.a().g());
dataOutputStream.writeShort(jz.b());
dataOutputStream.writeShort(3);
jr.a();
dataOutputStream.writeUTF(jr.c());
dataOutputStream.writeBoolean(ji.a().c());
ArrayList<hw> arrayList = new ArrayList();
for (Map.Entry entry : Collections.unmodifiableMap(ji.a().a).entrySet()) {
hw hwVar = new hw();
hwVar.a = ((jq) entry.getKey()).d;
if (((jq) entry.getKey()).e) {
hwVar.b = new String((byte[]) entry.getValue());
} else {
hwVar.b = ly.b((byte[]) entry.getValue());
}
arrayList.add(hwVar);
}
dataOutputStream.writeShort(arrayList.size());
for (hw hwVar2 : arrayList) {
dataOutputStream.writeShort(hwVar2.a);
byte[] bytes = hwVar2.b.getBytes();
dataOutputStream.writeShort(bytes.length);
dataOutputStream.write(bytes);
}
dataOutputStream.writeShort(6);
dataOutputStream.writeShort(ij.b - 1);
dataOutputStream.writeUTF(Build.MODEL);
dataOutputStream.writeShort(ij.c - 1);
dataOutputStream.writeUTF(Build.BOARD);
dataOutputStream.writeShort(ij.d - 1);
dataOutputStream.writeUTF(Build.ID);
dataOutputStream.writeShort(ij.e - 1);
dataOutputStream.writeUTF(Build.DEVICE);
dataOutputStream.writeShort(ij.f - 1);
dataOutputStream.writeUTF(Build.PRODUCT);
dataOutputStream.writeShort(ij.g - 1);
dataOutputStream.writeUTF(Build.VERSION.RELEASE);
dataOutputStream.writeShort(this.e.size());
for (ir irVar : this.e) {
dataOutputStream.write(irVar.a);
}
byte[] byteArray = byteArrayOutputStream.toByteArray();
CRC32 crc32 = new CRC32();
crc32.update(byteArray);
dataOutputStream.writeInt((int) crc32.getValue());
byte[] byteArray2 = byteArrayOutputStream.toByteArray();
ly.a(dataOutputStream);
return byteArray2;
}
byte[] byteArray3 = byteArrayOutputStream.toByteArray();
ly.a(dataOutputStream);
return byteArray3;
} catch (IOException e2) {
e = e2;
kn.a(6, a, "Error when generating report", e);
throw e;
}
} catch (Throwable th) {
th = th;
ly.a((Closeable) null);
throw th;
}
} catch (IOException e3) {
e = e3;
} catch (Throwable th2) {
th = th2;
ly.a((Closeable) null);
throw th;
}
}
}