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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
457 commits
Select commit Hold shift + click to select a range
24dc52e
Use ImportKeysResult to notify sessions listeners
BillCarsonFr Nov 29, 2021
8bb2f05
ktlint clean
BillCarsonFr Nov 29, 2021
71cc38f
rust: Bump the rust-sdk version
poljar Nov 30, 2021
2e71f38
quick log improvents
BillCarsonFr Nov 30, 2021
dc9f6b8
Remove unneeded lax check
BillCarsonFr Nov 30, 2021
59b2cfa
Removed useless code
BillCarsonFr Nov 30, 2021
14f974f
Delete old key backup code
BillCarsonFr Dec 1, 2021
5109f10
Merge branch 'bca/rust_4s_verify_pass' into rust
poljar Dec 1, 2021
ee017b7
rust: Bump the sdk version
poljar Dec 9, 2021
a194213
rust: Add the string that failed to be parsed as an user id to the error
poljar Feb 8, 2022
b8637dd
Merge branch 'develop' of https://github.com/vector-im/element-androi…
Mar 3, 2022
2f16a2e
Clean up some code
Mar 4, 2022
dc4569d
Remove warnings as error for now
Mar 4, 2022
7436647
Merge pull request #4 from poljar/rust_upstream_develop
ganfra Mar 10, 2022
e121007
Remove rust dependencies and use published aar
Mar 28, 2022
0590258
Suspend API: handle verification service
Mar 29, 2022
046699b
Suspend API: handle cross signing service
Mar 30, 2022
950c7f4
Fix verification not working
Apr 1, 2022
9c6fcca
Suspend API: continue moving verifications
Apr 1, 2022
ed84e38
Suspend api: continue moving away from callback
Apr 6, 2022
91daa1a
Suspend: continue cleaning
Apr 14, 2022
d020d1f
Use MatrixCoroutineDispatchers in OlmMachine
Apr 14, 2022
ba540eb
Continue removing runBlocking + some cleanup
Apr 15, 2022
9cb43ce
Continue cleaning mostly on coroutine
Apr 15, 2022
48793f5
Start fixing crypto tests compilation
Apr 15, 2022
39755b0
Continue cleaning up code and fix some verification code
Apr 21, 2022
5581b82
Let rust encrypt method handle unencrypted content ( like relates_to)
Apr 22, 2022
309a290
Suspend: fix flow builders
Apr 25, 2022
8bd094f
Do some cleanup on verification APIs
Apr 25, 2022
859d474
Add local lib in case maven is broken
May 5, 2022
69ede52
Update rust-crypto library
May 5, 2022
b4bc56f
Continue cleaning up/adding suspend
May 6, 2022
4e6bed8
Introduce ExtractMigrationDataUseCase
May 6, 2022
ff17941
Make it compile with latest rust lib
May 6, 2022
ae67e51
Add RustCryptoStoreMigrateUseCase
May 6, 2022
43f5fa9
Update olm to 3.2.11
May 10, 2022
4be5010
Temporary commenting other tests to make compile
May 10, 2022
f9f8854
Introduce TemporaryRealmConfigurationFactory rule
May 10, 2022
8873378
Add tests for extracting and migrate data
May 10, 2022
a2b3839
Rust Migration: use realm migration mechanism
May 11, 2022
677c879
Fix some code quality
May 12, 2022
559404f
Merge pull request #7 from poljar/feature/fga/suspend_api
ganfra May 12, 2022
725e56d
Merge branch 'develop' of https://github.com/vector-im/element-androi…
May 12, 2022
7e49bad
Try to clean up after merging upstream develop
May 13, 2022
a559eba
Some more cleanup
May 13, 2022
f559db6
Fix tests compilation
May 18, 2022
42e5dcd
Use release version 0.1.0 of crypto rust component
May 18, 2022
21ef138
Add more logs on verif
May 20, 2022
a6bc730
Merge pull request #8 from poljar/feature/fga/rust_upstream_develop
ganfra May 20, 2022
58a1c80
Fix crash on on crypto store open/close
May 20, 2022
1809d02
Temporary fix tests (wait for rust)
May 25, 2022
b57dfee
Rename RequestProcessor
May 25, 2022
7c76ba8
Create BackupRecoveryKey wrapper class (to avoid directly expose unif…
May 25, 2022
b0aae84
Use BackupRecoveryKey instead of plain string
May 25, 2022
466260b
Fix one test and ignore another one
May 30, 2022
3e116ad
Add RequestDeviceVerification method
May 30, 2022
c253f6b
Clean more code
May 31, 2022
797dc9c
Crypto: fix tracking onRoomMembershipEvent
Jun 2, 2022
47bc597
OKHttp: rise maxRequestsPerHost to 64 (instead of default 5)
Jun 2, 2022
eb0faa3
Fix some E2E tests
Jun 2, 2022
022057d
Merge pull request #10 from poljar/feature/fga/backup_recovery_key
ganfra Jun 2, 2022
14ed469
Merge branch 'rust' into feature/fga/device_verification
ganfra Jun 2, 2022
e519561
Merge pull request #9 from poljar/feature/fga/device_verification
ganfra Jun 2, 2022
c1961d1
DeviceId should be non-null so we can inject it properly and OlmMachi…
Jun 6, 2022
7057883
Fix some more E2EE tests
Jun 6, 2022
327ac2e
Ignore some failing tests because because using incompatible or unava…
Jun 6, 2022
abee136
Ktlint and format
Jun 6, 2022
b6d73d8
Use backup key directly on olmMachine.
Jun 7, 2022
6dda30e
Merge pull request #11 from poljar/fga/more_fixing_cleaning
ganfra Jun 8, 2022
52ed7c0
Merge pull request #12 from poljar/fga/feature/finish_backup_recovery…
ganfra Jun 8, 2022
e5ce77d
Use retry through executeRequest instead of Task.executeRetry
Jun 9, 2022
87c1d69
Cancel verification flow if request sending fails (after retry)
Jun 9, 2022
c0f3f39
Format ktlint
Jun 9, 2022
bda0314
Merge pull request #13 from poljar/fga/feature/handle_request_failing
ganfra Jun 13, 2022
ae02eb1
Prepare flavors
BillCarsonFr Oct 7, 2022
cf366f7
suspend verif WIP
BillCarsonFr Nov 16, 2022
5c82bdb
happy path qr kotlin verif
BillCarsonFr Nov 17, 2022
0c1e439
Actor unit test setup
BillCarsonFr Nov 18, 2022
bed2c22
Fix QR code not always displayed
BillCarsonFr Nov 19, 2022
4ce6a25
refactor for easy unit tests
BillCarsonFr Nov 21, 2022
5b3e3a7
Fix sas match action
BillCarsonFr Nov 21, 2022
d302fdc
self verification basics
BillCarsonFr Nov 23, 2022
2f3bbab
Fix no deleted device warning on long press menu
BillCarsonFr Nov 25, 2022
d934270
update rust-sdk bindings
BillCarsonFr Nov 28, 2022
fb1995e
only check moshi numbers for rust-sdk
BillCarsonFr Nov 29, 2022
f8d6511
rust sas state mapping
BillCarsonFr Nov 29, 2022
bb16d77
fix QR verification
BillCarsonFr Nov 29, 2022
a9b9708
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Nov 30, 2022
501625c
post rebase fix rust flavor
BillCarsonFr Nov 30, 2022
dd991e7
update workflow
BillCarsonFr Nov 30, 2022
b3d8b15
cleaning
BillCarsonFr Nov 30, 2022
6e371b7
code quality
BillCarsonFr Nov 30, 2022
9fbc0cd
fix compilation
BillCarsonFr Nov 30, 2022
304989f
Fix copyrights
BillCarsonFr Nov 30, 2022
43421e3
update doc
BillCarsonFr Nov 30, 2022
a110c9e
fix moshi number parsing for rust
BillCarsonFr Dec 1, 2022
b0168dc
fix compilation rust
BillCarsonFr Dec 1, 2022
17b8d3c
fix unhandled exceptions and cleaning
BillCarsonFr Dec 2, 2022
e6444fe
enable analytics by default on nightly
BillCarsonFr Dec 2, 2022
cb4720f
CI update for ER
BillCarsonFr Dec 2, 2022
b9045eb
ktlint
BillCarsonFr Dec 2, 2022
2ae4b87
fix CI
BillCarsonFr Dec 2, 2022
ae9711b
Basic sentry e2e reporting for rust + decrypt trust
BillCarsonFr Dec 2, 2022
03379a6
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 3, 2022
a20fd45
fix CI exodus/gplay
BillCarsonFr Dec 4, 2022
ea37029
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 4, 2022
c0614a9
fix CI concurrency
BillCarsonFr Dec 4, 2022
adacd55
Fix backup authdata serialization
BillCarsonFr Dec 5, 2022
0953bc9
Fix test compilation | rust / crypto missing api
BillCarsonFr Dec 5, 2022
cba3c27
Reduce room list placeholder lags
BillCarsonFr Dec 5, 2022
6965c0c
move app_name to xml res
BillCarsonFr Dec 6, 2022
17d25e2
Enable reset all and skip options (#7721)
amitkma Dec 7, 2022
d3ef5cc
Merge olm to Rust migration
BillCarsonFr Dec 8, 2022
14cee22
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 8, 2022
2bc0f6c
use lfs for rust aar lib
BillCarsonFr Dec 8, 2022
bfe6207
Fix crash when no ER migration needed
BillCarsonFr Dec 8, 2022
4766bc7
Fix: ER showing shields in clear rooms
BillCarsonFr Dec 8, 2022
438b456
quick incremental backup support
BillCarsonFr Dec 8, 2022
8c773b6
update crypto crate
BillCarsonFr Dec 12, 2022
c52be1f
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 12, 2022
9680b04
Fix test crash
BillCarsonFr Dec 13, 2022
3db82e6
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 13, 2022
d0807b9
Fix test compilation
BillCarsonFr Dec 13, 2022
f541be4
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 13, 2022
c3f439e
code quality
BillCarsonFr Dec 13, 2022
3abd68c
fix compilation warning
BillCarsonFr Dec 13, 2022
f1e8f84
fix test compilation
BillCarsonFr Dec 13, 2022
ee15623
FIx test compilation
BillCarsonFr Dec 13, 2022
8b7238e
fix CI
BillCarsonFr Dec 14, 2022
71d5610
Fix ui test compilation
BillCarsonFr Dec 14, 2022
8555b04
Fix CI missing key in map
BillCarsonFr Dec 14, 2022
b224a8d
Fix lock blocking sync loop
BillCarsonFr Dec 15, 2022
49239e6
fix ER migration
BillCarsonFr Dec 15, 2022
3efaa8e
Remove run blocking from realm tx
BillCarsonFr Dec 15, 2022
f07aa9f
Fix tests and better logs
BillCarsonFr Dec 15, 2022
3146f52
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 16, 2022
ca2d363
clean logs
BillCarsonFr Dec 16, 2022
2d388f3
ignore verification events from initial sync
BillCarsonFr Dec 16, 2022
7c888f6
tmp workaround for big account OOM
BillCarsonFr Dec 16, 2022
d337ccd
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 17, 2022
406dfaa
quick format
BillCarsonFr Dec 17, 2022
ee5dfba
fix kotlinCrypto flavor compilation
BillCarsonFr Dec 17, 2022
695a2b3
better feedback on verification request sent
BillCarsonFr Dec 20, 2022
76fa1bf
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Dec 26, 2022
54e8deb
cleaning and logs
BillCarsonFr Jan 3, 2023
fab0350
rust key safety integration
BillCarsonFr Jan 3, 2023
6952d17
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 3, 2023
8eda089
fix rebase
BillCarsonFr Jan 3, 2023
4196736
Added Self verification UI test
BillCarsonFr Jan 3, 2023
8606ac9
Fix verify with passphrase test
BillCarsonFr Jan 4, 2023
a217ec2
Handling incoming verification
BillCarsonFr Jan 9, 2023
3bae04c
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 9, 2023
13d3f4f
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 10, 2023
56b1b9d
configure encryption settings from state
BillCarsonFr Jan 10, 2023
02dc13e
Fix existing dm returning local room echo
BillCarsonFr Jan 10, 2023
3f29c55
Update verification signaling & handing
BillCarsonFr Jan 12, 2023
f330a00
fix copyright
BillCarsonFr Jan 12, 2023
c039787
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 12, 2023
607f375
fix cancel user verification
BillCarsonFr Jan 15, 2023
4ae93d5
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 15, 2023
1ab4a2f
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 18, 2023
f1d3eeb
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 19, 2023
f9ed8a4
verification state integration
BillCarsonFr Jan 19, 2023
4ee53ad
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 23, 2023
6b3d1f1
fix app locked on splash
BillCarsonFr Jan 25, 2023
29dee64
Migration for big accounts + update sdk
BillCarsonFr Jan 25, 2023
8b50fa3
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 25, 2023
e8064fa
fix error in merge
BillCarsonFr Jan 25, 2023
0e47a44
fix measure span
BillCarsonFr Jan 26, 2023
2a5768d
Encrypt rust database
BillCarsonFr Jan 27, 2023
8593f23
Better Ram mgmt and offload from main
BillCarsonFr Jan 27, 2023
992ec7f
cleaning
BillCarsonFr Jan 29, 2023
c4e03c5
refactor home room list
BillCarsonFr Jan 30, 2023
51b9603
rust fallback key support + stable ids
BillCarsonFr Jan 30, 2023
b1a3fb3
Fix flavor compilation
BillCarsonFr Jan 30, 2023
4dee5d2
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Jan 30, 2023
98f1c6d
Fix unverified popup for own device
BillCarsonFr Jan 31, 2023
b10a27d
Fix concat adapter stable Ids
BillCarsonFr Jan 31, 2023
1b4885c
rust SQL store
BillCarsonFr Jan 31, 2023
ebed319
fix new error reported from rust side
BillCarsonFr Feb 2, 2023
9d75a66
Mark verification state as dirty
BillCarsonFr Feb 2, 2023
d4fdf7e
strict mode report
BillCarsonFr Feb 2, 2023
508092e
fix crash on logout
BillCarsonFr Feb 2, 2023
07041d0
update rust crate
BillCarsonFr Feb 2, 2023
704e14c
Fix QR code signaling
BillCarsonFr Feb 2, 2023
82a7f29
disabled temporary analytics opt-in
BillCarsonFr Feb 3, 2023
2f1e282
Add some timing logs for encryption
BillCarsonFr Feb 3, 2023
6f859c9
Fix disable MSC3061 lab for rust crypto
BillCarsonFr Feb 3, 2023
e53fbaa
Fix false positive empty roomlist
BillCarsonFr Feb 3, 2023
76f856b
fix maybeBackup called for nothing
BillCarsonFr Feb 3, 2023
32aaf57
missing transiant field in copyAll
BillCarsonFr Feb 3, 2023
604c393
Flow collector causing strange NPE in some occasions
BillCarsonFr Feb 3, 2023
c0fb4e8
quality
BillCarsonFr Feb 6, 2023
fdd7023
fix CI warning
BillCarsonFr Feb 6, 2023
eea3dac
fix danger
BillCarsonFr Feb 6, 2023
b48e6f5
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Feb 6, 2023
1485ce3
CI with flavor
BillCarsonFr Feb 6, 2023
318a5a8
Fix test compilation
BillCarsonFr Feb 6, 2023
8b28e7b
quick cleaning
BillCarsonFr Feb 6, 2023
e1c3f1c
updated crypto crate
BillCarsonFr Feb 6, 2023
6edde6a
Ensure secureBackupRequired is enforced
BillCarsonFr Feb 7, 2023
a70e3c2
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Feb 7, 2023
6064cfd
Fix tests
BillCarsonFr Feb 7, 2023
2232839
fix test having timeouts
BillCarsonFr Feb 8, 2023
1e66f4f
Fix broken migration
BillCarsonFr Feb 23, 2023
5f185c5
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Mar 9, 2023
238d10d
Test integration of rust shield states
BillCarsonFr Mar 10, 2023
5f06926
Ignore some test in tust. Added some supports flags
BillCarsonFr Mar 14, 2023
065ee1d
cleaning
BillCarsonFr Mar 14, 2023
638442f
remove app_name from resource
BillCarsonFr Mar 14, 2023
c3bcdb1
unused resource
BillCarsonFr Mar 15, 2023
95b6c2a
unused resource
BillCarsonFr Mar 15, 2023
7ea7b4f
try fix CI
BillCarsonFr Mar 15, 2023
14d28a0
unused resource
BillCarsonFr Mar 15, 2023
9298d95
try fix lfs
BillCarsonFr Mar 16, 2023
0289571
CI
BillCarsonFr Mar 16, 2023
5409433
use maven deployed rust sdk
BillCarsonFr Mar 16, 2023
927f775
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Mar 28, 2023
bcc1ac4
rust-crypto 0.3.1 , wa to fix compilation
BillCarsonFr Mar 28, 2023
438b0a6
Fix unused resource
BillCarsonFr Mar 29, 2023
8f1bbd6
revert as kotlin crypto specific test
BillCarsonFr Mar 29, 2023
da4055f
UI tests are disabled on CI
BillCarsonFr Mar 29, 2023
33535a5
lint
BillCarsonFr Mar 29, 2023
b1f178a
missing corroded google-service
BillCarsonFr Mar 30, 2023
69b7efd
disable outdated no_olm test
BillCarsonFr Mar 30, 2023
507cd98
Fix E2EShareConfigTest
BillCarsonFr Mar 31, 2023
0cdd0a7
Fix testCantDecryptIfGlobalUnverified
BillCarsonFr Mar 31, 2023
8436900
Fix E2eeShareKeysHistoryTest
BillCarsonFr Mar 31, 2023
aab1afc
ignore deprecated test
BillCarsonFr Mar 31, 2023
b704b64
Fix backup tests
BillCarsonFr Apr 5, 2023
b45b90d
Fix verification bottomsheet not updating
BillCarsonFr Apr 5, 2023
d023d9d
fix sas test
BillCarsonFr Apr 5, 2023
a5a9599
test flakiness
BillCarsonFr Apr 5, 2023
1b57770
put back retry rule, flackiness
BillCarsonFr Apr 5, 2023
17c41fc
async backup throws now
BillCarsonFr Apr 5, 2023
3e1b59d
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Apr 6, 2023
2077d97
Fix test deadlock with await latch
BillCarsonFr Apr 6, 2023
ee1580c
Fix failing test
BillCarsonFr Apr 6, 2023
e554ecc
fix flackiness source
BillCarsonFr Apr 6, 2023
8926725
Fix use if internal API
BillCarsonFr Apr 6, 2023
1b12db9
Test framework cleaning
BillCarsonFr Apr 7, 2023
4ecbf87
unused flow
BillCarsonFr Apr 7, 2023
7050854
fix warning equals but no hashcode
BillCarsonFr Apr 7, 2023
26a6408
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Apr 11, 2023
0e50350
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Apr 13, 2023
ca8dc37
fix scope usage
BillCarsonFr Apr 14, 2023
4d9596b
do not launch in constructor
BillCarsonFr Apr 14, 2023
425cbc9
quick doc on flavors and migration
BillCarsonFr Apr 17, 2023
b2c7f05
Merge branch 'develop' into feature/bca/rust_flavor
BillCarsonFr Apr 20, 2023
8e6db17
Clean and update doc
BillCarsonFr Apr 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/snapshots/**/*.png filter=lfs diff=lfs merge=lfs -text
**/src/androidTest/assets/*.realm filter=lfs diff=lfs merge=lfs -text
**/matrix-rust-sdk-crypto.aar filter=lfs diff=lfs merge=lfs -text
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Assemble ${{ matrix.target }} debug apk
run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES
run: ./gradlew assemble${{ matrix.target }}KotlinCryptoDebug $CI_GRADLE_ARG_PROPERTIES
- name: Upload ${{ matrix.target }} debug APKs
uses: actions/upload-artifact@v3
with:
Expand All @@ -57,7 +57,7 @@ jobs:
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Assemble GPlay unsigned apk
run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES
run: ./gradlew clean assembleGplayKotlinCryptoRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload Gplay unsigned APKs
uses: actions/upload-artifact@v3
with:
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Execute exodus-standalone
uses: docker://exodusprivacy/exodus-standalone:latest
with:
args: /github/workspace/gplay/release/vector-gplay-universal-release-unsigned.apk -j -o /github/workspace/exodus.json
args: /github/workspace/gplayKotlinCrypto/release/vector-gplay-kotlinCrypto-universal-release-unsigned.apk -j -o /github/workspace/exodus.json
- name: Upload exodus json report
uses: actions/upload-artifact@v3
with:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/elementr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ER APK Build

on:
pull_request: { }
push:
branches: [ develop ]

# Enrich gradle.properties for CI/CD
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon

jobs:
debug:
name: Build debug APKs ER
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
strategy:
fail-fast: false
matrix:
target: [ Gplay, Fdroid ]
# Allow all jobs on develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/develop' && format('elementr-{0}-{1}', matrix.target, github.sha) || format('build-er-debug-{0}-{1}', matrix.target, github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Assemble ${{ matrix.target }} debug apk
run: ./gradlew assemble${{ matrix.target }}RustCryptoDebug $CI_GRADLE_ARG_PROPERTIES
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
yes n | towncrier build --version nightly
- name: Build and upload Gplay Nightly APK
run: |
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES
./gradlew assembleGplayKotlinCryptoNightly appDistributionUploadGplayKotlinCryptoNightly $CI_GRADLE_ARG_PROPERTIES
env:
ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }}
ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }}
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/nightly_er.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and release Element R nightly APK

on:
schedule:
# Every nights at 4
- cron: "0 4 * * *"

env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon

jobs:
nightly:
name: Build and publish ER nightly Gplay APK to Firebase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install towncrier
run: |
python3 -m pip install towncrier
- name: Prepare changelog file
run: |
mv towncrier.toml towncrier.toml.bak
sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml
rm towncrier.toml.bak
yes n | towncrier build --version nightly
- name: Build and upload Gplay Nightly ER APK
run: |
./gradlew assembleGplayRustCryptoNightly appDistributionUploadGplayRustCryptoNightly $CI_GRADLE_ARG_PROPERTIES
env:
ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }}
ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }}
ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD }}
FIREBASE_TOKEN: ${{ secrets.ELEMENT_R_NIGHTLY_FIREBASE_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ jobs:
- name: Run lint
# Not always, if ktlint or detekt fail, avoid running the long lint check.
run: |
./gradlew vector-app:lintGplayRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintFdroidRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintGplayKotlinCryptoRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintFdroidKotlinCryptoRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintGplayRustCryptoRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintFdroidRustCryptoRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload reports
if: always()
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
disable-animations: true
# emulator-build: 7425822
script: |
./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
./gradlew gatherGplayKotlinCryptoDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
/benchmark-out
/captures
.externalNativeBuild
rust-sdk/target/*
rust-sdk/src/uniffi/*
Cargo.lock

/tmp
/fastlane/private
Expand All @@ -24,3 +27,10 @@
/yarn.lock
/node_modules
**/out/failures

# For manual dependency to rust crypto sdk
matrix-sdk-android/src/main/jniLibs/

matrix-sdk-android/libs/crypto-android-release.aar

matrix-sdk-android/libs/matrix-rust-sdk-crypto.aar
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ allprojects {
groups.jcenter.group.each { includeGroup it }
}
}

maven {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots'
content {
groups.mavenSnapshots.regex.each { includeGroupByRegex it }
groups.mavenSnapshots.group.each { includeGroup it }
}
}

}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
Expand Down Expand Up @@ -314,7 +323,7 @@ tasks.register("recordScreenshots", GradleBuild) {

tasks.register("verifyScreenshots", GradleBuild) {
startParameter.projectProperties.screenshot = ""
tasks = [':vector:verifyPaparazziDebug']
tasks = [':vector:verifyPaparazziKotlinCryptoDebug']
}

ext.initScreenshotTests = { project ->
Expand Down
2 changes: 1 addition & 1 deletion coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ task unitTestsWithCoverage(type: GradleBuild) {
task instrumentationTestsWithCoverage(type: GradleBuild) {
startParameter.projectProperties.coverage = "true"
startParameter.projectProperties['android.testInstrumentationRunnerArguments.notPackage'] = 'im.vector.app.ui'
tasks = [':vector-app:connectedGplayDebugAndroidTest', ':vector:connectedDebugAndroidTest', 'matrix-sdk-android:connectedDebugAndroidTest']
tasks = [':vector-app:connectedGplayKotlinCryptoDebugAndroidTest', ':vector:connectedKotlinCryptoDebugAndroidTest', 'matrix-sdk-android:connectedKotlinCryptoDebugAndroidTest']
}
16 changes: 12 additions & 4 deletions dependencies_groups.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext.groups = [
jitpack : [
jitpack : [
regex: [
],
group: [
Expand All @@ -15,7 +15,7 @@ ext.groups = [
'com.github.Zhuinden',
]
],
jitsi : [
jitsi : [
regex: [
],
group: [
Expand All @@ -24,7 +24,7 @@ ext.groups = [
'org.webkit',
]
],
google : [
google : [
regex: [
'androidx\\..*',
'com\\.android\\.tools\\..*',
Expand All @@ -44,6 +44,13 @@ ext.groups = [
group: [
]
],
mavenSnapshots: [
regex: [
],
group: [
'org.matrix.rustcomponents'
]
],
mavenCentral: [
regex: [
],
Expand Down Expand Up @@ -204,6 +211,7 @@ ext.groups = [
'org.jvnet.staxex',
'org.maplibre.gl',
'org.matrix.android',
'org.matrix.rustcomponents',
'org.mockito',
'org.mongodb',
'org.objenesis',
Expand All @@ -223,7 +231,7 @@ ext.groups = [
'xml-apis',
]
],
jcenter : [
jcenter : [
regex: [
],
group: [
Expand Down
2 changes: 1 addition & 1 deletion docs/nightly_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mv towncrier.toml towncrier.toml.bak
sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml
rm towncrier.toml.bak
yes n | towncrier build --version nightly
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES
./gradlew assembleGplayKotlinCryptoNightly appDistributionUploadGplayKotlinCryptoNightly $CI_GRADLE_ARG_PROPERTIES
```

Then you can reset the change on the codebase.
63 changes: 63 additions & 0 deletions docs/rust_crypto_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## 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.

## 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`.

Copy this lib in `library/rustCrypto/`, and rename it `matrix-rust-sdk-crypto.aar`.

Then go to `matrix-sdk-android/build.gradle` and toggle the comments between the following lines.

````
rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.1")
// 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.

The migration 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.

20 changes: 20 additions & 0 deletions flavor.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
android {

flavorDimensions "crypto"

productFlavors {
kotlinCrypto {
dimension "crypto"
isDefault = true
// versionName "${versionMajor}.${versionMinor}.${versionPatch}${getFdroidVersionSuffix()}"
// buildConfigField "String", "SHORT_FLAVOR_DESCRIPTION", "\"JC\""
// buildConfigField "String", "FLAVOR_DESCRIPTION", "\"KotlinCrypto\""
}
rustCrypto {
dimension "crypto"
// // versionName "${versionMajor}.${versionMinor}.${versionPatch}${getFdroidVersionSuffix()}"
// buildConfigField "String", "SHORT_FLAVOR_DESCRIPTION", "\"RC\""
// buildConfigField "String", "FLAVOR_DESCRIPTION", "\"RustCrypto\""
}
}
}
2 changes: 2 additions & 0 deletions library/rustCrypto/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file('matrix-rust-sdk-crypto.aar'))
3 changes: 3 additions & 0 deletions library/rustCrypto/matrix-rust-sdk-crypto.aar
Git LFS file not shown