當前位置: 首頁>>代碼示例>>Java>>正文


Java SslErrorHandler.cancel方法代碼示例

本文整理匯總了Java中android.webkit.SslErrorHandler.cancel方法的典型用法代碼示例。如果您正苦於以下問題:Java SslErrorHandler.cancel方法的具體用法?Java SslErrorHandler.cancel怎麽用?Java SslErrorHandler.cancel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.webkit.SslErrorHandler的用法示例。


在下文中一共展示了SslErrorHandler.cancel方法的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();
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:32,代碼來源:TiWebViewClient.java

示例2: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    handler.cancel();

    // WebView can try to load the favicon for a bad page when you set a new URL. If we then
    // loadErrorPage() again, WebView tries to load the favicon again. We end up in onReceivedSSlError()
    // again, and we get an infinite loop of reloads (we also erroneously show the favicon URL
    // in the toolbar, but that's less noticeable). Hence we check whether this error is from
    // the desired page, or a page resource:
    if (error.getUrl().equals(currentPageURL)) {
        TelemetryWrapper.sslErrorEvent(true, error);
        ErrorPage.loadErrorPage(view, error.getUrl(), WebViewClient.ERROR_FAILED_SSL_HANDSHAKE);
    } else {
        TelemetryWrapper.sslErrorEvent(false, error);
    }
}
 
開發者ID:mozilla-mobile,項目名稱:focus-android,代碼行數:17,代碼來源:FocusWebViewClient.java

示例3: 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));
    }
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:12,代碼來源:WebDialog.java

示例4: 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();
    }
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:13,代碼來源:WebDialog.java

示例5: 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();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:9,代碼來源:LetvWebViewActivity.java

示例6: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    if (HongKongLoginWebview.this.baseUrl.contains(LetvUtils.WEB_INNER_FLAG) || !LetvConfig.getPcode().equals("010110016")) {
        handler.proceed();
    } else {
        handler.cancel();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:8,代碼來源:HongKongLoginWebview.java

示例7: 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();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:8,代碼來源:LetvOpenIDOAuthLoginActivity.java

示例8: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    if (this.mCallBack != null) {
        this.mCallBack.onReceivedSslErrorCallBack(view, handler, error);
    }
    handler.cancel();
    this.mShareRequestParam.sendSdkErrorResponse(this.mAct, "ReceivedSslError");
    WeiboSdkBrowser.closeBrowser(this.mAct, this.mShareRequestParam.getAuthListenerKey(), null);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:9,代碼來源:ShareWeiboWebViewClient.java

示例9: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@TargetApi(8)
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError
        sslError) {
    sslErrorHandler.cancel();
    this.a.c.onError(new UiError(sslError.getPrimaryError(),
            "請求不合法,請檢查手機安全設置,如係統時間、代理等。", "ssl error"));
    this.a.dismiss();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:9,代碼來源:AuthDialog.java

示例10: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    super.onReceivedSslError(view, handler, error);

    sendErrorToListener(new KakaoWebviewException(ERROR_FAILED_SSL_HANDSHAKE, null, null));
    handler.cancel();
    dismiss();
}
 
開發者ID:yongbeam,項目名稱:Android-kakaologin-gradle-sample,代碼行數:9,代碼來源:KakaoWebViewDialog.java

示例11: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    handler.cancel();
    view.stopLoading();
    mActivity.finishWithResult(
            ThreeDSecureAuthenticationResponse.fromException(error.toString()));
}
 
開發者ID:braintree,項目名稱:braintree_android,代碼行數:8,代碼來源:ThreeDSecureWebViewClient.java

示例12: 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();
    }
}
 
開發者ID:syncthing,項目名稱:syncthing-android,代碼行數:33,代碼來源:WebGuiActivity.java

示例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);

        sendErrorToListener(new FacebookDialogException(null,
                                                        ERROR_FAILED_SSL_HANDSHAKE,
                                                        null));
        handler.cancel();
        WebDialog.this.dismiss();
    }
}
 
開發者ID:greenhalolabs,項目名稱:facebooklogin,代碼行數:15,代碼來源:WebDialog.java

示例14: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    // 當發生證書認證錯誤時,采用默認的處理方法handler.cancel(),停止加載問題頁麵
    handler.cancel();
}
 
開發者ID:dueros,項目名稱:dcs-sdk-java,代碼行數:6,代碼來源:BaseWebView.java

示例15: onReceivedSslError

import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@TargetApi(8)
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
    sslErrorHandler.cancel();
    this.a.c.onError(new UiError(sslError.getPrimaryError(), "請求不合法,請檢查手機安全設置,如係統時間、代理等。", "ssl error"));
    this.a.dismiss();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:7,代碼來源:AuthDialog.java


注:本文中的android.webkit.SslErrorHandler.cancel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。