diff --git a/res/values/strings.xml b/res/values/strings.xml index 42937d41..4456aff7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -261,4 +261,9 @@ IP and Port that Tor offers its SOCKS proxy on (default: 9050) SOCKS Config (ip:port) + Torrc Custom Config + EXPERTS ONLY: enter direct torrc config lines + Custom Torrc + + diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index e4984e29..0277343b 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -204,6 +204,14 @@ android:dialogTitle="@string/pref_socks_dialog" android:defaultValue="9050" /> + + + 0) + { + StringBufferInputStream sbis = new StringBufferInputStream('\n' + extraLines + '\n'); + streamToFile(sbis,outFile,true,false); + } + return true; } diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 0e445458..ce2d0750 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -557,7 +557,10 @@ public class TorService extends Service implements TorServiceConstants, TorConst stopTor(); TorResourceInstaller installer = new TorResourceInstaller(this, appBinHome); - boolean success = installer.installTorrc(); + + String extraLines = prefs.getString("pref_custom_torrc", null); + + boolean success = installer.installTorrc(extraLines); if (version == null || (!version.equals(BINARY_TOR_VERSION)) || (!fileTor.exists())) { diff --git a/src/org/torproject/android/service/TorServiceConstants.java b/src/org/torproject/android/service/TorServiceConstants.java index e50c4166..74b2ef7c 100644 --- a/src/org/torproject/android/service/TorServiceConstants.java +++ b/src/org/torproject/android/service/TorServiceConstants.java @@ -76,7 +76,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.22-openssl1.0.1h.2"; + public static final String BINARY_TOR_VERSION = "0.2.4.22-openssl1.0.1h"; public static final String PREF_BINARY_TOR_VERSION_INSTALLED = "BINARY_TOR_VERSION_INSTALLED"; //obfsproxy