From: Soren Stoutner Date: Sun, 22 Dec 2019 02:17:52 +0000 (-0700) Subject: Switch to using AndroidX's ProxyController. https://redmine.stoutner.com/issues/486 X-Git-Tag: v3.3~3 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=01d647c09b892384e0b42e86b000b5cb858f7a2b;p=PrivacyBrowserAndroid.git Switch to using AndroidX's ProxyController. https://redmine.stoutner.com/issues/486 --- diff --git a/app/build.gradle b/app/build.gradle index d9b91dae..6b78da9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,6 +77,7 @@ dependencies { implementation 'androidx.preference:preference:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' implementation 'androidx.viewpager:viewpager:1.0.0' + implementation 'androidx.webkit:webkit:1.1.0' // Include the Google material library. implementation 'com.google.android.material:material:1.0.0' diff --git a/app/src/main/assets/de/guide_proxies_dark.html b/app/src/main/assets/de/guide_proxies_dark.html index ca09549f..27d47e6c 100644 --- a/app/src/main/assets/de/guide_proxies_dark.html +++ b/app/src/main/assets/de/guide_proxies_dark.html @@ -28,63 +28,69 @@ -

Proxies and Their Limits

+

Proxies deren Einschränkungen

Faktoren, die die Privatsphäre im Web einschränken wollen, lassen sich hauptsächlich in zwei verschiedene Kategorien unterteilen: Neugierige Behörden mit Zugriff auf Internetprovider und grosse Konzerne, die "soziale" und Werbe-Netzwerke betreiben. - Proxies like TOR (The Onion Router) and I2P (the Invisible Internet Project) are useful in protecting privacy from malicious governments (which spy on traffic in transit) - but not from mega corporations (which embed malicious code on web servers).

+ Proxies wie TOR (The Onion Router) und + I2P (Invisible Internet Project) können hilfreich sein, + um Ihre Privatsphäre vor böswilligen Obrigkeiten (welche Ihren Datenverkehr ausspionieren) zu schützen, nicht jedoch vor Megafirmen (welche Schadcode auf Webservern einbinden).

Neugierige Behörden

Oft spähen neugierige Behörden Bürger aus, um Fehlverhalten und Menschenrechtsaktivitäten zu bestrafen. Üblicherweise betreiben sie entweder die Internetprovider selbst oder sie können Provider dazu zwingen, Informationen über jede besuchte IP-Adresse und die zugehörigen Benutzer herauszugeben. - Layered proxies are designed to defeat this infringement of privacy by encrypting the traffic from a user’s device and routing it through multiple servers on the internet - before sending it on to the final destination. - This means that no individual ISP, server, or website, can know both the IP address of the user’s device and the IP address of the final web server. - Malicious governments and the ISPs they control cannot tell which web servers a user is accessing, although they can tell that the user is using a layered proxy service. - In some parts of the world, using proxies could be construed as an evidence of illegal behavior (“If you didn’t have anything to hide you wouldn’t be encrypting your traffic”) - and users could be punished because governments assume they are doing something that is prohibited. Thus, proxies can be helpful, but they aren’t a panacea.

+ Proxy-Server (layered proxies) versuchen solche Verstöße zu unterbinden, indem der Netzwerk-Verkehr eines Geräts verschlüsselt und über mehrere Server im Internet geleitet wird, + bevor er zum endgültigen Ziel geschickt wird. + Dadurch soll sichergestellt werden, dass Internet-Provider, + Server oder Websites weder die IP-Adresse des Gerätes noch die IP-Adresse des endgültigen Ziel-Webservers kennen. + Böswillige Obrigkeiten und von Ihnen kontrollierte Internet-Provider können so nicht erkennen, + auf welche Webserver ein Benutzer zugreift - sie können jedoch feststellen, dass der Benutzer einen Proxy-Service nutzt. + In einigen Teilen der Welt kann die Nutzung von Proxies als Anzeichen von illegalem Verhalten gewertet ("Wenn Du nichts zu verbergen hättest, würdest Du Deinen Datenverkehr nicht verschlüsseln") + und Benutzer belangt werden, weil Obrigkeiten annehmen, dass Nutzer damit Verbotenes tun. Daher können Proxies hilfreich sein, stellen jedoch kein Allheilmittel dar.

Megafirmen

Wenn ein Benutzer sich mit einem Webserver verbindet, kann der Webserver seine IP-Adresse sehen. Obwohl es keine ausgereifte Methode ist, können IP-Adressen in physische Adressen umgewandelt werden - mit erstaunlicher Genauigkeit. - Small web servers typically rely on IP addresses to identify the location of the users visiting their site. Proxies are a good solution to mask the user’s location from these servers. + Kleinere Webserver verlassen sich üblicherweise auf die IP-Adresse, um den Standort von Benutzern, die Ihre Internet-Seiten besuchen, festzustellen. + Proxies sind in solchen Fällen eine gute Lösung, um den Standort eines Benutzers vor den Serverbetreibern zu verschleiern. Große Megafirmen, die "soziale" und Werbe-Netzwerke betreiben, nutzen jedoch Profile an Informationen, um Benutzer über ihre Geräte und IP-Adressen hinweg zu tracken. Diese Profile nutzen verschiedene Techniken um Benutzer ausfindig zu machen, inklusive JavaScript, Cookies, Tracking-IDs und den sogenannten "Browser-Fingerabdruck" (fingerprinting). - Weil die große Mehrheit der Websites im Internet Werbung entweder von den großen Werbenetzwerken oder von eingebetteten Social-Media-Buttons mit ihrem zugewiesenen JavaScript lädt, + Weil die große Mehrheit der Websites im Internet Werbung entweder von großen Werbenetzwerken oder von eingebetteten Social-Media-Buttons mit ihrem zugewiesenen JavaScript lädt, haben die großen Megafirmen Profile von so gut wie jedem Internetnutzer angefertigt und verfolgen deren Aktivitäten über zueinander unabhängige Seiten.

Sie verfolgen jede besuchte Seite, Alles online Gekaufte, jede für Einkäufe genutzte Kreditkarte, jede Adresse, an die Waren verschickt werden, und die GPS-Metadaten von jedem ins Internet hochgeladene Foto. Sie fertigen Profile an, die Alter, Geschlecht, Beziehungsstatus, Adresse, politische und religiöse Ansichten, familiäre Umstände, Anzahl der Haustiere und alles Andere, was sie über einen Nutzer herausfinden können, beinhalten. - Sie kaufen sogar ganze Datenbanken mit Informationen über Kreditkartennutzungen in Geschäften auf, damit sie Offline-Einkaufsverhalten von Nutzern in ihren Profilen nachverfolgen können. - Because they already have much more accurate address information about a user than an IP address discloses, proxies provides no real privacy protection against mega corporations.

+ Sie kaufen sogar ganze Datenbanken mit Informationen über Kreditkartennutzungen in Geschäften auf, damit sie das Offline-Einkaufsverhalten von Nutzern in ihren Profilen nachverfolgen können. + Da sie damit bereits wesentlich genauere Adress-Informationen über einen Benutzer haben als eine IP-Adresse offenlegt, bieten Proxies keinen nennenswerten Privatsphäre-Schutz gegen Megafirmen.

Der einzige und beste Schutz der Privatsphäre gegen Megafirmen ist es, mit deaktivieren JavaScript durchs Web zu surfen, gefolgt von geblockten Werbenetzwerken, deaktivierten Cookies und DOM-Speicher und das Benutzen eines Browsers, der schwierig zu "fingerprinten" ist.

-

Using Proxies

+

Nutzung von Proxies

-

Despite their limitations, proxies can be useful in some circumstances. - Tor and I2p - have Android apps that make it easy to use their proxy networks. When proxying is turned on in Privacy Browser, the app bar will have a light blue background instead of the default light grey. - Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.

+

Trotz ihrer Einschränkungen können Proxies unter bestimmen Umständen durchaus nützlich sein. + Tor und I2p + existieren Android-Apps, die die einfache Nutzung dieser Proxy-Netzwerke ermöglichen. + Wird die Nutzung dieser Proxy-Netzwerke in Privacy Browser aktiviert, wird die App-Leiste mit einem hellblauen statt hellgrauen Hintergrund versehen. + Da der Datenverkehr in solchen Fällen jedoch über mehrere Proxy-Knoten geleitet wird, + ist die Übertragungsgeschwindigkeit bei der Nutzung von Proxies meist deutlich langsamer als bei direkten Internet-Verbindungen.

Herunterladen von Dateien mittels TOR

-

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.

+

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.

diff --git a/app/src/main/assets/de/guide_proxies_light.html b/app/src/main/assets/de/guide_proxies_light.html index 34d72117..9aaa3b9b 100644 --- a/app/src/main/assets/de/guide_proxies_light.html +++ b/app/src/main/assets/de/guide_proxies_light.html @@ -28,63 +28,69 @@ -

Proxies and Their Limits

+

Proxies deren Einschränkungen

Faktoren, die die Privatsphäre im Web einschränken wollen, lassen sich hauptsächlich in zwei verschiedene Kategorien unterteilen: Neugierige Behörden mit Zugriff auf Internetprovider und grosse Konzerne, die "soziale" und Werbe-Netzwerke betreiben. - Proxies like TOR (The Onion Router) and I2P (the Invisible Internet Project) are useful in protecting privacy from malicious governments (which spy on traffic in transit) - but not from mega corporations (which embed malicious code on web servers).

+ Proxies wie TOR (The Onion Router) und + I2P (Invisible Internet Project) können hilfreich sein, + um Ihre Privatsphäre vor böswilligen Obrigkeiten (welche Ihren Datenverkehr ausspionieren) zu schützen, nicht jedoch vor Megafirmen (welche Schadcode auf Webservern einbinden).

Neugierige Behörden

Oft spähen neugierige Behörden Bürger aus, um Fehlverhalten und Menschenrechtsaktivitäten zu bestrafen. Üblicherweise betreiben sie entweder die Internetprovider selbst oder sie können Provider dazu zwingen, Informationen über jede besuchte IP-Adresse und die zugehörigen Benutzer herauszugeben. - Layered proxies are designed to defeat this infringement of privacy by encrypting the traffic from a user’s device and routing it through multiple servers on the internet - before sending it on to the final destination. - This means that no individual ISP, server, or website, can know both the IP address of the user’s device and the IP address of the final web server. - Malicious governments and the ISPs they control cannot tell which web servers a user is accessing, although they can tell that the user is using a layered proxy service. - In some parts of the world, using proxies could be construed as an evidence of illegal behavior (“If you didn’t have anything to hide you wouldn’t be encrypting your traffic”) - and users could be punished because governments assume they are doing something that is prohibited. Thus, proxies can be helpful, but they aren’t a panacea.

+ Proxy-Server (layered proxies) versuchen solche Verstöße zu unterbinden, indem der Netzwerk-Verkehr eines Geräts verschlüsselt und über mehrere Server im Internet geleitet wird, + bevor er zum endgültigen Ziel geschickt wird. + Dadurch soll sichergestellt werden, dass Internet-Provider, + Server oder Websites weder die IP-Adresse des Gerätes noch die IP-Adresse des endgültigen Ziel-Webservers kennen. + Böswillige Obrigkeiten und von Ihnen kontrollierte Internet-Provider können so nicht erkennen, + auf welche Webserver ein Benutzer zugreift - sie können jedoch feststellen, dass der Benutzer einen Proxy-Service nutzt. + In einigen Teilen der Welt kann die Nutzung von Proxies als Anzeichen von illegalem Verhalten gewertet ("Wenn Du nichts zu verbergen hättest, würdest Du Deinen Datenverkehr nicht verschlüsseln") + und Benutzer belangt werden, weil Obrigkeiten annehmen, dass Nutzer damit Verbotenes tun. Daher können Proxies hilfreich sein, stellen jedoch kein Allheilmittel dar.

Megafirmen

Wenn ein Benutzer sich mit einem Webserver verbindet, kann der Webserver seine IP-Adresse sehen. Obwohl es keine ausgereifte Methode ist, können IP-Adressen in physische Adressen umgewandelt werden - mit erstaunlicher Genauigkeit. - Small web servers typically rely on IP addresses to identify the location of the users visiting their site. Proxies are a good solution to mask the user’s location from these servers. + Kleinere Webserver verlassen sich üblicherweise auf die IP-Adresse, um den Standort von Benutzern, die Ihre Internet-Seiten besuchen, festzustellen. + Proxies sind in solchen Fällen eine gute Lösung, um den Standort eines Benutzers vor den Serverbetreibern zu verschleiern. Große Megafirmen, die "soziale" und Werbe-Netzwerke betreiben, nutzen jedoch Profile an Informationen, um Benutzer über ihre Geräte und IP-Adressen hinweg zu tracken. Diese Profile nutzen verschiedene Techniken um Benutzer ausfindig zu machen, inklusive JavaScript, Cookies, Tracking-IDs und den sogenannten "Browser-Fingerabdruck" (fingerprinting). - Weil die große Mehrheit der Websites im Internet Werbung entweder von den großen Werbenetzwerken oder von eingebetteten Social-Media-Buttons mit ihrem zugewiesenen JavaScript lädt, + Weil die große Mehrheit der Websites im Internet Werbung entweder von großen Werbenetzwerken oder von eingebetteten Social-Media-Buttons mit ihrem zugewiesenen JavaScript lädt, haben die großen Megafirmen Profile von so gut wie jedem Internetnutzer angefertigt und verfolgen deren Aktivitäten über zueinander unabhängige Seiten.

Sie verfolgen jede besuchte Seite, Alles online Gekaufte, jede für Einkäufe genutzte Kreditkarte, jede Adresse, an die Waren verschickt werden, und die GPS-Metadaten von jedem ins Internet hochgeladene Foto. Sie fertigen Profile an, die Alter, Geschlecht, Beziehungsstatus, Adresse, politische und religiöse Ansichten, familiäre Umstände, Anzahl der Haustiere und alles Andere, was sie über einen Nutzer herausfinden können, beinhalten. - Sie kaufen sogar ganze Datenbanken mit Informationen über Kreditkartennutzungen in Geschäften auf, damit sie Offline-Einkaufsverhalten von Nutzern in ihren Profilen nachverfolgen können. - Because they already have much more accurate address information about a user than an IP address discloses, proxies provides no real privacy protection against mega corporations.

+ Sie kaufen sogar ganze Datenbanken mit Informationen über Kreditkartennutzungen in Geschäften auf, damit sie das Offline-Einkaufsverhalten von Nutzern in ihren Profilen nachverfolgen können. + Da sie damit bereits wesentlich genauere Adress-Informationen über einen Benutzer haben als eine IP-Adresse offenlegt, bieten Proxies keinen nennenswerten Privatsphäre-Schutz gegen Megafirmen.

Der einzige und beste Schutz der Privatsphäre gegen Megafirmen ist es, mit deaktivieren JavaScript durchs Web zu surfen, gefolgt von geblockten Werbenetzwerken, deaktivierten Cookies und DOM-Speicher und das Benutzen eines Browsers, der schwierig zu "fingerprinten" ist.

-

Using Proxies

+

Nutzung von Proxies

-

Despite their limitations, proxies can be useful in some circumstances. - Tor and I2p - have Android apps that make it easy to use their proxy networks. When proxying is turned on in Privacy Browser, the app bar will have a light blue background instead of the default light grey. - Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.

+

Trotz ihrer Einschränkungen können Proxies unter bestimmen Umständen durchaus nützlich sein. + Tor und I2p + existieren Android-Apps, die die einfache Nutzung dieser Proxy-Netzwerke ermöglichen. + Wird die Nutzung dieser Proxy-Netzwerke in Privacy Browser aktiviert, wird die App-Leiste mit einem hellblauen statt hellgrauen Hintergrund versehen. + Da der Datenverkehr in solchen Fällen jedoch über mehrere Proxy-Knoten geleitet wird, + ist die Übertragungsgeschwindigkeit bei der Nutzung von Proxies meist deutlich langsamer als bei direkten Internet-Verbindungen.

Herunterladen von Dateien mittels TOR

-

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.

+

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.

diff --git a/app/src/main/assets/es/guide_proxies_dark.html b/app/src/main/assets/es/guide_proxies_dark.html index fae7b7bd..21408324 100644 --- a/app/src/main/assets/es/guide_proxies_dark.html +++ b/app/src/main/assets/es/guide_proxies_dark.html @@ -26,64 +26,68 @@ -

Proxies and Their Limits

+

Proxis y sus límites

Existen dos categorías generales de malos actores que quieren infringir la privacidad de la web: gobiernos maliciosos con acceso a ISPs (Proveedores de Servicios de Internet) y grandes corporaciones que ofrecen redes sociales y de publicidad. - Proxies like TOR (The Onion Router) and I2P (the Invisible Internet Project) are useful in protecting privacy from malicious governments (which spy on traffic in transit) - but not from mega corporations (which embed malicious code on web servers).

+ Los proxies como TOR (The Onion Router) e I2P (the Invisible Internet Project) son útiles para proteger la privacidad frente a los gobiernos maliciosos (que espían el tráfico en tránsito) + pero no de las mega corporaciones (que incrustan código malicioso en los servidores web).

Gobiernos maliciosos

Los gobiernos maliciosos a menudo espían a sus ciudadanos para castigar la disidencia o la actividad de derechos humanos. Normalmente suelen operar los ISPs locales o los fuerzan a revelar información mostrando cada dirección IP que visita cada usuario. - Layered proxies are designed to defeat this infringement of privacy by encrypting the traffic from a user’s device and routing it through multiple servers on the internet - before sending it on to the final destination. - This means that no individual ISP, server, or website, can know both the IP address of the user’s device and the IP address of the final web server. - Malicious governments and the ISPs they control cannot tell which web servers a user is accessing, although they can tell that the user is using a layered proxy service. - In some parts of the world, using proxies could be construed as an evidence of illegal behavior (“If you didn’t have anything to hide you wouldn’t be encrypting your traffic”) - and users could be punished because governments assume they are doing something that is prohibited. Thus, proxies can be helpful, but they aren’t a panacea.

+ Los proxis en capas están diseñados para derrotar esta violación de la privacidad mediante el cifrado del tráfico del dispositivo de un usuario + y su enrutamiento a través de múltiples servidores en Internet antes de enviarlo al destino final. + Esto significa que ningún ISP, servidor o sitio web individual puede conocer tanto la dirección IP del dispositivo del usuario como la dirección IP del servidor web final. + Los gobiernos malintencionados y los ISP que ellos controlan no pueden saber a qué servidores web está accediendo un usuario, + aunque sí pueden saber que el usuario está utilizando un servicio proxy en capas. + En algunas partes del mundo, el uso de proxis podría ser interpretado como una evidencia de comportamiento ilegal (“Si no tuvieras nada que ocultar no estarías cifrando tu tráfico”) + y los usuarios podrían ser castigados porque los gobiernos asumen que están haciendo algo que está prohibido. Por lo tanto, los proxis pueden ser útiles, pero no son una panacea.

Grandes corporaciones

Cuando un usuario se conecta a un servidor web, éste puede ver la dirección IP del usuario. Aunque esto no es una ciencia perfecta, las direcciones IP se pueden convertir a direcciones físicas con bastante precisión. - Small web servers typically rely on IP addresses to identify the location of the users visiting their site. Proxies are a good solution to mask the user’s location from these servers. - Pero las más grandes corporaciones que poseen medios sociales y redes de publicidad usan un perfil completo de información diseñado - para rastrear a los usuarios a través de los dispositivos y direcciones IP. + Los pequeños servidores web suelen depender de las direcciones IP para identificar la ubicación de los usuarios que visitan su sitio. + Los proxis son una buena solución para enmascarar la ubicación del usuario desde estos servidores. + Pero las más grandes corporaciones que poseen medios sociales y redes de publicidad usan un perfil completo de información + diseñado para rastrear a los usuarios a través de los dispositivos y direcciones IP. Estos perfiles emplean una variedad de técnicas para identificar a los usuarios, incluyendo Javascript, cookies, IDs de seguimiento, y huellas del navegador. Debido a que la gran mayoría de páginas web en internet, o cargan un anuncio de una de las principales redes, o integran iconos de medios sociales con su Javascript asociado, estas corporaciones han creado perfiles para casi todos los usuarios en línea y pueden rastrear su actividad en internet a través de sitios que no están relacionados.

Ellos rastrean cada sitio web visitado, todo lo que se compra, cada tarjeta de crédito que es usada para realizar una compra, cada dirección a la que se envían los artículos, - y los metadatos GPS de cada imágen que se sube a internet. + y los metadatos GPS de cada imagen que se sube a internet. Construyen un perfil de la edad del usuario, género, estado civil, dirección, afiliaciones políticas, afiliaciones religiosas, circunstancias familiares, número de mascotas, y cualquier otra cosa que caiga en sus manos. Incluso compran bases de datos de transacciones con tarjeta de crédito en tiendas locales, para así poder rastrear de los usuarios en sus perfiles los patrones de compra que hacen cuando no están conectados. - Because they already have much more accurate address information about a user than an IP address discloses, proxies provides no real privacy protection against mega corporations.

+ Debido a que tienen ya una información de dirección mucho más precisa sobre un usuario que la que revela una dirección IP, + los proxis no proporcionan ninguna protección real de privacidad contra las mega corporaciones.

La única mejor protección de la privacidad contra las grandes corporaciones es navegar por la web con Javascript deshabilitado, seguido de bloquear redes publicitarias, inhabilitar cookies y almacenamiento DOM, y usar un navegador del que sea difícil recoger huellas.

-

Using Proxies

+

Uso de Proxis

-

Despite their limitations, proxies can be useful in some circumstances. - Tor and I2p - have Android apps that make it easy to use their proxy networks. When proxying is turned on in Privacy Browser, the app bar will have a light blue background instead of the default light grey. - Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.

+

A pesar de sus limitaciones, los proxis pueden ser útiles en algunas circunstancias. + Tor e I2p + tienen aplicaciones Android que facilitan el uso de sus redes de proxy. Cuando se activa el proxy en Navegador Privado, + la barra de aplicaciones tendrá un fondo azul claro en lugar del gris claro predeterminado. + 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.

Descarga de archivos a través de Tor

-

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.

+

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.

diff --git a/app/src/main/assets/es/guide_proxies_light.html b/app/src/main/assets/es/guide_proxies_light.html index 97dc8ff2..6dd1ee7d 100644 --- a/app/src/main/assets/es/guide_proxies_light.html +++ b/app/src/main/assets/es/guide_proxies_light.html @@ -26,64 +26,68 @@ -

Proxies and Their Limits

+

Proxis y sus límites

Existen dos categorías generales de malos actores que quieren infringir la privacidad de la web: gobiernos maliciosos con acceso a ISPs (Proveedores de Servicios de Internet) y grandes corporaciones que ofrecen redes sociales y de publicidad. - Proxies like TOR (The Onion Router) and I2P (the Invisible Internet Project) are useful in protecting privacy from malicious governments (which spy on traffic in transit) - but not from mega corporations (which embed malicious code on web servers).

+ Los proxies como TOR (The Onion Router) e I2P (the Invisible Internet Project) son útiles para proteger la privacidad frente a los gobiernos maliciosos (que espían el tráfico en tránsito) + pero no de las mega corporaciones (que incrustan código malicioso en los servidores web).

Gobiernos maliciosos

Los gobiernos maliciosos a menudo espían a sus ciudadanos para castigar la disidencia o la actividad de derechos humanos. Normalmente suelen operar los ISPs locales o los fuerzan a revelar información mostrando cada dirección IP que visita cada usuario. - Layered proxies are designed to defeat this infringement of privacy by encrypting the traffic from a user’s device and routing it through multiple servers on the internet - before sending it on to the final destination. - This means that no individual ISP, server, or website, can know both the IP address of the user’s device and the IP address of the final web server. - Malicious governments and the ISPs they control cannot tell which web servers a user is accessing, although they can tell that the user is using a layered proxy service. - In some parts of the world, using proxies could be construed as an evidence of illegal behavior (“If you didn’t have anything to hide you wouldn’t be encrypting your traffic”) - and users could be punished because governments assume they are doing something that is prohibited. Thus, proxies can be helpful, but they aren’t a panacea.

+ Los proxis en capas están diseñados para derrotar esta violación de la privacidad mediante el cifrado del tráfico del dispositivo de un usuario + y su enrutamiento a través de múltiples servidores en Internet antes de enviarlo al destino final. + Esto significa que ningún ISP, servidor o sitio web individual puede conocer tanto la dirección IP del dispositivo del usuario como la dirección IP del servidor web final. + Los gobiernos malintencionados y los ISP que ellos controlan no pueden saber a qué servidores web está accediendo un usuario, + aunque sí pueden saber que el usuario está utilizando un servicio proxy en capas. + En algunas partes del mundo, el uso de proxis podría ser interpretado como una evidencia de comportamiento ilegal (“Si no tuvieras nada que ocultar no estarías cifrando tu tráfico”) + y los usuarios podrían ser castigados porque los gobiernos asumen que están haciendo algo que está prohibido. Por lo tanto, los proxis pueden ser útiles, pero no son una panacea.

Grandes corporaciones

Cuando un usuario se conecta a un servidor web, éste puede ver la dirección IP del usuario. Aunque esto no es una ciencia perfecta, las direcciones IP se pueden convertir a direcciones físicas con bastante precisión. - Small web servers typically rely on IP addresses to identify the location of the users visiting their site. Proxies are a good solution to mask the user’s location from these servers. - Pero las más grandes corporaciones que poseen medios sociales y redes de publicidad usan un perfil completo de información diseñado - para rastrear a los usuarios a través de los dispositivos y direcciones IP. + Los pequeños servidores web suelen depender de las direcciones IP para identificar la ubicación de los usuarios que visitan su sitio. + Los proxis son una buena solución para enmascarar la ubicación del usuario desde estos servidores. + Pero las más grandes corporaciones que poseen medios sociales y redes de publicidad usan un perfil completo de información + diseñado para rastrear a los usuarios a través de los dispositivos y direcciones IP. Estos perfiles emplean una variedad de técnicas para identificar a los usuarios, incluyendo Javascript, cookies, IDs de seguimiento, y huellas del navegador. Debido a que la gran mayoría de páginas web en internet, o cargan un anuncio de una de las principales redes, o integran iconos de medios sociales con su Javascript asociado, estas corporaciones han creado perfiles para casi todos los usuarios en línea y pueden rastrear su actividad en internet a través de sitios que no están relacionados.

Ellos rastrean cada sitio web visitado, todo lo que se compra, cada tarjeta de crédito que es usada para realizar una compra, cada dirección a la que se envían los artículos, - y los metadatos GPS de cada imágen que se sube a internet. + y los metadatos GPS de cada imagen que se sube a internet. Construyen un perfil de la edad del usuario, género, estado civil, dirección, afiliaciones políticas, afiliaciones religiosas, circunstancias familiares, número de mascotas, y cualquier otra cosa que caiga en sus manos. Incluso compran bases de datos de transacciones con tarjeta de crédito en tiendas locales, para así poder rastrear de los usuarios en sus perfiles los patrones de compra que hacen cuando no están conectados. - Because they already have much more accurate address information about a user than an IP address discloses, proxies provides no real privacy protection against mega corporations.

+ Debido a que tienen ya una información de dirección mucho más precisa sobre un usuario que la que revela una dirección IP, + los proxis no proporcionan ninguna protección real de privacidad contra las mega corporaciones.

La única mejor protección de la privacidad contra las grandes corporaciones es navegar por la web con Javascript deshabilitado, seguido de bloquear redes publicitarias, inhabilitar cookies y almacenamiento DOM, y usar un navegador del que sea difícil recoger huellas.

-

Using Proxies

+

Uso de Proxis

-

Despite their limitations, proxies can be useful in some circumstances. - Tor and I2p - have Android apps that make it easy to use their proxy networks. When proxying is turned on in Privacy Browser, the app bar will have a light blue background instead of the default light grey. - Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.

+

A pesar de sus limitaciones, los proxis pueden ser útiles en algunas circunstancias. + Tor e I2p + tienen aplicaciones Android que facilitan el uso de sus redes de proxy. Cuando se activa el proxy en Navegador Privado, + la barra de aplicaciones tendrá un fondo azul claro en lugar del gris claro predeterminado. + 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.

Descarga de archivos a través de Tor

-

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.

+

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.

diff --git a/app/src/main/assets/fr/guide_proxies_dark.html b/app/src/main/assets/fr/guide_proxies_dark.html index 04a87664..0b876b60 100644 --- a/app/src/main/assets/fr/guide_proxies_dark.html +++ b/app/src/main/assets/fr/guide_proxies_dark.html @@ -26,29 +26,33 @@ -

Proxies and Their Limits

+

Proxies et leurs limites

Il existe deux catégories générales de mauvais acteurs qui veulent porter atteinte à la vie privée du Web: des gouvernements malveillants ayant accès à des fournisseurs de services Internet (FAI) et des méga entreprises exploitant des réseaux sociaux et publicitaires. - Proxies like TOR (The Onion Router) and I2P (the Invisible Internet Project) are useful in protecting privacy from malicious governments (which spy on traffic in transit) - but not from mega corporations (which embed malicious code on web servers).

+ 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).

Gouvernements Malicieux

Les gouvernements malveillants espionnent souvent leurs citoyens pour punir la dissidence ou les activités liées aux droits de l'homme. Ils exploitent généralement les FAI locaux ou peuvent les obliger à divulguer des informations indiquant chaque adresse IP visitée par chaque utilisateur. - Layered proxies are designed to defeat this infringement of privacy by encrypting the traffic from a user’s device and routing it through multiple servers on the internet - before sending it on to the final destination. - This means that no individual ISP, server, or website, can know both the IP address of the user’s device and the IP address of the final web server. - Malicious governments and the ISPs they control cannot tell which web servers a user is accessing, although they can tell that the user is using a layered proxy service. - In some parts of the world, using proxies could be construed as an evidence of illegal behavior (“If you didn’t have anything to hide you wouldn’t be encrypting your traffic”) - and users could be punished because governments assume they are doing something that is prohibited. Thus, proxies can be helpful, but they aren’t a panacea.

+ Les proxys en couches sont conçus pour vaincre cette atteinte à la vie privée en chiffrant le trafic à partir de l'appareil d'un utilisateur et en le routant via plusieurs serveurs sur Internet + avant de l'envoyer à la destination finale. + Cela signifie qu’aucun FAI, serveur ou site Web individuel ne peut connaître à la fois l’adresse IP de l’appareil de l’utilisateur + et l’adresse IP du serveur Web final. + Les gouvernements malveillants et les FAI qu'ils contrôlent ne peuvent pas savoir à quels serveurs Web un utilisateur accède, + bien qu'ils puissent dire que l'utilisateur utilise un service proxy en couches. + Dans certaines parties du monde, l'utilisation de proxies pourrait être interprétée comme une preuve de comportement illégal («Si vous n'aviez rien à cacher, vous ne crypteriez pas votre trafic») + 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.

Méga entreprises

Lorsqu'un utilisateur se connecte à un serveur Web, celui-ci peut voir l'adresse IP de l'utilisateur. Bien que ce ne soit pas une science parfaite, les adresses IP peuvent être transformées en adresses physiques avec une juste précision. - Small web servers typically rely on IP addresses to identify the location of the users visiting their site. Proxies are a good solution to mask the user’s location from these servers. + Les petits serveurs Web s'appuient généralement sur des adresses IP pour identifier l'emplacement des utilisateurs visitant leur site. + Les proxys sont une bonne solution pour masquer l'emplacement de l'utilisateur à partir de ces serveurs. Mais les grandes méga-entreprises propriétaires de réseaux de médias sociaux et de publicité utilisent tout un profil d'informations conçu pour suivre les utilisateurs sur des appareils et des adresses IP. Ces profils utilisent diverses techniques pour identifier les utilisateurs, notamment JavaScript, les cookies, les identifiants de suivi et les @@ -62,26 +66,28 @@ Ils établissent un profil de l'âge, du sexe, de l'état matrimonial, de l'adresse, des affiliations politiques, des appartenances religieuses, de la situation de famille, du nombre d'animaux de compagnie, et tout ce qu'ils peuvent mettre la main dessus. Ils achètent même des bases de données de transactions par carte de crédit dans les magasins locaux, afin de pouvoir suivre les habitudes d'achat hors ligne des utilisateurs dans leurs profils. - Because they already have much more accurate address information about a user than an IP address discloses, proxies provides no real privacy protection against mega corporations.

+ Parce qu'ils disposent déjà d'informations d'adresses beaucoup plus précises sur un utilisateur qu'une adresse IP ne peut le révéler, + les proxies n'offrent aucune véritable protection de la vie privée contre les grosses corporations.

La meilleure protection contre la confidentialité des grandes entreprises consiste à naviguer sur le Web avec JavaScript désactivé, le suivi du blocage des réseaux publicitaires, la désactivation des cookies et du stockage du DOM et en utilisant un navigateur difficile à identifier.

-

Using Proxies

+

Utiliser des Proxies

-

Despite their limitations, proxies can be useful in some circumstances. - Tor and I2p - have Android apps that make it easy to use their proxy networks. When proxying is turned on in Privacy Browser, the app bar will have a light blue background instead of the default light grey. - Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.

+

Malgré leurs limites, les proxies peuvent être utiles dans certaines circonstances. + Tor et I2p + ont des applications Android qui facilitent l'utilisation de leurs réseaux proxy. + Lorsque le proxy est activé dans Privacy Browser, la barre d'application aura un fond bleu clair au lieu du gris clair par défaut. + É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.

Téléchargement de fichiers via Tor

-

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.

+

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.

diff --git a/app/src/main/assets/fr/guide_proxies_light.html b/app/src/main/assets/fr/guide_proxies_light.html index c2b61176..0ffb12e7 100644 --- a/app/src/main/assets/fr/guide_proxies_light.html +++ b/app/src/main/assets/fr/guide_proxies_light.html @@ -26,29 +26,33 @@ -

Proxies and Their Limits

+

Proxies et leurs limites

Il existe deux catégories générales de mauvais acteurs qui veulent porter atteinte à la vie privée du Web: des gouvernements malveillants ayant accès à des fournisseurs de services Internet (FAI) et des méga entreprises exploitant des réseaux sociaux et publicitaires. - Proxies like TOR (The Onion Router) and I2P (the Invisible Internet Project) are useful in protecting privacy from malicious governments (which spy on traffic in transit) - but not from mega corporations (which embed malicious code on web servers).

+ 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).

Gouvernements Malicieux

Les gouvernements malveillants espionnent souvent leurs citoyens pour punir la dissidence ou les activités liées aux droits de l'homme. Ils exploitent généralement les FAI locaux ou peuvent les obliger à divulguer des informations indiquant chaque adresse IP visitée par chaque utilisateur. - Layered proxies are designed to defeat this infringement of privacy by encrypting the traffic from a user’s device and routing it through multiple servers on the internet - before sending it on to the final destination. - This means that no individual ISP, server, or website, can know both the IP address of the user’s device and the IP address of the final web server. - Malicious governments and the ISPs they control cannot tell which web servers a user is accessing, although they can tell that the user is using a layered proxy service. - In some parts of the world, using proxies could be construed as an evidence of illegal behavior (“If you didn’t have anything to hide you wouldn’t be encrypting your traffic”) - and users could be punished because governments assume they are doing something that is prohibited. Thus, proxies can be helpful, but they aren’t a panacea.

+ Les proxys en couches sont conçus pour vaincre cette atteinte à la vie privée en chiffrant le trafic à partir de l'appareil d'un utilisateur et en le routant via plusieurs serveurs sur Internet + avant de l'envoyer à la destination finale. + Cela signifie qu’aucun FAI, serveur ou site Web individuel ne peut connaître à la fois l’adresse IP de l’appareil de l’utilisateur + et l’adresse IP du serveur Web final. + Les gouvernements malveillants et les FAI qu'ils contrôlent ne peuvent pas savoir à quels serveurs Web un utilisateur accède, + bien qu'ils puissent dire que l'utilisateur utilise un service proxy en couches. + Dans certaines parties du monde, l'utilisation de proxies pourrait être interprétée comme une preuve de comportement illégal («Si vous n'aviez rien à cacher, vous ne crypteriez pas votre trafic») + 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.

Méga entreprises

Lorsqu'un utilisateur se connecte à un serveur Web, celui-ci peut voir l'adresse IP de l'utilisateur. Bien que ce ne soit pas une science parfaite, les adresses IP peuvent être transformées en adresses physiques avec une juste précision. - Small web servers typically rely on IP addresses to identify the location of the users visiting their site. Proxies are a good solution to mask the user’s location from these servers. + Les petits serveurs Web s'appuient généralement sur des adresses IP pour identifier l'emplacement des utilisateurs visitant leur site. + Les proxys sont une bonne solution pour masquer l'emplacement de l'utilisateur à partir de ces serveurs. Mais les grandes méga-entreprises propriétaires de réseaux de médias sociaux et de publicité utilisent tout un profil d'informations conçu pour suivre les utilisateurs sur des appareils et des adresses IP. Ces profils utilisent diverses techniques pour identifier les utilisateurs, notamment JavaScript, les cookies, les identifiants de suivi et les @@ -62,26 +66,28 @@ Ils établissent un profil de l'âge, du sexe, de l'état matrimonial, de l'adresse, des affiliations politiques, des appartenances religieuses, de la situation de famille, du nombre d'animaux de compagnie, et tout ce qu'ils peuvent mettre la main dessus. Ils achètent même des bases de données de transactions par carte de crédit dans les magasins locaux, afin de pouvoir suivre les habitudes d'achat hors ligne des utilisateurs dans leurs profils. - Because they already have much more accurate address information about a user than an IP address discloses, proxies provides no real privacy protection against mega corporations.

+ Parce qu'ils disposent déjà d'informations d'adresses beaucoup plus précises sur un utilisateur qu'une adresse IP ne peut le révéler, + les proxies n'offrent aucune véritable protection de la vie privée contre les grosses corporations.

La meilleure protection contre la confidentialité des grandes entreprises consiste à naviguer sur le Web avec JavaScript désactivé, le suivi du blocage des réseaux publicitaires, la désactivation des cookies et du stockage du DOM et en utilisant un navigateur difficile à identifier.

-

Using Proxies

+

Utiliser des Proxies

-

Despite their limitations, proxies can be useful in some circumstances. - Tor and I2p - have Android apps that make it easy to use their proxy networks. When proxying is turned on in Privacy Browser, the app bar will have a light blue background instead of the default light grey. - Because traffic is being routed through several proxy nodes, using a layered proxy is often much slower than connecting directly to the internet.

+

Malgré leurs limites, les proxies peuvent être utiles dans certaines circonstances. + Tor et I2p + ont des applications Android qui facilitent l'utilisation de leurs réseaux proxy. + Lorsque le proxy est activé dans Privacy Browser, la barre d'application aura un fond bleu clair au lieu du gris clair par défaut. + É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.

Téléchargement de fichiers via Tor

-

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.

+

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.

diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java index bea58d3f..1c328c4d 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java @@ -25,6 +25,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.media.MediaScannerConnection; +import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; @@ -558,7 +559,10 @@ public class ImportExportActivity extends AppCompatActivity implements StoragePe } @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, Intent intent) { + // Run the default commands. + super.onActivityResult(requestCode, resultCode, intent); + switch (requestCode) { case (BROWSE_RESULT_CODE): // Don't do anything if the user pressed back from the file picker. @@ -569,11 +573,17 @@ public class ImportExportActivity extends AppCompatActivity implements StoragePe // Instantiate the file name helper. FileNameHelper fileNameHelper = new FileNameHelper(); - // Convert the file name URI to a file name path. - String fileNamePath = fileNameHelper.convertUriToFileNamePath(data.getData()); + // Get the file path URI from the intent. + Uri filePathUri = intent.getData(); - // Set the file name path as the text of the file name edit text. - fileNameEditText.setText(fileNamePath); + // Use the file path from the intent if it exists. + if (filePathUri != null) { + // Convert the file name URI to a file name path. + String fileNamePath = fileNameHelper.convertUriToFileNamePath(filePathUri); + + // Set the file name path as the text of the file name edit text. + fileNameEditText.setText(fileNamePath); + } } break; diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 32d50e94..568a316f 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -173,7 +173,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook EditBookmarkFolderDialog.EditBookmarkFolderListener, FontSizeDialog.UpdateFontSizeListener, NavigationView.OnNavigationItemSelectedListener, PinnedMismatchDialog.PinnedMismatchListener, PopulateBlocklists.PopulateBlocklistsListener, SaveWebpageImageDialog.SaveWebpageImageListener, StoragePermissionDialog.StoragePermissionDialogListener, UrlHistoryDialog.NavigateHistoryListener, WebViewTabFragment.NewTabListener { - // `orbotStatus` is public static so it can be accessed from `OrbotProxyHelper`. It is also used in `onCreate()`, `onResume()`, and `applyProxyThroughOrbot()`. + // `orbotStatus` is public static so it can be accessed from `OrbotProxyHelper`. It is also used in `onCreate()`, `onResume()`, and `applyProxy()`. public static String orbotStatus = "unknown"; // The WebView pager adapter is accessed from `HttpAuthenticationDialog`, `PinnedMismatchDialog`, and `SslCertificateErrorDialog`. It is also used in `onCreate()`, `onResume()`, and `addTab()`. @@ -4316,12 +4316,12 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook AppBarLayout appBarLayout = findViewById(R.id.appbar_layout); // Set the proxy according to the mode. `this` refers to the current activity where an alert dialog might be displayed. - ProxyHelper.setProxy(getApplicationContext(), proxyMode); + ProxyHelper.setProxy(getApplicationContext(), appBarLayout, proxyMode); // Reset the waiting for proxy tracker. waitingForProxy = false; - // Update the user interface and reload the WebViews is requested. + // Update the user interface and reload the WebViews if requested. switch (proxyMode) { case ProxyHelper.NONE: // Set the default app bar layout background. diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java index 04e0d2d5..16ca2998 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java @@ -86,8 +86,7 @@ public class SettingsFragment extends PreferenceFragmentCompat { Preference searchPreference = findPreference("search"); Preference searchCustomURLPreference = findPreference("search_custom_url"); Preference proxyPreference = findPreference("proxy"); - Preference proxyCustomHostPreference = findPreference("proxy_custom_host"); - Preference proxyCustomPortPreference = findPreference("proxy_custom_port"); + Preference proxyCustomUrlPreference = findPreference("proxy_custom_url"); Preference fullScreenBrowsingModePreference = findPreference("full_screen_browsing_mode"); Preference hideAppBarPreference = findPreference("hide_app_bar"); Preference clearEverythingPreference = findPreference("clear_everything"); @@ -131,8 +130,7 @@ public class SettingsFragment extends PreferenceFragmentCompat { assert searchPreference != null; assert searchCustomURLPreference != null; assert proxyPreference != null; - assert proxyCustomHostPreference != null; - assert proxyCustomPortPreference != null; + assert proxyCustomUrlPreference != null; assert fullScreenBrowsingModePreference != null; assert hideAppBarPreference != null; assert clearEverythingPreference != null; @@ -257,7 +255,11 @@ public class SettingsFragment extends PreferenceFragmentCompat { break; case ProxyHelper.TOR: - proxyPreference.setSummary(getString(R.string.tor_enabled)); + if (Build.VERSION.SDK_INT == 19) { // Proxying through SOCKS doesn't work on Android KitKat. + proxyPreference.setSummary(getString(R.string.tor_enabled_kitkat)); + } else { + proxyPreference.setSummary(getString(R.string.tor_enabled)); + } break; case ProxyHelper.I2P: @@ -269,13 +271,11 @@ public class SettingsFragment extends PreferenceFragmentCompat { break; } - // Only enable the custom proxy options if a custom proxy is selected. - proxyCustomHostPreference.setEnabled(proxyString.equals("Custom")); - proxyCustomPortPreference.setEnabled(proxyString.equals("Custom")); + // Only enable the custom proxy URL if a custom proxy is selected. + proxyCustomUrlPreference.setEnabled(proxyString.equals("Custom")); - // Set the summary text for the custom proxy options. - proxyCustomHostPreference.setSummary(savedPreferences.getString("proxy_custom_host", getString(R.string.proxy_custom_host_default_value))); - proxyCustomPortPreference.setSummary(savedPreferences.getString("proxy_custom_port", getString(R.string.proxy_custom_port_default_value))); + // Set the summary text for the custom proxy URL. + proxyCustomUrlPreference.setSummary(savedPreferences.getString("proxy_custom_url", getString(R.string.proxy_custom_url_default_value))); // Set the status of the Clear and Exit preferences. clearCookiesPreference.setEnabled(!clearEverything); @@ -601,41 +601,35 @@ public class SettingsFragment extends PreferenceFragmentCompat { // Set the main proxy icon to be disabled. proxyPreference.setIcon(R.drawable.proxy_disabled_dark); - // Set the custom proxy icons to be ghosted. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_dark); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_dark); + // Set the custom proxy URL icon to be ghosted. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_dark); } else { // Light theme. // Set the main proxy icon to be disabled. proxyPreference.setIcon(R.drawable.proxy_disabled_light); - // Set the custom proxy icons to be ghosted. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_light); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_light); + // Set the custom proxy URL icon to be ghosted. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_light); } } else { // Proxying is enabled. if (darkTheme) { // Dark theme. // Set the main proxy icon to be enabled. proxyPreference.setIcon(R.drawable.proxy_enabled_dark); - // Set the custom proxy icons according to their status. - if (proxyCustomHostPreference.isEnabled()) { // Custom proxy is enabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_enabled_dark); - proxyCustomPortPreference.setIcon(R.drawable.proxy_enabled_dark); + // Set the custom proxy URL icon according to its status. + if (proxyCustomUrlPreference.isEnabled()) { // Custom proxy is enabled. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_enabled_dark); } else { // Custom proxy is disabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_dark); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_dark); + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_dark); } } else { // Light theme. // Set the main proxy icon to be enabled. proxyPreference.setIcon(R.drawable.proxy_enabled_light); - // Set the custom proxy icons according to their status. - if (proxyCustomHostPreference.isEnabled()) { // Custom proxy is enabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_enabled_light); - proxyCustomPortPreference.setIcon(R.drawable.proxy_enabled_light); + // Set the custom proxy URL icon according to its status. + if (proxyCustomUrlPreference.isEnabled()) { // Custom proxy is enabled. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_enabled_light); } else { // Custom proxy is disabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_light); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_light); + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_light); } } } @@ -1372,7 +1366,11 @@ public class SettingsFragment extends PreferenceFragmentCompat { break; case ProxyHelper.TOR: - proxyPreference.setSummary(getString(R.string.tor_enabled)); + if (Build.VERSION.SDK_INT == 19) { // Proxying through SOCKS doesn't work on Android KitKat. + proxyPreference.setSummary(getString(R.string.tor_enabled_kitkat)); + } else { + proxyPreference.setSummary(getString(R.string.tor_enabled)); + } break; case ProxyHelper.I2P: @@ -1384,9 +1382,8 @@ public class SettingsFragment extends PreferenceFragmentCompat { break; } - // Update the status of the custom proxy options. - proxyCustomHostPreference.setEnabled(currentProxyString.equals("Custom")); - proxyCustomPortPreference.setEnabled(currentProxyString.equals("Custom")); + // Update the status of the custom URL preference. + proxyCustomUrlPreference.setEnabled(currentProxyString.equals("Custom")); // Update the icons. if (currentProxyString.equals("None")) { // Proxying is disabled. @@ -1394,55 +1391,45 @@ public class SettingsFragment extends PreferenceFragmentCompat { // Set the main proxy icon to be disabled proxyPreference.setIcon(R.drawable.proxy_disabled_dark); - // Set the custom proxy icons to be ghosted. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_dark); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_dark); + // Set the custom proxy URL icon to be ghosted. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_dark); } else { // Light theme. // Set the main proxy icon to be disabled. proxyPreference.setIcon(R.drawable.proxy_disabled_light); - // Set the custom proxy icons to be ghosted. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_light); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_light); + // Set the custom proxy URL icon to be ghosted. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_light); } } else { // Proxying is enabled. if (darkTheme) { // Dark theme. // Set the main proxy icon to be enabled. proxyPreference.setIcon(R.drawable.proxy_enabled_dark); - /// Set the custom proxy icons according to their status. - if (proxyCustomHostPreference.isEnabled()) { // Custom proxy is enabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_enabled_dark); - proxyCustomPortPreference.setIcon(R.drawable.proxy_enabled_dark); + /// Set the custom proxy URL icon according to its status. + if (proxyCustomUrlPreference.isEnabled()) { // Custom proxy is enabled. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_enabled_dark); } else { // Custom proxy is disabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_dark); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_dark); + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_dark); } } else { // Light theme. // Set the main proxy icon to be enabled. proxyPreference.setIcon(R.drawable.proxy_enabled_light); - // Set the custom proxy icons according to their status. - if (proxyCustomHostPreference.isEnabled()) { // Custom proxy is enabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_enabled_light); - proxyCustomPortPreference.setIcon(R.drawable.proxy_enabled_light); + // Set the custom proxy URL icon according to its status. + if (proxyCustomUrlPreference.isEnabled()) { // Custom proxy is enabled. + proxyCustomUrlPreference.setIcon(R.drawable.proxy_enabled_light); } else { // Custom proxy is disabled. - proxyCustomHostPreference.setIcon(R.drawable.proxy_ghosted_light); - proxyCustomPortPreference.setIcon(R.drawable.proxy_ghosted_light); + proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_light); } } } break; - case "proxy_custom_host": - // Set the summary text for the proxy custom host. - proxyCustomHostPreference.setSummary(sharedPreferences.getString("proxy_custom_host", getString(R.string.proxy_custom_host_default_value))); + case "proxy_custom_url": + // Set the summary text for the proxy custom URL. + proxyCustomUrlPreference.setSummary(sharedPreferences.getString("proxy_custom_url", getString(R.string.proxy_custom_url_default_value))); break; - case "proxy_custom_port": - // Set the summary text for the proxy custom port. - proxyCustomPortPreference.setSummary(sharedPreferences.getString("proxy_custom_port", getString(R.string.proxy_custom_port_default_value))); - case "full_screen_browsing_mode": if (sharedPreferences.getBoolean("full_screen_browsing_mode", false)) { // Full screen browsing is enabled. // Set the full screen browsing mode preference icon according to the theme. diff --git a/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java b/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java index 3aa0ba0f..f504329b 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java @@ -23,6 +23,7 @@ import android.content.ContentValues; import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; +import android.database.DatabaseUtils; import android.database.sqlite.SQLiteDatabase; import android.preference.PreferenceManager; @@ -66,8 +67,7 @@ public class ImportExportDatabaseHelper { private static final String SEARCH = "search"; private static final String SEARCH_CUSTOM_URL = "search_custom_url"; private static final String PROXY = "proxy"; - private static final String PROXY_CUSTOM_HOST = "proxy_custom_host"; - private static final String PROXY_CUSTOM_PORT = "proxy_custom_port"; + private static final String PROXY_CUSTOM_URL = "proxy_custom_url"; private static final String FULL_SCREEN_BROWSING_MODE = "full_screen_browsing_mode"; private static final String HIDE_APP_BAR = "hide_app_bar"; private static final String CLEAR_EVERYTHING = "clear_everything"; @@ -221,8 +221,7 @@ public class ImportExportDatabaseHelper { SEARCH + " TEXT, " + SEARCH_CUSTOM_URL + " TEXT, " + PROXY + " TEXT, " + - PROXY_CUSTOM_HOST + " TEXT, " + - PROXY_CUSTOM_PORT + " TEXT, " + + PROXY_CUSTOM_URL + " TEXT, " + FULL_SCREEN_BROWSING_MODE + " BOOLEAN, " + HIDE_APP_BAR + " BOOLEAN, " + CLEAR_EVERYTHING + " BOOLEAN, " + @@ -273,8 +272,7 @@ public class ImportExportDatabaseHelper { preferencesContentValues.put(SEARCH, sharedPreferences.getString(SEARCH, context.getString(R.string.search_default_value))); preferencesContentValues.put(SEARCH_CUSTOM_URL, sharedPreferences.getString(SEARCH_CUSTOM_URL, context.getString(R.string.search_custom_url_default_value))); preferencesContentValues.put(PROXY, sharedPreferences.getString(PROXY, context.getString(R.string.proxy_default_value))); - preferencesContentValues.put(PROXY_CUSTOM_HOST, sharedPreferences.getString(PROXY_CUSTOM_HOST, context.getString(R.string.proxy_custom_host_default_value))); - preferencesContentValues.put(PROXY_CUSTOM_PORT, sharedPreferences.getString(PROXY_CUSTOM_PORT, context.getString(R.string.proxy_custom_port_default_value))); + preferencesContentValues.put(PROXY_CUSTOM_URL, sharedPreferences.getString(PROXY_CUSTOM_URL, context.getString(R.string.proxy_custom_url_default_value))); preferencesContentValues.put(FULL_SCREEN_BROWSING_MODE, sharedPreferences.getBoolean(FULL_SCREEN_BROWSING_MODE, false)); preferencesContentValues.put(HIDE_APP_BAR, sharedPreferences.getBoolean(HIDE_APP_BAR, true)); preferencesContentValues.put(CLEAR_EVERYTHING, sharedPreferences.getBoolean(CLEAR_EVERYTHING, true)); @@ -399,6 +397,9 @@ public class ImportExportDatabaseHelper { // Get the current value in `default_font_size`. String fontSize = importDatabasePreferenceCursor.getString(importDatabasePreferenceCursor.getColumnIndex("default_font_size")); + // SQL escape the font size. + fontSize = DatabaseUtils.sqlEscapeString(fontSize); + // Close the cursor. importDatabasePreferenceCursor.close(); @@ -521,18 +522,18 @@ public class ImportExportDatabaseHelper { case 8: // Add the new proxy columns to the preferences table. importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + PROXY + " TEXT"); - importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + PROXY_CUSTOM_HOST + " TEXT"); - importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + PROXY_CUSTOM_PORT + " TEXT"); + importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + PROXY_CUSTOM_URL + " TEXT"); // Get the current proxy values. String proxy = sharedPreferences.getString(PROXY, context.getString(R.string.proxy_default_value)); - String proxyCustomHost = sharedPreferences.getString(PROXY_CUSTOM_HOST, context.getString(R.string.proxy_custom_host_default_value)); - String proxyCustomPort = sharedPreferences.getString(PROXY_CUSTOM_PORT, context.getString(R.string.proxy_custom_port_default_value)); + String proxyCustomUrl = sharedPreferences.getString(PROXY_CUSTOM_URL, context.getString(R.string.proxy_custom_url_default_value)); + + // SQL escape the proxy custom URL string. + proxyCustomUrl = DatabaseUtils.sqlEscapeString(proxyCustomUrl); // Populate the table with the current proxy values. importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + PROXY + " = '" + proxy + "'"); - importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + PROXY_CUSTOM_HOST + " = '" + proxyCustomHost + "'"); - importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + PROXY_CUSTOM_PORT + " = '" + proxyCustomPort +"'"); + importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + PROXY_CUSTOM_URL + " = '" + proxyCustomUrl + "'"); } } @@ -671,8 +672,7 @@ public class ImportExportDatabaseHelper { .putString(SEARCH, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(SEARCH))) .putString(SEARCH_CUSTOM_URL, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(SEARCH_CUSTOM_URL))) .putString(PROXY, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(PROXY))) - .putString(PROXY_CUSTOM_HOST, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(PROXY_CUSTOM_HOST))) - .putString(PROXY_CUSTOM_PORT, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(PROXY_CUSTOM_PORT))) + .putString(PROXY_CUSTOM_URL, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(PROXY_CUSTOM_URL))) .putBoolean(FULL_SCREEN_BROWSING_MODE, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FULL_SCREEN_BROWSING_MODE)) == 1) .putBoolean(HIDE_APP_BAR, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(HIDE_APP_BAR)) == 1) .putBoolean(CLEAR_EVERYTHING, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(CLEAR_EVERYTHING)) == 1) diff --git a/app/src/main/java/com/stoutner/privacybrowser/helpers/ProxyHelper.java b/app/src/main/java/com/stoutner/privacybrowser/helpers/ProxyHelper.java index a6662086..dce61690 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/ProxyHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/ProxyHelper.java @@ -22,17 +22,29 @@ package com.stoutner.privacybrowser.helpers; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.net.Proxy; +import android.net.Uri; import android.os.Build; import android.os.Parcelable; import android.util.ArrayMap; import android.util.Log; +import android.view.View; +import androidx.preference.PreferenceManager; +import androidx.webkit.ProxyConfig; +import androidx.webkit.ProxyController; +import androidx.webkit.WebViewFeature; + +import com.google.android.material.snackbar.Snackbar; + +import com.stoutner.privacybrowser.R; import com.stoutner.privacybrowser.activities.MainWebViewActivity; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.concurrent.Executor; public class ProxyHelper { public static final String NONE = "None"; @@ -40,13 +52,16 @@ public class ProxyHelper { public static final String I2P = "I2P"; public static final String CUSTOM = "Custom"; - public static void setProxy(Context context, String mode) { + public static void setProxy(Context context, View activityView, String proxyMode) { // Initialize the proxy host and port strings. String proxyHost = "0"; String proxyPort = "0"; + // Create a proxy config builder. + ProxyConfig.Builder proxyConfigBuilder = new ProxyConfig.Builder(); + // Run the commands that correlate to the proxy mode. - switch (mode) { + switch (proxyMode) { case NONE: // Clear the proxy values. System.clearProperty("proxyHost"); @@ -54,17 +69,20 @@ public class ProxyHelper { break; case TOR: - // Update the proxy host and port strings. + // Update the proxy host and port strings. These can be removed once the minimum API >= 21. proxyHost = "localhost"; proxyPort = "8118"; - // Set the proxy values + // Set the proxy values. These can be removed once the minimum API >= 21. System.setProperty("proxyHost", proxyHost); System.setProperty("proxyPort", proxyPort); + // Add the proxy to the builder. The proxy config builder can use a SOCKS proxy. + proxyConfigBuilder.addProxyRule("socks://localhost:9050"); + // Ask Orbot to connect if its current status is not `"ON"`. if (!MainWebViewActivity.orbotStatus.equals("ON")) { - // Request Orbot to start. + // Create an intent to request Orbot to start. Intent orbotIntent = new Intent("org.torproject.android.intent.action.START"); // Send the intent to the Orbot package. @@ -79,85 +97,146 @@ public class ProxyHelper { break; case I2P: - // Update the proxy host and port strings. + // Update the proxy host and port strings. These can be removed once the minimum API >= 21. proxyHost = "localhost"; proxyPort = "4444"; - // Set the proxy values + // Set the proxy values. These can be removed once the minimum API >= 21. System.setProperty("proxyHost", proxyHost); System.setProperty("proxyPort", proxyPort); + + // Add the proxy to the builder. + proxyConfigBuilder.addProxyRule("http://localhost:4444"); break; case CUSTOM: - // Update the proxy host and port strings. - proxyHost = "0"; - proxyPort = "0"; - - // Set the proxy values - System.setProperty("proxyHost", proxyHost); - System.setProperty("proxyPort", proxyPort); + // Get a handle for the shared preferences. + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); + + // Get the custom proxy URL string. + String customProxyUrlString = sharedPreferences.getString("proxy_custom_url", context.getString(R.string.proxy_custom_url_default_value)); + + // Parse the custom proxy URL. + try { + // Convert the custom proxy URL string to a URI. + Uri customProxyUri = Uri.parse(customProxyUrlString); + + // Get the proxy host and port strings from the shared preferences. These can be removed once the minimum API >= 21. + proxyHost = customProxyUri.getHost(); + proxyPort = String.valueOf(customProxyUri.getPort()); + + // Set the proxy values. These can be removed once the minimum API >= 21. + System.setProperty("proxyHost", proxyHost); + System.setProperty("proxyPort", proxyPort); + + // Add the proxy to the builder. + proxyConfigBuilder.addProxyRule(customProxyUrlString); + } catch (Exception exception){ // The custom proxy URL is invalid. + // Display a Snackbar. + Snackbar.make(activityView, R.string.custom_proxy_invalid, Snackbar.LENGTH_LONG).show(); + } break; } - // Use reflection to apply the new proxy values. - try { - // Get the application and APK classes. Suppress the lint warning that reflection may not always work in the future and on all devices. - Class applicationClass = Class.forName("android.app.Application"); - @SuppressLint("PrivateApi") Class loadedApkClass = Class.forName("android.app.LoadedApk"); - - // Get the declared fields. Suppress the lint warning that `mLoadedApk` cannot be resolved. - @SuppressWarnings("JavaReflectionMemberAccess") Field methodLoadedApkField = applicationClass.getDeclaredField("mLoadedApk"); - Field methodReceiversField = loadedApkClass.getDeclaredField("mReceivers"); - - // Allow the values to be changed. - methodLoadedApkField.setAccessible(true); - methodReceiversField.setAccessible(true); - - // Get the APK object. - Object methodLoadedApkObject = methodLoadedApkField.get(context); - - // Get an array map of the receivers. - ArrayMap receivers = (ArrayMap) methodReceiversField.get(methodLoadedApkObject); - - // Set the proxy if the receivers has at least one entry. - if (receivers != null) { - for (Object receiverMap : receivers.values()) { - for (Object receiver : ((ArrayMap) receiverMap).keySet()) { - // Get the receiver class. - // `Class`, which is an `unbounded wildcard parameterized type`, must be used instead of `Class`, which is a `raw type`. Otherwise, `receiveClass.getDeclaredMethod()` is unhappy. - Class receiverClass = receiver.getClass(); - - // Apply the new proxy settings to any classes whose names contain `ProxyChangeListener`. - if (receiverClass.getName().contains("ProxyChangeListener")) { - // Get the `onReceive` method from the class. - Method onReceiveMethod = receiverClass.getDeclaredMethod("onReceive", Context.class, Intent.class); - - // Create a proxy change intent. - Intent proxyChangeIntent = new Intent(Proxy.PROXY_CHANGE_ACTION); - - if (Build.VERSION.SDK_INT >= 21) { - // Get a proxy info class. - // `Class`, which is an `unbounded wildcard parameterized type`, must be used instead of `Class`, which is a `raw type`. Otherwise, `proxyInfoClass.getMethod()` is unhappy. - Class proxyInfoClass = Class.forName("android.net.ProxyInfo"); - - // Get the build direct proxy method from the proxy info class. - Method buildDirectProxyMethod = proxyInfoClass.getMethod("buildDirectProxy", String.class, Integer.TYPE); - - // Populate a proxy info object with the new proxy information. - Object proxyInfoObject = buildDirectProxyMethod.invoke(proxyInfoClass, proxyHost, Integer.valueOf(proxyPort)); - - // Add the proxy info object into the proxy change intent. - proxyChangeIntent.putExtra("proxy", (Parcelable) proxyInfoObject); + // Apply the proxy settings + if (WebViewFeature.isFeatureSupported(WebViewFeature.PROXY_OVERRIDE)) { // The fancy new proxy config can be used because the API >= 21. + // Convert the proxy config builder into a proxy config. + ProxyConfig proxyConfig = proxyConfigBuilder.build(); + + // Get the proxy controller. + ProxyController proxyController = ProxyController.getInstance(); + + // Applying a proxy requires an executor. + Executor executor = runnable -> { + // Do nothing. + }; + + // Applying a proxy requires a runnable. + Runnable runnable = () -> { + // Do nothing. + }; + + // Apply the proxy settings. + if (proxyMode.equals(NONE)) { // Remove the proxy. + proxyController.clearProxyOverride(executor, runnable); + } else { // Apply the proxy. + try { + // Apply the proxy. + proxyController.setProxyOverride(proxyConfig, executor, runnable); + } catch (IllegalArgumentException exception) { // The proxy config is invalid. + // Display a Snackbar. + Snackbar.make(activityView, R.string.custom_proxy_invalid, Snackbar.LENGTH_LONG).show(); + } + } + } else { // The old proxy method must be used, either because an old WebView is installed or because the API == 19; + // Get a handle for the shared preferences. + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); + + // Check to make sure a SOCKS proxy is not selected. + if (proxyMode.equals(CUSTOM) && sharedPreferences.getString("proxy_custom_url", context.getString(R.string.proxy_custom_url_default_value)).startsWith("socks://")) { + // Display a Snackbar. + Snackbar.make(activityView, R.string.socks_proxies_do_not_work_on_kitkat, Snackbar.LENGTH_LONG).show(); + } else { // Use reflection to apply the new proxy values. + try { + // Get the application and APK classes. Suppress the lint warning that reflection may not always work in the future and on all devices. + Class applicationClass = Class.forName("android.app.Application"); + @SuppressLint("PrivateApi") Class loadedApkClass = Class.forName("android.app.LoadedApk"); + + // Get the declared fields. Suppress the lint warning that `mLoadedApk` cannot be resolved. + @SuppressWarnings("JavaReflectionMemberAccess") Field methodLoadedApkField = applicationClass.getDeclaredField("mLoadedApk"); + Field methodReceiversField = loadedApkClass.getDeclaredField("mReceivers"); + + // Allow the values to be changed. + methodLoadedApkField.setAccessible(true); + methodReceiversField.setAccessible(true); + + // Get the APK object. + Object methodLoadedApkObject = methodLoadedApkField.get(context); + + // Get an array map of the receivers. + ArrayMap receivers = (ArrayMap) methodReceiversField.get(methodLoadedApkObject); + + // Set the proxy if the receivers has at least one entry. + if (receivers != null) { + for (Object receiverMap : receivers.values()) { + for (Object receiver : ((ArrayMap) receiverMap).keySet()) { + // Get the receiver class. + // `Class`, which is an `unbounded wildcard parameterized type`, must be used instead of `Class`, which is a `raw type`. Otherwise, `receiveClass.getDeclaredMethod()` is unhappy. + Class receiverClass = receiver.getClass(); + + // Apply the new proxy settings to any classes whose names contain `ProxyChangeListener`. + if (receiverClass.getName().contains("ProxyChangeListener")) { + // Get the `onReceive` method from the class. + Method onReceiveMethod = receiverClass.getDeclaredMethod("onReceive", Context.class, Intent.class); + + // Create a proxy change intent. + Intent proxyChangeIntent = new Intent(Proxy.PROXY_CHANGE_ACTION); + + if (Build.VERSION.SDK_INT >= 21) { + // Get a proxy info class. + // `Class`, which is an `unbounded wildcard parameterized type`, must be used instead of `Class`, which is a `raw type`. Otherwise, `proxyInfoClass.getMethod()` is unhappy. + Class proxyInfoClass = Class.forName("android.net.ProxyInfo"); + + // Get the build direct proxy method from the proxy info class. + Method buildDirectProxyMethod = proxyInfoClass.getMethod("buildDirectProxy", String.class, Integer.TYPE); + + // Populate a proxy info object with the new proxy information. + Object proxyInfoObject = buildDirectProxyMethod.invoke(proxyInfoClass, proxyHost, Integer.valueOf(proxyPort)); + + // Add the proxy info object into the proxy change intent. + proxyChangeIntent.putExtra("proxy", (Parcelable) proxyInfoObject); + } + + // Pass the proxy change intent to the `onReceive` method of the receiver class. + onReceiveMethod.invoke(receiver, context, proxyChangeIntent); + } } - - // Pass the proxy change intent to the `onReceive` method of the receiver class. - onReceiveMethod.invoke(receiver, context, proxyChangeIntent); } } + } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException exception) { + Log.d("enableProxyThroughOrbot", "Exception: " + exception); } } - } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException exception) { - Log.d("enableProxyThroughOrbot", "Exception: " + exception); } } } \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index b1d58f21..8c92e528 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -83,7 +83,8 @@ SSL-Zertifikat ansehen Unverschlüsselte Website - Communication with this website is not encrypted. This allows third parties to intercept information, track your browsing, and inject malicious content. + Die Kommunikation mit dieser Website erfolgt nicht verschlüsselt. + Dies ermöglicht Dritten, Informationen abzuhören, Ihre Bewegungen im Internet zu beobachten und böswillige Inhalte einzuschleusen. SSL-Zertifikat Schließen Domain @@ -389,6 +390,7 @@ Übersicht Lokale Speicherung SSL-Zertifikate + Proxies Verolgungs-IDs @@ -396,8 +398,12 @@ Privacy Browser benötigt die Berechtigung zur Speicherung im öffentlichen Download-Ordner. Anderenfalls wird der Download-Ordner der App verwendet. OK - - Warte, bis sich Orbot verbindet. + + Orbot ist nicht installiert + Der Orbot-Proxy kann erst nach Installation der Orbot-App genutzt werden. + I2P ist nicht installiert + Der I2P-Proxy kann erst nach Installation der I2P-App genutzt werden. + Warte auf die Verbindung zum Orbot-Proxy. Über Privacy Browser @@ -418,6 +424,7 @@ WebView-Anbieter: WebView-Version: Orbot: + I2P: OpenKeychain: EasyList: EasyPrivacy: @@ -530,6 +537,18 @@ Suchmaschinen-URL Eigene URL + Proxy + Keiner + Tor + I2P + Benutzerdefiniert + + Keiner + Tor + I2P + Benutzerdefiniert + + Benutzerdefinierter Proxy Vollbild-Modus Vollbild-Browser-Modus Doppel-Tippen, um zwischen normalem und Vollbild-Modus umzuschalten. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 71be98a5..ff1803e8 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -388,6 +388,7 @@ Visión general Almacenamiento local Certificados SSL + Proxis Rastreo de IDs @@ -396,8 +397,12 @@ Si se deniega, se utilizará el directorio de descarga de la aplicación. OK - - Esperando a Orbot para conectar. + + Orbot No Instalado + El proxy a través de Orbot no funcionará a menos que la aplicación Orbot esté instalada. + I2P No Instalado + El proxy a través de I2P no funcionará a menos que la aplicación I2P esté instalada. + Esperando a que Orbot se conecte. Acerca de Navegador Privado @@ -418,6 +423,7 @@ Proveedor de WebView: Versión de WebView: Orbot: + I2P: OpenKeychain: EasyList: EasyPrivacy: @@ -529,6 +535,18 @@ URL personalizado de búsqueda URL personalizado + Proxy + Ninguno + Tor + I2P + Personalizado + + Ninguno + Tor + I2P + Personalizado + + Proxy personalizado Pantalla completa Navegación de pantalla completa Doble toque para alternar a modo de navegación de pantalla completa. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index b875be3b..2a6668ea 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -388,6 +388,7 @@ Présentation Stockage local Certificats SSL + Proxies ID de suivi @@ -396,8 +397,12 @@ Si cela est refusé, les dossiers internes à l\'application peut néanmoins être utilisé. OK - - En attente de connection d\'Orbot. + + Orbot non installé + Le proxy via Orbot ne fonctionnera que si l\'application Orbot est installée. + I2P non installé + Le proxy via I2P ne fonctionnera que si l\'application I2P est installée. + En attente de la connexion d\'Orbot. À propos @@ -418,6 +423,7 @@ Fournisseur WebView : Version WebView : Orbot : + I2P : OpenKeychain : EasyList : EasyPrivacy : @@ -529,6 +535,18 @@ URL de recherche personnalisée URL personnalisée + Proxy + Aucun + Tor + I2P + Personnalisé + + Aucun + Tor + I2P + Personnalisé + + Proxy personnalisé Plein écran Navigation plein écran Appuyez deux fois pour basculer en mode de navigation en plein écran. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 3d9066a8..83fdac30 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -382,6 +382,7 @@ Обзор Локальное хранилище Сертификаты SSL + Прокси Идентификаторы отслеживания @@ -390,8 +391,12 @@ Если разрешение получено не будет, то для загрузок будет использоваться папка приложения OK - - Ожидание Orbot для подключения. + + Orbot не установлен + Прокси через Orbot работать не будет, если приложение Orbot не установлено. + I2P не установлен + Прокси через I2P работать не будет, если приложение I2P не установлено. + Ожидание подключения Orbot. О Privacy Browser @@ -412,6 +417,7 @@ Провайдер WebView: Версия WebView: Orbot: + I2P: OpenKeychain: EasyList: EasyPrivacy: @@ -523,6 +529,18 @@ Настраиваемый URL поиска Настраиваемый URL + Прокси + Нет + Tor + I2P + Пользовательский + + Нет + Tor + I2P + Пользовательский + + Пользовательский прокси Во весь экран Полноэкранный режим просмотра Двойное касание переключает режим просмотра. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5428730c..5e8575cf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -390,6 +390,7 @@ Overview Local Storage SSL Certificates + Proxies Tracking IDs @@ -400,12 +401,13 @@ Proxy not installed dialog Waiting for proxy dialog - Proxies Orbot Not Installed Proxying through Orbot will not work unless the Orbot app is installed. I2P Not Installed - Proxying through I2P will not work unless the I2P app is installed + Proxying through I2P will not work unless the I2P app is installed. Waiting for Orbot to connect. + The custom proxy URL is invalid. + SOCKS proxies do not work on Android KitKat. About Privacy Browser @@ -599,12 +601,12 @@ I2P Custom - No proxy enabled. Connect directly to the internet. - Tor - proxy through localhost on port 8118. - I2P - proxy through localhost on port 4444. + None - connect directly to the internet. + Tor - connect through socks://localhost:9050. + Tor - connect through http://localhost:8118 + I2P - connect through http://localhost:4444. Custom proxy - Proxy custom host - Proxy custom port + Proxy custom URL Full Screen Full screen browsing mode Double-tap to toggle full screen browsing mode. @@ -649,8 +651,7 @@ https://www.startpage.com/do/search?query= None - - + http://localhost:8118 https://www.startpage.com/ 100 diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 9b7d8135..3bae796f 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -189,17 +189,10 @@ android:defaultValue="@string/proxy_default_value" /> - - -