aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-03-24 19:16:14 +0100
committerChristian Schneppe <christian@pix-art.de>2017-03-24 19:16:14 +0100
commitbb1ceff1ee42eddf7cea57b022326150734b72e0 (patch)
treeea862e33db7575682158e31cea7bdd7de1edef86 /src/main
parenta2210c8e86d3e873ede47c1710a87754dacb0d14 (diff)
open version can use tor networks (via settings)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/SettingsActivity.java9
-rw-r--r--src/main/res/values/strings.xml3
-rw-r--r--src/main/res/xml/preferences.xml9
3 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
index 61cf0a4af..13cb9bb99 100644
--- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Locale;
import de.duenndns.ssl.MemorizingTrustManager;
+import de.pixart.messenger.BuildConfig;
import de.pixart.messenger.Config;
import de.pixart.messenger.R;
import de.pixart.messenger.entities.Account;
@@ -84,6 +85,14 @@ public class SettingsActivity extends XmppActivity implements
}
}
+ if (BuildConfig.FLAVOR != "open") {
+ PreferenceCategory connectionOptions = (PreferenceCategory) mSettingsFragment.findPreference("connection_options");
+ PreferenceScreen expert = (PreferenceScreen) mSettingsFragment.findPreference("expert");
+ if (connectionOptions != null) {
+ expert.removePreference(connectionOptions);
+ }
+ }
+
final Preference removeCertsPreference = mSettingsFragment.findPreference("remove_trusted_certificates");
removeCertsPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 526f92c80..d1e053943 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -761,4 +761,7 @@
<string name="block_entire_domain">Block entire domain</string>
<string name="pref_use_auto_rotate_summary">Rotate images and videos in fullscreen to fit screensize</string>
<string name="pref_use_auto_rotate">rotate media in fullscreen</string>
+ <string name="pref_use_tor">Connect via Tor</string>
+ <string name="pref_use_tor_summary">Tunnel all connections through the Tor network.</string>
+ <string name="pref_connection_options">Connection options</string>
</resources>
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index dd5dab37d..bf0ee8ac8 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -269,6 +269,15 @@
android:summary="@string/pref_remove_trusted_certificates_summary"
android:title="@string/pref_remove_trusted_certificates_title" />
</PreferenceCategory>
+ <PreferenceCategory
+ android:key="connection_options"
+ android:title="@string/pref_connection_options">
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="use_tor"
+ android:summary="@string/pref_use_tor_summary"
+ android:title="@string/pref_use_tor" />
+ </PreferenceCategory>
<PreferenceCategory android:title="@string/pref_input_options">
<CheckBoxPreference
android:defaultValue="@bool/enter_is_send"