improve logic for updating torrc files (not so often)
This commit is contained in:
parent
44648f16c3
commit
dee0d19fe7
|
@ -558,29 +558,21 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
||||||
|
|
||||||
String extraLines = prefs.getString("pref_custom_torrc", null);
|
String extraLines = prefs.getString("pref_custom_torrc", null);
|
||||||
|
|
||||||
boolean success = installer.installTorrc(extraLines);
|
if (extraLines != null)
|
||||||
success = installer.installPolipoConf();
|
{
|
||||||
|
boolean success = installer.installTorrc(extraLines);
|
||||||
|
}
|
||||||
|
|
||||||
if (version == null || (!version.equals(BINARY_TOR_VERSION)) || (!fileTor.exists()))
|
if (version == null || (!version.equals(BINARY_TOR_VERSION)) || (!fileTor.exists()))
|
||||||
{
|
{
|
||||||
logNotice("upgrading binaries to latest version: " + BINARY_TOR_VERSION);
|
logNotice("upgrading binaries to latest version: " + BINARY_TOR_VERSION);
|
||||||
|
|
||||||
success = installer.installResources();
|
boolean success = installer.installResources();
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
prefs.edit().putString(PREF_BINARY_TOR_VERSION_INSTALLED,BINARY_TOR_VERSION).commit();
|
prefs.edit().putString(PREF_BINARY_TOR_VERSION_INSTALLED,BINARY_TOR_VERSION).commit();
|
||||||
}
|
}
|
||||||
else if (!fileTorRc.exists())
|
|
||||||
{
|
|
||||||
|
|
||||||
logNotice("upgrading binaries to latest version: " + BINARY_TOR_VERSION);
|
|
||||||
|
|
||||||
success = installer.installResources();
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
prefs.edit().putString(PREF_BINARY_TOR_VERSION_INSTALLED,BINARY_TOR_VERSION).commit();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,6 @@ public class TorServiceUtils implements TorServiceConstants {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public static SharedPreferences getSharedPrefs (Context context)
|
public static SharedPreferences getSharedPrefs (Context context)
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB)
|
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB)
|
||||||
|
|
Loading…
Reference in New Issue