commit dee0d19fe7b8c4cf7da6066226b452cd8413d139 Author: Nathan Freitas nathan@freitas.net Date: Wed Jun 11 22:04:41 2014 -0400
improve logic for updating torrc files (not so often) --- src/org/torproject/android/service/TorService.java | 20 ++++++-------------- .../android/service/TorServiceUtils.java | 1 - 2 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index e9029c3..3de7fb3 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -557,30 +557,22 @@ public class TorService extends Service implements TorServiceConstants, TorConst TorResourceInstaller installer = new TorResourceInstaller(this, appBinHome); String extraLines = prefs.getString("pref_custom_torrc", null); + + if (extraLines != null) + { + boolean success = installer.installTorrc(extraLines); + } - boolean success = installer.installTorrc(extraLines); - success = installer.installPolipoConf(); - if (version == null || (!version.equals(BINARY_TOR_VERSION)) || (!fileTor.exists())) { logNotice("upgrading binaries to latest version: " + BINARY_TOR_VERSION); - success = installer.installResources(); + boolean success = installer.installResources(); if (success) 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(); - - } }
diff --git a/src/org/torproject/android/service/TorServiceUtils.java b/src/org/torproject/android/service/TorServiceUtils.java index 16a9a17..af83709 100644 --- a/src/org/torproject/android/service/TorServiceUtils.java +++ b/src/org/torproject/android/service/TorServiceUtils.java @@ -112,7 +112,6 @@ public class TorServiceUtils implements TorServiceConstants {
} - @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static SharedPreferences getSharedPrefs (Context context) { if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB)
tor-commits@lists.torproject.org