360 Wi-Fi v1.0.1版本的 MD5 值为:53dc85b63eb655b13344ce30ddaccae2
以下内容为反编译后的 h.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.URLUtil;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import java.util.HashMap;
public class h {
public static long a = 0;
private static final String d = "h";
private static final int p = 1;
private static final int q = 2;
private static final int r = 0;
boolean b;
boolean c;
private int e;
private int f;
private com.anythink.expressad.e.a h;
private a f2093i;
private String j;
private String k;
private WebView f2094l;
private boolean m;
private String n;
private int o;
private boolean t;
private boolean s = false;
private final Runnable u = new Runnable() {
@Override
public final void run() {
h.n(h.this);
h.this.o = 1;
String unused = h.d;
int unused2 = h.this.f;
h.p(h.this);
}
};
private final Runnable v = new Runnable() {
@Override
public final void run() {
h.n(h.this);
h.this.o = 2;
String unused = h.d;
int unused2 = h.this.e;
h.p(h.this);
}
};
private 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 h(boolean z) {
this.e = 15000;
this.f = 3000;
com.anythink.expressad.e.b.a();
com.anythink.expressad.foundation.b.a.c().f();
com.anythink.expressad.e.a b = com.anythink.expressad.e.b.b();
this.h = b;
if (b == null) {
com.anythink.expressad.e.b.a();
this.h = com.anythink.expressad.e.b.c();
}
this.m = this.h.v();
if (z) {
this.e = (int) this.h.q();
this.f = (int) this.h.q();
return;
}
this.e = (int) this.h.r();
this.f = (int) this.h.r();
}
private void c() {
synchronized (d) {
try {
f();
this.f2094l.destroy();
a aVar = this.f2093i;
if (aVar != null) {
aVar.a(this.j, this.n);
}
} catch (Throwable unused) {
}
}
}
public static boolean e(h hVar) {
hVar.t = true;
return true;
}
public void f() {
j();
h();
}
public static void m(h hVar) {
hVar.j();
hVar.g.postDelayed(hVar.u, hVar.f);
}
public static boolean n(h hVar) {
hVar.s = true;
return true;
}
public static void p(h hVar) {
synchronized (d) {
try {
hVar.f();
hVar.f2094l.destroy();
a aVar = hVar.f2093i;
if (aVar != null) {
aVar.a(hVar.j, hVar.n);
}
} catch (Throwable unused) {
}
}
}
private void b() {
synchronized (d) {
try {
f();
a aVar = this.f2093i;
if (aVar != null) {
aVar.a(this.j, this.n);
}
} catch (Throwable unused) {
}
}
}
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(h hVar) {
hVar.h();
hVar.g.postDelayed(hVar.v, hVar.e);
}
public final void a(String str, String str2, String str3, Context context, String str4, String str5, a aVar) {
if (aVar != null) {
this.k = str5;
this.j = str4;
this.f2093i = aVar;
a(str, str2, str3, context);
return;
}
throw new NullPointerException("OverrideUrlLoadingListener can not be null");
}
public static void c(h hVar) {
synchronized (d) {
try {
hVar.f();
a aVar = hVar.f2093i;
if (aVar != null) {
aVar.a(hVar.j, hVar.n);
}
} catch (Throwable unused) {
}
}
}
public final void a(String str, String str2, String str3, Context context, String str4, a aVar) {
if (aVar != null) {
this.j = str4;
this.f2093i = aVar;
a(str, str2, str3, context);
return;
}
throw new NullPointerException("OverrideUrlLoadingListener can not be null");
}
private void a(final String str, final String str2, final String str3, final Context context) {
if (Thread.currentThread() == Looper.getMainLooper().getThread()) {
a(str2, str3, context, this.j);
} else {
this.g.post(new Runnable() {
@Override
public final void run() {
h hVar = h.this;
hVar.a(str2, str3, context, hVar.j);
}
});
}
}
public void a(String str, String str2, Context context, String str3) {
try {
a(context, str, str2);
if (!TextUtils.isEmpty(this.k)) {
this.f2094l.getSettings().setDefaultTextEncodingName(com.anythink.expressad.foundation.g.a.bR);
this.f = 2000;
this.e = 2000;
this.f2094l.loadDataWithBaseURL(str3, this.k, "*/*", com.anythink.expressad.foundation.g.a.bR, str3);
} else if (this.m) {
HashMap hashMap = new HashMap();
if (this.f2094l.getUrl() != null) {
hashMap.put("Referer", this.f2094l.getUrl());
}
this.f2094l.loadUrl(str3, hashMap);
} else {
this.f2094l.loadUrl(str3);
}
} catch (Throwable th) {
try {
a aVar = this.f2093i;
if (aVar != null) {
aVar.a(this.j, th.getMessage(), this.n);
}
} catch (Exception unused) {
}
}
}
@SuppressLint({"SetJavaScriptEnabled"})
private void a(Context context, final String str, final String str2) {
WebView webView = new WebView(context);
this.f2094l = webView;
webView.getSettings().setJavaScriptEnabled(true);
this.f2094l.getSettings().setCacheMode(2);
this.f2094l.getSettings().setLoadsImagesAutomatically(false);
this.f2094l.setWebViewClient(new WebViewClient() {
private boolean a() {
h hVar = h.this;
if (!hVar.b && !hVar.c) {
return false;
}
return true;
}
@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 (h.this.t) {
h.this.o = 0;
h.c(h.this);
return;
}
h.this.c = false;
if (webView2.getTag() == null) {
webView2.setTag("has_first_started");
} else {
h.this.b = true;
}
synchronized (h.d) {
h hVar = h.this;
if (hVar.b || hVar.c) {
}
if (URLUtil.isHttpsUrl(str3)) {
String unused = h.d;
} else {
String unused2 = h.d;
}
h.this.j = str3;
if (h.this.f2093i != null && h.this.f2093i.a(str3)) {
h.e(h.this);
h.c(h.this);
} else {
h.f(h.this);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public final void onReceivedError(WebView webView2, int i2, String str3, String str4) {
String unused = h.d;
webView2.getUrl();
synchronized (h.d) {
h.e(h.this);
h.this.f();
h.c(h.this);
}
if (h.this.f2093i != null) {
h.this.f2093i.a(webView2.getUrl(), str3, h.this.n);
}
}
@Override
public final void onReceivedSslError(WebView webView2, SslErrorHandler sslErrorHandler, SslError sslError) {
try {
String unused = h.d;
if (com.anythink.expressad.a.r && sslErrorHandler != null) {
sslErrorHandler.cancel();
}
if (!TextUtils.isEmpty(str2)) {
TextUtils.isEmpty(str);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView2, String str3) {
synchronized (h.d) {
String unused = h.d;
h hVar = h.this;
hVar.c = true;
hVar.j();
if (h.this.t) {
h.this.h();
h.c(h.this);
return true;
}
h.this.j = str3;
if (h.this.f2093i != null && h.this.f2093i.b(str3)) {
h.e(h.this);
h.this.h();
h.c(h.this);
return true;
}
if (h.this.m) {
HashMap hashMap = new HashMap();
if (h.this.f2094l.getUrl() != null) {
hashMap.put("Referer", h.this.f2094l.getUrl());
}
h.this.f2094l.loadUrl(str3, hashMap);
} else {
h.this.f2094l.loadUrl(str3);
}
return true;
}
}
});
this.f2094l.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 {
String unused = h.d;
webView2.getUrl();
webView2.loadUrl("javascript:window.navigator.vibrate([]);");
if (!h.this.t) {
h hVar = h.this;
if (!hVar.c) {
h.m(hVar);
}
}
if (h.this.f2093i != null) {
a aVar = h.this.f2093i;
webView2.getUrl();
aVar.a();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
});
}
}