Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.mbridge.msdk.foundation.webview;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.webkit.WebView;
import androidx.webkit.ProxyConfig;
import com.mbridge.msdk.activity.MBCommonActivity;
import com.mbridge.msdk.click.CommonJumpLoader;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.foundation.webview.BrowserView;
import com.mbridge.msdk.out.BaseTrackingListener;
public class a implements BrowserView.a {
private static String f47760a = "a";
private Context f47761b;
private BaseTrackingListener f47762c;
private CampaignEx f47763d;
private BrowserView f47765f;
private com.mbridge.msdk.click.a f47767h;
private long f47768i;
private int f47769j;
private CommonJumpLoader.JumpLoaderResult f47771l;
private String f47772m;
private boolean f47773n;
private boolean f47764e = true;
private boolean f47770k = false;
private final Runnable f47774o = new Runnable() {
@Override
public final void run() {
x.d(a.f47760a, "webview js!超时上限:" + a.this.f47769j + "ms");
if (a.this.f47767h != null && a.this.f47771l != null) {
a.this.f47771l.setSuccess(false);
a.this.f47771l.setUrl(a.this.f47772m);
a.this.f47771l.setType(2);
a.this.f47771l.setExceptionMsg("linktype 8 time out");
a.this.f47767h.a(a.this.f47771l, a.this.f47763d, 1, false);
}
a aVar = a.this;
if (aVar.d(null, aVar.f47772m) && !a.this.f47770k) {
a.this.f47770k = true;
a aVar2 = a.this;
aVar2.a(aVar2.f47761b, a.this.f47772m, a.this.f47763d);
}
if (a.this.f47762c != null) {
a.this.f47762c.onFinishRedirection(a.this.f47763d, a.this.f47772m);
}
}
};
private Handler f47766g = new Handler(Looper.getMainLooper());
public a(Context context, CampaignEx campaignEx, com.mbridge.msdk.click.a aVar, BrowserView browserView, BaseTrackingListener baseTrackingListener) {
this.f47769j = 10000;
this.f47771l = null;
this.f47761b = context;
this.f47763d = campaignEx;
this.f47765f = browserView;
this.f47762c = baseTrackingListener;
com.mbridge.msdk.c.a b11 = com.mbridge.msdk.c.b.a().b(com.mbridge.msdk.foundation.controller.a.d().g());
b11 = b11 == null ? com.mbridge.msdk.c.b.a().b() : b11;
this.f47767h = aVar;
this.f47771l = new CommonJumpLoader.JumpLoaderResult();
this.f47769j = (int) b11.W();
}
@Override
public final void a() {
}
public boolean d(WebView webView, String str) {
boolean z11;
boolean z12;
try {
if (TextUtils.isEmpty(str)) {
return true;
}
Uri parse = Uri.parse(str);
if (!parse.getScheme().equals(ProxyConfig.MATCH_HTTP) && !parse.getScheme().equals(ProxyConfig.MATCH_HTTPS)) {
z11 = false;
if (!z11) {
return true;
}
if (parse.getScheme().equals("intent")) {
Intent parseUri = Intent.parseUri(str, 1);
try {
String str2 = parseUri.getPackage();
if (!TextUtils.isEmpty(str2)) {
if (this.f47761b.getPackageManager().getLaunchIntentForPackage(str2) != null) {
return false;
}
}
} catch (Throwable th2) {
x.d(f47760a, th2.getMessage());
}
try {
String stringExtra = parseUri.getStringExtra("browser_fallback_url");
if (!TextUtils.isEmpty(stringExtra)) {
Uri parse2 = Uri.parse(str);
if (!parse2.getScheme().equals(ProxyConfig.MATCH_HTTP)) {
if (!parse2.getScheme().equals(ProxyConfig.MATCH_HTTPS)) {
z12 = false;
if (!z12) {
return true;
}
str = stringExtra;
}
}
z12 = true;
if (!z12) {
}
}
} catch (Throwable th3) {
x.d(f47760a, th3.getMessage());
}
}
if (!com.mbridge.msdk.click.b.d(this.f47761b, str)) {
return true;
}
x.d(f47760a, "openDeepLink");
return false;
}
z11 = true;
if (!z11) {
}
} catch (Throwable th4) {
x.d(f47760a, th4.getMessage());
return true;
}
}
private boolean e(WebView webView, String str) {
boolean z11;
boolean z12;
try {
if (TextUtils.isEmpty(str)) {
return false;
}
Uri parse = Uri.parse(str);
if (!parse.getScheme().equals(ProxyConfig.MATCH_HTTP) && !parse.getScheme().equals(ProxyConfig.MATCH_HTTPS)) {
z11 = false;
if (!z11) {
return false;
}
if (parse.getScheme().equals("intent")) {
Intent parseUri = Intent.parseUri(str, 1);
try {
String str2 = parseUri.getPackage();
if (!TextUtils.isEmpty(str2) && this.f47761b.getPackageManager().getLaunchIntentForPackage(str2) != null) {
parseUri.setFlags(268435456);
this.f47761b.startActivity(parseUri);
this.f47770k = true;
return true;
}
} catch (Throwable th2) {
x.d(f47760a, th2.getMessage());
}
try {
String stringExtra = parseUri.getStringExtra("browser_fallback_url");
if (!TextUtils.isEmpty(stringExtra)) {
Uri parse2 = Uri.parse(str);
if (!parse2.getScheme().equals(ProxyConfig.MATCH_HTTP) && !parse2.getScheme().equals(ProxyConfig.MATCH_HTTPS)) {
z12 = false;
if (!z12) {
webView.loadUrl(stringExtra);
return false;
}
str = stringExtra;
}
z12 = true;
if (!z12) {
}
}
} catch (Throwable th3) {
x.d(f47760a, th3.getMessage());
}
}
if (!com.mbridge.msdk.click.b.d(this.f47761b, str)) {
return false;
}
x.d(f47760a, "openDeepLink");
this.f47770k = true;
return true;
}
z11 = true;
if (!z11) {
}
} catch (Throwable th4) {
x.d(f47760a, th4.getMessage());
return false;
}
}
@Override
public final void c(WebView webView, final String str) {
x.d(f47760a, "onPageFinished1 " + str);
if (this.f47764e) {
this.f47768i = 0L;
this.f47764e = false;
com.mbridge.msdk.foundation.same.f.b.b().execute(new Runnable() {
@Override
public final void run() {
if (a.this.f47762c != null) {
a.this.f47762c.onFinishRedirection(a.this.f47763d, str);
}
if (a.this.f47767h != null && a.this.f47771l != null) {
a.this.f47771l.setSuccess(true);
a.this.f47771l.setUrl(str);
a.this.f47771l.setType(2);
a.this.f47767h.a(a.this.f47771l, a.this.f47763d, 1, true);
}
}
});
if (TextUtils.isEmpty(str)) {
return;
}
d();
Uri parse = Uri.parse(str);
if (!(parse.getScheme().equals(ProxyConfig.MATCH_HTTP) || parse.getScheme().equals(ProxyConfig.MATCH_HTTPS)) || this.f47770k) {
return;
}
this.f47770k = true;
a(this.f47761b, str, this.f47763d);
}
}
@Override
public final boolean b(WebView webView, final String str) {
x.d(f47760a, "shouldOverrideUrlLoading1 " + str);
this.f47764e = false;
if (ab.a.a(str) && ab.a.a(this.f47761b, str, null)) {
this.f47770k = true;
}
boolean e11 = e(webView, str);
if (e11) {
this.f47768i = 0L;
this.f47764e = false;
d();
com.mbridge.msdk.foundation.same.f.b.b().execute(new Runnable() {
@Override
public final void run() {
if (a.this.f47767h != null && a.this.f47771l != null) {
a.this.f47771l.setSuccess(true);
a.this.f47771l.setUrl(str);
a.this.f47771l.setType(2);
a.this.f47767h.a(a.this.f47771l, a.this.f47763d, 1, true);
}
if (a.this.f47762c != null) {
a.this.f47762c.onFinishRedirection(a.this.f47763d, str);
}
}
});
}
return e11;
}
@Override
public final void a(WebView webView, String str) {
if (this.f47768i == 0) {
this.f47768i = System.currentTimeMillis();
if (!this.f47773n) {
this.f47773n = true;
c();
}
}
this.f47772m = str;
this.f47764e = true;
}
@Override
public final void a(WebView webView, String str, Bitmap bitmap) {
if (this.f47768i == 0) {
this.f47768i = System.currentTimeMillis();
if (!this.f47773n) {
this.f47773n = true;
c();
}
this.f47770k = false;
}
this.f47772m = str;
this.f47764e = true;
}
private void c() {
this.f47766g.postDelayed(this.f47774o, this.f47769j);
}
private void d() {
this.f47766g.removeCallbacks(this.f47774o);
}
@Override
public final void a(WebView webView, int i11, final String str, final String str2) {
x.c(f47760a, str);
d();
com.mbridge.msdk.foundation.same.f.b.b().execute(new Runnable() {
@Override
public final void run() {
if (a.this.f47762c != null) {
a.this.f47762c.onFinishRedirection(a.this.f47763d, str2);
}
if (a.this.f47767h != null && a.this.f47771l != null) {
a.this.f47771l.setSuccess(false);
a.this.f47771l.setUrl(str2);
a.this.f47771l.setType(2);
a.this.f47771l.setExceptionMsg(str);
a.this.f47767h.a(a.this.f47771l, a.this.f47763d, 1, true);
}
}
});
if (!d(webView, str2) || this.f47770k) {
return;
}
this.f47770k = true;
a(this.f47761b, str2, this.f47763d);
}
public void a(Context context, String str, CampaignEx campaignEx) {
if (context == null) {
return;
}
try {
int i11 = MBCommonActivity.f46018d;
Intent intent = new Intent(context, (Class<?>) MBCommonActivity.class);
if (TextUtils.isEmpty(str)) {
return;
}
b.f47783a.put(str, this.f47765f);
if (ab.a.b(str)) {
str = "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", "");
}
intent.putExtra("url", str);
x.b("url", "webview url = " + str);
intent.setFlags(805306368);
intent.putExtra("mvcommon", campaignEx);
context.startActivity(intent);
} catch (Exception unused) {
ab.a(context, str, this.f47762c);
}
}
}