- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
109 lines
3.7 KiB
Java
109 lines
3.7 KiB
Java
package com.fyber.inneractive.sdk.config;
|
|
|
|
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class i0 implements j0 {
|
|
public com.fyber.inneractive.sdk.cache.session.d a;
|
|
public a d;
|
|
public final HashMap b = new HashMap();
|
|
public final HashMap c = new HashMap();
|
|
public boolean e = false;
|
|
|
|
public interface a {
|
|
}
|
|
|
|
public enum b {
|
|
NO_CLICK("0"),
|
|
CTA_BUTTON("1"),
|
|
COMPANION("2"),
|
|
VIDEO("3"),
|
|
APP_INFO("4");
|
|
|
|
String value;
|
|
|
|
b(String str) {
|
|
this.value = str;
|
|
}
|
|
|
|
public final String e() {
|
|
return this.value;
|
|
}
|
|
}
|
|
|
|
public final void a(a aVar) {
|
|
this.d = aVar;
|
|
}
|
|
|
|
public final String a(UnitDisplayType unitDisplayType, String str) {
|
|
Map map = (Map) this.b.get(unitDisplayType);
|
|
return (map == null || map.get(str) == null) ? "" : (String) map.get(str);
|
|
}
|
|
|
|
public final void a(UnitDisplayType unitDisplayType, String str, String str2) {
|
|
Map map = (Map) this.b.get(unitDisplayType);
|
|
if (map == null) {
|
|
map = new HashMap();
|
|
this.b.put(unitDisplayType, map);
|
|
}
|
|
map.put(str, str2);
|
|
a aVar = this.d;
|
|
if (aVar == null || !this.e) {
|
|
return;
|
|
}
|
|
((com.fyber.inneractive.sdk.bidder.a) aVar).d();
|
|
}
|
|
|
|
public final JSONArray a(UnitDisplayType unitDisplayType) {
|
|
int i;
|
|
com.fyber.inneractive.sdk.cache.session.d dVar = this.a;
|
|
if (dVar == null) {
|
|
return null;
|
|
}
|
|
JSONArray jSONArray = new JSONArray();
|
|
try {
|
|
for (com.fyber.inneractive.sdk.cache.session.enums.b bVar : com.fyber.inneractive.sdk.cache.session.enums.b.values()) {
|
|
if (bVar != com.fyber.inneractive.sdk.cache.session.enums.b.NONE && (unitDisplayType == null || bVar.e() == unitDisplayType)) {
|
|
JSONObject jSONObject = new JSONObject();
|
|
jSONObject.put("type", bVar.e().value());
|
|
jSONObject.put("subType", bVar.name().toLowerCase().contains("video") ? "video" : "display");
|
|
com.fyber.inneractive.sdk.cache.session.h hVar = dVar.b.get(bVar);
|
|
try {
|
|
i = Integer.parseInt(IAConfigManager.L.t.b.a("number_of_sessions", Integer.toString(5)));
|
|
} catch (Throwable unused) {
|
|
i = 5;
|
|
}
|
|
int i2 = i >= 0 ? i : 5;
|
|
if (i2 > 0 && hVar != null && hVar.size() >= i2) {
|
|
boolean f = bVar.f();
|
|
JSONArray jSONArray2 = new JSONArray();
|
|
ArrayList arrayList = new ArrayList(hVar);
|
|
Collections.sort(arrayList, new com.fyber.inneractive.sdk.cache.session.g());
|
|
Iterator it = arrayList.iterator();
|
|
int i3 = 0;
|
|
while (it.hasNext()) {
|
|
jSONArray2.put(((com.fyber.inneractive.sdk.cache.session.e) it.next()).a(false, f));
|
|
i3++;
|
|
if (i3 >= i2) {
|
|
break;
|
|
}
|
|
}
|
|
jSONObject.put("sessionData", jSONArray2);
|
|
jSONArray.put(jSONObject);
|
|
}
|
|
}
|
|
}
|
|
return jSONArray;
|
|
} catch (Exception unused2) {
|
|
return jSONArray;
|
|
}
|
|
}
|
|
}
|