- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
293 lines
8.1 KiB
Java
293 lines
8.1 KiB
Java
package com.ironsource;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import com.ironsource.environment.thread.IronSourceThreadManager;
|
|
import com.ironsource.mediationsdk.logger.IronLog;
|
|
import java.util.Iterator;
|
|
import java.util.Locale;
|
|
import java.util.Map;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class bd {
|
|
private final ce a;
|
|
private final ConcurrentHashMap<String, Object> b;
|
|
private final AtomicBoolean c;
|
|
private final AtomicBoolean d;
|
|
|
|
public class a implements Runnable {
|
|
final /* synthetic */ Context a;
|
|
|
|
public a(Context context) {
|
|
this.a = context;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
try {
|
|
bd.this.e(this.a);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
}
|
|
bd.this.c.set(false);
|
|
}
|
|
}
|
|
|
|
public static class b {
|
|
static volatile bd a = new bd(null);
|
|
|
|
private b() {
|
|
}
|
|
}
|
|
|
|
private bd() {
|
|
this.c = new AtomicBoolean(false);
|
|
this.d = new AtomicBoolean(false);
|
|
this.a = el.N().f();
|
|
this.b = new ConcurrentHashMap<>();
|
|
}
|
|
|
|
public /* synthetic */ bd(a aVar) {
|
|
this();
|
|
}
|
|
|
|
public static bd a() {
|
|
return b.a;
|
|
}
|
|
|
|
private void a(Context context) {
|
|
if (this.c.get()) {
|
|
return;
|
|
}
|
|
try {
|
|
this.c.set(true);
|
|
IronSourceThreadManager.INSTANCE.postMediationBackgroundTask(new a(context));
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
this.c.set(false);
|
|
}
|
|
}
|
|
|
|
private void a(String str, Object obj) {
|
|
if (str == null || obj == null) {
|
|
return;
|
|
}
|
|
try {
|
|
if (obj instanceof Boolean) {
|
|
obj = Integer.valueOf(((Boolean) obj).booleanValue() ? 1 : 0);
|
|
}
|
|
this.b.put(str, obj);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
}
|
|
}
|
|
|
|
private boolean a(String str) {
|
|
if (str == null) {
|
|
return false;
|
|
}
|
|
try {
|
|
return this.b.containsKey(str);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private void d(Context context) {
|
|
if (context == null || this.d.getAndSet(true)) {
|
|
return;
|
|
}
|
|
a("auid", this.a.s(context));
|
|
a("model", this.a.e());
|
|
a(ad.r, this.a.g());
|
|
a(ad.y, this.a.l());
|
|
String o = this.a.o();
|
|
if (o != null) {
|
|
a(ad.z, o.replaceAll("[^0-9/.]", ""));
|
|
a(ad.C, o);
|
|
}
|
|
a(ad.a, String.valueOf(this.a.k()));
|
|
String j = this.a.j(context);
|
|
if (!TextUtils.isEmpty(j)) {
|
|
a(ad.y0, j);
|
|
}
|
|
String e = v3.e(context);
|
|
if (!TextUtils.isEmpty(e)) {
|
|
a(ad.o, e);
|
|
}
|
|
String i = this.a.i(context);
|
|
if (!TextUtils.isEmpty(i)) {
|
|
a(ad.l0, i);
|
|
}
|
|
a("bid", context.getPackageName());
|
|
a(ad.t, String.valueOf(this.a.h(context)));
|
|
a(ad.S, "2.0");
|
|
a(ad.T, Long.valueOf(v3.f(context)));
|
|
a(ad.R, Long.valueOf(v3.d(context)));
|
|
a(ad.d, v3.b(context));
|
|
a(ad.F, Integer.valueOf(r8.f(context)));
|
|
a(ad.P, r8.g(context));
|
|
a("stid", un.c(context));
|
|
a("platform", "android");
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void e(Context context) {
|
|
if (context == null) {
|
|
return;
|
|
}
|
|
try {
|
|
String p = this.a.p(context);
|
|
if (!TextUtils.isEmpty(p)) {
|
|
a("gaid", p);
|
|
}
|
|
String a2 = this.a.a(context);
|
|
if (TextUtils.isEmpty(a2)) {
|
|
return;
|
|
}
|
|
a(ad.q, Boolean.valueOf(Boolean.parseBoolean(a2)));
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
}
|
|
}
|
|
|
|
private void f(Context context) {
|
|
if (context == null) {
|
|
return;
|
|
}
|
|
a(context);
|
|
String D = this.a.D(context);
|
|
if (!TextUtils.isEmpty(D)) {
|
|
a(ad.u0, D);
|
|
} else if (a(ad.u0)) {
|
|
b(ad.u0);
|
|
}
|
|
String b2 = this.a.b(context);
|
|
if (!TextUtils.isEmpty(b2)) {
|
|
a(ad.p, b2.toUpperCase(Locale.getDefault()));
|
|
}
|
|
String b3 = this.a.b();
|
|
if (!TextUtils.isEmpty(b3)) {
|
|
a("tz", b3);
|
|
}
|
|
String b4 = s8.b(context);
|
|
if (!TextUtils.isEmpty(b4) && !b4.equals("none")) {
|
|
a(ad.j, b4);
|
|
}
|
|
String d = s8.d(context);
|
|
if (!TextUtils.isEmpty(d)) {
|
|
a(ad.k, d);
|
|
}
|
|
a("vpn", Boolean.valueOf(s8.e(context)));
|
|
String n = this.a.n(context);
|
|
if (!TextUtils.isEmpty(n)) {
|
|
a("icc", n);
|
|
}
|
|
int y = this.a.y(context);
|
|
if (y >= 0) {
|
|
a(ad.S0, Integer.valueOf(y));
|
|
}
|
|
a(ad.T0, this.a.A(context));
|
|
a(ad.U0, this.a.H(context));
|
|
a(ad.X, Float.valueOf(this.a.m(context)));
|
|
a(ad.m, String.valueOf(this.a.n()));
|
|
a(ad.I, Integer.valueOf(this.a.d()));
|
|
a(ad.H, Integer.valueOf(this.a.j()));
|
|
a(ad.G0, String.valueOf(this.a.i()));
|
|
a(ad.P0, String.valueOf(this.a.p()));
|
|
a("mcc", Integer.valueOf(r8.b(context)));
|
|
a("mnc", Integer.valueOf(r8.c(context)));
|
|
a(ad.K, Boolean.valueOf(this.a.c()));
|
|
a(ad.g, Boolean.valueOf(this.a.G(context)));
|
|
a(ad.h, Integer.valueOf(this.a.l(context)));
|
|
a(ad.b, Boolean.valueOf(this.a.c(context)));
|
|
a(ad.D, Boolean.valueOf(this.a.d(context)));
|
|
a("rt", Boolean.valueOf(this.a.f()));
|
|
a(ad.Q, String.valueOf(this.a.h()));
|
|
a(ad.e, Integer.valueOf(this.a.w(context)));
|
|
a(ad.H0, Boolean.valueOf(this.a.q(context)));
|
|
a(ad.c, this.a.f(context));
|
|
a(ad.U, this.a.s());
|
|
}
|
|
|
|
public void a(String str, JSONObject jSONObject) {
|
|
if (jSONObject == null) {
|
|
return;
|
|
}
|
|
try {
|
|
Object obj = this.b.get(str);
|
|
if (!(obj instanceof JSONObject)) {
|
|
a(str, (Object) jSONObject);
|
|
return;
|
|
}
|
|
JSONObject jSONObject2 = (JSONObject) obj;
|
|
Iterator<String> keys = jSONObject.keys();
|
|
while (keys.hasNext()) {
|
|
String next = keys.next();
|
|
jSONObject2.putOpt(next, jSONObject.opt(next));
|
|
}
|
|
a(str, (Object) jSONObject2);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
}
|
|
}
|
|
|
|
public void a(Map<String, Object> map) {
|
|
if (map == null) {
|
|
return;
|
|
}
|
|
try {
|
|
for (String str : map.keySet()) {
|
|
if (map.containsKey(str)) {
|
|
a(str, map.get(str));
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
}
|
|
}
|
|
|
|
public JSONObject b(Context context) throws JSONException {
|
|
f(context);
|
|
return new JSONObject(dd.a(this.b));
|
|
}
|
|
|
|
public void b(String str) {
|
|
if (str == null) {
|
|
return;
|
|
}
|
|
try {
|
|
this.b.remove(str);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
}
|
|
}
|
|
|
|
public void b(String str, Object obj) {
|
|
a(str, obj);
|
|
}
|
|
|
|
public void c(Context context) {
|
|
try {
|
|
d(context);
|
|
f(context);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
IronLog.INTERNAL.error(e.toString());
|
|
}
|
|
}
|
|
}
|