AI Chat v1.1.8版本的 MD5 值为:1bcdce875f86738c8cfbf1e5f4064353
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.mbridge.msdk.splash.c;
import android.graphics.Bitmap;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.db.g;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.splash.c.e;
import com.mbridge.msdk.splash.view.MBSplashView;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
public final class b {
private static String b = "ResManager";
private static int c = 1;
public static com.mbridge.msdk.foundation.db.e a = com.mbridge.msdk.foundation.db.e.a(g.a(com.mbridge.msdk.foundation.controller.a.d().f()));
private static ConcurrentHashMap<String, Boolean> f1703d = new ConcurrentHashMap<>();
public static void b(String str) {
f1703d.remove(str);
}
private static String c(String str) {
try {
File file = new File(str);
if (file.exists()) {
return "file:///" + file.getAbsolutePath();
}
return "";
} catch (Throwable th) {
try {
throw th;
} catch (Exception e) {
e.getMessage();
return "";
}
}
}
public static CampaignEx a(MBSplashView mBSplashView, String str, String str2, String str3, boolean z, int i, boolean z2, boolean z3) {
if (a == null) {
a = com.mbridge.msdk.foundation.db.e.a(g.a(com.mbridge.msdk.foundation.controller.a.d().f()));
}
com.mbridge.msdk.c.a b2 = com.mbridge.msdk.c.b.a().b(com.mbridge.msdk.foundation.controller.a.d().g());
if (b2 == null) {
b2 = com.mbridge.msdk.c.b.a().b();
}
long R = b2.R() * 1000;
long L = b2.L() * 1000;
if (a == null) {
a = com.mbridge.msdk.foundation.db.e.a(g.a(com.mbridge.msdk.foundation.controller.a.d().f()));
}
a.b(L, str2);
List<CampaignEx> a2 = a.a(str2, 0, 0, c, !TextUtils.isEmpty(str3));
if (a2 == null || a2.size() <= 0) {
return null;
}
CampaignEx campaignEx = a2.get(0);
if (TextUtils.isEmpty(campaignEx.getAdZip()) && TextUtils.isEmpty(campaignEx.getAdHtml())) {
return null;
}
long currentTimeMillis = System.currentTimeMillis();
long j = currentTimeMillis - R;
if (!z2) {
if (((campaignEx.getPlct() <= 0 || (campaignEx.getPlct() * 1000) + campaignEx.getTimestamp() < currentTimeMillis) && (campaignEx.getPlct() > 0 || campaignEx.getTimestamp() < j)) || !a(mBSplashView, campaignEx, str, str2, z, i, z3)) {
return null;
}
return a(campaignEx);
} else if ((campaignEx.getPlct() > 0 && (campaignEx.getPlct() * 1000) + campaignEx.getTimestamp() >= currentTimeMillis) || (campaignEx.getPlct() <= 0 && campaignEx.getTimestamp() >= j)) {
if (a(mBSplashView, campaignEx, str, str2, z, i, z3)) {
return a(campaignEx);
}
return null;
} else if (a(mBSplashView, campaignEx, str, str2, z, i, z3) && campaignEx.isSpareOffer(R, L)) {
return a(campaignEx);
} else {
return null;
}
}
private static CampaignEx a(CampaignEx campaignEx) {
if (TextUtils.isEmpty(campaignEx.getAdZip()) && (TextUtils.isEmpty(campaignEx.getAdHtml()) || !campaignEx.getAdHtml().contains("<MBTPLMARK>"))) {
campaignEx.setHasMBTplMark(false);
campaignEx.setIsMraid(true);
} else {
campaignEx.setHasMBTplMark(true);
campaignEx.setIsMraid(false);
}
return campaignEx;
}
private static boolean a(MBSplashView mBSplashView, CampaignEx campaignEx, String str, String str2, boolean z, int i, boolean z2) {
boolean z3;
boolean z4 = false;
if (campaignEx != null) {
mBSplashView.clearResState();
if (TextUtils.isEmpty(campaignEx.getVideoUrlEncode())) {
z3 = true;
} else {
boolean z5 = mBSplashView.isVideoReady() || com.mbridge.msdk.videocommon.download.c.getInstance().a(com.anythink.expressad.foundation.g.a.aV, str2, campaignEx.isBidCampaign());
if (!z5) {
a(mBSplashView, campaignEx, str2);
} else {
mBSplashView.setVideoReady(true);
}
z3 = z5;
}
if (!TextUtils.isEmpty(campaignEx.getAdZip()) && !mBSplashView.isH5Ready()) {
String b2 = com.mbridge.msdk.videocommon.download.g.a().b(campaignEx.getAdZip());
if (TextUtils.isEmpty(b2)) {
z3 = false;
} else if (!z2) {
a(mBSplashView, b2, campaignEx, str, str2, z, i);
}
}
if (TextUtils.isEmpty(campaignEx.getAdZip()) && !TextUtils.isEmpty(campaignEx.getAdHtml()) && !mBSplashView.isH5Ready()) {
String c2 = c(campaignEx.getAdHtml());
if (!TextUtils.isEmpty(c2)) {
if (!z2) {
a(mBSplashView, c2, campaignEx, str, str2, z, i);
}
}
if (campaignEx.isDynamicView()) {
Boolean bool = f1703d.get(campaignEx.getImageUrl());
if (bool != null) {
z4 = bool.booleanValue();
}
if (!z4) {
a(mBSplashView, campaignEx, (com.mbridge.msdk.splash.view.nativeview.a) null);
} else {
mBSplashView.setImageReady(true);
}
}
}
z4 = z3;
if (campaignEx.isDynamicView()) {
}
}
return z4;
}
private static void a(final MBSplashView mBSplashView, CampaignEx campaignEx, String str) {
com.mbridge.msdk.videocommon.listener.a aVar = new com.mbridge.msdk.videocommon.listener.a() {
@Override
public final void a(String str2) {
MBSplashView.this.setVideoReady(true);
}
@Override
public final void a(String str2, String str3) {
MBSplashView.this.setVideoReady(false);
}
};
CopyOnWriteArrayList<CampaignEx> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
copyOnWriteArrayList.add(campaignEx);
com.mbridge.msdk.videocommon.download.c.getInstance().createUnitCache(com.mbridge.msdk.foundation.controller.a.d().f(), str, copyOnWriteArrayList, com.anythink.expressad.foundation.g.a.aV, aVar);
if (!com.mbridge.msdk.videocommon.download.c.getInstance().a(com.anythink.expressad.foundation.g.a.aV, str, campaignEx.isBidCampaign())) {
com.mbridge.msdk.videocommon.download.c.getInstance().load(str);
} else {
mBSplashView.setVideoReady(true);
}
}
public static void a(final MBSplashView mBSplashView, final CampaignEx campaignEx, final com.mbridge.msdk.splash.view.nativeview.a aVar) {
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.a.d().f()).a(campaignEx.getImageUrl(), new com.mbridge.msdk.foundation.same.c.c() {
@Override
public final void onFailedLoad(String str, String str2) {
b.f1703d.put(CampaignEx.this.getImageUrl(), Boolean.FALSE);
com.mbridge.msdk.splash.view.nativeview.a aVar2 = aVar;
if (aVar2 != null) {
aVar2.b();
}
MBSplashView mBSplashView2 = mBSplashView;
if (mBSplashView2 != null) {
mBSplashView2.setImageReady(false);
}
}
@Override
public final void onSuccessLoad(Bitmap bitmap, String str) {
b.f1703d.put(CampaignEx.this.getImageUrl(), Boolean.TRUE);
com.mbridge.msdk.splash.view.nativeview.a aVar2 = aVar;
if (aVar2 != null) {
aVar2.a();
}
MBSplashView mBSplashView2 = mBSplashView;
if (mBSplashView2 != null) {
mBSplashView2.setImageReady(true);
}
}
});
if (TextUtils.isEmpty(campaignEx.getIconUrl())) {
return;
}
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.a.d().f()).a(campaignEx.getIconUrl(), new com.mbridge.msdk.foundation.same.c.c() {
@Override
public final void onFailedLoad(String str, String str2) {
}
@Override
public final void onSuccessLoad(Bitmap bitmap, String str) {
}
});
}
private static void a(MBSplashView mBSplashView, String str, CampaignEx campaignEx, String str2, String str3, boolean z, int i) {
e.c cVar = new e.c();
cVar.c(str3);
cVar.b(str2);
cVar.a(campaignEx);
cVar.a(str);
cVar.a(z);
cVar.a(i);
e.a.a().a(mBSplashView, cVar, null);
}
public static boolean a(MBSplashView mBSplashView, CampaignEx campaignEx) {
if (mBSplashView == null) {
return false;
}
boolean isVideoReady = TextUtils.isEmpty(campaignEx.getVideoUrlEncode()) ? true : mBSplashView.isVideoReady();
if (isVideoReady && !TextUtils.isEmpty(campaignEx.getAdZip())) {
isVideoReady = mBSplashView.isH5Ready();
}
if (isVideoReady && TextUtils.isEmpty(campaignEx.getAdZip()) && !TextUtils.isEmpty(campaignEx.getAdHtml())) {
isVideoReady = mBSplashView.isH5Ready();
}
if (TextUtils.isEmpty(campaignEx.getAdZip()) && TextUtils.isEmpty(campaignEx.getAdHtml())) {
isVideoReady = false;
}
if (campaignEx.isDynamicView()) {
if (TextUtils.isEmpty(campaignEx.getImageUrl())) {
return false;
}
return mBSplashView.isImageReady();
}
return isVideoReady;
}
public static void a(CampaignEx campaignEx, String str) {
ArrayList arrayList = new ArrayList();
arrayList.add(campaignEx);
if (a == null) {
a = com.mbridge.msdk.foundation.db.e.a(g.a(com.mbridge.msdk.foundation.controller.a.d().f()));
}
a.b(arrayList, str);
}
public static void a(String str) {
if (a == null) {
a = com.mbridge.msdk.foundation.db.e.a(g.a(com.mbridge.msdk.foundation.controller.a.d().f()));
}
a.a(str, 0, c);
}
}