<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2019 Bernhard G. Keller. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
ist die Übertragungsgeschwindigkeit bei der Nutzung von Proxies meist deutlich langsamer als bei direkten Internet-Verbindungen.</p>
<img class="center" src="images/tor.png">
-
-
- <h3><img class="title" src="../shared_images/file_download_blue_dark.png"> Herunterladen von Dateien mittels TOR</h3>
-
- <p>Wenn Orbot im Proxy-Modus genutzt wird, wird zwar der Datenverkehr beim Internet-Surfen über den Proxy geleitet, nicht jedoch heruntergeladene Dateien.
- Der Grund dafür ist, dass Privacy Browser für Datei-Downloads Androids eingebauten Download-Manager verwendet, der jedoch keine Proxy-Option bietet.
- Benutzer, die Dateien via Orbot herunterladen wollen, sollten daher dessen VPN-Modus aktivieren. Aktuell existiert keine Möglichkeit, Dateien über I2P herunterzuladen.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2019 Bernhard G. Keller. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
ist die Übertragungsgeschwindigkeit bei der Nutzung von Proxies meist deutlich langsamer als bei direkten Internet-Verbindungen.</p>
<img class="center" src="images/tor.png">
-
-
- <h3><img class="title" src="../shared_images/file_download_blue_light.png"> Herunterladen von Dateien mittels TOR</h3>
-
- <p>Wenn Orbot im Proxy-Modus genutzt wird, wird zwar der Datenverkehr beim Internet-Surfen über den Proxy geleitet, nicht jedoch heruntergeladene Dateien.
- Der Grund dafür ist, dass Privacy Browser für Datei-Downloads Androids eingebauten Download-Manager verwendet, der jedoch keine Proxy-Option bietet.
- Benutzer, die Dateien via Orbot herunterladen wollen, sollten daher dessen VPN-Modus aktivieren. Aktuell existiert keine Möglichkeit, Dateien über I2P herunterzuladen.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_dark.png"> Downloading Files Via Tor</h3>
-
- <p>When Orbot is operating in proxy mode, browsing the internet using Privacy Browser will be routed through the proxy, but file downloads will not.
- This is because Privacy Browser uses Android’s builtin download manager to download files, which doesn’t have a proxy option.
- Users who want to download files via Orbot need to enable its VPN mode. There is currently no way to download files through I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_light.png"> Downloading Files Via Tor</h3>
-
- <p>When Orbot is operating in proxy mode, browsing the internet using Privacy Browser will be routed through the proxy, but file downloads will not.
- This is because Privacy Browser uses Android’s builtin download manager to download files, which doesn’t have a proxy option.
- Users who want to download files via Orbot need to enable its VPN mode. There is currently no way to download files through I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2017-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2017-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2017,2019 Jose A. León. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
Debido a que el tráfico está siendo enrutado a través de varios nodos proxy, usar un proxy en capas es a menudo mucho más lento que conectarse directamente a Internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_dark.png"> Descarga de archivos a través de Tor</h3>
-
- <p>Cuando Orbot funciona en modo proxy, la navegación por Internet mediante Navegador Privado se enrutará a través del proxy, pero no así las descargas de archivos.
- Esto se debe a que Navegador Privado utiliza el administrador de descargas integrado de Android para descargar archivos, que no tiene una opción de proxy.
- Los usuarios que deseen descargar archivos a través de Orbot necesitan habilitar su modo VPN. Actualmente no hay forma de descargar archivos a través de I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2017-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2017-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2017,2019 Jose A. León. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
Debido a que el tráfico está siendo enrutado a través de varios nodos proxy, usar un proxy en capas es a menudo mucho más lento que conectarse directamente a Internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_light.png"> Descarga de archivos a través de Tor</h3>
-
- <p>Cuando Orbot funciona en modo proxy, la navegación por Internet mediante Navegador Privado se enrutará a través del proxy, pero no así las descargas de archivos.
- Esto se debe a que Navegador Privado utiliza el administrador de descargas integrado de Android para descargar archivos, que no tiene una opción de proxy.
- Los usuarios que deseen descargar archivos a través de Orbot necesitan habilitar su modo VPN. Actualmente no hay forma de descargar archivos a través de I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2019 Kévin LE FLOHIC <kevinliste@framalistes.org>. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
Des proxys comme TOR (The Onion Router) et I2P (The Invisible Internet Project) sont utiles pour protéger la confidentialité des gouvernements malveillants (qui espionnent le trafic en transit)
mais pas de méga sociétés (qui intègrent du code malveillant sur les serveurs Web).</p>
+
<h3><img class="title" src="../shared_images/language_blue_dark.png"> Gouvernements Malicieux</h3>
<p>Les gouvernements malveillants espionnent souvent leurs citoyens pour punir la dissidence ou les activités liées aux droits de l'homme.
et les utilisateurs pourraient être punis parce que les gouvernements supposent qu'ils font quelque chose qui est interdit.
Ainsi, les proxies peuvent être utiles, mais elles ne sont pas une panacée.</p>
+
<h3><img class="title" src="../shared_images/language_blue_dark.png"> Méga entreprises</h3>
<p>Lorsqu'un utilisateur se connecte à un serveur Web, celui-ci peut voir l'adresse IP de l'utilisateur.
Étant donné que le trafic est acheminé via plusieurs nœuds proxy, l'utilisation d'un proxy en couches est souvent beaucoup plus lente que la connexion directe à Internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_dark.png"> Téléchargement de fichiers via Tor</h3>
-
- <p>Lorsque Orbot fonctionne en mode proxy, la navigation sur Internet à l'aide de Privacy Browser sera acheminée via le proxy, mais pas les téléchargements de fichiers.
- En effet, Privacy Browser utilise le gestionnaire de téléchargement intégré d'Android pour télécharger des fichiers, qui ne dispose pas d'une option proxy.
- Les utilisateurs qui souhaitent télécharger des fichiers via Orbot doivent activer son mode VPN. Il n'existe actuellement aucun moyen de télécharger des fichiers via I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2019 Kévin LE FLOHIC <kevinliste@framalistes.org>. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
Des proxys comme TOR (The Onion Router) et I2P (The Invisible Internet Project) sont utiles pour protéger la confidentialité des gouvernements malveillants (qui espionnent le trafic en transit)
mais pas de méga sociétés (qui intègrent du code malveillant sur les serveurs Web).</p>
+
<h3><img class="title" src="../shared_images/language_blue_light.png"> Gouvernements Malicieux</h3>
<p>Les gouvernements malveillants espionnent souvent leurs citoyens pour punir la dissidence ou les activités liées aux droits de l'homme.
et les utilisateurs pourraient être punis parce que les gouvernements supposent qu'ils font quelque chose qui est interdit.
Ainsi, les proxies peuvent être utiles, mais elles ne sont pas une panacée.</p>
+
<h3><img class="title" src="../shared_images/language_blue_light.png"> Méga entreprises</h3>
<p>Lorsqu'un utilisateur se connecte à un serveur Web, celui-ci peut voir l'adresse IP de l'utilisateur.
Étant donné que le trafic est acheminé via plusieurs nœuds proxy, l'utilisation d'un proxy en couches est souvent beaucoup plus lente que la connexion directe à Internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_light.png"> Téléchargement de fichiers via Tor</h3>
-
- <p>Lorsque Orbot fonctionne en mode proxy, la navigation sur Internet à l'aide de Privacy Browser sera acheminée via le proxy, mais pas les téléchargements de fichiers.
- En effet, Privacy Browser utilise le gestionnaire de téléchargement intégré d'Android pour télécharger des fichiers, qui ne dispose pas d'une option proxy.
- Les utilisateurs qui souhaitent télécharger des fichiers via Orbot doivent activer son mode VPN. Il n'existe actuellement aucun moyen de télécharger des fichiers via I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2017-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2017-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2017,2019 Francesco Buratti. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
Dal momento che il traffico è instradato attraverso diversi nodi proxy, l'utilizzo di un proxy a strati è spesso molto più lento di una connessione diretta a internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_dark.png"> Download di File con Tor</h3>
-
- <p>Quando Orbot sta funzionando in modalità proxy, la navigazione su internet con Privacy Browser è instradata attraverso il proxy, ma il download di file no.
- Questo perchè Privacy Browser utilizza il download manager nativo di Android per lo scaricamento dei file, e questo non ha l'opzione proxy.
- Gli utenti che vogliono scaricare i file via Orbot devono quindi abilitare la sua modalità VPN. Attualmente non c'è ancora la possibilità di scaricare file con I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2017-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2017-2020 Soren Stoutner <soren@stoutner.com>.
Translation 2017,2019 Francesco Buratti. Copyright assigned to Soren Stoutner <soren@stoutner.com>.
Dal momento che il traffico è instradato attraverso diversi nodi proxy, l'utilizzo di un proxy a strati è spesso molto più lento di una connessione diretta a internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_light.png"> Download di File con Tor</h3>
-
- <p>Quando Orbot sta funzionando in modalità proxy, la navigazione su internet con Privacy Browser è instradata attraverso il proxy, ma il download di file no.
- Questo perchè Privacy Browser utilizza il download manager nativo di Android per lo scaricamento dei file, e questo non ha l'opzione proxy.
- Gli utenti che vogliono scaricare i file via Orbot devono quindi abilitare la sua modalità VPN. Attualmente non c'è ancora la possibilità di scaricare file con I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
Поскольку трафик маршрутизируется через несколько прокси-узлов, использование многоуровневого прокси зачастую требует гораздо больше времени, чем прямое подключение к интернету.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_dark.png"> Загрузка файлов через сеть Tor</h3>
-
- <p>Когда Orbot работает в режиме прокси, навигация по интернету с помощью Privacy Browser будет проходить через прокси, а загрузка файлов - нет.
- Это связано с тем, что Privacy Browser использует встроенный менеджер загрузок Android, в котором отсутствует опция проксирования.
- Пользователи, которые хотят загружать файлы через Orbot, должны включить режим VPN. В настоящее время нет возможности загружать файлы через I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
Поскольку трафик маршрутизируется через несколько прокси-узлов, использование многоуровневого прокси зачастую требует гораздо больше времени, чем прямое подключение к интернету.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_light.png"> Загрузка файлов через сеть Tor</h3>
-
- <p>Когда Orbot работает в режиме прокси, навигация по интернету с помощью Privacy Browser будет проходить через прокси, а загрузка файлов - нет.
- Это связано с тем, что Privacy Browser использует встроенный менеджер загрузок Android, в котором отсутствует опция проксирования.
- Пользователи, которые хотят загружать файлы через Orbot, должны включить режим VPN. В настоящее время нет возможности загружать файлы через I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_dark.png"> Tor ile Dosya İndirme</h3>
-
- <p>When Orbot is operating in proxy mode, browsing the internet using Privacy Browser will be routed through the proxy, but file downloads will not.
- This is because Privacy Browser uses Android’s builtin download manager to download files, which doesn’t have a proxy option.
- Users who want to download files via Orbot need to enable its VPN mode. There is currently no way to download files through I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
<!--
- Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.</p>
<img class="center" src="images/tor.png">
-
- <h3><img class="title" src="../shared_images/file_download_blue_light.png"> Tor ile Dosya İndirme</h3>
-
- <p>When Orbot is operating in proxy mode, browsing the internet using Privacy Browser will be routed through the proxy, but file downloads will not.
- This is because Privacy Browser uses Android’s builtin download manager to download files, which doesn’t have a proxy option.
- Users who want to download files via Orbot need to enable its VPN mode. There is currently no way to download files through I2P.</p>
-
- <img class="center" src="../shared_images/vpn_mode.png">
</body>
</html>
\ No newline at end of file
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
- switch (requestCode) {
- case PERMISSION_OPEN_REQUEST_CODE:
- // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
- if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) { // The storage permission was granted.
- // Load the file.
- currentWebView.loadUrl("file://" + openFilePath);
- } else { // The storage permission was not granted.
- // Display an error snackbar.
- Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
- }
+ //Only process the results if they exist (this method is triggered when a dialog is presented the first time for an app, but no grant results are included).
+ if (grantResults.length > 0) {
+ switch (requestCode) {
+ case PERMISSION_OPEN_REQUEST_CODE:
+ // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // The storage permission was granted.
+ // Load the file.
+ currentWebView.loadUrl("file://" + openFilePath);
+ } else { // The storage permission was not granted.
+ // Display an error snackbar.
+ Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
+ }
- // Reset the open file path.
- openFilePath = "";
- break;
+ // Reset the open file path.
+ openFilePath = "";
+ break;
- case PERMISSION_SAVE_URL_REQUEST_CODE:
- // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
- if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) { // The storage permission was granted.
- // Save the raw URL.
- new SaveUrl(this, this, saveWebpageFilePath, currentWebView.getSettings().getUserAgentString(), currentWebView.getAcceptFirstPartyCookies()).execute(saveWebpageUrl);
- } else { // The storage permission was not granted.
- // Display an error snackbar.
- Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
- }
+ case PERMISSION_SAVE_URL_REQUEST_CODE:
+ // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // The storage permission was granted.
+ // Save the raw URL.
+ new SaveUrl(this, this, saveWebpageFilePath, currentWebView.getSettings().getUserAgentString(), currentWebView.getAcceptFirstPartyCookies()).execute(saveWebpageUrl);
+ } else { // The storage permission was not granted.
+ // Display an error snackbar.
+ Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
+ }
- // Reset the save strings.
- saveWebpageUrl = "";
- saveWebpageFilePath = "";
- break;
+ // Reset the save strings.
+ saveWebpageUrl = "";
+ saveWebpageFilePath = "";
+ break;
- case PERMISSION_SAVE_AS_ARCHIVE_REQUEST_CODE:
- // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
- if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) { // The storage permission was granted.
- // Save the webpage archive.
- currentWebView.saveWebArchive(saveWebpageFilePath);
- } else { // The storage permission was not granted.
- // Display an error snackbar.
- Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
- }
+ case PERMISSION_SAVE_AS_ARCHIVE_REQUEST_CODE:
+ // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // The storage permission was granted.
+ // Save the webpage archive.
+ currentWebView.saveWebArchive(saveWebpageFilePath);
+ } else { // The storage permission was not granted.
+ // Display an error snackbar.
+ Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
+ }
- // Reset the save webpage file path.
- saveWebpageFilePath = "";
- break;
+ // Reset the save webpage file path.
+ saveWebpageFilePath = "";
+ break;
- case PERMISSION_SAVE_AS_IMAGE_REQUEST_CODE:
- // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
- if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) { // The storage permission was granted.
- // Save the webpage image.
- new SaveWebpageImage(this, currentWebView).execute(saveWebpageFilePath);
- } else { // The storage permission was not granted.
- // Display an error snackbar.
- Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
- }
+ case PERMISSION_SAVE_AS_IMAGE_REQUEST_CODE:
+ // Check to see if the storage permission was granted. If the dialog was canceled the grant results will be empty.
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // The storage permission was granted.
+ // Save the webpage image.
+ new SaveWebpageImage(this, currentWebView).execute(saveWebpageFilePath);
+ } else { // The storage permission was not granted.
+ // Display an error snackbar.
+ Snackbar.make(currentWebView, getString(R.string.cannot_use_location), Snackbar.LENGTH_LONG).show();
+ }
- // Reset the save webpage file path.
- saveWebpageFilePath = "";
- break;
+ // Reset the save webpage file path.
+ saveWebpageFilePath = "";
+ break;
+ }
}
}
}
private void openWithApp(String url) {
- // Create the open with intent with `ACTION_VIEW`.
+ // Create an open with app intent with `ACTION_VIEW`.
Intent openWithAppIntent = new Intent(Intent.ACTION_VIEW);
// Set the URI but not the MIME type. This should open all available apps.
// Flag the intent to open in a new task.
openWithAppIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ // Try the intent.
try {
// Show the chooser.
startActivity(openWithAppIntent);
- } catch (ActivityNotFoundException exception) {
+ } catch (ActivityNotFoundException exception) { // There are no apps available to open the URL.
// Show a snackbar with the error.
Snackbar.make(currentWebView, getString(R.string.error) + " " + exception, Snackbar.LENGTH_INDEFINITE).show();
}
}
private void openWithBrowser(String url) {
- // Create the open with intent with `ACTION_VIEW`.
+ // Create an open with browser intent with `ACTION_VIEW`.
Intent openWithBrowserIntent = new Intent(Intent.ACTION_VIEW);
// Set the URI and the MIME type. `"text/html"` should load browser options.
// Flag the intent to open in a new task.
openWithBrowserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ // Try the intent.
try {
// Show the chooser.
startActivity(openWithBrowserIntent);
- } catch (ActivityNotFoundException exception) {
+ } catch (ActivityNotFoundException exception) { // There are no browsers available to open the URL.
// Show a snackbar with the error.
Snackbar.make(currentWebView, getString(R.string.error) + " " + exception, Snackbar.LENGTH_INDEFINITE).show();
}
// Check the response code.
if (responseCode >= 400) { // The response code is an error message.
// Set the formatted file size to indicate a bad URL.
- formattedFileSize = context.getString(R.string.bad_url);
+ formattedFileSize = context.getString(R.string.invalid_url);
} else { // The response code is not an error message.
// Get the content length header.
String contentLengthString = httpURLConnection.getHeaderField("Content-Length");
}
} catch (IOException exception) {
// Set the formatted file size to indicate a bad URL.
- formattedFileSize = context.getString(R.string.bad_url);
+ formattedFileSize = context.getString(R.string.invalid_url);
}
// Return the formatted file size string.
package com.stoutner.privacybrowser.asynctasks;
import android.app.Activity;
+import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
+import android.os.Build;
+import android.view.View;
import android.webkit.CookieManager;
+import androidx.core.content.FileProvider;
+
import com.google.android.material.snackbar.Snackbar;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.helpers.ProxyHelper;
NoSwipeViewPager noSwipeViewPager = activity.findViewById(R.id.webviewpager);
// Create a saving file snackbar.
- savingFileSnackbar = Snackbar.make(noSwipeViewPager, activity.getString(R.string.saving_file) + ": " + filePathString, Snackbar.LENGTH_INDEFINITE);
+ savingFileSnackbar = Snackbar.make(noSwipeViewPager, activity.getString(R.string.saving_file) + " 0% - " + filePathString, Snackbar.LENGTH_INDEFINITE);
// Display the saving file snackbar.
savingFileSnackbar.show();
@Override
protected String doInBackground(String... urlToSave) {
- // Get a handle for the context and activity.
+ // Get handles for the context and activity.
Context context = contextWeakReference.get();
Activity activity = activityWeakReference.get();
String formattedNumberOfBytesDownloaded = NumberFormat.getInstance().format(numberOfBytesDownloaded);
// Update the snackbar.
- savingFileSnackbar.setText(activity.getString(R.string.saving_file) + ": " + formattedNumberOfBytesDownloaded + " " + activity.getString(R.string.bytes) + " - " + filePathString);
+ savingFileSnackbar.setText(activity.getString(R.string.saving_file) + " " + formattedNumberOfBytesDownloaded + " " + activity.getString(R.string.bytes) + " - " + filePathString);
} else { // There is a download percentage.
// Update the snackbar.
- savingFileSnackbar.setText(activity.getString(R.string.saving_file) + ": " + downloadPercentage[0] + "% - " + filePathString);
+ savingFileSnackbar.setText(activity.getString(R.string.saving_file) + " " + downloadPercentage[0] + "% - " + filePathString);
}
}
// `onPostExecute()` operates on the UI thread.
@Override
protected void onPostExecute(String saveDisposition) {
- // Get a handle for the activity.
+ // Get handles for the context and activity.
+ Context context = contextWeakReference.get();
Activity activity = activityWeakReference.get();
// Abort if the activity is gone.
// Display a save disposition snackbar.
if (saveDisposition.equals(SUCCESS)) {
- Snackbar.make(noSwipeViewPager, R.string.file_saved, Snackbar.LENGTH_SHORT).show();
+ // Create a file saved snackbar.
+ Snackbar fileSavedSnackbar = Snackbar.make(noSwipeViewPager, activity.getString(R.string.file_saved) + " " + filePathString, Snackbar.LENGTH_LONG);
+
+ // Add an open action if the file is not an APK on API >= 26 (that scenario requires the REQUEST_INSTALL_PACKAGES permission).
+ if (!(Build.VERSION.SDK_INT >= 26 && filePathString.endsWith(".apk"))) {
+ fileSavedSnackbar.setAction(R.string.open, (View v) -> {
+ // Get a file for the file path string.
+ File file = new File(filePathString);
+
+ // Create an open intent with `ACTION_VIEW`.
+ Intent openIntent = new Intent(Intent.ACTION_VIEW);
+
+ // Set the URI but not the MIME type. This should open all available apps.
+ openIntent.setData(FileProvider.getUriForFile(context, activity.getString(R.string.file_provider), file));
+
+ // Allow the app to read the file URI.
+ openIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+
+ // Try the intent.
+ try {
+ // Show the chooser.
+ activity.startActivity(openIntent);
+ } catch (ActivityNotFoundException exception) { // There are no apps available to open the URL.
+ // Show a snackbar with the error.
+ Snackbar.make(noSwipeViewPager, activity.getString(R.string.error) + " " + exception, Snackbar.LENGTH_INDEFINITE).show();
+ }
+ });
+ }
+
+ // Show the file saved snackbar.
+ fileSavedSnackbar.show();
} else {
+ // Display the file saving error.
Snackbar.make(noSwipeViewPager, activity.getString(R.string.error_saving_file) + " " + saveDisposition, Snackbar.LENGTH_INDEFINITE).show();
}
}
<string name="print">Drucken</string>
<string name="privacy_browser_web_page">Privacy Browser-Website</string>
<string name="save">Speichern</string>
+ <string name="save_url">URL speichern</string>
<string name="save_as_archive">Als Archiv speichern</string>
<string name="save_as_image">Als Grafik speichern</string>
<string name="view_source">Quelltext anzeigen</string>
<string name="save_image">Grafik speichern</string>
<string name="webpage_mht">Webseite.mht</string>
<string name="webpage_png">Webseite.png</string>
+ <string name="file">Datei</string>
+ <string name="bytes">Bytes</string>
<string name="unknown_size">Unbekannte Größe</string>
+ <string name="invalid_url">Ungültige URL</string>
<string name="ok">OK</string>
+ <string name="saving_file">Speichere Datei:</string>
<string name="saving_image">Speichere Grafik…</string>
+ <string name="file_saved">Datei gespeichert:</string>
<string name="image_saved">Grafik gespeichert.</string>
+ <string name="error_saving_file">Fehler beim Speichern der Datei:</string>
<string name="error_saving_image">Fehler beim Speichern der Grafik:</string>
<!-- View Source. -->
<string name="print">Imprimir</string>
<string name="privacy_browser_web_page">Página web de Navegador Privado</string>
<string name="save">Guardar</string>
+ <string name="save_url">Guardar URL</string>
<string name="save_as_archive">Guardar como archivo</string>
<string name="save_as_image">Guardar como imagen</string>
<string name="add_to_home_screen">Añadir a la ventana de inicio</string>
<string name="save_image">Guardar imagen</string>
<string name="webpage_mht">PaginaWeb.mht</string>
<string name="webpage_png">PaginaWeb.png</string>
+ <string name="file">Archivo</string>
+ <string name="bytes">bytes</string>
<string name="unknown_size">Tamaño desconocido</string>
+ <string name="invalid_url">URL inválida</string>
<string name="ok">OK</string>
+ <string name="saving_file">Guardando archivo:</string>
<string name="saving_image">Guardando imagen…</string>
+ <string name="file_saved">Archivo guardado:</string>
<string name="image_saved">Imagen guardada.</string>
+ <string name="error_saving_file">Error guardando archivo:</string>
<string name="error_saving_image">Error guardando imagen:</string>
<!-- View Source. -->
<string name="print">Stampa</string>
<string name="privacy_browser_web_page">Pagina web di Privacy Browser</string>
<string name="save">Salva</string>
+ <string name="save_url">Salva URL</string>
<string name="save_as_archive">Salva come Archivio</string>
<string name="save_as_image">Salva come Immagine</string>
<string name="add_to_home_screen">Aggiungi collegamento</string>
<string name="save_image">Salva Immagine</string>
<string name="webpage_mht">PaginaWeb.mht</string>
<string name="webpage_png">PaginaWeb.png</string>
+ <string name="file">File</string>
+ <string name="bytes">byte</string>
<string name="unknown_size">Dimensione sconosciuta</string>
+ <string name="invalid_url">URL non valida</string>
<string name="ok">OK</string>
+ <string name="saving_file">Salvataggio file:</string>
<string name="saving_image">Salvataggio immagine…</string>
+ <string name="file_saved">File salvato:</string>
<string name="image_saved">Immagine salvata.</string>
+ <string name="error_saving_file">Errore salvataggio file:</string>
<string name="error_saving_image">Errore nel salvare l\'immagine:</string>
<!-- View Source. -->
<string name="print">Печать</string>
<string name="privacy_browser_web_page">Privacy Browser веб-страница</string>
<string name="save">Сохранить</string>
+ <string name="save_url">Сохранить URL</string>
<string name="save_as_archive">Сохранить как архив</string>
<string name="save_as_image">Сохранить как изображение</string>
<string name="add_to_home_screen">Добавить на главный экран</string>
<string name="save_image">Сохранить изображение</string>
<string name="webpage_mht">Webpage.mht</string>
<string name="webpage_png">Webpage.png</string>
+ <string name="file">Файл</string>
+ <string name="bytes">байтов</string>
<string name="unknown_size">неизвестный размер</string>
+ <string name="invalid_url">неправильный URL</string>
<string name="ok">OK</string>
+ <string name="saving_file">Сохранение файла:</string>
<string name="saving_image">Сохранение изображения…</string>
+ <string name="file_saved">Файл сохранен:</string>
<string name="image_saved">Изображение сохранено.</string>
+ <string name="error_saving_file">Ошибка сохранения файла:</string>
<string name="error_saving_image">Ошибка сохранения изображения:</string>
<!-- View Source. -->
<string name="file">File</string>
<string name="bytes">bytes</string>
<string name="unknown_size">unknown size</string>
- <string name="bad_url">bad URL</string>
+ <string name="invalid_url">invalid URL</string>
<string name="ok">OK</string>
- <string name="saving_file">Saving file</string>
+ <string name="saving_file">Saving file:</string>
<string name="saving_image">Saving image…</string>
- <string name="file_saved">File saved.</string>
+ <string name="file_saved">File saved:</string>
<string name="image_saved">Image saved.</string>
<string name="error_saving_file">Error saving file:</string>
<string name="error_saving_image">Error saving image:</string>