Skip to content

Commit

Permalink
Significantly improves #621, more serious work to tor-androud should …
Browse files Browse the repository at this point in the history
…occur, basically Orbot set tor events and then TorService set its own CIRC event which caused the Orbot UI to not update
  • Loading branch information
bitmold committed Apr 20, 2022
1 parent e95179f commit fbc0bdc
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,16 +745,15 @@ public void onServiceConnected(ComponentName componentName, IBinder iBinder) {

if (conn != null) {
try {
initControlConnection();
conn.addRawEventListener(mOrbotRawEventListener);
conn.authenticate(new byte[0]);
logNotice(getString(R.string.log_notice_connected_to_tor_control_port));
conn.setEvents(events);
logNotice(getString(R.string.log_notice_added_event_handler));
} catch (IOException e) {
e.printStackTrace();
}


initControlConnection();
}
}

Expand Down Expand Up @@ -796,16 +795,6 @@ protected void exec(Runnable run) {

private void initControlConnection() {
if (conn != null) {

/* todo this is a kludge workaround for a bug in tor-android where sometimes TorService
gets stuck waiting for a lock... this will at least update the app to the starting
state so users can stop and then restart orbot
see: https://github.com/guardianproject/tor-android/issues/67
*/
var localStartingStatus = new Intent(LOCAL_ACTION_STATUS).putExtra(EXTRA_STATUS, STATUS_STARTING);
LocalBroadcastManager.getInstance(this).sendBroadcast(localStartingStatus);
logNotice(getString(R.string.log_notice_connected_to_tor_control_port));
try {
String confSocks = conn.getInfo("net/listeners/socks");
StringTokenizer st = new StringTokenizer(confSocks, " ");
Expand Down

0 comments on commit fbc0bdc

Please sign in to comment.