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

[tor-commits] [orbot/master] Merge branch 'master' of github.com:guardianproject/orbot



commit 9be60c28b603cf9d5138307377aa6dc0e3985483
Merge: 47b7b805 626a341d
Author: n8fr8 <nathan@xxxxxxxxxxxxxxxxxxxx>
Date:   Mon Dec 14 13:46:53 2020 -0500

    Merge branch 'master' of github.com:guardianproject/orbot

 .../torproject/android/service/OrbotService.java   | 45 +++++++++++-----------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --cc orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
index 227f503e,10f4a686..6274b18b
--- a/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
@@@ -297,54 -297,35 +297,53 @@@ public class OrbotService extends VpnSe
          super.onDestroy();
      }
  
-     private void stopTor() {
-         new Thread(this::stopTorAsync).start();
-     }
- 
      private void stopTorAsync() {
-         Log.i("OrbotService", "stopTor");
 +        try {
-             sendCallbackStatus(STATUS_STOPPING);
-             sendCallbackLogMessage(getString(R.string.status_shutting_down));
 +
-             if (useIPtObfsMeekProxy())
-                 IPtProxy.stopObfs4Proxy();
+         new Thread(() ->{
+             Log.i("OrbotService", "stopTor");
+             try {
+                 sendCallbackStatus(STATUS_STOPPING);
+                 sendCallbackLogMessage(getString(R.string.status_shutting_down));
  
-             if (useIPtSnowflakeProxy())
-                IPtProxy.stopSnowflake();
 -                if (useIPtProxy())
 -                    IPtProxy.stopObfs4Proxy();
++            	if (useIPtObfsMeekProxy())
++               	 IPtProxy.stopObfs4Proxy();
 +
-             stopTorDaemon(true);
++            	if (useIPtSnowflakeProxy())
++                IPtProxy.stopSnowflake();
 +
-             //stop the foreground priority and make sure to remove the persistant notification
-             stopForeground(true);
  
-             sendCallbackLogMessage(getString(R.string.status_disabled));
-         } catch (Exception e) {
-             logNotice("An error occured stopping Tor: " + e.getMessage());
-             sendCallbackLogMessage(getString(R.string.something_bad_happened));
-         }
-         clearNotifications();
-         sendCallbackStatus(STATUS_OFF);
+                 stopTorDaemon(true);
  
+                 //stop the foreground priority and make sure to remove the persistant notification
+                 stopForeground(true);
  
+                 sendCallbackLogMessage(getString(R.string.status_disabled));
+             } catch (Exception e) {
+                 logNotice("An error occured stopping Tor: " + e.getMessage());
+                 sendCallbackLogMessage(getString(R.string.something_bad_happened));
+             }
+             clearNotifications();
+             sendCallbackStatus(STATUS_OFF);
+         }).start();
      }
  
 -    private static boolean useIPtProxy ()
 +    private static boolean useIPtObfsMeekProxy ()
 +    {
 +        String bridgeList = Prefs.getBridgesList();
 +        return bridgeList.contains("obfs")||bridgeList.contains("meek");
 +    }
 +
 +    private static boolean useIPtSnowflakeProxy ()
      {
          String bridgeList = Prefs.getBridgesList();
 -        return bridgeList.contains("obfs3")|| bridgeList.contains("obfs4")||bridgeList.contains("meek");
 +        return bridgeList.contains("snowflake");
 +    }
 +
 +    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);
      }
  
      /**



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