ensure settings are updated and binary paths are on service restart
This commit is contained in:
parent
af433d37ba
commit
6e6546972a
|
@ -340,6 +340,12 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
|
||||
try
|
||||
{
|
||||
|
||||
if (fileTor == null)
|
||||
initBinariesAndDirectories();
|
||||
|
||||
updateSettings ();
|
||||
|
||||
mExecutor.execute (new TorStarter(intent));
|
||||
|
||||
return Service.START_STICKY;
|
||||
|
@ -568,13 +574,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
try
|
||||
{
|
||||
initBinariesAndDirectories();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//what error here
|
||||
Log.e(TAG, "Error installing Orbot binaries",e);
|
||||
logNotice("There was an error installing Orbot binaries");
|
||||
}
|
||||
updateSettings();
|
||||
|
||||
new Thread(new Runnable ()
|
||||
{
|
||||
|
@ -592,6 +592,15 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//what error here
|
||||
Log.e(TAG, "Error installing Orbot binaries",e);
|
||||
logNotice("There was an error installing Orbot binaries");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initBinariesAndDirectories () throws Exception
|
||||
|
@ -712,6 +721,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
|
||||
private void updateSettings () throws TimeoutException, IOException
|
||||
{
|
||||
|
||||
SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
|
||||
|
||||
mHasRoot = prefs.getBoolean(PREF_HAS_ROOT,false);
|
||||
|
@ -736,6 +746,9 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
|
||||
currentStatus = STATUS_CONNECTING;
|
||||
|
||||
if (fileTor == null)
|
||||
initBinariesAndDirectories();
|
||||
|
||||
enableBinExec(fileTor);
|
||||
enableBinExec(filePolipo);
|
||||
enableBinExec(fileObfsclient);
|
||||
|
|
Loading…
Reference in New Issue