Spermatid v6.1.8版本的 MD5 值为:a375ce51a42d528ba6e2583c10478296
以下内容为反编译后的 a.java 源代码,内容仅作参考
package kd;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.util.Log;
import android.webkit.DownloadListener;
import android.webkit.SslErrorHandler;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.czhj.sdk.common.Constants;
import com.czhj.sdk.common.network.JsonRequest;
import java.util.Iterator;
public class a {
public Activity f33626a;
public ValueCallback<Uri> f33628c;
public ValueCallback<Uri[]> f33629d;
public WebViewClient f33627b = new C1303a();
public WebChromeClient f33630e = new b();
public class b extends WebChromeClient {
public b() {
}
@Override
public void onProgressChanged(WebView webView, int i10) {
super.onProgressChanged(webView, i10);
a.this.f33626a.isFinishing();
}
@Override
public void onReceivedTitle(WebView webView, String str) {
if (str == null || str.equals("")) {
return;
}
a.this.f33626a.setTitle(str);
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> valueCallback, WebChromeClient.FileChooserParams fileChooserParams) {
a aVar = a.this;
aVar.f33629d = valueCallback;
aVar.a();
return true;
}
}
public class c implements DownloadListener {
public c() {
}
@Override
public void onDownloadStart(String str, String str2, String str3, String str4, long j10) {
Log.d("test", "onReceivedError.onDownloadStart=" + str);
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.addCategory("android.intent.category.BROWSABLE");
intent.setData(Uri.parse(str));
a aVar = a.this;
if (aVar.d(aVar.f33626a, intent)) {
intent.setComponent(new ComponentName("com.android.browser", "com.android.browser.BrowserActivity"));
}
a.this.f33626a.startActivity(intent);
}
}
public final void a() {
Intent intent = new Intent("android.intent.action.GET_CONTENT");
intent.addCategory("android.intent.category.OPENABLE");
intent.setType("image/*");
this.f33626a.startActivityForResult(Intent.createChooser(intent, "Image Chooser"), 12);
}
public void b(Activity activity, WebView webView) {
this.f33626a = activity;
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setAppCacheMaxSize(8388608L);
settings.setAllowFileAccess(true);
settings.setAppCacheEnabled(true);
settings.setAppCachePath(activity.getApplication().getCacheDir().getAbsolutePath());
settings.setDatabaseEnabled(true);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
settings.setDisplayZoomControls(false);
settings.setTextZoom(100);
settings.setCacheMode(2);
settings.setAllowFileAccess(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setLoadsImagesAutomatically(true);
settings.setDefaultTextEncodingName(JsonRequest.PROTOCOL_CHARSET);
settings.setBlockNetworkImage(false);
settings.setUseWideViewPort(true);
if (Build.VERSION.SDK_INT >= 21) {
settings.setMixedContentMode(0);
}
webView.setWebChromeClient(this.f33630e);
webView.setWebViewClient(this.f33627b);
webView.setDownloadListener(new c());
}
public final boolean d(Context context, Intent intent) {
Iterator<ResolveInfo> it = context.getPackageManager().queryIntentActivities(intent, 65536).iterator();
while (it.hasNext()) {
if (it.next().activityInfo.packageName.contains("com.android.browser")) {
return true;
}
}
return false;
}
public class C1303a extends WebViewClient {
public class DialogInterfaceOnClickListenerC1304a implements DialogInterface.OnClickListener {
public final Activity f33632a;
public DialogInterfaceOnClickListenerC1304a(C1303a c1303a, Activity activity) {
this.f33632a = activity;
}
@Override
public void onClick(DialogInterface dialogInterface, int i10) {
this.f33632a.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://d.alipay.com")));
}
}
public C1303a() {
}
@Override
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
a.this.f33626a.isFinishing();
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
super.onPageStarted(webView, str, bitmap);
}
@Override
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
int errorCode = webResourceError.getErrorCode();
Log.d("test", "onReceivedError.errCode=" + errorCode);
if (errorCode != 400) {
return;
}
webView.loadUrl("file:///android_assets/error_handle.html");
}
@Override
public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
}
@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
sslErrorHandler.proceed();
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
Log.d("test", "onReceivedError.shouldOverrideUrlLoading=" + str);
if (a.this.f33626a.isFinishing()) {
return true;
}
Activity activity = a.this.f33626a;
if (!str.startsWith("alipays:") && !str.startsWith("alipay")) {
if (str.startsWith("weixin:")) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
activity.startActivity(intent);
return true;
}
if (str.startsWith(Constants.HTTP) || str.startsWith("https")) {
return false;
}
try {
Intent parseUri = Intent.parseUri(str, 1);
parseUri.setFlags(805306368);
parseUri.addCategory("android.intent.category.BROWSABLE");
parseUri.setComponent(null);
activity.startActivity(parseUri);
return true;
} catch (Exception e10) {
e10.printStackTrace();
return true;
}
}
try {
activity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
} catch (Exception unused) {
new AlertDialog.Builder(activity).setMessage("未检测到支付宝客户端,请安装后重试。").setPositiveButton("立即安装", new DialogInterfaceOnClickListenerC1304a(this, activity)).setNegativeButton("取消", (DialogInterface.OnClickListener) null).show();
}
return true;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
return super.shouldOverrideUrlLoading(webView, webResourceRequest);
}
}
}