Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase against Element Android v1.6.16 #1061

Merged
merged 35 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
af59f65
adding android 12 url deeplink support
ouchadam Jun 1, 2022
4e068a1
capture all element subdomains, means we can verify on the parent ins…
ouchadam Sep 13, 2022
423b921
Store the `formattedText` to the draft, to be able to restore the for…
bmarty Jan 31, 2024
6a30a2e
Keep the current message formatting when switching between composer m…
bmarty Jan 31, 2024
054af4d
changelog
bmarty Jan 31, 2024
a17c75a
Remove unused import
bmarty Jan 31, 2024
6e1b346
Add dependency on `com.github.matrix-org:matrix-analytics-events` and…
bmarty Mar 27, 2024
e337be2
Sync Emojis
bmarty Apr 1, 2024
479cb1a
Merge tag 'v1.6.14' into develop
bmarty Apr 2, 2024
c2b46a1
version++
bmarty Apr 2, 2024
6cd9e6e
When reporting a user, use the membership state eventId for the eventId.
bmarty Apr 2, 2024
9b4394b
Merge pull request #8798 from element-hq/feature/bma/reportUserStateE…
bmarty Apr 2, 2024
5ccc486
Merge pull request #8795 from element-hq/sync-emojis
bmarty Apr 2, 2024
0a284bb
Analyics: stop double reporting posthog utds
BillCarsonFr Apr 4, 2024
a1823b0
Merge pull request #8801 from element-hq/feature/bca/stop_double_repo…
BillCarsonFr Apr 5, 2024
33d09ec
fix: update local file access permission
yostyle Apr 18, 2024
305372c
Merge pull request #6225 from element-hq/feature/adm/android-12-deepl…
bmarty May 2, 2024
a8a9c61
Add note about MSC3886, MSC3903 and MSC3906 being closed
hughns May 3, 2024
443db6c
Bump posthog version to 3.2.0
BillCarsonFr May 6, 2024
69bb98f
Add change log
BillCarsonFr May 6, 2024
d100b62
Fix posthog tests
BillCarsonFr May 6, 2024
2362fcd
TODO must not be followed by `:`
bmarty May 16, 2024
0e94a49
Merge pull request #8810 from yostyle/yostyle/fix_file_permission
bmarty May 16, 2024
085bf82
Merge pull request #8817 from element-hq/hughns/qr-mscs-closed
bmarty May 16, 2024
f9a8451
Merge pull request #8790 from element-hq/feature/bma/externalAnalytic…
bmarty May 16, 2024
4acbe4e
Merge pull request #8820 from element-hq/feature/bca/bump_posthog_ver…
bmarty May 16, 2024
5ac70da
Bump rust sdk crypto to 0.4.1
BillCarsonFr May 27, 2024
0bf3350
Add change log
BillCarsonFr May 27, 2024
2395d72
Fix regression on send button visibility.
bmarty May 27, 2024
204244b
Merge pull request #8838 from element-hq/feature/bca/bump_crypto_sdk_…
bmarty May 28, 2024
22f69ec
Merge pull request #8743 from element-hq/feature/bma/editorIssue
ganfra May 28, 2024
018f494
Changelog for version 1.6.16
ganfra May 29, 2024
10d89f2
Adding fastlane file for version 1.6.16
ganfra May 29, 2024
e3a8781
Merge branch 'release/1.6.16' into main
ganfra May 29, 2024
861500f
Merge tag 'v1.6.16' into rebase/element-android-1.6.16
yostyle Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/sync-from-external-sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,3 @@ jobs:
- Update SAS Strings from matrix-doc.
branch: sync-sas-strings
base: develop

sync-analytics-plan:
runs-on: ubuntu-latest
# Skip in forks
if: github.repository == 'element-hq/element-android'
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v3
- name: Run analytics import script
run: ./tools/import_analytic_plan.sh
- name: Create Pull Request for analytics plan
uses: peter-evans/create-pull-request@v5
with:
commit-message: Sync analytics plan
title: Sync analytics plan
body: |
### Update analytics plan
Reviewers:
- [ ] Please remove usage of Event or Enum which may have been removed or updated
- [ ] please ensure new Events or new Enums are used to send analytics by pushing new commit(s) to this PR.
*Note*: Change are coming from [this project](https://github.com/matrix-org/matrix-analytics-events)
branch: sync-analytics-plan
base: develop
15 changes: 15 additions & 0 deletions ELEMENT_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Changes in Element v1.6.16 (2024-05-29)
=======================================

Bugfixes 🐛
----------
- Fix crash when accessing a local file and permission is revoked. ([#3616](https://github.com/element-hq/element-android/issues/3616))
- Fixes Element on Android 12+ being ineligible for URL deeplinks ([#5748](https://github.com/element-hq/element-android/issues/5748))
- Restore formatting when restoring a draft. Also keep formatting when switching composer mode. ([#7466](https://github.com/element-hq/element-android/issues/7466))

Other changes
-------------
- Update posthog sdk to 3.2.0 ([#8820](https://github.com/element-hq/element-android/issues/8820))
- Update Rust crypto SDK to version 0.4.1 ([#8838](https://github.com/element-hq/element-android/issues/8838))


Changes in Element v1.6.14 (2024-04-02)
=======================================

Expand Down
1 change: 1 addition & 0 deletions changelog.d/1060.improvements
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rebase against Element-Android v1.6.16
3 changes: 2 additions & 1 deletion dependencies_groups.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ext.groups = [
'com.github.hyuwah',
'com.github.jetradarmobile',
'com.github.MatrixFrog',
'com.github.matrix-org',
'com.github.tapadoo',
'com.github.UnifiedPush',
'com.github.yalantis',
Expand Down Expand Up @@ -120,7 +121,7 @@ ext.groups = [
'com.parse.bolts',
'com.pinterest',
'com.pinterest.ktlint',
'com.posthog.android',
'com.posthog',
'com.squareup',
'com.squareup.curtains',
'com.squareup.duktape',
Expand Down
2 changes: 1 addition & 1 deletion docs/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We ask for the user to give consent before sending any analytics data.

The analytics plan is shared between all Element clients. To add an Event, please open a PR to this project: https://github.com/matrix-org/matrix-analytics-events

Then, once the PR has been merged, you can run the tool `import_analytic_plan.sh` to import the plan to Element, and then you can use the new Event. Note that this tool is run by Github action once a week.
Then, once the PR has been merged, and the library is release, you can update the version of the library in the `build.gradle` file.

## Forks of Element

Expand Down
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/40106160.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Main changes in this version: Bug fixes.
Full changelog: https://github.com/element-hq/element-android/releases
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class AudioPicker : Picker<MultiPickerAudioType>() {
* Returns selected audio files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerAudioType> {
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
selectedUri.toMultiPickerAudioType(context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class FilePicker : Picker<MultiPickerBaseType>() {
* Returns selected files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseType> {
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
val type = context.contentResolver.getType(selectedUri)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class ImagePicker : Picker<MultiPickerImageType>() {
* Returns selected image files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerImageType> {
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
selectedUri.toMultiPickerImageType(context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class MediaPicker : Picker<MultiPickerBaseMediaType>() {
* Returns selected image/video files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseMediaType> {
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
val mimeType = context.contentResolver.getType(selectedUri)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ abstract class Picker<T> {
uriList.forEach {
for (resolveInfo in resInfoList) {
val packageName: String = resolveInfo.activityInfo.packageName
// TCHAP Replace implicit intent by an explicit to fix crash on some devices like Xiaomi.

// Replace implicit intent by an explicit to fix crash on some devices like Xiaomi.
// see https://juejin.cn/post/7031736325422186510
try {
context.grantUriPermission(packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION)
} catch (e: Exception) {
Expand Down Expand Up @@ -113,8 +115,6 @@ abstract class Picker<T> {
}
}
}
// TCHAP Grant permission to access the selected file.
val packageName = context.applicationContext.packageName
return selectedUriList.onEach { context.grantUriPermission(packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION) }
return selectedUriList.onEach { context.grantUriPermission(context.applicationContext.packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class VideoPicker : Picker<MultiPickerVideoType>() {
* Returns selected video files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerVideoType> {
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
selectedUri.toMultiPickerVideoType(context)
}
Expand Down
4 changes: 2 additions & 2 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ android {
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'

buildConfigField "String", "SDK_VERSION", "\"1.6.14\""
buildConfigField "String", "SDK_VERSION", "\"1.6.16\""

buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\""
Expand Down Expand Up @@ -216,7 +216,7 @@ dependencies {

implementation libs.google.phonenumber

implementation("org.matrix.rustcomponents:crypto-android:0.3.16")
implementation("org.matrix.rustcomponents:crypto-android:0.4.1")
// api project(":library:rustCrypto")

testImplementation libs.tests.junit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ import org.matrix.android.sdk.api.session.crypto.crosssigning.DeviceTrustLevel
import org.matrix.android.sdk.api.util.MatrixJsonParser
import timber.log.Timber

// n.b MSC3886/MSC3903/MSC3906 that this is based on are now closed.
// However, we want to keep this implementation around for some time.
// TODO define an end-of-life date for this implementation.

/**
* Implementation of MSC3906 to sign in + E2EE set up using a QR code.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import org.matrix.android.sdk.internal.crypto.verification.SasVerification
import org.matrix.android.sdk.internal.crypto.verification.VerificationRequest
import org.matrix.android.sdk.internal.crypto.verification.prepareMethods
import org.matrix.rustcomponents.sdk.crypto.CryptoStoreException
import org.matrix.rustcomponents.sdk.crypto.LocalTrust
import org.matrix.rustcomponents.sdk.crypto.SignatureException
import uniffi.matrix_sdk_crypto.LocalTrust
import org.matrix.rustcomponents.sdk.crypto.Device as InnerDevice

/** Class representing a device that supports E2EE in the Matrix world
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ import org.matrix.rustcomponents.sdk.crypto.DeviceLists
import org.matrix.rustcomponents.sdk.crypto.EncryptionSettings
import org.matrix.rustcomponents.sdk.crypto.KeyRequestPair
import org.matrix.rustcomponents.sdk.crypto.KeysImportResult
import org.matrix.rustcomponents.sdk.crypto.LocalTrust
import org.matrix.rustcomponents.sdk.crypto.Logger
import org.matrix.rustcomponents.sdk.crypto.MegolmV1BackupKey
import org.matrix.rustcomponents.sdk.crypto.Request
Expand All @@ -86,6 +85,7 @@ import org.matrix.rustcomponents.sdk.crypto.ShieldState
import org.matrix.rustcomponents.sdk.crypto.SignatureVerification
import org.matrix.rustcomponents.sdk.crypto.setLogger
import timber.log.Timber
import uniffi.matrix_sdk_crypto.LocalTrust
import java.io.File
import java.nio.charset.Charset
import javax.inject.Inject
Expand Down Expand Up @@ -828,8 +828,14 @@ internal class OlmMachine @Inject constructor(
val requests = withContext(coroutineDispatchers.io) {
inner.bootstrapCrossSigning()
}
(requests.uploadKeysRequest)?.let {
when (it) {
is Request.KeysUpload -> requestSender.uploadKeys(it)
else -> {}
}
}
requestSender.uploadCrossSigningKeys(requests.uploadSigningKeysRequest, uiaInterceptor)
requestSender.sendSignatureUpload(requests.signatureRequest)
requestSender.sendSignatureUpload(requests.uploadSignatureRequest)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ import org.matrix.android.sdk.internal.util.JsonCanonicalizer
import org.matrix.olm.OlmException
import org.matrix.rustcomponents.sdk.crypto.Request
import org.matrix.rustcomponents.sdk.crypto.RequestType
import org.matrix.rustcomponents.sdk.crypto.SignatureState
import org.matrix.rustcomponents.sdk.crypto.SignatureVerification
import timber.log.Timber
import uniffi.matrix_sdk_crypto.SignatureState
import java.security.InvalidParameterException
import javax.inject.Inject
import kotlin.random.Random
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fun RealmToMigrate.getPickledAccount(pickleKey: ByteArray): MigrationData {
)
MigrationData(
account = pickledAccount,
pickleKey = pickleKey.map { it.toUByte() },
pickleKey = pickleKey,
crossSigning = CrossSigningKeyExport(
masterKey = masterKey,
selfSigningKey = selfSignedKey,
Expand Down Expand Up @@ -153,7 +153,7 @@ fun RealmToMigrate.getPickledAccount(pickleKey: ByteArray): MigrationData {

migrationData = MigrationData(
account = pickledAccount,
pickleKey = pickleKey.map { it.toUByte() },
pickleKey = pickleKey,
crossSigning = CrossSigningKeyExport(
masterKey = masterKey,
selfSigningKey = selfSignedKey,
Expand Down Expand Up @@ -222,8 +222,10 @@ fun RealmToMigrate.pickledOlmSessions(pickleKey: ByteArray, chunkSize: Int, onCh
pickle = pickle,
senderKey = deviceKey,
createdUsingFallbackKey = false,
creationTime = lastReceivedMessageTs.toString(),
lastUseTime = lastReceivedMessageTs.toString()
// / Unix timestamp (in seconds) when the session was created.
creationTime = (lastReceivedMessageTs / 1000).toULong(),
// / Unix timestamp (in seconds) when the session was last used.
lastUseTime = (lastReceivedMessageTs / 1000).toULong(),
)
// should we check the tracking status?
pickledSessions.add(pickledSession)
Expand Down Expand Up @@ -323,8 +325,10 @@ private fun OlmSessionEntity.toPickledSession(pickleKey: ByteArray): PickledSess
pickle = pickledOlmSession,
senderKey = deviceKey,
createdUsingFallbackKey = false,
creationTime = lastReceivedMessageTs.toString(),
lastUseTime = lastReceivedMessageTs.toString()
// Rust expect in seconds
creationTime = (lastReceivedMessageTs / 1000).toULong(),
// Rust expect in seconds
lastUseTime = (lastReceivedMessageTs / 1000).toULong(),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
.also {
Timber.e("## Send: Work cancelled by user")

// TCHAP Revoke read permission to the local file.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.revokeUriPermission(context.packageName, params.attachment.queryUri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
} else {
Expand Down Expand Up @@ -408,7 +407,6 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
return Result.success(WorkerParamsFactory.toData(sendParams)).also {
Timber.v("## handleSuccess $attachmentUrl, work is stopped $isStopped")

// TCHAP Revoke read permission to the local file.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.revokeUriPermission(context.packageName, params.attachment.queryUri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
} else {
Expand Down
Loading
Loading