Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
package com.mbridge.msdk.splash.c;
import android.content.Context;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.tools.o;
import com.mbridge.msdk.splash.view.MBSplashNativeView;
import com.mbridge.msdk.splash.view.MBSplashView;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes4.dex */
public class a {
public void a(List<String> list, MBSplashView mBSplashView, com.mbridge.msdk.splash.a.c cVar, com.mbridge.msdk.splash.b.a aVar) {
}
public final void a(MBSplashView mBSplashView, com.mbridge.msdk.splash.a.c cVar, com.mbridge.msdk.splash.b.a aVar) {
Context context = mBSplashView.getContext();
if (context == null) {
context = com.mbridge.msdk.foundation.controller.c.m().c();
}
if (cVar == null && aVar != null) {
aVar.a("The render parameters is unavailable.");
return;
}
String a = (cVar == null || cVar.c() == null) ? "" : o.a(cVar.c().getAdZip());
if (!TextUtils.isEmpty(a)) {
if (cVar == null || cVar.c() == null) {
return;
}
if (!TextUtils.isEmpty(cVar.c().getAdZip())) {
try {
ArrayList arrayList = new ArrayList();
arrayList.add(a);
a(arrayList, mBSplashView, cVar, aVar);
return;
} catch (Exception unused) {
}
}
a(context, mBSplashView, cVar, aVar);
return;
}
a(context, mBSplashView, cVar, aVar);
}
public final void a(Context context, MBSplashView mBSplashView, com.mbridge.msdk.splash.a.c cVar, com.mbridge.msdk.splash.b.a aVar) {
try {
MBSplashNativeView mBSplashNativeView = new MBSplashNativeView(context, mBSplashView, cVar);
if (aVar != null) {
aVar.a(mBSplashNativeView);
}
} catch (Throwable unused) {
if (aVar != null) {
aVar.a("View render error.");
}
}
}
}

View File

@@ -0,0 +1,781 @@
package com.mbridge.msdk.splash.c;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Base64;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.iab.omid.library.mmadbridge.adsession.AdEvents;
import com.iab.omid.library.mmadbridge.adsession.AdSession;
import com.mbridge.msdk.click.i;
import com.mbridge.msdk.foundation.db.j;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.entity.n;
import com.mbridge.msdk.foundation.same.report.h;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.aj;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.MBridgeIds;
import com.mbridge.msdk.splash.view.MBSplashView;
import com.mbridge.msdk.splash.view.MBSplashWebview;
import com.mbridge.msdk.widget.FeedBackButton;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class b {
protected MBSplashView b;
protected com.mbridge.msdk.splash.d.d c;
protected com.mbridge.msdk.click.a d;
protected String e;
protected MBridgeIds f;
protected String h;
protected String i;
protected String j;
protected String k;
protected boolean l;
protected Context m;
private CampaignEx q;
private boolean r;
private TextView s;
private View t;
private String u;
private boolean v;
private ImageView w;
private a x;
protected final String a = "SplashShowManager";
protected int g = 5;
protected boolean n = true;
private View.OnClickListener y = new View.OnClickListener() { // from class: com.mbridge.msdk.splash.c.b.1
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
if (b.this.r) {
b.this.b(1);
b.a(b.this, -1);
}
}
};
public Handler o = new Handler(Looper.getMainLooper()) { // from class: com.mbridge.msdk.splash.c.b.2
@Override // android.os.Handler
public final void handleMessage(@NonNull Message message) {
MBSplashView mBSplashView;
MBSplashWebview splashWebview;
super.handleMessage(message);
int i = message.what;
if (i != 1) {
if (i != 2 || b.this.q == null || !b.this.q.isActiveOm() || (mBSplashView = b.this.b) == null || (splashWebview = mBSplashView.getSplashWebview()) == null) {
return;
}
try {
AdSession adSession = splashWebview.getAdSession();
if (adSession != null) {
AdEvents createAdEvents = AdEvents.createAdEvents(adSession);
createAdEvents.loaded();
createAdEvents.impressionOccurred();
}
af.a("OMSDK", "adSession.impressionOccurred()");
return;
} catch (Throwable th) {
af.a("OMSDK", th.getMessage());
if (b.this.q != null) {
String requestId = b.this.q.getRequestId();
String requestIdNotice = b.this.q.getRequestIdNotice();
String id = b.this.q.getId();
new h(splashWebview.getContext()).a(requestId, requestIdNotice, id, b.this.e, "fetch OM failed, exception" + th.getMessage());
return;
}
return;
}
}
if (!b.this.v) {
b.this.f();
}
b bVar = b.this;
if (bVar.g > 0) {
if (!com.mbridge.msdk.foundation.d.b.c) {
b bVar2 = b.this;
if (!bVar2.l) {
int i2 = bVar2.g - 1;
bVar2.g = i2;
b.a(bVar2, i2);
b bVar3 = b.this;
if (!bVar3.n) {
bVar3.c();
}
b.this.o.removeMessages(1);
sendEmptyMessageDelayed(1, 1000L);
return;
}
}
b.this.d();
b.this.o.removeMessages(1);
sendEmptyMessageDelayed(1, 1000L);
return;
}
bVar.b(2);
}
};
protected i p = new i() { // from class: com.mbridge.msdk.splash.c.b.4
@Override // com.mbridge.msdk.out.BaseTrackingListener
public final void onStartRedirection(Campaign campaign, String str) {
aj.b(campaign, b.this.b);
}
@Override // com.mbridge.msdk.out.BaseTrackingListener
public final void onFinishRedirection(Campaign campaign, String str) {
if (campaign == null) {
return;
}
aj.a(campaign, b.this.b);
}
@Override // com.mbridge.msdk.out.BaseTrackingListener
public final void onRedirectionFailed(Campaign campaign, String str) {
if (campaign == null) {
return;
}
aj.a(campaign, b.this.b);
}
};
public final void a(int i) {
this.g = i;
}
public void a(CampaignEx campaignEx, boolean z, String str) {
}
public final void a(com.mbridge.msdk.splash.d.d dVar) {
this.c = dVar;
}
public final void a(boolean z) {
this.r = z;
if (z) {
this.h = this.i;
} else {
this.h = this.k;
}
}
public b(Context context, String str, String str2) {
this.h = "点击跳过|";
this.i = "点击跳过|";
this.j = "";
this.k = "秒后自动关闭";
this.e = str2;
this.u = str;
this.f = new MBridgeIds(str, str2);
this.m = context;
if (this.s == null) {
TextView textView = new TextView(context);
this.s = textView;
textView.setGravity(1);
this.s.setTextIsSelectable(false);
this.s.setPadding(ak.a(context, 5.0f), ak.a(context, 5.0f), ak.a(context, 5.0f), ak.a(context, 5.0f));
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.s.getLayoutParams();
this.s.setLayoutParams(layoutParams == null ? new RelativeLayout.LayoutParams(ak.a(context, 100.0f), ak.a(context, 50.0f)) : layoutParams);
Context c = com.mbridge.msdk.foundation.controller.c.m().c();
if (c != null) {
String g = com.mbridge.msdk.foundation.controller.c.m().g();
int identifier = c.getResources().getIdentifier("mbridge_splash_count_time_can_skip", "string", g);
int identifier2 = c.getResources().getIdentifier("mbridge_splash_count_time_can_skip_not", "string", g);
int identifier3 = c.getResources().getIdentifier("mbridge_splash_count_time_can_skip_s", "string", g);
this.i = c.getResources().getString(identifier);
String string = c.getResources().getString(identifier2);
this.k = string;
this.h = string;
this.j = c.getResources().getString(identifier3);
this.s.setBackgroundResource(c.getResources().getIdentifier("mbridge_splash_close_bg", "drawable", com.mbridge.msdk.foundation.controller.c.m().g()));
this.s.setTextColor(c.getResources().getColor(c.getResources().getIdentifier("mbridge_splash_count_time_skip_text_color", "color", g)));
}
}
}
public final void a(ViewGroup viewGroup) {
if (viewGroup != null) {
viewGroup.setOnClickListener(this.y);
}
this.t = viewGroup;
}
public class a implements com.mbridge.msdk.splash.d.a {
private a() {
}
@Override // com.mbridge.msdk.splash.d.a
public final void a(int i) {
MBSplashView mBSplashView = b.this.b;
if (mBSplashView != null) {
mBSplashView.changeCloseBtnState(i);
}
}
@Override // com.mbridge.msdk.splash.d.a
public final void a(Object obj, String str) {
b.this.b(1);
}
@Override // com.mbridge.msdk.splash.d.a
public final void a(CampaignEx campaignEx) {
b.this.a(campaignEx, false, "");
}
@Override // com.mbridge.msdk.splash.d.a
public final void b(int i) {
af.b("SplashShowManager", "resetCountdown" + i);
b bVar = b.this;
bVar.g = i;
bVar.o.removeMessages(1);
b.this.o.sendEmptyMessageDelayed(1, 1000L);
}
@Override // com.mbridge.msdk.splash.d.a
public final void a() {
b.this.b(1);
}
@Override // com.mbridge.msdk.splash.d.a
public final void a(boolean z) {
if (z) {
b.this.o.removeMessages(1);
}
}
@Override // com.mbridge.msdk.splash.d.a
public final void a(boolean z, String str) {
try {
if (b.this.c != null) {
if (TextUtils.isEmpty(str)) {
b bVar = b.this;
bVar.c.b(bVar.f);
} else {
CampaignEx parseCampaignWithBackData = CampaignEx.parseCampaignWithBackData(CampaignEx.campaignToJsonObject(b.this.q));
parseCampaignWithBackData.setClickURL(str);
b.this.a(parseCampaignWithBackData, true, str);
}
}
} catch (Exception e) {
af.b("SplashShowManager", e.getMessage());
}
}
@Override // com.mbridge.msdk.splash.d.a
public final void a(int i, int i2) {
if (i == 1) {
b.this.o.removeMessages(1);
}
if (i == 2) {
b bVar = b.this;
bVar.g = i2;
bVar.o.removeMessages(1);
b.this.o.sendEmptyMessageDelayed(1, 1000L);
}
}
}
/* JADX WARN: Multi-variable type inference failed */
public final void a(CampaignEx campaignEx, MBSplashView mBSplashView) {
MBSplashView mBSplashView2;
MBSplashView mBSplashView3;
Context context;
MBSplashWebview splashWebview;
a(this.r);
this.q = campaignEx;
this.b = mBSplashView;
com.mbridge.msdk.splash.signal.c splashSignalCommunicationImpl = mBSplashView.getSplashSignalCommunicationImpl();
if (splashSignalCommunicationImpl == null) {
splashSignalCommunicationImpl = new com.mbridge.msdk.splash.signal.c(mBSplashView.getContext(), this.u, this.e);
ArrayList arrayList = new ArrayList();
arrayList.add(campaignEx);
splashSignalCommunicationImpl.a(arrayList);
}
splashSignalCommunicationImpl.b(this.g);
splashSignalCommunicationImpl.a(this.r ? 1 : 0);
RelativeLayout.LayoutParams layoutParams = null;
Object[] objArr = 0;
if (this.x == null) {
this.x = new a();
}
splashSignalCommunicationImpl.a(this.x);
mBSplashView.setSplashSignalCommunicationImpl(splashSignalCommunicationImpl);
boolean isHasMBTplMark = campaignEx.isHasMBTplMark();
View view = this.t;
if (view == null) {
if (isHasMBTplMark) {
this.s.setVisibility(8);
}
g();
a(this.s);
mBSplashView.setCloseView(this.s);
} else {
if (isHasMBTplMark) {
view.setVisibility(8);
}
a(this.t);
mBSplashView.setCloseView(this.t);
}
mBSplashView.show();
CampaignEx campaignEx2 = this.q;
if (campaignEx2 != null && campaignEx2.isActiveOm() && (splashWebview = mBSplashView.getSplashWebview()) != null) {
try {
AdSession a2 = com.mbridge.msdk.a.b.a(com.mbridge.msdk.foundation.controller.c.m().c(), splashWebview, splashWebview.getUrl(), this.q);
if (a2 != null) {
splashWebview.setAdSession(a2);
a2.registerAdView(splashWebview);
a2.start();
}
af.a("OMSDK", "adSession.start()");
} catch (Throwable th) {
af.a("OMSDK", th.getMessage());
CampaignEx campaignEx3 = this.q;
if (campaignEx3 != null) {
String requestId = campaignEx3.getRequestId();
String requestIdNotice = this.q.getRequestIdNotice();
String id = this.q.getId();
new h(splashWebview.getContext()).a(requestId, requestIdNotice, id, this.e, "fetch OM failed, exception" + th.getMessage());
}
}
}
d.a(this.e);
this.o.removeMessages(1);
this.o.sendEmptyMessageDelayed(1, 1000L);
this.o.sendEmptyMessageDelayed(2, 1000L);
CampaignEx campaignEx4 = this.q;
if (campaignEx4 != null && campaignEx4.getPrivacyButtonTemplateVisibility() == 1 && (mBSplashView3 = this.b) != null && mBSplashView3.getSplashWebview() != null && !this.b.isDynamicView() && this.q.isMraid() && (context = this.b.getContext()) != null) {
try {
int a3 = x.a(context, "mbridge_splash_notice", "drawable");
int a4 = ak.a(context, 35.0f);
int a5 = ak.a(context, 9.0f);
ImageView imageView = new ImageView(context);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(a4, a4);
layoutParams2.addRule(9);
layoutParams2.addRule(10);
layoutParams2.setMargins(a5, a5, a5, a5);
imageView.setScaleType(ImageView.ScaleType.CENTER);
imageView.setBackgroundResource(a3);
ak.a(3, imageView, this.q, context, true, new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.splash.c.b.7
@Override // com.mbridge.msdk.foundation.d.a
public final void showed() {
b.this.d();
}
@Override // com.mbridge.msdk.foundation.d.a
public final void close() {
b.this.c();
}
@Override // com.mbridge.msdk.foundation.d.a
public final void summit(String str) {
b.this.c();
}
});
this.b.addView(imageView);
} catch (Throwable th2) {
af.b("SplashShowManager", th2.getMessage());
}
}
if (!this.q.isMraid()) {
CampaignEx campaignEx5 = this.q;
if (campaignEx5 != null) {
campaignEx5.setCampaignUnitId(this.e);
com.mbridge.msdk.foundation.d.b.a().a(this.e, 3);
com.mbridge.msdk.foundation.d.b.a().a(this.e, this.q);
}
if (com.mbridge.msdk.foundation.d.b.a().b() && ((mBSplashView2 = this.b) == null || !mBSplashView2.isDynamicView())) {
com.mbridge.msdk.foundation.d.b.a().a(this.e, new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.splash.c.b.3
@Override // com.mbridge.msdk.foundation.d.a
public final void showed() {
String str;
b.this.d();
try {
JSONObject jSONObject = new JSONObject();
if (com.mbridge.msdk.foundation.controller.c.m().c() != null) {
jSONObject.put("status", 1);
}
str = jSONObject.toString();
} catch (Throwable th3) {
af.b("SplashShowManager", th3.getMessage(), th3);
str = "";
}
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a((WebView) b.this.b.getSplashWebview(), "onFeedbackAlertStatusNotify", Base64.encodeToString(str.getBytes(), 2));
}
@Override // com.mbridge.msdk.foundation.d.a
public final void close() {
String str;
b.this.c();
try {
JSONObject jSONObject = new JSONObject();
if (com.mbridge.msdk.foundation.controller.c.m().c() != null) {
jSONObject.put("status", 2);
}
str = jSONObject.toString();
} catch (Throwable th3) {
af.b("SplashShowManager", th3.getMessage(), th3);
str = "";
}
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a((WebView) b.this.b.getSplashWebview(), "onFeedbackAlertStatusNotify", Base64.encodeToString(str.getBytes(), 2));
}
@Override // com.mbridge.msdk.foundation.d.a
public final void summit(String str) {
String str2;
b.this.c();
try {
JSONObject jSONObject = new JSONObject();
if (com.mbridge.msdk.foundation.controller.c.m().c() != null) {
jSONObject.put("status", 2);
}
str2 = jSONObject.toString();
} catch (Throwable th3) {
af.b("SplashShowManager", th3.getMessage(), th3);
str2 = "";
}
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a((WebView) b.this.b.getSplashWebview(), "onFeedbackAlertStatusNotify", Base64.encodeToString(str2.getBytes(), 2));
}
});
FeedBackButton b = com.mbridge.msdk.foundation.d.b.a().b(this.e);
if (b != null) {
try {
layoutParams = (RelativeLayout.LayoutParams) b.getLayoutParams();
} catch (Exception e) {
e.printStackTrace();
}
if (layoutParams == null) {
layoutParams = new RelativeLayout.LayoutParams(com.mbridge.msdk.foundation.d.b.b, com.mbridge.msdk.foundation.d.b.a);
}
layoutParams.topMargin = ak.a(com.mbridge.msdk.foundation.controller.c.m().c(), 10.0f);
layoutParams.leftMargin = ak.a(com.mbridge.msdk.foundation.controller.c.m().c(), 10.0f);
ViewGroup viewGroup = (ViewGroup) b.getParent();
if (viewGroup != null) {
viewGroup.removeView(b);
}
MBSplashView mBSplashView4 = this.b;
if (mBSplashView4 != null) {
mBSplashView4.addView(b, layoutParams);
}
}
}
}
com.mbridge.msdk.click.c.a(com.mbridge.msdk.foundation.controller.c.m().c(), this.q.getMaitve(), this.q.getMaitve_src());
try {
BitmapDrawable a6 = com.mbridge.msdk.foundation.controller.c.m().a(this.e, this.q.getAdType());
if (a6 != null) {
if (this.w == null) {
this.w = new ImageView(com.mbridge.msdk.foundation.controller.c.m().c());
}
if (this.w.getVisibility() != 0) {
this.w.setVisibility(0);
}
ak.a(this.w, a6, mBSplashView.getResources().getDisplayMetrics());
if (this.w.getParent() == null) {
mBSplashView.addView(this.w, new ViewGroup.LayoutParams(-1, -1));
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
public final String a() {
CampaignEx campaignEx = this.q;
return (campaignEx == null || campaignEx.getRequestId() == null) ? "" : this.q.getRequestId();
}
public final String b() {
ArrayList arrayList = new ArrayList();
CampaignEx campaignEx = this.q;
if (campaignEx != null) {
arrayList.add(campaignEx);
}
return com.mbridge.msdk.foundation.same.c.a(arrayList);
}
/* JADX INFO: Access modifiers changed from: private */
public synchronized void f() {
MBSplashView mBSplashView;
if (this.q == null) {
return;
}
this.v = true;
if (this.c != null && (mBSplashView = this.b) != null) {
if (mBSplashView.getContext() != null && (this.b.getContext() instanceof Activity) && ((Activity) this.b.getContext()).isFinishing()) {
this.c.a(this.f, "Activity is finishing");
return;
} else if (this.b.isShown()) {
this.c.a(this.f);
} else {
this.c.a(this.f, "SplashView or container is not visibility");
}
}
if (!this.q.isReport()) {
MBSplashView mBSplashView2 = this.b;
if (mBSplashView2 != null && !mBSplashView2.isDynamicView()) {
CampaignEx campaignEx = this.q;
if (!campaignEx.isHasMBTplMark()) {
c(campaignEx, com.mbridge.msdk.foundation.controller.c.m().c(), this.e);
campaignEx.setReport(true);
com.mbridge.msdk.foundation.same.a.b.a(this.e, campaignEx, "splash");
b(campaignEx, com.mbridge.msdk.foundation.controller.c.m().c(), this.e);
a(campaignEx, com.mbridge.msdk.foundation.controller.c.m().c(), this.e);
}
} else {
CampaignEx campaignEx2 = this.q;
b(campaignEx2, com.mbridge.msdk.foundation.controller.c.m().c(), this.e);
c(campaignEx2, com.mbridge.msdk.foundation.controller.c.m().c(), this.e);
a(campaignEx2, com.mbridge.msdk.foundation.controller.c.m().c(), this.e);
campaignEx2.setReport(true);
com.mbridge.msdk.foundation.same.a.b.a(this.e, campaignEx2, "splash");
}
Context c = com.mbridge.msdk.foundation.controller.c.m().c();
CampaignEx campaignEx3 = this.q;
String str = this.e;
if (campaignEx3 != null) {
try {
if (campaignEx3.isMraid()) {
n nVar = new n();
nVar.f(campaignEx3.getRequestId());
nVar.g(campaignEx3.getRequestIdNotice());
nVar.e(campaignEx3.getId());
nVar.d(campaignEx3.isMraid() ? n.a : n.b);
com.mbridge.msdk.foundation.same.report.g.d(nVar, c.getApplicationContext(), str);
}
} catch (Exception e) {
af.b("SplashReport", e.getMessage());
}
}
}
}
public final void b(CampaignEx campaignEx, boolean z, String str) {
if (this.d == null) {
com.mbridge.msdk.click.a aVar = new com.mbridge.msdk.click.a(com.mbridge.msdk.foundation.controller.c.m().c(), this.e);
this.d = aVar;
aVar.a(this.p);
}
campaignEx.setCampaignUnitId(this.e);
this.d.a(campaignEx);
if (!this.q.isReportClick()) {
this.q.setReportClick(true);
com.mbridge.msdk.splash.e.a.a(com.mbridge.msdk.foundation.controller.c.m().c(), campaignEx);
}
com.mbridge.msdk.splash.d.d dVar = this.c;
if (dVar != null) {
dVar.b(this.f);
b(3);
}
if (!z || TextUtils.isEmpty(str)) {
return;
}
String str2 = this.e;
try {
if (TextUtils.isEmpty(str) || !campaignEx.isMraid()) {
return;
}
new h(com.mbridge.msdk.foundation.controller.c.m().c()).a(campaignEx.getRequestId(), campaignEx.getRequestIdNotice(), campaignEx.getId(), str2, str, campaignEx.isBidCampaign());
} catch (Exception e) {
af.b("SplashReport", e.getMessage());
}
}
private void g() {
String str;
if (this.r) {
str = this.i + this.g + this.j;
} else {
str = this.g + this.k;
}
this.s.setText(str);
}
private void a(View view) {
if (view != null) {
view.setOnClickListener(this.y);
}
}
public final void b(final int i) {
CampaignEx campaignEx;
MBSplashWebview splashWebview;
MBSplashView mBSplashView = this.b;
if (mBSplashView != null && (splashWebview = mBSplashView.getSplashWebview()) != null) {
splashWebview.finishAdSession();
}
if (this.o != null && (campaignEx = this.q) != null && campaignEx.isActiveOm()) {
this.o.postDelayed(new Runnable() { // from class: com.mbridge.msdk.splash.c.b.5
@Override // java.lang.Runnable
public final void run() {
b.this.c(i);
}
}, 1500L);
} else {
c(i);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void c(int i) {
MBSplashView mBSplashView;
try {
com.mbridge.msdk.splash.d.d dVar = this.c;
if (dVar != null) {
dVar.a(this.f, i);
this.c = null;
com.mbridge.msdk.splash.e.a.a(this.e, this.q);
}
ImageView imageView = this.w;
if (imageView != null && imageView.getParent() != null && (mBSplashView = this.b) != null) {
mBSplashView.removeView(this.w);
this.w.setVisibility(8);
}
this.v = false;
com.mbridge.msdk.splash.e.a.a(this.e, i, this.q);
Handler handler = this.o;
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
} catch (Exception e) {
af.b("SplashShowManager", e.getMessage());
}
}
private void a(CampaignEx campaignEx, Context context, String str) {
if (campaignEx != null) {
try {
List<String> pv_urls = campaignEx.getPv_urls();
if (pv_urls == null || pv_urls.size() <= 0) {
return;
}
Iterator<String> it = pv_urls.iterator();
while (it.hasNext()) {
com.mbridge.msdk.click.a.a(context, campaignEx, str, it.next(), false, true);
}
} catch (Throwable th) {
af.b("SplashShowManager", th.getMessage());
}
}
}
private void b(CampaignEx campaignEx, Context context, String str) {
if (campaignEx != null) {
try {
if (TextUtils.isEmpty(campaignEx.getOnlyImpressionURL())) {
return;
}
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getOnlyImpressionURL(), false, true, com.mbridge.msdk.click.a.a.h);
} catch (Throwable th) {
af.b("SplashShowManager", th.getMessage());
}
}
}
private void c(final CampaignEx campaignEx, final Context context, String str) {
com.mbridge.msdk.foundation.controller.c.m().a(context);
if (!TextUtils.isEmpty(campaignEx.getImpressionURL())) {
new Thread(new Runnable() { // from class: com.mbridge.msdk.splash.c.b.6
@Override // java.lang.Runnable
public final void run() {
try {
j.a(com.mbridge.msdk.foundation.db.g.a(context)).a(campaignEx.getId());
} catch (Exception unused) {
af.b("SplashShowManager", "campain can't insert db");
}
}
}).start();
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getImpressionURL(), false, true, com.mbridge.msdk.click.a.a.g);
}
if (TextUtils.isEmpty(str) || campaignEx.getNativeVideoTracking() == null || campaignEx.getNativeVideoTracking().p() == null) {
return;
}
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getNativeVideoTracking().p(), false, false);
}
public final void c() {
MBSplashView mBSplashView;
Handler handler;
this.n = true;
if (this.b != null && this.g > 0 && (handler = this.o) != null) {
handler.removeMessages(1);
this.o.sendEmptyMessageDelayed(1, 1000L);
}
if (com.mbridge.msdk.foundation.d.b.c || (mBSplashView = this.b) == null) {
return;
}
mBSplashView.onResume();
MBSplashWebview splashWebview = this.b.getSplashWebview();
if (splashWebview == null || splashWebview.isDestoryed()) {
return;
}
com.mbridge.msdk.splash.signal.d.a(splashWebview, "onSystemPause", "");
}
public final void d() {
Handler handler;
this.n = false;
if (this.b != null && this.g > 0 && (handler = this.o) != null) {
handler.removeMessages(1);
}
MBSplashView mBSplashView = this.b;
if (mBSplashView != null) {
mBSplashView.onPause();
MBSplashWebview splashWebview = this.b.getSplashWebview();
if (splashWebview == null || splashWebview.isDestoryed()) {
return;
}
com.mbridge.msdk.splash.signal.d.a(splashWebview, "onSystemPause", "");
}
}
public final void e() {
if (this.c != null) {
this.c = null;
}
if (this.x != null) {
this.x = null;
}
if (this.y != null) {
this.y = null;
}
MBSplashView mBSplashView = this.b;
if (mBSplashView != null) {
mBSplashView.destroy();
}
com.mbridge.msdk.foundation.d.b.a().c(this.e);
}
public static /* synthetic */ void a(b bVar, int i) {
MBSplashView mBSplashView = bVar.b;
if (mBSplashView != null) {
mBSplashView.updateCountdown(i);
if (bVar.b.getSplashSignalCommunicationImpl() != null) {
bVar.b.getSplashSignalCommunicationImpl().c(i);
}
}
if (i < 0) {
bVar.g = i;
return;
}
com.mbridge.msdk.splash.d.d dVar = bVar.c;
if (dVar != null) {
dVar.a(bVar.f, i * 1000);
}
if (bVar.t == null) {
bVar.g();
}
}
}

View File

@@ -0,0 +1,197 @@
package com.mbridge.msdk.splash.c;
import android.content.Context;
import android.view.View;
import com.mbridge.msdk.c.h;
import com.mbridge.msdk.dycreator.binding.response.SplashResData;
import com.mbridge.msdk.dycreator.binding.response.base.BaseRespData;
import com.mbridge.msdk.dycreator.bridge.MBSplashData;
import com.mbridge.msdk.dycreator.listener.DyCountDownListener;
import com.mbridge.msdk.dycreator.listener.action.EAction;
import com.mbridge.msdk.dycreator.wrapper.DyAdType;
import com.mbridge.msdk.dycreator.wrapper.DyOption;
import com.mbridge.msdk.dycreator.wrapper.DynamicViewBackListener;
import com.mbridge.msdk.dycreator.wrapper.DynamicViewCreator;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.splash.view.MBSplashView;
import java.util.List;
/* loaded from: classes4.dex */
final class c extends com.mbridge.msdk.splash.c.a {
public static class a {
private static final c a = new c();
}
private c() {
}
@Override // com.mbridge.msdk.splash.c.a
public final void a(List<String> list, final MBSplashView mBSplashView, final com.mbridge.msdk.splash.a.c cVar, final com.mbridge.msdk.splash.b.a aVar) {
h.a().b(com.mbridge.msdk.foundation.controller.c.m().k());
final DyOption build = new DyOption.Builder().campaignEx(cVar.c()).fileDirs(list).dyAdType(DyAdType.SPLASH).canSkip(cVar.d()).isScreenClick(cVar.g() == 1).isClickButtonVisible(cVar.f() == 0).isShakeVisible(cVar.i() == 1).isApkInfoVisible(cVar.h() == 0).isLogoVisible(cVar.m() == 1).shakeStrenght(cVar.j()).shakeTime(cVar.k()).orientation(cVar.l()).countDownTime(cVar.e()).adChoiceLink(ak.a(cVar.c())).build();
mBSplashView.setDyCountDownListener(new DyCountDownListener() { // from class: com.mbridge.msdk.splash.c.c.1
@Override // com.mbridge.msdk.dycreator.listener.DyCountDownListener
public final void getCountDownValue(int i) {
build.setDyCountDownListener(i);
}
});
DynamicViewCreator.getInstance().createDynamicView(build, new DynamicViewBackListener() { // from class: com.mbridge.msdk.splash.c.c.2
@Override // com.mbridge.msdk.dycreator.wrapper.DynamicViewBackListener
public final void viewCreatedSuccess(View view) {
com.mbridge.msdk.splash.b.a aVar2 = aVar;
if (aVar2 != null) {
if (view != null) {
aVar2.a(view);
} else {
aVar2.a("View render error.");
}
}
}
@Override // com.mbridge.msdk.dycreator.wrapper.DynamicViewBackListener
public final void viewCreateFail(com.mbridge.msdk.dycreator.b.a aVar2) {
MBSplashView mBSplashView2 = mBSplashView;
if (mBSplashView2 != null) {
Context context = mBSplashView2.getContext();
if (context == null) {
context = com.mbridge.msdk.foundation.controller.c.m().c();
}
c.this.a(context, mBSplashView, cVar, aVar);
}
}
@Override // com.mbridge.msdk.dycreator.wrapper.DynamicViewBackListener
public final void viewClicked(BaseRespData baseRespData) {
float f;
float f2;
com.mbridge.msdk.splash.signal.c splashSignalCommunicationImpl;
MBSplashView mBSplashView2 = mBSplashView;
final com.mbridge.msdk.splash.d.a a2 = (mBSplashView2 == null || (splashSignalCommunicationImpl = mBSplashView2.getSplashSignalCommunicationImpl()) == null) ? null : splashSignalCommunicationImpl.a();
DyOption dyOption = build;
CampaignEx campaignEx = dyOption != null ? dyOption.getCampaignEx() : null;
EAction eAction = baseRespData instanceof SplashResData ? ((SplashResData) baseRespData).geteAction() : null;
if (eAction != null) {
int i = AnonymousClass3.a[eAction.ordinal()];
if (i == 1) {
if (a2 != null) {
if (baseRespData != null) {
if (baseRespData instanceof SplashResData) {
SplashResData splashResData = (SplashResData) baseRespData;
if (splashResData.getBaseViewData() != null) {
com.mbridge.msdk.dycreator.f.a.a baseViewData = splashResData.getBaseViewData();
if (baseViewData == null || !(baseViewData instanceof MBSplashData)) {
f = 0.0f;
f2 = 0.0f;
} else {
MBSplashData mBSplashData = (MBSplashData) baseViewData;
f = mBSplashData.getxInScreen();
float f3 = mBSplashData.getyInScreen();
r3 = mBSplashData.getClickType();
f2 = f3;
}
try {
a2.a(com.mbridge.msdk.splash.a.a.a.a(com.mbridge.msdk.splash.a.a.a.a(r3, f, f2), campaignEx));
return;
} catch (Throwable th) {
th.printStackTrace();
a2.a(campaignEx);
return;
}
}
return;
}
return;
}
a2.a(campaignEx);
return;
}
return;
}
if (i == 2) {
if (a2 != null) {
a2.a();
return;
}
return;
}
if (i == 3) {
if (build != null) {
com.mbridge.msdk.click.c.f(com.mbridge.msdk.foundation.controller.c.m().c(), build.getAdChoiceLink());
return;
}
return;
}
if (i == 4 && baseRespData != null && (baseRespData instanceof SplashResData)) {
SplashResData splashResData2 = (SplashResData) baseRespData;
if (splashResData2.getBaseViewData() != null) {
com.mbridge.msdk.dycreator.f.a.a baseViewData2 = splashResData2.getBaseViewData();
final c cVar2 = c.this;
if (campaignEx != null) {
String campaignUnitId = campaignEx.getCampaignUnitId();
String requestId = campaignEx.getRequestId();
r3 = baseViewData2 != null ? baseViewData2.getEffectData().getCurrentCountDown() : 0;
a2.a(1, r3);
com.mbridge.msdk.foundation.d.a.a a3 = com.mbridge.msdk.foundation.d.b.a().a(campaignUnitId + "_" + requestId);
if (a3 != null) {
a3.a(campaignEx);
com.mbridge.msdk.foundation.d.b.a().a(campaignUnitId + "_" + requestId, new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.splash.c.a.1
final /* synthetic */ com.mbridge.msdk.splash.d.a a;
final /* synthetic */ int b;
@Override // com.mbridge.msdk.foundation.d.a
public final void showed() {
}
public AnonymousClass1(final com.mbridge.msdk.splash.d.a a22, final int i2) {
r2 = a22;
r3 = i2;
}
@Override // com.mbridge.msdk.foundation.d.a
public final void close() {
r2.a(2, r3);
}
@Override // com.mbridge.msdk.foundation.d.a
public final void summit(String str) {
r2.a(2, r3);
}
});
a3.e();
}
}
}
}
}
}
});
}
/* renamed from: com.mbridge.msdk.splash.c.c$3, reason: invalid class name */
public static /* synthetic */ class AnonymousClass3 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[EAction.values().length];
a = iArr;
try {
iArr[EAction.DOWNLOAD.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[EAction.CLOSE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[EAction.NOTICE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[EAction.FEEDBACK.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
}

View File

@@ -0,0 +1,253 @@
package com.mbridge.msdk.splash.c;
import android.graphics.Bitmap;
import android.text.TextUtils;
import com.mbridge.msdk.c.h;
import com.mbridge.msdk.c.i;
import com.mbridge.msdk.foundation.download.download.H5DownLoadManager;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.splash.c.g;
import com.mbridge.msdk.splash.view.MBSplashView;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/* loaded from: classes4.dex */
public final class d {
public static com.mbridge.msdk.foundation.db.e a = com.mbridge.msdk.foundation.db.e.a(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.c.m().c()));
private static String b = "ResManager";
private static int c = 1;
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(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.c.m().c()));
}
com.mbridge.msdk.c.g b2 = h.a().b(com.mbridge.msdk.foundation.controller.c.m().k());
if (b2 == null) {
h.a();
b2 = i.a();
}
long ac = b2.ac() * 1000;
long ad = b2.ad() * 1000;
if (a == null) {
a = com.mbridge.msdk.foundation.db.e.a(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.c.m().c()));
}
a.b(ad, 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 - ac;
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);
}
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;
}
if (a(mBSplashView, campaignEx, str, str2, z, i, z3) && campaignEx.isSpareOffer(ac, ad)) {
return a(campaignEx);
}
return null;
}
private static CampaignEx a(CampaignEx campaignEx) {
if (!TextUtils.isEmpty(campaignEx.getAdZip()) || (!TextUtils.isEmpty(campaignEx.getAdHtml()) && campaignEx.getAdHtml().contains("<MBTPLMARK>"))) {
campaignEx.setHasMBTplMark(true);
campaignEx.setIsMraid(false);
} else {
campaignEx.setHasMBTplMark(false);
campaignEx.setIsMraid(true);
}
return campaignEx;
}
private static boolean a(MBSplashView mBSplashView, CampaignEx campaignEx, String str, String str2, boolean z, int i, boolean z2) {
boolean z3;
if (campaignEx == null) {
return false;
}
mBSplashView.clearResState();
if (TextUtils.isEmpty(campaignEx.getVideoUrlEncode())) {
z3 = true;
} else {
boolean z4 = mBSplashView.isVideoReady() || com.mbridge.msdk.videocommon.download.b.getInstance().a(297, str2, campaignEx.isBidCampaign());
if (!z4) {
a(mBSplashView, campaignEx, str2);
} else {
mBSplashView.setVideoReady(true);
}
z3 = z4;
}
if (!TextUtils.isEmpty(campaignEx.getAdZip()) && !mBSplashView.isH5Ready()) {
String h5ResAddress = H5DownLoadManager.getInstance().getH5ResAddress(campaignEx.getAdZip());
if (TextUtils.isEmpty(h5ResAddress)) {
z3 = false;
} else if (!z2) {
a(mBSplashView, h5ResAddress, campaignEx, str, str2, z, i);
}
}
if (TextUtils.isEmpty(campaignEx.getAdZip()) && !TextUtils.isEmpty(campaignEx.getAdHtml()) && !mBSplashView.isH5Ready()) {
String b2 = b(campaignEx.getAdHtml());
if (TextUtils.isEmpty(b2)) {
z3 = false;
} else if (!z2) {
a(mBSplashView, b2, campaignEx, str, str2, z, i);
}
}
if (campaignEx.isDynamicView()) {
if (TextUtils.isEmpty(campaignEx.getImageUrl()) || mBSplashView.isImageReady()) {
return false;
}
if (!com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.c.m().c()).b(campaignEx.getImageUrl())) {
a(mBSplashView, campaignEx, (com.mbridge.msdk.splash.view.nativeview.a) null);
} else {
mBSplashView.setImageReady(true);
return true;
}
}
return z3;
}
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() { // from class: com.mbridge.msdk.splash.c.d.1
@Override // com.mbridge.msdk.videocommon.listener.a
public final void a(String str2) {
MBSplashView.this.setVideoReady(true);
}
@Override // com.mbridge.msdk.videocommon.listener.a
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.b.getInstance().createUnitCache(com.mbridge.msdk.foundation.controller.c.m().c(), str, copyOnWriteArrayList, 297, aVar);
if (!com.mbridge.msdk.videocommon.download.b.getInstance().a(297, str, campaignEx.isBidCampaign())) {
com.mbridge.msdk.videocommon.download.b.getInstance().load(str);
} else {
mBSplashView.setVideoReady(true);
}
}
public static void a(final MBSplashView mBSplashView, CampaignEx campaignEx, final com.mbridge.msdk.splash.view.nativeview.a aVar) {
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.c.m().c()).a(campaignEx.getImageUrl(), new com.mbridge.msdk.foundation.same.c.c() { // from class: com.mbridge.msdk.splash.c.d.2
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onSuccessLoad(Bitmap bitmap, String str) {
com.mbridge.msdk.splash.view.nativeview.a aVar2 = com.mbridge.msdk.splash.view.nativeview.a.this;
if (aVar2 != null) {
aVar2.a();
}
MBSplashView mBSplashView2 = mBSplashView;
if (mBSplashView2 != null) {
mBSplashView2.setImageReady(true);
}
}
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onFailedLoad(String str, String str2) {
com.mbridge.msdk.splash.view.nativeview.a aVar2 = com.mbridge.msdk.splash.view.nativeview.a.this;
if (aVar2 != null) {
aVar2.b();
}
MBSplashView mBSplashView2 = mBSplashView;
if (mBSplashView2 != null) {
mBSplashView2.setImageReady(false);
}
}
});
if (TextUtils.isEmpty(campaignEx.getIconUrl())) {
return;
}
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.c.m().c()).a(campaignEx.getIconUrl(), new com.mbridge.msdk.foundation.same.c.c() { // from class: com.mbridge.msdk.splash.c.d.3
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onFailedLoad(String str, String str2) {
}
@Override // com.mbridge.msdk.foundation.same.c.c
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) {
g gVar;
g.c cVar = new g.c();
cVar.c(str3);
cVar.b(str2);
cVar.a(campaignEx);
cVar.a(str);
cVar.a(z);
cVar.a(i);
gVar = g.a.a;
gVar.a(mBSplashView, cVar, null);
}
private static String b(String str) {
try {
File file = new File(str);
if (!file.exists()) {
return "";
}
return "file:///" + file.getAbsolutePath();
} catch (Throwable th) {
try {
throw th;
} catch (Exception e) {
e.getMessage();
return "";
}
}
}
public static boolean a(MBSplashView mBSplashView, CampaignEx campaignEx) {
if (mBSplashView == null) {
return false;
}
boolean isVideoReady = !TextUtils.isEmpty(campaignEx.getVideoUrlEncode()) ? mBSplashView.isVideoReady() : true;
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()) {
return isVideoReady;
}
if (TextUtils.isEmpty(campaignEx.getImageUrl())) {
return false;
}
return mBSplashView.isImageReady();
}
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(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.c.m().c()));
}
a.b(arrayList, str);
}
public static void a(String str) {
if (a == null) {
a = com.mbridge.msdk.foundation.db.e.a(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.c.m().c()));
}
a.a(str, 0, c);
}
}

View File

@@ -0,0 +1,800 @@
package com.mbridge.msdk.splash.c;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.work.WorkRequest;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.c.k;
import com.mbridge.msdk.foundation.db.j;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.download.H5DownLoadManager;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.entity.CampaignUnit;
import com.mbridge.msdk.foundation.same.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.ap;
import com.mbridge.msdk.foundation.tools.n;
import com.mbridge.msdk.foundation.tools.o;
import com.mbridge.msdk.out.MBridgeIds;
import com.mbridge.msdk.splash.a.c;
import com.mbridge.msdk.splash.c.c;
import com.mbridge.msdk.splash.c.g;
import com.mbridge.msdk.splash.view.MBSplashView;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/* loaded from: classes4.dex */
public final class e {
private static String a = "SplashLoadManager";
private String b;
private String c;
private long d;
private long e;
private com.mbridge.msdk.splash.d.b f;
private MBSplashView h;
private k i;
private boolean j;
private int k;
private int l;
private int m;
private String n;
private int o;
private boolean p;
private volatile boolean q;
private com.mbridge.msdk.videocommon.listener.a r;
private H5DownLoadManager.ZipDownloadListener s;
private String t;
private int u;
private int w;
private List<CampaignEx> x;
private String v = "";
private String y = "";
private Handler z = new Handler(Looper.getMainLooper()) { // from class: com.mbridge.msdk.splash.c.e.1
@Override // android.os.Handler
public final void handleMessage(@NonNull Message message) {
super.handleMessage(message);
int i = message.what;
if (i == 1) {
Object obj = message.obj;
int i2 = message.arg1;
if (obj instanceof CampaignEx) {
CampaignEx campaignEx = (CampaignEx) obj;
e.this.a(H5DownLoadManager.getInstance().getH5ResAddress(campaignEx.getAdZip()), campaignEx, i2);
return;
}
return;
}
if (i != 2) {
if (i != 3) {
return;
}
Object obj2 = message.obj;
if (obj2 instanceof CampaignEx) {
e eVar = e.this;
eVar.b((CampaignEx) obj2, eVar.o);
return;
}
return;
}
Object obj3 = message.obj;
try {
if (obj3 instanceof Bundle) {
int i3 = ((Bundle) obj3).getInt("type");
String string = ((Bundle) obj3).getString("msg");
CampaignEx campaignEx2 = (CampaignEx) ((Bundle) obj3).getSerializable("campaignex");
com.mbridge.msdk.foundation.c.b bVar = new com.mbridge.msdk.foundation.c.b(i3 == 1 ? 880004 : i3 == 2 ? 880006 : 880027);
bVar.a(string);
e eVar2 = e.this;
eVar2.a(bVar, eVar2.n, e.this.o, campaignEx2);
}
} catch (Exception e) {
com.mbridge.msdk.foundation.c.b bVar2 = new com.mbridge.msdk.foundation.c.b(880024);
bVar2.a((Throwable) e);
e eVar3 = e.this;
eVar3.a(bVar2, eVar3.n, e.this.o, (CampaignEx) null);
}
}
};
private Runnable A = new Runnable() { // from class: com.mbridge.msdk.splash.c.e.4
@Override // java.lang.Runnable
public final void run() {
com.mbridge.msdk.foundation.c.b bVar = new com.mbridge.msdk.foundation.c.b(880010);
e eVar = e.this;
eVar.a(bVar, eVar.n, e.this.o, (CampaignEx) null);
}
};
private Context g = com.mbridge.msdk.foundation.controller.c.m().c();
public final String a() {
return this.v;
}
public final void a(int i) {
this.k = i;
}
public final void a(int i, int i2) {
this.m = i;
this.l = i2;
}
public final void a(k kVar) {
this.i = kVar;
}
public final void a(com.mbridge.msdk.splash.d.b bVar) {
this.f = bVar;
}
public final void a(MBSplashView mBSplashView) {
this.h = mBSplashView;
}
public final void a(boolean z) {
this.j = z;
}
public final void b(int i) {
this.w = i;
}
public final void c() {
if (this.f != null) {
this.f = null;
}
if (this.r != null) {
this.r = null;
}
if (this.s != null) {
this.s = null;
}
}
public e(String str, String str2, long j) {
this.c = str;
this.b = str2;
this.e = j;
}
public final String b() {
return com.mbridge.msdk.foundation.same.c.a(this.x);
}
public final void a(String str, int i) {
this.q = false;
this.n = str;
this.o = i;
CampaignEx a2 = d.a(this.h, this.c, this.b, str, this.j, this.k, false, false);
long timestamp = a2 != null ? a2.getTimestamp() : 0L;
if (this.i.m() == 1 && i != 1 && a2 != null) {
a(a2, i);
return;
}
this.p = true;
if (i == 1) {
List<Integer> c = this.i.c();
if (c == null || c.size() <= 0) {
this.d = WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS;
} else {
this.d = c.get(0).intValue() * 1000;
}
} else {
long j = this.e;
if (j <= 0) {
this.d = this.i.r();
} else {
this.d = j;
}
}
if (this.i == null || timestamp <= 0 || !TextUtils.isEmpty(str)) {
a(this.d);
a(this.g, str, i);
return;
}
if (System.currentTimeMillis() - timestamp > this.i.o() * 1000) {
a(this.d);
a(this.g, str, i);
} else {
a(a2, i);
}
}
private void a(long j) {
this.z.postDelayed(this.A, j);
}
private void a(Context context, final String str, final int i) {
try {
if (context == null) {
a(new com.mbridge.msdk.foundation.c.b(880025), str, i, (CampaignEx) null);
return;
}
if (ap.a(this.b)) {
a(new com.mbridge.msdk.foundation.c.b(880032), str, i, (CampaignEx) null);
return;
}
MBridgeIds mBridgeIds = new MBridgeIds(this.c, this.b);
com.mbridge.msdk.splash.f.f fVar = new com.mbridge.msdk.splash.f.f();
fVar.a(i);
fVar.b(this.u);
fVar.a(this.t);
fVar.c(this.m);
fVar.d(this.l);
com.mbridge.msdk.foundation.same.net.f.e a2 = com.mbridge.msdk.splash.f.e.a(context, mBridgeIds, fVar);
if (a2 == null) {
a(new com.mbridge.msdk.foundation.c.b(880001), str, i, (CampaignEx) null);
return;
}
if (!TextUtils.isEmpty(str)) {
a2.a("token", str);
}
String d = ak.d(this.b);
if (!TextUtils.isEmpty(d)) {
a2.a("j", d);
}
com.mbridge.msdk.splash.f.c cVar = new com.mbridge.msdk.splash.f.c(context);
com.mbridge.msdk.splash.f.b bVar = new com.mbridge.msdk.splash.f.b(i) { // from class: com.mbridge.msdk.splash.c.e.5
@Override // com.mbridge.msdk.splash.f.b
public final void a(CampaignUnit campaignUnit, int i2) {
try {
e eVar = e.this;
e.a(eVar, campaignUnit, i2, eVar.b, str);
e.this.v = campaignUnit.getRequestId();
e.this.x = campaignUnit.getAds();
} catch (Exception e) {
e.printStackTrace();
com.mbridge.msdk.foundation.c.b bVar2 = new com.mbridge.msdk.foundation.c.b(880003);
bVar2.a((Throwable) e);
e.this.a(bVar2, str, i2, (campaignUnit == null || campaignUnit.getAds() == null || campaignUnit.getAds().size() == 0) ? null : campaignUnit.getAds().get(0));
e.this.u = 0;
}
}
@Override // com.mbridge.msdk.splash.f.b
public final void a(int i2, String str2) {
af.b(e.a, str2);
com.mbridge.msdk.foundation.c.b bVar2 = new com.mbridge.msdk.foundation.c.b(880002);
bVar2.a(str2);
e.this.a(bVar2, str, i, (CampaignEx) null);
e.this.u = 0;
}
};
bVar.a(str);
bVar.setUnitId(this.b);
bVar.setPlacementId(this.c);
bVar.setAdType(297);
cVar.choiceV3OrV5BySetting(1, a2, bVar, str, com.mbridge.msdk.foundation.same.c.a(this.d, WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS));
} catch (Exception e) {
af.b(a, e.getMessage());
com.mbridge.msdk.foundation.c.b bVar2 = new com.mbridge.msdk.foundation.c.b(880020);
bVar2.a((Throwable) e);
a(bVar2, str, i, (CampaignEx) null);
this.u = 0;
}
}
private void a(CampaignEx campaignEx, int i) {
MBSplashView mBSplashView = this.h;
if (mBSplashView != null) {
mBSplashView.setDynamicView(false);
}
if (campaignEx.isDynamicView()) {
d(campaignEx, i);
} else {
MBSplashView mBSplashView2 = this.h;
if (mBSplashView2 != null) {
mBSplashView2.setSplashWebView();
}
}
if (d.a(this.h, campaignEx)) {
b(campaignEx, i);
} else {
c(campaignEx, i);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void b(CampaignEx campaignEx, int i) {
if (!d.a(this.h, campaignEx) || this.q) {
return;
}
e();
if (this.p) {
d.a(campaignEx, this.b);
}
this.q = true;
com.mbridge.msdk.splash.d.b bVar = this.f;
if (bVar != null) {
bVar.a(campaignEx, i);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a(com.mbridge.msdk.foundation.c.b bVar, String str, int i, CampaignEx campaignEx) {
if (this.p) {
this.p = false;
a(bVar, i, str, campaignEx);
} else {
a(bVar, i, campaignEx);
}
}
private void a(com.mbridge.msdk.foundation.c.b bVar, int i, String str, CampaignEx campaignEx) {
CampaignEx a2 = d.a(this.h, this.c, this.b, str, this.j, this.k, true, false);
if (a2 != null) {
a(a2, i);
} else {
a(bVar, i, campaignEx);
}
}
private void a(com.mbridge.msdk.foundation.c.b bVar, int i, CampaignEx campaignEx) {
if (this.q) {
return;
}
e();
this.q = true;
if (bVar != null) {
bVar.a(campaignEx);
}
com.mbridge.msdk.splash.d.b bVar2 = this.f;
if (bVar2 != null) {
bVar2.a(bVar, i);
}
}
private void e() {
this.z.removeCallbacks(this.A);
}
private void c(CampaignEx campaignEx, int i) {
this.h.clearResState();
if (!TextUtils.isEmpty(campaignEx.getAdZip())) {
f(campaignEx, i);
}
if (campaignEx.isDynamicView()) {
return;
}
if (!TextUtils.isEmpty(campaignEx.getAdHtml())) {
e(campaignEx, i);
}
if (!TextUtils.isEmpty(campaignEx.getVideoUrlEncode())) {
g(campaignEx, i);
}
if (TextUtils.isEmpty(campaignEx.getImageUrl())) {
return;
}
d(campaignEx, i);
}
private void d(final CampaignEx campaignEx, final int i) {
d.a(this.h, campaignEx, new com.mbridge.msdk.splash.view.nativeview.a() { // from class: com.mbridge.msdk.splash.c.e.8
@Override // com.mbridge.msdk.splash.view.nativeview.a
public final void a() {
if (campaignEx.isDynamicView() && e.this.h != null) {
e.this.h.setImageReady(true);
e.b(e.this, campaignEx, i);
}
e.this.b(campaignEx, i);
}
@Override // com.mbridge.msdk.splash.view.nativeview.a
public final void b() {
if (!campaignEx.isDynamicView() || e.this.h == null) {
return;
}
e.this.h.setImageReady(false);
com.mbridge.msdk.foundation.c.b bVar = new com.mbridge.msdk.foundation.c.b(880027);
e eVar = e.this;
eVar.a(bVar, eVar.n, i, campaignEx);
}
});
}
/* JADX WARN: Code restructure failed: missing block: B:27:0x00bf, code lost:
if (r3 == null) goto L38;
*/
/* JADX WARN: Code restructure failed: missing block: B:29:0x00c6, code lost:
if (r7.exists() == false) goto L45;
*/
/* JADX WARN: Code restructure failed: missing block: B:31:0x00cc, code lost:
if (r7.isFile() == false) goto L45;
*/
/* JADX WARN: Code restructure failed: missing block: B:33:0x00d2, code lost:
if (r7.canRead() == false) goto L45;
*/
/* JADX WARN: Code restructure failed: missing block: B:34:0x00d4, code lost:
r10.setAdHtml(r7.getAbsolutePath());
a("file:////" + r7.getAbsolutePath(), r10, r11);
*/
/* JADX WARN: Code restructure failed: missing block: B:35:?, code lost:
return;
*/
/* JADX WARN: Code restructure failed: missing block: B:37:0x00f4, code lost:
a(new com.mbridge.msdk.foundation.c.b(880013), r9.n, r11, r10);
*/
/* JADX WARN: Code restructure failed: missing block: B:38:?, code lost:
return;
*/
/* JADX WARN: Code restructure failed: missing block: B:39:0x00aa, code lost:
r3.close();
*/
/* JADX WARN: Code restructure failed: missing block: B:47:0x00a8, code lost:
if (r3 != null) goto L31;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private void e(com.mbridge.msdk.foundation.entity.CampaignEx r10, int r11) {
/*
Method dump skipped, instructions count: 272
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.splash.c.e.e(com.mbridge.msdk.foundation.entity.CampaignEx, int):void");
}
private void f(final CampaignEx campaignEx, final int i) {
if (campaignEx.isDynamicView()) {
o.a(5, "", campaignEx.getAdZip(), new o.a() { // from class: com.mbridge.msdk.splash.c.e.9
@Override // com.mbridge.msdk.foundation.tools.o.a
public final void a(String str, String str2, String str3, String str4, boolean z) {
if (z) {
return;
}
e.a(e.this, campaignEx, str, true, "");
}
@Override // com.mbridge.msdk.foundation.tools.o.a
public final void a(String str, DownloadError downloadError) {
String str2 = "";
if (downloadError != null) {
try {
if (downloadError.getException() != null) {
str2 = downloadError.getException().getMessage();
}
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
e.printStackTrace();
return;
}
return;
}
}
e.a(e.this, campaignEx, str, false, str2);
}
}, campaignEx);
return;
}
this.s = new H5DownLoadManager.ZipDownloadListener() { // from class: com.mbridge.msdk.splash.c.e.10
@Override // com.mbridge.msdk.foundation.download.download.H5DownLoadManager.H5ResDownloadListerInter
public final void onSuccess(String str, String str2, boolean z) {
Message obtain = Message.obtain();
obtain.what = 1;
obtain.obj = campaignEx;
obtain.arg1 = i;
e.this.z.sendMessage(obtain);
if (z) {
return;
}
CampaignEx campaignEx2 = campaignEx;
e.a(e.this, campaignEx, campaignEx2 != null ? campaignEx2.getAdZip() : "", true, "");
}
@Override // com.mbridge.msdk.foundation.download.download.H5DownLoadManager.H5ResDownloadListerInter
public final void onFailed(String str, String str2) {
com.mbridge.msdk.foundation.c.b bVar = new com.mbridge.msdk.foundation.c.b(880006);
e eVar = e.this;
eVar.a(bVar, eVar.n, i, campaignEx);
Message obtain = Message.obtain();
obtain.what = 2;
Bundle bundle = new Bundle();
bundle.putSerializable("campaignex", campaignEx);
bundle.putString("msg", str);
bundle.putInt("type", 2);
obtain.obj = bundle;
e.this.z.sendMessage(obtain);
e.a(e.this, campaignEx, str2, false, str);
}
};
com.mbridge.msdk.foundation.same.report.d.c cVar = new com.mbridge.msdk.foundation.same.report.d.c();
cVar.b(297);
cVar.a(2);
cVar.a(campaignEx);
cVar.c(campaignEx.getAabEntity() != null ? campaignEx.getAabEntity().h3c : 0);
H5DownLoadManager.getInstance().downloadH5Res(cVar, campaignEx.getAdZip(), this.s);
}
/* JADX INFO: Access modifiers changed from: private */
public void a(String str, final CampaignEx campaignEx, final int i) {
g gVar;
g.c cVar = new g.c();
cVar.c(this.b);
cVar.b(this.c);
cVar.a(campaignEx);
cVar.a(str);
cVar.a(this.j);
cVar.a(this.k);
g.b bVar = new g.b() { // from class: com.mbridge.msdk.splash.c.e.2
@Override // com.mbridge.msdk.splash.c.g.b
public final void a() {
if (campaignEx.isHasMBTplMark()) {
return;
}
e.c(e.this, campaignEx, i);
}
@Override // com.mbridge.msdk.splash.c.g.b
public final void a(String str2) {
e.a(e.this, str2, i, campaignEx);
}
@Override // com.mbridge.msdk.splash.c.g.b
public final void a(int i2) {
if (i2 == 1) {
e.c(e.this, campaignEx, i);
} else {
e.a(e.this, "readyState 2", i, campaignEx);
}
}
};
gVar = g.a.a;
gVar.a(this.h, cVar, bVar);
}
private void g(final CampaignEx campaignEx, int i) {
this.r = new com.mbridge.msdk.videocommon.listener.a() { // from class: com.mbridge.msdk.splash.c.e.3
@Override // com.mbridge.msdk.videocommon.listener.a
public final void a(String str) {
e.this.h.setVideoReady(true);
Message obtain = Message.obtain();
obtain.obj = campaignEx;
obtain.what = 3;
e.this.z.sendMessage(obtain);
}
@Override // com.mbridge.msdk.videocommon.listener.a
public final void a(String str, String str2) {
e.this.h.setVideoReady(false);
com.mbridge.msdk.foundation.c.b bVar = new com.mbridge.msdk.foundation.c.b(880004);
bVar.a(str);
e eVar = e.this;
eVar.a(bVar, eVar.n, e.this.o, campaignEx);
Message obtain = Message.obtain();
Bundle bundle = new Bundle();
bundle.putSerializable("campaignex", campaignEx);
bundle.putString("msg", str);
bundle.putInt("type", 1);
obtain.obj = bundle;
obtain.what = 2;
e.this.z.sendMessage(obtain);
}
};
CopyOnWriteArrayList<CampaignEx> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
copyOnWriteArrayList.add(campaignEx);
com.mbridge.msdk.videocommon.download.b.getInstance().createUnitCache(this.g, this.b, copyOnWriteArrayList, 297, this.r);
if (!com.mbridge.msdk.videocommon.download.b.getInstance().a(297, this.b, campaignEx.isBidCampaign())) {
com.mbridge.msdk.videocommon.download.b.getInstance().load(this.b);
} else {
this.h.setVideoReady(true);
b(campaignEx, i);
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r2v0, types: [com.mbridge.msdk.foundation.same.report.d.a.a] */
/* JADX WARN: Type inference failed for: r2v3, types: [com.mbridge.msdk.foundation.entity.CampaignEx] */
/* JADX WARN: Type inference failed for: r2v4 */
/* JADX WARN: Type inference failed for: r2v5 */
public static /* synthetic */ void a(e eVar, CampaignUnit campaignUnit, int i, String str, String str2) {
ArrayList arrayList;
com.mbridge.msdk.foundation.c.b bVar;
CampaignEx campaignEx;
int i2;
k kVar;
final CampaignEx campaignEx2 = 0;
campaignEx2 = 0;
campaignEx2 = 0;
if (campaignUnit == null || campaignUnit.getAds() == null) {
arrayList = null;
} else {
arrayList = new ArrayList();
final CampaignEx campaignEx3 = campaignUnit.getAds().get(0);
campaignEx3.setCampaignUnitId(eVar.b);
new Thread(new Runnable() { // from class: com.mbridge.msdk.splash.c.e.7
@Override // java.lang.Runnable
public final void run() {
j.a(com.mbridge.msdk.foundation.db.g.a(e.this.g)).a();
n.a(e.this.g, campaignEx3);
}
}).start();
eVar.t = campaignUnit.getSessionId();
if (campaignEx3.getOfferType() != 99 && (!TextUtils.isEmpty(campaignEx3.getAdZip()) || !TextUtils.isEmpty(campaignEx3.getAdHtml()))) {
if (ak.c(campaignEx3)) {
campaignEx3.setRtinsType(ak.c(eVar.g, campaignEx3.getPackageName()) ? 1 : 2);
}
if (com.mbridge.msdk.foundation.same.c.a(eVar.g, campaignEx3)) {
arrayList.add(campaignEx3);
} else {
ak.a(eVar.b, campaignEx3, com.mbridge.msdk.foundation.same.a.x);
eVar.y = "APP ALREADY INSTALLED";
}
try {
com.mbridge.msdk.foundation.same.c.a(campaignEx3, eVar.g, null, new c.a() { // from class: com.mbridge.msdk.splash.c.e.6
@Override // com.mbridge.msdk.foundation.same.c.a
public final void a(String str3, com.mbridge.msdk.foundation.same.report.d.c cVar) {
try {
com.mbridge.msdk.foundation.same.report.d.d.a().a(str3, cVar, campaignEx3, e.this.g, campaignEx2);
} catch (Exception e) {
af.b("SplashReport", e.getMessage());
}
}
});
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
e.printStackTrace();
}
}
}
}
if (arrayList == null || arrayList.size() <= 0) {
if (eVar.y.contains("INSTALLED")) {
bVar = new com.mbridge.msdk.foundation.c.b(880021, "APP ALREADY INSTALLED");
} else {
bVar = new com.mbridge.msdk.foundation.c.b(880003);
}
if (campaignUnit != null && campaignUnit.getAds() != null && campaignUnit.getAds().size() != 0) {
campaignEx2 = campaignUnit.getAds().get(0);
}
eVar.a(bVar, str2, i, campaignEx2);
return;
}
try {
i2 = eVar.u + 1;
eVar.u = i2;
kVar = eVar.i;
} catch (Exception e2) {
e2.printStackTrace();
}
if (kVar != null) {
if (i2 > kVar.w()) {
}
campaignEx = (CampaignEx) arrayList.get(0);
if (TextUtils.isEmpty(campaignEx.getAdZip()) || (!TextUtils.isEmpty(campaignEx.getAdHtml()) && campaignEx.getAdHtml().contains("<MBTPLMARK>"))) {
campaignEx.setHasMBTplMark(true);
campaignEx.setIsMraid(false);
} else {
campaignEx.setHasMBTplMark(false);
campaignEx.setIsMraid(true);
}
eVar.a(campaignEx, i);
}
eVar.u = 0;
campaignEx = (CampaignEx) arrayList.get(0);
if (TextUtils.isEmpty(campaignEx.getAdZip())) {
}
campaignEx.setHasMBTplMark(true);
campaignEx.setIsMraid(false);
eVar.a(campaignEx, i);
}
public static /* synthetic */ void b(e eVar, final CampaignEx campaignEx, final int i) {
c cVar;
if (campaignEx.isDynamicView()) {
c.a aVar = new c.a();
aVar.b(eVar.b).a(eVar.c).a(eVar.j).a(campaignEx).a(eVar.k).h(eVar.w);
try {
if (!TextUtils.isEmpty(campaignEx.getAdZip())) {
Uri parse = Uri.parse(campaignEx.getAdZip());
String queryParameter = parse.getQueryParameter("hdbtn");
String queryParameter2 = parse.getQueryParameter("alecfc");
String queryParameter3 = parse.getQueryParameter("hdinfo");
String queryParameter4 = parse.getQueryParameter("shake_show");
String queryParameter5 = parse.getQueryParameter("shake_strength");
String queryParameter6 = parse.getQueryParameter("shake_time");
String queryParameter7 = parse.getQueryParameter("n_logo");
if (!TextUtils.isEmpty(queryParameter)) {
aVar.b(Integer.parseInt(queryParameter));
}
if (!TextUtils.isEmpty(queryParameter2)) {
aVar.c(Integer.parseInt(queryParameter2));
}
if (!TextUtils.isEmpty(queryParameter3)) {
aVar.d(Integer.parseInt(queryParameter3));
}
if (!TextUtils.isEmpty(queryParameter4)) {
aVar.e(Integer.parseInt(queryParameter4));
}
if (!TextUtils.isEmpty(queryParameter5)) {
aVar.f(Integer.parseInt(queryParameter5));
}
if (!TextUtils.isEmpty(queryParameter6)) {
aVar.g(Integer.parseInt(queryParameter6));
}
if (!TextUtils.isEmpty(queryParameter7)) {
aVar.i(Integer.parseInt(queryParameter7) == 0 ? 0 : 1);
}
}
} catch (Throwable th) {
af.b(a, th.getMessage());
}
cVar = c.a.a;
cVar.a(eVar.h, new com.mbridge.msdk.splash.a.c(aVar), new com.mbridge.msdk.splash.b.a() { // from class: com.mbridge.msdk.splash.c.e.11
@Override // com.mbridge.msdk.splash.b.a
public final void a(View view) {
if (e.this.h != null) {
e.this.h.setDynamicView(true);
e.this.h.setSplashNativeView(view);
e.this.b(campaignEx, i);
}
}
@Override // com.mbridge.msdk.splash.b.a
public final void a(String str) {
com.mbridge.msdk.foundation.c.b bVar = new com.mbridge.msdk.foundation.c.b(880034);
bVar.a(str);
e eVar2 = e.this;
eVar2.a(bVar, eVar2.n, i, campaignEx);
}
});
}
}
public static /* synthetic */ void a(e eVar, CampaignEx campaignEx, String str, boolean z, String str2) {
try {
com.mbridge.msdk.foundation.entity.n nVar = new com.mbridge.msdk.foundation.entity.n();
nVar.e(2);
nVar.a("m_download_end");
if (campaignEx != null) {
nVar.d(campaignEx.isMraid() ? com.mbridge.msdk.foundation.entity.n.a : com.mbridge.msdk.foundation.entity.n.b);
nVar.g(campaignEx.getRequestIdNotice());
}
nVar.a("url", str);
nVar.a("scenes", "1");
if (z) {
nVar.b(1);
} else {
nVar.b(3);
nVar.h(str2);
}
com.mbridge.msdk.foundation.same.report.d.d.a().a(nVar, campaignEx);
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.b(a, e.getMessage());
}
}
}
public static /* synthetic */ void c(e eVar, CampaignEx campaignEx, int i) {
if (eVar.h.isH5Ready()) {
return;
}
eVar.h.setH5Ready(true);
eVar.b(campaignEx, i);
}
public static /* synthetic */ void a(e eVar, String str, int i, CampaignEx campaignEx) {
com.mbridge.msdk.foundation.c.b bVar = new com.mbridge.msdk.foundation.c.b(880009);
bVar.a(str);
eVar.a(bVar, eVar.n, i, campaignEx);
}
}

View File

@@ -0,0 +1,16 @@
package com.mbridge.msdk.splash.c;
import android.content.Context;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public final class f extends b {
public f(Context context, String str, String str2) {
super(context, str, str2);
}
@Override // com.mbridge.msdk.splash.c.b
public final void a(CampaignEx campaignEx, boolean z, String str) {
b(campaignEx, z, str);
}
}

View File

@@ -0,0 +1,224 @@
package com.mbridge.msdk.splash.c;
import android.net.http.SslError;
import android.text.TextUtils;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.mbbid.common.BidResponsedEx;
import com.mbridge.msdk.splash.view.MBSplashView;
import com.mbridge.msdk.splash.view.MBSplashWebview;
import java.util.ArrayList;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class g {
private boolean a;
private boolean b;
public static class a {
private static final g a = new g();
}
public interface b {
void a();
void a(int i);
void a(String str);
}
public static class c {
private String a;
private String b;
private CampaignEx c;
private String d;
private boolean e;
private int f;
public final String a() {
return this.d;
}
public final void a(int i) {
this.f = i;
}
public final void a(CampaignEx campaignEx) {
this.c = campaignEx;
}
public final void a(String str) {
this.d = str;
}
public final void a(boolean z) {
this.e = z;
}
public final String b() {
return this.a;
}
public final void b(String str) {
this.a = str;
}
public final String c() {
return this.b;
}
public final void c(String str) {
this.b = str;
}
public final CampaignEx d() {
return this.c;
}
public final boolean e() {
return this.e;
}
public final int f() {
return this.f;
}
}
public final void a() {
this.a = false;
this.b = false;
}
private g() {
this.a = false;
this.b = false;
}
public final void a(final MBSplashView mBSplashView, c cVar, final b bVar) {
String requestId;
if (mBSplashView == null || cVar == null) {
return;
}
final String c2 = cVar.c();
String b2 = cVar.b();
final CampaignEx d = cVar.d();
String a2 = cVar.a();
boolean e = cVar.e();
int f = cVar.f();
MBSplashWebview splashWebview = mBSplashView.getSplashWebview();
if (splashWebview == null) {
return;
}
com.mbridge.msdk.splash.signal.c cVar2 = new com.mbridge.msdk.splash.signal.c(mBSplashView.getContext(), b2, c2);
ArrayList arrayList = new ArrayList();
arrayList.add(d);
cVar2.a(arrayList);
cVar2.a(e ? 1 : 0);
cVar2.b(f);
mBSplashView.setSplashSignalCommunicationImpl(cVar2);
if (TextUtils.isEmpty(d.getRequestId())) {
requestId = d.getRequestIdNotice();
} else {
requestId = d.getRequestId();
}
String requestId2 = splashWebview.getRequestId();
af.b("WebViewRenderManager", "CampaignEx RequestId = " + requestId + " WebView RequestId = " + requestId2);
if (!TextUtils.isEmpty(requestId2) && requestId2.equals(requestId) && (this.a || this.b)) {
mBSplashView.setH5Ready(true);
if (bVar != null) {
bVar.a(1);
return;
}
return;
}
a();
splashWebview.setRequestId(requestId);
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("key", "2000067");
jSONObject.put(MBridgeConstans.PROPERTIES_UNIT_ID, c2);
jSONObject.put(BidResponsedEx.KEY_CID, d.getId());
jSONObject.put("rid", d.getRequestId());
jSONObject.put("rid_n", d.getRequestIdNotice());
jSONObject.put(CampaignEx.JSON_KEY_CREATIVE_ID, d.getCreativeId());
jSONObject.put("hb", d.isBidCampaign() ? 1 : 0);
jSONObject.put("network_type", ab.m(com.mbridge.msdk.foundation.controller.c.m().c()));
com.mbridge.msdk.foundation.same.report.d.d.a().a(jSONObject);
} catch (Throwable th) {
af.b("SplashReport", th.getMessage());
}
final long currentTimeMillis = System.currentTimeMillis();
splashWebview.setWebViewListener(new com.mbridge.msdk.mbsignalcommon.b.b() { // from class: com.mbridge.msdk.splash.c.g.1
@Override // com.mbridge.msdk.mbsignalcommon.b.b, com.mbridge.msdk.mbsignalcommon.windvane.d
public final void a(WebView webView, int i) {
super.a(webView, i);
b bVar2 = bVar;
if (bVar2 != null) {
bVar2.a(i);
}
if (i == 1) {
g.this.a = true;
mBSplashView.setH5Ready(true);
com.mbridge.msdk.splash.e.a.a(com.mbridge.msdk.foundation.controller.c.m().c(), d, c2, "", currentTimeMillis, 1);
com.mbridge.msdk.splash.e.a.a(1, "", c2, d);
return;
}
g.this.a = false;
mBSplashView.setH5Ready(false);
com.mbridge.msdk.splash.e.a.a(2, "readyState 2", c2, d);
com.mbridge.msdk.splash.e.a.a(com.mbridge.msdk.foundation.controller.c.m().c(), d, c2, "readyState 2", currentTimeMillis, 3);
}
@Override // com.mbridge.msdk.mbsignalcommon.b.b, com.mbridge.msdk.mbsignalcommon.windvane.d
public final void a(WebView webView, int i, String str, String str2) {
super.a(webView, i, str, str2);
b bVar2 = bVar;
if (bVar2 != null) {
bVar2.a(str);
}
g.this.a();
mBSplashView.setH5Ready(false);
com.mbridge.msdk.splash.e.a.a(2, "error code:" + i + str, c2, d);
com.mbridge.msdk.splash.e.a.a(com.mbridge.msdk.foundation.controller.c.m().c(), d, c2, "error code:" + i + str, currentTimeMillis, 3);
}
@Override // com.mbridge.msdk.mbsignalcommon.b.b, com.mbridge.msdk.mbsignalcommon.windvane.d
public final void a(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
super.a(webView, sslErrorHandler, sslError);
if (bVar != null) {
throw null;
}
g.this.a();
mBSplashView.setH5Ready(false);
new StringBuilder().append("error url:");
throw null;
}
@Override // com.mbridge.msdk.mbsignalcommon.b.b, com.mbridge.msdk.mbsignalcommon.windvane.d
public final void a(WebView webView, String str) {
super.a(webView, str);
b bVar2 = bVar;
if (bVar2 != null) {
bVar2.a();
}
g.this.b = true;
if (!d.isHasMBTplMark()) {
mBSplashView.setH5Ready(true);
com.mbridge.msdk.splash.e.a.a(1, "", c2, d);
com.mbridge.msdk.splash.e.a.a(com.mbridge.msdk.foundation.controller.c.m().c(), d, c2, "", currentTimeMillis, 1);
}
com.mbridge.msdk.splash.signal.d.a(webView);
}
});
if (!splashWebview.isDestoryed()) {
splashWebview.loadUrl(a2);
} else {
mBSplashView.setH5Ready(false);
com.mbridge.msdk.splash.e.a.a(com.mbridge.msdk.foundation.controller.c.m().c(), d, c2, "webview had destory", currentTimeMillis, 3);
}
}
}