手机管家 v7.2.0版本的 MD5 值为:dd92ba71696e35a4b841cd1b5de53cd3
以下内容为反编译后的 c.java 源代码,内容仅作参考
package oicq.wlogin_sdk.quicklogin;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.net.Uri;
import android.net.http.SslCertificate;
import android.net.http.SslError;
import android.os.Build;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.tencent.kingkong.database.SQLiteDatabase;
import java.io.ByteArrayInputStream;
import java.security.MessageDigest;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import oicq.wlogin_sdk.tools.util;
final class c extends WebViewClient {
final String Rb;
final Activity a;
final WebView b;
public c(Activity activity, WebView webView, String str) {
this.a = activity;
this.b = webView;
this.Rb = str;
}
@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
try {
util.LOGI("ssl error " + sslError.getUrl() + ":" + sslError.getPrimaryError());
} catch (Error e) {
}
if (true == QuickLoginWebViewLoader.sslErrorProcessed) {
sslErrorHandler.proceed();
return;
}
if ((sslError.getPrimaryError() == 4 || sslError.getPrimaryError() == 1 || sslError.getPrimaryError() == 5 || sslError.getPrimaryError() == 3) && sslError.getUrl().startsWith("https://xui.ptlogin2.qq.com") && a(sslError.getCertificate())) {
sslErrorHandler.proceed();
QuickLoginWebViewLoader.sslErrorProcessed = true;
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this.a);
builder.setMessage("页面证书错误(" + sslError.getPrimaryError() + "),是否继续?");
builder.setPositiveButton("继续", new d(this, sslErrorHandler));
builder.setNegativeButton("取消", new e(this, sslErrorHandler));
builder.setOnCancelListener(new f(this, sslErrorHandler));
try {
builder.create().show();
} catch (Exception e2) {
}
}
private boolean a(SslCertificate sslCertificate) {
byte[] bArr = {51, -65, -44, 0, 73, 7, 89, -98, 112, -76, -112, -125, 58, 25, -96, -8, -40, -51, 57, -89, -92, -47, 9, -16, -108, 34, -93, -30, -1, -123, -89, -98};
byte[] byteArray = SslCertificate.saveState(sslCertificate).getByteArray("x509-certificate");
if (byteArray != null) {
try {
return Arrays.equals(MessageDigest.getInstance("SHA-256").digest(((X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(byteArray))).getEncoded()), bArr);
} catch (Exception e) {
}
}
return false;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (str != null) {
try {
webView.getContext().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
return true;
} catch (Exception e) {
StringBuilder append = new StringBuilder().append("load url ");
if (str == null) {
str = SQLiteDatabase.KeyEmpty;
}
util.LOGI(append.append(str).append(" failed ").append(e.getMessage()).toString(), SQLiteDatabase.KeyEmpty);
return true;
}
}
return false;
}
@Override
public void onPageFinished(WebView webView, String str) {
if (17 <= Build.VERSION.SDK_INT) {
this.b.loadUrl(this.Rb);
}
}
}