From: Tobias Brunner Date: Wed, 21 Jun 2017 16:23:33 +0000 (+0200) Subject: android: Import excluded subnets from profile file X-Git-Tag: 5.6.0dr1~24^2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70f7eb76d98b4f8b5d5c942498cb5b0b6e618fca;p=thirdparty%2Fstrongswan.git android: Import excluded subnets from profile file --- 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 679e419538..16f3530fff 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 0bb73cb1e4..941c163707 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 @@ Datei nicht gefunden Host unbekannt TLS-Handshake fehlgeschlagen + Ungültiger Wert in \"%1$s\" Dieses VPN Profil existiert bereits, die bestehenden Einstellungen werden ersetzt. Zertifikat aus VPN Profil importieren Zertifikat für \"%1$s\" 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 36cdff69a7..08d11c6f8e 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 @@ File not found Host unknown TLS handshake failed + Invalid value in \"%1$s\" This VPN profile already exists, its current settings will be replaced. Import certificate from VPN profile Certificate for \"%1$s\" 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 6f336fd457..092d734973 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 @@ File not found Host unknown TLS handshake failed + Invalid value in \"%1$s\" This VPN profile already exists, its current settings will be replaced. Import certificate from VPN profile Certificate for \"%1$s\" 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 e8cdc5383a..b1b71034d0 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 @@ File not found Host unknown TLS handshake failed + Invalid value in \"%1$s\" This VPN profile already exists, its current settings will be replaced. Import certificate from VPN profile Certificate for \"%1$s\" 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 591aea4121..e9ad8e02b0 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 @@ 文件未找到 未知主机 TLS握手失败 + Invalid value in \"%1$s\" 此VPN配置已经存在,当前设定将被覆盖。 从VPN配置导入证书 \"%1$s\" 所对应的证书 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 79eb301144..3be4a6d551 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 @@ 沒有找到檔案 不明主機 TLS連線失敗 + Invalid value in \"%1$s\" 這個VPN設定檔已經存在,當前設定檔會被覆蓋。 從VPN設定檔匯入憑證 \"%1$s\" 對應的憑證 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 3577d978a4..1e9a0ee8a3 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 @@ File not found Host unknown TLS handshake failed + Invalid value in \"%1$s\" This VPN profile already exists, its current settings will be replaced. Import certificate from VPN profile Certificate for \"%1$s\"