Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
package com.baidu.uaq.agent.android.transmission.lss;
import com.baidu.uaq.agent.android.harvest.bean.j;
import com.baidu.uaq.agent.android.logging.b;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: LssDataParser.java */
/* loaded from: classes.dex */
public class a implements com.baidu.uaq.agent.android.transmission.a {
private static final com.baidu.uaq.agent.android.logging.a a = b.a();
@Override // com.baidu.uaq.agent.android.transmission.a
public JSONArray a(List<j> list) {
JSONArray jSONArray = new JSONArray();
HashMap hashMap = new HashMap();
HashMap hashMap2 = new HashMap();
try {
Iterator<j> it = list.iterator();
while (it.hasNext()) {
JSONObject b = it.next().b();
if (b != null) {
String string = b.getJSONObject("baseInfo").getString("vvid");
if (hashMap.containsKey(string)) {
JSONArray jSONArray2 = (JSONArray) hashMap2.get(string);
b.remove("baseInfo");
jSONArray2.put(b);
} else {
hashMap.put(string, new JSONObject().put("baseInfo", b.remove("baseInfo")));
hashMap2.put(string, new JSONArray().put(b));
}
}
it.remove();
}
for (Map.Entry entry : hashMap.entrySet()) {
JSONObject jSONObject = (JSONObject) entry.getValue();
jSONObject.put("events", hashMap2.get((String) entry.getKey()));
jSONArray.put(jSONObject);
}
} catch (JSONException e) {
a.a("Caught error while LssDataParser parse: ", e);
com.baidu.uaq.agent.android.harvest.health.a.a(e);
}
return jSONArray;
}
}