Skip to content

Commit

Permalink
Merge tag 'tchap_v2.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Aug 31, 2023
2 parents 8c18c50 + 5ed60ce commit 97f42e7
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 57 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:

# Enrich gradle.properties for CI/CD
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
# Tchap : up Xmx TO 4096 to achieve build in CI
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx4096m" -Dkotlin.incremental=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon

jobs:
Expand Down
14 changes: 14 additions & 0 deletions TCHAP_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Changes in Tchap 2.9.1 (2023-07-27)
===================================

Improvements 🙌
--------------
- Amélioration UX, wording et organisation des settings sécurité (partie II, multidevice) (#940) ([#940](https://github.com/tchapgouv/tchap-android-v2/issues/940))
- Supprimer le blocage d'envoi de messages chiffrés aux appareils non vérifiés (945) ([#945](https://github.com/tchapgouv/tchap-android-v2/issues/945))

Bugfixes 🐛
----------
- Correction du test de Push Notification non adapté à Tchap #950 ([#950](https://github.com/tchapgouv/tchap-android-v2/issues/950))
- Problème de copie du code de récupération après génération ([#953](https://github.com/tchapgouv/tchap-android-v2/issues/953))


Changes in Tchap 2.9.0 (2023-07-06)
===================================

Expand Down
2 changes: 1 addition & 1 deletion library/ui-strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@
<string name="settings_silent_notifications_preferences">Configurer les notifications silencieuses</string>
<string name="settings_system_preferences_summary">Choisir la couleur de la LED, les vibrations, le son…</string>
<string name="settings_cryptography_manage_keys">Clés Tchap</string><!-- Tchap: Use custom string -->
<string name="encryption_settings_manage_message_recovery_summary">Gérer la sauvegarde</string><!-- Tchap: Use custom string -->
<string name="encryption_settings_manage_message_recovery_summary">Récupérer mes messages</string><!-- Tchap: Use custom string -->
<string name="notification_silent">Silencieuse</string>
<string name="passphrase_empty_error_message">Veuillez saisir une phrase secrète</string>
<string name="passphrase_passphrase_too_weak">La phrase secrète est trop faible</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,9 @@ internal class RealmCryptoStore @Inject constructor(
}
)
return Transformations.map(liveData) {
it.firstOrNull() ?: false
// Tchap : force to false to avoid "Never send messages to non verified devices"
// it.firstOrNull() ?: false
false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ internal class RustCryptoStore @Inject constructor(
}
)
return Transformations.map(liveData) {
it.firstOrNull() ?: false
// Tchap : force to false to avoid "Never send messages to non verified devices"
// it.firstOrNull() ?: false
false
}
}

Expand Down
2 changes: 1 addition & 1 deletion towncrier.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.towncrier]
version = "2.9.0"
version = "2.9.1"
directory = "changelog.d"
filename = "TCHAP_CHANGES.md"
name = "Changes in Tchap"
Expand Down
2 changes: 1 addition & 1 deletion vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ext.versionMinor = 9
// Note: even values are reserved for regular release, odd values for hotfix release.
// When creating a hotfix, you should decrease the value, since the current value
// is the value for the next regular release.
ext.versionPatch = 0
ext.versionPatch = 1

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import im.vector.app.features.settings.troubleshoot.TestCurrentUnifiedPushDistri
import im.vector.app.features.settings.troubleshoot.TestDeviceSettings
import im.vector.app.features.settings.troubleshoot.TestEndpointAsTokenRegistration
import im.vector.app.features.settings.troubleshoot.TestNotification
import im.vector.app.features.settings.troubleshoot.TestPushFromPushGateway
// import im.vector.app.features.settings.troubleshoot.TestPushFromPushGateway // Tchap : remove
import im.vector.app.features.settings.troubleshoot.TestPushRulesSettings
import im.vector.app.features.settings.troubleshoot.TestSystemSettings
import im.vector.app.features.settings.troubleshoot.TestUnifiedPushEndpoint
Expand All @@ -47,7 +47,7 @@ class FdroidNotificationTroubleshootTestManagerFactory @Inject constructor(
private val testUnifiedPushEndpoint: TestUnifiedPushEndpoint,
private val testAvailableUnifiedPushDistributors: TestAvailableUnifiedPushDistributors,
private val testEndpointAsTokenRegistration: TestEndpointAsTokenRegistration,
private val testPushFromPushGateway: TestPushFromPushGateway,
// private val testPushFromPushGateway: TestPushFromPushGateway, // Tchap : remove
private val testAutoStartBoot: TestAutoStartBoot,
private val testBackgroundRestrictions: TestBackgroundRestrictions,
private val testBatteryOptimization: TestBatteryOptimization,
Expand All @@ -73,7 +73,7 @@ class FdroidNotificationTroubleshootTestManagerFactory @Inject constructor(
mgr.addTest(testUnifiedPushGateway)
mgr.addTest(testUnifiedPushEndpoint)
mgr.addTest(testEndpointAsTokenRegistration)
mgr.addTest(testPushFromPushGateway)
// mgr.addTest(testPushFromPushGateway) // Tchap : remove
}
mgr.addTest(testNotification)
return mgr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import im.vector.app.features.settings.troubleshoot.TestCurrentUnifiedPushDistri
import im.vector.app.features.settings.troubleshoot.TestDeviceSettings
import im.vector.app.features.settings.troubleshoot.TestEndpointAsTokenRegistration
import im.vector.app.features.settings.troubleshoot.TestNotification
import im.vector.app.features.settings.troubleshoot.TestPushFromPushGateway
// import im.vector.app.features.settings.troubleshoot.TestPushFromPushGateway // Tchap : remove
import im.vector.app.features.settings.troubleshoot.TestPushRulesSettings
import im.vector.app.features.settings.troubleshoot.TestSystemSettings
import im.vector.app.features.settings.troubleshoot.TestUnifiedPushEndpoint
Expand All @@ -50,7 +50,7 @@ class GoogleNotificationTroubleshootTestManagerFactory @Inject constructor(
private val testUnifiedPushEndpoint: TestUnifiedPushEndpoint,
private val testAvailableUnifiedPushDistributors: TestAvailableUnifiedPushDistributors,
private val testEndpointAsTokenRegistration: TestEndpointAsTokenRegistration,
private val testPushFromPushGateway: TestPushFromPushGateway,
// private val testPushFromPushGateway: TestPushFromPushGateway, // Tchap : remove
private val testNotification: TestNotification,
private val vectorFeatures: VectorFeatures,
) : NotificationTroubleshootTestManagerFactory {
Expand All @@ -75,7 +75,7 @@ class GoogleNotificationTroubleshootTestManagerFactory @Inject constructor(
mgr.addTest(testUnifiedPushEndpoint)
mgr.addTest(testEndpointAsTokenRegistration)
}
mgr.addTest(testPushFromPushGateway)
// mgr.addTest(testPushFromPushGateway) // Tchap : remove
mgr.addTest(testNotification)
return mgr
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ class KeysBackupSettingsRecyclerViewController @Inject constructor(
textButton1(host.stringProvider.getString(R.string.keys_backup_settings_restore_backup_button))
clickOnButton1 { host.listener?.didSelectRestoreMessageRecovery() }

textButton2(host.stringProvider.getString(R.string.keys_backup_settings_delete_backup_button))
clickOnButton2 { host.listener?.didSelectDeleteSetupMessageRecovery() }
// Tchap : hide "Suppress backup" button
// textButton2(host.stringProvider.getString(R.string.keys_backup_settings_delete_backup_button))
// clickOnButton2 { host.listener?.didSelectDeleteSetupMessageRecovery() }
} else {
textButton1(host.stringProvider.getString(R.string.keys_backup_setup))
clickOnButton1 { host.listener?.didSelectSetupMessageRecovery() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package im.vector.app.features.crypto.recover

import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
Expand Down Expand Up @@ -93,7 +96,8 @@ class BootstrapSaveRecoveryKeyFragment :
}

private val copyStartForActivityResult = registerStartForActivityResult { activityResult ->
if (activityResult.resultCode == Activity.RESULT_OK) {
// Tchap : accept to close sheet even if result is RESULT_CANCELED. The Recovery code is in the clipboard.
if (activityResult.resultCode == Activity.RESULT_OK || activityResult.resultCode == Activity.RESULT_CANCELED) {
// Tchap : Close the dialog without having to tap "Continue"
sharedViewModel.handle(BootstrapActions.Completed)
}
Expand All @@ -103,6 +107,11 @@ class BootstrapSaveRecoveryKeyFragment :
val recoveryKey = state.recoveryKeyCreationInfo?.recoveryKey?.formatRecoveryKey()
?: return@withState

// Tchap : copy recovery key to clipboard right now after "Copy" button is tapped.
val clipboard = requireContext().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("", recoveryKey)
clipboard.setPrimaryClip(clip)

startSharePlainTextIntent(
requireContext(),
copyStartForActivityResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,30 +205,32 @@ class RoomProfileController @Inject constructor(
host.callback?.openGlobalBlockSettings()
}
}
} else {
// per room setting is available
val shouldBlockUnverified = data.encryptToVerifiedDeviceOnly.invoke()
formSwitchItem {
id("send_to_unverified")
enabled(shouldBlockUnverified != null)
title(host.stringProvider.getString(R.string.encryption_never_send_to_unverified_devices_in_room))

switchChecked(shouldBlockUnverified ?: false)

apply {
if (shouldBlockUnverified == true && data.unverifiedDevicesInTheRoom.invoke() == true) {
summary(
host.stringProvider.getString(R.string.some_devices_will_not_be_able_to_decrypt)
)
} else {
summary(null)
}
}
listener { value ->
host.callback?.setEncryptedToVerifiedDevicesOnly(value)
}
}
}
// Tchap : don't display option "Never send messages to unverified devices in room"
// else {
// // per room setting is available
// val shouldBlockUnverified = data.encryptToVerifiedDeviceOnly.invoke()
// formSwitchItem {
// id("send_to_unverified")
// enabled(shouldBlockUnverified != null)
// title(host.stringProvider.getString(R.string.encryption_never_send_to_unverified_devices_in_room))
//
// switchChecked(shouldBlockUnverified ?: false)
//
// apply {
// if (shouldBlockUnverified == true && data.unverifiedDevicesInTheRoom.invoke() == true) {
// summary(
// host.stringProvider.getString(R.string.some_devices_will_not_be_able_to_decrypt)
// )
// } else {
// summary(null)
// }
// }
// listener { value ->
// host.callback?.setEncryptedToVerifiedDevicesOnly(value)
// }
// }
// }
}
}
// More
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class RoomProfileViewModel @AssistedInject constructor(

private fun setEncryptToVerifiedDeviceOnly(enabled: Boolean) {
session.coroutineScope.launch {
session.cryptoService().setRoomBlockUnverifiedDevices(room.roomId, enabled)
session.cryptoService().setRoomBlockUnverifiedDevices(room.roomId, enabled and false) // Tchap : force to false to deactivate "Never send messages to unverified devices in room"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,18 @@ class VectorSettingsSecurityPrivacyFragment :
} else {
// just hide all, you can't setup from here
// you should synchronize to get gossips
secureBackupCategory.isVisible = false
// Tchap : here, the section is hidden on Element.
// In Tchap, we want to show it.
secureBackupCategory.isVisible = true
secureBackupPreference.title = getString(R.string.settings_secure_backup_enter_to_setup)
secureBackupPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener {
vectorActivity.let {
it.navigator.requestSelfSessionVerification(it)
}
true
}
// Tchap : remove "Manage backup" button because Secure backup is not activated
manageBackupPref.isVisible = false
}
} else {
// so here we know that 4S is setup
Expand Down Expand Up @@ -372,7 +383,7 @@ class VectorSettingsSecurityPrivacyFragment :
mCrossSigningStatePreference.summary = getString(R.string.encryption_information_dg_xsigning_trusted)
}
xSigningIsEnableInAccount -> {
mCrossSigningStatePreference.setIcon(R.drawable.ic_shield_black)
mCrossSigningStatePreference.setIcon(R.drawable.ic_tchap_cancel) // Tchpa icon
mCrossSigningStatePreference.summary = getString(R.string.encryption_information_dg_xsigning_not_trusted)
}
else -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ class CrossSigningSettingsController @Inject constructor(
titleIconResourceId(R.drawable.ic_shield_trusted)
title(host.stringProvider.getString(R.string.encryption_information_dg_xsigning_complete).toEpoxyCharSequence())
}
genericButtonItem {
id("Reset")
text(host.stringProvider.getString(R.string.reset_cross_signing))
textColor(host.colorProvider.getColor(R.color.palette_tchap_coral)) // Tchap
buttonClickAction {
host.interactionListener?.didTapInitializeCrossSigning()
}
}
// Tchap : don't display "Reset cross-signing" button
// genericButtonItem {
// id("Reset")
// text(host.stringProvider.getString(R.string.reset_cross_signing))
// textColor(host.colorProvider.getColor(R.color.palette_tchap_coral)) // Tchap
// buttonClickAction {
// host.interactionListener?.didTapInitializeCrossSigning()
// }
// }
}
data.xSigningKeysAreTrusted -> {
genericItem {
Expand All @@ -77,7 +78,7 @@ class CrossSigningSettingsController @Inject constructor(
data.xSigningIsEnableInAccount -> {
genericItem {
id("enable")
titleIconResourceId(R.drawable.ic_shield_black)
titleIconResourceId(R.drawable.ic_tchap_cancel) // Tchap icon
title(host.stringProvider.getString(R.string.encryption_information_dg_xsigning_not_trusted).toEpoxyCharSequence())
}
genericButtonItem {
Expand Down
5 changes: 5 additions & 0 deletions vector/src/main/res/drawable/ic_tchap_cancel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#9B9B9B"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM15.59,7L12,10.59 8.41,7 7,8.41 10.59,12 7,15.59 8.41,17 12,13.41 15.59,17 17,15.59 13.41,12 17,8.41z"/>
</vector>
13 changes: 6 additions & 7 deletions vector/src/main/res/xml/vector_settings_security_privacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
android:focusable="false"
android:persistent="false"
android:summary="@string/settings_secure_backup_section_info" />
<im.vector.app.core.preference.VectorPreference
app:icon="@drawable/ic_shield_trusted"
android:key="SETTINGS_SECURE_MESSAGE_RECOVERY_PREFERENCE_KEY"
android:persistent="false"
android:title="@string/encryption_settings_manage_message_recovery_summary"
app:isPreferenceVisible="@bool/tchap_is_key_backup_enabled" />

<im.vector.app.core.preference.VectorPreference
android:icon="@drawable/ic_secure_backup"
android:key="SETTINGS_SECURE_BACKUP_RECOVERY_PREFERENCE_KEY"
android:persistent="false"
android:title="@string/settings_secure_backup_setup" />

<im.vector.app.core.preference.VectorPreference
app:icon="@drawable/ic_shield_trusted"
android:key="SETTINGS_SECURE_MESSAGE_RECOVERY_PREFERENCE_KEY"
android:persistent="false"
android:title="@string/encryption_settings_manage_message_recovery_summary"
app:isPreferenceVisible="@bool/tchap_is_key_backup_enabled" />

</im.vector.app.core.preference.VectorPreferenceCategory>

<!-- devices list entry point -->
Expand Down

0 comments on commit 97f42e7

Please sign in to comment.