Puzzle King v2.3.8版本的 MD5 值为:1734eb975c9d2843afa462aec387292e
以下内容为反编译后的 f.java 源代码,内容仅作参考
package com.mbridge.msdk.click;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.tools.v;
import com.mbridge.msdk.playercommon.exoplayer2.DefaultLoadControl;
import com.safedk.android.analytics.brandsafety.creatives.CreativeInfoManager;
import com.safedk.android.internal.partials.MintegralNetworkBridge;
import com.safedk.android.utils.Logger;
import java.util.HashMap;
public class f {
boolean b;
boolean c;
private int e;
private int f;
private com.mbridge.msdk.c.a h;
private a i;
private String j;
private String k;
private WebView l;
private boolean m;
private String n;
private int o;
private boolean q;
private static final String d = f.class.getSimpleName();
public static long a = 0;
private boolean p = false;
private final Runnable r = new Runnable() {
@Override
public final void run() {
f.this.p = true;
f.this.o = 1;
f.m(f.this);
}
};
private final Runnable s = new Runnable() {
@Override
public final void run() {
f.this.p = true;
f.this.o = 2;
f.m(f.this);
}
};
private Handler g = new Handler(Looper.getMainLooper());
public interface a {
void a(int i, String str, String str2, String str3);
void a(String str, boolean z, String str2);
boolean a(String str);
boolean b(String str);
boolean c(String str);
}
public f() {
this.e = DefaultLoadControl.DEFAULT_MIN_BUFFER_MS;
this.f = 3000;
com.mbridge.msdk.c.a b = com.mbridge.msdk.c.b.a().b(com.mbridge.msdk.foundation.controller.a.d().g());
this.h = b;
if (b == null) {
this.h = com.mbridge.msdk.c.b.a().b();
}
this.m = this.h.Q();
this.e = (int) this.h.V();
this.f = (int) this.h.V();
}
public final void a(String str, String str2, Context context, String str3, String str4, a aVar) {
if (aVar == null) {
throw new NullPointerException("OverrideUrlLoadingListener can not be null");
}
this.k = str4;
this.j = str3;
this.i = aVar;
a(str, str2, context);
}
public final void a(String str, String str2, Context context, String str3, a aVar) {
if (aVar == null) {
throw new NullPointerException("OverrideUrlLoadingListener can not be null");
}
this.j = str3;
this.i = aVar;
a(str, str2, context);
}
private void a(final String str, final String str2, final Context context) {
if (Thread.currentThread() == Looper.getMainLooper().getThread()) {
a(str, str2, context, this.j);
} else {
this.g.post(new Runnable() {
@Override
public final void run() {
f fVar = f.this;
fVar.a(str, str2, context, fVar.j);
}
});
}
}
public void a(String str, String str2, Context context, String str3) {
try {
a(context, str, str2);
if (!TextUtils.isEmpty(this.k)) {
this.l.getSettings().setDefaultTextEncodingName("utf-8");
this.f = 2000;
this.e = 2000;
v.b(d, this.k);
MintegralNetworkBridge.webviewLoadDataWithBaseURL(this.l, str3, this.k, "*/*", "utf-8", str3);
return;
}
if (this.m) {
HashMap hashMap = new HashMap();
if (this.l.getUrl() != null) {
hashMap.put("Referer", this.l.getUrl());
}
MintegralNetworkBridge.webviewLoadUrl(this.l, str3, hashMap);
return;
}
MintegralNetworkBridge.webviewLoadUrl(this.l, str3);
} catch (Throwable th) {
try {
if (this.i != null) {
this.i.a(0, this.j, th.getMessage(), this.n);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
private void a(final Context context, final String str, final String str2) {
WebView webView = new WebView(context);
this.l = webView;
webView.getSettings().setJavaScriptEnabled(true);
this.l.getSettings().setCacheMode(2);
this.l.getSettings().setLoadsImagesAutomatically(false);
this.l.setWebViewClient(new WebViewClient() {
@Override
public void onLoadResource(WebView view, String url) {
super.onLoadResource(view, url);
CreativeInfoManager.onResourceLoaded(com.safedk.android.utils.g.o, view, url);
}
@Override
public final void onPageFinished(WebView webView2, String str3) {
Logger.d("Mintegral|SafeDK: Execution> Lcom/mbridge/msdk/click/f$2;->onPageFinished(Landroid/webkit/WebView;Ljava/lang/String;)V");
CreativeInfoManager.onWebViewPageFinished(com.safedk.android.utils.g.o, webView2, str3);
safedk_f$2_onPageFinished_0a546ebb8aa37f3f4215111b603f43c5(webView2, str3);
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest webResourceRequest) {
return CreativeInfoManager.onWebViewResponseWithHeaders(com.safedk.android.utils.g.o, view, webResourceRequest, super.shouldInterceptRequest(view, webResourceRequest));
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
return CreativeInfoManager.onWebViewResponse(com.safedk.android.utils.g.o, view, url, super.shouldInterceptRequest(view, url));
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView2, String str3) {
Logger.d("Mintegral|SafeDK: Execution> Lcom/mbridge/msdk/click/f$2;->shouldOverrideUrlLoading(Landroid/webkit/WebView;Ljava/lang/String;)Z");
boolean safedk_f$2_shouldOverrideUrlLoading_e7de11595966d7493973a22f40bb5841 = safedk_f$2_shouldOverrideUrlLoading_e7de11595966d7493973a22f40bb5841(webView2, str3);
CreativeInfoManager.onOverrideUrlLoading(com.safedk.android.utils.g.o, webView2, str3, safedk_f$2_shouldOverrideUrlLoading_e7de11595966d7493973a22f40bb5841);
return safedk_f$2_shouldOverrideUrlLoading_e7de11595966d7493973a22f40bb5841;
}
@Override
public final void onPageStarted(WebView webView2, String str3, Bitmap bitmap) {
try {
MintegralNetworkBridge.webviewLoadUrl(webView2, "javascript:window.navigator.vibrate([]);");
if (f.this.q) {
f.this.o = 0;
f.c(f.this);
return;
}
f.this.c = false;
if (webView2.getTag() == null) {
webView2.setTag("has_first_started");
} else {
f.this.b = true;
}
synchronized (f.d) {
f.this.j = str3;
if (f.this.i != null && f.this.i.a(str3)) {
f.this.q = true;
f.c(f.this);
} else {
f.e(f.this);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public boolean safedk_f$2_shouldOverrideUrlLoading_e7de11595966d7493973a22f40bb5841(WebView p0, String p1) {
synchronized (f.d) {
f.this.c = true;
f.this.d();
if (f.this.q) {
f.this.c();
f.c(f.this);
return true;
}
f.this.j = p1;
if (f.this.i == null || !f.this.i.b(p1)) {
if (!f.this.m) {
WebView p02 = f.this.l;
MintegralNetworkBridge.webviewLoadUrl(p02, p1);
} else {
HashMap hashMap = new HashMap();
if (f.this.l.getUrl() != null) {
hashMap.put("Referer", f.this.l.getUrl());
}
MintegralNetworkBridge.webviewLoadUrl(f.this.l, p1, hashMap);
}
return true;
}
f.this.q = true;
f.this.c();
f.c(f.this);
return true;
}
}
@Override
public final void onReceivedError(WebView webView2, int i, String str3, String str4) {
synchronized (f.d) {
f.this.q = true;
f.this.b();
f.c(f.this);
}
if (f.this.i != null) {
f.this.i.a(i, webView2.getUrl(), str3, f.this.n);
}
}
@Override
public final void onReceivedSslError(WebView webView2, SslErrorHandler sslErrorHandler, SslError sslError) {
try {
if (MBridgeConstans.IS_SP_CBT_CF && sslErrorHandler != null) {
sslErrorHandler.cancel();
}
if (TextUtils.isEmpty(str2) || TextUtils.isEmpty(str)) {
return;
}
new com.mbridge.msdk.foundation.same.report.d(context).a(str, str2, webView2.getUrl());
} catch (Exception e) {
e.printStackTrace();
}
}
public void safedk_f$2_onPageFinished_0a546ebb8aa37f3f4215111b603f43c5(WebView p0, String p1) {
super.onPageFinished(p0, p1);
try {
MintegralNetworkBridge.webviewLoadUrl(p0, "javascript:window.navigator.vibrate([]);");
} catch (Exception e) {
e.printStackTrace();
}
}
});
this.l.setWebChromeClient(new WebChromeClient() {
@Override
public final boolean onJsAlert(WebView webView2, String str3, String str4, JsResult jsResult) {
return true;
}
@Override
public final boolean onJsConfirm(WebView webView2, String str3, String str4, JsResult jsResult) {
return true;
}
@Override
public final boolean onJsPrompt(WebView webView2, String str3, String str4, String str5, JsPromptResult jsPromptResult) {
return true;
}
@Override
public final void onProgressChanged(WebView webView2, int i) {
if (i == 100) {
try {
MintegralNetworkBridge.webviewLoadUrl(webView2, "javascript:window.navigator.vibrate([]);");
if (!f.this.q && !f.this.c) {
f.l(f.this);
}
if (f.this.i != null) {
f.this.i.c(webView2.getUrl());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
});
}
public void b() {
d();
c();
}
public void c() {
this.g.removeCallbacks(this.s);
}
public void d() {
this.g.removeCallbacks(this.r);
}
static void c(f fVar) {
synchronized (d) {
try {
fVar.b();
if (fVar.i != null) {
fVar.i.a(fVar.j, fVar.p, fVar.n);
}
} catch (Exception e) {
v.d(d, e.getMessage());
} catch (Throwable th) {
v.d(d, th.getMessage());
}
}
}
static void e(f fVar) {
fVar.c();
fVar.g.postDelayed(fVar.s, fVar.e);
}
static void l(f fVar) {
fVar.d();
fVar.g.postDelayed(fVar.r, fVar.f);
}
static void m(f fVar) {
synchronized (d) {
try {
try {
fVar.b();
fVar.l.destroy();
if (fVar.i != null) {
fVar.i.a(fVar.j, fVar.p, fVar.n);
}
} catch (Exception e) {
v.d(d, e.getMessage());
}
} finally {
}
}
}
}