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/
|
NOTE: Specific #s below correspond to Trac tickets logged and maintained at https://trac.torproject.org/projects/tor/
|
||||||
|
|
||||||
1.0.7.3
|
1.0.7.3
|
||||||
|
- fixed tor control port cookie file path lookup related to #5305
|
||||||
- updated strings
|
- updated strings
|
||||||
- adding in manual locale selection
|
- adding in manual locale selection
|
||||||
|
|
||||||
|
|
|
@ -869,18 +869,15 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
||||||
conn = TorControlConnection.getConnection(torConnSocket);
|
conn = TorControlConnection.getConnection(torConnSocket);
|
||||||
|
|
||||||
// conn.authenticate(new byte[0]); // See section 3.2
|
// conn.authenticate(new byte[0]); // See section 3.2
|
||||||
|
|
||||||
|
|
||||||
logNotice( "SUCCESS connected to control port");
|
logNotice( "SUCCESS connected to control port");
|
||||||
|
|
||||||
String torAuthCookie = new File(appCacheHome, TOR_CONTROL_COOKIE).getAbsolutePath();
|
File fileCookie = new File(appCacheHome, TOR_CONTROL_COOKIE);
|
||||||
|
|
||||||
File fileCookie = new File(torAuthCookie);
|
|
||||||
|
|
||||||
if (fileCookie.exists())
|
if (fileCookie.exists())
|
||||||
{
|
{
|
||||||
byte[] cookie = new byte[(int)fileCookie.length()];
|
byte[] cookie = new byte[(int)fileCookie.length()];
|
||||||
new FileInputStream(new File(torAuthCookie)).read(cookie);
|
new FileInputStream(fileCookie).read(cookie);
|
||||||
conn.authenticate(cookie);
|
conn.authenticate(cookie);
|
||||||
|
|
||||||
logNotice( "SUCCESS authenticated to control port");
|
logNotice( "SUCCESS authenticated to control port");
|
||||||
|
|
|
@ -202,6 +202,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
|
||||||
|
|
||||||
apps[appIdx] = new TorifiedApp();
|
apps[appIdx] = new TorifiedApp();
|
||||||
|
|
||||||
|
|
||||||
apps[appIdx].setEnabled(aInfo.enabled);
|
apps[appIdx].setEnabled(aInfo.enabled);
|
||||||
apps[appIdx].setUid(aInfo.uid);
|
apps[appIdx].setUid(aInfo.uid);
|
||||||
apps[appIdx].setUsername(pMgr.getNameForUid(apps[appIdx].getUid()));
|
apps[appIdx].setUsername(pMgr.getNameForUid(apps[appIdx].getUid()));
|
||||||
|
@ -280,5 +281,8 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
|
||||||
saveAppSettings(this);
|
saveAppSettings(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue