diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-01 22:41:58 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-12-01 22:41:58 +0100 |
commit | dc8967d8fc09a5b7e515bb5005726d677a08c86b (patch) | |
tree | dff76dd5f6f71af64ca3b7cc2e723fdd2dafc5a7 /src/main/java/eu/siacs/conversations/ui | |
parent | 65b5504e68e36116234bd69126304d6d764b678b (diff) |
introduced build-time paranoia mode that disables unencrypted chats and forces TOR
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 1 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/SettingsActivity.java | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 5ac2b1b4e..1f6e57a0a 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -815,6 +815,7 @@ public class ConversationActivity extends XmppActivity MenuItem pgp = popup.getMenu().findItem(R.id.encryption_choice_pgp); MenuItem axolotl = popup.getMenu().findItem(R.id.encryption_choice_axolotl); pgp.setVisible(!Config.HIDE_PGP_IN_UI); + none.setVisible(!Config.PARANOID_MODE); if (conversation.getMode() == Conversation.MODE_MULTI) { otr.setVisible(false); axolotl.setVisible(false); diff --git a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java index 7118eb5a8..da9738ab5 100644 --- a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java @@ -9,7 +9,10 @@ import android.os.Build; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; +import android.preference.PreferenceCategory; import android.preference.PreferenceManager; +import android.preference.PreferenceScreen; +import android.util.Log; import android.widget.Toast; import java.security.KeyStoreException; @@ -19,6 +22,7 @@ import java.util.Collections; import java.util.Locale; import de.duenndns.ssl.MemorizingTrustManager; +import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.xmpp.XmppConnection; @@ -57,6 +61,14 @@ public class SettingsActivity extends XmppActivity implements } } + if (Config.PARANOID_MODE) { + 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 |