atsameip v0.1版本的 MD5 值为:28547cf98b0a2d02acb37969dcfb83e9
以下内容为反编译后的 z.java 源代码,内容仅作参考
package com.appodeal.ads;
import android.os.Build;
import android.util.Pair;
import android.util.SparseArray;
import com.amazon.aps.shared.APSAnalytics;
import com.appodeal.ads.utils.Log;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONObject;
public class z {
private AppodealRequestCallbacks a;
final SparseArray<JSONObject> b = new SparseArray<>();
private final SparseArray<Pair<String, Long>> c = new SparseArray<>();
JSONObject d;
public class a implements Runnable {
final AdType a;
a(AdType adType) {
this.a = adType;
}
@Override
public void run() {
if (z.this.a != null) {
z.this.a.onWaterfallStart(this.a.getDisplayName());
}
}
}
public class b implements Runnable {
final AdType a;
final com.appodeal.ads.f b;
final String c;
b(AdType adType, com.appodeal.ads.f fVar, String str) {
this.a = adType;
this.b = fVar;
this.c = str;
}
@Override
public void run() {
if (z.this.a != null) {
z.this.a.onRequestStart(this.a.getDisplayName(), this.b.g(), this.c, this.b.getEcpm());
}
}
}
public class c implements Runnable {
final AdType a;
final String b;
final com.appodeal.ads.f c;
final boolean d;
c(AdType adType, String str, com.appodeal.ads.f fVar, boolean z) {
this.a = adType;
this.b = str;
this.c = fVar;
this.d = z;
}
@Override
public void run() {
if (z.this.a != null) {
z.this.a.onRequestFinish(this.a.getDisplayName(), this.b, this.c.getId(), this.d ? this.c.getEcpm() : 0.0d, this.d);
}
}
}
public class d implements Runnable {
final com.appodeal.ads.f a;
final AdType b;
final boolean c;
d(com.appodeal.ads.f fVar, AdType adType, boolean z) {
this.a = fVar;
this.b = adType;
this.c = z;
}
@Override
public void run() {
if (z.this.a == null || this.a == null) {
return;
}
z.this.a.onWaterfallFinish(this.b.getDisplayName(), this.c ? this.a.getEcpm() : 0.0d, this.c);
}
}
public class e implements Runnable {
final com.appodeal.ads.f a;
final AdType b;
e(com.appodeal.ads.f fVar, AdType adType) {
this.a = fVar;
this.b = adType;
}
@Override
public void run() {
if (z.this.a == null || this.a == null) {
return;
}
z.this.a.onImpression(this.b.getDisplayName(), this.a.g(), this.a.getId(), this.a.getEcpm());
}
}
public class f implements Runnable {
final com.appodeal.ads.f a;
final AdType b;
f(com.appodeal.ads.f fVar, AdType adType) {
this.a = fVar;
this.b = adType;
}
@Override
public void run() {
if (z.this.a == null || this.a == null) {
return;
}
z.this.a.onClick(this.b.getDisplayName(), this.a.g(), this.a.getId(), this.a.getEcpm());
}
}
private synchronized JSONObject a(int i) {
JSONObject jSONObject;
JSONObject jSONObject2;
String str;
String str2;
try {
if (this.d == null) {
JSONObject jSONObject3 = new JSONObject();
this.d = jSONObject3;
m1 m1Var = m1.a;
jSONObject3.put("device_id", m1Var.getIfa());
this.d.put("package_name", r1.e.getPackageName());
this.d.put("os", APSAnalytics.OS_NAME);
this.d.put("sdk_version", "2.11.1");
JSONObject jSONObject4 = this.d;
String str3 = Build.VERSION.RELEASE;
jSONObject4.put("os_version", str3);
this.d.put("osv", str3);
if (j0.A(r1.e)) {
jSONObject2 = this.d;
str = "device_type";
str2 = "tablet";
} else {
jSONObject2 = this.d;
str = "device_type";
str2 = "phone";
}
jSONObject2.put(str, str2);
ConnectionData connectionData = m1Var.getConnectionData(r1.e);
if (connectionData != null) {
this.d.put("connection_type", connectionData.type);
}
this.d.put("user_agent", m1Var.getHttpAgent(r1.e));
this.d.put("model", String.format("%s %s", Build.MANUFACTURER, Build.MODEL));
}
jSONObject = new JSONObject();
Iterator<String> keys = this.d.keys();
while (keys.hasNext()) {
String next = keys.next();
jSONObject.put(next, this.d.get(next));
}
jSONObject.put("waterfall_ad_type", i);
jSONObject.put("waterfall_start_time", System.currentTimeMillis());
jSONObject.put("ad_units", new JSONArray());
} catch (Exception e2) {
Log.log(e2);
return null;
}
return jSONObject;
}
private boolean b(int i) {
m b2;
if (i == 128) {
b2 = p1.b();
} else if (i == 256) {
b2 = y0.b();
} else if (i == 512) {
b2 = Native.a();
} else if (i == 1) {
b2 = q0.b();
} else if (i == 2) {
b2 = j1.b();
} else if (i == 3) {
return q0.b().w() || j1.b().w();
} else if (i != 4) {
return false;
} else {
b2 = b0.b();
}
return b2.w();
}
String a() {
return "https://rri.appodeal.com/api/stat";
}
public void a(AdType adType) {
int notifyType = adType.getNotifyType();
if (b(notifyType)) {
this.b.put(notifyType, a(notifyType));
}
w1.a(new a(adType));
}
public void a(AdType adType, com.appodeal.ads.f fVar) {
w1.a(new f(fVar, adType));
}
public void a(AdType adType, com.appodeal.ads.f fVar, boolean z) {
a(adType, fVar, z, 0);
}
public void a(AdType adType, com.appodeal.ads.f fVar, boolean z, int i) {
Pair<String, Long> pair;
try {
int notifyType = adType.getNotifyType();
String g = fVar.g();
if (b(notifyType) && (pair = this.c.get(notifyType)) != null) {
String str = (String) pair.first;
Long l = (Long) pair.second;
JSONObject jSONObject = this.b.get(notifyType);
if (l != null && jSONObject != null) {
Long valueOf = Long.valueOf(System.currentTimeMillis() - l.longValue());
JSONArray jSONArray = jSONObject.getJSONArray("ad_units");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("aid", str);
jSONObject2.put("network_name", g);
jSONObject2.put("fill", z);
jSONObject2.put("delta", valueOf);
if (!z) {
jSONObject2.put(IronSourceConstants.EVENTS_ERROR_REASON, i);
}
jSONArray.put(jSONObject2);
}
}
w1.a(new c(adType, g, fVar, z));
} catch (Exception e2) {
Log.log(e2);
}
}
public void a(AppodealRequestCallbacks appodealRequestCallbacks) {
this.a = appodealRequestCallbacks;
}
void a(JSONObject jSONObject, int i) {
this.b.remove(i);
this.c.remove(i);
com.appodeal.ads.utils.s.f.execute(new com.appodeal.ads.utils.v(jSONObject.toString(), a()));
}
public void b(AdType adType, com.appodeal.ads.f fVar) {
w1.a(new e(fVar, adType));
}
public void b(AdType adType, com.appodeal.ads.f fVar, boolean z) {
JSONObject jSONObject;
try {
int notifyType = adType.getNotifyType();
if (b(notifyType) && (jSONObject = this.b.get(notifyType)) != null) {
jSONObject.put(IronSourceConstants.EVENTS_RESULT, z);
a(jSONObject, notifyType);
}
w1.a(new d(fVar, adType, z));
} catch (Exception e2) {
Log.log(e2);
}
}
public void c(AdType adType, com.appodeal.ads.f fVar) {
int notifyType = adType.getNotifyType();
String id = fVar.getId();
if (b(notifyType)) {
this.c.put(notifyType, new Pair<>(id, Long.valueOf(System.currentTimeMillis())));
}
w1.a(new b(adType, fVar, id));
}
}