[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] clean-up logic for setting PT bridge lines



commit b2fb0e74e6a881eaf87cab61f49e7d8d293b1342
Author: n8fr8 <nathan@xxxxxxxxxxxxxxxxxxxx>
Date:   Fri Dec 11 17:48:34 2020 -0500

    clean-up logic for setting PT bridge lines
---
 .../torproject/android/service/OrbotService.java   | 29 +++++++++++-----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java b/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
index b1b64aeb..d03fd989 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
@@ -342,6 +342,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
     }
 
     private void startSnowflakeProxy () {
+        //this is using the current, default Tor snowflake infrastructure
         IPtProxy.startSnowflake( "stun:stun.l.google.com:19302", "https://snowflake-broker.azureedge.net/";,
                 "ajax.aspnetcdn.com", null, true, false, true, 3);
     }
@@ -1414,17 +1415,15 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
             //    extraLines.append("UpdateBridgesFromAuthority 1").append('\n');
 
             String bridgeList = Prefs.getBridgesList();
-            boolean obfs3Bridges = bridgeList.contains("obfs3");
-            boolean obfs4Bridges = bridgeList.contains("obfs4");
+            boolean obfsBridges = bridgeList.contains("obfs");
             boolean meekBridges = bridgeList.contains("meek");
             boolean snowflakeBridges = bridgeList.contains("snowflake");
 
             //check if any PT bridges are needed
-            if (obfs3Bridges)
+            if (obfsBridges) {
                 extraLines.append("ClientTransportPlugin obfs3 socks5 127.0.0.1:" + IPtProxy.Obfs3SocksPort).append('\n');
-
-            if (obfs4Bridges)
                 extraLines.append("ClientTransportPlugin obfs4 socks5 127.0.0.1:" + IPtProxy.Obfs4SocksPort).append('\n');
+            }
 
             if (meekBridges)
                 extraLines.append("ClientTransportPlugin meek_lite socks5 127.0.0.1:" + IPtProxy.MeekSocksPort).append('\n');
@@ -1432,16 +1431,8 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
             if (snowflakeBridges)
                 extraLines.append("ClientTransportPlugin snowflake socks5 127.0.0.1:" + IPtProxy.SnowflakeSocksPort).append('\n');
 
-            if (bridgeList != null && bridgeList.length() > 10) //longer then 1 = some real values here
+            if (obfsBridges||meekBridges||snowflakeBridges)
             {
-                String[] bridgeListLines = parseBridgesFromSettings(bridgeList);
-                int bridgeIdx = (int) Math.floor(Math.random() * ((double) bridgeListLines.length));
-                String bridgeLine = bridgeListLines[bridgeIdx];
-                extraLines.append("Bridge ");
-                extraLines.append(bridgeLine);
-                extraLines.append("\n");
-               
-            } else {
 
                 String type = "obfs4";
 
@@ -1453,6 +1444,16 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
                 getBridges(type, extraLines);
 
             }
+            else
+            {
+                String[] bridgeListLines = parseBridgesFromSettings(bridgeList);
+                int bridgeIdx = (int) Math.floor(Math.random() * ((double) bridgeListLines.length));
+                String bridgeLine = bridgeListLines[bridgeIdx];
+                extraLines.append("Bridge ");
+                extraLines.append(bridgeLine);
+                extraLines.append("\n");
+
+            }
 
         }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits