Skip to content

Commit 0263183

Browse files
committed
Merge branch 'release/1.6.18' into main
2 parents e3a8781 + 3f67bbf commit 0263183

File tree

30 files changed

+328
-141
lines changed

30 files changed

+328
-141
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- uses: actions/setup-java@v3
3333
with:
3434
distribution: 'adopt'
35-
java-version: '11'
35+
java-version: '17'
3636
- uses: gradle/gradle-build-action@v2
3737
with:
3838
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}

CHANGES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Changes in Element v1.6.18 (2024-06-25)
2+
=======================================
3+
4+
Bugfixes 🐛
5+
----------
6+
- Fix redacted events not grouped correctly when hidden events are inserted between. ([#8840](https://github.com/element-hq/element-android/issues/8840))
7+
- Element-Android session doesn't encrypt for a dehydrated device ([#8842](https://github.com/element-hq/element-android/issues/8842))
8+
- Intercept only links from `element.io` well known hosts. The previous behaviour broke OIDC login in Element X. ([#8894](https://github.com/element-hq/element-android/issues/8894))
9+
10+
Other changes
11+
-------------
12+
- Posthog | report platform code for EA ([#8839](https://github.com/element-hq/element-android/issues/8839))
13+
14+
115
Changes in Element v1.6.16 (2024-05-29)
216
=======================================
317

dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ext.libs = [
101101
],
102102
element : [
103103
'opusencoder' : "io.element.android:opusencoder:1.1.0",
104-
'wysiwyg' : "io.element.android:wysiwyg:2.35.0"
104+
'wysiwyg' : "io.element.android:wysiwyg:2.37.3"
105105
],
106106
squareup : [
107107
'moshi' : "com.squareup.moshi:moshi:$moshi",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Main changes in this version: Bugfixes.
2+
Full changelog: https://github.com/element-hq/element-android/releases

matrix-sdk-android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ android {
6262
// that the app's state is completely cleared between tests.
6363
testInstrumentationRunnerArguments clearPackageData: 'true'
6464

65-
buildConfigField "String", "SDK_VERSION", "\"1.6.16\""
65+
buildConfigField "String", "SDK_VERSION", "\"1.6.18\""
6666

6767
buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
6868
buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\""

matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/MarkdownParserTest.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ import org.junit.Test
2626
import org.junit.runner.RunWith
2727
import org.junit.runners.MethodSorters
2828
import org.matrix.android.sdk.InstrumentedTest
29-
import org.matrix.android.sdk.api.MatrixConfiguration
3029
import org.matrix.android.sdk.api.util.TextContent
31-
import org.matrix.android.sdk.common.TestRoomDisplayNameFallbackProvider
32-
import org.matrix.android.sdk.internal.session.displayname.DisplayNameResolver
3330
import org.matrix.android.sdk.internal.session.room.send.pills.MentionLinkSpecComparator
3431
import org.matrix.android.sdk.internal.session.room.send.pills.TextPillsUtils
3532

@@ -56,12 +53,6 @@ class MarkdownParserTest : InstrumentedTest {
5653
HtmlRenderer.builder().softbreak("<br />").build(),
5754
TextPillsUtils(
5855
MentionLinkSpecComparator(),
59-
DisplayNameResolver(
60-
MatrixConfiguration(
61-
applicationFlavor = "TestFlavor",
62-
roomDisplayNameFallbackProvider = TestRoomDisplayNameFallbackProvider()
63-
)
64-
),
6556
TestPermalinkService()
6657
)
6758
)

matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/Matrix.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,12 @@ class Matrix(context: Context, matrixConfiguration: MatrixConfiguration) {
147147
fun getSdkVersion(): String {
148148
return BuildConfig.SDK_VERSION + " (" + BuildConfig.GIT_SDK_REVISION + ")"
149149
}
150+
151+
fun getCryptoVersion(longFormat: Boolean): String {
152+
val version = org.matrix.rustcomponents.sdk.crypto.version()
153+
val gitHash = org.matrix.rustcomponents.sdk.crypto.versionInfo().gitSha
154+
val vodozemac = org.matrix.rustcomponents.sdk.crypto.vodozemacVersion()
155+
return if (longFormat) "Rust SDK $version ($gitHash), Vodozemac $vodozemac" else version
156+
}
150157
}
151158
}

matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.matrix.android.sdk.api.session.crypto
1818

19-
import android.content.Context
2019
import androidx.annotation.Size
2120
import androidx.lifecycle.LiveData
2221
import androidx.paging.PagedList
@@ -61,8 +60,6 @@ interface CryptoService {
6160

6261
suspend fun deleteDevices(@Size(min = 1) deviceIds: List<String>, userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)
6362

64-
fun getCryptoVersion(context: Context, longFormat: Boolean): String
65-
6663
fun isCryptoEnabled(): Boolean
6764

6865
fun isRoomBlacklistUnverifiedDevices(roomId: String?): Boolean

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.matrix.android.sdk.internal.crypto
1818

19-
import android.content.Context
2019
import androidx.lifecycle.LiveData
2120
import androidx.lifecycle.map
2221
import androidx.paging.PagedList
@@ -184,13 +183,6 @@ internal class RustCryptoService @Inject constructor(
184183
deleteDevices(listOf(deviceId), userInteractiveAuthInterceptor)
185184
}
186185

187-
override fun getCryptoVersion(context: Context, longFormat: Boolean): String {
188-
val version = org.matrix.rustcomponents.sdk.crypto.version()
189-
val gitHash = org.matrix.rustcomponents.sdk.crypto.versionInfo().gitSha
190-
val vodozemac = org.matrix.rustcomponents.sdk.crypto.vodozemacVersion()
191-
return if (longFormat) "Rust SDK $version ($gitHash), Vodozemac $vodozemac" else version
192-
}
193-
194186
override suspend fun getMyCryptoDevice(): CryptoDeviceInfo = withContext(coroutineDispatchers.io) {
195187
olmMachine.ownDevice()
196188
}

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/CryptoInfoMapper.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,10 @@ package org.matrix.android.sdk.internal.crypto.model
1818
import org.matrix.android.sdk.api.session.crypto.crosssigning.CryptoCrossSigningKey
1919
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
2020
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceKeys
21-
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceKeysWithUnsigned
2221
import org.matrix.android.sdk.internal.crypto.model.rest.RestKeyInfo
2322

2423
internal object CryptoInfoMapper {
2524

26-
fun map(deviceKeysWithUnsigned: DeviceKeysWithUnsigned): CryptoDeviceInfo {
27-
return CryptoDeviceInfo(
28-
deviceId = deviceKeysWithUnsigned.deviceId,
29-
userId = deviceKeysWithUnsigned.userId,
30-
algorithms = deviceKeysWithUnsigned.algorithms,
31-
keys = deviceKeysWithUnsigned.keys,
32-
signatures = deviceKeysWithUnsigned.signatures,
33-
unsigned = deviceKeysWithUnsigned.unsigned,
34-
trustLevel = null
35-
)
36-
}
37-
3825
fun map(cryptoDeviceInfo: CryptoDeviceInfo): DeviceKeys {
3926
return DeviceKeys(
4027
deviceId = cryptoDeviceInfo.deviceId,

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/DeviceKeysWithUnsigned.kt

Lines changed: 0 additions & 62 deletions
This file was deleted.

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/KeysQueryResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal data class KeysQueryResponse(
3434
* For each device, the information returned will be the same as uploaded via /keys/upload, with the addition of an unsigned property.
3535
*/
3636
@Json(name = "device_keys")
37-
val deviceKeys: Map<String, Map<String, DeviceKeysWithUnsigned>>? = null,
37+
val deviceKeys: Map<String, Map<String, Map<String, Any>>>? = null,
3838

3939
/**
4040
* If any remote homeservers could not be reached, they are recorded here. The names of the

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/DownloadKeysForUsersTask.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import kotlinx.coroutines.joinAll
2222
import kotlinx.coroutines.sync.Mutex
2323
import kotlinx.coroutines.sync.withLock
2424
import org.matrix.android.sdk.internal.crypto.api.CryptoApi
25-
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceKeysWithUnsigned
2625
import org.matrix.android.sdk.internal.crypto.model.rest.KeysQueryBody
2726
import org.matrix.android.sdk.internal.crypto.model.rest.KeysQueryResponse
2827
import org.matrix.android.sdk.internal.crypto.model.rest.RestKeyInfo
@@ -52,7 +51,7 @@ internal class DefaultDownloadKeysForUsers @Inject constructor(
5251

5352
return if (bestChunkSize.shouldChunk()) {
5453
// Store server results in these mutable maps
55-
val deviceKeys = mutableMapOf<String, Map<String, DeviceKeysWithUnsigned>>()
54+
val deviceKeys = mutableMapOf<String, Map<String, Map<String, Any>>>()
5655
val failures = mutableMapOf<String, Map<String, Any>>()
5756
val masterKeys = mutableMapOf<String, RestKeyInfo?>()
5857
val selfSigningKeys = mutableMapOf<String, RestKeyInfo?>()

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/pills/TextPillsUtils.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import android.text.SpannableString
1919
import org.matrix.android.sdk.api.session.permalinks.PermalinkService
2020
import org.matrix.android.sdk.api.session.room.send.MatrixItemSpan
2121
import org.matrix.android.sdk.api.util.MatrixItem
22-
import org.matrix.android.sdk.internal.session.displayname.DisplayNameResolver
2322
import java.util.Collections
2423
import javax.inject.Inject
2524

@@ -29,7 +28,6 @@ import javax.inject.Inject
2928
*/
3029
internal class TextPillsUtils @Inject constructor(
3130
private val mentionLinkSpecComparator: MentionLinkSpecComparator,
32-
private val displayNameResolver: DisplayNameResolver,
3331
private val permalinkService: PermalinkService
3432
) {
3533

@@ -70,7 +68,7 @@ internal class TextPillsUtils @Inject constructor(
7068
// append text before pill
7169
append(text, currIndex, start)
7270
// append the pill
73-
append(String.format(template, urlSpan.matrixItem.id, displayNameResolver.getBestName(urlSpan.matrixItem)))
71+
append(String.format(template, urlSpan.matrixItem.id, urlSpan.matrixItem.id))
7472
currIndex = end
7573
}
7674
// append text after the last pill
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright 2022 The Matrix.org Foundation C.I.C.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.matrix.android.sdk.internal.crypto
18+
19+
import org.amshove.kluent.internal.assertEquals
20+
import org.junit.Test
21+
import org.matrix.android.sdk.internal.crypto.model.rest.KeysQueryResponse
22+
import org.matrix.android.sdk.internal.di.MoshiProvider
23+
24+
class KeysQueryResponseTest {
25+
26+
private val moshi = MoshiProvider.providesMoshi()
27+
private val keysQueryResponseAdapter = moshi.adapter(KeysQueryResponse::class.java)
28+
29+
private fun aKwysQueryResponseWithDehydrated(): KeysQueryResponse {
30+
val rawResponseWithDehydratedDevice = """
31+
{
32+
"device_keys": {
33+
"@dehydration2:localhost": {
34+
"TDHZGMDVNO": {
35+
"algorithms": [
36+
"m.olm.v1.curve25519-aes-sha2",
37+
"m.megolm.v1.aes-sha2"
38+
],
39+
"device_id": "TDHZGMDVNO",
40+
"keys": {
41+
"curve25519:TDHZGMDVNO": "ClMOrHlQJqaqr4oESYyPURwD4BSQxMlEZZk/AnYxVSk",
42+
"ed25519:TDHZGMDVNO": "5iZ4zfk0URyIH8YOIWnXmJo41Vn34IixGYphkMdDzik"
43+
},
44+
"signatures": {
45+
"@dehydration2:localhost": {
46+
"ed25519:TDHZGMDVNO": "O6VP+ELiCVAJGHaRdReKga0LGMQahjRnp4znZH7iJO6maZV8aSXnpugSoVsSPRvQ4GBkjX+KXAXU+ODZ0J8MDg",
47+
"ed25519:YZ0EmlbDX+t/m/MB5EWkQLw8cEDg7hX4Zy9699h3hd8": "lG3idYliFGOAe4F/7tENIQ6qI0d41VQKY34BHyVvvWKbv63zDDO5kBTwBeXfUSEeRqyxET3SXLXfB1D8E8LUDg"
48+
}
49+
},
50+
"user_id": "@dehydration2:localhost",
51+
"unsigned": {
52+
"device_display_name": "localhost:8080: Chrome on macOS"
53+
}
54+
},
55+
"Y2gISVBZ024gKKAe6Xos44cDbNlO/49YjaOyiqFwjyQ": {
56+
"algorithms": [
57+
"m.olm.v1.curve25519-aes-sha2",
58+
"m.megolm.v1.aes-sha2"
59+
],
60+
"dehydrated": true,
61+
"device_id": "Y2gISVBZ024gKKAe6Xos44cDbNlO/49YjaOyiqFwjyQ",
62+
"keys": {
63+
"curve25519:Y2gISVBZ024gKKAe6Xos44cDbNlO/49YjaOyiqFwjyQ": "Y2gISVBZ024gKKAe6Xos44cDbNlO/49YjaOyiqFwjyQ",
64+
"ed25519:Y2gISVBZ024gKKAe6Xos44cDbNlO/49YjaOyiqFwjyQ": "sVY5Xq13sIdhC4We/p5CH69++GsIWRNUhHijtucBirs"
65+
},
66+
"signatures": {
67+
"@dehydration2:localhost": {
68+
"ed25519:Y2gISVBZ024gKKAe6Xos44cDbNlO/49YjaOyiqFwjyQ": "e2aVrdnD/kor2T0Ok/4SC32MW4WB5JXFSd2wnXV8apxFJBfbdZErANiUbo1Zz/HAasaXM5NBfkr/9gVTdph9BQ",
69+
"ed25519:YZ0EmlbDX+t/m/MB5EWkQLw8cEDg7hX4Zy9699h3hd8": "rVzeE1LbB12XOlckxjRLjt3eq2jVlek6OJ4p08+8g8CMoiJDcw1OVzbJuG/8u6ryarxQF6Yqr4Xu2TqCPBmHDw"
70+
}
71+
},
72+
"user_id": "@dehydration2:localhost",
73+
"unsigned": {
74+
"device_display_name": "Dehydrated device"
75+
}
76+
}
77+
}
78+
}
79+
}
80+
""".trimIndent()
81+
82+
return keysQueryResponseAdapter.fromJson(rawResponseWithDehydratedDevice)!!
83+
}
84+
85+
@Test
86+
fun `Should parse correctly devices with new dehydrated field`() {
87+
val aKeysQueryResponse = aKwysQueryResponseWithDehydrated()
88+
89+
val pojoToJson = keysQueryResponseAdapter.toJson(aKeysQueryResponse)
90+
91+
val rawAdapter = moshi.adapter(Map::class.java)
92+
93+
val rawJson = rawAdapter.fromJson(pojoToJson)!!
94+
95+
val deviceKeys = (rawJson["device_keys"] as Map<*, *>)["@dehydration2:localhost"] as Map<*, *>
96+
97+
assertEquals(deviceKeys.keys.size, 2)
98+
99+
val dehydratedDevice = deviceKeys["Y2gISVBZ024gKKAe6Xos44cDbNlO/49YjaOyiqFwjyQ"] as Map<*, *>
100+
101+
assertEquals(dehydratedDevice["dehydrated"] as? Boolean, true)
102+
}
103+
}

tools/release/releaseScript.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if [ ${envError} == 1 ]; then
6666
exit 1
6767
fi
6868

69-
buildToolsVersion="30.0.2"
69+
buildToolsVersion="35.0.0"
7070
buildToolsPath="${androidHome}/build-tools/${buildToolsVersion}"
7171

7272
if [[ ! -d ${buildToolsPath} ]]; then

vector-app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ext.versionMinor = 6
3737
// Note: even values are reserved for regular release, odd values for hotfix release.
3838
// When creating a hotfix, you should decrease the value, since the current value
3939
// is the value for the next regular release.
40-
ext.versionPatch = 16
40+
ext.versionPatch = 18
4141

4242
static def getGitTimestamp() {
4343
def cmd = 'git show -s --format=%ct'

0 commit comments

Comments
 (0)