Merge pull request #724 from syncthing/support-tor

Support TOR connectivity (fixes #589).
This commit is contained in:
Felix Ableitner 2016-08-19 17:29:52 +02:00 committed by GitHub
commit a981abfad6
3 changed files with 13 additions and 0 deletions

View File

@ -122,6 +122,10 @@ public class SyncthingRunnable implements Runnable {
env.put("STNOUPGRADE", "1");
env.put("STGUIAUTH", sp.getString("gui_user", "") + ":" +
sp.getString("gui_password", ""));
if (sp.getBoolean("use_tor", false)) {
env.put("all_proxy", "socks5://localhost:9050");
env.put("ALL_PROXY_NO_FALLBACK", "1");
}
process = pb.start();
mSyncthing.set(process);

View File

@ -304,6 +304,10 @@ Please report any problems you encounter via Github.</string>
<string name="run_as_foreground_service_summary">If enabled, Syncthing will run with foreground priority and is less likely to be stopped by Android. This might cause other services to be stopped if available memory is low. A low-priority notification needs to be shown due to Android requirements, regardless of the \"Notification\" setting.</string>
<string name="use_tor_title">Use TOR</string>
<string name="use_tor_summary">Force all traffic through TOR for increased privacy</string>
<!-- Toast shown after config was successfully exported -->
<string name="config_export_successful">Config was exported to %1$s</string>

View File

@ -168,6 +168,11 @@
android:summary="@string/run_as_foreground_service_summary"
android:defaultValue="false" />
<CheckBoxPreference
android:key="use_tor"
android:title="@string/use_tor_title"
android:summary="@string/use_tor_summary" />
</PreferenceScreen>
</PreferenceCategory>