Idle Tower v2.48版本的 MD5 值为:56f20496f6a85726b376356ed2ecee23
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.ironsource.sdk.d;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.text.TextUtils;
import com.ironsource.environment.thread.ISAdPlayerThreadManager;
import com.ironsource.mediationsdk.IronSourceBannerLayout;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.sdk.controller.C1399c;
import com.ironsource.sdk.controller.FeaturesManager;
import com.ironsource.sdk.controller.g;
import com.ironsource.sdk.controller.j;
import com.ironsource.sdk.e;
import com.ironsource.sdk.f;
import com.ironsource.sdk.g.d;
import com.ironsource.sdk.service.AdInstanceTimingService;
import com.ironsource.sdk.service.d;
import com.ironsource.sdk.utils.IronSourceStorageUtils;
import com.ironsource.sdk.utils.Logger;
import com.ironsource.sdk.utils.SDKUtils;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public final class b implements c, e, f, com.ironsource.sdk.j.a.a, com.ironsource.sdk.j.a.b, com.ironsource.sdk.j.a.c, com.ironsource.sdk.j.a.e {
private static b g;
public g f5738a;
com.ironsource.sdk.j.e b;
String c;
String d;
j e;
private long h;
private d i;
private com.ironsource.sdk.service.c j;
private C1399c l;
private final String f = IronSourceConstants.SUPERSONIC_CONFIG_NAME;
private boolean k = false;
private FeaturesManager m = FeaturesManager.getInstance();
private b(Context context) {
b(context);
}
private b(String str, String str2, Context context) {
this.c = str;
this.d = str2;
b(context);
}
public static synchronized b a(Context context) {
b a2;
synchronized (b.class) {
a2 = a(context, 0);
}
return a2;
}
public static synchronized b a(Context context, int i) {
b bVar;
synchronized (b.class) {
Logger.i("IronSourceAdsPublisherAgent", "getInstance()");
if (g == null) {
g = new b(context);
}
bVar = g;
}
return bVar;
}
public static synchronized e a(String str, String str2, Context context) {
b bVar;
synchronized (b.class) {
if (g == null) {
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.f5580a);
g = new b(str, str2, context);
} else {
d.a().b(str);
d.a().a(str2);
}
bVar = g;
}
return bVar;
}
private static com.ironsource.sdk.j.c a(com.ironsource.sdk.g.c cVar) {
if (cVar == null) {
return null;
}
return (com.ironsource.sdk.j.c) cVar.g;
}
private void a(Context context, JSONObject jSONObject) {
boolean optBoolean = jSONObject.optBoolean("enableLifeCycleListeners", false);
this.k = optBoolean;
if (optBoolean) {
try {
((Application) context).registerActivityLifecycleCallbacks(new a(this));
} catch (Throwable th) {
com.ironsource.sdk.a.a aVar = new com.ironsource.sdk.a.a();
aVar.a("generalmessage", th.getMessage());
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.s, aVar.f5575a);
}
}
}
private static com.ironsource.sdk.j.b b(com.ironsource.sdk.g.c cVar) {
if (cVar == null) {
return null;
}
return (com.ironsource.sdk.j.b) cVar.g;
}
private void b(Context context) {
try {
JSONObject networkConfiguration = SDKUtils.getNetworkConfiguration();
com.ironsource.sdk.utils.b.a(context);
IronSourceStorageUtils.initializeCacheDirectory(context, new com.ironsource.sdk.h.e(SDKUtils.getNetworkConfiguration().optJSONObject("storage")));
com.ironsource.sdk.utils.b.a().a(SDKUtils.getSDKVersion());
this.i = c(context);
this.e = new j();
C1399c c1399c = new C1399c();
this.l = c1399c;
if (context instanceof Activity) {
c1399c.a((Activity) context);
}
int debugMode = this.m.getDebugMode();
this.f5738a = new g(context, this.l, this.i, this.e, ISAdPlayerThreadManager.f5203a, debugMode, this.m.getDataManagerConfig());
Logger.enableLogging(debugMode);
Logger.i("IronSourceAdsPublisherAgent", "C'tor");
a(context, networkConfiguration);
this.j = new com.ironsource.sdk.service.c();
com.ironsource.environment.c.e.a("sdkv", "7.3.1.1");
this.j.a();
this.j.a(context);
this.j.b();
this.j.c();
this.j.b(context);
this.j.d();
this.h = 0L;
} catch (Exception e) {
e.printStackTrace();
}
}
private void b(final com.ironsource.sdk.b bVar, final Map<String, String> map) {
Logger.d("IronSourceAdsPublisherAgent", "loadOnNewInstance " + bVar.b);
this.f5738a.a(new Runnable() {
@Override
public final void run() {
d.e eVar = bVar.a() ? d.e.Banner : d.e.Interstitial;
com.ironsource.sdk.g.c a2 = b.this.e.a(eVar, bVar);
com.ironsource.sdk.a.a aVar = new com.ironsource.sdk.a.a();
com.ironsource.sdk.a.a a3 = aVar.a("isbiddinginstance", Boolean.valueOf(bVar.d)).a("isoneflow", Boolean.valueOf(bVar.h)).a("demandsourcename", bVar.c).a("producttype", com.ironsource.sdk.d.a(bVar));
AdInstanceTimingService adInstanceTimingService = AdInstanceTimingService.f5781a;
a3.a("custom_c", Long.valueOf(AdInstanceTimingService.c(bVar.b)));
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.h, aVar.f5575a);
if (eVar == d.e.Banner) {
b.this.f5738a.a(b.this.c, b.this.d, a2, (com.ironsource.sdk.j.a.b) b.this);
b.this.f5738a.a(a2, map, (com.ironsource.sdk.j.a.b) b.this);
} else {
b.this.f5738a.a(b.this.c, b.this.d, a2, (com.ironsource.sdk.j.a.c) b.this);
b.this.f5738a.a(a2, map, (com.ironsource.sdk.j.a.c) b.this);
}
}
});
}
private com.ironsource.sdk.service.d c(Context context) {
com.ironsource.sdk.service.d a2 = com.ironsource.sdk.service.d.a();
a2.b();
a2.a(context, this.c, this.d);
return a2;
}
private com.ironsource.sdk.g.c d(d.e eVar, String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
return this.e.a(eVar, str);
}
@Override
public final void a(Activity activity) {
try {
Logger.i("IronSourceAdsPublisherAgent", "release()");
com.ironsource.sdk.utils.a.a();
this.l.b();
this.f5738a.b(activity);
this.f5738a.destroy();
this.f5738a = null;
} catch (Exception unused) {
}
g = null;
}
@Override
public final void a(Activity activity, com.ironsource.sdk.b bVar, Map<String, String> map) {
this.l.a(activity);
a(bVar, map);
}
@Override
public final void a(Activity activity, final Map<String, String> map) {
if (activity != null) {
this.l.a(activity);
}
this.f5738a.a(new Runnable() {
@Override
public final void run() {
b.this.f5738a.a(map, b.this.b);
}
});
}
@Override
public final void a(final com.ironsource.sdk.b bVar) {
Logger.d("IronSourceAdsPublisherAgent", "destroyInstance " + bVar.b);
this.f5738a.a(new Runnable() {
@Override
public final void run() {
com.ironsource.sdk.g.c a2 = b.this.e.a(d.e.Banner, bVar);
com.ironsource.sdk.a.a aVar = new com.ironsource.sdk.a.a();
aVar.a("isbiddinginstance", Boolean.valueOf(bVar.d)).a("demandsourcename", bVar.c).a("producttype", com.ironsource.sdk.d.a(bVar));
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.m, aVar.f5575a);
b.this.f5738a.a(a2);
}
});
}
@Override
public final void a(com.ironsource.sdk.b bVar, Map<String, String> map) {
long currentTimeMillis = System.currentTimeMillis();
map.put("loadStartTime", String.valueOf(currentTimeMillis));
AdInstanceTimingService adInstanceTimingService = AdInstanceTimingService.f5781a;
AdInstanceTimingService.a(bVar.b, currentTimeMillis);
com.ironsource.sdk.a.a aVar = new com.ironsource.sdk.a.a();
aVar.a("isbiddinginstance", Boolean.valueOf(bVar.d)).a("isoneflow", Boolean.valueOf(bVar.h)).a("demandsourcename", bVar.c).a("producttype", com.ironsource.sdk.d.a(bVar)).a("custom_c", Long.valueOf(currentTimeMillis));
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.f, aVar.f5575a);
Logger.d("IronSourceAdsPublisherAgent", "loadAd " + bVar.b);
if (!(bVar.d || bVar.h)) {
b(bVar, map);
return;
}
try {
map.put("adm", SDKUtils.decodeString(map.get("adm")));
} catch (Exception e) {
com.ironsource.sdk.a.a a2 = new com.ironsource.sdk.a.a().a("callfailreason", e.getMessage()).a("isbiddinginstance", Boolean.valueOf(bVar.d)).a("isoneflow", Boolean.valueOf(bVar.h)).a("demandsourcename", bVar.c).a("producttype", com.ironsource.sdk.d.a(bVar));
AdInstanceTimingService adInstanceTimingService2 = AdInstanceTimingService.f5781a;
com.ironsource.sdk.a.a a3 = a2.a("custom_c", Long.valueOf(AdInstanceTimingService.c(bVar.b)));
AdInstanceTimingService adInstanceTimingService3 = AdInstanceTimingService.f5781a;
AdInstanceTimingService.b(bVar.b);
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.k, a3.f5575a);
e.printStackTrace();
Logger.d("IronSourceAdsPublisherAgent", "loadInAppBiddingAd failed decoding ADM " + e.getMessage());
}
b(bVar, map);
}
@Override
public final void a(d.e eVar, String str) {
com.ironsource.sdk.j.c a2;
com.ironsource.sdk.g.c d = d(eVar, str);
if (d == null || eVar == d.e.RewardedVideo || eVar != d.e.Interstitial || (a2 = a(d)) == null) {
return;
}
a2.onInterstitialClose();
}
@Override
public final void a(d.e eVar, String str, com.ironsource.sdk.g.a aVar) {
com.ironsource.sdk.j.b b;
com.ironsource.sdk.g.c d = d(eVar, str);
if (d != null) {
d.a(2);
if (eVar != d.e.RewardedVideo) {
if (eVar == d.e.Interstitial) {
com.ironsource.sdk.j.c a2 = a(d);
if (a2 != null) {
a2.onInterstitialInitSuccess();
return;
}
return;
}
if (eVar != d.e.Banner || (b = b(d)) == null) {
return;
}
b.onBannerInitSuccess();
}
}
}
@Override
public final void a(d.e eVar, String str, String str2) {
com.ironsource.sdk.j.b b;
com.ironsource.sdk.g.c d = d(eVar, str);
com.ironsource.sdk.a.a a2 = new com.ironsource.sdk.a.a().a("demandsourcename", str).a("producttype", eVar).a("callfailreason", str2);
if (d != null) {
AdInstanceTimingService adInstanceTimingService = AdInstanceTimingService.f5781a;
a2.a("custom_c", Long.valueOf(AdInstanceTimingService.c(d.b)));
a2.a("isbiddinginstance", Boolean.valueOf(com.ironsource.sdk.a.e.a(d)));
AdInstanceTimingService adInstanceTimingService2 = AdInstanceTimingService.f5781a;
AdInstanceTimingService.b(d.b);
d.a(3);
if (eVar != d.e.RewardedVideo) {
if (eVar == d.e.Interstitial) {
com.ironsource.sdk.j.c a3 = a(d);
if (a3 != null) {
a3.onInterstitialInitFailed(str2);
}
} else if (eVar == d.e.Banner && (b = b(d)) != null) {
b.onBannerLoadFail(str2);
}
}
}
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.i, a2.f5575a);
}
@Override
public final void a(d.e eVar, String str, String str2, JSONObject jSONObject) {
com.ironsource.sdk.j.b b;
com.ironsource.sdk.g.c d = d(eVar, str);
if (d == null || TextUtils.isEmpty(str2)) {
return;
}
try {
Logger.i("IronSourceAdsPublisherAgent", "Received Event Notification: " + str2 + " for demand source: " + d.f5755a);
if (eVar == d.e.Interstitial) {
com.ironsource.sdk.j.c a2 = a(d);
if (a2 != null) {
jSONObject.put("demandSourceName", str);
a2.onInterstitialEventNotificationReceived(str2, jSONObject);
return;
}
return;
}
if (eVar == d.e.RewardedVideo) {
if ((d == null ? null : (IronSourceBannerLayout.a) d.g) != null) {
jSONObject.put("demandSourceName", str);
}
} else {
if (eVar != d.e.Banner || (b = b(d)) == null) {
return;
}
jSONObject.put("demandSourceName", str);
if (str2.equalsIgnoreCase("impressions")) {
b.onBannerShowSuccess();
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public final void a(final com.ironsource.sdk.j.e eVar) {
this.f5738a.a(new Runnable() {
@Override
public final void run() {
b.this.f5738a.a(b.this.c, b.this.d, eVar);
}
});
}
@Override
public final void a(String str) {
d(d.e.RewardedVideo, str);
}
@Override
public final void a(String str, int i) {
d(d.e.RewardedVideo, str);
}
@Override
public final void a(String str, com.ironsource.sdk.c.a aVar) {
com.ironsource.sdk.j.b b;
com.ironsource.sdk.g.c d = d(d.e.Banner, str);
if (d == null || (b = b(d)) == null) {
return;
}
b.onBannerLoadSuccess(d.h, aVar);
}
@Override
public final void a(String str, String str2) {
d(d.e.RewardedVideo, str);
}
@Override
public final void a(final String str, final String str2, final com.ironsource.sdk.j.e eVar) {
this.c = str;
this.d = str2;
this.f5738a.a(new Runnable() {
@Override
public final void run() {
b.this.f5738a.a(str, str2, eVar);
}
});
}
@Override
public final void a(final String str, final String str2, final Map<String, String> map, final com.ironsource.sdk.j.e eVar) {
this.c = str;
this.d = str2;
this.b = eVar;
this.f5738a.a(new Runnable() {
@Override
public final void run() {
b.this.f5738a.a(str, str2, map, eVar);
}
});
}
@Override
public final void a(final Map<String, String> map, final com.ironsource.sdk.j.e eVar) {
this.b = eVar;
this.f5738a.a(new Runnable() {
@Override
public final void run() {
b.this.f5738a.a(b.this.c, b.this.d, map, eVar);
}
});
}
@Override
public final void a(final JSONObject jSONObject) {
if (jSONObject != null && jSONObject.has("gdprConsentStatus")) {
try {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("consent", Boolean.parseBoolean(jSONObject.getString("gdprConsentStatus")));
this.i.a(jSONObject2);
} catch (JSONException e) {
e.printStackTrace();
}
}
this.f5738a.a(new Runnable() {
@Override
public final void run() {
b.this.f5738a.a(jSONObject);
}
});
}
@Override
public final void b(Activity activity) {
if (this.k) {
return;
}
d(activity);
}
@Override
public final void b(Activity activity, com.ironsource.sdk.b bVar, final Map<String, String> map) {
this.l.a(activity);
Logger.i("IronSourceAdsPublisherAgent", "showAd " + bVar.b);
final com.ironsource.sdk.g.c a2 = this.e.a(d.e.Interstitial, bVar.b);
if (a2 == null) {
return;
}
this.f5738a.a(new Runnable() {
@Override
public final void run() {
b.this.f5738a.b(a2, map, b.this);
}
});
}
@Override
public final void b(d.e eVar, String str) {
com.ironsource.sdk.j.b b;
com.ironsource.sdk.g.c d = d(eVar, str);
if (d == null || eVar == d.e.RewardedVideo) {
return;
}
if (eVar == d.e.Interstitial) {
com.ironsource.sdk.j.c a2 = a(d);
if (a2 != null) {
a2.onInterstitialClick();
return;
}
return;
}
if (eVar != d.e.Banner || (b = b(d)) == null) {
return;
}
b.onBannerClick();
}
@Override
public final void b(String str) {
com.ironsource.sdk.g.c d = d(d.e.Interstitial, str);
com.ironsource.sdk.a.a a2 = new com.ironsource.sdk.a.a().a("demandsourcename", str);
if (d != null) {
com.ironsource.sdk.a.a a3 = a2.a("producttype", com.ironsource.sdk.a.e.a(d, d.e.Interstitial)).a("isbiddinginstance", Boolean.valueOf(com.ironsource.sdk.a.e.a(d)));
AdInstanceTimingService adInstanceTimingService = AdInstanceTimingService.f5781a;
a3.a("custom_c", Long.valueOf(AdInstanceTimingService.c(d.b)));
AdInstanceTimingService adInstanceTimingService2 = AdInstanceTimingService.f5781a;
AdInstanceTimingService.b(d.b);
com.ironsource.sdk.j.c a4 = a(d);
if (a4 != null) {
a4.onInterstitialLoadSuccess();
}
}
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.l, a2.f5575a);
}
@Override
public final void b(String str, int i) {
com.ironsource.sdk.g.c d = d(d.e.Interstitial, str);
com.ironsource.sdk.j.c a2 = a(d);
if (d == null || a2 == null) {
return;
}
a2.onInterstitialAdRewarded(str, i);
}
@Override
public final void b(String str, String str2) {
com.ironsource.sdk.g.c d = d(d.e.Interstitial, str);
com.ironsource.sdk.a.a aVar = new com.ironsource.sdk.a.a();
aVar.a("callfailreason", str2).a("demandsourcename", str);
if (d != null) {
com.ironsource.sdk.a.a a2 = aVar.a("producttype", com.ironsource.sdk.a.e.a(d, d.e.Interstitial)).a("generalmessage", d.e == 2 ? com.ironsource.sdk.f.b.f5752a : com.ironsource.sdk.f.b.b).a("isbiddinginstance", Boolean.valueOf(com.ironsource.sdk.a.e.a(d)));
AdInstanceTimingService adInstanceTimingService = AdInstanceTimingService.f5781a;
a2.a("custom_c", Long.valueOf(AdInstanceTimingService.c(d.b)));
AdInstanceTimingService adInstanceTimingService2 = AdInstanceTimingService.f5781a;
AdInstanceTimingService.b(d.b);
com.ironsource.sdk.j.c a3 = a(d);
if (a3 != null) {
a3.onInterstitialLoadFailed(str2);
}
}
com.ironsource.sdk.a.d.a(com.ironsource.sdk.a.f.g, aVar.f5575a);
}
@Override
public final boolean b(com.ironsource.sdk.b bVar) {
Logger.d("IronSourceAdsPublisherAgent", "isAdAvailable " + bVar.b);
com.ironsource.sdk.g.c a2 = this.e.a(d.e.Interstitial, bVar.b);
if (a2 == null) {
return false;
}
return a2.f;
}
@Override
public final void c(Activity activity) {
if (this.k) {
return;
}
e(activity);
}
@Override
public final void c(d.e eVar, String str) {
com.ironsource.sdk.g.c d = d(eVar, str);
if (d != null) {
if (eVar != d.e.Interstitial) {
d.e eVar2 = d.e.RewardedVideo;
return;
}
com.ironsource.sdk.j.c a2 = a(d);
if (a2 != null) {
a2.onInterstitialOpen();
}
}
}
@Override
public final void c(String str) {
com.ironsource.sdk.j.c a2;
com.ironsource.sdk.g.c d = d(d.e.Interstitial, str);
if (d == null || (a2 = a(d)) == null) {
return;
}
a2.onInterstitialShowSuccess();
}
@Override
public final void c(String str, String str2) {
com.ironsource.sdk.j.c a2;
com.ironsource.sdk.g.c d = d(d.e.Interstitial, str);
if (d == null || (a2 = a(d)) == null) {
return;
}
a2.onInterstitialShowFailed(str2);
}
@Override
public final void d(Activity activity) {
try {
this.f5738a.e();
this.f5738a.b(activity);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public final void d(String str, String str2) {
com.ironsource.sdk.j.b b;
com.ironsource.sdk.g.c d = d(d.e.Banner, str);
if (d == null || (b = b(d)) == null) {
return;
}
b.onBannerLoadFail(str2);
}
@Override
public final void e(Activity activity) {
this.l.a(activity);
this.f5738a.d();
this.f5738a.a(activity);
}
}