commit fc0554f9ff9f4f4f1d7940ab5dfc2e8fe4148841
Author: Nathan Freitas <[email protected]>
Date: Mon Apr 7 23:35:58 2014 -0400
fix for binary version upgrade support
---
src/org/torproject/android/service/TorService.java | 27 +++++++++++++++-----
.../android/service/TorServiceConstants.java | 2 +-
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/org/torproject/android/service/TorService.java
b/src/org/torproject/android/service/TorService.java
index 1cede61..23c0a4c 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 bd1c64c..db73e70 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";
_______________________________________________
tor-commits mailing list
[email protected]
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits