From 5c9367467e671483924626fa69eb8a4e61d24352 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Thu, 3 Jun 2021 19:57:25 -0700 Subject: [PATCH] Fix a crash in View Source when using a proxy. https://redmine.stoutner.com/issues/725 --- .../com/stoutner/privacybrowser/helpers/ProxyHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 f30d71a8..04e40e9b 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/ProxyHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/ProxyHelper.java @@ -250,13 +250,13 @@ public class ProxyHelper { case (ProxyHelper.TOR): if (Build.VERSION.SDK_INT >= 21) { // Use localhost port 9050 as the socket address. - SocketAddress torSocketAddress = new InetSocketAddress("localhost", 9050); + SocketAddress torSocketAddress = InetSocketAddress.createUnresolved("localhost", 9050); // Create a SOCKS proxy. proxy = new Proxy(Proxy.Type.SOCKS, torSocketAddress); } else { // Use localhost port 8118 as the socket address. - SocketAddress oldTorSocketAddress = new InetSocketAddress("localhost", 8118); + SocketAddress oldTorSocketAddress = InetSocketAddress.createUnresolved("localhost", 8118); // Create an HTTP proxy. proxy = new Proxy(Proxy.Type.HTTP, oldTorSocketAddress); @@ -265,7 +265,7 @@ public class ProxyHelper { case (ProxyHelper.I2P): // Use localhost port 4444 as the socket address. - SocketAddress i2pSocketAddress = new InetSocketAddress("localhost", 4444); + SocketAddress i2pSocketAddress = InetSocketAddress.createUnresolved("localhost", 4444); // Create an HTTP proxy. proxy = new Proxy(Proxy.Type.HTTP, i2pSocketAddress); @@ -284,7 +284,7 @@ public class ProxyHelper { Uri customProxyUri = Uri.parse(customProxyUrlString); // Get the custom socket address. - SocketAddress customSocketAddress = new InetSocketAddress(customProxyUri.getHost(), customProxyUri.getPort()); + SocketAddress customSocketAddress = InetSocketAddress.createUnresolved(customProxyUri.getHost(), customProxyUri.getPort()); // Get the custom proxy scheme. String customProxyScheme = customProxyUri.getScheme(); -- 2.45.2