MyRecorder v1.01.90.0219版本的 MD5 值为:c361f51174a0bf833abfa72929caf8d3
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.applovin.impl.mediation.c.b;
import android.net.Uri;
import android.webkit.URLUtil;
import com.applovin.impl.sdk.AppLovinError;
import com.applovin.impl.sdk.e.w;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.nativeAd.AppLovinNativeAdLoadListener;
import com.applovin.impl.sdk.network.c;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.x;
import com.applovin.mediation.MaxAdFormat;
import com.applovin.mediation.adapter.parameters.MaxAdapterInitializationParameters;
import com.applovin.mediation.adapter.parameters.MaxAdapterResponseParameters;
import com.facebook.appevents.internal.ViewHierarchyConstants;
import com.facebook.devicerequests.internal.DeviceRequestsHelper;
import com.fyber.fairbid.sdk.placements.Placement;
import com.google.api.client.http.HttpMethods;
import com.smaato.sdk.core.gdpr.CmpApiConstants;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import net.pubnative.lite.sdk.analytics.Reporting;
import org.json.JSONArray;
import org.json.JSONObject;
public class a extends com.applovin.impl.mediation.c.b {
public static final Uri avZ = Uri.parse("https://api.taboola.com/");
private final String avO;
private String avR;
private final Uri awa;
private final Map<String, Object> awb;
private String awc;
public a(String str, String str2, String str3, n nVar) {
super("TaboolaApiService", nVar);
this.avR = Reporting.EventType.SDK_INIT;
this.awc = "";
this.avO = str;
Uri parse = URLUtil.isValidUrl(str3) ? Uri.parse(str3) : avZ;
this.awa = Uri.withAppendedPath(parse, "2.0/json/" + str2);
HashMap hashMap = new HashMap(3);
this.awb = hashMap;
hashMap.put("type", "mobile");
hashMap.put("apiKey", str);
hashMap.put("origin", "SERVER");
}
private Integer a(MaxAdapterResponseParameters maxAdapterResponseParameters, String str, Integer num) {
if (maxAdapterResponseParameters.getLocalExtraParameters().containsKey(str)) {
Object obj = maxAdapterResponseParameters.getLocalExtraParameters().get(str);
if (obj instanceof Integer) {
return (Integer) obj;
}
}
return Integer.valueOf(maxAdapterResponseParameters.getCustomParameters().getInt(str, num.intValue()));
}
private String a(MaxAdapterResponseParameters maxAdapterResponseParameters, String str, String str2) {
if (maxAdapterResponseParameters.getLocalExtraParameters().containsKey(str)) {
Object obj = maxAdapterResponseParameters.getLocalExtraParameters().get(str);
if (obj instanceof String) {
return (String) obj;
}
}
return maxAdapterResponseParameters.getCustomParameters().getString(str, str2);
}
private JSONObject a(MaxAdapterResponseParameters maxAdapterResponseParameters) {
Map<String, Object> CV = this.sdk.BV() != null ? this.sdk.BV().CV() : this.sdk.BS().CV();
String valueOf = String.valueOf(CV.get("ua"));
String valueOf2 = String.valueOf(CV.get("idfa"));
String str = this.avR;
Map<String, Object> localExtraParameters = maxAdapterResponseParameters.getLocalExtraParameters();
if (localExtraParameters.containsKey("taboola_session")) {
Object obj = localExtraParameters.get("taboola_session");
if (obj instanceof String) {
str = (String) obj;
}
}
JSONObject jSONObject = new JSONObject();
JsonUtils.putString(jSONObject, "session", str);
JsonUtils.putString(jSONObject, "agent", valueOf);
JsonUtils.putString(jSONObject, DeviceRequestsHelper.DEVICE_INFO_DEVICE, valueOf2);
JsonUtils.putString(jSONObject, "id", this.awc);
JsonUtils.putString(jSONObject, "realip", maxAdapterResponseParameters.getServerParameters().getString("s2s_ip", ""));
return jSONObject;
}
private void a(final b bVar) {
HashMap hashMap = new HashMap(2);
hashMap.put("app.type", "mobile");
hashMap.put("app.apikey", this.avO);
c.a D = com.applovin.impl.sdk.network.c.D(this.sdk);
this.sdk.BO().b(new w<JSONObject>(D.cW(this.awa.toString() + "/user.sync").cX(HttpMethods.GET).k(hashMap).ad(new JSONObject()).aS(false).aU(false).Ig(), this.sdk) {
@Override
public void a(int i10, String str, JSONObject jSONObject) {
if (x.Fn()) {
x xVar = this.logger;
String str2 = this.tag;
xVar.i(str2, "Unable to fetch user id. Server returned " + i10);
}
bVar.onInitialized(false, str);
}
@Override
public void d(JSONObject jSONObject, int i10) {
if (i10 == 200 && jSONObject != null) {
a.this.awc = JsonUtils.getString(JsonUtils.getJSONObject(jSONObject, "user", new JSONObject()), "id", "");
this.sdk.a(com.applovin.impl.mediation.c.c.avE, (com.applovin.impl.mediation.c.c<String>) a.this.awc, a.this.avw);
this.sdk.a(com.applovin.impl.mediation.c.c.avF, (com.applovin.impl.mediation.c.c<Long>) Long.valueOf(System.currentTimeMillis()), a.this.avw);
bVar.onInitialized(true, null);
return;
}
String str = "Unable to fetch user id. Server returned " + i10;
if (x.Fn()) {
this.logger.i(this.tag, str);
}
bVar.onInitialized(false, str);
}
});
}
private JSONObject b(MaxAdapterResponseParameters maxAdapterResponseParameters) {
JSONObject jSONObject = new JSONObject();
JsonUtils.putString(jSONObject, "type", maxAdapterResponseParameters.getCustomParameters().getString("source_type", ""));
JsonUtils.putString(jSONObject, "id", maxAdapterResponseParameters.getCustomParameters().getString("source_id", ""));
JsonUtils.putString(jSONObject, "url", maxAdapterResponseParameters.getCustomParameters().getString("source_url", ""));
return jSONObject;
}
private JSONObject c(MaxAdapterResponseParameters maxAdapterResponseParameters) {
JSONObject jSONObject = new JSONObject();
JsonUtils.putString(jSONObject, "id", a(maxAdapterResponseParameters, "taboola_view_id", ""));
return jSONObject;
}
private JSONArray d(MaxAdapterResponseParameters maxAdapterResponseParameters) {
JSONArray jSONArray = new JSONArray();
JSONObject jSONObject = new JSONObject();
JsonUtils.putString(jSONObject, "name", maxAdapterResponseParameters.getThirdPartyAdPlacementId());
JsonUtils.putInt(jSONObject, "recCount", 1);
JsonUtils.putString(jSONObject, "organicType", maxAdapterResponseParameters.getCustomParameters().getString("placement_type", "MIX"));
Map<String, Object> localExtraParameters = maxAdapterResponseParameters.getLocalExtraParameters();
if (localExtraParameters.containsKey("taboola_thumbnail_height") && localExtraParameters.containsKey("taboola_thumbnail_width")) {
Integer a10 = a(maxAdapterResponseParameters, "taboola_thumbnail_height", (Integer) 0);
Integer a11 = a(maxAdapterResponseParameters, "taboola_thumbnail_width", (Integer) 0);
if (a10.intValue() > 0 && a11.intValue() > 0) {
JSONObject jSONObject2 = new JSONObject();
JsonUtils.putInt(jSONObject2, "width", a10.intValue());
JsonUtils.putInt(jSONObject2, "height", a11.intValue());
JsonUtils.putJSONObject(jSONObject, "thumbnail", jSONObject2);
}
}
jSONArray.put(jSONObject);
return jSONArray;
}
private JSONObject zA() {
JSONObject jSONObject = new JSONObject();
Map<String, Object> DI = this.sdk.BV() != null ? this.sdk.BV().DI() : this.sdk.BS().Db();
Object obj = DI.get(CmpApiConstants.IABTCF_GDPR_APPLIES);
if (obj != null) {
JsonUtils.putObject(jSONObject, "gdpr_applies", obj);
JsonUtils.putString(jSONObject, "daisyBit", String.valueOf(DI.get(CmpApiConstants.IABTCF_TC_STRING)));
}
return jSONObject;
}
public void a(MaxAdapterInitializationParameters maxAdapterInitializationParameters, b bVar) {
String str = (String) this.sdk.b(com.applovin.impl.mediation.c.c.avE, null, this.avw);
Long l10 = (Long) this.sdk.b(com.applovin.impl.mediation.c.c.avF, null, this.avw);
if (!StringUtils.isValidString(str) || l10 == null) {
a(bVar);
} else if (maxAdapterInitializationParameters.getServerParameters().getLong("user_id_expiration_millis", TimeUnit.DAYS.toMillis(30L)) - (System.currentTimeMillis() - l10.longValue()) <= TimeUnit.HOURS.toMillis(1L)) {
a(bVar);
} else {
this.awc = str;
bVar.onInitialized(true, null);
}
}
public void a(final MaxAdapterResponseParameters maxAdapterResponseParameters, final AppLovinNativeAdLoadListener appLovinNativeAdLoadListener) {
JSONObject jSONObject = new JSONObject();
JsonUtils.putJSONObject(jSONObject, "app", new JSONObject(this.awb));
JsonUtils.putJSONObject(jSONObject, "consent", zA());
JsonUtils.putJSONObject(jSONObject, "user", a(maxAdapterResponseParameters));
JsonUtils.putJSONObject(jSONObject, "source", b(maxAdapterResponseParameters));
JsonUtils.putJSONObject(jSONObject, ViewHierarchyConstants.VIEW_KEY, c(maxAdapterResponseParameters));
JsonUtils.putJsonArray(jSONObject, Placement.JSON_KEY, d(maxAdapterResponseParameters));
c.a D = com.applovin.impl.sdk.network.c.D(this.sdk);
this.sdk.BO().b(new w<JSONObject>(D.cW(this.awa.toString() + "/recommendations.get").cX(HttpMethods.POST).K(jSONObject).ad(new JSONObject()).aS(false).aU(false).Ig(), this.sdk) {
@Override
public void a(int i10, String str, JSONObject jSONObject2) {
if (x.Fn()) {
x xVar = this.logger;
String str2 = this.tag;
xVar.i(str2, "Unable to fetch " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + " Taboola ad: server returned " + i10);
}
AppLovinNativeAdLoadListener appLovinNativeAdLoadListener2 = appLovinNativeAdLoadListener;
appLovinNativeAdLoadListener2.onNativeAdLoadFailed(new AppLovinError(i10, "Taboola server returned with code: " + jSONObject2));
}
@Override
public void d(JSONObject jSONObject2, int i10) {
if (i10 == 200 && jSONObject2 != null) {
JSONObject jSONObject3 = JsonUtils.getJSONObject(jSONObject2, "user", new JSONObject());
a.this.avR = JsonUtils.getString(jSONObject3, "session", "");
this.sdk.BO().b(new c(jSONObject2, maxAdapterResponseParameters, MaxAdFormat.NATIVE, appLovinNativeAdLoadListener, this.sdk));
return;
}
if (x.Fn()) {
x xVar = this.logger;
String str = this.tag;
xVar.i(str, "Unable to fetch " + maxAdapterResponseParameters.getThirdPartyAdPlacementId() + " Taboola ad: server returned " + i10);
}
AppLovinNativeAdLoadListener appLovinNativeAdLoadListener2 = appLovinNativeAdLoadListener;
appLovinNativeAdLoadListener2.onNativeAdLoadFailed(new AppLovinError(i10, "Taboola server returned with code: " + jSONObject2));
}
});
}
}