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

[tor-commits] [orbot/master] improved root detect and binary installation



commit f14ca9a2d98dce14022b0c92ab428165f07b38d1
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date:   Fri Jan 13 19:19:04 2012 -0500

    improved root detect and binary installation
---
 src/org/torproject/android/Orbot.java              |    2 +-
 .../android/service/TorBinaryInstaller.java        |    3 --
 src/org/torproject/android/service/TorService.java |   34 ++++++++++++-------
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java
index 5452a5a..c2a7408 100644
--- a/src/org/torproject/android/Orbot.java
+++ b/src/org/torproject/android/Orbot.java
@@ -72,7 +72,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
       //if Tor binary is not running, then start the service up
       //might want to look at whether we need to call this every time
       //or whether binding to the service is enough
-                startService(new Intent(INTENT_TOR_SERVICE));
+            startService(new Intent(INTENT_TOR_SERVICE));
                 
             //something to play with on the UI branch
             setTheme(android.R.style.Theme_Black_NoTitleBar);
diff --git a/src/org/torproject/android/service/TorBinaryInstaller.java b/src/org/torproject/android/service/TorBinaryInstaller.java
index 93325db..9a56004 100644
--- a/src/org/torproject/android/service/TorBinaryInstaller.java
+++ b/src/org/torproject/android/service/TorBinaryInstaller.java
@@ -249,9 +249,6 @@ public class TorBinaryInstaller implements TorServiceConstants {
 		}
 		*/
 		
-		if (changed) {
-				Toast.makeText(ctx, R.string.status_install_success, Toast.LENGTH_LONG).show();
-			}
 		
 		return true;
 	}
diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java
index 50ddb01..2d1698a 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -206,23 +206,32 @@ public class TorService extends Service implements TorServiceConstants, TorConst
 		
     	Log.i(TAG, "service started: " + intent.getAction());
 
-		try {
-			checkTorBinaries (false);
-		} catch (Exception e) {
-
-			logNotice("unable to find tor binaries: " + e.getMessage());
-	    	showToolbarNotification(getString(R.string.error_installing_binares), NOTIFY_ID, R.drawable.tornotificationerr);
-
-			Log.e(TAG, "error checking tor binaries", e);
-		}
+    	
+    	Thread thread = new Thread ()
+    	{
+    		
+    		public void run ()
+    		{
+				try {
+					checkTorBinaries (false);
+				} catch (Exception e) {
+		
+					logNotice("unable to find tor binaries: " + e.getMessage());
+			    	showToolbarNotification(getString(R.string.error_installing_binares), NOTIFY_ID, R.drawable.tornotificationerr);
+		
+					Log.e(TAG, "error checking tor binaries", e);
+				}
+    		}
+    	};
+    	
+    	thread.start();
 
 		if (intent.getAction()!=null && intent.getAction().equals("onboot"))
 		{
 			
-		
 			SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
 			
-			boolean startOnBoot = prefs.getBoolean("pref_start_boot",true);
+			boolean startOnBoot = prefs.getBoolean("pref_start_boot",false);
 			
 			if (startOnBoot)
 			{
@@ -474,8 +483,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
     			
     			logNotice(getString(R.string.status_install_success));
     	
-    			showToolbarNotification(getString(R.string.status_install_success), NOTIFY_ID, R.drawable.tornotification);
-    		
+    			//showToolbarNotification(getString(R.string.status_install_success), NOTIFY_ID, R.drawable.tornotification);
 
     			torBinaryPath = fileTor.getAbsolutePath();
     			privoxyPath = filePrivoxy.getAbsolutePath();



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