atsameip v0.1版本的 MD5 值为:28547cf98b0a2d02acb37969dcfb83e9
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.applovin.impl.sdk.nativeAd;
import android.net.Uri;
import android.text.TextUtils;
import android.webkit.URLUtil;
import com.amazon.aps.shared.util.APSSharedUtil;
import com.applovin.impl.sdk.e.o;
import com.applovin.impl.sdk.e.r;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl;
import com.applovin.impl.sdk.nativeAd.a;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.w;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdLoadListener;
import com.applovin.sdk.AppLovinSdkUtils;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
public class e extends com.applovin.impl.sdk.e.a implements a.InterfaceC0040a, AppLovinAdLoadListener {
private final JSONObject a;
private final JSONObject c;
private final AppLovinNativeAdLoadListener d;
private String e;
private String f;
private String g;
private String h;
private Uri i;
private Uri j;
private Uri k;
private Uri l;
private com.applovin.impl.a.a m;
private Uri n;
private Uri o;
private final List<String> p;
private final List<String> q;
private final List<String> r;
private final List<String> s;
private final List<String> t;
public e(JSONObject jSONObject, JSONObject jSONObject2, AppLovinNativeAdLoadListener appLovinNativeAdLoadListener, n nVar) {
super("TaskRenderNativeAd", nVar);
this.e = "";
this.f = "";
this.g = "";
this.h = "";
this.i = null;
this.j = null;
this.k = null;
this.l = null;
this.n = null;
this.o = null;
this.p = new ArrayList();
this.q = new ArrayList();
this.r = new ArrayList();
this.s = new ArrayList();
this.t = new ArrayList();
this.a = jSONObject;
this.c = jSONObject2;
this.d = appLovinNativeAdLoadListener;
}
private void a() {
AppLovinNativeAdImpl build = new AppLovinNativeAdImpl.Builder(JsonUtils.shallowCopy(this.a), JsonUtils.shallowCopy(this.c), this.b).setTitle(this.e).setAdvertiser(this.f).setBody(this.g).setCallToAction(this.h).setIconUri(this.i).setMainImageUri(this.j).setPrivacyIconUri(this.k).setVastAd(this.m).setPrivacyDestinationUri(this.l).setClickDestinationUri(this.n).setClickDestinationBackupUri(this.o).setClickTrackingUrls(this.p).setImpressionUrls(this.q).setViewableMRC50Urls(this.r).setViewableMRC100Urls(this.s).setViewableVideo50Urls(this.t).build();
build.getAdEventTracker().b();
if (w.a()) {
a("Starting cache task for type: " + build.getType() + APSSharedUtil.TRUNCATE_SEPARATOR);
}
this.b.S().a(new a(build, this.b, this), o.a.MAIN);
}
private void a(JSONObject jSONObject) {
if (jSONObject == null) {
return;
}
String string = JsonUtils.getString(jSONObject, "url", null);
if (StringUtils.isValidString(string)) {
this.n = Uri.parse(string);
if (w.a()) {
a("Processed click destination URL: " + this.n);
}
}
String string2 = JsonUtils.getString(jSONObject, "fallback", null);
if (StringUtils.isValidString(string2)) {
this.o = Uri.parse(string2);
if (w.a()) {
a("Processed click destination backup URL: " + this.o);
}
}
JSONArray jSONArray = JsonUtils.getJSONArray(jSONObject, "clicktrackers", null);
if (jSONArray != null) {
try {
this.p.addAll(JsonUtils.toList(jSONArray));
if (w.a()) {
a("Processed click tracking URLs: " + this.p);
}
} catch (Throwable th) {
if (w.a()) {
a("Failed to render click tracking URLs", th);
}
}
}
}
public void b() {
this.d.onNativeAdLoadFailed(-6);
}
private void b(final AppLovinNativeAdImpl appLovinNativeAdImpl) {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (w.a()) {
e.this.a("Preparing native ad view components...");
}
try {
appLovinNativeAdImpl.setUpNativeAdViewComponents();
if (w.a()) {
e.this.a("Successfully prepared native ad view components");
}
appLovinNativeAdImpl.getAdEventTracker().c();
e.this.d.onNativeAdLoaded(appLovinNativeAdImpl);
} catch (Throwable th) {
if (w.a()) {
e.this.a("Failed to prepare native ad view components", th);
}
e.this.b();
}
}
});
}
@Override
public void a(AppLovinNativeAdImpl appLovinNativeAdImpl) {
if (w.a()) {
a("Successfully cached and loaded ad");
}
b(appLovinNativeAdImpl);
}
@Override
public void adReceived(AppLovinAd appLovinAd) {
if (w.a()) {
a("VAST ad rendered successfully");
}
this.m = (com.applovin.impl.a.a) appLovinAd;
a();
}
@Override
public void failedToReceiveAd(int i) {
if (w.a()) {
d("VAST ad failed to render");
}
a();
}
@Override
public void run() {
StringBuilder sb;
String str;
StringBuilder sb2;
String str2;
StringBuilder sb3;
String str3;
String sb4;
String str4;
Uri uri;
?? r2 = 0;
String string = JsonUtils.getString(this.a, "privacy_icon_url", null);
if (URLUtil.isValidUrl(string)) {
this.k = Uri.parse(string);
}
String string2 = JsonUtils.getString(this.a, "privacy_url", null);
if (!URLUtil.isValidUrl(string2)) {
string2 = "https://www.applovin.com/privacy/";
}
this.l = Uri.parse(string2);
JSONObject jSONObject = JsonUtils.getJSONObject(this.a, "ortb_response", (JSONObject) null);
if (jSONObject == null || jSONObject.length() == 0) {
if (w.a()) {
d("No oRtb response provided: " + this.a);
}
b();
return;
}
String string3 = JsonUtils.getString(jSONObject, "version", null);
JSONObject jSONObject2 = JsonUtils.getJSONObject(jSONObject, AppMeasurementSdk.ConditionalUserProperty.VALUE, (JSONObject) null);
if (w.a()) {
a("Rendering native ad for oRTB version: " + string3);
}
JSONObject jSONObject3 = JsonUtils.getJSONObject(jSONObject2, "native", jSONObject2);
a(JsonUtils.getJSONObject(jSONObject3, "link", (JSONObject) null));
JSONArray jSONArray = JsonUtils.getJSONArray(jSONObject3, "assets", null);
if (jSONArray == null || jSONArray.length() == 0) {
if (w.a()) {
d("Unable to retrieve assets - failing ad load: " + this.a);
}
b();
return;
}
String str5 = "";
int i = 0;
while (i < jSONArray.length()) {
JSONObject jSONObject4 = JsonUtils.getJSONObject(jSONArray, i, (JSONObject) r2);
if (jSONObject4.has("title")) {
this.e = JsonUtils.getString(JsonUtils.getJSONObject(jSONObject4, "title", (JSONObject) r2), "text", r2);
if (w.a()) {
a("Processed title: " + this.e);
}
} else if (jSONObject4.has("link")) {
a(JsonUtils.getJSONObject(jSONObject4, "link", (JSONObject) r2));
} else if (jSONObject4.has("img")) {
int i2 = JsonUtils.getInt(jSONObject4, "id", -1);
JSONObject jSONObject5 = JsonUtils.getJSONObject(jSONObject4, "img", (JSONObject) r2);
int i3 = JsonUtils.getInt(jSONObject5, "type", -1);
String string4 = JsonUtils.getString(jSONObject5, "url", r2);
if (i3 == 1 || 3 == i2) {
this.i = Uri.parse(string4);
if (w.a()) {
sb2 = new StringBuilder();
sb2.append("Processed icon URL: ");
uri = this.i;
sb2.append(uri);
}
} else if (i3 == 3 || 2 == i2) {
this.j = Uri.parse(string4);
if (w.a()) {
sb2 = new StringBuilder();
sb2.append("Processed main image URL: ");
uri = this.j;
sb2.append(uri);
}
} else {
if (w.a()) {
c("Unrecognized image: " + jSONObject4);
}
int i4 = JsonUtils.getInt(jSONObject5, "w", -1);
int i5 = JsonUtils.getInt(jSONObject5, "h", -1);
if (i4 > 0 && i5 > 0) {
int i6 = ((i4 / i5) > 1.0d ? 1 : ((i4 / i5) == 1.0d ? 0 : -1));
boolean a = w.a();
if (i6 > 0) {
if (a) {
a("Inferring main image from " + i4 + "x" + i5 + APSSharedUtil.TRUNCATE_SEPARATOR);
}
this.j = Uri.parse(string4);
} else {
if (a) {
a("Inferring icon image from " + i4 + "x" + i5 + APSSharedUtil.TRUNCATE_SEPARATOR);
}
this.i = Uri.parse(string4);
}
} else if (w.a()) {
sb4 = "Skipping...";
c(sb4);
}
}
str4 = sb2.toString();
a(str4);
} else {
if (jSONObject4.has("video")) {
str5 = JsonUtils.getString(JsonUtils.getJSONObject(jSONObject4, "video", (JSONObject) null), "vasttag", null);
if (StringUtils.isValidString(str5)) {
if (w.a()) {
str4 = "Processed VAST video";
a(str4);
}
} else if (w.a()) {
sb3 = new StringBuilder();
str3 = "Ignoring invalid \"vasttag\" for video: ";
sb3.append(str3);
sb3.append(jSONObject4);
sb4 = sb3.toString();
}
} else if (jSONObject4.has("data")) {
int i7 = JsonUtils.getInt(jSONObject4, "id", -1);
JSONObject jSONObject6 = JsonUtils.getJSONObject(jSONObject4, "data", (JSONObject) null);
int i8 = JsonUtils.getInt(jSONObject6, "type", -1);
String string5 = JsonUtils.getString(jSONObject6, AppMeasurementSdk.ConditionalUserProperty.VALUE, null);
if (i8 == 1 || i7 == 8) {
this.f = string5;
if (w.a()) {
sb2 = new StringBuilder();
sb2.append("Processed advertiser: ");
str2 = this.f;
sb2.append(str2);
}
} else if (i8 == 2 || i7 == 4) {
this.g = string5;
if (w.a()) {
sb2 = new StringBuilder();
sb2.append("Processed body: ");
str2 = this.g;
sb2.append(str2);
}
} else if (i8 == 12 || i7 == 5) {
this.h = string5;
if (w.a()) {
sb2 = new StringBuilder();
sb2.append("Processed cta: ");
str2 = this.h;
sb2.append(str2);
}
} else if (w.a()) {
sb3 = new StringBuilder();
str3 = "Skipping unsupported data: ";
sb3.append(str3);
sb3.append(jSONObject4);
sb4 = sb3.toString();
}
str4 = sb2.toString();
a(str4);
} else if (w.a()) {
d("Unsupported asset object: " + jSONObject4);
}
c(sb4);
}
i++;
r2 = 0;
}
Object obj = null;
JSONArray jSONArray2 = JsonUtils.getJSONArray(jSONObject3, "imptrackers", null);
if (jSONArray2 != null) {
int i9 = 0;
while (i9 < jSONArray2.length()) {
Object objectAtIndex = JsonUtils.getObjectAtIndex(jSONArray2, i9, obj);
if (objectAtIndex instanceof String) {
String str6 = (String) objectAtIndex;
if (!TextUtils.isEmpty(str6)) {
this.q.add(str6);
if (w.a()) {
a("Processed imptracker URL: " + str6);
}
}
}
i9++;
obj = null;
}
}
if (jSONObject3.has("jstracker") && w.a()) {
d("Ignoring \"jstracker\" field - it is deprecated in lieu of \"eventtrackers\"");
}
JSONArray jSONArray3 = JsonUtils.getJSONArray(jSONObject3, "eventtrackers", null);
if (jSONArray3 != null) {
for (int i10 = 0; i10 < jSONArray3.length(); i10++) {
JSONObject jSONObject7 = JsonUtils.getJSONObject(jSONArray3, i10, (JSONObject) null);
int i11 = JsonUtils.getInt(jSONObject7, "event", -1);
int i12 = JsonUtils.getInt(jSONObject7, "method", -1);
String string6 = JsonUtils.getString(jSONObject7, "url", null);
if (!TextUtils.isEmpty(string6)) {
if (i12 != 1) {
if (w.a()) {
d("Unsupported method for event tracker: " + jSONObject7);
}
} else if (i11 == 1) {
this.q.add(string6);
if (w.a()) {
a("Processed impression URL: " + string6);
}
} else if (i11 == 2) {
this.r.add(string6);
if (w.a()) {
sb = new StringBuilder();
str = "Processed viewable MRC50 URL: ";
sb.append(str);
sb.append(string6);
a(sb.toString());
}
} else if (i11 == 3) {
this.s.add(string6);
if (w.a()) {
sb = new StringBuilder();
str = "Processed viewable MRC100 URL: ";
sb.append(str);
sb.append(string6);
a(sb.toString());
}
} else {
if (i11 == 4) {
this.t.add(string6);
if (w.a()) {
a("Processed viewable video 50 URL: " + string6);
}
} else if (w.a()) {
d("Unsupported event tracker: " + jSONObject7);
}
}
}
}
}
if (!StringUtils.isValidString(str5)) {
a();
return;
}
if (w.a()) {
a("Processing VAST video...");
}
this.b.S().a((com.applovin.impl.sdk.e.a) r.a(str5, JsonUtils.shallowCopy(this.a), JsonUtils.shallowCopy(this.c), com.applovin.impl.sdk.ad.b.UNKNOWN, this, this.b));
}
}