本文整理匯總了Java中android.webkit.SslErrorHandler.proceed方法的典型用法代碼示例。如果您正苦於以下問題:Java SslErrorHandler.proceed方法的具體用法?Java SslErrorHandler.proceed怎麽用?Java SslErrorHandler.proceed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.webkit.SslErrorHandler
的用法示例。
在下文中一共展示了SslErrorHandler.proceed方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
{
/*
* in theory this should be checked to make sure it's not null but if there is some failure
* in the association then usage of webViewProxy should trigger a NPE to make sure the issue
* is not ignored
*/
KrollProxy webViewProxy = this.webView.getProxy();
KrollDict data = new KrollDict();
data.put(TiC.ERROR_PROPERTY_CODE, error.getPrimaryError());
webView.getProxy().fireSyncEvent(TiC.EVENT_SSL_ERROR, data);
boolean ignoreSslError = false;
try {
ignoreSslError = webViewProxy.getProperties().optBoolean(TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR, false);
} catch(IllegalArgumentException e) {
Log.e(TAG, TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR + " property does not contain a boolean value, ignoring");
}
if (ignoreSslError == true) {
Log.w(TAG, "ran into SSL error but ignoring...");
handler.proceed();
} else {
Log.e(TAG, "SSL error occurred: " + error.toString());
handler.cancel();
}
}
示例2: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
/**
* Notify the host application that an SSL error occurred while loading a resource.
* The host application must call either handler.cancel() or handler.proceed().
* Note that the decision may be retained for use in response to future SSL errors.
* The default behavior is to cancel the load.
*
* @param view The WebView that is initiating the callback.
* @param handler An SslErrorHandler object that will handle the user's response.
* @param error The SSL error object.
*/
@TargetApi(8)
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
final String packageName = parentEngine.cordova.getActivity().getPackageName();
final PackageManager pm = parentEngine.cordova.getActivity().getPackageManager();
ApplicationInfo appInfo;
try {
appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// debug = true
handler.proceed();
return;
} else {
// debug = false
super.onReceivedSslError(view, handler, error);
}
} catch (NameNotFoundException e) {
// When it doubt, lock it out!
super.onReceivedSslError(view, handler, error);
}
}
示例3: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
/**
* Notify the host application that an SSL error occurred while loading a resource.
* The host application must call either handler.cancel() or handler.proceed().
* Note that the decision may be retained for use in response to future SSL errors.
* The default behavior is to cancel the load.
*
* @param view The WebView that is initiating the callback.
* @param handler An SslErrorHandler object that will handle the user's response.
* @param error The SSL error object.
*/
@TargetApi(8)
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
final String packageName = this.cordova.getActivity().getPackageName();
final PackageManager pm = this.cordova.getActivity().getPackageManager();
ApplicationInfo appInfo;
try {
appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// debug = true
handler.proceed();
return;
} else {
// debug = false
super.onReceivedSslError(view, handler, error);
}
} catch (NameNotFoundException e) {
// When it doubt, lock it out!
super.onReceivedSslError(view, handler, error);
}
}
示例4: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
com.alipay.sdk.app.statistic.a.a(c.a, c.g, "證書錯誤");
if (this.a.d) {
sslErrorHandler.proceed();
this.a.d = false;
return;
}
this.a.runOnUiThread(new d(this, sslErrorHandler));
}
示例5: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
if (this.a.g) {
sslErrorHandler.proceed();
this.a.g = false;
return;
}
this.a.runOnUiThread(new e(this, sslErrorHandler));
}
示例6: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, @NonNull SslErrorHandler handler, SslError error) {
if (BuildConfig.DEBUG) {
handler.proceed(); // ignore in debug builds
} else {
Log.exception(new RuntimeException("SSL error: " + error.toString()));
}
}
示例7: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
LogInfo.log("LM", "onReceivedSslError");
if (LetvWebViewActivity.this.baseUrl.contains(LetvUtils.WEB_INNER_FLAG) || !LetvConfig.getPcode().equals("010110016")) {
handler.proceed();
} else {
handler.cancel();
}
}
示例8: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, @NonNull final SslErrorHandler handler, @NonNull SslError error) {
List<Integer> errorCodeMessageCodes = getAllSslErrorMessageCodes(error);
StringBuilder stringBuilder = new StringBuilder();
for (Integer messageCode : errorCodeMessageCodes) {
stringBuilder.append(" - ").append(mActivity.getString(messageCode)).append('\n');
}
String alertMessage =
mActivity.getString(R.string.message_insecure_connection, stringBuilder.toString());
// AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
// builder.setTitle(mActivity.getString(R.string.title_warning));
// builder.setMessage(alertMessage)
// .setCancelable(true)
// .setPositiveButton(mActivity.getString(R.string.action_yes),
// new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int id) {
// handler.proceed();
// }
// })
// .setNegativeButton(mActivity.getString(R.string.action_no),
// new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int id) {
// handler.cancel();
// }
// });
// Dialog dialog = builder.show();
// BrowserDialog.setDialogSize(mActivity, dialog);
handler.proceed();
}
示例9: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (LetvOpenIDOAuthLoginActivity.this.baseUrl.contains(LetvUtils.WEB_INNER_FLAG) || !LetvConfig.getPcode().equals("010110016")) {
handler.proceed();
} else {
handler.cancel();
}
}
示例10: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
if (this.a.d) {
sslErrorHandler.proceed();
this.a.d = false;
return;
}
this.a.runOnUiThread(new c(this, sslErrorHandler));
}
示例11: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
// Ignore SSL certificate errors
handler.proceed();
// Log the error message for debugging
Log.d(getClass().getSimpleName(), error.toString());
}
示例12: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
com.alipay.sdk.app.statistic.a.a(c.a, c.f, "證書錯誤");
if (this.a.e) {
sslErrorHandler.proceed();
this.a.e = false;
return;
}
this.a.runOnUiThread(new i(this, sslErrorHandler));
}
示例13: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (DISABLE_SSL_CHECK_FOR_TESTING) {
handler.proceed();
} else {
super.onReceivedSslError(view, handler, error);
handler.cancel();
sendErrorToListener(new FacebookDialogException(null, ERROR_FAILED_SSL_HANDSHAKE, null));
}
}
示例14: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (DISABLE_SSL_CHECK_FOR_TESTING) {
handler.proceed();
} else {
super.onReceivedSslError(view, handler, error);
sendErrorToListener(new FacebookDialogException(null, ERROR_FAILED_SSL_HANDSHAKE, null));
handler.cancel();
WebDialog.this.dismiss();
}
}
示例15: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
/**
* Catch (self-signed) SSL errors and test if they correspond to Syncthing's certificate.
*/
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
try {
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
// The mX509Certificate field is not available for ICS- devices
Log.w(TAG, "Skipping certificate check for devices <ICS");
handler.proceed();
return;
}
// Use reflection to access the private mX509Certificate field of SslCertificate
SslCertificate sslCert = error.getCertificate();
Field f = sslCert.getClass().getDeclaredField("mX509Certificate");
f.setAccessible(true);
X509Certificate cert = (X509Certificate)f.get(sslCert);
if (cert == null) {
Log.w(TAG, "X509Certificate reference invalid");
handler.cancel();
return;
}
cert.verify(mCaCert.getPublicKey());
handler.proceed();
} catch (NoSuchFieldException|IllegalAccessException|CertificateException|
NoSuchAlgorithmException|InvalidKeyException|NoSuchProviderException|
SignatureException e) {
Log.w(TAG, e);
handler.cancel();
}
}