aboutsummaryrefslogtreecommitdiffstats
path: root/src/frontends
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-06-21 18:23:33 +0200
committerTobias Brunner <tobias@strongswan.org>2017-07-03 10:27:52 +0200
commit70f7eb76d98b4f8b5d5c942498cb5b0b6e618fca (patch)
treef704fba3f87aeb90a110432e971b408702f2ba16 /src/frontends
parent72b7c289addad31007eefd4a14643659b4c283af (diff)
downloadstrongswan-70f7eb76d98b4f8b5d5c942498cb5b0b6e618fca.tar.bz2
strongswan-70f7eb76d98b4f8b5d5c942498cb5b0b6e618fca.tar.xz
android: Import excluded subnets from profile file
Diffstat (limited to 'src/frontends')
-rw-r--r--src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileImportActivity.java11
-rw-r--r--src/frontends/android/app/src/main/res/values-de/strings.xml1
-rw-r--r--src/frontends/android/app/src/main/res/values-pl/strings.xml1
-rw-r--r--src/frontends/android/app/src/main/res/values-ru/strings.xml1
-rw-r--r--src/frontends/android/app/src/main/res/values-ua/strings.xml1
-rw-r--r--src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml1
-rw-r--r--src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml1
-rw-r--r--src/frontends/android/app/src/main/res/values/strings.xml1
8 files changed, 18 insertions, 0 deletions
diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileImportActivity.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileImportActivity.java
index 679e41953..16f3530ff 100644
--- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileImportActivity.java
+++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileImportActivity.java
@@ -55,6 +55,7 @@ import org.strongswan.android.logic.TrustedCertificateManager;
import org.strongswan.android.security.TrustedCertificateEntry;
import org.strongswan.android.ui.widget.TextInputLayoutHelper;
import org.strongswan.android.utils.Constants;
+import org.strongswan.android.utils.IPRangeSet;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -489,6 +490,16 @@ public class VpnProfileImportActivity extends AppCompatActivity
JSONObject split = obj.optJSONObject("split-tunneling");
if (split != null)
{
+ String excluded = split.optString("excluded", null);
+ if (excluded != null && !excluded.isEmpty())
+ {
+ if (IPRangeSet.fromString(excluded) == null)
+ {
+ throw new JSONException(getString(R.string.profile_import_failed_value,
+ "split-tunneling.excluded"));
+ }
+ profile.setExcludedSubnets(excluded);
+ }
int st = 0;
st |= split.optBoolean("block-ipv4") ? VpnProfile.SPLIT_TUNNELING_BLOCK_IPV4 : 0;
st |= split.optBoolean("block-ipv6") ? VpnProfile.SPLIT_TUNNELING_BLOCK_IPV6 : 0;
diff --git a/src/frontends/android/app/src/main/res/values-de/strings.xml b/src/frontends/android/app/src/main/res/values-de/strings.xml
index 0bb73cb1e..941c16370 100644
--- a/src/frontends/android/app/src/main/res/values-de/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-de/strings.xml
@@ -88,6 +88,7 @@
<string name="profile_import_failed_not_found">Datei nicht gefunden</string>
<string name="profile_import_failed_host">Host unbekannt</string>
<string name="profile_import_failed_tls">TLS-Handshake fehlgeschlagen</string>
+ <string name="profile_import_failed_value">Ungültiger Wert in \"%1$s\"</string>
<string name="profile_import_exists">Dieses VPN Profil existiert bereits, die bestehenden Einstellungen werden ersetzt.</string>
<string name="profile_cert_import">Zertifikat aus VPN Profil importieren</string>
<string name="profile_cert_alias">Zertifikat für \"%1$s\"</string>
diff --git a/src/frontends/android/app/src/main/res/values-pl/strings.xml b/src/frontends/android/app/src/main/res/values-pl/strings.xml
index 36cdff69a..08d11c6f8 100644
--- a/src/frontends/android/app/src/main/res/values-pl/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-pl/strings.xml
@@ -88,6 +88,7 @@
<string name="profile_import_failed_not_found">File not found</string>
<string name="profile_import_failed_host">Host unknown</string>
<string name="profile_import_failed_tls">TLS handshake failed</string>
+ <string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>
diff --git a/src/frontends/android/app/src/main/res/values-ru/strings.xml b/src/frontends/android/app/src/main/res/values-ru/strings.xml
index 6f336fd45..092d73497 100644
--- a/src/frontends/android/app/src/main/res/values-ru/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-ru/strings.xml
@@ -85,6 +85,7 @@
<string name="profile_import_failed_not_found">File not found</string>
<string name="profile_import_failed_host">Host unknown</string>
<string name="profile_import_failed_tls">TLS handshake failed</string>
+ <string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>
diff --git a/src/frontends/android/app/src/main/res/values-ua/strings.xml b/src/frontends/android/app/src/main/res/values-ua/strings.xml
index e8cdc5383..b1b71034d 100644
--- a/src/frontends/android/app/src/main/res/values-ua/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-ua/strings.xml
@@ -86,6 +86,7 @@
<string name="profile_import_failed_not_found">File not found</string>
<string name="profile_import_failed_host">Host unknown</string>
<string name="profile_import_failed_tls">TLS handshake failed</string>
+ <string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>
diff --git a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
index 591aea412..e9ad8e02b 100644
--- a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
@@ -85,6 +85,7 @@
<string name="profile_import_failed_not_found">文件未找到</string>
<string name="profile_import_failed_host">未知主机</string>
<string name="profile_import_failed_tls">TLS握手失败</string>
+ <string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">此VPN配置已经存在,当前设定将被覆盖。</string>
<string name="profile_cert_import">从VPN配置导入证书</string>
<string name="profile_cert_alias">\"%1$s\" 所对应的证书</string>
diff --git a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
index 79eb30114..3be4a6d55 100644
--- a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
@@ -85,6 +85,7 @@
<string name="profile_import_failed_not_found">沒有找到檔案</string>
<string name="profile_import_failed_host">不明主機</string>
<string name="profile_import_failed_tls">TLS連線失敗</string>
+ <string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">這個VPN設定檔已經存在,當前設定檔會被覆蓋。</string>
<string name="profile_cert_import">從VPN設定檔匯入憑證</string>
<string name="profile_cert_alias">\"%1$s\" 對應的憑證</string>
diff --git a/src/frontends/android/app/src/main/res/values/strings.xml b/src/frontends/android/app/src/main/res/values/strings.xml
index 3577d978a..1e9a0ee8a 100644
--- a/src/frontends/android/app/src/main/res/values/strings.xml
+++ b/src/frontends/android/app/src/main/res/values/strings.xml
@@ -88,6 +88,7 @@
<string name="profile_import_failed_not_found">File not found</string>
<string name="profile_import_failed_host">Host unknown</string>
<string name="profile_import_failed_tls">TLS handshake failed</string>
+ <string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>