Wolves Themes v1.0版本的 MD5 值为:cddc92b47f6b7c4a195c9625507eb51c
以下内容为反编译后的 j.java 源代码,内容仅作参考
package com.appodeal.ads;
import android.os.Build;
import android.support.annotation.VisibleForTesting;
import android.util.Pair;
import android.util.SparseArray;
import com.appodeal.ads.bf;
import com.ironsource.sdk.constants.Constants;
import com.mobvista.msdk.base.entity.CampaignEx;
import com.tapjoy.TapjoyConstants;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONObject;
public class j {
@VisibleForTesting
JSONObject b;
private AppodealRequestCallbacks c;
@VisibleForTesting
SparseArray<JSONObject> a = new SparseArray<>();
private SparseArray<Pair<String, Long>> d = new SparseArray<>();
public j() {
}
public j(AppodealRequestCallbacks appodealRequestCallbacks) {
this.c = appodealRequestCallbacks;
}
private boolean b(int i) {
if (i != 4) {
if (i != 128) {
if (i != 256) {
if (i != 512) {
switch (i) {
case 1:
return t.l;
case 2:
return au.l;
default:
return false;
}
}
return Native.o;
}
return ae.t;
}
return ba.p;
}
return l.w;
}
private synchronized JSONObject c(int i) {
JSONObject jSONObject;
JSONObject jSONObject2;
String str;
String str2;
try {
if (this.b == null) {
this.b = new JSONObject();
this.b.put("device_id", az.h());
this.b.put(CampaignEx.JSON_KEY_PACKAGE_NAME, Appodeal.f.getPackageName());
this.b.put("os", Constants.JAVASCRIPT_INTERFACE_NAME);
this.b.put("sdk_version", "2.4.2");
this.b.put(TapjoyConstants.TJC_DEVICE_OS_VERSION_NAME, Build.VERSION.RELEASE);
if (bf.n(Appodeal.f)) {
jSONObject2 = this.b;
str = TapjoyConstants.TJC_DEVICE_TYPE_NAME;
str2 = "tablet";
} else {
jSONObject2 = this.b;
str = TapjoyConstants.TJC_DEVICE_TYPE_NAME;
str2 = "phone";
}
jSONObject2.put(str, str2);
bf.a c = az.c(Appodeal.f);
if (c != null) {
this.b.put(TapjoyConstants.TJC_CONNECTION_TYPE, c.a);
}
this.b.put("user_agent", System.getProperty("http.agent"));
this.b.put("model", String.format("%s %s", Build.MANUFACTURER, Build.MODEL));
}
jSONObject = new JSONObject();
Iterator<String> keys = this.b.keys();
while (keys.hasNext()) {
String next = keys.next();
jSONObject.put(next, this.b.get(next));
}
jSONObject.put("waterfall_ad_type", i);
jSONObject.put("waterfall_start_time", System.currentTimeMillis());
jSONObject.put("ad_units", new JSONArray());
} catch (Exception e) {
Appodeal.a(e);
return null;
}
return jSONObject;
}
@VisibleForTesting
String a() {
return "https://rri.appodeal.com/api/stat";
}
public void a(int i) {
if (b(i)) {
this.a.put(i, c(i));
}
if (this.c != null) {
this.c.onWaterfallStart(i);
}
}
public void a(int i, String str) {
if (this.c != null) {
this.c.onImpression(i, str);
}
}
public void a(int i, String str, String str2) {
if (b(i)) {
this.d.put(i, new Pair<>(str2, Long.valueOf(System.currentTimeMillis())));
}
if (this.c != null) {
this.c.onRequestStart(i, str, "");
}
}
public void a(int i, String str, boolean z) {
a(i, str, z, 0);
}
public void a(int i, String str, boolean z, int i2) {
Pair<String, Long> pair;
try {
if (b(i) && (pair = this.d.get(i)) != null) {
String str2 = (String) pair.first;
Long l = (Long) pair.second;
JSONObject jSONObject = this.a.get(i);
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", str2);
jSONObject2.put("network_name", str);
jSONObject2.put("fill", z);
jSONObject2.put("delta", valueOf);
if (!z) {
jSONObject2.put("reason", i2);
}
jSONArray.put(jSONObject2);
}
}
if (this.c != null) {
this.c.onRequestFinish(i, str, z);
}
} catch (Exception e) {
Appodeal.a(e);
}
}
public void a(int i, boolean z) {
JSONObject jSONObject;
try {
if (b(i) && (jSONObject = this.a.get(i)) != null) {
jSONObject.put("result", z);
a(jSONObject, i);
}
if (this.c != null) {
this.c.onWaterfallFinish(i, z);
}
} catch (Exception e) {
Appodeal.a(e);
}
}
@VisibleForTesting
void a(JSONObject jSONObject, int i) {
this.a.remove(i);
this.d.remove(i);
com.appodeal.ads.utils.t.a.execute(new com.appodeal.ads.utils.z(jSONObject.toString(), a()));
}
public void b(int i, String str) {
if (this.c != null) {
this.c.onClick(i, str);
}
}
}