From 333783ff2f8f53cf30e99cf0ae3d15381fa17b0a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 2 Jun 2025 13:22:59 +0200 Subject: [PATCH 1/5] version++ --- matrix-sdk-android/build.gradle | 2 +- vector-app/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index eb6a3e58043..55da126d23b 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -62,7 +62,7 @@ android { // that the app's state is completely cleared between tests. testInstrumentationRunnerArguments clearPackageData: 'true' - buildConfigField "String", "SDK_VERSION", "\"1.6.40\"" + buildConfigField "String", "SDK_VERSION", "\"1.6.42\"" buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\"" diff --git a/vector-app/build.gradle b/vector-app/build.gradle index 738ececc853..895924a712b 100644 --- a/vector-app/build.gradle +++ b/vector-app/build.gradle @@ -37,7 +37,7 @@ ext.versionMinor = 6 // 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 = 40 +ext.versionPatch = 42 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' From c3b923c27def396c0ee42f179602d6ac98b63141 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Mon, 2 Jun 2025 13:56:58 +0100 Subject: [PATCH 2/5] Improve docs about the Rust crypto integration (#9035) --- CONTRIBUTING.md | 2 ++ docs/rust_crypto_integration.md | 55 +++++++++------------------------ 2 files changed, 16 insertions(+), 41 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 40ae8484156..c9348218582 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,6 +70,8 @@ Note that if the templates are modified, the only things to do is to restart And For now, the Matrix SDK and the Element application are in the same project. So there is no specific thing to do, this project should compile without any special action. +See [docs/rust_crypto_integration.md](./docs/rust_crypto_integration.md#testing-with-a-local-rust-aar) for notes on building against a custom version of the Rust `matrix-sdk-crypto`. + ## I want to help translating Element If you want to fix an issue with an English string, please submit a PR. diff --git a/docs/rust_crypto_integration.md b/docs/rust_crypto_integration.md index aad370d80a0..8ac895d7160 100644 --- a/docs/rust_crypto_integration.md +++ b/docs/rust_crypto_integration.md @@ -1,31 +1,18 @@ ## Overview -Until the final migration to [rust crypto sdk](https://github.com/matrix-org/matrix-rust-components-kotlin), the Element Android project will support two -different SDK as a product flavor. - -The `matrix-sdk-android` module is defining a new flavor dimension `crypto`, with two flavors `kotlinCrypto` and `rustCrypto`. -The crypto module cannot be changed at runtime, it's a build time configuration. The app supports migration from kotlinCrypto to rustCrypto but not the other -way around. - -The code that is not shared between the flavors is located in dedicated source sets (`src/kotlinCrypto/`, `src/rustCrypto/`). Some tests are also extracted -in different source sets because they were accessing internal API and won't work with the rust crypto sdk. - -## Noticeable changes - -As a general rule, if you stick to the `kotlinCrypto` the app should behave as it was before the integration of favours. -There is a noticeable exception though: -In order to integrate the rust crypto several APIs had to be migrated from callback code to suspendable code. This change -impacted a lot the key verification engine (user and device verification), so this part has been refactored for `kotlinCrypto`. The UI is also impacted, -the verification flows now match the web experience. - -TLDR; Verification UI and engine has been refactored. +Element Android [now](https://github.com/element-hq/element-android/pull/8656) only supports the [rust crypto SDK](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto). ## Testing with a local rust aar -In order to run a custom rust SDK branch you can follow the direction in the [bindings repository](https://github.com/matrix-org/matrix-rust-components-kotlin) -in order to build the `matrix-rust-sdk-crypto.aar`. +In order to run a custom rust SDK branch you can follow the directions in the +[bindings repository](https://github.com/matrix-org/matrix-rust-components-kotlin?tab=readme-ov-file#testing-locally) +in order to build the AAR for the crypto crate. + +Install the resulting file as `./library/rustCrypto/matrix-rust-sdk-crypto.aar`. For example: -Copy this lib in `library/rustCrypto/`, and rename it `matrix-rust-sdk-crypto.aar`. +```sh +ln -s /crypto/crypto-android/build/outputs/aar/crypto-android-debug.aar ./library/rustCrypto/matrix-rust-sdk-crypto.aar +``` Then go to `matrix-sdk-android/build.gradle` and toggle the comments between the following lines. @@ -34,30 +21,16 @@ Then go to `matrix-sdk-android/build.gradle` and toggle the comments between the // rustCryptoApi project(":library:rustCrypto") ```` -## Changes in CI - -The workflow files have been updated to use the `kotlinCrypto` flavor, e.g - -`assembleGplayNightly` => `assembleGplayKotlinCryptoNightly` - -So building the unsigned release kotlin crypto apk is now: - -`> ./gradlew assembleGplayKotlinCryptoRelease` - -An additional workflow has been added to build the `rustCrypto` flavor (elementr.yml, ` Build debug APKs ER`). - - ## Database migration from kotlin to rust -With the kotlin flavor, the crypto information are persisted in the crypto realm database. -With the rust flavor, the crypto information are in a sqllite database. +Crypto information is now persisted in a SQLite database. -The migration is handled when injecting `@SessionRustFilesDirectory` in the olmMachine. +The migration from the old Realm database is handled when injecting `@SessionRustFilesDirectory` in the olmMachine. When launching the first time after migration, the app will detect that there is no rust data repository and it will create one. If there is an existing realm database, the data will then migrated to rust. See `ExtractMigrationDataUseCase`. This will extract your device keys, account secrets, active olm and megolm sessions. -There is no inverse migration for now, as there is not yet rust pickle to olm pickle support in the sdk. - -If you migrate your app to rust, and want to revert to kotlin you have to logout then login again. +There is no inverse migration. If you migrate to a version of the app that uses +the Rust library, and want to revert to a Kotlin-crypto version, you will have +to logout then login again. From b00bc861a0d930082fb6c39ab08cb55b8446d02a Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 10 Jun 2025 15:12:15 +0200 Subject: [PATCH 3/5] deps (rust crypto sdk) : bump version to 0.11.1 --- matrix-sdk-android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 55da126d23b..ce4f1956377 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -221,7 +221,7 @@ dependencies { implementation libs.google.phonenumber - implementation("org.matrix.rustcomponents:crypto-android:0.11.0") + implementation("org.matrix.rustcomponents:crypto-android:0.11.1") // api project(":library:rustCrypto") testImplementation libs.tests.junit From bd15adb2c9acc48837e0099008681fe06f3f9619 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 10 Jun 2025 16:21:51 +0200 Subject: [PATCH 4/5] Changelog for version 1.6.42 --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d9059cad14b..9547bc7652d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,9 @@ +Changes in Element v1.6.42 (2025-06-10) +======================================= + +- Bump org.matrix.rustcomponents:crypto-android to 0.11.1 ([#9043](https://github.com/element-hq/element-android/pull/9043)) + + Changes in Element v1.6.40 (2025-06-02) ======================================= From 49b0b9ed59554d839ade205cb6b0869e790e6bb5 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 10 Jun 2025 16:22:42 +0200 Subject: [PATCH 5/5] Adding fastlane file for version 1.6.42 --- fastlane/metadata/android/en-US/changelogs/40106420.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/40106420.txt diff --git a/fastlane/metadata/android/en-US/changelogs/40106420.txt b/fastlane/metadata/android/en-US/changelogs/40106420.txt new file mode 100644 index 00000000000..2038fb676f0 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/40106420.txt @@ -0,0 +1,2 @@ +Main changes in this version: bug fixes and improvements. +Full changelog: https://github.com/element-hq/element-android/releases \ No newline at end of file