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


Java SslErrorHandler.proceed方法代碼示例

本文整理匯總了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();
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:32,代碼來源:TiWebViewClient.java

示例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);
    }
}
 
開發者ID:jie-meng,項目名稱:DinningShare,代碼行數:34,代碼來源:SystemWebViewClient.java

示例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);
    }
}
 
開發者ID:namnguyen9x,項目名稱:cordova-plugin-background-mode,代碼行數:34,代碼來源:CordovaWebViewClient.java

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

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

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

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

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

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

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

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

示例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));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:10,代碼來源:H5PayActivity.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);

        handler.cancel();
        sendErrorToListener(new FacebookDialogException(null, ERROR_FAILED_SSL_HANDSHAKE, null));
    }
}
 
開發者ID:ButterFlyDevs,項目名稱:BrainStudio,代碼行數:12,代碼來源:WebDialog.java

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

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


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