From 61b1c46c460e1ba3a7e905854a1394d2d507c9a9 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 25 Apr 2016 23:32:36 +0300 Subject: Clarify error message --- main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index abb8c270..3885dfa3 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -814,7 +814,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac NetworkSpace.ipAddress gatewayIP = new NetworkSpace.ipAddress(new CIDRIP(gateway, 32), false); if (mLocalIP == null) { - VpnStatus.logError("Local IP address unset but adding route?! This is broken! Please contact author with log"); + VpnStatus.logError("Local IP address unset and received. Neither pushed server config nor local config specifies an IP addresses. Opening tun device is most likely going to fail."); return; } NetworkSpace.ipAddress localNet = new NetworkSpace.ipAddress(mLocalIP, true); -- cgit v1.2.3 From 9498eb76ef4c053d77e45d4d3ebaf839e0f40a0b Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 27 Apr 2016 08:22:41 +0300 Subject: add a few more mime types (closes #481) --- main/src/main/java/de/blinkt/openvpn/fragments/Utils.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java index 243eae98..af76ee7a 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java @@ -49,10 +49,12 @@ public class Utils { supportedMimeTypes.add("application/x-x509-ca-cert"); supportedMimeTypes.add("application/x-x509-user-cert"); supportedMimeTypes.add("application/x-pem-file"); + supportedMimeTypes.add("application/pkix-cert"); supportedMimeTypes.add("text/plain"); extensions.add("pem"); extensions.add("crt"); + extensions.add("cer"); break; case KEYFILE: i.setType("application/x-pem-file"); @@ -86,6 +88,10 @@ public class Utils { extensions.add("conf"); break; + case CRL_FILE: + supportedMimeTypes.add("application/x-pkcs7-crl"); + supportedMimeTypes.add("application/pkix-crl"); + case USERPW_FILE: i.setType("text/plain"); supportedMimeTypes.add("text/plain"); -- cgit v1.2.3 From d478576ffc48d7caa7fa0e987f257c46eba157b5 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 27 Apr 2016 08:52:47 +0300 Subject: add missing break --- main/src/main/java/de/blinkt/openvpn/fragments/Utils.java | 1 + 1 file changed, 1 insertion(+) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java index af76ee7a..1344b1e6 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java @@ -91,6 +91,7 @@ public class Utils { case CRL_FILE: supportedMimeTypes.add("application/x-pkcs7-crl"); supportedMimeTypes.add("application/pkix-crl"); + break; case USERPW_FILE: i.setType("text/plain"); -- cgit v1.2.3 From c3523db9e76133c57043f75f42716b7c34bb5c0f Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 27 Apr 2016 14:25:26 +0300 Subject: Do no try to restore strings of invalid length. --- main/src/main/java/de/blinkt/openvpn/core/LogItem.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java index 57bc3e1e..d767e073 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java @@ -151,6 +151,8 @@ public class LogItem implements Parcelable { if (len == 0) { mMessage = null; } else { + if (len > bb.remaining()) + throw new IndexOutOfBoundsException("String length " + len + " is bigger than remaining bytes " + bb.remaining()); byte[] utf8bytes = new byte[len]; bb.get(utf8bytes); mMessage = new String(utf8bytes, "UTF-8"); -- cgit v1.2.3 From ea7ef5b2b42261aac4f5ac334361a7580fc1f955 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 27 Apr 2016 14:25:44 +0300 Subject: Version 0.6.53 --- main/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/build.gradle b/main/build.gradle index 43204e17..64859cf7 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -27,8 +27,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 23 - versionCode = 132 - versionName = "0.6.52" + versionCode = 133 + versionName = "0.6.53" } sourceSets { -- cgit v1.2.3 From 0d158ea62d9e72fb3aaebf72cdab6c076302c53e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 27 Apr 2016 16:59:47 +0300 Subject: Remove paypal link (violates Play store policy) --- main/build.gradle | 2 +- main/misc/fetchtranslations.sh | 2 +- .../java/de/blinkt/openvpn/fragments/AboutFragment.java | 9 ++------- main/src/main/res/layout/about.xml | 11 ----------- main/src/main/res/values-ca/strings.xml | 1 - main/src/main/res/values-cs/strings.xml | 3 --- main/src/main/res/values-de/strings.xml | 13 ++++++++++--- main/src/main/res/values-es/strings.xml | 3 --- main/src/main/res/values-et/strings.xml | 3 --- main/src/main/res/values-fr/strings.xml | 3 --- main/src/main/res/values-hu/strings.xml | 3 --- main/src/main/res/values-in/strings.xml | 3 --- main/src/main/res/values-it/strings.xml | 3 --- main/src/main/res/values-ja/strings.xml | 3 --- main/src/main/res/values-ko/strings.xml | 3 --- main/src/main/res/values-no/strings.xml | 2 -- main/src/main/res/values-pl/strings.xml | 3 --- main/src/main/res/values-pt/strings.xml | 1 - main/src/main/res/values-ro/strings.xml | 3 --- main/src/main/res/values-ru/strings.xml | 3 --- main/src/main/res/values-sl/strings.xml | 3 --- main/src/main/res/values-sv/strings.xml | 3 --- main/src/main/res/values-tr/strings.xml | 3 --- main/src/main/res/values-uk/strings.xml | 3 --- main/src/main/res/values-vi/strings.xml | 3 --- main/src/main/res/values-zh-rCN/strings.xml | 3 --- main/src/main/res/values-zh-rTW/strings.xml | 3 --- main/src/main/res/values/strings.xml | 1 - 28 files changed, 14 insertions(+), 85 deletions(-) (limited to 'main') diff --git a/main/build.gradle b/main/build.gradle index 64859cf7..7dfa1a89 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -27,7 +27,7 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 23 - versionCode = 133 + versionCode = 134 versionName = "0.6.53" } diff --git a/main/misc/fetchtranslations.sh b/main/misc/fetchtranslations.sh index 4d03730a..b6589ce9 100755 --- a/main/misc/fetchtranslations.sh +++ b/main/misc/fetchtranslations.sh @@ -9,7 +9,7 @@ then fi echo "Fetch translation archive" -wget -q http://crowdin.net/download/project/ics-openvpn.zip +wget -q https://crowdin.com/download/project/ics-openvpn.zip # Chinese language require zh-CN and zh-TW diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/AboutFragment.java b/main/src/main/java/de/blinkt/openvpn/fragments/AboutFragment.java index d270fb2e..98fc7c9a 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/AboutFragment.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/AboutFragment.java @@ -16,7 +16,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; -import android.text.Html; import android.text.SpannableString; import android.text.Spanned; import android.text.method.LinkMovementMethod; @@ -54,7 +53,7 @@ public class AboutFragment extends Fragment implements View.OnClickListener { private static final String[] donationSkus = { "donation1eur", "donation2eur", "donation5eur", "donation10eur", "donation1337eur","donation23eur","donation25eur",}; IInAppBillingService mService; - Hashtable viewToProduct = new Hashtable(); + Hashtable viewToProduct = new Hashtable<>(); ServiceConnection mServiceConn = new ServiceConnection() { @Override public void onServiceDisconnected(ComponentName name) { @@ -272,12 +271,8 @@ public class AboutFragment extends Fragment implements View.OnClickListener { ver.setText(getString(R.string.version_info, name, version)); - TextView paypal = (TextView) v.findViewById(R.id.donatestring); - String donatetext = getActivity().getString(R.string.donatewithpaypal); - Spanned htmltext = Html.fromHtml(donatetext); - paypal.setText(htmltext); - paypal.setMovementMethod(LinkMovementMethod.getInstance()); + gmsTextView = (TextView) v.findViewById(R.id.donategms); /* recreating view without onCreate/onDestroy cycle */ diff --git a/main/src/main/res/layout/about.xml b/main/src/main/res/layout/about.xml index 1f7a4acb..09a872f7 100644 --- a/main/src/main/res/layout/about.xml +++ b/main/src/main/res/layout/about.xml @@ -54,17 +54,6 @@ android:autoLink="all" android:text="@string/copyright_guicode" /> - - - - Inici rapid Utilitzant el proxy %1$s %2$d Utiliza el proxy del sistema - Torna a conectar al reiniciar Ignorar Reinicia Els canvis de configuració s\'apliquen desprès de reinicar la VPN. (Re)inicar la VPN ara? diff --git a/main/src/main/res/values-cs/strings.xml b/main/src/main/res/values-cs/strings.xml index 3ff4057a..1d01d07a 100755 --- a/main/src/main/res/values-cs/strings.xml +++ b/main/src/main/res/values-cs/strings.xml @@ -202,9 +202,6 @@ Používám proxy %1$s %2$d Použít systémovou proxy K připojení použít systémové nastavení pro HTTP/HTTPS. - K přispění můžeš využít <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">PayPal</a> - OpenVPN se opětovně připojí k VPN, pokud byla aktivní před vypnutím/restartem systému. Přečti si oddíl o varování před připojením než použiješ tuto možnost. - Znovu připoj po restartu Ignorovat Restartovat Změna nastavení začne platit až po restartu VPN. Restartovat teď? diff --git a/main/src/main/res/values-de/strings.xml b/main/src/main/res/values-de/strings.xml index 75fad11f..4653dd19 100755 --- a/main/src/main/res/values-de/strings.xml +++ b/main/src/main/res/values-de/strings.xml @@ -203,9 +203,8 @@ Verwende Proxy %1$s %2$d System-Proxys verwenden Systemweite Einstellungen für HTTP- und HTTPS-Proxys beim Verbinden verwenden. - <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">Spenden mit PayPal</a> - OpenVPN wird bei einem Neustart des Telefons das beim Herunterfahren aktive VPN wieder verbinden. Bitte lesen Sie die FAQ \"Warnung beim Verbinden\", bevor Sie diese Option verwenden. - Nach Neustart verbinden + Beim Systemstart das angebene VPN verbinden. Bitte die FAQ zum Bestätigungsdialog lesen für Android Version < 5.0. + Beim Gerätestart verbinden Ignorieren Neu verbinden Konfigurationsänderungen werden erst nach einem Neustart des VPNs aktiv. Jetzt neu verbinden? @@ -401,4 +400,12 @@ %1$s benötigt Geben Sie bitte das Passwort für das Profil %1$s ein Inline-Daten verwenden + Konfigurationsdatei exportieren + TLS-Auth-Datei fehlt + Fehlendes Benutzerzertifikat oder privater Schlüssel + Fehlendes CA-Zertifikat + Zertifikatswiderrufsliste (optional) + %d Einträge vom Logcache gelesen + Samsung Geräte + kein VPN ausgewählt diff --git a/main/src/main/res/values-es/strings.xml b/main/src/main/res/values-es/strings.xml index 1fff99ef..d985e55f 100755 --- a/main/src/main/res/values-es/strings.xml +++ b/main/src/main/res/values-es/strings.xml @@ -203,9 +203,6 @@ hacia/de Móvil) Usando proxy %1$s %2$d Usar el proxy del sistema Utilice la configuración del sistema para los proxies HTTP/HTTPS al conectar. - Usted puede <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">donar con PayPal</a> - OpenVPN volvera a conectar a una VPN si estaba activa en el apagado/reinicio del sistema. Por favor lea la P+F de advertencia de conexión antes de usar esta opción. - Vuelva a conectar al reiniciar Ignorar Reiniciar Los cambios de configuración se aplican después de reiniciar la VPN. ¿(Re)iniciar la VPN ahora? diff --git a/main/src/main/res/values-et/strings.xml b/main/src/main/res/values-et/strings.xml index 7e40eb3a..207676e0 100755 --- a/main/src/main/res/values-et/strings.xml +++ b/main/src/main/res/values-et/strings.xml @@ -203,9 +203,6 @@ Kasutusel proxy %1$s %2$d Kasuta süsteemset proxy\'t Kasuta ühendumisel süsteemse HTTP/HTTPS proxy konfiguratsiooni. - Sul on võimalus <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">annetada PayPal vahendusel</a> - Kui VPN oli süsteemi uuestilaadimisel/sulgemisel aktiivne siis taastatakse seadme käivitamisel OpenVPN ühendus. Palun lugege enne selle valiku kasutamist läbi ühendumise hoiatuse KKK. - Uuestilaadimisel ühendu uuesti Ignoreeri Uuestilaadimine Konfiguratsioonimuudatused rakendatakse peale VPN uuestilaadimist. Kas soovite VPN kohe (uuesti)laadida? diff --git a/main/src/main/res/values-fr/strings.xml b/main/src/main/res/values-fr/strings.xml index 5ef282f1..9e7a52a9 100755 --- a/main/src/main/res/values-fr/strings.xml +++ b/main/src/main/res/values-fr/strings.xml @@ -204,9 +204,6 @@ Sur certaines images, cette notification joue un son.\nAndroid à introduit ces "Utilisation du proxy %1$s %2$d" "Utiliser le proxy système" "Utiliser la configuration générale du système pour que les proxy HTTP / HTTPS se connectent." - "Vous pouvez faire un <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&cmd=_s-xclick\">don avec PayPal</ a> " - "Reconnecter OpenVPN automatiquement si une connexion était active lors de l\'extinction/redémarrage de l\'appareil. Veuillez lire l\'avertissement de connexion dans la FAQ avant d\'utiliser cette option." - "Connexion automatique au redémarrage" "Ignorer" "Redémarrer" Les changements de configuration sont appliqués après redémarrage du VPN. (Re)démarrer le VPN maintenant ? diff --git a/main/src/main/res/values-hu/strings.xml b/main/src/main/res/values-hu/strings.xml index ec81949d..38b7cb66 100755 --- a/main/src/main/res/values-hu/strings.xml +++ b/main/src/main/res/values-hu/strings.xml @@ -198,9 +198,6 @@ Proxy használatban: %1$s %2$d Rendszerproxy használata Rendszerszintű konfiguráció használata a HTTP/HTTPS proxy csatlakozáshoz. - <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">Adakozhat PayPal-al</a>  - Az OpenVPN újracsatlakozik a VPN-hez ha az aktív volt az újraindításkoz/leállításkor. - Újracsatlakozás újraindításkor Hagyja figyelmen kívül Újraindítás A konfiguráció változások a VPN újraindítása után lépnek életbe. (Újra)indítja most a VPN-t? diff --git a/main/src/main/res/values-in/strings.xml b/main/src/main/res/values-in/strings.xml index 63602200..7111e4a0 100755 --- a/main/src/main/res/values-in/strings.xml +++ b/main/src/main/res/values-in/strings.xml @@ -203,9 +203,6 @@ Menggunakan proxy %1$s %2$d Gunakan sistem proxy Gunakan konfigurasi lebih luas untuk menyambung system melalui proxy HTTP/HTTPS - Anda dapat melakukan donasi <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">dengan PayPal</a> - OpenVPN akan menyambung kembali VPN jika VPN aktif pada saat sistem reboot/shutdown. Silakan baca FAQ tentang peringatan sambungan sebelum menggunakan pilihan ini. - Koneksi ulang saat perangkat dihidupkan kembali Abaikan Restart Perubahan konfigurasi baru diterapkan setelah restart VPN. Restart VPN sekarang? diff --git a/main/src/main/res/values-it/strings.xml b/main/src/main/res/values-it/strings.xml index 42b34c63..d072c142 100755 --- a/main/src/main/res/values-it/strings.xml +++ b/main/src/main/res/values-it/strings.xml @@ -204,9 +204,6 @@ Effettuata la lettura del file di configurazione Si sta utilizzando il proxy %1$s %2$d Utilizza il proxy di sistema Utilizza la configurazione generale del sistema relativa ai proxy HTTP/HTTPS per connettersi. - Puoi <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">donare tramite PayPal</a> - OpenVPN is riconnetterà alla VPN se era in funzione durante un riavvio od un spegnimento dell\'apparecchio. Leggi con attenzione le FAQ con gli avvertimenti sulla connessione prima di scegliere questa opzione. - Riconnetti al riavvio Ignora Riavvia Le modifiche sarannoi applicate dopo aver riavviato la connessione VPN. Riavviare ora la connessione? diff --git a/main/src/main/res/values-ja/strings.xml b/main/src/main/res/values-ja/strings.xml index f5444b02..1b3afcde 100755 --- a/main/src/main/res/values-ja/strings.xml +++ b/main/src/main/res/values-ja/strings.xml @@ -217,9 +217,6 @@ Androidはあなた自身の安全性のために、これらを迂回できな プロキシを使用します %1$s %2$d システムのプロキシ設定を使用 システム全体の構成の HTTP/HTTPS プロキシ接続を使用します。 - 以下のURLより寄付いただけます。 <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">PayPalで寄付</a> - OpenVPNはシステムの再起動やシャットダウン時に再接続するようになります。このオプションを使用する前にFAQをご一読ください。 - システム起動後に再接続 無視 再起動 設定の変更はVPNの再起動後に反映されます。VPNを(再)起動しますか? diff --git a/main/src/main/res/values-ko/strings.xml b/main/src/main/res/values-ko/strings.xml index 4e9ca77f..a189c62a 100755 --- a/main/src/main/res/values-ko/strings.xml +++ b/main/src/main/res/values-ko/strings.xml @@ -201,9 +201,6 @@ 프록시 %1$s %2$d 을 사용 시스템 프록시를 사용 연결시 전 시스템 설정에 있는 HTTP/HTTPS 프록시를 사용합니다. - 당신은 <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">PayPal을 통해 기부할 수 있습니다.</a> - OpenVPN은 시스템 재부팅/종료에 활성화 되었으면 VPN을 다시 연결합니다. 이 옵션을 사용 하기 전에 연결 경고 FAQ를 읽어 보시기 바랍니다. - 재시작 후 다시 연결 무시 다시 시작 VPN을 다시 시작한 후 설정 변경 내용이 적용 됩니다. VPN을 지금 (재)시작? diff --git a/main/src/main/res/values-no/strings.xml b/main/src/main/res/values-no/strings.xml index 41e26e3c..85576bb3 100755 --- a/main/src/main/res/values-no/strings.xml +++ b/main/src/main/res/values-no/strings.xml @@ -138,8 +138,6 @@ Bruker proxy %1$s %2$d Bruk systemet proxy Bruk global systemkonfigurasjon for HTTP/HTTPS proxy for å koble til. - Du kan <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">donere med PayPal</a> - Koble til på nytt ved restart Ignorer Start på nytt Konfigurasjon endret diff --git a/main/src/main/res/values-pl/strings.xml b/main/src/main/res/values-pl/strings.xml index d596b19e..5eb45e09 100755 --- a/main/src/main/res/values-pl/strings.xml +++ b/main/src/main/res/values-pl/strings.xml @@ -203,9 +203,6 @@ Używam proxy %1$s%2$d Użyj proxy systemowego Połącz używając systemowej konfiguracji proxy HTTP/HTTPS. - Możesz <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">wspomóc przez PayPal</a> - OpenVPN połączy ponownie z VPN jeśli połączenie było aktywne przy restarcie/zamknięciu systemu. Przeczytaj proszę FAQ z ostrzeżeniami przed użyciem tej opcji. - Połącz po restarcie Ignoruj Uruchom ponownie Zmiany konfiguracji będą zatwierdzone po restarcie VPN. Uruchomić ponowie teraz? diff --git a/main/src/main/res/values-pt/strings.xml b/main/src/main/res/values-pt/strings.xml index 5b9b4db5..48861e7f 100755 --- a/main/src/main/res/values-pt/strings.xml +++ b/main/src/main/res/values-pt/strings.xml @@ -173,7 +173,6 @@ Início Rápido A utilizar proxy %1$s %2$d Usar a proxy do sistema - Volte a ligar na reinicialização Ignorar Reiniciar As alterações de configuração são aplicadas depois de reiniciar a VPN. Reiniciar a VPN agora? diff --git a/main/src/main/res/values-ro/strings.xml b/main/src/main/res/values-ro/strings.xml index ef70ab27..a7bff8bb 100755 --- a/main/src/main/res/values-ro/strings.xml +++ b/main/src/main/res/values-ro/strings.xml @@ -195,9 +195,6 @@ Folosesc proxy %1$s %2$d Foloseşte proxy sistem Foloseşte configurarea sistem pentru proxy HTTP/HTTPS folosit la conectare. - Puteţi <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">dona prin PayPal</a> - OpenVPN va reconecta un VPN dacă a fost activ la reboot/shutdown. Citiţi avertizarea la Conexiune din FAQ înainte de a folosi această funcţie. - Reconectarea la reboot Ignora Restart Schimbările de configurare vor fi aplicate după restartarea VPN-ului. (Re)startaţi VPN-ul acum? diff --git a/main/src/main/res/values-ru/strings.xml b/main/src/main/res/values-ru/strings.xml index 3de1d244..7fdabc9d 100755 --- a/main/src/main/res/values-ru/strings.xml +++ b/main/src/main/res/values-ru/strings.xml @@ -203,9 +203,6 @@ Используется прокси-сервер %1$s %2$d Использовать прокси-сервер системы Использовать системную конфигурацию прокси HTTP/HTTPS для соединения. - Вы можете <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">пожертвовать с PayPal</a> - OpenVPN будет переподключаться, если он был активен в момент выключения/перезагрузки. Пожалуйста, прочтите FAQ перед тем, как использовать эту настройку. - Переподключение после перезагрузки Игнорировать Перезапуск Изменения конфигурации применяются после перезапуска VPN. (Пере)запустить VPN сейчас? diff --git a/main/src/main/res/values-sl/strings.xml b/main/src/main/res/values-sl/strings.xml index 8657ebe5..27149362 100755 --- a/main/src/main/res/values-sl/strings.xml +++ b/main/src/main/res/values-sl/strings.xml @@ -203,9 +203,6 @@ Uporaba posredniškega strežnika %1$s %2$d Uporabi sis. pos. str. Za povezavo uporabi nastavitve celega sistema za posredniške strežnike HTTP/HTTPS. - Darujete lahko s <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">PayPalom</a> - OpenVPN bo ponovno povezal VPN, če je bil dejaven ob zaustavitvi/ponovnem zagonu sistema. Preberite pogosta vprašanja opozoril o povezavi pred uporabo te možnosti. - Pon. povez. ob pon. zag. Prezri Ponovno zaženi Spremembe nastavitev se bodo uporabile po ponovnem zagonu VPN-a. (Ponovno) zaženi VPN zdaj? diff --git a/main/src/main/res/values-sv/strings.xml b/main/src/main/res/values-sv/strings.xml index 8aeec79b..41ecf355 100755 --- a/main/src/main/res/values-sv/strings.xml +++ b/main/src/main/res/values-sv/strings.xml @@ -203,9 +203,6 @@ Använder proxy %1$s %2$d Använd system proxy Använda systemkonfigurationen för HTTP/HTTPS proxy för att ansluta. - Du kan <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">donera via PayPal</a> - OpenVPN återansluter VPN om den var aktiv vid avstängning/omstart. Läs FAQ om anslutningsvarning innan du använder detta alternativ. - Återanslut vid omstart Ignorera Starta om Konfigurationsändringar tillämpas efter omstart av VPN. Starta(om) VPN nu? diff --git a/main/src/main/res/values-tr/strings.xml b/main/src/main/res/values-tr/strings.xml index 54b3c4ac..00f111c4 100755 --- a/main/src/main/res/values-tr/strings.xml +++ b/main/src/main/res/values-tr/strings.xml @@ -203,9 +203,6 @@ %1$s %2$d vekil sunucusu kullanarak Sistem vekil sunucusunu kullan Bağlanmak için sistem çapındaki HTTP/HTTPS vekil sunucularını kullan. - <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">PayPal ile bağış</a> yapabilirsiniz; - OpenVPN, sistem yeniden başlatma/kapatma sırasında etkinse, tekrar bir VPN\'ye bağlanacak. Lütfen bu seçeneği kullanmadan önce Bağlantı uyarı SSS\'sini okuyun. - Yeniden başlatmada tekrar bağlan Yoksay Yeniden Başlat Yapılandırma değişiklikleri, VPN yeniden başlattıktan sonra geçerli olur. VPN (yeniden) başlatılsın mı? diff --git a/main/src/main/res/values-uk/strings.xml b/main/src/main/res/values-uk/strings.xml index 43a55bba..7c73b783 100755 --- a/main/src/main/res/values-uk/strings.xml +++ b/main/src/main/res/values-uk/strings.xml @@ -202,9 +202,6 @@ Використовується проксі %1$s %2$d Використовувати системний проксі Використовувати системну конфігурацію HTTP/HTTPS проксі для з\'єднання. - Ви можете <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">пожертвувати через PayPal</a> - OpenVPN буде перепідключатися, якщо він був активний в момент вимикання/перезавантаження. Будь ласка, прочитайте ЧаП перед тим, як використовувати цей параметр. - Перепідключати при перезавантаженні Ігнорувати Перезапустити Після перезапуску VPN застосувати зміни конфігурації. (Пере)запустити VPN тепер? diff --git a/main/src/main/res/values-vi/strings.xml b/main/src/main/res/values-vi/strings.xml index bedce249..ff673f9d 100755 --- a/main/src/main/res/values-vi/strings.xml +++ b/main/src/main/res/values-vi/strings.xml @@ -203,9 +203,6 @@ Đang sử dụng proxy %1$s %2$d Sử dụng proxy hệ thống Sử dụng các cấu hình hệ thống rộng cho HTTP/HTTPS proxy để kết nối. - Bạn có thể <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">ủng hộ cho ứng dụng với PayPal</a> - OpenVPN sẽ kết nối lại VPN nếu nó đã hoạt động khi hệ thống khởi động lại/tắt máy. Xin vui lòng đọc phần cảnh báo kết nối trong các câu hỏi thường gặp trước khi sử dụng tùy chọn này. - Kết nối lại khi khởi động lại máy Bỏ qua Khởi động lại Cấu hình sẽ được áp dụng sau khi khởi động lại VPN. (Khởi động) bắt đầu VPN lại ngay bây giờ? diff --git a/main/src/main/res/values-zh-rCN/strings.xml b/main/src/main/res/values-zh-rCN/strings.xml index 7acd3605..648703fe 100755 --- a/main/src/main/res/values-zh-rCN/strings.xml +++ b/main/src/main/res/values-zh-rCN/strings.xml @@ -205,9 +205,6 @@ 使用代理 %1$s %2$d 使用系统代理 使用系统设置连接 HTTP/HTTPS 代理服务器。 - 您可以 <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\"> 通过 PayPal 捐助</a> - OpenVPN 将会在重启后自动重新连接 VPN。请在启用该选项前先阅读连接警告的常见问题解答。 - 重启时重新连接 忽略 重启 配置的变更将在重启 VPN 后生效,是否立即重启? diff --git a/main/src/main/res/values-zh-rTW/strings.xml b/main/src/main/res/values-zh-rTW/strings.xml index a8cd5669..926d981e 100755 --- a/main/src/main/res/values-zh-rTW/strings.xml +++ b/main/src/main/res/values-zh-rTW/strings.xml @@ -202,9 +202,6 @@ 使用代理伺服器 %1$s %2$d 使用系統代理 使用系統配置的 HTTP/HTTPS 代理伺服器進行連線。 - 你可以透過 <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">PayPal</a> 提供捐助 - 如果在重新開機或關機前正連線VPN,開機時自動重新連線。在使用這個選項之前請先閱讀連線警告FAQ。 - 開機時重新連線 忽略 重置 配置變更只會在重新啟動VPN時才生效,現在要(重新)啟動VPN嗎? diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index f68832e9..6ba546e1 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -201,7 +201,6 @@ Using proxy %1$s %2$d Use system proxy Use the system wide configuration for HTTP/HTTPS proxies to connect. - You can <a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;cmd=_s-xclick\">donate with PayPal</a> OpenVPN will connect the specified VPN if it was active on system boot. Please read the connection warning FAQ before using this option on Android < 5.0. Connect on boot Ignore -- cgit v1.2.3 From 8c91cc5bb404b30ea066b9c0f646ee1a12d310a0 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 28 Apr 2016 11:46:09 +0300 Subject: Version 0.6.54 --- main/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/build.gradle b/main/build.gradle index 7dfa1a89..c5a40778 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -27,8 +27,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 23 - versionCode = 134 - versionName = "0.6.53" + versionCode = 135 + versionName = "0.6.54" } sourceSets { -- cgit v1.2.3 From 29a654d63189c96bdd5a3b0186f6bda0c4dcb399 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 29 Apr 2016 11:03:57 +0300 Subject: Fix another crash reading broken logs. --- main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java | 4 +++- main/src/main/java/de/blinkt/openvpn/core/LogItem.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java index 7bb9d134..43a3f30e 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; +import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.util.Locale; @@ -63,7 +64,7 @@ class LogFileHandler extends Handler { flushToDisk(); } - } catch (IOException e) { + } catch (IOException| BufferOverflowException e) { e.printStackTrace(); VpnStatus.logError("Error during log cache: " + msg.what); VpnStatus.logException(e); @@ -88,6 +89,7 @@ class LogFileHandler extends Handler { // We do not really care if the log cache breaks between Android upgrades, // write binary format to disc + byte[] liBytes = li.getMarschaledBytes(); writeEscapedBytes(liBytes); diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java index d767e073..ebe884a8 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java @@ -18,6 +18,7 @@ import android.util.Log; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; +import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -89,7 +90,7 @@ public class LogItem implements Parcelable { } - public byte[] getMarschaledBytes() throws UnsupportedEncodingException { + public byte[] getMarschaledBytes() throws UnsupportedEncodingException, BufferOverflowException { ByteBuffer bb = ByteBuffer.allocate(16384); -- cgit v1.2.3 From ad494bd239f898f32e97820bcf31d9420bff0106 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 29 Apr 2016 20:00:57 +0300 Subject: Fix verify-x509-name parsing --- main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java index d14e643e..57635cf4 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java +++ b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java @@ -554,10 +554,12 @@ public class ConfigParser { if (verifyx509name.size() > 2) { if (verifyx509name.get(2).equals("name")) np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_RDN; + else if (verifyx509name.get(2).equals("subject")) + np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_DN; else if (verifyx509name.get(2).equals("name-prefix")) np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_RDN_PREFIX; else - throw new ConfigParseError("Unknown parameter to x509-verify-name: " + verifyx509name.get(2)); + throw new ConfigParseError("Unknown parameter to verify-x509-name: " + verifyx509name.get(2)); } else { np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_DN; } -- cgit v1.2.3 From 3cc9dfb875e579cc5d08c1c697ccc414ef98f215 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 3 May 2016 10:40:21 +0200 Subject: Fix minor warnings --- main/src/main/java/de/blinkt/openvpn/VpnProfile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index 11656ee3..31a52ec0 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -272,7 +272,7 @@ public class VpnProfile implements Serializable, Cloneable { if (!configForOvpn3) { cfg += String.format("setenv IV_GUI_VER %s \n", openVpnEscape(getVersionEnvString(context))); - String versionString = String.format("%d %s %s %s %s %s", Build.VERSION.SDK_INT, Build.VERSION.RELEASE, + String versionString = String.format(Locale.US, "%d %s %s %s %s %s", Build.VERSION.SDK_INT, Build.VERSION.RELEASE, NativeUtils.getNativeAPI(), Build.BRAND, Build.BOARD, Build.MODEL); cfg += String.format("setenv IV_PLAT_VER %s\n", openVpnEscape(versionString)); } @@ -450,7 +450,7 @@ public class VpnProfile implements Serializable, Cloneable { if (mMssFix != 0) { if (mMssFix != 1450) { - cfg += String.format("mssfix %d\n", mMssFix, Locale.US); + cfg += String.format(Locale.US, "mssfix %d\n", mMssFix); } else cfg += "mssfix\n"; } -- cgit v1.2.3 From 8e84c38a3e650af61cd2548d931ed617e4af0069 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 3 May 2016 18:03:21 +0200 Subject: Update OpenSSL --- main/openssl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main') diff --git a/main/openssl b/main/openssl index f6da7c53..c4feda0b 160000 --- a/main/openssl +++ b/main/openssl @@ -1 +1 @@ -Subproject commit f6da7c53fd01990e8e039dbfd5e9ea87e50d1d44 +Subproject commit c4feda0b636aa397cf4e731d3aef91948c3fc2b4 -- cgit v1.2.3 From a8a3589d7fa6a5e088bfd5e530e78c6e4f15686c Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 4 May 2016 19:11:11 +0200 Subject: Dismiss error dialog on touch outside --- main/src/main/java/de/blinkt/openvpn/LaunchVPN.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java b/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java index df19565c..1df4b0e4 100644 --- a/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java +++ b/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java @@ -5,6 +5,7 @@ package de.blinkt.openvpn; +import android.annotation.TargetApi; import android.app.Activity; import android.app.AlertDialog; import android.content.ActivityNotFoundException; @@ -13,6 +14,7 @@ import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.SharedPreferences; import android.net.VpnService; +import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.text.InputType; @@ -233,9 +235,27 @@ public class LaunchVPN extends Activity { } }); + d.setOnCancelListener(new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + finish(); + } + }); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) + setOnDismissListener(d); d.show(); } + @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) + private void setOnDismissListener(AlertDialog.Builder d) { + d.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + finish(); + } + }); + } + void launchVPN() { int vpnok = mSelectedProfile.checkProfile(this); if (vpnok != R.string.no_error_found) { -- cgit v1.2.3 From 918f17fa3558912970483b73474dcab955306e20 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 5 May 2016 12:52:39 +0200 Subject: Give the user a choice if the vpn is already connected. --- .../blinkt/openvpn/activities/DisconnectVPN.java | 23 ++++++++++------------ .../de/blinkt/openvpn/core/ProfileManager.java | 14 ++++++++----- .../java/de/blinkt/openvpn/core/VpnStatus.java | 3 +++ .../blinkt/openvpn/fragments/VPNProfileList.java | 14 +++++++++++-- main/src/main/res/values/strings.xml | 1 + 5 files changed, 35 insertions(+), 20 deletions(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java b/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java index cc7e2266..b955532a 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java @@ -10,7 +10,9 @@ import android.app.AlertDialog; import android.content.*; import android.os.IBinder; +import de.blinkt.openvpn.LaunchVPN; import de.blinkt.openvpn.R; +import de.blinkt.openvpn.VpnProfile; import de.blinkt.openvpn.core.OpenVPNService; import de.blinkt.openvpn.core.ProfileManager; @@ -53,24 +55,13 @@ public class DisconnectVPN extends Activity implements DialogInterface.OnClickLi unbindService(mConnection); } - // if (getIntent() !=null && OpenVpnService.DISCONNECT_VPN.equals(getIntent().getAction())) - - // setIntent(null); - - /* - @Override - protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - setIntent(intent); - } - */ - private void showDisconnectDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.title_cancel); builder.setMessage(R.string.cancel_connection_query); builder.setNegativeButton(android.R.string.no, this); - builder.setPositiveButton(android.R.string.yes,this); + builder.setNeutralButton(R.string.reconnect, this); + builder.setPositiveButton(android.R.string.yes, this); builder.setOnCancelListener(this); builder.show(); @@ -78,10 +69,16 @@ public class DisconnectVPN extends Activity implements DialogInterface.OnClickLi @Override public void onClick(DialogInterface dialog, int which) { + VpnProfile lastVPN = ProfileManager.getLastConnectedVpn(); if (which == DialogInterface.BUTTON_POSITIVE) { ProfileManager.setConntectedVpnProfileDisconnected(this); if (mService != null && mService.getManagement() != null) mService.getManagement().stopVPN(false); + } else if (which == DialogInterface.BUTTON_NEUTRAL && lastVPN !=null) { + Intent intent = new Intent(this, LaunchVPN.class); + intent.putExtra(LaunchVPN.EXTRA_KEY, lastVPN.getUUID().toString()); + intent.setAction(Intent.ACTION_MAIN); + startActivity(intent); } finish(); } diff --git a/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java b/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java index 165bd647..2856a069 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java +++ b/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java @@ -66,21 +66,25 @@ public class ProfileManager { } - public static void setConnectedVpnProfile(Context c, VpnProfile connectedrofile) { + /** + * Sets the profile that is connected (to connect if the service restarts) + */ + public static void setConnectedVpnProfile(Context c, VpnProfile connectedProfile) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c); Editor prefsedit = prefs.edit(); - prefsedit.putString(LAST_CONNECTED_PROFILE, connectedrofile.getUUIDString()); + prefsedit.putString(LAST_CONNECTED_PROFILE, connectedProfile.getUUIDString()); prefsedit.apply(); - mLastConnectedVpn = connectedrofile; + mLastConnectedVpn = connectedProfile; } + /** + * Returns the profile that was last connected (to connect if the service restarts) + */ public static VpnProfile getLastConnectedProfile(Context c) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c); - - String lastConnectedProfile = prefs.getString(LAST_CONNECTED_PROFILE, null); if (lastConnectedProfile != null) return get(c, lastConnectedProfile); diff --git a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java index d23f0013..8b076437 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java +++ b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java @@ -59,6 +59,9 @@ public class VpnStatus { static final int MAXLOGENTRIES = 1000; + public static boolean isVPNActive() { + return mLastLevel != ConnectionStatus.LEVEL_AUTH_FAILED && !(mLastLevel == ConnectionStatus.LEVEL_NOTCONNECTED); + } public static String getLastCleanLogMessage(Context c) { String message = mLaststatemsg; diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java index 3f5e806e..0323ba76 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java @@ -28,6 +28,7 @@ import android.widget.Toast; import de.blinkt.openvpn.*; import de.blinkt.openvpn.activities.ConfigConverter; +import de.blinkt.openvpn.activities.DisconnectVPN; import de.blinkt.openvpn.activities.FileSelect; import de.blinkt.openvpn.activities.VPNPreferences; import de.blinkt.openvpn.core.ProfileManager; @@ -82,7 +83,7 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn titleview.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - startVPN(profile); + startOrStopVPN(profile); } }); @@ -110,6 +111,15 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn } } + private void startOrStopVPN(VpnProfile profile) { + if (VpnStatus.isVPNActive()) { + Intent disconnectVPN = new Intent(getActivity(), DisconnectVPN.class); + startActivity(disconnectVPN); + } else { + startVPN(profile); + } + } + private ArrayAdapter mArrayadapter; @@ -212,7 +222,7 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn } private void setListAdapter() { - if (mArrayadapter==null) { + if (mArrayadapter == null) { mArrayadapter = new VPNArrayAdapter(getActivity(), R.layout.vpn_list_item, R.id.vpn_item_title); } diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index 6ba546e1..aca6c317 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -408,4 +408,5 @@ Samsung phones No VPN selected. VPN used on boot and for Always-On + Reconnect -- cgit v1.2.3 From f7865e2e7862a22c5762dbc8df53c98fb27d5440 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 5 May 2016 13:20:37 +0200 Subject: Update OpenVPN --- main/jni/Android.mk | 14 +++++++------- main/openvpn | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'main') diff --git a/main/jni/Android.mk b/main/jni/Android.mk index c61db83e..fed2bdea 100644 --- a/main/jni/Android.mk +++ b/main/jni/Android.mk @@ -2,9 +2,9 @@ JNI_DIR := $(call my-dir) #optional arguments -#WITH_POLAR=1 +#WITH_MBEDTLS=1 #WITH_OPENVPN3=1 -# Build openvpn with polar (OpenVPN3 core is always build with polar) +# Build openvpn with mbedTLS (OpenVPN3 core is always build with mbedTLS) #WITH_BREAKPAD=0 @@ -25,15 +25,15 @@ else WITH_BREAKPAD=0 endif -ifeq ($(WITH_POLAR),1) - USE_POLAR=1 +ifeq ($(WITH_MBEDTLS),1) + USE_MBEDTLS=1 endif ifeq ($(WITH_OPENVPN3),1) - USE_POLAR=1 + USE_MBEDTLS=1 endif -ifeq ($(USE_POLAR),1) - include polarssl/Android.mk +ifeq ($(USE_MBEDTLS),1) + include mbedtls/Android.mk endif include openvpn/Android.mk diff --git a/main/openvpn b/main/openvpn index 049858bb..a7bf6fce 160000 --- a/main/openvpn +++ b/main/openvpn @@ -1 +1 @@ -Subproject commit 049858bb44a04f3a52395b523a262f9c9b7dd51a +Subproject commit a7bf6fceeae8646888e8f64a9c36222fd987e5cd -- cgit v1.2.3 From 547284daac9c6f2bc5501154f8f4ff9bc106823e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 5 May 2016 13:48:33 +0200 Subject: Version 0.6.55 --- main/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/build.gradle b/main/build.gradle index c5a40778..f1f0cc69 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -27,8 +27,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 23 - versionCode = 135 - versionName = "0.6.54" + versionCode = 136 + versionName = "0.6.55" } sourceSets { -- cgit v1.2.3 From a3640fe6aeebf60a1e53840d60c170bfb4e5bc4a Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 10 May 2016 18:52:16 +0200 Subject: Do reading from content urls in the background. Also fixes Skydrive imports. --- .../blinkt/openvpn/activities/ConfigConverter.java | 161 ++++++++++++++------- .../de/blinkt/openvpn/core/LogFileHandler.java | 2 +- main/src/main/res/layout/config_converter.xml | 4 + 3 files changed, 111 insertions(+), 56 deletions(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java index cb3a43cf..462e7ee0 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java @@ -16,10 +16,10 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.database.Cursor; import android.net.Uri; +import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.Environment; -import android.os.NetworkOnMainThreadException; import android.provider.OpenableColumns; import android.security.KeyChain; import android.security.KeyChainAliasCallback; @@ -36,6 +36,7 @@ import android.widget.CheckBox; import android.widget.EditText; import android.widget.ImageButton; import android.widget.LinearLayout; +import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; @@ -84,6 +85,9 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, private Vector mLogEntries = new Vector<>(); private Uri mSourceUri; private EditText mProfilename; + private AsyncTask mImportTask; + private LinearLayout mLogLayout; + private TextView mProfilenameLabel; @Override public void onClick(View v) { @@ -147,7 +151,7 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, mResult.mName = mProfilename.getText().toString(); ProfileManager vpl = ProfileManager.getInstance(this); - if (vpl.getProfileByName(mResult.mName)!=null) { + if (vpl.getProfileByName(mResult.mName) != null) { mProfilename.setError(getString(R.string.duplicate_profile_name)); return true; } @@ -603,7 +607,11 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, findViewById(R.id.fab_footerspace).setVisibility(View.VISIBLE); } + mLogLayout = (LinearLayout) findViewById(R.id.config_convert_root); + + mProfilename = (EditText) findViewById(R.id.profilename); + mProfilenameLabel = (TextView) findViewById(R.id.profilename_label); if (savedInstanceState != null && savedInstanceState.containsKey(VPNPROFILE)) { mResult = (VpnProfile) savedInstanceState.getSerializable(VPNPROFILE); @@ -650,60 +658,99 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, private void doImportUri(Uri data) { //log(R.string.import_experimental); log(R.string.importing_config, data.toString()); - try { - String possibleName = null; - if ((data.getScheme() != null && data.getScheme().equals("file")) || - (data.getLastPathSegment() != null && - (data.getLastPathSegment().endsWith(".ovpn") || - data.getLastPathSegment().endsWith(".conf"))) - ) { - possibleName = data.getLastPathSegment(); - if (possibleName.lastIndexOf('/') != -1) - possibleName = possibleName.substring(possibleName.lastIndexOf('/') + 1); + String possibleName = null; + if ((data.getScheme() != null && data.getScheme().equals("file")) || + (data.getLastPathSegment() != null && + (data.getLastPathSegment().endsWith(".ovpn") || + data.getLastPathSegment().endsWith(".conf"))) + ) { + possibleName = data.getLastPathSegment(); + if (possibleName.lastIndexOf('/') != -1) + possibleName = possibleName.substring(possibleName.lastIndexOf('/') + 1); - } + } - mPathsegments = data.getPathSegments(); + mPathsegments = data.getPathSegments(); - Cursor cursor = getContentResolver().query(data, null, null, null, null); + Cursor cursor = getContentResolver().query(data, null, null, null, null); - try { + try { - if (cursor != null && cursor.moveToFirst()) { - int columnIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); + if (cursor != null && cursor.moveToFirst()) { + int columnIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); - if (columnIndex != -1) { - String displayName = cursor.getString(columnIndex); - if (displayName != null) - possibleName = displayName; - } - columnIndex = cursor.getColumnIndex("mime_type"); - if (columnIndex != -1) { - log("Opening Mime TYPE: " + cursor.getString(columnIndex)); - } + if (columnIndex != -1) { + String displayName = cursor.getString(columnIndex); + if (displayName != null) + possibleName = displayName; + } + columnIndex = cursor.getColumnIndex("mime_type"); + if (columnIndex != -1) { + log("Mime type: " + cursor.getString(columnIndex)); } - } finally { - if (cursor != null) - cursor.close(); } - if (possibleName != null) { - possibleName = possibleName.replace(".ovpn", ""); - possibleName = possibleName.replace(".conf", ""); + } finally { + if (cursor != null) + cursor.close(); + } + if (possibleName != null) { + possibleName = possibleName.replace(".ovpn", ""); + possibleName = possibleName.replace(".conf", ""); + } + + startImportTask(data, possibleName); + + + } + + private void startImportTask(final Uri data, final String possibleName) { + mImportTask = new AsyncTask() { + private ProgressBar mProgress; + + @Override + protected void onPreExecute() { + mProgress = new ProgressBar(ConfigConverter.this); + addViewToLog(mProgress); } - try { - InputStream is = getContentResolver().openInputStream(data); - doImport(is, possibleName); - } catch (NetworkOnMainThreadException nom) { - throw new RuntimeException("Network on Main: + " + data); + + @Override + protected Integer doInBackground(Void... params) { + try { + InputStream is = getContentResolver().openInputStream(data); + + doImport(is); + if (mResult==null) + return -3; + } catch (FileNotFoundException | + SecurityException se) + + { + log(R.string.import_content_resolve_error + ":" + se.getLocalizedMessage()); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) + checkMarschmallowFileImportError(data); + return -2; + } + + return 0; } - } catch (FileNotFoundException | SecurityException se) { - log(R.string.import_content_resolve_error + ":" + se.getLocalizedMessage()); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) - checkMarschmallowFileImportError(data); - } + @Override + protected void onPostExecute(Integer errorCode) { + mLogLayout.removeView(mProgress); + if (errorCode == 0) { + displayWarnings(); + mResult.mName = getUniqueProfileName(possibleName); + mProfilename.setVisibility(View.VISIBLE); + mProfilenameLabel.setVisibility(View.VISIBLE); + mProfilename.setText(mResult.getName()); + + log(R.string.import_done); + } + } + }.execute(); } + @TargetApi(Build.VERSION_CODES.M) private void checkMarschmallowFileImportError(Uri data) { // Permission already granted, not the source of the error @@ -723,15 +770,24 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, super.onStart(); } - private void log(String logmessage) { - mLogEntries.add(logmessage); - TextView tv = new TextView(this); - tv.setText(logmessage); - LinearLayout logLayout = (LinearLayout) findViewById(R.id.config_convert_root); - logLayout.addView(tv, logLayout.getChildCount() - 1); + private void log(final String logmessage) { + runOnUiThread(new Runnable() { + @Override + public void run() { + TextView tv = new TextView(ConfigConverter.this); + mLogEntries.add(logmessage); + tv.setText(logmessage); + + addViewToLog(tv); + } + }); + } + + private void addViewToLog(View view) { + mLogLayout.addView(view, mLogLayout.getChildCount() - 1); } - private void doImport(InputStream is, String newName) { + private void doImport(InputStream is) { ConfigParser cp = new ConfigParser(); try { InputStreamReader isr = new InputStreamReader(is); @@ -739,11 +795,6 @@ public class ConfigConverter extends BaseActivity implements FileSelectCallback, cp.parseConfig(isr); mResult = cp.convertProfile(); embedFiles(cp); - displayWarnings(); - mResult.mName = getUniqueProfileName(newName); - mProfilename.setText(mResult.getName()); - - log(R.string.import_done); return; } catch (IOException | ConfigParseError e) { diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java index 43a3f30e..dbcb13fc 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java @@ -64,7 +64,7 @@ class LogFileHandler extends Handler { flushToDisk(); } - } catch (IOException| BufferOverflowException e) { + } catch (IOException | BufferOverflowException e) { e.printStackTrace(); VpnStatus.logError("Error during log cache: " + msg.what); VpnStatus.logException(e); diff --git a/main/src/main/res/layout/config_converter.xml b/main/src/main/res/layout/config_converter.xml index ec248cd4..4070ff7c 100644 --- a/main/src/main/res/layout/config_converter.xml +++ b/main/src/main/res/layout/config_converter.xml @@ -21,12 +21,16 @@ android:layout_height="wrap_content"> -- cgit v1.2.3 From 727fed99d567002a33c4b8e315b0677751a3e283 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 22 May 2016 10:02:05 +0200 Subject: Add variant for better testing with instant run that has a minimal sdk of 21 --- main/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/build.gradle b/main/build.gradle index f1f0cc69..91478f74 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -79,7 +79,9 @@ android { normal - + modern { + minSdkVersion 21 + } /* x86 { versionCode Integer.parseInt("6" + defaultConfig.versionCode) -- cgit v1.2.3