- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
225 lines
7.7 KiB
Java
225 lines
7.7 KiB
Java
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);
|
|
}
|
|
}
|
|
}
|