Spermatid v6.1.8版本的 MD5 值为:a375ce51a42d528ba6e2583c10478296
以下内容为反编译后的 InnerWebView.java 源代码,内容仅作参考
package com.maoyanym.views;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.os.Build;
import android.util.AttributeSet;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.DownloadListener;
import android.webkit.SslErrorHandler;
import android.webkit.WebBackForwardList;
import android.webkit.WebChromeClient;
import android.webkit.WebHistoryItem;
import android.webkit.WebSettings;
import android.webkit.WebStorage;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.maoyanym.utils.p;
import com.maoyanym.views.CommonWebView;
public class InnerWebView extends ScrollWebView implements DownloadListener {
private CommonWebView.a2 f18155f;
private CommonWebView.y1 f18156g;
private CommonWebView f18157h;
private boolean f18158i;
private float f18159j;
public class a extends WebViewClient {
public final CommonWebView f18160a;
public a(CommonWebView commonWebView) {
this.f18160a = commonWebView;
}
@Override
public void onPageFinished(WebView webView, String str) {
if (InnerWebView.this.f18155f != null) {
InnerWebView.this.f18155f.a(this.f18160a, str);
}
super.onPageFinished(webView, str);
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
if (InnerWebView.this.f18155f != null) {
InnerWebView.this.f18155f.a(this.f18160a, str, bitmap);
}
super.onPageStarted(webView, str, bitmap);
}
@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
if (InnerWebView.this.f18155f != null) {
InnerWebView.this.f18155f.a(this.f18160a, new f(sslErrorHandler), new e(sslError));
} else {
super.onReceivedSslError(webView, sslErrorHandler, sslError);
}
}
@Override
public void onScaleChanged(WebView webView, float f10, float f11) {
InnerWebView.this.f18159j = f11;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (InnerWebView.this.f18155f == null || !InnerWebView.this.f18155f.b(this.f18160a, str)) {
return super.shouldOverrideUrlLoading(webView, str);
}
return true;
}
}
public class b extends WebChromeClient {
public final CommonWebView f18162a;
public b(CommonWebView commonWebView) {
this.f18162a = commonWebView;
}
@Override
public void onProgressChanged(WebView webView, int i10) {
if (InnerWebView.this.f18156g != null) {
InnerWebView.this.f18156g.a(this.f18162a, i10);
}
}
@Override
public void onReceivedTitle(WebView webView, String str) {
if (InnerWebView.this.f18156g != null) {
InnerWebView.this.f18156g.a(this.f18162a, str);
}
}
}
public class c extends WebViewClient {
public final InnerWebView f18164a;
public c(InnerWebView innerWebView) {
this.f18164a = innerWebView;
}
@Override
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
try {
String cookie = CookieManager.getInstance().getCookie("http://boardy.huanqiu.com");
CookieManager.getInstance().removeAllCookie();
CookieManager.getInstance().removeSessionCookie();
if (p.c(cookie)) {
for (String str2 : cookie.split(";")) {
String trim = str2.trim();
String[] split = trim.split("=");
if (split.length > 1) {
String trim2 = split[0].trim();
if (!trim2.startsWith("smuc") && !trim2.startsWith("smub")) {
CookieManager.getInstance().setCookie("http://boardy.huanqiu.com", trim);
}
this.f18164a.loadUrl("javascript:localStorage.removeItem('" + trim2 + "')");
}
}
}
} catch (Throwable unused) {
}
InnerWebView.this.reload();
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
webView.loadUrl(str);
return true;
}
}
public class d extends WebViewClient {
public final InnerWebView f18166a;
public final String f18167b;
public d(InnerWebView innerWebView, String str) {
this.f18166a = innerWebView;
this.f18167b = str;
}
@Override
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
try {
CookieSyncManager.createInstance(com.maoyanym.b.a.j());
com.tencent.smtt.sdk.CookieManager cookieManager = com.tencent.smtt.sdk.CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= 21) {
cookieManager.removeAllCookie();
cookieManager.removeSessionCookie();
cookieManager.flush();
} else {
cookieManager.removeAllCookie();
cookieManager.removeSessionCookie();
CookieSyncManager.getInstance().sync();
}
this.f18166a.loadUrl("javascript:localStorage.clear()");
InnerWebView.this.loadUrl("javascript:" + this.f18167b + "()");
} catch (Throwable unused) {
}
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
webView.loadUrl(str);
return true;
}
}
public static class e implements CommonWebView.v1 {
private SslError f18169a;
public e(SslError sslError) {
this.f18169a = sslError;
}
@Override
public String a() {
SslError sslError = this.f18169a;
return sslError != null ? sslError.getUrl() : "";
}
@Override
public int b() {
SslError sslError = this.f18169a;
if (sslError != null) {
return sslError.getPrimaryError();
}
return -1;
}
}
public static class f implements CommonWebView.w1 {
private SslErrorHandler f18170a;
public f(SslErrorHandler sslErrorHandler) {
this.f18170a = sslErrorHandler;
}
@Override
public void a() {
SslErrorHandler sslErrorHandler = this.f18170a;
if (sslErrorHandler != null) {
sslErrorHandler.cancel();
}
}
@Override
public void b() {
SslErrorHandler sslErrorHandler = this.f18170a;
if (sslErrorHandler != null) {
sslErrorHandler.proceed();
}
}
}
public static class g implements CommonWebView.x1 {
private WebBackForwardList f18171a;
public g(WebBackForwardList webBackForwardList) {
this.f18171a = webBackForwardList;
}
@Override
public int a() {
WebBackForwardList webBackForwardList = this.f18171a;
if (webBackForwardList != null) {
return webBackForwardList.getCurrentIndex();
}
return 0;
}
@Override
public CommonWebView.z1 a(int i10) {
WebBackForwardList webBackForwardList = this.f18171a;
if (webBackForwardList == null || i10 < 0 || i10 >= webBackForwardList.getSize()) {
return null;
}
return new h(this.f18171a.getItemAtIndex(i10));
}
}
public static class h implements CommonWebView.z1 {
private WebHistoryItem f18172a;
public h(WebHistoryItem webHistoryItem) {
this.f18172a = webHistoryItem;
}
@Override
public String a() {
WebHistoryItem webHistoryItem = this.f18172a;
if (webHistoryItem != null) {
return webHistoryItem.getUrl();
}
return null;
}
@Override
public String b() {
WebHistoryItem webHistoryItem = this.f18172a;
if (webHistoryItem != null) {
return webHistoryItem.getOriginalUrl();
}
return null;
}
}
public InnerWebView(Context context) {
super(a(context));
this.f18158i = true;
this.f18159j = 1.0f;
}
public InnerWebView(Context context, AttributeSet attributeSet) {
super(a(context), attributeSet);
this.f18158i = true;
this.f18159j = 1.0f;
}
public InnerWebView(Context context, AttributeSet attributeSet, int i10) {
super(a(context), attributeSet, i10);
this.f18158i = true;
this.f18159j = 1.0f;
}
public InnerWebView(Context context, AttributeSet attributeSet, int i10, int i11) {
super(a(context), attributeSet, i10, i11);
this.f18158i = true;
this.f18159j = 1.0f;
}
public InnerWebView(Context context, AttributeSet attributeSet, int i10, boolean z10) {
super(a(context), attributeSet, i10, z10);
this.f18158i = true;
this.f18159j = 1.0f;
}
private static Context a(Context context) {
int i10 = Build.VERSION.SDK_INT;
return (i10 < 21 || i10 >= 23) ? context : context.createConfigurationContext(new Configuration());
}
public void a(CommonWebView commonWebView) {
this.f18157h = commonWebView;
getSettings().setJavaScriptEnabled(true);
getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
getSettings().setLoadsImagesAutomatically(true);
getSettings().setAllowFileAccess(true);
addJavascriptInterface(commonWebView, "Client");
CookieManager.getInstance().setAcceptCookie(true);
int i10 = Build.VERSION.SDK_INT;
if (i10 >= 21) {
getSettings().setMixedContentMode(0);
CookieManager.getInstance().setAcceptThirdPartyCookies(this, true);
}
getSettings().setUseWideViewPort(true);
getSettings().setLoadWithOverviewMode(true);
getSettings().setSaveFormData(true);
getSettings().setSavePassword(true);
getSettings().setDefaultZoom(WebSettings.ZoomDensity.MEDIUM);
getSettings().setSupportZoom(true);
getSettings().setTextZoom(100);
getSettings().setBuiltInZoomControls(true);
if (i10 >= 11) {
getSettings().setDisplayZoomControls(false);
}
if (i10 > 8) {
getSettings().setPluginState(WebSettings.PluginState.ON_DEMAND);
}
getSettings().setAppCacheEnabled(true);
getSettings().setDatabaseEnabled(true);
getSettings().setDomStorageEnabled(true);
setLongClickable(true);
setVerticalScrollBarEnabled(false);
setHorizontalScrollBarEnabled(false);
setWebViewClient(new a(commonWebView));
setWebChromeClient(new b(commonWebView));
setDownloadListener(this);
this.f18159j = super.getScale();
}
public void a(String str) {
try {
if (!com.maoyanym.c.c.u()) {
InnerWebView innerWebView = new InnerWebView(getContext());
innerWebView.a(this.f18157h);
innerWebView.setDownloadEnable(false);
innerWebView.setWebViewClient(new d(innerWebView, str));
innerWebView.loadUrl("http://boardy.huanqiu.com");
return;
}
CookieSyncManager.createInstance(com.maoyanym.b.a.j());
CookieManager cookieManager = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= 21) {
cookieManager.removeAllCookie();
cookieManager.removeSessionCookie();
cookieManager.flush();
} else {
cookieManager.removeAllCookie();
cookieManager.removeSessionCookie();
CookieSyncManager.getInstance().sync();
}
WebStorage.getInstance().deleteAllData();
loadUrl("javascript:" + str + "()");
} catch (Throwable unused) {
}
}
public void b() {
try {
InnerWebView innerWebView = new InnerWebView(getContext());
innerWebView.a(this.f18157h);
innerWebView.setDownloadEnable(false);
innerWebView.setWebViewClient(new c(innerWebView));
innerWebView.loadUrl("http://boardy.huanqiu.com");
} catch (Throwable unused) {
}
}
public boolean c() {
try {
String cookie = CookieManager.getInstance().getCookie("http://boardy.huanqiu.com");
if (p.c(cookie)) {
for (String str : cookie.split(";")) {
if (str.contains("smub")) {
return false;
}
}
}
} catch (Throwable unused) {
}
return true;
}
@Override
public float getScale() {
return this.f18159j;
}
public String getUA() {
return getSettings().getUserAgentString();
}
public CommonWebView.x1 innercopyBackForwardList() {
return new g(super.copyBackForwardList());
}
@Override
public void onDownloadStart(String str, String str2, String str3, String str4, long j10) {
if (this.f18158i) {
this.f18157h.onDownloadStart(str, str2, str3, str4, j10);
}
}
public void setCacheMode(int i10) {
getSettings().setCacheMode(i10);
}
public void setCommonWebChromeClient(CommonWebView.y1 y1Var) {
this.f18156g = y1Var;
}
public void setCommonWebViewClient(CommonWebView.a2 a2Var) {
this.f18155f = a2Var;
}
public void setDownloadEnable(boolean z10) {
this.f18158i = z10;
}
public void setJavaScriptEnabled(boolean z10) {
getSettings().setJavaScriptEnabled(z10);
}
public void setMediaPlaybackRequiresUserGesture(boolean z10) {
if (Build.VERSION.SDK_INT < 17) {
return;
}
getSettings().setMediaPlaybackRequiresUserGesture(z10);
}
@Override
public void setOverScrollMode(int i10) {
boolean contains;
boolean contains2;
boolean contains3;
try {
super.setOverScrollMode(i10);
} finally {
if (!contains) {
if (!contains2) {
if (contains3) {
}
}
}
}
}
}