105 lines
3.3 KiB
Java
105 lines
3.3 KiB
Java
package com.baidu.uaq.agent.android.crashes;
|
|
|
|
import com.unity3d.ads.adunit.AdUnitActivity;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* compiled from: DeviceInfo.java */
|
|
/* loaded from: classes.dex */
|
|
public class e extends com.baidu.uaq.agent.android.harvest.type.d {
|
|
private long b;
|
|
private int c;
|
|
private String d;
|
|
private long[] e;
|
|
private String f;
|
|
private String g;
|
|
private String h;
|
|
private String i;
|
|
private String j;
|
|
private String k;
|
|
private String l;
|
|
private String m;
|
|
|
|
public e() {
|
|
}
|
|
|
|
public static e a(JSONObject jSONObject) {
|
|
e eVar = new e();
|
|
try {
|
|
eVar.b = jSONObject.getLong("memoryUsage");
|
|
eVar.c = jSONObject.getInt(AdUnitActivity.EXTRA_ORIENTATION);
|
|
eVar.d = jSONObject.getString("networkStatus");
|
|
eVar.e = a(jSONObject.getJSONArray("diskAvailable"));
|
|
eVar.f = jSONObject.getString("OSVersion");
|
|
eVar.g = jSONObject.getString("deviceName");
|
|
eVar.h = jSONObject.getString("OSBuild");
|
|
eVar.i = jSONObject.getString("architecture");
|
|
eVar.m = jSONObject.getString("runTime");
|
|
eVar.j = jSONObject.getString("modelNumber");
|
|
eVar.k = jSONObject.getString("screenResolution");
|
|
eVar.l = jSONObject.getString("deviceUuid");
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
}
|
|
return eVar;
|
|
}
|
|
|
|
private JSONArray e() {
|
|
JSONArray jSONArray = new JSONArray();
|
|
for (long j : this.e) {
|
|
jSONArray.put(Long.valueOf(j));
|
|
}
|
|
return jSONArray;
|
|
}
|
|
|
|
@Override // com.baidu.uaq.agent.android.harvest.type.a
|
|
public JSONObject d() {
|
|
JSONObject jSONObject = new JSONObject();
|
|
try {
|
|
jSONObject.put("memoryUsage", Long.valueOf(this.b));
|
|
jSONObject.put(AdUnitActivity.EXTRA_ORIENTATION, Integer.valueOf(this.c));
|
|
jSONObject.put("networkStatus", this.d);
|
|
jSONObject.put("diskAvailable", e());
|
|
jSONObject.put("OSVersion", this.f);
|
|
jSONObject.put("deviceName", this.g);
|
|
jSONObject.put("OSBuild", this.h);
|
|
jSONObject.put("architecture", this.i);
|
|
jSONObject.put("runTime", this.m);
|
|
jSONObject.put("modelNumber", this.j);
|
|
jSONObject.put("screenResolution", this.k);
|
|
jSONObject.put("deviceUuid", this.l);
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
}
|
|
return jSONObject;
|
|
}
|
|
|
|
public e(com.baidu.uaq.agent.android.harvest.bean.c cVar, com.baidu.uaq.agent.android.harvest.bean.d dVar) {
|
|
this.b = dVar.a();
|
|
this.c = dVar.d();
|
|
this.d = dVar.b();
|
|
this.e = dVar.c();
|
|
this.f = cVar.e();
|
|
this.g = cVar.m();
|
|
this.h = cVar.i();
|
|
this.i = cVar.f();
|
|
this.j = cVar.n();
|
|
this.k = cVar.h();
|
|
this.l = cVar.l();
|
|
this.m = cVar.g();
|
|
}
|
|
|
|
private static long[] a(JSONArray jSONArray) {
|
|
long[] jArr = new long[jSONArray.length()];
|
|
for (int i = 0; i < jSONArray.length(); i++) {
|
|
try {
|
|
jArr[i] = jSONArray.getLong(i);
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
return jArr;
|
|
}
|
|
}
|