[tor-commits] [orbot/master] cleaned up tor control cookie file code for #5305

n8fr8 at torproject.org n8fr8 at torproject.org
Mon Apr 9 03:26:06 UTC 2012


commit d11a6c6f752d70d3c644eda0f8c7b9fc4e80829f
Author: Nathan Freitas <nathan at freitas.net>
Date:   Sun Apr 8 23:22:54 2012 -0400

    cleaned up tor control cookie file code for #5305
---
 CHANGELOG                                          |    2 ++
 src/org/torproject/android/service/TorService.java |    7 ++-----
 .../torproject/android/settings/AppManager.java    |    4 ++++
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index cb0d856..95bd499 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
 NOTE: Specific #s below correspond to Trac tickets logged and maintained at https://trac.torproject.org/projects/tor/
+
 1.0.7.3
+- fixed tor control port cookie file path lookup related to #5305 
 - updated strings
 - adding in manual locale selection
 
diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java
index ca803b5..90ec393 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -869,18 +869,15 @@ public class TorService extends Service implements TorServiceConstants, TorConst
 			        conn = TorControlConnection.getConnection(torConnSocket);
 			        
 			      //  conn.authenticate(new byte[0]); // See section 3.2
-			        
 
 					logNotice( "SUCCESS connected to control port");
 			        
-			        String torAuthCookie = new File(appCacheHome, TOR_CONTROL_COOKIE).getAbsolutePath();
-			        
-			        File fileCookie = new File(torAuthCookie);
+			        File fileCookie = new File(appCacheHome, TOR_CONTROL_COOKIE);
 			        
 			        if (fileCookie.exists())
 			        {
 				        byte[] cookie = new byte[(int)fileCookie.length()];
-				        new FileInputStream(new File(torAuthCookie)).read(cookie);
+				        new FileInputStream(fileCookie).read(cookie);
 				        conn.authenticate(cookie);
 				        		
 				        logNotice( "SUCCESS authenticated to control port");
diff --git a/src/org/torproject/android/settings/AppManager.java b/src/org/torproject/android/settings/AppManager.java
index 16a6e7f..2e10ed7 100644
--- a/src/org/torproject/android/settings/AppManager.java
+++ b/src/org/torproject/android/settings/AppManager.java
@@ -202,6 +202,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
 			
 			apps[appIdx] = new TorifiedApp();
 			
+			
 			apps[appIdx].setEnabled(aInfo.enabled);
 			apps[appIdx].setUid(aInfo.uid);
 			apps[appIdx].setUsername(pMgr.getNameForUid(apps[appIdx].getUid()));
@@ -280,5 +281,8 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
 		saveAppSettings(this);
 		
 	}
+
+
+
 	
 }





More information about the tor-commits mailing list