de.blinkt.openvpn.core.Connection Java Examples
The following examples show how to use
de.blinkt.openvpn.core.Connection.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VpnProfile.java From Cake-VPN with GNU General Public License v2.0 | 6 votes |
public void upgradeProfile() { if (mProfileVersion < 2) { /* default to the behaviour the OS used */ mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT; } if (mProfileVersion < 4) { moveOptionsToConnection(); mAllowedAppsVpnAreDisallowed = true; } if (mAllowedAppsVpn == null) mAllowedAppsVpn = new HashSet<>(); if (mConnections == null) mConnections = new Connection[0]; if (mProfileVersion < 6) { if (TextUtils.isEmpty(mProfileCreator)) mUserEditable = true; } mProfileVersion = CURRENT_PROFILE_VERSION; }
Example #2
Source File: VpnProfile.java From android with GNU General Public License v3.0 | 6 votes |
public int checkProfile(Context context) { if (mAuthenticationType == TYPE_KEYSTORE || mAuthenticationType == TYPE_USERPASS_KEYSTORE) { if (mAlias == null) return R.string.no_keystore_cert_selected; } if (!mUsePull || mAuthenticationType == TYPE_STATICKEYS) { if (mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null) return R.string.ipv4_format_error; } if (!mUseDefaultRoute && (getCustomRoutes(mCustomRoutes) == null || getCustomRoutes(mExcludedRoutes) == null)) return R.string.custom_route_format_error; boolean noRemoteEnabled = true; for (Connection c : mConnections) if (c.mEnabled) noRemoteEnabled = false; if (noRemoteEnabled) return R.string.remote_no_server_selected; // Everything okay return R.string.no_error_found; }
Example #3
Source File: VpnProfile.java From android with GNU General Public License v3.0 | 6 votes |
public void upgradeProfile() { if (mProfileVersion < 2) { /* default to the behaviour the OS used */ mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT; } if (mProfileVersion < 4) { moveOptionsToConnection(); mAllowedAppsVpnAreDisallowed = true; } if (mAllowedAppsVpn == null) mAllowedAppsVpn = new HashSet<String>(); if (mConnections == null) mConnections = new Connection[0]; mProfileVersion = CURRENT_PROFILE_VERSION; }
Example #4
Source File: VpnProfile.java From EasyVPN-Free with GNU General Public License v3.0 | 6 votes |
public void upgradeProfile() { if (mProfileVersion < 2) { /* default to the behaviour the OS used */ mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT; } if (mProfileVersion < 4) { moveOptionsToConnection(); mAllowedAppsVpnAreDisallowed = true; } if (mAllowedAppsVpn == null) mAllowedAppsVpn = new HashSet<>(); if (mConnections == null) mConnections = new Connection[0]; if (mProfileVersion < 6) { if (TextUtils.isEmpty(mProfileCreator)) mUserEditable = true; } mProfileVersion = CURRENT_PROFILE_VERSION; }
Example #5
Source File: VpnProfile.java From Cybernet-VPN with GNU General Public License v3.0 | 6 votes |
int checkProfile(Context context) { if (mAuthenticationType == TYPE_KEYSTORE || mAuthenticationType == TYPE_USERPASS_KEYSTORE) { if (mAlias == null) return R.string.no_keystore_cert_selected; } if (!mUsePull || mAuthenticationType == TYPE_STATICKEYS) { if (mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null) return R.string.ipv4_format_error; } if (!mUseDefaultRoute) { if (!TextUtils.isEmpty(mCustomRoutes) && getCustomRoutes(mCustomRoutes).size() == 0) return R.string.custom_route_format_error; if (!TextUtils.isEmpty(mExcludedRoutes) && getCustomRoutes(mExcludedRoutes).size() == 0) return R.string.custom_route_format_error; } if (mUseTLSAuth && TextUtils.isEmpty(mTLSAuthFilename)) return R.string.missing_tlsauth; if ((mAuthenticationType == TYPE_USERPASS_CERTIFICATES || mAuthenticationType == TYPE_CERTIFICATES) && (TextUtils.isEmpty(mClientCertFilename) || TextUtils.isEmpty(mClientKeyFilename))) return R.string.missing_certificates; if ((mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES) && TextUtils.isEmpty(mCaFilename)) return R.string.missing_ca_certificate; boolean noRemoteEnabled = true; for (Connection c : mConnections) if (c.mEnabled) noRemoteEnabled = false; if (noRemoteEnabled) return R.string.remote_no_server_selected; // Everything okay return R.string.no_error_found; }
Example #6
Source File: VpnProfile.java From Cybernet-VPN with GNU General Public License v3.0 | 6 votes |
public void upgradeProfile() { if (mProfileVersion < 2) { /* default to the behaviour the OS used */ mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT; } if (mProfileVersion < 4) { moveOptionsToConnection(); mAllowedAppsVpnAreDisallowed = true; } if (mAllowedAppsVpn == null) mAllowedAppsVpn = new HashSet<>(); if (mConnections == null) mConnections = new Connection[0]; if (mProfileVersion < 6) { if (TextUtils.isEmpty(mProfileCreator)) mUserEditable = true; } mProfileVersion = CURRENT_PROFILE_VERSION; }
Example #7
Source File: VpnProfile.java From Cake-VPN with GNU General Public License v2.0 | 6 votes |
int checkProfile(Context context) { if (mAuthenticationType == TYPE_KEYSTORE || mAuthenticationType == TYPE_USERPASS_KEYSTORE) { if (mAlias == null) return R.string.no_keystore_cert_selected; } if (!mUsePull || mAuthenticationType == TYPE_STATICKEYS) { if (mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null) return R.string.ipv4_format_error; } if (!mUseDefaultRoute) { if (!TextUtils.isEmpty(mCustomRoutes) && getCustomRoutes(mCustomRoutes).size() == 0) return R.string.custom_route_format_error; if (!TextUtils.isEmpty(mExcludedRoutes) && getCustomRoutes(mExcludedRoutes).size() == 0) return R.string.custom_route_format_error; } if (mUseTLSAuth && TextUtils.isEmpty(mTLSAuthFilename)) return R.string.missing_tlsauth; if ((mAuthenticationType == TYPE_USERPASS_CERTIFICATES || mAuthenticationType == TYPE_CERTIFICATES) && (TextUtils.isEmpty(mClientCertFilename) || TextUtils.isEmpty(mClientKeyFilename))) return R.string.missing_certificates; if ((mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES) && TextUtils.isEmpty(mCaFilename)) return R.string.missing_ca_certificate; boolean noRemoteEnabled = true; for (Connection c : mConnections) if (c.mEnabled) noRemoteEnabled = false; if (noRemoteEnabled) return R.string.remote_no_server_selected; // Everything okay return R.string.no_error_found; }
Example #8
Source File: VpnProfile.java From SimpleOpenVpn-Android with Apache License 2.0 | 6 votes |
public void upgradeProfile() { if (mProfileVersion < 2) { /* default to the behaviour the OS used */ mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT; } if (mProfileVersion < 4) { moveOptionsToConnection(); mAllowedAppsVpnAreDisallowed = true; } if (mAllowedAppsVpn == null) mAllowedAppsVpn = new HashSet<>(); if (mConnections == null) mConnections = new Connection[0]; if (mProfileVersion < 6) { if (TextUtils.isEmpty(mProfileCreator)) mUserEditable = true; } mProfileVersion = CURRENT_PROFILE_VERSION; }
Example #9
Source File: VpnProfile.java From EasyVPN-Free with GNU General Public License v3.0 | 5 votes |
public VpnProfile(String name) { mUuid = UUID.randomUUID(); mName = name; mProfileVersion = CURRENT_PROFILE_VERSION; mConnections = new Connection[1]; mConnections[0] = new Connection(); }
Example #10
Source File: VpnProfile.java From Cake-VPN with GNU General Public License v2.0 | 5 votes |
public VpnProfile(String name) { mUuid = UUID.randomUUID(); mName = name; mProfileVersion = CURRENT_PROFILE_VERSION; mConnections = new Connection[1]; mConnections[0] = new Connection(); }
Example #11
Source File: VpnProfile.java From android with GNU General Public License v3.0 | 5 votes |
@Override protected VpnProfile clone() throws CloneNotSupportedException { VpnProfile copy = (VpnProfile) super.clone(); copy.mUuid = UUID.randomUUID(); copy.mConnections = new Connection[mConnections.length]; int i = 0; for (Connection conn : mConnections) { copy.mConnections[i++] = conn.clone(); } copy.mAllowedAppsVpn = (HashSet<String>) mAllowedAppsVpn.clone(); return copy; }
Example #12
Source File: VpnProfile.java From android with GNU General Public License v3.0 | 5 votes |
private void moveOptionsToConnection() { mConnections = new Connection[1]; Connection conn = new Connection(); conn.mServerName = mServerName; conn.mServerPort = mServerPort; conn.mUseUdp = mUseUdp; conn.mCustomConfiguration = ""; mConnections[0] = conn; }
Example #13
Source File: VpnProfile.java From Cake-VPN with GNU General Public License v2.0 | 5 votes |
private void moveOptionsToConnection() { mConnections = new Connection[1]; Connection conn = new Connection(); conn.mServerName = mServerName; conn.mServerPort = mServerPort; conn.mUseUdp = true; conn.mCustomConfiguration = ""; mConnections[0] = conn; }
Example #14
Source File: VpnProfile.java From android with GNU General Public License v3.0 | 5 votes |
public VpnProfile(String name) { mUuid = UUID.randomUUID(); mName = name; mProfileVersion = CURRENT_PROFILE_VERSION; mConnections = new Connection[1]; mConnections[0] = new Connection(); }
Example #15
Source File: VpnProfile.java From EasyVPN-Free with GNU General Public License v3.0 | 5 votes |
@Override protected VpnProfile clone() throws CloneNotSupportedException { VpnProfile copy = (VpnProfile) super.clone(); copy.mUuid = UUID.randomUUID(); copy.mConnections = new Connection[mConnections.length]; int i = 0; for (Connection conn : mConnections) { copy.mConnections[i++] = conn.clone(); } copy.mAllowedAppsVpn = (HashSet<String>) mAllowedAppsVpn.clone(); return copy; }
Example #16
Source File: VpnProfile.java From EasyVPN-Free with GNU General Public License v3.0 | 5 votes |
private void moveOptionsToConnection() { mConnections = new Connection[1]; Connection conn = new Connection(); conn.mServerName = mServerName; conn.mServerPort = mServerPort; conn.mUseUdp = mUseUdp; conn.mCustomConfiguration = ""; mConnections[0] = conn; }
Example #17
Source File: VpnProfile.java From Cake-VPN with GNU General Public License v2.0 | 5 votes |
@Override protected VpnProfile clone() throws CloneNotSupportedException { VpnProfile copy = (VpnProfile) super.clone(); copy.mUuid = UUID.randomUUID(); copy.mConnections = new Connection[mConnections.length]; int i = 0; for (Connection conn : mConnections) { copy.mConnections[i++] = conn.clone(); } copy.mAllowedAppsVpn = (HashSet<String>) mAllowedAppsVpn.clone(); return copy; }
Example #18
Source File: VpnProfile.java From Cybernet-VPN with GNU General Public License v3.0 | 5 votes |
@Override protected VpnProfile clone() throws CloneNotSupportedException { VpnProfile copy = (VpnProfile) super.clone(); copy.mUuid = UUID.randomUUID(); copy.mConnections = new Connection[mConnections.length]; int i = 0; for (Connection conn : mConnections) { copy.mConnections[i++] = conn.clone(); } copy.mAllowedAppsVpn = (HashSet<String>) mAllowedAppsVpn.clone(); return copy; }
Example #19
Source File: VpnProfile.java From Cybernet-VPN with GNU General Public License v3.0 | 5 votes |
private void moveOptionsToConnection() { mConnections = new Connection[1]; Connection conn = new Connection(); conn.mServerName = mServerName; conn.mServerPort = mServerPort; conn.mUseUdp = true; conn.mCustomConfiguration = ""; mConnections[0] = conn; }
Example #20
Source File: VpnProfile.java From SimpleOpenVpn-Android with Apache License 2.0 | 5 votes |
public VpnProfile(String name) { mUuid = UUID.randomUUID(); mName = name; mProfileVersion = CURRENT_PROFILE_VERSION; mConnections = new Connection[1]; mConnections[0] = new Connection(); }
Example #21
Source File: VpnProfile.java From Cybernet-VPN with GNU General Public License v3.0 | 5 votes |
public VpnProfile(String name) { mUuid = UUID.randomUUID(); mName = name; mProfileVersion = CURRENT_PROFILE_VERSION; mConnections = new Connection[1]; mConnections[0] = new Connection(); }
Example #22
Source File: VpnProfile.java From SimpleOpenVpn-Android with Apache License 2.0 | 5 votes |
@Override protected VpnProfile clone() throws CloneNotSupportedException { VpnProfile copy = (VpnProfile) super.clone(); copy.mUuid = UUID.randomUUID(); copy.mConnections = new Connection[mConnections.length]; int i = 0; for (Connection conn : mConnections) { copy.mConnections[i++] = conn.clone(); } copy.mAllowedAppsVpn = (HashSet<String>) mAllowedAppsVpn.clone(); return copy; }
Example #23
Source File: VpnProfile.java From SimpleOpenVpn-Android with Apache License 2.0 | 5 votes |
private void moveOptionsToConnection() { mConnections = new Connection[1]; Connection conn = new Connection(); conn.mServerName = mServerName; conn.mServerPort = mServerPort; conn.mUseUdp = mUseUdp; conn.mCustomConfiguration = ""; mConnections[0] = conn; }
Example #24
Source File: VpnProfile.java From EasyVPN-Free with GNU General Public License v3.0 | 4 votes |
public int checkProfile(Context context) { if (mAuthenticationType == TYPE_KEYSTORE || mAuthenticationType == TYPE_USERPASS_KEYSTORE) { if (mAlias == null) return R.string.no_keystore_cert_selected; } if (!mUsePull || mAuthenticationType == TYPE_STATICKEYS) { if (mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null) return R.string.ipv4_format_error; } if (!mUseDefaultRoute) { if (!TextUtils.isEmpty(mCustomRoutes) && getCustomRoutes(mCustomRoutes).size() == 0) return R.string.custom_route_format_error; if (!TextUtils.isEmpty(mExcludedRoutes) && getCustomRoutes(mExcludedRoutes).size() == 0) return R.string.custom_route_format_error; } if (mUseTLSAuth && TextUtils.isEmpty(mTLSAuthFilename)) return R.string.missing_tlsauth; if ((mAuthenticationType == TYPE_USERPASS_CERTIFICATES || mAuthenticationType == TYPE_CERTIFICATES) && (TextUtils.isEmpty(mClientCertFilename) || TextUtils.isEmpty(mClientKeyFilename))) return R.string.missing_certificates; if ((mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES) && TextUtils.isEmpty(mCaFilename)) return R.string.missing_ca_certificate; boolean noRemoteEnabled = true; for (Connection c : mConnections) if (c.mEnabled) noRemoteEnabled = false; if (noRemoteEnabled) return R.string.remote_no_server_selected; // Everything okay return R.string.no_error_found; }
Example #25
Source File: VpnProfile.java From SimpleOpenVpn-Android with Apache License 2.0 | 4 votes |
public int checkProfile(Context context) { if (mAuthenticationType == TYPE_KEYSTORE || mAuthenticationType == TYPE_USERPASS_KEYSTORE) { if (mAlias == null) return R.string.no_keystore_cert_selected; } if (!mUsePull || mAuthenticationType == TYPE_STATICKEYS) { if (mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null) return R.string.ipv4_format_error; } if (!mUseDefaultRoute) { if (!TextUtils.isEmpty(mCustomRoutes) && getCustomRoutes(mCustomRoutes).size() == 0) return R.string.custom_route_format_error; if (!TextUtils.isEmpty(mExcludedRoutes) && getCustomRoutes(mExcludedRoutes).size() == 0) return R.string.custom_route_format_error; } if (mUseTLSAuth && TextUtils.isEmpty(mTLSAuthFilename)) return R.string.missing_tlsauth; if ((mAuthenticationType == TYPE_USERPASS_CERTIFICATES || mAuthenticationType == TYPE_CERTIFICATES) && (TextUtils.isEmpty(mClientCertFilename) || TextUtils.isEmpty(mClientKeyFilename))) return R.string.missing_certificates; if ((mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES) && TextUtils.isEmpty(mCaFilename)) return R.string.missing_ca_certificate; boolean noRemoteEnabled = true; for (Connection c : mConnections) if (c.mEnabled) noRemoteEnabled = false; if (noRemoteEnabled) return R.string.remote_no_server_selected; // Everything okay return R.string.no_error_found; }