aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2019-12-13 21:17:01 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2019-12-13 21:17:01 +0100
commitb8602852b77e2b0f9f52b7bcb4fc87040e02ef48 (patch)
tree89db562a0774a92d028b8e4a68ccb1e9ac502de7
parentdc44c346ca291e2cfad7c726566cd7a55ce473b5 (diff)
first step to remove OTR encryption
* make OTR available via expert settings and disable it as default
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/main/java/de/pixart/messenger/ui/SettingsActivity.java1
-rw-r--r--src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java4
-rw-r--r--src/main/res/values/defaults.xml1
-rw-r--r--src/main/res/values/strings.xml2
-rw-r--r--src/main/res/xml/preferences.xml5
6 files changed, 14 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 92912e132..b6934a323 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,7 @@
### Changelog
+#### Version 2.3.5
+* start removing OTR
#### Version 2.3.4
* fixes for Jingle IBB file transfer
* fixes for repeated corrections filling up the database
diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
index 2ef7ead13..ae13072c7 100644
--- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
@@ -75,6 +75,7 @@ public class SettingsActivity extends XmppActivity implements
public static final String INDICATE_RECEIVED = "indicate_received";
public static final String USE_INVIDIOUS = "use_invidious";
public static final String ALLOW_MESSAGE_CORRECTION = "allow_message_correction";
+ public static final String ENABLE_OTR_ENCRYPTION = "enable_otr_encryption";
public static final int REQUEST_CREATE_BACKUP = 0xbf8701;
Preference multiAccountPreference;
diff --git a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java
index cb4211b1e..9797da56f 100644
--- a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java
+++ b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java
@@ -43,6 +43,8 @@ import de.pixart.messenger.entities.Conversation;
import de.pixart.messenger.entities.Conversational;
import de.pixart.messenger.entities.Message;
+import static de.pixart.messenger.ui.SettingsActivity.ENABLE_OTR_ENCRYPTION;
+
public class ConversationMenuConfigurator {
private static boolean microphoneAvailable = false;
@@ -128,7 +130,7 @@ public class ConversationMenuConfigurator {
menuSecure.setIcon(R.drawable.ic_lock_white_24dp);
}
- otr.setVisible(Config.supportOtr());
+ otr.setVisible(Config.supportOtr() && conversation.getBooleanAttribute(ENABLE_OTR_ENCRYPTION, false));
if (conversation.getMode() == Conversation.MODE_MULTI) {
otr.setVisible(false);
}
diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml
index 4d769d9de..36f881348 100644
--- a/src/main/res/values/defaults.xml
+++ b/src/main/res/values/defaults.xml
@@ -55,6 +55,7 @@
<bool name="use_internal_updater">true</bool>
<bool name="show_own_accounts">true</bool>
<bool name="vibrate_in_chat">true</bool>
+ <bool name="enable_otr">false</bool>
<integer name="auto_accept_filesize_wifi">10485760</integer>
<integer name="auto_accept_filesize_mobile">524288</integer>
<integer name="auto_accept_filesize_roaming">0</integer>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 5b515a738..b44679e52 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -993,4 +993,6 @@
<string name="pref_theme_orange">Orange</string>
<string name="pref_theme_color_options_summary">Select the theme color palette</string>
<string name="pref_theme_color_options">Theme color</string>
+ <string name="pref_enable_otr_summary">Enable OTR encryption for message encryption</string>
+ <string name="pref_enable_otr">Enable OTR encryption</string>
</resources>
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index 1b37df35f..f6f018cd2 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -449,6 +449,11 @@
android:summary="@string/pref_delete_omemo_identities_summary"
android:title="@string/pref_delete_omemo_identities" />
<CheckBoxPreference
+ android:defaultValue="@bool/enable_otr"
+ android:key="enable_otr_encryption"
+ android:summary="@string/pref_enable_otr_summary"
+ android:title="@string/pref_enable_otr" />
+ <CheckBoxPreference
android:defaultValue="@bool/dont_trust_system_cas"
android:key="dont_trust_system_cas"
android:summary="@string/pref_dont_trust_system_cas_summary"