diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 1cede611..23c0a4c9 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -525,10 +525,26 @@ public class TorService extends Service implements TorServiceConstants, TorConst fileXtables = new File(appBinHome, IPTABLES_ASSET_KEY); - if (!fileTorRc.exists()) + SharedPreferences prefs = getSharedPrefs(getApplicationContext()); + String version = prefs.getString(PREF_BINARY_TOR_VERSION_INSTALLED,null); + + if (version == null || (!version.equals(BINARY_TOR_VERSION))) { + stopTor(); + TorResourceInstaller installer = new TorResourceInstaller(this, appBinHome); boolean success = installer.installResources(); + + prefs.edit().putString(PREF_BINARY_TOR_VERSION_INSTALLED,BINARY_TOR_VERSION).commit(); + } + else if (!fileTorRc.exists()) + { + stopTor(); + + TorResourceInstaller installer = new TorResourceInstaller(this, appBinHome); + boolean success = installer.installResources(); + + prefs.edit().putString(PREF_BINARY_TOR_VERSION_INSTALLED,BINARY_TOR_VERSION).commit(); } @@ -608,8 +624,9 @@ public class TorService extends Service implements TorServiceConstants, TorConst if (mTransProxy == null) { - mTransProxy = new TorTransProxy(this); - mTransProxy.setXTables(fileXtables); + mTransProxy = new TorTransProxy(this, fileXtables); + + } logMessage ("Transparent Proxying: enabling..."); @@ -668,7 +685,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst logMessage ("Transparent Proxying: disabling..."); if (mTransProxy == null) - mTransProxy = new TorTransProxy(this); + mTransProxy = new TorTransProxy(this, fileXtables); mTransProxy.clearTransparentProxyingAll(this); @@ -1156,10 +1173,8 @@ public class TorService extends Service implements TorServiceConstants, TorConst public IBinder onBind(Intent intent) { - _torInstance = this; - Thread thread = new Thread () { diff --git a/src/org/torproject/android/service/TorServiceConstants.java b/src/org/torproject/android/service/TorServiceConstants.java index bd1c64c2..db73e70e 100644 --- a/src/org/torproject/android/service/TorServiceConstants.java +++ b/src/org/torproject/android/service/TorServiceConstants.java @@ -80,7 +80,7 @@ public interface TorServiceConstants { public static final int DISABLE_TOR_MSG = 3; public static final int LOG_MSG = 4; - public static final String BINARY_TOR_VERSION = "0.2.4.21"; + public static final String BINARY_TOR_VERSION = "0.2.4.21-openssl1.0.1g"; public static final String BINARY_PRIVOXY_VERSION = "3.0.12"; public static final String PREF_BINARY_TOR_VERSION_INSTALLED = "BINARY_TOR_VERSION_INTALLED"; public static final String PREF_BINARY_PRIVOXY_VERSION_INSTALLED = "BINARY_PRIVOXY_VERSION_INTALLED";