cleaned up tor control cookie file code for #5305
This commit is contained in:
parent
1cb7ed5a6c
commit
d11a6c6f75
|
@ -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
|
||||
|
||||
|
|
|
@ -870,17 +870,14 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
|
||||
// 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");
|
||||
|
|
|
@ -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()));
|
||||
|
@ -281,4 +282,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue