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

Merging Element R in Element Android as a new flavor #7628

Merged
merged 457 commits into from Apr 20, 2023

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Nov 23, 2022

Type of change

  • Technical

Content

Integration of the rust crypto crate in Element Android.
Currently it's a bit hard to extract a clean crypto-backend API that could be implemented in rust or kotlin.
As a first step and to avoid disruption on the kotlin side, the code is separated as different source sets

Task:

  • Create a new flavor dimension for rust vs kotlin

  • Suspendable Verification:

    • Make kotlin verification suspendable
      • SAS
      • QR
      • Handle concurrent start
      • (legacy) Allow start without request in to_device
      • Fix all existing tests
    • Backfill changes in Rust
    • UX
      • Clean User Verification
      • Clean Self Verification
  • Fix unit tests

  • Rust parity

    • Use m.room.encryption to configure encryption settings (rotationPeriod/rotationPeriodMsgs)
    • Key share on invite
    • Verification support
    • Sas
    • QR
    • get crypto version from sdk
    • Block unverified per room
    • Room key listener/ audit trail
    • Deprecate manual key request handling (check with forks?)
    • Key safety warnings
    • Cross signing key not signed by current device?
    • map key safety from decryption result
    • Query key backup before sending key request
  • Clear various debug/dev logs (VALR.., ##)

  • ...

Motivation and context

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

BillCarsonFr and others added 30 commits November 29, 2021 17:48
This updates the rust-sdk to support fallback keys, note that fallback
keys are not yet uploaded, they just can be used when downloaded and
info about the fallback keys coming from a sync can be passed to the
rust side.
If there's an invalid user id that gets passed to the Rust side we're
going to throw an error, this error doesn't tell us what is invalid nor
what the string contained.

Add the string that is being parsed to the error so that the log line
becomes actionable.
dependencies {
implementation libs.jetbrains.coroutinesCore
implementation libs.jetbrains.coroutinesAndroid


// implementation(name: 'crypto-android-release', ext: 'aar')
implementation 'net.java.dev.jna:jna:5.10.0@aar'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ A newer version of net.java.dev.jna:jna than 5.10.0 is available: 5.13.0
  • ⚠️ A newer version of net.java.dev.jna:jna than 5.10.0 is available: 5.13.0

@@ -121,6 +127,6 @@ internal class MegolmSessionDataImporter @Inject constructor(

Timber.tag(loggerTag.value).v("## importMegolmSessionsData : sessions import " + (t1 - t0) + " ms (" + megolmSessionsData.size + " sessions)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Replace String concatenation with Timber's string formatting
  • ⚠️ Replace String concatenation with Timber's string formatting

@@ -127,32 +125,34 @@ class DevicesViewModelTest {
}

@Test
@Ignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation

}

@Test
@Ignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation

@@ -107,36 +105,38 @@ class OtherSessionsViewModelTest {
}

@Test
@Ignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation

}

@Test
@Ignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation

}
}

@Test
@Ignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation
  • ⚠️ Test is ignored without giving any explanation

@sonarcloud
Copy link

sonarcloud bot commented Apr 20, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 4 Security Hotspots
Code Smell A 352 Code Smells

0.0% 0.0% Coverage
1.4% 1.4% Duplication

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, let's merge this big PR now that we have just issued a release.

@BillCarsonFr BillCarsonFr merged commit d4d9a10 into develop Apr 20, 2023
15 of 16 checks passed
@BillCarsonFr BillCarsonFr deleted the feature/bca/rust_flavor branch April 20, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants