JieJing Cleaner v1.4.2版本的 MD5 值为:a574eea9fb07160f0bbb08ba0adf1c62
以下内容为反编译后的 f.java 源代码,内容仅作参考
package com.anythink.expressad.a;
import android.annotation.SuppressLint;
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.WebView;
import android.webkit.WebViewClient;
import com.anythink.expressad.foundation.g.n;
import java.util.HashMap;
public class f {
public static long a = 0;
public static final String d = "f";
public static final int p = 1;
public static final int f1481q = 2;
public static final int r = 0;
public boolean b;
public boolean c;
public int e;
public int f;
public com.anythink.expressad.b.a f1482h;
public a f1483i;
public String j;
public String k;
public WebView l;
public boolean m;
public String n;
public int o;
public boolean t;
public boolean s = false;
public final Runnable u = new Runnable() {
@Override
public final void run() {
f.n(f.this);
f.this.o = 1;
f.o(f.this);
}
};
public final Runnable v = new Runnable() {
@Override
public final void run() {
f.n(f.this);
f.this.o = 2;
f.o(f.this);
}
};
public Handler g = new Handler(Looper.getMainLooper());
public interface a {
void a(String str, String str2);
void a(String str, String str2, String str3);
boolean a();
boolean a(String str);
boolean b(String str);
}
public f() {
this.e = 15000;
this.f = 3000;
com.anythink.expressad.b.b.a();
com.anythink.expressad.b.a b = com.anythink.expressad.b.b.b();
this.f1482h = b;
this.m = b.t();
this.e = (int) this.f1482h.z();
this.f = (int) this.f1482h.z();
}
private void c() {
synchronized (d) {
try {
try {
f();
this.l.destroy();
if (this.f1483i != null) {
this.f1483i.a(this.j, this.n);
}
} catch (Exception e) {
n.c(d, e.getMessage());
}
}
}
}
public static boolean e(f fVar) {
fVar.t = true;
return true;
}
public void f() {
j();
h();
}
public static void m(f fVar) {
fVar.j();
fVar.g.postDelayed(fVar.u, fVar.f);
}
public static boolean n(f fVar) {
fVar.s = true;
return true;
}
public static void o(f fVar) {
synchronized (d) {
try {
try {
fVar.f();
fVar.l.destroy();
if (fVar.f1483i != null) {
fVar.f1483i.a(fVar.j, fVar.n);
}
} catch (Exception e) {
n.c(d, e.getMessage());
}
}
}
}
private void b() {
synchronized (d) {
try {
f();
if (this.f1483i != null) {
this.f1483i.a(this.j, this.n);
}
} catch (Exception e) {
n.c(d, e.getMessage());
} catch (Throwable th) {
n.c(d, th.getMessage());
}
}
}
private void d() {
h();
this.g.postDelayed(this.v, this.e);
}
private void e() {
j();
this.g.postDelayed(this.u, this.f);
}
private void g() {
this.g.postDelayed(this.v, this.e);
}
public void h() {
this.g.removeCallbacks(this.v);
}
private void i() {
this.g.postDelayed(this.u, this.f);
}
public void j() {
this.g.removeCallbacks(this.u);
}
public static void f(f fVar) {
fVar.h();
fVar.g.postDelayed(fVar.v, fVar.e);
}
public final void a(String str, String str2, Context context, String str3, String str4, a aVar) {
if (aVar != null) {
this.k = str4;
this.j = str3;
this.f1483i = aVar;
a(str, str2, context);
return;
}
throw new NullPointerException("OverrideUrlLoadingListener can not be null");
}
public static void c(f fVar) {
synchronized (d) {
try {
fVar.f();
if (fVar.f1483i != null) {
fVar.f1483i.a(fVar.j, fVar.n);
}
} catch (Exception e) {
n.c(d, e.getMessage());
} catch (Throwable th) {
n.c(d, th.getMessage());
}
}
}
public final void a(String str, String str2, Context context, String str3, a aVar) {
if (aVar != null) {
this.j = str3;
this.f1483i = aVar;
a(str, str2, context);
return;
}
throw new NullPointerException("OverrideUrlLoadingListener can not be null");
}
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(com.anythink.expressad.foundation.f.a.F);
this.f = 2000;
this.e = 2000;
n.b(d, this.k);
this.l.loadDataWithBaseURL(str3, this.k, "*/*", com.anythink.expressad.foundation.f.a.F, str3);
} else if (this.m) {
HashMap hashMap = new HashMap();
if (this.l.getUrl() != null) {
hashMap.put("Referer", this.l.getUrl());
}
this.l.loadUrl(str3, hashMap);
} else {
this.l.loadUrl(str3);
}
} catch (Throwable th) {
try {
if (this.f1483i != null) {
this.f1483i.a(this.j, th.getMessage(), this.n);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@SuppressLint({"SetJavaScriptEnabled"})
private void a(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() {
private boolean a() {
f fVar = f.this;
return fVar.b || fVar.c;
}
@Override
public final void onPageFinished(WebView webView2, String str3) {
super.onPageFinished(webView2, str3);
try {
webView2.loadUrl("javascript:window.navigator.vibrate([]);");
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public final void onPageStarted(WebView webView2, String str3, Bitmap bitmap) {
try {
webView2.loadUrl("javascript:window.navigator.vibrate([]);");
if (f.this.t) {
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.f1483i != null && f.this.f1483i.a(str3)) {
f.e(f.this);
f.c(f.this);
} else {
f.f(f.this);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public final void onReceivedError(WebView webView2, int i2, String str3, String str4) {
synchronized (f.d) {
f.e(f.this);
f.this.f();
f.c(f.this);
}
if (f.this.f1483i != null) {
f.this.f1483i.a(webView2.getUrl(), str3, f.this.n);
}
}
@Override
public final void onReceivedSslError(WebView webView2, SslErrorHandler sslErrorHandler, SslError sslError) {
try {
if (com.anythink.expressad.a.e && sslErrorHandler != null) {
sslErrorHandler.cancel();
}
if (TextUtils.isEmpty(str2)) {
return;
}
TextUtils.isEmpty(str);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView2, String str3) {
synchronized (f.d) {
f.this.c = true;
f.this.j();
if (f.this.t) {
f.this.h();
f.c(f.this);
return true;
}
f.this.j = str3;
if (f.this.f1483i == null || !f.this.f1483i.b(str3)) {
if (!f.this.m) {
f.this.l.loadUrl(str3);
} else {
HashMap hashMap = new HashMap();
if (f.this.l.getUrl() != null) {
hashMap.put("Referer", f.this.l.getUrl());
}
f.this.l.loadUrl(str3, hashMap);
}
return true;
}
f.e(f.this);
f.this.h();
f.c(f.this);
return true;
}
}
});
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 i2) {
if (i2 == 100) {
try {
webView2.loadUrl("javascript:window.navigator.vibrate([]);");
if (!f.this.t && !f.this.c) {
f.m(f.this);
}
if (f.this.f1483i != null) {
a unused = f.this.f1483i;
webView2.getUrl();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
});
}
}