- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
285 lines
10 KiB
Java
285 lines
10 KiB
Java
package com.applovin.impl.mediation;
|
|
|
|
import android.app.Activity;
|
|
import com.applovin.impl.am;
|
|
import com.applovin.impl.an;
|
|
import com.applovin.impl.fi;
|
|
import com.applovin.impl.la;
|
|
import com.applovin.impl.ma;
|
|
import com.applovin.impl.pe;
|
|
import com.applovin.impl.q6;
|
|
import com.applovin.impl.sdk.j;
|
|
import com.applovin.impl.sdk.n;
|
|
import com.applovin.impl.sdk.utils.JsonUtils;
|
|
import com.applovin.impl.sdk.utils.StringUtils;
|
|
import com.applovin.impl.tm;
|
|
import com.applovin.impl.uj;
|
|
import com.applovin.impl.ve;
|
|
import com.applovin.mediation.adapter.MaxAdapter;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class e {
|
|
private final j a;
|
|
private final n b;
|
|
private final AtomicBoolean c = new AtomicBoolean();
|
|
private final Set d = new HashSet();
|
|
private final Object e = new Object();
|
|
private final JSONArray f = new JSONArray();
|
|
private final LinkedHashMap g = new LinkedHashMap();
|
|
private final Object h = new Object();
|
|
private final Map i = new HashMap();
|
|
private final Map j = new HashMap();
|
|
private final Object k = new Object();
|
|
private List l;
|
|
|
|
public e(j jVar) {
|
|
this.a = jVar;
|
|
this.b = jVar.J();
|
|
}
|
|
|
|
public void b(pe peVar, Activity activity) {
|
|
List list;
|
|
if (((Boolean) this.a.a(ve.Y7)).booleanValue()) {
|
|
a(peVar, activity);
|
|
return;
|
|
}
|
|
if (((Boolean) this.a.a(ve.X7)).booleanValue()) {
|
|
pe peVar2 = (pe) this.i.get(peVar.b());
|
|
if (peVar2 != null) {
|
|
peVar = peVar2;
|
|
}
|
|
} else {
|
|
if (this.a.l0().c() && (list = this.l) != null) {
|
|
Iterator it = list.iterator();
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
peVar = null;
|
|
break;
|
|
}
|
|
pe peVar3 = (pe) it.next();
|
|
if (peVar3.b().equals(peVar.b())) {
|
|
peVar = peVar3;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (peVar == null) {
|
|
return;
|
|
}
|
|
}
|
|
g a = this.a.M().a(peVar);
|
|
if (a != null) {
|
|
if (n.a()) {
|
|
this.b.d("MediationAdapterInitializationManager", "Initializing adapter " + peVar);
|
|
}
|
|
c(peVar);
|
|
a.a(MaxAdapterParametersImpl.a(peVar), activity, (MaxAdapter.OnCompletionListener) null);
|
|
return;
|
|
}
|
|
n.h("MediationAdapterInitializationManager", "Mediation adapter could not be initialized, double check that the adapter is included in your build. Adapter spec: " + peVar);
|
|
}
|
|
|
|
public void a(pe peVar, long j, MaxAdapter.InitializationStatus initializationStatus, String str) {
|
|
boolean z;
|
|
if (initializationStatus == null || initializationStatus == MaxAdapter.InitializationStatus.INITIALIZING) {
|
|
return;
|
|
}
|
|
synchronized (this.h) {
|
|
try {
|
|
z = !b(peVar);
|
|
if (z) {
|
|
this.g.put(peVar.b(), Integer.valueOf(initializationStatus.getCode()));
|
|
JSONObject jSONObject = new JSONObject();
|
|
JsonUtils.putString(jSONObject, "class", peVar.b());
|
|
JsonUtils.putString(jSONObject, "init_status", String.valueOf(initializationStatus.getCode()));
|
|
JsonUtils.putLong(jSONObject, "init_time_ms", j);
|
|
JsonUtils.putString(jSONObject, "error_message", JSONObject.quote(str));
|
|
this.f.put(jSONObject);
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
if (z) {
|
|
this.a.a(peVar);
|
|
this.a.Q().processAdapterInitializationPostback(peVar, j, initializationStatus, str);
|
|
this.a.p().a(initializationStatus, peVar.b());
|
|
}
|
|
}
|
|
|
|
private void c(pe peVar) {
|
|
String b = peVar.b();
|
|
synchronized (this.e) {
|
|
try {
|
|
if (this.d.contains(b)) {
|
|
return;
|
|
}
|
|
this.d.add(b);
|
|
this.a.E().a(la.m, ma.a(peVar));
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
public boolean c() {
|
|
return this.c.get();
|
|
}
|
|
|
|
public boolean b(pe peVar) {
|
|
boolean containsKey;
|
|
synchronized (this.h) {
|
|
containsKey = this.g.containsKey(peVar.b());
|
|
}
|
|
return containsKey;
|
|
}
|
|
|
|
public JSONArray b() {
|
|
JSONArray shallowCopy;
|
|
synchronized (this.h) {
|
|
shallowCopy = JsonUtils.shallowCopy(this.f);
|
|
}
|
|
return shallowCopy;
|
|
}
|
|
|
|
private pe a(pe peVar) {
|
|
List<pe> list;
|
|
if (((Boolean) this.a.a(ve.X7)).booleanValue()) {
|
|
pe peVar2 = (pe) this.i.get(peVar.b());
|
|
return peVar2 != null ? peVar2 : peVar;
|
|
}
|
|
if (!this.a.l0().c() || (list = this.l) == null) {
|
|
return peVar;
|
|
}
|
|
for (pe peVar3 : list) {
|
|
if (peVar3.b().equals(peVar.b())) {
|
|
return peVar3;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public fi a(pe peVar, Activity activity) {
|
|
pe a = a(peVar);
|
|
if (a == null) {
|
|
return fi.c(MaxAdapter.InitializationStatus.DOES_NOT_APPLY);
|
|
}
|
|
String b = peVar.b();
|
|
synchronized (this.k) {
|
|
try {
|
|
fi fiVar = (fi) this.j.get(b);
|
|
if (fiVar == null || (fiVar.d() && a.q())) {
|
|
final fi fiVar2 = new fi();
|
|
this.j.put(b, fiVar2);
|
|
g a2 = this.a.M().a(a);
|
|
if (a2 == null) {
|
|
fiVar2.a("Adapter implementation not found");
|
|
return fiVar2;
|
|
}
|
|
if (n.a()) {
|
|
this.b.d("MediationAdapterInitializationManager", "Initializing adapter " + a);
|
|
}
|
|
c(a);
|
|
a2.a(MaxAdapterParametersImpl.a(a), activity, new MaxAdapter.OnCompletionListener() { // from class: com.applovin.impl.mediation.e$$ExternalSyntheticLambda0
|
|
@Override // com.applovin.mediation.adapter.MaxAdapter.OnCompletionListener
|
|
public final void onCompletion(MaxAdapter.InitializationStatus initializationStatus, String str) {
|
|
e.a(fi.this, initializationStatus, str);
|
|
}
|
|
});
|
|
an.a(a.m(), fiVar2, "The adapter (" + peVar.c() + ") timed out initializing", "MediationAdapterInitializationManager", this.a);
|
|
return fiVar2;
|
|
}
|
|
return fiVar;
|
|
} finally {
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void a(fi fiVar, MaxAdapter.InitializationStatus initializationStatus, String str) {
|
|
if (initializationStatus != null && initializationStatus != MaxAdapter.InitializationStatus.INITIALIZING) {
|
|
if (initializationStatus == MaxAdapter.InitializationStatus.INITIALIZED_FAILURE) {
|
|
fiVar.a(str);
|
|
return;
|
|
} else {
|
|
fiVar.b(initializationStatus);
|
|
return;
|
|
}
|
|
}
|
|
q6.a("Adapters should never report a null or INITIALIZING status.", new Object[0]);
|
|
fiVar.a("Adapter reported INITIALIZING");
|
|
}
|
|
|
|
public void a(Activity activity) {
|
|
if (this.c.compareAndSet(false, true)) {
|
|
String str = (String) this.a.a(uj.F);
|
|
if (StringUtils.isValidString(str)) {
|
|
try {
|
|
JSONObject jSONObject = new JSONObject(str);
|
|
List<pe> a = a(JsonUtils.getJSONArray(jSONObject, this.a.l0().c() ? "test_mode_auto_init_adapters" : "auto_init_adapters", new JSONArray()), jSONObject);
|
|
this.l = a;
|
|
for (pe peVar : a) {
|
|
this.i.put(peVar.b(), peVar);
|
|
}
|
|
long parseLong = StringUtils.parseLong(this.a.g0().getExtraParameters().get("adapter_initialization_delay_ms"), -1L);
|
|
am amVar = new am(a, activity, this.a);
|
|
if (parseLong > 0) {
|
|
this.a.j0().a(amVar, tm.b.MEDIATION, parseLong);
|
|
} else {
|
|
this.a.j0().a(amVar);
|
|
}
|
|
} catch (JSONException e) {
|
|
if (n.a()) {
|
|
this.b.a("MediationAdapterInitializationManager", "Failed to parse auto-init adapters JSON", e);
|
|
}
|
|
q6.a((Throwable) e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public Integer a(String str) {
|
|
Integer num;
|
|
synchronized (this.h) {
|
|
num = (Integer) this.g.get(str);
|
|
}
|
|
return num;
|
|
}
|
|
|
|
public Set a() {
|
|
HashSet hashSet;
|
|
synchronized (this.h) {
|
|
hashSet = new HashSet(this.g.keySet());
|
|
}
|
|
return hashSet;
|
|
}
|
|
|
|
private List a(JSONArray jSONArray, JSONObject jSONObject) {
|
|
ArrayList arrayList = new ArrayList(jSONArray.length());
|
|
for (int i = 0; i < jSONArray.length(); i++) {
|
|
arrayList.add(new pe(Collections.EMPTY_MAP, JsonUtils.getJSONObject(jSONArray, i, (JSONObject) null), jSONObject, this.a));
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public void a(MaxAdapter.InitializationStatus initializationStatus) {
|
|
synchronized (this.h) {
|
|
this.g.put("com.applovin.mediation.adapters.AppLovinMediationAdapter", Integer.valueOf(initializationStatus.getCode()));
|
|
}
|
|
this.a.p().a(initializationStatus, "com.applovin.mediation.adapters.AppLovinMediationAdapter");
|
|
}
|
|
}
|