1
0
mirror of https://github.com/vector-im/riotX-android synced 2025-10-06 00:02:48 +02:00

Compare commits

...

633 Commits

Author SHA1 Message Date
ganfra
35d98c2e1e Introduce start/onStart methods on ViewModel, when you want to delay observing db 2020-09-10 22:06:08 +02:00
Benoit Marty
b9e8d7187c Merge pull request #2075 from vector-im/feature/strict_mode_tracking
Feature/strict mode tracking
2020-09-10 13:46:44 +02:00
Onuray Sahin
926ff80525 Merge pull request #2086 from vector-im/feature/fix_event_read_elsewhere
Clear the notification when the event is read elsewhere
2020-09-10 13:24:57 +03:00
Onuray Sahin
0cba8f3aa1 Start background sync even if the eventId or roomId is null. 2020-09-10 12:08:05 +03:00
Benoit Marty
11fb2bcdfa ktlint... 2020-09-09 13:34:57 +02:00
Benoit Marty
94e43475e2 Merge pull request #2040 from vector-im/feature/date_formatting
Feature/date formatting
2020-09-09 12:16:18 +02:00
Benoit Marty
01a4905dc8 Changelog 2020-09-09 12:15:27 +02:00
Benoit Marty
8cb7260375 Small changes (PR review) 2020-09-09 12:10:46 +02:00
ganfra
dc04d2848d Default pref: make sure to use app context 2020-09-09 11:52:05 +02:00
ganfra
c2880a5832 Strict mode: add a build entry to enable whenever we want to check 2020-09-09 11:52:05 +02:00
ganfra
979c0832cf Use realmSessionProvider in localEchoRepository 2020-09-09 11:52:05 +02:00
ganfra
fa381cc06d Use a singleton for default shared pref 2020-09-09 11:45:47 +02:00
ganfra
f1d902b9ad Enable strict mode and remove some stuff from the main thread 2020-09-09 11:45:47 +02:00
Benoit Marty
b97d922808 ktlint 2020-09-09 11:33:22 +02:00
ganfra
18dcd6b9b1 Date format: add more comments and fix wrong format kind usage 2020-09-09 11:32:56 +02:00
ganfra
c6178e504f Clean files and update CHANGES 2020-09-09 11:32:56 +02:00
ganfra
0ff28c4f50 Date formatting: try to generalise usage of VectorDateFormatter and get proper formatting for Date + Time 2020-09-09 11:32:16 +02:00
ganfra
73ab32fd92 Start reworking date formatting 2020-09-09 11:32:16 +02:00
Benoit Marty
bf0b6d738a Version++ 2020-09-08 17:49:26 +02:00
Benoit Marty
83a06b9657 Merge branch 'release/1.0.6' into develop 2020-09-08 17:47:15 +02:00
Benoit Marty
9b5bd3e226 Prepare release 1.0.6 2020-09-08 17:47:03 +02:00
Benoit Marty
135fcab558 Merge pull request #2074 from vector-im/feature/cleanup
Cleanup and documentation after #2047
2020-09-08 17:39:02 +02:00
Benoit Marty
f990600aea Cleanup and documentation after #2047 2020-09-08 12:40:21 +02:00
Benoit Marty
22cd6ae239 Merge pull request #2047 from vector-im/feature/universal_link_navigation
Handle room, user, group, email verification links by converting them to permalinks.
2020-09-08 12:21:54 +02:00
Benoit Marty
00b53ee577 Merge pull request #2053 from vector-im/feature/fix_poll_reply
Feature/fix poll reply
2020-09-08 12:19:32 +02:00
Benoit Marty
f65e96e7b4 Merge pull request #2069 from etherealvisage/develop
Support data-mx-[bg-]color attribute on <font> tags in formatted messages.
2020-09-08 10:09:25 +02:00
Benoit Marty
f98844db02 Privacy 2020-09-08 10:04:27 +02:00
Benoit Marty
c59665e017 typo 2020-09-08 09:52:51 +02:00
Valere
7fe4148384 update change log 2020-09-08 09:51:55 +02:00
Valere
a544ae264b Avoid showing debug notice format for event preview 2020-09-08 09:51:35 +02:00
Valere
c895f87e26 Prevent reply to poll local echo (relation to echo not supported yet) 2020-09-08 09:51:35 +02:00
Onuray Sahin
e65558958d Code review refactoring. 2020-09-08 10:45:00 +03:00
Valere
eb5088c699 Fix / sending poll event appears forever 2020-09-08 09:32:37 +02:00
Benoit Marty
3755d866b1 Merge pull request #2067 from vector-im/feature/contact_crash
Android 6: App crash when read Contact permission is granted (#2064)
2020-09-08 08:46:27 +02:00
ethereal
8291dfc188 Support data-mx-color attribute in <font> tags as well. 2020-09-07 14:52:30 -04:00
Onuray Sahin
c41c91b0e7 Update changelog. 2020-09-07 20:53:11 +03:00
Onuray Sahin
3367ed6765 Fix support of riot.im/develop urls. 2020-09-07 20:02:06 +03:00
Benoit Marty
4654e39417 Update after Ganfra's review 2020-09-07 17:14:09 +02:00
Onuray Sahin
6dd4d4d906 Merge branch 'develop' into feature/universal_link_navigation 2020-09-07 17:48:52 +03:00
Onuray Sahin
cf3fecd425 Changelog added.
Fixes #1795
2020-09-07 17:48:12 +03:00
Benoit Marty
be9a91e3fe Android 6: App crash when read Contact permission is granted (#2064) 2020-09-07 16:33:12 +02:00
Onuray Sahin
fc51097ed8 develop and staging subdomains are added. 2020-09-07 17:17:58 +03:00
Benoit Marty
751c870a4a Merge pull request #2049 from vector-im/feature/image_compression
Image compression
2020-09-07 15:21:26 +02:00
Benoit Marty
de8e325193 Merge branch 'develop' into feature/image_compression 2020-09-07 15:21:15 +02:00
Benoit Marty
e2feac3dde Merge pull request #2056 from vector-im/feature/small_doc_change
Feature/small doc change
2020-09-07 15:19:55 +02:00
Benoit Marty
d7b0b2f785 Merge pull request #2072 from vector-im/feature/weblate_fixes
Weblate fixes and other stuff done during locked Weblate
2020-09-07 15:00:04 +02:00
Benoit Marty
326c863148 Emoji SAS: Step 4: changelog (#1909) 2020-09-07 14:30:21 +02:00
Benoit Marty
c42920d9aa Emoji SAS: Step 3: Make the code compile (#1909) 2020-09-07 14:28:43 +02:00
Benoit Marty
fb5c1bb163 Emoji SAS: Step 2: Run import_sas_strings.py (#1909) 2020-09-07 14:21:10 +02:00
Benoit Marty
4f695a6d8f Emoji SAS: Step 1: Remove legacy strings (#1909) 2020-09-07 14:19:55 +02:00
Benoit Marty
bc389d371d Move string def to app module instead of SDK (#1994) 2020-09-07 13:38:12 +02:00
Benoit Marty
3756c3a191 Fix lint issues 2020-09-07 13:32:32 +02:00
Benoit Marty
9e3caf603d Lint: "..." -> 2020-09-07 13:25:11 +02:00
Benoit Marty
74e2ffc4c4 Format string files 2020-09-07 13:24:33 +02:00
Benoit Marty
6e019dbd44 Merge pull request #2071 from RiotTranslateBot/weblate-element-android-element-app
Update from Weblate
2020-09-07 13:13:13 +02:00
Onuray Sahin
4d7cd7319b Handle new mobile config url. 2020-09-07 12:19:34 +03:00
Weblate
edf7761d49 Merge branch 'origin/develop' into Weblate. 2020-09-07 08:57:45 +00:00
LinAGKar
a590bc96cd Translated using Weblate (Swedish)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/sv/
2020-09-07 08:57:34 +00:00
Benoit Marty
6c6bba68ff Merge pull request #2062 from vector-im/feature/fix_no_verif
Feature/fix no verif
2020-09-07 10:49:38 +02:00
ethereal
5fbcf348f5 Support data-mx-bg-color attribute on <font> tags in formatted messages.
Signed-off-by: Kestrel Williams-King <ethereal@ethv.net>
2020-09-07 01:13:32 -04:00
LinAGKar
58f5baa5f6 Added translation using Weblate (Swedish) 2020-09-06 06:49:13 +00:00
PPNplus
398dcb1036 Translated using Weblate (Thai)
Currently translated at 66.7% (2 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/th/
2020-09-05 09:42:47 +00:00
PPNplus
30e7b761ae Translated using Weblate (Thai)
Currently translated at 4.7% (87 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/th/
2020-09-05 09:42:47 +00:00
Eduardo F
4d105c278b Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-09-05 09:42:44 +00:00
Benoit Marty
f019e4a246 Merge pull request #1995 from notramo/patch-1
Mention thousands of public servers in Play Store
2020-09-04 21:35:10 +02:00
Benoit Marty
4499e34f44 Merge pull request #2030 from vector-im/feature/fix_call_proximity_sensor
Turn the screen off while using ear speaker
2020-09-04 21:25:59 +02:00
Benoit Marty
fd1bb84770 typo 2020-09-04 20:47:19 +02:00
Benoit Marty
ac4c111ad3 Refacto: let's matrixItem be part of the constructor 2020-09-04 20:42:35 +02:00
Benoit Marty
254eb26211 Verification popup won't show 2020-09-04 20:38:32 +02:00
Benoit Marty
f689871fc0 Code symmetry 2020-09-04 18:45:49 +02:00
Benoit Marty
8ead371603 Fix crash with WakeLock 2020-09-04 18:43:59 +02:00
Benoit Marty
8045d61e1f Code cleanup 2020-09-04 18:41:13 +02:00
Onuray Sahin
e790c35270 Use stringProvider. 2020-09-04 17:19:54 +02:00
Onuray Sahin
914ec895ee Use ContextCompat.getSystemService function. 2020-09-04 17:19:54 +02:00
Onuray Sahin
bd05484b2d Initialize fields in the constructor. 2020-09-04 17:19:54 +02:00
Onuray Sahin
7872838056 Changelog added. 2020-09-04 17:19:54 +02:00
Onuray Sahin
b89b3db077 Use proximity manager to turn the screen off while the ear speaker is used. 2020-09-04 17:19:18 +02:00
Onuray Sahin
8e3d83579b Remove attachBaseContext to fix the crash. 2020-09-04 17:19:18 +02:00
Onuray Sahin
96845d31db Proximity sensor implementation. 2020-09-04 17:19:18 +02:00
Benoit Marty
89fa2ece43 Fix compilation issue (I'm tired) 2020-09-04 15:46:16 +02:00
Benoit Marty
82e3adebbc Improve wording and fix typo 2020-09-04 14:23:56 +02:00
Benoit Marty
2490d4d638 Generic email-provider hots. 2020-09-04 14:18:47 +02:00
Benoit Marty
55f04906ac Correct markdown formatting 2020-09-04 14:17:15 +02:00
Onuray Sahin
f186a00515 Support legacy riot.im url. 2020-09-04 14:20:03 +03:00
Benoit Marty
0bd7e40a22 Rework: split long method, extract thumbnail management 2020-09-04 12:33:10 +02:00
Benoit Marty
ad984b26fb Move variable declaration 2020-09-04 12:22:38 +02:00
Benoit Marty
3a659a9f3b Ensure temporary files are deleted even in case of Exception 2020-09-04 12:03:20 +02:00
Benoit Marty
0217e79324 Ensure input stream is closed 2020-09-04 11:08:44 +02:00
Benoit Marty
544bff9f4f For only with Files now 2020-09-04 11:07:06 +02:00
PPNplus
a4fdf1802b Translated using Weblate (Thai)
Currently translated at 1.5% (28 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/th/
2020-09-04 08:43:08 +00:00
LinAGKar
2c4f7d38a2 Translated using Weblate (Swedish)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sv/
2020-09-04 08:43:07 +00:00
Peter Vágner
48a9e1ff9f Translated using Weblate (Slovak)
Currently translated at 70.0% (1294 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sk/
2020-09-04 08:43:06 +00:00
rkfg
c4b6d52657 Translated using Weblate (Russian)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-09-04 08:42:43 +00:00
call_xz
43b291d2d0 Translated using Weblate (Japanese)
Currently translated at 49.9% (923 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ja/
2020-09-04 08:42:43 +00:00
Benoit Marty
b31178683c typo 2020-09-04 09:37:49 +02:00
Benoit Marty
38631eb70e Format 2020-09-04 09:37:10 +02:00
Benoit Marty
6246fd98c3 Cleanup 2020-09-04 09:36:18 +02:00
Benoit Marty
71aa315f2a Cleanup 2020-09-04 09:36:18 +02:00
Benoit Marty
af6a94d08e Support for image compression on Android 10 2020-09-04 09:36:18 +02:00
Valere
f6c7f3eed1 Merge pull request #1889 from vector-im/feature/enhance_big_files
Feature/enhance big files
2020-09-03 17:09:55 +02:00
Valere
e0c5377968 Merge branch 'develop' into feature/enhance_big_files 2020-09-03 17:09:40 +02:00
Valere
0c39495e3f FIx / unneeded code 2020-09-03 15:03:07 +02:00
Valere
7c638798c7 Code review 2020-09-03 14:53:13 +02:00
Benoit Marty
05ec5bde93 Merge pull request #2020 from vector-im/feature/add_email
Add email and phone numbers
2020-09-03 14:33:09 +02:00
Benoit Marty
d2d372d140 Merge pull request #2043 from vector-im/feature/cleanup_after_2002
Cleanup after #2002
2020-09-03 11:15:45 +02:00
Benoit Marty
e9b3ab91a0 Merge pull request #1902 from vector-im/feature/verify_one_session
Feature/verify one session
2020-09-03 11:11:22 +02:00
Benoit Marty
633b12f66d Propose to verify the current session if the 4S contains secret, even if there is no other sessions 2020-09-03 10:00:01 +02:00
Benoit Marty
2efe5a420c Do not propose to verify the current session if there is only one session (#1901) 2020-09-03 09:54:03 +02:00
Benoit Marty
96c7f57ea0 Remove useless member 2020-09-03 09:52:57 +02:00
Benoit Marty
6af879fe2a Rename class 2020-09-03 09:52:14 +02:00
Benoit Marty
b935a6557f Move state to a dedicated file 2020-09-03 09:46:17 +02:00
Valere
8340d5e71f Fix tests 2020-09-03 09:38:40 +02:00
Valere
8103081e0e Fix / Support open and view of sending attachment 2020-09-03 09:31:53 +02:00
Benoit Marty
be3157b6f5 Do not strip new lines. Many tests are not passing, we should work more on it... 2020-09-03 09:24:44 +02:00
Benoit Marty
ae9afcc393 Add test to cover line break 2020-09-03 09:16:37 +02:00
Benoit Marty
e73480c0ef Riot -> Element 2020-09-03 09:06:12 +02:00
Benoit Marty
e02b9b7736 Changelog 2020-09-02 19:02:36 +02:00
Benoit Marty
8c801ae078 API change: encrypted files are now decrypted internally, no need to expose decryptStream() anymore 2020-09-02 19:01:26 +02:00
Onuray Sahin
a151f42495 Handle room, user, group links by converting them to permalinks. 2020-09-02 18:26:08 +03:00
Valere
40f7dc4824 Merge remote-tracking branch 'origin/feature/enhance_big_files' into feature/enhance_big_files 2020-09-02 16:42:54 +02:00
Valere
3b8c61a87e FIx / interceptors and stream closed 2020-09-02 16:06:48 +02:00
Benoit Marty
4ef1f9c4d9 Avoid copy paste of code 2020-09-02 12:47:41 +02:00
Benoit Marty
93cb6bd26e Avoid null type 2020-09-02 12:37:06 +02:00
Benoit Marty
7c33bf2742 Remove Done TODO 2020-09-02 12:31:22 +02:00
Benoit Marty
e5e67fbcbb Internal class and Copyright 2020-09-02 12:29:53 +02:00
Benoit Marty
95219c7934 typo 2020-09-02 12:29:39 +02:00
Benoit Marty
53744982f0 Update Javadoc 2020-09-02 12:29:18 +02:00
Benoit Marty
6d24aa75d0 Format file (no other change) 2020-09-02 12:25:50 +02:00
Benoit Marty
76c79f9f75 Move Base64 methods to a dedicated file 2020-09-02 12:06:21 +02:00
Benoit Marty
28081aa7d2 Cleanup: rename parameters, make some fields private, add Javadoc, fix copy paste error 2020-09-02 12:03:03 +02:00
Benoit Marty
d0532bb9a9 Revert some change from #2002 2020-09-02 09:06:34 +02:00
Benoit Marty
9389cfe7a3 Add comment for history 2020-09-02 09:04:16 +02:00
Benoit Marty
484fd61706 Make MarkdownParserTest tests pass again 2020-09-02 09:04:16 +02:00
Benoit Marty
6c943571fc Remove useless TextContentRenderer 2020-09-01 22:22:27 +02:00
Leon Schmidt
29123ac726 Bugfix/markdown parsing (#2002)
Removed replacing of newlines in already parsed HTML documents

Signed-off-by: Leon Schmidt <mail@leon.wtf>

Co-authored-by: Benoit Marty <benoitm@matrix.org>
2020-09-01 22:02:16 +02:00
Benoit Marty
44cb8cdeca Merge pull request #2042 from vector-im/feature/builkite_location_and_pipeline_location_change
Update of Buildkite configuration
2020-09-01 21:53:11 +02:00
Benoit Marty
9e20f7db1a Update of Buildkite configuration:
New pipeline location: https://github.com/matrix-org/pipelines/blob/master/element-android/pipeline.yml
New build location: https://buildkite.com/matrix-dot-org/element-android
2020-09-01 18:52:03 +02:00
Benoit Marty
971320a56c Restore setting removed by mistake 2020-09-01 18:38:38 +02:00
Benoit Marty
4290d22465 Merge pull request #2035 from vector-im/feature/fix_crashes_attachment_viewer
Crash / Attachment viewer: Cannot draw a recycled Bitmap
2020-09-01 18:33:39 +02:00
Benoit Marty
96a3b25adb Merge branch 'develop' into feature/fix_crashes_attachment_viewer 2020-09-01 18:32:55 +02:00
Valere
3dc69b60c4 Fix / Log could leak file name 2020-09-01 17:31:54 +02:00
Benoit Marty
bdde638967 Merge pull request #2028 from vector-im/feature/relax_is_discovery
Relax IS dicovery
2020-09-01 15:39:28 +02:00
Benoit Marty
8157644ff8 Merge pull request #2014 from vector-im/feature/fix_call_sound_device
Fix: Loudspeaker is always used
2020-09-01 15:33:06 +02:00
ziriSut
4008339963 Translated using Weblate (Kabyle)
Currently translated at 56.7% (1049 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-09-01 13:08:35 +00:00
Benoit Marty
c6bd6c17fc Auto review 2020-09-01 14:55:12 +02:00
Benoit Marty
1a452a6cd7 Improve error for non supported SSO flow to delete device or add MSISDN 2020-09-01 12:58:53 +02:00
Benoit Marty
35f854de5d Also request focus (keyboard is not shown on my device :/) 2020-09-01 10:45:48 +02:00
Benoit Marty
99343294c6 Rename class 2020-09-01 10:09:28 +02:00
Benoit Marty
56261bd741 Add a trick to reset EditText field when recycled. 2020-09-01 10:07:04 +02:00
Benoit Marty
1d53b48c8a Inline wrong token error 2020-08-31 23:11:58 +02:00
Benoit Marty
5594489b69 Optimisation and cleanup 2020-08-31 22:20:59 +02:00
Benoit Marty
ddb858380e Code quality 2020-08-31 21:46:55 +02:00
Benoit Marty
bf5c1e9d8f Add phone numbers to account 2020-08-31 20:53:37 +02:00
Benoit Marty
931eeac548 Add MSISDN (WIP) 2020-08-31 18:07:25 +02:00
Valere
f34c5d6674 Crash / Attachment viewer: Cannot draw a recycled Bitmap 2020-08-31 17:50:17 +02:00
Benoit Marty
9c05efa15d Fix migration issue. Also do not delete Realm file in case of migration issue when debugging. 2020-08-31 16:46:56 +02:00
Benoit Marty
bd12c89a3c Move the DB version number to the Migration class, I think it has more sense. Also increase the value. 2020-08-31 16:29:34 +02:00
Valere
bf4f869524 rebase fix 2020-08-31 16:25:40 +02:00
Valere
dd09c4a72d post rebase fix 2020-08-31 16:21:27 +02:00
Valere
55dcba6f36 Fix progress of message with attachment 2020-08-31 16:21:27 +02:00
Valere
4e7790966f Always use temp file before sending 2020-08-31 16:21:27 +02:00
Valere
bfcbb9ff4f Rebase post matrix sdk package renaming 2020-08-31 16:21:27 +02:00
Benoit Marty
cc57a73f23 Cleanup and split long lines 2020-08-31 16:20:12 +02:00
Valere
d6f96e3d64 Fix test + cleaning 2020-08-31 16:20:12 +02:00
Valere
5f76f182f6 Fix clear glide in recycler view 2020-08-31 16:20:12 +02:00
Valere
31eccf5f1c Cleaning 2020-08-31 16:20:12 +02:00
Valere
9d2ea19d7d Upgrade to worker 2.4.0 2020-08-31 16:20:12 +02:00
Valere
a888e1e80e Support cancel sending and resend event with attachments
Avoid auto retry for medium and big files
2020-08-31 16:20:12 +02:00
Valere
8b8855d2d5 FIx / Audio icon not shown after download 2020-08-31 16:20:12 +02:00
Valere
de53166193 Use file service in glide loader (avoid re-dl after send) 2020-08-31 16:20:12 +02:00
Valere
caf0ac1c9f Add event sending indicator for attachment 2020-08-31 16:20:12 +02:00
Valere
299cd9ced3 Fix / preview/edit was shown for movies and gif 2020-08-31 16:20:12 +02:00
Valere
11c8da3717 Improve upload/dl mem for big files + report ecryption progress 2020-08-31 16:20:12 +02:00
Benoit Marty
e309b30203 Implement: Adding MSISDN (WIP) 2020-08-31 16:16:18 +02:00
Benoit Marty
5a21249022 Doc: Adding MSISDN 2020-08-31 15:08:59 +02:00
Benoit Marty
3c3c51e6fd Doc: more generic to handle MSISDN 2020-08-31 14:48:48 +02:00
Benoit Marty
ee3e10a4b0 Add threePid: improve UI for phone numbers 2020-08-31 14:46:05 +02:00
Benoit Marty
e92cf38cde Add threePid: improve UX (remove dialog) 2020-08-31 14:30:47 +02:00
Benoit Marty
dbd080ca6c Merge pull request #2018 from vector-im/feature/moar_sonar_fixes
Feature/moar sonar fixes
2020-08-31 12:10:00 +02:00
Valere
aedcf3006a Relax IS dicovery
fixes #2027
2020-08-31 12:08:37 +02:00
LinAGKar
6a475ae85c Translated using Weblate (Swedish)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sv/
2020-08-30 07:42:56 +00:00
ziriSut
0ad637fa16 Translated using Weblate (Kabyle)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-30 07:42:56 +00:00
ziriSut
ee98a2da03 Translated using Weblate (Kabyle)
Currently translated at 54.1% (1001 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-30 07:42:55 +00:00
Balázs Meskó
183d928e21 Translated using Weblate (Hungarian)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/hu/
2020-08-30 07:42:43 +00:00
Rww Folo
807c6f0cb5 Added translation using Weblate (Bengali (Bangladesh)) 2020-08-29 15:53:08 +00:00
Kahina Messaoudi
72bb140b70 Translated using Weblate (Kabyle)
Currently translated at 41.3% (763 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-29 13:46:02 +00:00
ziriSut
a5678a752b Translated using Weblate (Kabyle)
Currently translated at 41.3% (763 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-29 13:46:02 +00:00
Benoit Marty
58938a239e Format phone number 2020-08-28 19:07:41 +02:00
Benoit Marty
da4695ff2a Improve UI of threePid screen 2020-08-28 18:35:04 +02:00
Benoit Marty
9fecc1b992 Reduce button width 2020-08-28 18:05:59 +02:00
Benoit Marty
e8e1330cd5 Cleanup 2020-08-28 18:05:07 +02:00
Benoit Marty
1af45ede62 Add some guard, and allow to cancel adding 3pid 2020-08-28 17:55:38 +02:00
Benoit Marty
f6f9373aeb Cleanup 2020-08-28 17:06:17 +02:00
Benoit Marty
36a9b80040 i18n for M_THREEPID_AUTH_FAILED 2020-08-28 17:05:40 +02:00
Benoit Marty
175a5ab824 List phone numbers and emails added to the Matrix account, and add Email to account (#44) 2020-08-28 16:45:09 +02:00
Benoit Marty
46d3608ccb RiotX -> Element 2020-08-28 11:25:16 +02:00
Benoit Marty
b11eced4f1 Fix a refresh problem on the user avatar 2020-08-28 11:12:29 +02:00
Benoit Marty
66dfcbc2f8 Add documentation on the flows 2020-08-28 10:59:51 +02:00
Benoit Marty
71de2d9adc Update README.md 2020-08-28 09:23:55 +02:00
Benoit Marty
3f30636808 Matrix SDK is now exported 2020-08-28 09:23:08 +02:00
Benoit Marty
ee9c73fde1 Sonar: rename variables and parameter to follow naming convention 2020-08-28 08:58:57 +02:00
Onuray Sahin
7d76264b25 Merge branch 'develop' into feature/fix_call_sound_device 2020-08-28 02:53:46 +03:00
Marcelo Filho
22771a84f1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/pt_BR/
2020-08-27 22:42:34 +00:00
Marcelo Filho
a107bdd849 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-27 22:42:34 +00:00
random
9fbf97f4cb Translated using Weblate (Italian)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/it/
2020-08-27 22:42:34 +00:00
Tirifto
812563f68b Translated using Weblate (Esperanto)
Currently translated at 25.5% (471 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/eo/
2020-08-27 22:42:33 +00:00
Benoit Marty
d3f50ee6c3 Fix a crash that would occur if it was not dead code 2020-08-27 22:46:30 +02:00
Benoit Marty
9dbe9c7286 Typo in comment 2020-08-27 22:44:55 +02:00
Benoit Marty
fbcc7aa211 Merge pull request #1993 from vector-im/feature/fix_call_in_background
Don't pause the sync thread if there is an active or pending call.
2020-08-27 22:41:46 +02:00
Benoit Marty
a0af769d7c Merge pull request #2016 from vector-im/feature/sonar_fixes
Sonar fixes
2020-08-27 21:39:56 +02:00
Benoit Marty
ef4f930ba2 Don't pause the sync thread if there is an active or pending call.
But pause the sync thread when there is no active call and the app is the background.
Authors: Onuray, I just rebased and squashed all the commit
2020-08-27 18:20:06 +02:00
Benoit Marty
8369003bdf Sonar: rename project name and project key 2020-08-27 18:16:29 +02:00
Benoit Marty
02145eaa06 Github repository has been renamed 2020-08-27 18:16:29 +02:00
Benoit Marty
a857d8e306 Fix bugs detected by sonar 2020-08-27 18:16:29 +02:00
Benoit Marty
cb64f472fe Remove commented out code and useless code 2020-08-27 18:15:53 +02:00
Benoit Marty
cd28ad4c07 Remove dead code (QrCode animation) 2020-08-27 18:15:53 +02:00
Benoit Marty
b69616117f Sonar: skip project diff-match-patch 2020-08-27 18:15:53 +02:00
Benoit Marty
59fa2e28c2 Fix sonar analysis version name issue 2020-08-27 18:15:53 +02:00
Benoit Marty
0f1e348ac4 Merge pull request #2010 from vector-im/feature/fix_send_room_v6
Feature/fix send room v6
2020-08-27 18:14:58 +02:00
Benoit Marty
67bde947f9 Merge pull request #2009 from vector-im/feature/joining_room
Feature/joining room
2020-08-27 18:11:42 +02:00
Onuray Sahin
d9009540dd Don't try to use bluetooth headset if it is not connected. 2020-08-27 16:43:11 +03:00
ganfra
28a1cf6982 Join room: clean up after benoit's remarks 2020-08-27 11:44:21 +02:00
ganfra
9c1c9f96e1 Room v6: finish cleaning up 2020-08-27 10:34:40 +02:00
aevw
7657c0f905 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.9% (1848 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-27 00:29:21 +00:00
Marcelo Filho
d8a0142aee Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.9% (1848 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-27 00:29:20 +00:00
strix aluco
eddc681d64 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/uk/
2020-08-26 20:42:44 +00:00
vejetaryenvampir
87a97bc8ec Translated using Weblate (Turkish)
Currently translated at 64.4% (1191 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/tr/
2020-08-26 20:42:44 +00:00
LinAGKar
ae81ea2bbc Translated using Weblate (Swedish)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sv/
2020-08-26 20:42:44 +00:00
Marcelo Filho
90e580245a Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/pt_BR/
2020-08-26 20:42:44 +00:00
aevw
8372c9e3ed Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.7% (1843 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-26 20:42:43 +00:00
Marcelo Filho
1fcb8d712b Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.7% (1843 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-26 20:42:42 +00:00
Imre Kristoffer Eilertsen
9761566b28 Translated using Weblate (Norwegian Bokmål)
Currently translated at 44.1% (815 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/nb_NO/
2020-08-26 20:42:41 +00:00
Kahina Messaoudi
f26c58fa22 Translated using Weblate (Kabyle)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/kab/
2020-08-26 20:42:31 +00:00
Tirifto
6d73f7b767 Translated using Weblate (Esperanto)
Currently translated at 25.1% (465 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/eo/
2020-08-26 20:42:31 +00:00
ganfra
3c0177c2dd Update CHANGES 2020-08-26 19:25:20 +02:00
ganfra
dc4135b506 Remove unnecessary code now we have an other way to keep number types 2020-08-26 19:21:41 +02:00
ganfra
cefdbe1d08 Add CheckNumberType in json to fix sending in room v6 2020-08-26 19:21:14 +02:00
Benoit Marty
95e80f0263 Merge pull request #2001 from vector-im/feature/mention_display_name
Fix mention display name
2020-08-26 17:35:23 +02:00
Benoit Marty
013f51f0c4 Merge branch 'develop' into feature/mention_display_name 2020-08-26 17:35:16 +02:00
Benoit Marty
75911ba4c0 Merge pull request #2008 from vector-im/feature/sas_emoji
Create a script to import SAS strings (#1909)
2020-08-26 17:34:43 +02:00
Benoit Marty
b3edc439cf Merge pull request #1997 from vector-im/feature/switch_language
Switch language and font size settings fixes
2020-08-26 17:34:26 +02:00
Benoit Marty
7ef08579ef Merge branch 'develop' into feature/switch_language 2020-08-26 17:34:17 +02:00
ganfra
b39a86edbd Merge branch 'develop' into feature/joining_room 2020-08-26 17:06:31 +02:00
ganfra
9c151417a8 Update CHANGES 2020-08-26 17:03:51 +02:00
ganfra
5d8d9cb19c Clean files 2020-08-26 17:02:24 +02:00
ganfra
b986bfd509 Permalink: handle via parameters 2020-08-26 16:37:48 +02:00
Benoit Marty
28ae10a4aa Merge pull request #2007 from vector-im/feature/icons
Feature/icons
2020-08-26 16:04:36 +02:00
Benoit Marty
39fa7d850a Merge branch 'develop' into feature/icons 2020-08-26 16:04:27 +02:00
Benoit Marty
25ea221d47 Create a script to import SAS strings (#1909)
It will be run at the next Weblate sync, since we have to remove previous translations
2020-08-26 16:02:58 +02:00
Benoit Marty
a4e495edd3 Merge pull request #2006 from vector-im/feature/long_click
Add long click gesture to copy userId, user display name, room name, …
2020-08-26 13:23:31 +02:00
Benoit Marty
8b009304ad Merge pull request #2004 from vector-im/feature/fix_ucrop
Increase version of uCrop library which supports Android 10.
2020-08-26 13:22:56 +02:00
Benoit Marty
249f268fb5 Fix bad color for settings icon on Android < 24 (#1786) 2020-08-26 12:55:49 +02:00
Benoit Marty
9f3f981ab0 Use cached Views 2020-08-26 12:54:01 +02:00
Benoit Marty
ef912e066b Remove unused resource 2020-08-26 12:29:46 +02:00
Benoit Marty
d014872e3b Add long click gesture to copy userId, user display name, room name, room topic and room alias (#1774) 2020-08-26 11:57:27 +02:00
Onuray Sahin
776d892d27 Increase version of uCrop library which supports Android 10. 2020-08-26 12:27:12 +03:00
ganfra
9970398cf2 Join room: add "UnknownItem" to public room list 2020-08-25 20:20:14 +02:00
Benoit Marty
a5f537f251 Merge pull request #1996 from johnjohndoe/file-extensions
Use File extension functions to make code more concise.
2020-08-25 18:09:00 +02:00
Benoit Marty
6376ba2516 Improve wording (visible in debug screen) 2020-08-25 17:48:12 +02:00
Benoit Marty
5e0fc3e17f Rename class 2020-08-25 17:34:43 +02:00
Benoit Marty
1a068ee191 Add more tests 2020-08-25 17:34:02 +02:00
Benoit Marty
8226f60fad Refactor test to avoid duplicated code 2020-08-25 17:31:51 +02:00
Benoit Marty
2e618999d9 Words containing my name should not trigger notifications (Fixes #1781)
It adds a specific behavior for rule with id RuleIds.RULE_ID_CONTAIN_USER_NAME
2020-08-25 17:26:54 +02:00
Benoit Marty
bf7a096a18 Refactor: Remove duplicated declaration for Actions 2020-08-25 17:01:55 +02:00
Benoit Marty
0d9885a1e0 Refactor: Remove duplicated declaration for RuleIds 2020-08-25 16:53:12 +02:00
Benoit Marty
aca8fd7f3d Refactor: Kotlin style 2020-08-25 16:18:44 +02:00
Benoit Marty
f5ea4fb6ac Refactor: Extract method to dedicated files 2020-08-25 16:15:42 +02:00
Benoit Marty
7b5c74f81c Refactor: Condition is now an interface 2020-08-25 16:14:14 +02:00
Benoit Marty
558e11a364 Refactor: move Kind to its own file 2020-08-25 16:01:34 +02:00
Weblate
3d5b3c65de Merge branch 'origin/develop' into Weblate. 2020-08-25 11:15:37 +00:00
LinAGKar
ed9e590498 Translated using Weblate (Swedish)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sv/
2020-08-25 11:15:37 +00:00
tctovsli
70fda1009b Translated using Weblate (Norwegian Bokmål)
Currently translated at 33.1% (612 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/nb_NO/
2020-08-25 11:15:36 +00:00
Kahina Messaoudi
ceae1f1ad8 Translated using Weblate (Kabyle)
Currently translated at 25.2% (466 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-25 11:15:33 +00:00
ganfra
8f1eff8782 Start reusing RoomPreview for joining room not joined 2020-08-25 12:35:35 +02:00
ganfra
c1c8c04567 Room detail: Fix roomId not set up when activity is restored 2020-08-25 12:31:55 +02:00
LinAGKar
31b4785a4d Translated using Weblate (Swedish)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sv/
2020-08-24 17:43:19 +00:00
Kahina Messaoudi
8e5656729b Translated using Weblate (Kabyle)
Currently translated at 33.3% (1 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/kab/
2020-08-24 17:42:31 +00:00
ziriSut
51893fff09 Translated using Weblate (Kabyle)
Currently translated at 99.1% (233 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-24 17:42:31 +00:00
Kahina Messaoudi
25d8ba2699 Translated using Weblate (Kabyle)
Currently translated at 99.1% (233 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-24 17:42:31 +00:00
Kahina Messaoudi
fd5e4b78da Translated using Weblate (Kabyle)
Currently translated at 24.6% (454 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-24 17:42:31 +00:00
@a2sc:matrix.org
f45d0122b0 Translated using Weblate (German)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-24 17:42:30 +00:00
aWeinzierl
01cfa4496c Translated using Weblate (German)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-24 17:42:30 +00:00
linsui
82c8b532c0 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-24 17:42:30 +00:00
Slavi Pantaleev
ee7f79b40c Translated using Weblate (Bulgarian)
Currently translated at 72.3% (170 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/bg/
2020-08-24 17:42:28 +00:00
Benoit Marty
cb7a1bc9c3 Fix FontSize issue (#1483, #1787) 2020-08-24 18:32:08 +02:00
Benoit Marty
52cf4d24d3 Fix switch language issue 2020-08-24 18:32:08 +02:00
Tobias Preuss
ed98613b2d Use File extension functions to make code more concise.
+ This change replaces a few usages of ByteArrayInputStream, FileInputStream,
  FileOutputStream with their equivalent Kotlin extension functions.
2020-08-24 18:01:30 +02:00
notramo
252df0f7a9 Mention thousands of public servers in Play Store 2020-08-24 14:51:10 +00:00
Benoit Marty
116e6fb3c0 Call restart() extension 2020-08-24 15:50:47 +02:00
Benoit Marty
efa3aa5cf8 Stop using internal context of VectorLocal in CallHeadsUpActionReceiver... 2020-08-24 15:08:52 +02:00
Benoit Marty
69e9a79ac1 Inject StringProvider instead of Context 2020-08-24 14:49:42 +02:00
Benoit Marty
96cf5d2105 Cleanup: propoerly inject things to PushRulesFragment and move PushRulesController to its own file 2020-08-24 14:32:43 +02:00
Benoit Marty
f745e22a52 Merge pull request #1983 from vector-im/feature/live_display_name
Make user displayName live in the setting, it should fix #1926
2020-08-24 13:43:08 +02:00
Benoit Marty
50495ef604 Improve algo 2020-08-24 11:12:19 +02:00
Benoit Marty
84854d9382 Add entry in changelog 2020-08-24 10:14:00 +02:00
Benoit Marty
328dc9ea5b Merge pull request #1979 from vector-im/feature/update_dependencies
Update some dependencies, including coroutines for working debugging
2020-08-24 10:11:57 +02:00
Kahina Messaoudi
30b92efcc6 Translated using Weblate (Kabyle)
Currently translated at 24.4% (452 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-23 17:15:04 +00:00
ziriSut
e87bd16b6b Translated using Weblate (Kabyle)
Currently translated at 24.4% (452 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-23 17:15:02 +00:00
Kahina Messaoudi
8b41b014ee Translated using Weblate (Kabyle)
Currently translated at 96.6% (227 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 15:46:17 +00:00
ziriSut
601cf10fb4 Translated using Weblate (Kabyle)
Currently translated at 96.6% (227 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 15:46:16 +00:00
Kahina Messaoudi
f02ee2af27 Translated using Weblate (Kabyle)
Currently translated at 72.3% (170 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 14:38:55 +00:00
ziriSut
c490d6bcd1 Translated using Weblate (Kabyle)
Currently translated at 72.3% (170 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 14:38:55 +00:00
ziriSut
64b6b069a4 Translated using Weblate (Kabyle)
Currently translated at 69.4% (163 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 14:32:38 +00:00
Kahina Messaoudi
edd455a772 Translated using Weblate (Kabyle)
Currently translated at 69.4% (163 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 14:32:38 +00:00
Kahina Messaoudi
a54c1af7cc Translated using Weblate (Kabyle)
Currently translated at 39.6% (93 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 12:09:01 +00:00
ziriSut
9e1fe22c19 Translated using Weblate (Kabyle)
Currently translated at 39.6% (93 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 12:09:01 +00:00
Kahina Messaoudi
bd033ed5f4 Translated using Weblate (Kabyle)
Currently translated at 7.2% (17 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 06:37:58 +00:00
Slimane Selyan AMIRI
2fd9333fb0 Translated using Weblate (Kabyle)
Currently translated at 7.2% (17 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/kab/
2020-08-23 06:37:57 +00:00
Slimane Selyan AMIRI
6249d5a85e Translated using Weblate (Kabyle)
Currently translated at 0.3% (5 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/kab/
2020-08-23 06:35:09 +00:00
Slimane Selyan AMIRI
385de03f40 Added translation using Weblate (Kabyle) 2020-08-22 18:05:34 +00:00
Slimane Selyan AMIRI
5bfb2c211a Added translation using Weblate (Kabyle) 2020-08-22 18:04:55 +00:00
LinAGKar
7ee4a8fc0a Translated using Weblate (Swedish)
Currently translated at 61.0% (1127 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sv/
2020-08-22 15:42:55 +00:00
AnonymousWebHacker
c73f544a01 Translated using Weblate (Spanish)
Currently translated at 81.6% (1508 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/es/
2020-08-22 15:42:38 +00:00
Nikita Epifanov
370d57cfbc Translated using Weblate (Russian)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-22 15:42:28 +00:00
Marcelo Filho
4380d34645 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/pt_BR/
2020-08-22 15:42:27 +00:00
aWeinzierl
471497e721 Translated using Weblate (German)
Currently translated at 99.7% (1843 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-22 15:42:27 +00:00
Jeff Huang
16809a53ab Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hant/
2020-08-22 15:42:26 +00:00
Slavi Pantaleev
6ad0098767 Translated using Weblate (Bulgarian)
Currently translated at 75.4% (1394 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/bg/
2020-08-22 15:42:25 +00:00
Priit Jõerüüt
eea17f0905 Translated using Weblate (Estonian)
Currently translated at 100.0% (1849 of 1849 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-22 11:08:31 +00:00
Benoit Marty
bd238dcbfa Make user displayName live in the setting, it should fix #1926 2020-08-21 22:24:29 +02:00
Benoit Marty
20e2b3beb8 Merge pull request #1978 from vector-im/feature/ttl
Improve #1971, especially be robust about system time change
2020-08-21 18:12:35 +02:00
ganfra
1f890324b4 Update some dependencies, including coroutines for working debugging 2020-08-21 17:17:51 +02:00
Benoit Marty
04fa7d9628 Version++ 2020-08-21 17:04:05 +02:00
Benoit Marty
7fd7970ec1 Merge branch 'release/1.0.5' into develop 2020-08-21 17:02:46 +02:00
Benoit Marty
81dece5516 Prepare release 1.0.5 2020-08-21 17:02:32 +02:00
Benoit Marty
52e66b09dc Merge pull request #1977 from vector-im/feature/networkonmainthread
Avoid NetworkOnMainThreadException when setting a user avatar
2020-08-21 16:48:19 +02:00
Benoit Marty
06f4b95dc0 Merge branch 'develop' into feature/networkonmainthread 2020-08-21 16:48:11 +02:00
Benoit Marty
008bc0116d Improve #1971, especially be robust about system time change 2020-08-21 16:36:45 +02:00
Benoit Marty
de728f6c36 Merge pull request #1971 from tzeitlho/turn_fix
Turn fix
2020-08-21 16:28:52 +02:00
Benoit Marty
a8c6678efc Avoid NetworkOnMainThreadException when setting a user avatar 2020-08-21 16:11:22 +02:00
Benoit Marty
35dbab2ff5 Merge pull request #1976 from vector-im/feature/post_weblate_merge
Feature/post weblate merge
2020-08-21 14:47:25 +02:00
Thomas Zeitlhofer
a732d8856b change var -> val according to review comment
Signed-off-by: Thomas Zeitlhofer <tz+github@ze-it.at>
2020-08-21 14:28:18 +02:00
Benoit Marty
80f7ffd7a6 Fix Potential Plurals - 3 2020-08-21 14:19:06 +02:00
Benoit Marty
d86536c949 Fix Potential Plurals (removing unused resource) - 2 2020-08-21 13:07:37 +02:00
Benoit Marty
f84ea0ad5b Fix Potential Plurals - 1 2020-08-21 12:55:15 +02:00
Benoit Marty
28ed6cb3b6 Fix typos reported by Lint 2020-08-21 12:47:39 +02:00
Benoit Marty
927c3e7e94 Update element web url (Fixes #1974) 2020-08-21 12:31:06 +02:00
Benoit Marty
5416f4194c Fix lint issue 2020-08-21 12:27:57 +02:00
Benoit Marty
b09c1e3cbf Format strings 2020-08-21 12:23:25 +02:00
Benoit Marty
66ac03a021 Merge pull request #1975 from RiotTranslateBot/weblate-element-android-element-app
Update from Weblate
2020-08-21 12:16:25 +02:00
Weblate
43d0a11cba Merge branch 'origin/develop' into Weblate. 2020-08-21 09:30:51 +00:00
notramo
a27b22a972 Translated using Weblate (Hungarian)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/hu/
2020-08-21 09:30:37 +00:00
Priit Jõerüüt
338c569c0b Translated using Weblate (Estonian)
Currently translated at 89.8% (1649 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-21 09:30:37 +00:00
Lua
f7db14fb02 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/pt_BR/
2020-08-21 00:42:34 +00:00
Lua
cfd0e00c0c Translated using Weblate (Portuguese)
Currently translated at 44.5% (817 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt/
2020-08-21 00:42:34 +00:00
Priit Jõerüüt
7c4afd922c Translated using Weblate (Estonian)
Currently translated at 87.4% (1605 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-21 00:42:34 +00:00
Thomas Zeitlhofer
bd1a0361be Changelog entry for turnserver related fix
Signed-off-by: Thomas Zeitlhofer <tz+github@ze-it.at>
2020-08-20 19:46:20 +02:00
Thomas Zeitlhofer
a7ee7d5bad Renew turnserver credentials when ttl runs out
The previous implementation caches the turnserver response indefinitely.
This breaks VoIP calls as soon as the ttl of the received turnserver
credentials runs out. So, take care to renew the turnserver credentials
by allowing the cache to expire.

Fixes: d8cf44fdc9 ("Simple cache of turn server response")
Signed-off-by: Thomas Zeitlhofer <tz+github@ze-it.at>
2020-08-20 19:43:52 +02:00
Benoit Marty
29e4a64475 Merge pull request #1970 from vector-im/feature/highlight
Highlighted Event when opening a permalink from another room
2020-08-20 19:04:15 +02:00
Benoit Marty
f07bf43ada Merge branch 'develop' into feature/highlight 2020-08-20 19:04:03 +02:00
Onuray Sahin
80551fc0c2 Fix IllegalArgumentException: Receiver not registered: NetworkInfoReceiver (#1961)
Fix IllegalArgumentException: Receiver not registered: NetworkInfoReceiver (#1961)

Co-authored-by: Onuray Sahin <onurays@element.io>
2020-08-20 18:31:03 +02:00
Benoit Marty
2acda2c5da Merge pull request #1962 from vector-im/feature/membership_state_event
A Kick appears has "someone has made no change" (Fixes #1959)
2020-08-20 18:29:23 +02:00
Benoit Marty
9582b9c0fb Merge pull request #1965 from vector-im/feature/share
Share button in rooms gives room ID link without via parameters (#1927)
2020-08-20 18:28:30 +02:00
Benoit Marty
cbe093fe77 Highlighted Event when opening a permalink from another room (Fixes #1033) 2020-08-20 18:20:53 +02:00
Benoit Marty
112a7913d4 Improve (unused) code 2020-08-20 17:57:48 +02:00
Benoit Marty
cab447e44e Add missing copyright 2020-08-20 17:50:43 +02:00
Benoit Marty
fde2bdf304 Create a PermalinkFactory to avoid injecting the service in SDK classes 2020-08-20 17:41:01 +02:00
Benoit Marty
2c90e33ceb Move package 2020-08-20 17:33:55 +02:00
Benoit Marty
af10344b6b Share button in rooms gives room ID link without via parameters (#1927)
Following the algorithm described in #1927
Create a PermalinkService
2020-08-20 17:33:55 +02:00
Benoit Marty
187edbd32a Merge pull request #1968 from vector-im/feature/biometrics
Improve PIN code feature
2020-08-20 17:16:27 +02:00
Benoit Marty
3bce0be96e Merge pull request #1969 from vector-im/feature/dm_creation
DM creation: handled denied federation error
2020-08-20 17:15:44 +02:00
Benoit Marty
828bf44b2b Better handling DM creation when invitees cannot be inviting due to denied federation
As we do not know the created roomId, we cannot add it to the DM list though. But at least the user is informed that a room has been created and won't retry because the screen will be closed.
2020-08-20 15:44:28 +02:00
Benoit Marty
c6c8ef07a6 Fail first (before creating the room) when trying to create a DM without at least one invitee 2020-08-20 15:34:58 +02:00
Benoit Marty
a6150beed2 Stuff added by AS 4.0.1 2020-08-20 15:32:45 +02:00
Benoit Marty
b090468109 Logout after 3 wrong PIN codes 2020-08-20 14:21:24 +02:00
Benoit Marty
4cba1388f9 Add support for biometrics (not only Fingerprint) 2020-08-20 14:11:23 +02:00
Benoit Marty
61caa3474b Merge pull request #1956 from vector-im/feature/fix_package_renaming_issues
Some cleanup after the package renaming thing
2020-08-20 13:58:13 +02:00
Benoit Marty
cd08c919e9 Merge pull request #1963 from vector-im/feature/cleanup
Improve user avatar setting
2020-08-20 13:56:43 +02:00
Benoit Marty
45ca480de1 Ganfra's review 2020-08-20 13:56:23 +02:00
Benoit Marty
95d05a9c28 Make the user's Avatar live in the general settings
Also remove unused class RoomAvatarPreference
2020-08-19 18:32:06 +02:00
Benoit Marty
db9c418622 We are already in a Coroutine scope, we can directly call execute() on the task.
-> It will prevent the callback from being called twice.
2020-08-19 18:04:22 +02:00
Ege Sertçetin
e860062553 Translated using Weblate (Turkish)
Currently translated at 66.7% (2 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/tr/
2020-08-19 15:42:50 +00:00
Ege Sertçetin
80fc66e097 Translated using Weblate (Turkish)
Currently translated at 65.0% (1194 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/tr/
2020-08-19 15:42:49 +00:00
Peter Vágner
6b89dfdc8d Translated using Weblate (Slovak)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/sk/
2020-08-19 15:42:46 +00:00
Marcelo Filho
97fa087496 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/pt_BR/
2020-08-19 15:42:46 +00:00
Marcelo Filho
312a5855c6 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-19 15:42:46 +00:00
Priit Jõerüüt
c8d95f701d Translated using Weblate (Estonian)
Currently translated at 76.4% (1403 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-19 15:42:45 +00:00
Benoit Marty
9b6c45e112 A Kick appears has "someone has made no change" (Fixes #1959) 2020-08-19 15:54:46 +02:00
Benoit Marty
482a8f1fb8 Merge pull request #1955 from vector-im/feature/fix_unique_filename
Fix save media error: Failed to build unique file
2020-08-19 14:44:37 +02:00
Onuray Sahin
eb109aa755 ktlint fix. 2020-08-19 13:15:42 +03:00
aethralis
4a4a544860 Translated using Weblate (Estonian)
Currently translated at 51.6% (948 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-18 18:17:42 +00:00
Benoit Marty
72f5f8b64b Merge pull request #1945 from vector-im/feature/update_element_config_file_parsing
Feature/update element config file parsing
2020-08-18 18:31:39 +02:00
Benoit Marty
0a296908a8 Merge branch 'develop' into feature/update_element_config_file_parsing 2020-08-18 18:31:28 +02:00
Benoit Marty
08292c874b Merge pull request #1943 from vector-im/feature/design_quick_win
Feature/design quick win
2020-08-18 18:30:25 +02:00
Benoit Marty
e76c32b74e Add missing copyright mention for PFLockScreen-Android 2020-08-18 18:21:20 +02:00
Benoit Marty
7613073373 Some cleanup after the package renaming thing 2020-08-18 18:15:48 +02:00
Onuray Sahin
2b0051887a Append current time to the filename before saving. 2020-08-18 18:54:59 +03:00
Peter Vágner
413c21505c Translated using Weblate (Slovak)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/sk/
2020-08-18 09:23:31 +00:00
Benoit Marty
8581d06931 Merge pull request #1948 from tilosp/api-21-cleanup
Remove old code that was used on devices with api level <21
2020-08-18 10:11:15 +02:00
Benoit Marty
9385bd2a10 Merge branch 'develop' into api-21-cleanup 2020-08-18 10:11:02 +02:00
Benoit Marty
131f4d1757 Merge pull request #1949 from tilosp/gradle-wrapper-validation
Official Gradle Wrapper Validation Action
2020-08-18 09:56:36 +02:00
Tilo Spannagel
861b379992 Official Gradle Wrapper Validation Action
See: https://github.com/gradle/wrapper-validation-action

Signed-off-by: Tilo Spannagel <development@tilosp.de>
2020-08-18 00:49:17 +02:00
Tilo Spannagel
87bc0c6c7a Set severity of ObsoleteSdkInt to error
Signed-off-by: Tilo Spannagel <development@tilosp.de>
2020-08-18 00:46:37 +02:00
Nikita Epifanov
5f3d6a6905 Translated using Weblate (Russian)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/ru/
2020-08-17 22:42:25 +00:00
Marcelo Filho
ce367f6e17 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/pt_BR/
2020-08-17 22:42:25 +00:00
Marcelo Filho
9660e147d4 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-17 22:42:25 +00:00
call_xz
5c2b4309cf Translated using Weblate (Japanese)
Currently translated at 50.4% (925 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ja/
2020-08-17 22:42:25 +00:00
Tuomas Hietala
788d72d6ca Translated using Weblate (Finnish)
Currently translated at 66.7% (2 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/fi/
2020-08-17 22:42:23 +00:00
Priit Jõerüüt
c982ebaca9 Translated using Weblate (Estonian)
Currently translated at 51.1% (938 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-17 22:42:23 +00:00
linsui
570f5ac375 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/zh_Hans/
2020-08-17 22:42:19 +00:00
Benoit Marty
a9ad3ac4f3 Merge pull request #1930 from yh-gao/best_localized_date_format
Fix date format for some Asian languages (#1928)
2020-08-17 23:57:40 +02:00
Tilo Spannagel
8c7956d935 Remove old code that was used on devices with api level <21
Signed-off-by: Tilo Spannagel <development@tilosp.de>
2020-08-17 21:20:39 +02:00
Benoit Marty
bde77784b9 Add internal 2020-08-17 19:46:44 +02:00
Benoit Marty
f012e23fa9 #1682: changelog 2020-08-17 19:42:21 +02:00
Benoit Marty
112f77c4e0 #1682: try to fetch config.domain.json 2020-08-17 19:39:29 +02:00
Benoit Marty
c11c28b406 #1682: parse "default_server_config" 2020-08-17 19:27:13 +02:00
Benoit Marty
189d2b2c06 Increase again font size 2020-08-17 19:08:32 +02:00
Benoit Marty
497b07b156 Fix color issue in dark and black themes (#961) 2020-08-17 18:02:23 +02:00
Benoit Marty
d74dc2053b Increase Font size on Calling screen (#1643)
And cleanup the layout
2020-08-17 16:48:40 +02:00
Benoit Marty
1b9b18851d Merge pull request #1906 from vector-im/feature/verify_developer_mode
Cleanup temporary code added during developpement
2020-08-17 16:32:28 +02:00
Benoit Marty
ac32d6bb29 Remove /verify command, it was added temporarily 2020-08-17 14:44:56 +02:00
Benoit Marty
1c48ba6b99 Remove actions that have been added only for debug purpose - step 1 2020-08-17 14:44:56 +02:00
Benoit Marty
35a5d9e454 Prevent click on Cross-Signing item when not in developer mode 2020-08-17 14:44:47 +02:00
Benoit Marty
550dcde9b8 Merge pull request #1914 from vector-im/feature/jitsi_native
Feature/jitsi native
2020-08-17 10:54:31 +02:00
Benoit Marty
7049c6e8ac Add Copyrigth notice for Jitsi library 2020-08-17 10:13:19 +02:00
Benoit Marty
9b1c01351c Adding jitsi.md documentation 2020-08-17 10:07:30 +02:00
LinAGKar
204db7b19b Translated using Weblate (Swedish)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/sv/
2020-08-16 21:42:28 +00:00
LinAGKar
93294be53e Translated using Weblate (Swedish)
Currently translated at 44.3% (814 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/sv/
2020-08-16 21:42:28 +00:00
Marcelo Filho
b06a72f944 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-16 21:42:21 +00:00
Hubert Chathi
abd478ad3c Translated using Weblate (German)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/de/
2020-08-16 21:42:21 +00:00
dccs
f91b99ec5e Translated using Weblate (German)
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-16 21:42:21 +00:00
Priit Jõerüüt
cfee0e4797 Translated using Weblate (Estonian)
Currently translated at 46.2% (849 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-16 21:42:20 +00:00
Yihong Gao
f9faf9c4d8 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-16 21:42:18 +00:00
Yihong Gao
e3b7f167ff Fix date format of some Asian languages (#1928)
With DateFormat.getBestDateTimePattern to generate best
localized pattern.

Signed-off-by: Yihong Gao <yihong.ui@gmail.com>
2020-08-15 18:32:22 -07:00
strix aluco
553e5e7aa0 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/uk/
2020-08-14 22:42:23 +00:00
strix aluco
6016e8f526 Translated using Weblate (Ukrainian)
Currently translated at 41.6% (763 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/uk/
2020-08-14 22:42:23 +00:00
rkfg
b2cd350115 Translated using Weblate (Russian)
Currently translated at 99.8% (1833 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-14 22:42:23 +00:00
Marcelo Filho
12a1828f04 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-14 22:42:23 +00:00
Rintan
133fd29a33 Translated using Weblate (Japanese)
Currently translated at 49.2% (903 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ja/
2020-08-14 22:42:23 +00:00
tatuya0902
9b8caf4f83 Translated using Weblate (Japanese)
Currently translated at 49.2% (903 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ja/
2020-08-14 22:42:22 +00:00
random
bbcd02a4c4 Translated using Weblate (Italian)
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/it/
2020-08-14 22:42:22 +00:00
notramo
2cdea80fef Translated using Weblate (Hungarian)
Currently translated at 94.1% (1727 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/hu/
2020-08-14 22:42:21 +00:00
aWeinzierl
023caf57d1 Translated using Weblate (German)
Currently translated at 100.0% (3 of 3 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/de/
2020-08-14 22:42:20 +00:00
Priit Jõerüüt
8ae3ffba32 Translated using Weblate (Estonian)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/et/
2020-08-14 22:42:20 +00:00
Priit Jõerüüt
8b994a1401 Translated using Weblate (Estonian)
Currently translated at 43.8% (805 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-14 22:42:19 +00:00
Jeff Huang
00615c9882 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (1836 of 1836 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hant/
2020-08-14 22:42:15 +00:00
Benoit Marty
e90d18a86b Lint: Ignore error from dropbox-core-sdk-3.0.8 lib, which comes with Jitsi library 2020-08-14 21:33:46 +02:00
Benoit Marty
05ecbf0f86 Build Jitsi lib version android-sdk-2.9.3, commit abcbbbea12e3ef88012b14723bb8cd42dbefc988
And host it in https://github.com/vector-im/jitsi_libre_maven/tree/master/android-sdk-2.9.3
2020-08-14 21:33:25 +02:00
Benoit Marty
85734e3581 Ensure that when user accept permission the native widget is well open
Before we were asking in loop until the sync comes back with the updated account data
2020-08-14 15:48:41 +02:00
Benoit Marty
4f8fd7b994 Benoit's review
- Cleanup
- Force refresh of HomeServerCapabilities
- add some doc
- remove dead code
- remove commented code
- remove duplicated comment
- use getBestName()
- improve code formatting
- Fix isAudioOnly parameter in jitsi url
- Fix layout issue between "Active conference" banner and "Jump to first unread message banner"
- Improve "Active conference" banner
- Remove Calendar permission from Manifest
2020-08-14 15:40:02 +02:00
Benoit Marty
68d128133c Merge pull request #1913 from vector-im/feature/RtlHardcoded
Fix RtlHardcoded issues
2020-08-14 11:47:01 +02:00
Valere
157f22ac2d Update change log 2020-08-14 10:12:55 +02:00
Valere
050ef659b3 Code quality
Fix neg margin + typo in jitsi
2020-08-14 10:10:08 +02:00
Valere
8c150aa3e8 klint 2020-08-14 10:00:02 +02:00
Valere
c911d9c7ff Check native widget permissions 2020-08-14 09:54:58 +02:00
Valere
3ce1e3e5d9 Add/Remove jitsi widget via option menu 2020-08-14 09:45:33 +02:00
Valere
42a24300a1 Initial commit jitsi 2020-08-14 09:31:24 +02:00
Benoit Marty
5a3894036c Merge pull request #1907 from vector-im/feature/display_device_key
Feature/display device key
2020-08-13 20:31:15 +02:00
Benoit Marty
15c9d68175 Merge branch 'develop' into feature/display_device_key 2020-08-13 20:31:07 +02:00
Benoit Marty
4f0111f331 Remove useless layout_marginLeft and layout_marginRight attributes
RtlHardoded: other error

RtlHardoded: paddingLeft / Right

RtlHardoded: other error

Fix RtlHardcoded issues (use `Start` and `End` instead of `Left` and `Right` layout attributes)
2020-08-13 18:49:19 +02:00
Benoit Marty
81a4b5edbc Merge pull request #1905 from vector-im/feature/refresh_device_list
Live sessions list
2020-08-13 17:13:36 +02:00
Benoit Marty
87c903a0fa Merge pull request #1900 from vector-im/feature/improve_ignore_user
Ensure users do not accidentally ignore other users (#1890)
2020-08-13 17:13:14 +02:00
Benoit Marty
3103fe970a Ensure users do not accidentally ignore other users (#1890)
- Wording: use "Ignore" instead of "Block" for consistency across the app and with other Element app
2020-08-13 16:44:32 +02:00
Benoit Marty
5fa22fedbb Cleanup dead code 2020-08-13 16:37:19 +02:00
Benoit Marty
e6f89b0b22 Display device information (name, id and key) in Cryptography setting screen (#1784) 2020-08-13 16:37:19 +02:00
Benoit Marty
d1b6cff663 Revert change (Valere's review) 2020-08-13 16:34:08 +02:00
Benoit Marty
3c8a4b80d2 Add missing Copyright 2020-08-13 16:31:46 +02:00
Benoit Marty
7a2454d816 Fix refreshing of sessions list when another session is logged out
Rx: use distinctUntilChanged() instead of distinct()
2020-08-13 16:27:04 +02:00
Benoit Marty
c9c787b11d Rename method
to merge
2020-08-13 16:24:51 +02:00
Benoit Marty
76788892c0 Merge pull request #1911 from vector-im/feature/rename_sdk_package
Rename package of SDK modules
2020-08-13 16:17:29 +02:00
Benoit Marty
cdc60cd453 Add missing Copyright 2020-08-13 15:41:05 +02:00
Benoit Marty
894f5b9ed3 Add copyright to SDK Kotlin source file 2020-08-13 15:41:05 +02:00
Benoit Marty
8f1adf6316 Ensure deserialization of previously stored objects still works
After package has been renamed from `im.vector.matrix.android` to `org.matrix.android.sdk`
2020-08-13 15:41:05 +02:00
Benoit Marty
11b5512cb8 Rename package of SDK modules 2020-08-13 12:50:58 +02:00
Benoit Marty
e3bf4c1e7b Merge pull request #1912 from vector-im/feature/post_weblate_sync
Post weblate sync
2020-08-13 12:47:22 +02:00
Benoit Marty
2d3359b70e Rename files, Weblate is expecting _ rather than - 2020-08-13 12:20:44 +02:00
Benoit Marty
a92e9040bf Fix lint issue UnusedQuantity and ensure it will be an error in the future 2020-08-13 12:15:15 +02:00
Benoit Marty
c8e5cde101 Fix lint issues 2020-08-13 12:08:01 +02:00
Benoit Marty
617558a1ca Format strings resource 2020-08-13 11:20:44 +02:00
Benoit Marty
753518fdc5 Merge pull request #1910 from RiotTranslateBot/weblate-element-android-element-app
Update from Weblate
2020-08-13 11:09:50 +02:00
Weblate
95e998b652 Merge branch 'origin/develop' into Weblate. 2020-08-13 08:48:02 +00:00
Marcelo Filho
dc17156024 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/pt_BR/
2020-08-13 06:42:18 +00:00
random
7299f938b5 Translated using Weblate (Italian)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/it/
2020-08-13 06:42:18 +00:00
@a2sc:matrix.org
6bf6c53969 Translated using Weblate (German)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/de/
2020-08-13 06:42:16 +00:00
linsui
c1b40442fa Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1 of 1 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/zh_Hans/
2020-08-13 06:42:16 +00:00
linsui
d8850e046a Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/zh_Hans/
2020-08-13 06:42:16 +00:00
Akarshan Biswas
fb09f58ac8 Translated using Weblate (Bengali (India))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/bn_IN/
2020-08-13 06:42:16 +00:00
AnonymousWebHacker
482c9ad451 Translated using Weblate (Spanish)
Currently translated at 73.8% (1353 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/es/
2020-08-12 17:54:27 +00:00
rkfg
0702d3593c Translated using Weblate (Russian)
Currently translated at 99.9% (1833 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-12 17:54:23 +00:00
Marcelo Filho
7efccab2af Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-12 17:54:22 +00:00
AmirAli Akbari
e364c78cc7 Translated using Weblate (Persian)
Currently translated at 32.3% (593 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/fa/
2020-08-12 17:54:00 +00:00
call_xz
e27632e253 Translated using Weblate (Japanese)
Currently translated at 48.4% (888 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ja/
2020-08-12 17:54:00 +00:00
random
93f2724f68 Translated using Weblate (Italian)
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/it/
2020-08-12 17:53:53 +00:00
@a2sc:matrix.org
1e56c70d6a Translated using Weblate (German)
Currently translated at 99.9% (1833 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-12 17:53:45 +00:00
Priit Jõerüüt
d836f9d1f8 Translated using Weblate (Estonian)
Currently translated at 39.4% (723 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-12 17:53:42 +00:00
Thomas Lee
d82d14c629 Translated using Weblate (Esperanto)
Currently translated at 25.3% (464 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/eo/
2020-08-12 17:53:30 +00:00
linsui
547f5634e5 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-12 17:53:25 +00:00
Akarshan Biswas
9dd61c2004 Translated using Weblate (Bengali (India))
Currently translated at 57.3% (1051 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/bn_IN/
2020-08-12 17:53:14 +00:00
Benoit Marty
bc3d7bdfc4 Merge pull request #1883 from vector-im/feature/confirm_call
Give user the possibility to prevent accidental call (#1869)
2020-08-12 11:54:58 +02:00
Benoit Marty
80d5368d75 Merge pull request #1898 from vector-im/feature/fix_crash
Fix crash reported by RageShake
2020-08-12 11:53:54 +02:00
Benoit Marty
ab9950ee73 Fix crash reported by RageShake 2020-08-12 10:49:54 +02:00
Yihong Gao
11ec53bcfc Translated using Weblate (Chinese (Simplified))
Currently translated at 91.8% (1683 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-12 02:45:37 +00:00
linsui
ca38d4ce70 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.8% (1683 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-12 02:45:35 +00:00
@a2sc:matrix.org
311eeb9260 Added translation using Weblate (Kurdish) 2020-08-11 22:24:49 +00:00
Benoit Marty
98aeee9c5a Merge pull request #1803 from czeidler/relative-date-time-formatter
Relative date time formatter #822
2020-08-11 12:45:49 +02:00
Benoit Marty
7b017e4328 Ensure we will always use Context#getSystemService extension function provided by core-ktx 2020-08-11 12:42:32 +02:00
Benoit Marty
b18a8744b2 Merge pull request #1702 from johnjohndoe/system-service
Use Context#getSystemService extension function provided by core-ktx.
2020-08-11 12:37:23 +02:00
Benoit Marty
247a34438b Merge pull request #1880 from vector-im/feature/theme_cleanup
Feature/theme cleanup
2020-08-11 10:41:38 +02:00
Benoit Marty
ebc7db2bc2 Update issue templates 2020-08-11 09:45:47 +02:00
rkfg
0f0f6b90dc Translated using Weblate (Russian)
Currently translated at 98.2% (1801 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-11 07:01:37 +00:00
Artyom
c17297ad15 Translated using Weblate (Russian)
Currently translated at 98.2% (1801 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-11 07:01:36 +00:00
Tobias Preuss
40f8e6061f Use "Context#getSystemService" extension function provided by "core-ktx".
+ Re-use local variable where possible.
2020-08-09 16:16:06 +02:00
aevw
0ab2f62e28 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 22:29:50 +00:00
Marcelo Filho
9bca325e07 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 22:29:50 +00:00
aevw
eb01c0c016 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 20:33:23 +00:00
Marcelo Filho
a76e222cb5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 20:33:23 +00:00
Marcelo Filho
ebe43497d5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 19:44:16 +00:00
aevw
f181f4e449 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 19:44:16 +00:00
Artyom
d144dcf7d9 Translated using Weblate (Russian)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/ru/
2020-08-07 14:42:27 +00:00
rkfg
0e6d296c87 Translated using Weblate (Russian)
Currently translated at 90.6% (1662 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-07 14:42:26 +00:00
Artyom
6dbefb212e Translated using Weblate (Russian)
Currently translated at 90.6% (1662 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-07 14:42:26 +00:00
Alexey Murz Korepov
e11bd9436b Translated using Weblate (Russian)
Currently translated at 90.6% (1662 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-07 14:42:24 +00:00
aevw
61373e6e8e Translated using Weblate (Portuguese (Brazil))
Currently translated at 92.0% (1688 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 14:42:23 +00:00
Marcelo Filho
aa7a0abad7 Translated using Weblate (Portuguese (Brazil))
Currently translated at 92.0% (1688 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 14:42:22 +00:00
Benoit Marty
c9d7559f03 Translated using Weblate (French)
Currently translated at 100.0% (1 of 1 strings)

Translation: Element Android/Element Android Store
Translate-URL: https://translate.riot.im/projects/element-android/element-store/fr/
2020-08-07 14:42:21 +00:00
Priit Jõerüüt
a6b7a65dfb Translated using Weblate (Estonian)
Currently translated at 30.1% (552 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-07 14:42:21 +00:00
Xidorn Quan
a0ecb6ecc2 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/zh_Hans/
2020-08-07 14:42:12 +00:00
linsui
3eb12ab116 Translated using Weblate (Chinese (Simplified))
Currently translated at 78.9% (1447 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-07 14:42:11 +00:00
Marcelo Filho
84a6d4a592 Translated using Weblate (Portuguese (Brazil))
Currently translated at 91.3% (1675 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 06:25:04 +00:00
aevw
66a7802e1b Translated using Weblate (Portuguese (Brazil))
Currently translated at 91.3% (1675 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-07 06:25:04 +00:00
Benoit Marty
fc510e86f7 ktlint 2020-08-06 17:20:14 +02:00
Xidorn Quan
0901075c9f Translated using Weblate (Chinese (Simplified))
Currently translated at 72.3% (1326 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-06 10:14:45 +00:00
linsui
6bb5835bea Translated using Weblate (Chinese (Simplified))
Currently translated at 72.3% (1326 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-06 10:14:44 +00:00
rkfg
0dd4563217 Translated using Weblate (Russian)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/ru/
2020-08-06 03:43:04 +00:00
Artyom
2b91482ec4 Translated using Weblate (Russian)
Currently translated at 88.7% (1626 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-06 03:43:04 +00:00
rkfg
4ca0a5acae Translated using Weblate (Russian)
Currently translated at 88.7% (1626 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/ru/
2020-08-06 03:42:55 +00:00
Marcelo Filho
b90be98679 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/pt_BR/
2020-08-06 03:42:54 +00:00
aevw
2c16fc467b Translated using Weblate (Portuguese (Brazil))
Currently translated at 62.5% (1146 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-06 03:42:51 +00:00
Marcelo Filho
87084e5065 Translated using Weblate (Portuguese (Brazil))
Currently translated at 62.5% (1146 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/pt_BR/
2020-08-06 03:42:38 +00:00
random
f0f0fcf9ba Translated using Weblate (Italian)
Currently translated at 94.8% (1739 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/it/
2020-08-06 03:42:36 +00:00
@a2sc:matrix.org
8ef97e9dc6 Translated using Weblate (German)
Currently translated at 99.1% (233 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/de/
2020-08-06 03:42:33 +00:00
aWeinzierl
dedc183e75 Translated using Weblate (German)
Currently translated at 99.1% (233 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/de/
2020-08-06 03:42:33 +00:00
@a2sc:matrix.org
d301a3e5d3 Translated using Weblate (German)
Currently translated at 99.9% (1832 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-06 03:42:32 +00:00
Priit Jõerüüt
199e3165f2 Translated using Weblate (Estonian)
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/et/
2020-08-06 03:42:31 +00:00
Priit Jõerüüt
1c66705c5a Translated using Weblate (Estonian)
Currently translated at 21.6% (397 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/et/
2020-08-06 03:42:30 +00:00
Jeff Huang
ac86a8948e Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (235 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/zh_Hant/
2020-08-06 03:42:21 +00:00
Jeff Huang
2e8f87b80d Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (1834 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hant/
2020-08-06 03:42:20 +00:00
linsui
a708a93f3e Translated using Weblate (Chinese (Simplified))
Currently translated at 74.5% (175 of 235 strings)

Translation: Element Android/Element Android Sdk
Translate-URL: https://translate.riot.im/projects/element-android/element-sdk/zh_Hans/
2020-08-06 03:42:13 +00:00
linsui
2ef4e9c378 Translated using Weblate (Chinese (Simplified))
Currently translated at 68.0% (1248 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/zh_Hans/
2020-08-06 03:42:13 +00:00
Benoit Marty
b8b8a12035 Update issue templates 2020-08-05 22:05:13 +02:00
Benoit Marty
087c5cb77c Update issue templates 2020-08-05 22:02:57 +02:00
Benoit Marty
02baf824f9 Give user the possibility to prevent accidental call (#1869) 2020-08-05 19:59:25 +02:00
Benoit Marty
b833198a3a Rework text selector 2020-08-05 19:34:19 +02:00
Benoit Marty
06d927a911 Rework tabbar style 2020-08-05 19:26:00 +02:00
Benoit Marty
7ab55d46c0 No need to overide with same value 2020-08-05 18:55:57 +02:00
Benoit Marty
8e81d6fe01 Rework attrs riotx_highlighted_message_background 2020-08-05 18:54:13 +02:00
Benoit Marty
85e6ef40a1 Rework attrs vctr_line_divider and vctr_pill_receipt 2020-08-05 18:49:22 +02:00
Benoit Marty
e1db7630d9 Remove unused resources 2020-08-05 18:35:09 +02:00
Benoit Marty
a343e25785 Remove useless method now that we are on API 21+ 2020-08-05 18:30:37 +02:00
Benoit Marty
0ad059359f R.drawable.vector_label_background for API 21 2020-08-05 18:27:59 +02:00
Benoit Marty
20336af84e R.drawable.bg_unread_notification for API 21 2020-08-05 18:21:13 +02:00
Benoit Marty
0a775444dd R.drawable.divider_horizontal for API 21 2020-08-05 18:19:20 +02:00
Benoit Marty
7fe30e464d Remove unused png 2020-08-05 18:12:10 +02:00
aWeinzierl
9c1e61992a Translated using Weblate (German)
Currently translated at 99.7% (1828 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-05 12:33:25 +00:00
@a2sc:matrix.org
d41036f861 Translated using Weblate (German)
Currently translated at 99.7% (1828 of 1834 strings)

Translation: Element Android/Element Android App
Translate-URL: https://translate.riot.im/projects/element-android/element-app/de/
2020-08-05 12:33:15 +00:00
Clemens Zeidler
159881645c Add change log entry 2020-08-05 21:04:26 +12:00
Clemens Zeidler
5e711f6c57 Fix relative date time formatting (#822)
The transitionResolution parameter has to go back to the beginning of
the day. In general, going back 24h is not enough.
2020-08-05 20:59:56 +12:00
Benoit Marty
16f80f35dd Remove unused resources 2020-08-04 17:31:14 +02:00
Benoit Marty
188aec9fc4 Remove unused attrs 2020-08-04 17:22:05 +02:00
Benoit Marty
deeb0d3303 Update Weblate URL to the brand new Weblate project 2020-08-04 14:58:52 +02:00
Benoit Marty
7a215d94d8 Merge pull request #1872 from vector-im/feature/weblate_element
Weblate for element
2020-08-04 12:45:00 +02:00
Benoit Marty
cf7770e47e Remove unused strings 2020-08-04 11:04:36 +02:00
Benoit Marty
6a8ac72b6a Remove riot ref 2020-08-04 09:13:29 +02:00
Benoit Marty
95bbdba141 Rework settings_notification_advanced_summary string 2020-08-04 09:13:29 +02:00
Benoit Marty
1ddeeba561 Little rework of default session public name 2020-08-04 09:13:29 +02:00
Benoit Marty
e95735c491 Remove unused strings 2020-08-04 09:12:16 +02:00
Benoit Marty
fa49e5cb4f Rename string id 2020-08-04 09:12:16 +02:00
Benoit Marty
a48302f433 Remove PlayStore strings from Android resource 2020-08-04 09:12:16 +02:00
Benoit Marty
ad1b2b4511 Add PlayStore description resources in the Triple-T format, to let Weblate handle them 2020-08-04 09:12:16 +02:00
Benoit Marty
0127339eac Merge pull request #1870 from vector-im/feature/rename_package
Rename packages
2020-08-04 09:11:38 +02:00
Benoit Marty
ab4a517ae0 Cleanup 2020-08-03 18:50:04 +02:00
Benoit Marty
8931fd314d Rename package im.vector.riotx to im.vector.app (other manual changes) 2020-08-03 18:48:20 +02:00
Benoit Marty
05b849de13 Rename package im.vector.riotx to im.vector.app (IDE, other variants) 2020-08-03 18:46:29 +02:00
Benoit Marty
a1f90abcd2 Rename package im.vector.riotx to im.vector.app (IDE) 2020-08-03 18:46:29 +02:00
Benoit Marty
67fc2feacb Rename package im.vector.riotx.multipicker to im.vector.lib.multipicker 2020-08-03 18:35:02 +02:00
Benoit Marty
d28c091f0a Rename package im.vector.riotx.attachmentviewer to im.vector.lib.attachmentviewer 2020-08-03 18:35:02 +02:00
Benoit Marty
b4af59728c Merge pull request #1867 from vector-im/feature/cleanup_after_ooo
Small cleanup, also to be aware of all the changes that occurred during my holidays.
2020-08-03 17:47:26 +02:00
Benoit Marty
025d5f7b4c Code readability 2020-08-03 17:33:24 +02:00
Benoit Marty
d531e88666 Key is private 2020-08-03 17:33:24 +02:00
Benoit Marty
ac845ad8c9 Hide Flair settings, this is not implemented yet. 2020-08-03 17:33:24 +02:00
Benoit Marty
ace7ff464b Banned users: use the counter as the title 2020-08-03 17:33:24 +02:00
Benoit Marty
562c6fbcce Naming convention 2020-08-03 17:33:24 +02:00
Benoit Marty
8cc12fb8d4 Only one token per request is possible so use header instead of addHeader 2020-08-03 17:33:24 +02:00
Benoit Marty
4cbb2f7d9d Cleanup 2020-08-03 17:33:24 +02:00
Benoit Marty
18c0f53764 Format 2020-08-03 17:33:24 +02:00
Benoit Marty
64d000ec53 Update PULL_REQUEST_TEMPLATE.md 2020-08-03 17:29:07 +02:00
Benoit Marty
8e84c099fa Merge pull request #1747 from vulet/develop
fix: invisible toolbar(status.im theme)
2020-08-03 16:59:30 +02:00
Benoit Marty
707b69e3e2 Merge branch 'develop' into develop 2020-08-03 16:58:52 +02:00
Valere
33f6e7e337 Version ++ 2020-08-03 14:04:31 +02:00
Valere
9178fd2b5c Merge branch 'hotfix/fix_crash_invite_user' into develop 2020-08-03 14:01:27 +02:00
Valere
69e499e497 Merge hotfix 2020-08-03 14:00:32 +02:00
Valere
1370ca7082 Merge branch 'hotfix/fix_crash_before_release' into develop 2020-08-03 12:23:55 +02:00
Valere
db6045778e Update change log 2020-08-03 12:11:50 +02:00
Valere
2810923519 FIx / Crash when opening Invite User screen 2020-08-03 12:00:08 +02:00
ganfra
7f326abcd0 Merge pull request #1844 from vector-im/feature/pin_code
Feature/pin code
2020-07-31 11:51:39 +02:00
ganfra
acf977577f Pin: clean code 2020-07-31 11:47:51 +02:00
ganfra
995c552f2a Merge branch 'develop' into feature/pin_code 2020-07-31 11:41:42 +02:00
ganfra
99ae1655f5 Pin: fix PopupAlertManager showing on top of PinCode 2020-07-31 11:34:24 +02:00
ganfra
7e45fe4509 Pin: add comment on UnlockActivity interface 2020-07-31 11:33:25 +02:00
Valere
531623178a Version ++ 2020-07-31 00:52:22 +02:00
Valere
7fddfa45e8 Merge branch 'release/1.0.3' 2020-07-31 00:02:02 +02:00
Valere
2b2fd3a356 Merge branch 'release/1.0.3' into develop 2020-07-31 00:02:02 +02:00
Valere
258acaf814 Prepare release 1.0.3 2020-07-31 00:01:33 +02:00
ganfra
a883d3ecdd Merge branch 'develop' into feature/pin_code 2020-07-30 18:49:13 +02:00
Valere
2f6cdc6529 Merge pull request #1847 from vector-im/feature/crash_store_mvrx
Fix IllegalArgumentException reported from store on HomeActivity aunch
2020-07-30 18:07:11 +02:00
Valere
1f226ca6c7 Merge pull request #1845 from vector-im/feature/admin_e2e_config
Feature/admin e2e config
2020-07-30 18:06:27 +02:00
ganfra
9475cb3b39 Update CHANGES 2020-07-30 17:25:49 +02:00
ganfra
eb0d350097 Merge branch 'develop' into feature/pin_code 2020-07-30 17:24:48 +02:00
Valere
c90f5ed370 Fix IllegalArgumentException reported from store on HomeActivity aunch 2020-07-30 17:03:11 +02:00
Valere
ccb466edbe Update change log 2020-07-30 16:57:25 +02:00
Valere
1204f6d9ce UX feedback, reduce severity of message 2020-07-30 15:25:10 +02:00
ganfra
efa1263c35 Pin: set back the grace period to 2 minutes 2020-07-30 15:22:41 +02:00
ganfra
06bd353d44 Pin: polish a bit and clean code 2020-07-30 14:58:46 +02:00
Valere
562cfce9e2 Support HS admin option to disable E2EE for DMs
Fixes #1794
2020-07-30 12:08:30 +02:00
ganfra
bb066b7c65 Add PinLocker to handle lock state 2020-07-29 20:19:01 +02:00
ganfra
37521d2d4f Pin: add settings to enable/disable 2020-07-29 16:11:57 +02:00
Valere
b732ea6c69 Version ++ 2020-07-29 11:39:23 +02:00
ganfra
5426e43cbb Create PinCodeStore and migrate code to fragment 2020-07-29 11:38:04 +02:00
Valere
a048f79b37 Merge branch 'release/1.0.2' 2020-07-29 10:46:54 +02:00
Valere
3214f7d3d5 Merge branch 'release/1.0.2' into develop 2020-07-29 10:46:54 +02:00
Valere
06ef665f66 prepare release 1.0.2 2020-07-29 10:33:55 +02:00
Valere
e1a07f1da6 Merge pull request #1838 from vector-im/feature/session_store_migration
Feature/session store migration
2020-07-29 10:31:14 +02:00
Valere
5c32c7388a cleaning 2020-07-29 09:51:50 +02:00
Valere
c04f22d3bf quick fix plural 2020-07-29 09:51:20 +02:00
Valere
cbf43ea7b3 Session store migration 2020-07-29 09:50:12 +02:00
Valere
9197275343 version++ 2020-07-29 09:00:29 +02:00
ganfra
ecdef52829 Continue PIN code library integration (fork required) 2020-07-28 20:22:59 +02:00
Valere
f26ce64914 Merge branch 'release/1.0.1' into develop 2020-07-28 18:03:36 +02:00
ganfra
cd38aa42aa Merge branch 'develop' into feature/pin_code 2020-07-28 17:49:36 +02:00
ganfra
a19a3f2a7f Merge branch 'develop' into feature/pin_code 2020-07-24 11:35:38 +02:00
vulet
f5b584ddb8 fix: invisible toolbar(status.im theme) 2020-07-20 00:15:45 +08:00
ganfra
c5f06386bd Continue trying to configure Pin library, stil WIP 2020-07-17 17:13:50 +02:00
ganfra
f5fbb2bc4f Setup screens for Pin 2020-07-17 13:29:18 +02:00
2601 changed files with 38227 additions and 20912 deletions

34
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve Element
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Smartphone (please complete the following information):**
- Device: [e.g. Samsung S6]
- OS: [e.g. Android 6.0]
**Additional context**
- App version and store [e.g. 1.0.0 - F-Droid]
- Homeserver: [e.g. matrix.org]
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: type:suggestion
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,10 +1,10 @@
### Pull Request Checklist
<!-- Please read [CONTRIBUTING.md](https://github.com/vector-im/riotX-android/blob/develop/CONTRIBUTING.md) before submitting your pull request -->
<!-- Please read [CONTRIBUTING.md](https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md) before submitting your pull request -->
- [ ] Changes has been tested on an Android device or Android emulator with API 16
- [ ] Changes has been tested on an Android device or Android emulator with API 21
- [ ] UI change has been tested on both light and dark themes
- [ ] Pull request is based on the develop branch
- [ ] Pull request updates [CHANGES.md](https://github.com/vector-im/riotX-android/blob/develop/CHANGES.md)
- [ ] Pull request updates [CHANGES.md](https://github.com/vector-im/element-android/blob/develop/CHANGES.md)
- [ ] Pull request includes screenshots or videos if containing UI changes
- [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#sign-off)

View File

@@ -0,0 +1,10 @@
name: "Validate Gradle Wrapper"
on: [push, pull_request]
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

View File

@@ -4,7 +4,16 @@
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />

View File

@@ -14,6 +14,7 @@
<w>gplay</w>
<w>hmac</w>
<w>homeserver</w>
<w>jitsi</w>
<w>ktlint</w>
<w>linkified</w>
<w>linkify</w>

View File

@@ -1,4 +1,4 @@
A full developer contributors list can be found [here](https://github.com/vector-im/riotX-android/graphs/contributors).
A full developer contributors list can be found [here](https://github.com/vector-im/element-android/graphs/contributors).
# Core team:

View File

@@ -1,3 +1,146 @@
Changes in Element 1.0.7 (2020-XX-XX)
===================================================
Features ✨:
-
Improvements 🙌:
- Handle date formatting properly (show time am/pm if needed, display year when needed)
Bugfix 🐛:
- Clear the notification when the event is read elsewhere (#1822)
Translations 🗣:
-
SDK API changes ⚠️:
-
Build 🧱:
-
Other changes:
- Performance: share Realm instance used on UI thread and improve SharedPreferences reading time.
Changes in Element 1.0.6 (2020-09-08)
===================================================
Features ✨:
- List phone numbers and emails added to the Matrix account, and add emails and phone numbers to account (#44, #45)
Improvements 🙌:
- You can now join room through permalink and within room directory search
- Add long click gesture to copy userId, user display name, room name, room topic and room alias (#1774)
- Fix several issues when uploading big files (#1889)
- Do not propose to verify session if there is only one session and 4S is not configured (#1901)
- Call screen does not use proximity sensor (#1735)
Bugfix 🐛:
- Display name not shown under Settings/General (#1926)
- Editing message forgets line breaks and markdown (#1939)
- Words containing my name should not trigger notifications (#1781)
- Fix changing language issue
- Fix FontSize issue (#1483, #1787)
- Fix bad color for settings icon on Android < 24 (#1786)
- Change user or room avatar: when selecting Gallery, I'm not proposed to crop the selected image (#1590)
- Loudspeaker is always used (#1685)
- Fix uploads still don't work with room v6 (#1879)
- Can't handle ongoing call events in background (#1992)
- Handle room, user and group links by the Element app (#1795)
- Update associated site domain (#1833)
- Crash / Attachment viewer: Cannot draw a recycled Bitmap #2034
- Login with Matrix-Id | Autodiscovery fails if identity server is invalid and Homeserver ok (#2027)
- Support for image compression on Android 10
- Verification popup won't show
- Android 6: App crash when read Contact permission is granted (#2064)
- JSON for verification events leaks in to the room list (#1246)
- Replies to poll appears in timeline as unsupported events during sending (#1004)
Translations 🗣:
- The SDK is now using SAS string translations from [Weblate Matrix-doc project](https://translate.riot.im/projects/matrix-doc/) (#1909)
- New translation to kabyle
Build 🧱:
- Some dependencies have been upgraded (coroutine, recyclerView, appCompat, core-ktx, firebase-messaging)
- Buildkite:
New pipeline location: https://github.com/matrix-org/pipelines/blob/master/element-android/pipeline.yml
New build location: https://buildkite.com/matrix-dot-org/element-android
Other changes:
- Use File extension functions to make code more concise (#1996)
- Create a script to import SAS strings (#1909)
- Support `data-mx-[bg-]color` attributes on `<font>` tags.
Changes in Element 1.0.5 (2020-08-21)
===================================================
Features :
- Protect access to the app by a pin code (#1700)
- Conference with Jitsi support (#43)
Improvements 🙌:
- Share button in rooms gives room ID link without via parameters (#1927)
- Give user the possibility to prevent accidental call (#1869)
- Display device information (name, id and key) in Cryptography setting screen (#1784)
- Ensure users do not accidentally ignore other users (#1890)
- Better handling DM creation when invitees cannot be inviting due to denied federation
- Support new config.json format and config.domain.json files (#1682)
- Increase Font size on Calling screen (#1643)
- Make the user's Avatar live in the general settings
Bugfix 🐛:
- Fix incorrect date format for some Asian languages (#1928)
- Fix invisible toolbar (Status.im theme) (#1746)
- Fix relative date time formatting (#822)
- Fix crash reported by RageShake
- Fix refreshing of sessions list when another session is logged out
- Fix IllegalArgumentException: Receiver not registered: NetworkInfoReceiver (#1960)
- Failed to build unique file (#1954)
- Highlighted Event when opening a permalink from another room (#1033)
- A Kick appears has "someone has made no change" (#1959)
- Avoid NetworkOnMainThreadException when setting a user avatar
- Renew turnserver credentials when ttl runs out
Translations 🗣:
- Add PlayStore description resources in the Triple-T format, to let Weblate handle them
SDK API changes :
- Rename package `im.vector.matrix.android` to `org.matrix.android.sdk`
- Rename package `im.vector.matrix.rx` to `org.matrix.android.sdk.rx`
Build 🧱:
- Fix RtlHardcoded issues (use `Start` and `End` instead of `Left` and `Right` layout attributes)
Other changes:
- Use `Context#getSystemService` extension function provided by `core-ktx` (#1702)
- Hide Flair settings, this is not implemented yet.
- Rename package `im.vector.riotx.attachmentviewer` to `im.vector.lib.attachmentviewer`
- Rename package `im.vector.riotx.multipicker` to `im.vector.lib.multipicker`
- Rename package `im.vector.riotx` to `im.vector.app`
- Remove old code that was used on devices with api level <21
- Add Official Gradle Wrapper Validation Action
Changes in Element 1.0.4 (2020-08-03)
===================================================
Bugfix 🐛:
- Fix Crash when opening invite to room user screen
Changes in Element 1.0.3 (2020-07-31)
===================================================
Features :
- Support server admin option to disable E2EE for DMs / private rooms [users can still enable] (#1794)
Bugfix 🐛:
- Crash reported on playstore for HomeActivity launch (151 reports)
Changes in Element 1.0.2 (2020-07-29)
===================================================
Improvements 🙌:
- Added Session Database migration to avoid unneeded initial syncs
Changes in Element 1.0.1 (2020-07-28)
===================================================

View File

@@ -40,7 +40,7 @@ For now, the Matrix SDK and the Element application are in the same project. So
## I want to help translating Element
If you want to fix an issue with an English string, please submit a PR.
If you want to fix an issue in other languages, or add a missing translation, or even add a new language, please use [Weblate](https://translate.riot.im/projects/riot-android/).
If you want to fix an issue in other languages, or add a missing translation, or even add a new language, please use [Weblate](https://translate.riot.im/projects/element-android/).
## I want to submit a PR to fix an issue

View File

@@ -1,9 +1,9 @@
[![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android/builds?branch=develop)
[![Weblate](https://translate.riot.im/widgets/riot-android/-/svg-badge.svg)](https://translate.riot.im/engage/riot-android/?utm_source=widget)
[![Buildkite](https://badge.buildkite.com/ad0065c1b70f557cd3b1d3d68f9c2154010f83c4d6f71706a9.svg?branch=develop)](https://buildkite.com/matrix-dot-org/element-android/builds?branch=develop)
[![Weblate](https://translate.riot.im/widgets/element-android/-/svg-badge.svg)](https://translate.riot.im/engage/element-android/?utm_source=widget)
[![Element Android Matrix room #element-android:matrix.org](https://img.shields.io/matrix/element-android:matrix.org.svg?label=%23element-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#element-android:matrix.org)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riotx&metric=alert_status)](https://sonarcloud.io/dashboard?id=vector.android.riotx)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riotx&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=vector.android.riotx)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riotx&metric=bugs)](https://sonarcloud.io/dashboard?id=vector.android.riotx)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.android&metric=alert_status)](https://sonarcloud.io/dashboard?id=im.vector.app.android)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.android&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=im.vector.app.android)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.android&metric=bugs)](https://sonarcloud.io/dashboard?id=im.vector.app.android)
# Element Android
@@ -14,11 +14,13 @@ It is a total rewrite of [Riot-Android](https://github.com/vector-im/riot-androi
[<img src="resources/img/google-play-badge.png" alt="Get it on Google Play" height="60">](https://play.google.com/store/apps/details?id=im.vector.app)
[<img src="resources/img/f-droid-badge.png" alt="Get it on F-Droid" height="60">](https://f-droid.org/app/im.vector.app)
Nightly build: [![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android/builds?branch=develop)
Nightly build: [![Buildkite](https://badge.buildkite.com/ad0065c1b70f557cd3b1d3d68f9c2154010f83c4d6f71706a9.svg?branch=develop)](https://buildkite.com/matrix-dot-org/element-android/builds?branch=develop)
# New Android SDK
Element is based on a new Android SDK fully written in Kotlin (like Element). In order to make the early development as fast as possible, Element and the new SDK currently share the same git repository. We will make separate repos once the SDK is stable enough.
Element is based on a new Android SDK fully written in Kotlin (like Element). In order to make the early development as fast as possible, Element and the new SDK currently share the same git repository.
At each Element release, the SDK module is copied to a dedicated repository: https://github.com/matrix-org/matrix-android-sdk2. That way, third party apps can add a regular gradle dependency to use it. So more details on how to do that here: https://github.com/matrix-org/matrix-android-sdk2.
# Roadmap
@@ -27,6 +29,6 @@ The team will work to add them on a regular basis.
## Contributing
Please refer to [CONTRIBUTING.md](https://github.com/vector-im/riotX-android/blob/develop/CONTRIBUTING.md) if you want to contribute on Matrix Android projects!
Please refer to [CONTRIBUTING.md](https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md) if you want to contribute on Matrix Android projects!
Come chat with the community in the dedicated Matrix [room](https://matrix.to/#/#element-android:matrix.org).

View File

@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="im.vector.riotx.attachmentviewer" />
<manifest package="im.vector.lib.attachmentviewer" />

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.view.View
import android.widget.ImageView
@@ -27,4 +27,9 @@ class AnimatedImageViewHolder constructor(itemView: View) :
val imageLoaderProgress: ProgressBar = itemView.findViewById(R.id.imageLoaderProgress)
internal val target = DefaultImageLoaderTarget(this, this.touchImageView)
override fun onRecycled() {
super.onRecycled()
touchImageView.setImageDrawable(null)
}
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
sealed class AttachmentEvents {
data class VideoEvent(val isPlaying: Boolean, val progress: Int, val duration: Int) : AttachmentEvents()

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.content.Context
import android.view.View

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.graphics.Color
import android.os.Bundle

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.view.LayoutInflater
import android.view.ViewGroup

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.view.View
import androidx.recyclerview.widget.RecyclerView

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.graphics.drawable.Animatable
import android.graphics.drawable.Drawable
@@ -50,6 +50,7 @@ internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, pri
override fun onLoadFailed(uid: String, errorDrawable: Drawable?) {
if (holder.boundResourceUid != uid) return
holder.imageLoaderProgress.isVisible = false
holder.touchImageView.setImageDrawable(errorDrawable)
}
override fun onResourceCleared(uid: String, placeholder: Drawable?) {
@@ -77,11 +78,13 @@ internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, pri
override fun onResourceLoading(uid: String, placeholder: Drawable?) {
if (holder.boundResourceUid != uid) return
holder.imageLoaderProgress.isVisible = true
holder.touchImageView.setImageDrawable(placeholder)
}
override fun onLoadFailed(uid: String, errorDrawable: Drawable?) {
if (holder.boundResourceUid != uid) return
holder.imageLoaderProgress.isVisible = false
holder.touchImageView.setImageDrawable(errorDrawable)
}
override fun onResourceCleared(uid: String, placeholder: Drawable?) {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
sealed class SwipeDirection {
object NotDetected : SwipeDirection()

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.content.Context
import android.view.MotionEvent

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.animation.Animator
import android.animation.AnimatorListenerAdapter

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.graphics.drawable.Drawable
import android.widget.ImageView
@@ -35,6 +35,7 @@ interface VideoLoaderTarget {
fun onVideoFileLoading(uid: String)
fun onVideoFileLoadFailed(uid: String)
fun onVideoFileReady(uid: String, file: File)
fun onVideoURLReady(uid: String, path: String)
}
internal class DefaultVideoLoaderTarget(val holder: VideoViewHolder, private val contextView: ImageView) : VideoLoaderTarget {
@@ -47,6 +48,8 @@ internal class DefaultVideoLoaderTarget(val holder: VideoViewHolder, private val
}
override fun onThumbnailResourceCleared(uid: String, placeholder: Drawable?) {
if (holder.boundResourceUid != uid) return
holder.thumbnailImage.setImageDrawable(placeholder)
}
override fun onThumbnailResourceReady(uid: String, resource: Drawable) {
@@ -68,9 +71,19 @@ internal class DefaultVideoLoaderTarget(val holder: VideoViewHolder, private val
override fun onVideoFileReady(uid: String, file: File) {
if (holder.boundResourceUid != uid) return
arrangeForVideoReady()
holder.videoReady(file)
}
override fun onVideoURLReady(uid: String, path: String) {
if (holder.boundResourceUid != uid) return
arrangeForVideoReady()
holder.videoReady(path)
}
private fun arrangeForVideoReady() {
holder.thumbnailImage.isVisible = false
holder.loaderProgressBar.isVisible = false
holder.videoView.isVisible = true
holder.videoReady(file)
}
}

View File

@@ -14,8 +14,9 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.ProgressBar
@@ -65,6 +66,13 @@ class VideoViewHolder constructor(itemView: View) :
}
}
fun videoReady(path: String) {
mVideoPath = path
if (isSelected) {
startPlaying()
}
}
fun videoFileLoadError() {
}
@@ -118,8 +126,13 @@ class VideoViewHolder constructor(itemView: View) :
eventListener?.get()?.onEvent(AttachmentEvents.VideoEvent(isPlaying, progress, duration))
}
}
try {
videoView.setVideoPath(mVideoPath)
} catch (failure: Throwable) {
// Couldn't open
Log.v(VideoViewHolder::class.java.name, "Failed to start video")
}
videoView.setVideoPath(mVideoPath)
if (!wasPaused) {
videoView.start()
if (progress > 0) {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.riotx.attachmentviewer
package im.vector.lib.attachmentviewer
import android.view.View
import android.widget.ProgressBar
@@ -39,4 +39,9 @@ class ZoomableImageViewHolder constructor(itemView: View) :
}
internal val target = DefaultImageLoaderTarget.ZoomableImageTarget(this, touchImageView)
override fun onRecycled() {
super.onRecycled()
touchImageView.setImageDrawable(null)
}
}

View File

@@ -41,6 +41,8 @@ allprojects {
includeGroupByRegex 'com\\.github\\.BillCarsonFr'
// PhotoView
includeGroupByRegex 'com\\.github\\.chrisbanes'
// PFLockScreen-Android
includeGroupByRegex 'com\\.github\\.vector-im'
}
}
maven {
@@ -50,6 +52,12 @@ allprojects {
}
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
// Jitsi repo
maven {
url "https://github.com/vector-im/jitsi_libre_maven/raw/master/android-sdk-2.9.3"
// Note: to test Jitsi release you can use a local file like this:
// url "file:///Users/bmarty/workspaces/jitsi_libre_maven/android-sdk-2.9.3"
}
google()
jcenter()
}
@@ -73,15 +81,15 @@ apply plugin: 'org.sonarqube'
sonarqube {
properties {
property "sonar.projectName", "RiotX-Android"
property "sonar.projectKey", "vector.android.riotx"
property "sonar.projectName", "Element-Android"
property "sonar.projectKey", "im.vector.app.android"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectVersion", project(":vector").android.defaultConfig.versionName
property "sonar.sourceEncoding", "UTF-8"
property "sonar.links.homepage", "https://github.com/vector-im/riotX-android/"
property "sonar.links.ci", "https://buildkite.com/matrix-dot-org/riotx-android"
property "sonar.links.scm", "https://github.com/vector-im/riotX-android/"
property "sonar.links.issue", "https://github.com/vector-im/riotX-android/issues"
property "sonar.links.homepage", "https://github.com/vector-im/element-android/"
property "sonar.links.ci", "https://buildkite.com/matrix-dot-org/element-android"
property "sonar.links.scm", "https://github.com/vector-im/element-android/"
property "sonar.links.issue", "https://github.com/vector-im/element-android/issues"
property "sonar.organization", "new_vector_ltd_organization"
property "sonar.login", project.hasProperty("SONAR_LOGIN") ? SONAR_LOGIN : "invalid"
}
@@ -92,11 +100,18 @@ project(":vector") {
properties {
property "sonar.sources", project(":vector").android.sourceSets.main.java.srcDirs
// exclude source code from analyses separated by a colon (:)
// property "sonar.exclusions", "**/*.*"
// Exclude Java source
property "sonar.exclusions", "**/BugReporterMultipartBody.java"
}
}
}
project(":diff-match-patch") {
sonarqube {
skipProject = true
}
}
//project(":matrix-sdk-android") {
// sonarqube {
// properties {

285
docs/add_threePids.md Normal file
View File

@@ -0,0 +1,285 @@
# Adding and removing ThreePids to an account
## Add email
### User enter the email
> POST https://homeserver.org/_matrix/client/r0/account/3pid/email/requestToken
```json
{
"email": "alice@email-provider.org",
"client_secret": "TixzvOnw7nLEUdiQEmkHzkXKrY4HhiGh",
"send_attempt": 1
}
```
#### The email is already added to an account
400
```json
{
"errcode": "M_THREEPID_IN_USE",
"error": "Email is already in use"
}
```
#### The email is free
Wording: "We've sent you an email to verify your address. Please follow the instructions there and then click the button below."
200
```json
{
"sid": "bxyDHuJKsdkjMlTJ"
}
```
## User receive an e-mail
> [homeserver.org] Validate your email
>
> A request to add an email address to your Matrix account has been received. If this was you, please click the link below to confirm adding this email:
https://homeserver.org/_matrix/client/unstable/add_threepid/email/submit_token?token=WUnEhQAmJrXupdEbXgdWvnVIKaGYZFsU&client_secret=TixzvOnw7nLEUdiQEmkHzkXKrY4HhiGh&sid=bxyDHuJKsdkjMlTJ
>
> If this was not you, you can safely ignore this email. Thank you.
### User clicks on the link
The browser displays the following message:
> Your email has now been validated, please return to your client. You may now close this window.
### User returns on Element
User clicks on CONTINUE
> POST https://homeserver.org/_matrix/client/r0/account/3pid/add
```json
{
"sid": "bxyDHuJKsdkjMlTJ",
"client_secret": "TixzvOnw7nLEUdiQEmkHzkXKrY4HhiGh"
}
```
401 User Interactive Authentication
```json
{
"session": "ppvvnozXCQZFaggUBlHJYPjA",
"flows": [
{
"stages": [
"m.login.password"
]
}
],
"params": {
}
}
```
### User enters his password
POST https://homeserver.org/_matrix/client/r0/account/3pid/add
```json
{
"sid": "bxyDHuJKsdkjMlTJ",
"client_secret": "TixzvOnw7nLEUdiQEmkHzkXKrY4HhiGh",
"auth": {
"session": "ppvvnozXCQZFaggUBlHJYPjA",
"type": "m.login.password",
"user": "@benoitx:matrix.org",
"password": "weak_password"
}
}
```
#### The link has not been clicked
400
```json
{
"errcode": "M_THREEPID_AUTH_FAILED",
"error": "No validated 3pid session found"
}
```
#### Wrong password
401
```json
{
"session": "fXHOvoQsPMhEebVqTnIrzZJN",
"flows": [
{
"stages": [
"m.login.password"
]
}
],
"params": {
},
"completed":[
],
"error": "Invalid password",
"errcode": "M_FORBIDDEN"
}
```
#### The link has been clicked and the account password is correct
200
```json
{}
```
## Remove email
### User want to remove an email from his account
> POST https://homeserver.org/_matrix/client/r0/account/3pid/delete
```json
{
"medium": "email",
"address": "alice@email-provider.org"
}
```
#### Email was not bound to an identity server
200
```json
{
"id_server_unbind_result": "no-support"
}
```
#### Email was bound to an identity server
200
```json
{
"id_server_unbind_result": "success"
}
```
## Add phone number
> POST https://homeserver.org/_matrix/client/r0/account/3pid/msisdn/requestToken
```json
{
"country": "FR",
"phone_number": "611223344",
"client_secret": "f1K29wFZBEr4RZYatu7xj8nEbXiVpr7J",
"send_attempt": 1
}
```
Note that the phone number is sent without `+` and without the country code
#### The phone number is already added to an account
400
```json
{
"errcode": "M_THREEPID_IN_USE",
"error": "MSISDN is already in use"
}
```
#### The phone number is free
Wording: "A text message has been sent to +33611223344. Please enter the verification code it contains."
200
```json
{
"msisdn": "33651547677",
"intl_fmt": "+33 6 51 54 76 77",
"success": true,
"sid": "253299954",
"submit_url": "https://homeserver.org/_matrix/client/unstable/add_threepid/msisdn/submit_token"
}
```
## User receive a text message
> Riot
> Your Riot validation code is 892541, please enter this into the app
### User enter the code to the app
#### Wrong code
> POST https://homeserver.org/_matrix/client/unstable/add_threepid/msisdn/submit_token
```json
{
"sid": "253299954",
"client_secret": "f1K29wFZBEr4RZYatu7xj8nEbXiVpr7J",
"token": "111111"
}
```
400
```json
{
"errcode": "M_UNKNOWN",
"error": "Error contacting the identity server"
}
```
This is not an ideal, but the client will display a hint to check the entered code to the user.
#### Correct code
> POST https://homeserver.org/_matrix/client/unstable/add_threepid/msisdn/submit_token
```json
{
"sid": "253299954",
"client_secret": "f1K29wFZBEr4RZYatu7xj8nEbXiVpr7J",
"token": "892541"
}
```
200
```json
{
"success": true
}
```
Then the app call `https://homeserver.org/_matrix/client/r0/account/3pid/add` as per adding an email and follow the same UIS flow
## Remove phone number
### User wants to remove a phone number from his account
This is the same request and response than to remove email, but with this body:
```json
{
"medium": "msisdn",
"address": "33611223344"
}
```
Note that the phone number is provided without `+`, but with the country code.

82
docs/jitsi.md Normal file
View File

@@ -0,0 +1,82 @@
# Jitsi in Element Android
Native Jitsi support has been added to Element Android by the PR [#1914](https://github.com/vector-im/element-android/pull/1914). The description of the PR contains some documentation about the behaviour in each possible room configuration.
Also, ensure to have a look on [the documentation from Element Web](https://github.com/vector-im/element-web/blob/develop/docs/jitsi.md)
The official documentation about how to integrate the Jitsi SDK in an Android app is available here: https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-android-sdk.
# Native Jitsi SDK
The Jitsi SDK is built by ourselves with the flag LIBRE_BUILD, to be able to be integrated on the F-Droid version of Element Android.
The generated maven repository is then host in the project https://github.com/vector-im/jitsi_libre_maven
## How to build the Jitsi Meet SDK
### Jitsi version
Update the script `./tools/jitsi/build_jisti_libs.sh` with the tag of the project `https://github.com/jitsi/jitsi-meet`.
Currently we are building the version with the tag `android-sdk-2.9.3`.
### Run the build script
At the root of the Element Android, run the following script:
```shell script
./tools/jitsi/build_jisti_libs.sh
```
It will build the Jitsi Meet Android library and put every generated files in the folder `/tmp/jitsi`
### Link with the new generated library
- Update the file `./build.gradle` to use the previously created local Maven repository. Currently we have this line:
```groovy
url "https://github.com/vector-im/jitsi_libre_maven/raw/master/android-sdk-2.9.3"
```
You can uncomment and update the line starting with `// url "file://...` and comment the line starting with `url`, to test the library using the locally generated Maven repository.
- Update the dependency of the WebRTC library in the file `./matrix-sdk-android/build.gradle`. Currently we have this line:
```groovy
implementation('com.facebook.react:react-native-webrtc:1.84.0-jitsi-5112273@aar')
```
- Update the dependency of the Jitsi Meet library in the file `./vector/build.gradle`. Currently we have this line:
```groovy
implementation('org.jitsi.react:jitsi-meet-sdk:2.9.3') { transitive = true }
```
- Perform a gradle sync and build the project
- Perform test
### Sanity tests
In order to validate that the upgrade of the Jitsi and WebRTC dependency does not break anything, the following sanity tests have to be performed, using two devices:
- Make 1-1 audio call (so using WebRTC)
- Make 1-1 video call (so using WebRTC)
- Create and join a conference call with audio only (so using Jitsi library). Leave the conference. Join it again.
- Create and join a conference call with audio and video (so using Jitsi library) Leave the conference. Join it again.
### Export the build library
If all the tests are passed, you can export the generated Jitsi library to our Maven repository.
- Clone the project https://github.com/vector-im/jitsi_libre_maven.
- Create a new folder with the version name.
- Copy every generated files form `/tmp/jitsi` to the folder you have just created.
- Commit and push the change on https://github.com/vector-im/jitsi_libre_maven.
- Update the file `./build.gradle` to use the previously created Maven repository. Currently we have this line:
```groovy
url "https://github.com/vector-im/jitsi_libre_maven/raw/master/android-sdk-2.9.3"
```
- Build the project and perform the sanity tests again.
- Update the file `/CANGES.md` to notify about the library upgrade, and create a regular PR for project Element Android.

View File

@@ -8,7 +8,9 @@ This document describes the flow of signin to a homeserver, and also the flow wh
Client request the sign-in flows, once the homeserver is chosen by the user and its url is known (in the example it's `https://matrix.org`)
> curl -X GET 'https://matrix.org/_matrix/client/r0/login'
```shell script
curl -X GET 'https://matrix.org/_matrix/client/r0/login'
```
200
@@ -26,7 +28,9 @@ Client request the sign-in flows, once the homeserver is chosen by the user and
The user is able to connect using `m.login.password`
> curl -X POST --data $'{"identifier":{"type":"m.id.user","user":"alice"},"password":"weak_password","type":"m.login.password","initial_device_display_name":"Portable"}' 'https://matrix.org/_matrix/client/r0/login'
```shell script
curl -X POST --data $'{"identifier":{"type":"m.id.user","user":"alice"},"password":"weak_password","type":"m.login.password","initial_device_display_name":"Portable"}' 'https://matrix.org/_matrix/client/r0/login'
```
```json
{
@@ -73,14 +77,16 @@ We get credential (200)
If the user has associated an email with its account, he can signin using the email.
> curl -X POST --data $'{"identifier":{"type":"m.id.thirdparty","medium":"email","address":"alice@yopmail.com"},"password":"weak_password","type":"m.login.password","initial_device_display_name":"Portable"}' 'https://matrix.org/_matrix/client/r0/login'
```shell script
curl -X POST --data $'{"identifier":{"type":"m.id.thirdparty","medium":"email","address":"alice@email-provider.org"},"password":"weak_password","type":"m.login.password","initial_device_display_name":"Portable"}' 'https://matrix.org/_matrix/client/r0/login'
```
```json
{
"identifier": {
"type": "m.id.thirdparty",
"medium": "email",
"address": "alice@yopmail.com"
"address": "alice@email-provider.org"
},
"password": "weak_password",
"type": "m.login.password",
@@ -136,7 +142,9 @@ Not supported yet in Element
### Login with SSO
> curl -X GET 'https://homeserver.with.sso/_matrix/client/r0/login'
```shell script
curl -X GET 'https://homeserver.with.sso/_matrix/client/r0/login'
```
200
@@ -171,7 +179,9 @@ Once the process is finished, the web page will call the `redirectUrl` with an e
This navigation is intercepted by Element by the `LoginActivity`, which will then ask the homeserver to convert this `loginToken` to an access token
> curl -X POST --data $'{"type":"m.login.token","token":"MDAxOWxvY2F0aW9uIG1vemlsbGEub3JnCjAwMTNpZGVudGlmaWVy"}' 'https://homeserver.with.sso/_matrix/client/r0/login'
```shell script
curl -X POST --data $'{"type":"m.login.token","token":"MDAxOWxvY2F0aW9uIG1vemlsbGEub3JnCjAwMTNpZGVudGlmaWVy"}' 'https://homeserver.with.sso/_matrix/client/r0/login'
```
```json
{
@@ -214,7 +224,9 @@ We display a warning regarding e2e.
At the first step, we do not send the password, only the email and a client secret, generated by the application
> curl -X POST --data $'{"client_secret":"6c57f284-85e2-421b-8270-fb1795a120a7","send_attempt":0,"email":"user@domain.com"}' 'https://matrix.org/_matrix/client/r0/account/password/email/requestToken'
```shell script
curl -X POST --data $'{"client_secret":"6c57f284-85e2-421b-8270-fb1795a120a7","send_attempt":0,"email":"user@domain.com"}' 'https://matrix.org/_matrix/client/r0/account/password/email/requestToken'
```
```json
{
@@ -251,7 +263,9 @@ During this step, the new password is sent to the homeserver.
If the user confirms before the link is clicked, we get an error:
> curl -X POST --data $'{"auth":{"type":"m.login.email.identity","threepid_creds":{"client_secret":"6c57f284-85e2-421b-8270-fb1795a120a7","sid":"tQNbrREDACTEDldA"}},"new_password":"weak_password"}' 'https://matrix.org/_matrix/client/r0/account/password'
```shell script
curl -X POST --data $'{"auth":{"type":"m.login.email.identity","threepid_creds":{"client_secret":"6c57f284-85e2-421b-8270-fb1795a120a7","sid":"tQNbrREDACTEDldA"}},"new_password":"weak_password"}' 'https://matrix.org/_matrix/client/r0/account/password'
```
```json
{
@@ -285,7 +299,9 @@ It contains the client secret, a token and the sid
When the user click the link, if validate his ownership and the new password can now be ent by the application (on user demand):
> curl -X POST --data $'{"auth":{"type":"m.login.email.identity","threepid_creds":{"client_secret":"6c57f284-85e2-421b-8270-fb1795a120a7","sid":"tQNbrREDACTEDldA"}},"new_password":"weak_password"}' 'https://matrix.org/_matrix/client/r0/account/password'
```shell script
curl -X POST --data $'{"auth":{"type":"m.login.email.identity","threepid_creds":{"client_secret":"6c57f284-85e2-421b-8270-fb1795a120a7","sid":"tQNbrREDACTEDldA"}},"new_password":"weak_password"}' 'https://matrix.org/_matrix/client/r0/account/password'
```
```json
{

View File

@@ -10,7 +10,9 @@ This document describes the flow of registration to a homeserver. Examples come
Client request the sign-up flows, once the homeserver is chosen by the user and its url is known (in the example it's `https://matrix.org`)
> curl -X POST --data $'{}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -70,7 +72,9 @@ If the registration is not possible, we get a 403
The app is displaying a form to enter username and password.
> curl -X POST --data $'{"initial_device_display_name":"Mobile device","username":"alice","password": "weak_password"}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{"initial_device_display_name":"Mobile device","username":"alice","password": "weak_password"}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -133,9 +137,11 @@ We get a 400:
### Step 2: entering email
User is proposed to enter an email. We skip this step.
User is proposed to enter an email. User skips this step.
> curl -X POST --data $'{"auth":{"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.dummy"}}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{"auth":{"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.dummy"}}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -189,16 +195,18 @@ User is proposed to enter an email. We skip this step.
}
```
### Step 2 bis: we enter an email
### Step 2 bis: user enters an email
We request a token to the homeserver. The `client_secret` is generated by the application
> curl -X POST --data $'{"client_secret":"53e679ea-oRED-ACTED-92b8-3012c49c6cfa","email":"alice@yopmail.com","send_attempt":0}' 'https://matrix.org/_matrix/client/r0/register/email/requestToken'
```shell script
curl -X POST --data $'{"client_secret":"53e679ea-oRED-ACTED-92b8-3012c49c6cfa","email":"alice@email-provider.org","send_attempt":0}' 'https://matrix.org/_matrix/client/r0/register/email/requestToken'
```
```json
{
"client_secret": "53e679ea-oRED-ACTED-92b8-3012c49c6cfa",
"email": "alice@yopmail.com",
"email": "alice@email-provider.org",
"send_attempt": 0
}
```
@@ -213,7 +221,9 @@ We request a token to the homeserver. The `client_secret` is generated by the ap
And
> curl -X POST --data $'{"auth":{"threepid_creds":{"client_secret":"53e679ea-oRED-ACTED-92b8-3012c49c6cfa","sid":"qlBCREDACTEDEtgxD"},"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.email.identity"}}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{"auth":{"threepid_creds":{"client_secret":"53e679ea-oRED-ACTED-92b8-3012c49c6cfa","sid":"qlBCREDACTEDEtgxD"},"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.email.identity"}}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -239,7 +249,9 @@ We get 401 since the email is not validated yet:
The app is now polling on
> curl -X POST --data $'{"auth":{"threepid_creds":{"client_secret":"53e679ea-oRED-ACTED-92b8-3012c49c6cfa","sid":"qlBCREDACTEDEtgxD"},"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.email.identity"}}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{"auth":{"threepid_creds":{"client_secret":"53e679ea-oRED-ACTED-92b8-3012c49c6cfa","sid":"qlBCREDACTEDEtgxD"},"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.email.identity"}}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -254,7 +266,7 @@ The app is now polling on
}
```
We click on the link received by email `https://matrix.org/_matrix/client/unstable/registration/email/submit_token?token=vtQjQIZfwdoREDACTEDozrmKYSWlCXsJ&client_secret=53e679ea-oRED-ACTED-92b8-3012c49c6cfa&sid=qlBCREDACTEDEtgxD` which contains:
User clicks on the link received by email `https://matrix.org/_matrix/client/unstable/registration/email/submit_token?token=vtQjQIZfwdoREDACTEDozrmKYSWlCXsJ&client_secret=53e679ea-oRED-ACTED-92b8-3012c49c6cfa&sid=qlBCREDACTEDEtgxD` which contains:
- A `token` vtQjQIZfwdoREDACTEDozrmKYSWlCXsJ
- The `client_secret`: 53e679ea-oRED-ACTED-92b8-3012c49c6cfa
- A `sid`: qlBCREDACTEDEtgxD
@@ -306,7 +318,9 @@ Once the link is clicked, the registration request (polling) returns a 401 with
User is proposed to accept T&C and he accepts them
> curl -X POST --data $'{"auth":{"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.terms"}}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{"auth":{"session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.terms"}}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -365,7 +379,9 @@ User is proposed to accept T&C and he accepts them
User is proposed to prove he is not a robot and he does it:
> curl -X POST --data $'{"auth":{"response":"03AOLTBLSiGS9GhFDpAMblJ2nlXOmHXqAYJ5OvHCPUjiVLBef3k9snOYI_BDC32-t4D2jv-tpvkaiEI_uloobFd9RUTPpJ7con2hMddbKjSCYqXqcUQFhzhbcX6kw8uBnh2sbwBe80_ihrHGXEoACXQkL0ki1Q0uEtOeW20YBRjbNABsZPpLNZhGIWC0QVXnQ4FouAtZrl3gOAiyM-oG3cgP6M9pcANIAC_7T2P2amAHbtsTlSR9CsazNyS-rtDR9b5MywdtnWN9Aw8fTJb8cXQk_j7nvugMxzofPjSOrPKcr8h5OqPlpUCyxxnFtag6cuaPSUwh43D2L0E-ZX7djzaY2Yh_U2n6HegFNPOQ22CJmfrKwDlodmAfMPvAXyq77n3HpoREDACTEDo3830RHF4BfkGXUaZjctgg-A1mvC17hmQmQpkG7IhDqyw0onU-0vF_-ehCjq_CcQEDpS_O3uiHJaG5xGf-0rhLm57v_wA3deugbsZuO4uTuxZZycN_mKxZ97jlDVBetl9hc_5REPbhcT1w3uzTCSx7Q","session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.recaptcha"}}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{"auth":{"response":"03AOLTBLSiGS9GhFDpAMblJ2nlXOmHXqAYJ5OvHCPUjiVLBef3k9snOYI_BDC32-t4D2jv-tpvkaiEI_uloobFd9RUTPpJ7con2hMddbKjSCYqXqcUQFhzhbcX6kw8uBnh2sbwBe80_ihrHGXEoACXQkL0ki1Q0uEtOeW20YBRjbNABsZPpLNZhGIWC0QVXnQ4FouAtZrl3gOAiyM-oG3cgP6M9pcANIAC_7T2P2amAHbtsTlSR9CsazNyS-rtDR9b5MywdtnWN9Aw8fTJb8cXQk_j7nvugMxzofPjSOrPKcr8h5OqPlpUCyxxnFtag6cuaPSUwh43D2L0E-ZX7djzaY2Yh_U2n6HegFNPOQ22CJmfrKwDlodmAfMPvAXyq77n3HpoREDACTEDo3830RHF4BfkGXUaZjctgg-A1mvC17hmQmQpkG7IhDqyw0onU-0vF_-ehCjq_CcQEDpS_O3uiHJaG5xGf-0rhLm57v_wA3deugbsZuO4uTuxZZycN_mKxZ97jlDVBetl9hc_5REPbhcT1w3uzTCSx7Q","session":"xptUYoREDACTEDogOWAGVnbJQ","type":"m.login.recaptcha"}}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -396,9 +412,11 @@ Some homeservers may require the user to enter MSISDN.
On matrix.org, it's not required, and not even optional, but it's still possible for the app to add a MSISDN during the registration.
The user enter a phone number and select a country, the `client_secret` is generated by the application
The user enters a phone number and selects a country, the `client_secret` is generated by the application
> curl -X POST --data $'{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","send_attempt":1,"country":"FR","phone_number":"+33611223344"}' 'https://matrix.org/_matrix/client/r0/register/msisdn/requestToken'
```shell script
curl -X POST --data $'{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","send_attempt":1,"country":"FR","phone_number":"+33611223344"}' 'https://matrix.org/_matrix/client/r0/register/msisdn/requestToken'
```
```json
{
@@ -430,10 +448,11 @@ If it is not the case, the homeserver send the SMS and returns some data, especi
}
```
When you execute the register request, with the received `sid`, you get an error since the MSISDN is not validated yet:
> curl -X POST --data $'{"auth":{"type":"m.login.msisdn","session":"xptUYoREDACTEDogOWAGVnbJQ","threepid_creds":{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","sid":"1678881798"}}}' 'https://matrix.org/_matrix/client/r0/register'
When we execute the register request, with the received `sid`, we get an error since the MSISDN is not validated yet:
```shell script
curl -X POST --data $'{"auth":{"type":"m.login.msisdn","session":"xptUYoREDACTEDogOWAGVnbJQ","threepid_creds":{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","sid":"1678881798"}}}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
"auth": {
@@ -492,7 +511,9 @@ There is an issue on Synapse, which return a 401, it sends too much data along w
The user receive the SMS, he can enter the SMS code in the app, which is sent using the "submit_url" received ie the response of the `requestToken` request:
> curl -X POST --data $'{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","sid":"1678881798","token":"123456"}' 'https://matrix.org/_matrix/client/unstable/add_threepid/msisdn/submit_token'
```shell script
curl -X POST --data $'{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","sid":"1678881798","token":"123456"}' 'https://matrix.org/_matrix/client/unstable/add_threepid/msisdn/submit_token'
```
```json
{
@@ -520,7 +541,9 @@ And if the code is correct we get a 200 with:
We can now execute the registration request, to the homeserver
> curl -X POST --data $'{"auth":{"type":"m.login.msisdn","session":"xptUYoREDACTEDogOWAGVnbJQ","threepid_creds":{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","sid":"1678881798"}}}' 'https://matrix.org/_matrix/client/r0/register'
```shell script
curl -X POST --data $'{"auth":{"type":"m.login.msisdn","session":"xptUYoREDACTEDogOWAGVnbJQ","threepid_creds":{"client_secret":"d3e285f6-972a-496c-9a22-7915a2db57c7","sid":"1678881798"}}}' 'https://matrix.org/_matrix/client/r0/register'
```
```json
{
@@ -535,7 +558,7 @@ We can now execute the registration request, to the homeserver
}
```
Now the homeserver consider that the `m.login.msisdn` step is completed (401):
Now the homeserver considers that the `m.login.msisdn` step is completed (401):
```json
{

View File

@@ -1,2 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="im.vector.matrix.rx" />
package="org.matrix.android.sdk.rx" />

View File

@@ -1,11 +1,12 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +15,7 @@
* limitations under the License.
*/
package im.vector.matrix.rx
package org.matrix.android.sdk.rx
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer

View File

@@ -1,11 +1,12 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,9 +15,9 @@
* limitations under the License.
*/
package im.vector.matrix.rx
package org.matrix.android.sdk.rx
import im.vector.matrix.android.api.util.Optional
import org.matrix.android.sdk.api.util.Optional
import io.reactivex.Observable
fun <T : Any> Observable<Optional<T>>.unwrap(): Observable<T> {

View File

@@ -1,11 +1,12 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,10 +15,10 @@
* limitations under the License.
*/
package im.vector.matrix.rx
package org.matrix.android.sdk.rx
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.util.Cancelable
import org.matrix.android.sdk.api.MatrixCallback
import org.matrix.android.sdk.api.util.Cancelable
import io.reactivex.Completable
import io.reactivex.Single

View File

@@ -1,11 +1,12 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,24 +15,24 @@
* limitations under the License.
*/
package im.vector.matrix.rx
package org.matrix.android.sdk.rx
import android.net.Uri
import im.vector.matrix.android.api.query.QueryStringValue
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.identity.ThreePid
import im.vector.matrix.android.api.session.room.Room
import im.vector.matrix.android.api.session.room.members.RoomMemberQueryParams
import im.vector.matrix.android.api.session.room.model.EventAnnotationsSummary
import im.vector.matrix.android.api.session.room.model.ReadReceipt
import im.vector.matrix.android.api.session.room.model.RoomHistoryVisibility
import im.vector.matrix.android.api.session.room.model.RoomMemberSummary
import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.matrix.android.api.session.room.notification.RoomNotificationState
import im.vector.matrix.android.api.session.room.send.UserDraft
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
import im.vector.matrix.android.api.util.Optional
import im.vector.matrix.android.api.util.toOptional
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.identity.ThreePid
import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.api.session.room.members.RoomMemberQueryParams
import org.matrix.android.sdk.api.session.room.model.EventAnnotationsSummary
import org.matrix.android.sdk.api.session.room.model.ReadReceipt
import org.matrix.android.sdk.api.session.room.model.RoomHistoryVisibility
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.notification.RoomNotificationState
import org.matrix.android.sdk.api.session.room.send.UserDraft
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.api.util.toOptional
import io.reactivex.Completable
import io.reactivex.Observable
import io.reactivex.Single

View File

@@ -1,11 +1,12 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,38 +15,38 @@
* limitations under the License.
*/
package im.vector.matrix.rx
package org.matrix.android.sdk.rx
import androidx.paging.PagedList
import im.vector.matrix.android.api.extensions.orFalse
import im.vector.matrix.android.api.query.QueryStringValue
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.crypto.crosssigning.KEYBACKUP_SECRET_SSSS_NAME
import im.vector.matrix.android.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
import im.vector.matrix.android.api.session.crypto.crosssigning.MXCrossSigningInfo
import im.vector.matrix.android.api.session.crypto.crosssigning.SELF_SIGNING_KEY_SSSS_NAME
import im.vector.matrix.android.api.session.crypto.crosssigning.USER_SIGNING_KEY_SSSS_NAME
import im.vector.matrix.android.api.session.group.GroupSummaryQueryParams
import im.vector.matrix.android.api.session.group.model.GroupSummary
import im.vector.matrix.android.api.session.identity.ThreePid
import im.vector.matrix.android.api.session.pushers.Pusher
import im.vector.matrix.android.api.session.room.RoomSummaryQueryParams
import im.vector.matrix.android.api.session.room.members.ChangeMembershipState
import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.matrix.android.api.session.room.model.create.CreateRoomParams
import im.vector.matrix.android.api.session.sync.SyncState
import im.vector.matrix.android.api.session.user.model.User
import im.vector.matrix.android.api.session.widgets.model.Widget
import im.vector.matrix.android.api.util.JsonDict
import im.vector.matrix.android.api.util.Optional
import im.vector.matrix.android.api.util.toOptional
import im.vector.matrix.android.internal.crypto.model.CryptoDeviceInfo
import im.vector.matrix.android.internal.crypto.model.rest.DeviceInfo
import im.vector.matrix.android.internal.crypto.store.PrivateKeysInfo
import im.vector.matrix.android.api.session.accountdata.UserAccountDataEvent
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.functions.Function3
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.crypto.crosssigning.KEYBACKUP_SECRET_SSSS_NAME
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
import org.matrix.android.sdk.api.session.crypto.crosssigning.SELF_SIGNING_KEY_SSSS_NAME
import org.matrix.android.sdk.api.session.crypto.crosssigning.USER_SIGNING_KEY_SSSS_NAME
import org.matrix.android.sdk.api.session.group.GroupSummaryQueryParams
import org.matrix.android.sdk.api.session.group.model.GroupSummary
import org.matrix.android.sdk.api.session.identity.ThreePid
import org.matrix.android.sdk.api.session.pushers.Pusher
import org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
import org.matrix.android.sdk.api.session.sync.SyncState
import org.matrix.android.sdk.api.session.user.model.User
import org.matrix.android.sdk.api.session.widgets.model.Widget
import org.matrix.android.sdk.api.util.JsonDict
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.api.util.toOptional
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceInfo
import org.matrix.android.sdk.internal.crypto.store.PrivateKeysInfo
class RxSession(private val session: Session) {
@@ -70,7 +71,7 @@ class RxSession(private val session: Session) {
}
}
fun liveMyDeviceInfo(): Observable<List<DeviceInfo>> {
fun liveMyDevicesInfo(): Observable<List<DeviceInfo>> {
return session.cryptoService().getLiveMyDevicesInfo().asObservable()
.startWithCallable {
session.cryptoService().getMyDevicesInfo()
@@ -109,6 +110,11 @@ class RxSession(private val session: Session) {
.startWithCallable { session.getThreePids() }
}
fun livePendingThreePIds(): Observable<List<ThreePid>> {
return session.getPendingThreePidsLive().asObservable()
.startWithCallable { session.getPendingThreePids() }
}
fun createRoom(roomParams: CreateRoomParams): Single<String> = singleBuilder {
session.createRoom(roomParams, it)
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2020 New Vector Ltd
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +15,7 @@
* limitations under the License.
*/
package im.vector.matrix.rx
package org.matrix.android.sdk.rx
data class SecretsSynchronisationInfo(
val isBackupSetup: Boolean,

View File

@@ -112,18 +112,18 @@ dependencies {
def moshi_version = '1.8.0'
def lifecycle_version = '2.2.0'
def arch_version = '2.1.0'
def coroutines_version = "1.3.2"
def coroutines_version = "1.3.8"
def markwon_version = '3.1.0'
def daggerVersion = '2.25.4'
def work_version = '2.3.3'
def work_version = '2.4.0'
def retrofit_version = '2.6.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.core:core-ktx:1.3.0"
implementation "androidx.appcompat:appcompat:1.2.0"
implementation "androidx.core:core-ktx:1.3.1"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
@@ -131,9 +131,12 @@ dependencies {
// Network
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
implementation "com.squareup.retrofit2:converter-scalars:$retrofit_version"
implementation 'com.squareup.okhttp3:okhttp:4.2.2'
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.8.1"))
implementation 'com.squareup.okhttp3:okhttp'
implementation 'com.squareup.okhttp3:logging-interceptor'
implementation 'com.squareup.okhttp3:okhttp-urlconnection'
implementation "com.squareup.moshi:moshi-adapters:$moshi_version"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
@@ -141,7 +144,6 @@ dependencies {
// Image
implementation 'androidx.exifinterface:exifinterface:1.3.0-alpha01'
implementation 'id.zelory:compressor:3.0.0'
// Database
implementation 'com.github.Zhuinden:realm-monarchy:0.5.1'
@@ -174,8 +176,10 @@ dependencies {
implementation 'com.googlecode.libphonenumber:libphonenumber:8.10.23'
// Web RTC
// TODO meant for development purposes only. See http://webrtc.github.io/webrtc-org/native-code/android/
implementation 'org.webrtc:google-webrtc:1.0.+'
// org.webrtc:google-webrtc is for development purposes only. See http://webrtc.github.io/webrtc-org/native-code/android/
// implementation 'org.webrtc:google-webrtc:1.0.+'
// Use the same WebRTC library than the one used by Jitsi library
implementation('com.facebook.react:react-native-webrtc:1.84.0-jitsi-5112273@aar')
debugImplementation 'com.airbnb.okreplay:okreplay:1.5.0'
releaseImplementation 'com.airbnb.okreplay:noop:1.5.0'

View File

@@ -29,5 +29,6 @@
<issue id="SetTextI18n" severity="error" />
<issue id="ViewConstructor" severity="error" />
<issue id="UseValueOf" severity="error" />
<issue id="ObsoleteSdkInt" severity="error" />
</lint>

View File

@@ -1,278 +0,0 @@
/*
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.internal.session.room.send
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import org.commonmark.parser.Parser
import org.commonmark.renderer.html.HtmlRenderer
import org.commonmark.renderer.text.TextContentRenderer
import org.junit.Assert.assertEquals
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
/**
* It will not be possible to test all combinations. For the moment I add a few tests, then, depending on the problem discovered in the wild,
* we can add more tests to cover the edge cases.
* Some tests are suffixed with `_not_passing`, maybe one day we will fix them...
* Riot-Web should be used as a reference for expected results, but not always. Especially Riot-Web add lots of `\n` in the
* formatted body, which is quite useless.
* Also Riot-Web does not provide plain text body when formatted text is provided. The body contains what the user has entered.
* See https://matrix.org/docs/spec/client_server/latest#m-room-message-msgtypes
*/
@Suppress("SpellCheckingInspection")
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
class MarkdownParserTest : InstrumentedTest {
/**
* Create the same parser than in the RoomModule
*/
private val markdownParser = MarkdownParser(
Parser.builder().build(),
HtmlRenderer.builder().build(),
TextContentRenderer.builder().build()
)
@Test
fun parseNoMarkdown() {
testIdentity("")
testIdentity("a")
testIdentity("1")
testIdentity("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et " +
"dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea com" +
"modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pari" +
"atur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
}
@Test
fun parseSpaces() {
testIdentity(" ")
testIdentity(" ")
testIdentity("\n")
}
@Test
fun parseNewLines() {
testIdentity("line1\nline2")
testIdentity("line1\nline2\nline3")
}
@Test
fun parseBold() {
testType(
name = "bold",
markdownPattern = "**",
htmlExpectedTag = "strong"
)
}
@Test
fun parseItalic() {
testType(
name = "italic",
markdownPattern = "*",
htmlExpectedTag = "em"
)
}
@Test
fun parseItalic2() {
// Riot-Web format
"_italic_".let { markdownParser.parse(it) }.expect("italic", "<em>italic</em>")
}
/**
* Note: the test is not passing, it does not work on Riot-Web neither
*/
@Test
fun parseStrike_not_passing() {
testType(
name = "strike",
markdownPattern = "~~",
htmlExpectedTag = "del"
)
}
@Test
fun parseCode() {
testType(
name = "code",
markdownPattern = "`",
htmlExpectedTag = "code",
plainTextPrefix = "\"",
plainTextSuffix = "\""
)
}
@Test
fun parseCode2() {
testType(
name = "code",
markdownPattern = "``",
htmlExpectedTag = "code",
plainTextPrefix = "\"",
plainTextSuffix = "\""
)
}
@Test
fun parseCode3() {
testType(
name = "code",
markdownPattern = "```",
htmlExpectedTag = "code",
plainTextPrefix = "\"",
plainTextSuffix = "\""
)
}
@Test
fun parseUnorderedList() {
"- item1".let { markdownParser.parse(it).expect(it, "<ul><li>item1</li></ul>") }
"- item1\n- item2".let { markdownParser.parse(it).expect(it, "<ul><li>item1</li><li>item2</li></ul>") }
}
@Test
fun parseOrderedList() {
"1. item1".let { markdownParser.parse(it).expect(it, "<ol><li>item1</li></ol>") }
"1. item1\n2. item2".let { markdownParser.parse(it).expect(it, "<ol><li>item1</li><li>item2</li></ol>") }
}
@Test
fun parseHorizontalLine() {
"---".let { markdownParser.parse(it) }.expect("***", "<hr />")
}
@Test
fun parseH2AndContent() {
"a\n---\nb".let { markdownParser.parse(it) }.expect("a\nb", "<h2>a</h2><p>b</p>")
}
@Test
fun parseQuote() {
"> quoted".let { markdownParser.parse(it) }.expect("«quoted»", "<blockquote><p>quoted</p></blockquote>")
}
@Test
fun parseQuote_not_passing() {
"> quoted\nline2".let { markdownParser.parse(it) }.expect("«quoted\nline2»", "<blockquote><p>quoted<br/>line2</p></blockquote>")
}
@Test
fun parseBoldItalic() {
"*italic* **bold**".let { markdownParser.parse(it) }.expect("italic bold", "<em>italic</em> <strong>bold</strong>")
"**bold** *italic*".let { markdownParser.parse(it) }.expect("bold italic", "<strong>bold</strong> <em>italic</em>")
}
@Test
fun parseHead() {
"# head1".let { markdownParser.parse(it) }.expect("head1", "<h1>head1</h1>")
"## head2".let { markdownParser.parse(it) }.expect("head2", "<h2>head2</h2>")
"### head3".let { markdownParser.parse(it) }.expect("head3", "<h3>head3</h3>")
"#### head4".let { markdownParser.parse(it) }.expect("head4", "<h4>head4</h4>")
"##### head5".let { markdownParser.parse(it) }.expect("head5", "<h5>head5</h5>")
"###### head6".let { markdownParser.parse(it) }.expect("head6", "<h6>head6</h6>")
}
@Test
fun parseHeads() {
"# head1\n# head2".let { markdownParser.parse(it) }.expect("head1\nhead2", "<h1>head1</h1><h1>head2</h1>")
}
@Test
fun parseBoldNewLines_not_passing() {
"**bold**\nline2".let { markdownParser.parse(it) }.expect("bold\nline2", "<strong>bold</strong><br />line2")
}
@Test
fun parseLinks() {
"[link](target)".let { markdownParser.parse(it) }.expect(""""link" (target)""", """<a href="target">link</a>""")
}
@Test
fun parseParagraph() {
"# head\ncontent".let { markdownParser.parse(it) }.expect("head\ncontent", "<h1>head</h1><p>content</p>")
}
private fun testIdentity(text: String) {
markdownParser.parse(text).expect(text, null)
}
private fun testType(name: String,
markdownPattern: String,
htmlExpectedTag: String,
plainTextPrefix: String = "",
plainTextSuffix: String = "") {
// Test simple case
"$markdownPattern$name$markdownPattern"
.let { markdownParser.parse(it) }
.expect(expectedText = "$plainTextPrefix$name$plainTextSuffix",
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag>")
// Test twice the same tag
"$markdownPattern$name$markdownPattern and $markdownPattern$name bis$markdownPattern"
.let { markdownParser.parse(it) }
.expect(expectedText = "$plainTextPrefix$name$plainTextSuffix and $plainTextPrefix$name bis$plainTextSuffix",
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag> and <$htmlExpectedTag>$name bis</$htmlExpectedTag>")
val textBefore = "a"
val textAfter = "b"
// With sticked text before
"$textBefore$markdownPattern$name$markdownPattern"
.let { markdownParser.parse(it) }
.expect(expectedText = "$textBefore$plainTextPrefix$name$plainTextSuffix",
expectedFormattedText = "$textBefore<$htmlExpectedTag>$name</$htmlExpectedTag>")
// With text before and space
"$textBefore $markdownPattern$name$markdownPattern"
.let { markdownParser.parse(it) }
.expect(expectedText = "$textBefore $plainTextPrefix$name$plainTextSuffix",
expectedFormattedText = "$textBefore <$htmlExpectedTag>$name</$htmlExpectedTag>")
// With sticked text after
"$markdownPattern$name$markdownPattern$textAfter"
.let { markdownParser.parse(it) }
.expect(expectedText = "$plainTextPrefix$name$plainTextSuffix$textAfter",
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag>$textAfter")
// With space and text after
"$markdownPattern$name$markdownPattern $textAfter"
.let { markdownParser.parse(it) }
.expect(expectedText = "$plainTextPrefix$name$plainTextSuffix $textAfter",
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag> $textAfter")
// With sticked text before and text after
"$textBefore$markdownPattern$name$markdownPattern$textAfter"
.let { markdownParser.parse(it) }
.expect(expectedText = "$textBefore$plainTextPrefix$name$plainTextSuffix$textAfter",
expectedFormattedText = "a<$htmlExpectedTag>$name</$htmlExpectedTag>$textAfter")
// With text before and after, with spaces
"$textBefore $markdownPattern$name$markdownPattern $textAfter"
.let { markdownParser.parse(it) }
.expect(expectedText = "$textBefore $plainTextPrefix$name$plainTextSuffix $textAfter",
expectedFormattedText = "$textBefore <$htmlExpectedTag>$name</$htmlExpectedTag> $textAfter")
}
private fun TextContent.expect(expectedText: String, expectedFormattedText: String?) {
assertEquals("TextContent are not identical", TextContent(expectedText, expectedFormattedText), this)
}
}

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,11 +14,11 @@
* limitations under the License.
*/
package im.vector.matrix.android
package org.matrix.android.sdk
import android.content.Context
import androidx.test.core.app.ApplicationProvider
import im.vector.matrix.android.test.shared.createTimberTestRule
import org.matrix.android.sdk.test.shared.createTimberTestRule
import org.junit.Rule
import java.io.File

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android;
package org.matrix.android.sdk;
import androidx.annotation.Nullable;
import androidx.lifecycle.LiveData;

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android;
package org.matrix.android.sdk;
import android.os.Handler;
import android.os.Looper;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android
package org.matrix.android.sdk
import okreplay.OkReplayConfig
import okreplay.PermissionRule

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package im.vector.matrix.android
package org.matrix.android.sdk
import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers
import org.matrix.android.sdk.internal.util.MatrixCoroutineDispatchers
import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.asCoroutineDispatcher
import java.util.concurrent.Executors

View File

@@ -14,13 +14,13 @@
* limitations under the License.
*/
package im.vector.matrix.android.account
package org.matrix.android.sdk.account
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.SessionTestParams
import im.vector.matrix.android.common.TestConstants
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith

View File

@@ -14,13 +14,13 @@
* limitations under the License.
*/
package im.vector.matrix.android.account
package org.matrix.android.sdk.account
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.failure.isInvalidPassword
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.SessionTestParams
import im.vector.matrix.android.common.TestConstants
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.failure.isInvalidPassword
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.amshove.kluent.shouldBeTrue
import org.junit.FixMethodOrder
import org.junit.Test

View File

@@ -14,17 +14,17 @@
* limitations under the License.
*/
package im.vector.matrix.android.account
package org.matrix.android.sdk.account
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.auth.data.LoginFlowResult
import im.vector.matrix.android.api.auth.registration.RegistrationResult
import im.vector.matrix.android.api.failure.Failure
import im.vector.matrix.android.api.failure.MatrixError
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.SessionTestParams
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.common.TestMatrixCallback
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.auth.data.LoginFlowResult
import org.matrix.android.sdk.api.auth.registration.RegistrationResult
import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.api.failure.MatrixError
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.common.TestMatrixCallback
import org.junit.Assert.assertTrue
import org.junit.FixMethodOrder
import org.junit.Test

View File

@@ -14,23 +14,21 @@
* limitations under the License.
*/
package im.vector.matrix.android.api
package org.matrix.android.sdk.api
import android.content.Context
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.work.Configuration
import androidx.work.WorkManager
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.BuildConfig
import im.vector.matrix.android.api.auth.AuthenticationService
import im.vector.matrix.android.common.DaggerTestMatrixComponent
import im.vector.matrix.android.internal.SessionManager
import im.vector.matrix.android.internal.crypto.attachments.ElementToDecrypt
import im.vector.matrix.android.internal.crypto.attachments.MXEncryptedAttachments
import im.vector.matrix.android.internal.network.UserAgentHolder
import im.vector.matrix.android.internal.util.BackgroundDetectionObserver
import org.matrix.android.sdk.BuildConfig
import org.matrix.android.sdk.api.auth.AuthenticationService
import org.matrix.android.sdk.api.legacy.LegacySessionImporter
import org.matrix.android.sdk.common.DaggerTestMatrixComponent
import org.matrix.android.sdk.internal.SessionManager
import org.matrix.android.sdk.internal.network.UserAgentHolder
import org.matrix.android.sdk.internal.util.BackgroundDetectionObserver
import org.matrix.olm.OlmManager
import java.io.InputStream
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject
@@ -39,8 +37,9 @@ import javax.inject.Inject
* This is the main entry point to the matrix sdk.
* To get the singleton instance, use getInstance static method.
*/
class Matrix private constructor(context: Context, matrixConfiguration: MatrixConfiguration) {
class Matrix private constructor(context: Context, matrixConfiguration: MatrixConfiguration) {
@Inject internal lateinit var legacySessionImporter: LegacySessionImporter
@Inject internal lateinit var authenticationService: AuthenticationService
@Inject internal lateinit var userAgentHolder: UserAgentHolder
@Inject internal lateinit var backgroundDetectionObserver: BackgroundDetectionObserver
@@ -62,6 +61,10 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
return authenticationService
}
fun legacySessionImporter(): LegacySessionImporter {
return legacySessionImporter
}
companion object {
private lateinit var instance: Matrix
@@ -90,9 +93,5 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
fun getSdkVersion(): String {
return BuildConfig.VERSION_NAME + " (" + BuildConfig.GIT_SDK_REVISION + ")"
}
fun decryptStream(inputStream: InputStream?, elementToDecrypt: ElementToDecrypt): InputStream? {
return MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt)
}
}
}

View File

@@ -15,27 +15,27 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import android.content.Context
import android.net.Uri
import androidx.lifecycle.Observer
import im.vector.matrix.android.api.Matrix
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.MatrixConfiguration
import im.vector.matrix.android.api.auth.data.HomeServerConnectionConfig
import im.vector.matrix.android.api.auth.data.LoginFlowResult
import im.vector.matrix.android.api.auth.registration.RegistrationResult
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.Room
import im.vector.matrix.android.api.session.room.model.message.MessageContent
import im.vector.matrix.android.api.session.room.send.SendState
import im.vector.matrix.android.api.session.room.timeline.Timeline
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
import im.vector.matrix.android.api.session.room.timeline.TimelineSettings
import im.vector.matrix.android.api.session.sync.SyncState
import org.matrix.android.sdk.api.Matrix
import org.matrix.android.sdk.api.MatrixCallback
import org.matrix.android.sdk.api.MatrixConfiguration
import org.matrix.android.sdk.api.auth.data.HomeServerConnectionConfig
import org.matrix.android.sdk.api.auth.data.LoginFlowResult
import org.matrix.android.sdk.api.auth.registration.RegistrationResult
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
import org.matrix.android.sdk.api.session.room.send.SendState
import org.matrix.android.sdk.api.session.room.timeline.Timeline
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.session.room.timeline.TimelineSettings
import org.matrix.android.sdk.api.session.sync.SyncState
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import im.vector.matrix.android.api.session.Session
import org.matrix.android.sdk.api.session.Session
data class CryptoTestData(val firstSession: Session,
val roomId: String,

View File

@@ -14,32 +14,32 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import android.os.SystemClock
import android.util.Log
import androidx.lifecycle.Observer
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.crypto.verification.IncomingSasVerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.OutgoingSasVerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.VerificationMethod
import im.vector.matrix.android.api.session.crypto.verification.VerificationTxState
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toContent
import im.vector.matrix.android.api.session.room.Room
import im.vector.matrix.android.api.session.room.model.Membership
import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.matrix.android.api.session.room.model.create.CreateRoomParams
import im.vector.matrix.android.api.session.room.roomSummaryQueryParams
import im.vector.matrix.android.api.session.room.timeline.Timeline
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
import im.vector.matrix.android.api.session.room.timeline.TimelineSettings
import im.vector.matrix.android.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import im.vector.matrix.android.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
import im.vector.matrix.android.internal.crypto.keysbackup.model.MegolmBackupAuthData
import im.vector.matrix.android.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.verification.IncomingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.OutgoingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationMethod
import org.matrix.android.sdk.api.session.crypto.verification.VerificationTxState
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toContent
import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.api.session.room.model.Membership
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
import org.matrix.android.sdk.api.session.room.roomSummaryQueryParams
import org.matrix.android.sdk.api.session.room.timeline.Timeline
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.session.room.timeline.TimelineSettings
import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupAuthData
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import org.matrix.android.sdk.internal.crypto.model.rest.UserPasswordAuth
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import im.vector.matrix.android.internal.session.TestInterceptor
import org.matrix.android.sdk.internal.session.TestInterceptor
import okhttp3.Interceptor
import okhttp3.Protocol
import okhttp3.Request

View File

@@ -14,6 +14,6 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
data class SessionTestParams @JvmOverloads constructor(val withInitialSync: Boolean = false)

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import android.os.Debug

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import androidx.annotation.CallSuper
import im.vector.matrix.android.api.MatrixCallback
import org.matrix.android.sdk.api.MatrixCallback
import org.junit.Assert.fail
import timber.log.Timber
import java.util.concurrent.CountDownLatch

View File

@@ -14,17 +14,17 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import android.content.Context
import dagger.BindsInstance
import dagger.Component
import im.vector.matrix.android.api.MatrixConfiguration
import im.vector.matrix.android.internal.auth.AuthModule
import im.vector.matrix.android.internal.di.MatrixComponent
import im.vector.matrix.android.internal.di.MatrixModule
import im.vector.matrix.android.internal.di.MatrixScope
import im.vector.matrix.android.internal.di.NetworkModule
import org.matrix.android.sdk.api.MatrixConfiguration
import org.matrix.android.sdk.internal.auth.AuthModule
import org.matrix.android.sdk.internal.di.MatrixComponent
import org.matrix.android.sdk.internal.di.MatrixModule
import org.matrix.android.sdk.internal.di.MatrixScope
import org.matrix.android.sdk.internal.di.NetworkModule
@Component(modules = [TestModule::class, MatrixModule::class, NetworkModule::class, AuthModule::class, TestNetworkModule::class])
@MatrixScope

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import dagger.Binds
import dagger.Module
import im.vector.matrix.android.internal.di.MatrixComponent
import org.matrix.android.sdk.internal.di.MatrixComponent
@Module
internal abstract class TestModule {

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package im.vector.matrix.android.common
package org.matrix.android.sdk.common
import dagger.Module
import dagger.Provides
import im.vector.matrix.android.internal.session.MockHttpInterceptor
import im.vector.matrix.android.internal.session.TestInterceptor
import org.matrix.android.sdk.internal.session.MockHttpInterceptor
import org.matrix.android.sdk.internal.session.TestInterceptor
@Module
internal object TestNetworkModule {

View File

@@ -14,22 +14,22 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto
package org.matrix.android.sdk.internal.crypto
import android.os.MemoryFile
import android.util.Base64
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.internal.crypto.attachments.MXEncryptedAttachments
import im.vector.matrix.android.internal.crypto.model.rest.EncryptedFileInfo
import im.vector.matrix.android.internal.crypto.model.rest.EncryptedFileKey
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Assert.assertNotNull
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import java.io.ByteArrayInputStream
import org.matrix.android.sdk.internal.crypto.attachments.MXEncryptedAttachments
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileInfo
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileKey
import org.matrix.android.sdk.internal.crypto.attachments.toElementToDecrypt
import java.io.ByteArrayOutputStream
import java.io.InputStream
/**
@@ -41,29 +41,26 @@ import java.io.InputStream
class AttachmentEncryptionTest {
private fun checkDecryption(input: String, encryptedFileInfo: EncryptedFileInfo): String {
val `in` = Base64.decode(input, Base64.DEFAULT)
val inputAsByteArray = Base64.decode(input, Base64.DEFAULT)
val inputStream: InputStream
inputStream = if (`in`.isEmpty()) {
ByteArrayInputStream(`in`)
inputStream = if (inputAsByteArray.isEmpty()) {
inputAsByteArray.inputStream()
} else {
val memoryFile = MemoryFile("file" + System.currentTimeMillis(), `in`.size)
memoryFile.outputStream.write(`in`)
val memoryFile = MemoryFile("file" + System.currentTimeMillis(), inputAsByteArray.size)
memoryFile.outputStream.write(inputAsByteArray)
memoryFile.inputStream
}
val decryptedStream = MXEncryptedAttachments.decryptAttachment(inputStream, encryptedFileInfo)
val decryptedStream = ByteArrayOutputStream()
val result = MXEncryptedAttachments.decryptAttachment(inputStream, encryptedFileInfo.toElementToDecrypt()!!, decryptedStream)
assertNotNull(decryptedStream)
assert(result)
val buffer = ByteArray(100)
val toByteArray = decryptedStream.toByteArray()
val len = decryptedStream!!.read(buffer)
decryptedStream.close()
return Base64.encodeToString(buffer, 0, len, Base64.DEFAULT).replace("\n".toRegex(), "").replace("=".toRegex(), "")
return Base64.encodeToString(toByteArray, 0, toByteArray.size, Base64.DEFAULT).replace("\n".toRegex(), "").replace("=".toRegex(), "")
}
@Test
@@ -74,7 +71,7 @@ class AttachmentEncryptionTest {
key = EncryptedFileKey(
alg = "A256CTR",
k = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
key_ops = listOf("encrypt", "decrypt"),
keyOps = listOf("encrypt", "decrypt"),
kty = "oct",
ext = true
),
@@ -93,7 +90,7 @@ class AttachmentEncryptionTest {
key = EncryptedFileKey(
alg = "A256CTR",
k = "__________________________________________8",
key_ops = listOf("encrypt", "decrypt"),
keyOps = listOf("encrypt", "decrypt"),
kty = "oct",
ext = true
),
@@ -112,7 +109,7 @@ class AttachmentEncryptionTest {
key = EncryptedFileKey(
alg = "A256CTR",
k = "__________________________________________8",
key_ops = listOf("encrypt", "decrypt"),
keyOps = listOf("encrypt", "decrypt"),
kty = "oct",
ext = true
),
@@ -133,7 +130,7 @@ class AttachmentEncryptionTest {
key = EncryptedFileKey(
alg = "A256CTR",
k = "__________________________________________8",
key_ops = listOf("encrypt", "decrypt"),
keyOps = listOf("encrypt", "decrypt"),
kty = "oct",
ext = true
),

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto
package org.matrix.android.sdk.internal.crypto
import im.vector.matrix.android.api.auth.data.Credentials
import im.vector.matrix.android.internal.crypto.store.IMXCryptoStore
import im.vector.matrix.android.internal.crypto.store.db.RealmCryptoStore
import im.vector.matrix.android.internal.crypto.store.db.RealmCryptoStoreModule
import im.vector.matrix.android.internal.crypto.store.db.mapper.CrossSigningKeysMapper
import im.vector.matrix.android.internal.di.MoshiProvider
import org.matrix.android.sdk.api.auth.data.Credentials
import org.matrix.android.sdk.internal.crypto.store.IMXCryptoStore
import org.matrix.android.sdk.internal.crypto.store.db.RealmCryptoStore
import org.matrix.android.sdk.internal.crypto.store.db.RealmCryptoStoreModule
import org.matrix.android.sdk.internal.crypto.store.db.mapper.CrossSigningKeysMapper
import org.matrix.android.sdk.internal.di.MoshiProvider
import io.realm.RealmConfiguration
import kotlin.random.Random

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto
package org.matrix.android.sdk.internal.crypto
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.internal.crypto.model.OlmSessionWrapper
import im.vector.matrix.android.internal.crypto.store.IMXCryptoStore
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.internal.crypto.model.OlmSessionWrapper
import org.matrix.android.sdk.internal.crypto.store.IMXCryptoStore
import io.realm.Realm
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto
package org.matrix.android.sdk.internal.crypto
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert.assertEquals

View File

@@ -14,25 +14,25 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto
package org.matrix.android.sdk.internal.crypto
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.extensions.tryThis
import im.vector.matrix.android.api.session.crypto.MXCryptoError
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.timeline.Timeline
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
import im.vector.matrix.android.api.session.room.timeline.TimelineSettings
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.internal.crypto.model.OlmSessionWrapper
import im.vector.matrix.android.internal.crypto.model.event.EncryptedEventContent
import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth
import im.vector.matrix.android.internal.crypto.store.db.deserializeFromRealm
import im.vector.matrix.android.internal.crypto.store.db.serializeForRealm
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.extensions.tryThis
import org.matrix.android.sdk.api.session.crypto.MXCryptoError
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.timeline.Timeline
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.session.room.timeline.TimelineSettings
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.model.OlmSessionWrapper
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent
import org.matrix.android.sdk.internal.crypto.model.rest.UserPasswordAuth
import org.matrix.android.sdk.internal.crypto.store.db.deserializeFromRealm
import org.matrix.android.sdk.internal.crypto.store.db.serializeForRealm
import org.amshove.kluent.shouldBe
import org.junit.Assert
import org.junit.Before

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.crosssigning
package org.matrix.android.sdk.internal.crypto.crosssigning
import org.amshove.kluent.shouldBeNull
import org.amshove.kluent.shouldBeTrue

View File

@@ -1,14 +1,14 @@
package im.vector.matrix.android.internal.crypto.crosssigning
package org.matrix.android.sdk.internal.crypto.crosssigning
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.SessionTestParams
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.internal.crypto.model.CryptoDeviceInfo
import im.vector.matrix.android.internal.crypto.model.MXUsersDevicesMap
import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.MXUsersDevicesMap
import org.matrix.android.sdk.internal.crypto.model.rest.UserPasswordAuth
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull

View File

@@ -14,33 +14,33 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.gossiping
package org.matrix.android.sdk.internal.crypto.gossiping
import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.session.crypto.verification.IncomingSasVerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.SasVerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.VerificationMethod
import im.vector.matrix.android.api.session.crypto.verification.VerificationService
import im.vector.matrix.android.api.session.crypto.verification.VerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.VerificationTxState
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.model.RoomDirectoryVisibility
import im.vector.matrix.android.api.session.room.model.create.CreateRoomParams
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.SessionTestParams
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.internal.crypto.GossipingRequestState
import im.vector.matrix.android.internal.crypto.OutgoingGossipingRequestState
import im.vector.matrix.android.internal.crypto.crosssigning.DeviceTrustLevel
import im.vector.matrix.android.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import im.vector.matrix.android.internal.crypto.keysbackup.model.rest.KeysVersion
import im.vector.matrix.android.internal.crypto.model.CryptoDeviceInfo
import im.vector.matrix.android.internal.crypto.model.MXUsersDevicesMap
import im.vector.matrix.android.internal.crypto.model.event.EncryptedEventContent
import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.session.crypto.verification.IncomingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.SasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationMethod
import org.matrix.android.sdk.api.session.crypto.verification.VerificationService
import org.matrix.android.sdk.api.session.crypto.verification.VerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationTxState
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.RoomDirectoryVisibility
import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.GossipingRequestState
import org.matrix.android.sdk.internal.crypto.OutgoingGossipingRequestState
import org.matrix.android.sdk.internal.crypto.crosssigning.DeviceTrustLevel
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersion
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.MXUsersDevicesMap
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent
import org.matrix.android.sdk.internal.crypto.model.rest.UserPasswordAuth
import junit.framework.TestCase.assertEquals
import junit.framework.TestCase.assertNotNull
import junit.framework.TestCase.assertTrue

View File

@@ -14,23 +14,23 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.gossiping
package org.matrix.android.sdk.internal.crypto.gossiping
import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.NoOpMatrixCallback
import im.vector.matrix.android.api.extensions.tryThis
import im.vector.matrix.android.api.session.crypto.MXCryptoError
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.MockOkHttpInterceptor
import im.vector.matrix.android.common.SessionTestParams
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.internal.crypto.model.event.EncryptedEventContent
import im.vector.matrix.android.internal.crypto.model.event.WithHeldCode
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.NoOpMatrixCallback
import org.matrix.android.sdk.api.extensions.tryThis
import org.matrix.android.sdk.api.session.crypto.MXCryptoError
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.MockOkHttpInterceptor
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent
import org.matrix.android.sdk.internal.crypto.model.event.WithHeldCode
import org.junit.Assert
import org.junit.FixMethodOrder
import org.junit.Test

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.keysbackup
package org.matrix.android.sdk.internal.crypto.keysbackup
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.listeners.ProgressListener
import im.vector.matrix.android.common.assertByteArrayNotEqual
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.listeners.ProgressListener
import org.matrix.android.sdk.common.assertByteArrayNotEqual
import org.junit.Assert.assertArrayEquals
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.keysbackup
package org.matrix.android.sdk.internal.crypto.keysbackup
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestData
import im.vector.matrix.android.internal.crypto.model.OlmInboundGroupSessionWrapper2
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestData
import org.matrix.android.sdk.internal.crypto.model.OlmInboundGroupSessionWrapper2
/**
* Data class to store result of [KeysBackupTestHelper.createKeysBackupScenarioWithPassword]

View File

@@ -14,25 +14,25 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.keysbackup
package org.matrix.android.sdk.internal.crypto.keysbackup
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.listeners.ProgressListener
import im.vector.matrix.android.api.listeners.StepProgressListener
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupState
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupStateListener
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.common.TestMatrixCallback
import im.vector.matrix.android.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
import im.vector.matrix.android.internal.crypto.crosssigning.DeviceTrustLevel
import im.vector.matrix.android.internal.crypto.keysbackup.model.KeysBackupVersionTrust
import im.vector.matrix.android.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import im.vector.matrix.android.internal.crypto.keysbackup.model.rest.KeysVersion
import im.vector.matrix.android.internal.crypto.keysbackup.model.rest.KeysVersionResult
import im.vector.matrix.android.internal.crypto.model.ImportRoomKeysResult
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.listeners.ProgressListener
import org.matrix.android.sdk.api.listeners.StepProgressListener
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupState
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupStateListener
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.common.TestMatrixCallback
import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
import org.matrix.android.sdk.internal.crypto.crosssigning.DeviceTrustLevel
import org.matrix.android.sdk.internal.crypto.keysbackup.model.KeysBackupVersionTrust
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersion
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersionResult
import org.matrix.android.sdk.internal.crypto.model.ImportRoomKeysResult
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.keysbackup
package org.matrix.android.sdk.internal.crypto.keysbackup
import im.vector.matrix.android.common.SessionTestParams
import org.matrix.android.sdk.common.SessionTestParams
object KeysBackupTestConstants {
val defaultSessionParams = SessionTestParams(withInitialSync = false)

View File

@@ -14,20 +14,20 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.keysbackup
package org.matrix.android.sdk.internal.crypto.keysbackup
import im.vector.matrix.android.api.listeners.ProgressListener
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupService
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupState
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupStateListener
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.assertDictEquals
import im.vector.matrix.android.common.assertListEquals
import im.vector.matrix.android.internal.crypto.MegolmSessionData
import im.vector.matrix.android.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import im.vector.matrix.android.internal.crypto.keysbackup.model.rest.KeysVersion
import org.matrix.android.sdk.api.listeners.ProgressListener
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupService
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupState
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupStateListener
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.assertDictEquals
import org.matrix.android.sdk.common.assertListEquals
import org.matrix.android.sdk.internal.crypto.MegolmSessionData
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersion
import org.junit.Assert
import java.util.concurrent.CountDownLatch

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.keysbackup
package org.matrix.android.sdk.internal.crypto.keysbackup
import im.vector.matrix.android.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
data class PrepareKeysBackupDataResult(val megolmBackupCreationInfo: MegolmBackupCreationInfo,
val version: String)

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.keysbackup
package org.matrix.android.sdk.internal.crypto.keysbackup
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupService
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupState
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupStateListener
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupService
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupState
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupStateListener
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import java.util.concurrent.CountDownLatch

View File

@@ -14,28 +14,28 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.ssss
package org.matrix.android.sdk.internal.crypto.ssss
import androidx.lifecycle.Observer
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.securestorage.EncryptedSecretContent
import im.vector.matrix.android.api.session.securestorage.KeySigner
import im.vector.matrix.android.api.session.securestorage.RawBytesKeySpec
import im.vector.matrix.android.api.session.securestorage.SecretStorageKeyContent
import im.vector.matrix.android.api.session.securestorage.SharedSecretStorageService
import im.vector.matrix.android.api.session.securestorage.SsssKeyCreationInfo
import im.vector.matrix.android.api.util.Optional
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.SessionTestParams
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.common.TestMatrixCallback
import im.vector.matrix.android.internal.crypto.SSSS_ALGORITHM_AES_HMAC_SHA2
import im.vector.matrix.android.internal.crypto.crosssigning.toBase64NoPadding
import im.vector.matrix.android.internal.crypto.secrets.DefaultSharedSecretStorageService
import im.vector.matrix.android.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.MatrixCallback
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.securestorage.EncryptedSecretContent
import org.matrix.android.sdk.api.session.securestorage.KeySigner
import org.matrix.android.sdk.api.session.securestorage.RawBytesKeySpec
import org.matrix.android.sdk.api.session.securestorage.SecretStorageKeyContent
import org.matrix.android.sdk.api.session.securestorage.SharedSecretStorageService
import org.matrix.android.sdk.api.session.securestorage.SsssKeyCreationInfo
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.common.TestMatrixCallback
import org.matrix.android.sdk.internal.crypto.SSSS_ALGORITHM_AES_HMAC_SHA2
import org.matrix.android.sdk.internal.crypto.crosssigning.toBase64NoPadding
import org.matrix.android.sdk.internal.crypto.secrets.DefaultSharedSecretStorageService
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -14,30 +14,30 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.verification
package org.matrix.android.sdk.internal.crypto.verification
import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.crypto.verification.CancelCode
import im.vector.matrix.android.api.session.crypto.verification.IncomingSasVerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.OutgoingSasVerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.SasMode
import im.vector.matrix.android.api.session.crypto.verification.SasVerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.VerificationMethod
import im.vector.matrix.android.api.session.crypto.verification.VerificationService
import im.vector.matrix.android.api.session.crypto.verification.VerificationTransaction
import im.vector.matrix.android.api.session.crypto.verification.VerificationTxState
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.internal.crypto.model.CryptoDeviceInfo
import im.vector.matrix.android.internal.crypto.model.MXUsersDevicesMap
import im.vector.matrix.android.internal.crypto.model.rest.KeyVerificationCancel
import im.vector.matrix.android.internal.crypto.model.rest.KeyVerificationStart
import im.vector.matrix.android.internal.crypto.model.rest.toValue
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.verification.CancelCode
import org.matrix.android.sdk.api.session.crypto.verification.IncomingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.OutgoingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.SasMode
import org.matrix.android.sdk.api.session.crypto.verification.SasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationMethod
import org.matrix.android.sdk.api.session.crypto.verification.VerificationService
import org.matrix.android.sdk.api.session.crypto.verification.VerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationTxState
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.MXUsersDevicesMap
import org.matrix.android.sdk.internal.crypto.model.rest.KeyVerificationCancel
import org.matrix.android.sdk.internal.crypto.model.rest.KeyVerificationStart
import org.matrix.android.sdk.internal.crypto.model.rest.toValue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.verification.qrcode
package org.matrix.android.sdk.internal.crypto.verification.qrcode
fun hexToByteArray(hex: String): ByteArray {
// Remove all spaces

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.verification.qrcode
package org.matrix.android.sdk.internal.crypto.verification.qrcode
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import org.matrix.android.sdk.InstrumentedTest
import org.amshove.kluent.shouldBeNull
import org.amshove.kluent.shouldEqual
import org.amshove.kluent.shouldEqualTo

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.verification.qrcode
package org.matrix.android.sdk.internal.crypto.verification.qrcode
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import org.matrix.android.sdk.InstrumentedTest
import org.amshove.kluent.shouldBe
import org.amshove.kluent.shouldNotBeEqualTo
import org.junit.FixMethodOrder

View File

@@ -14,17 +14,17 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.verification.qrcode
package org.matrix.android.sdk.internal.crypto.verification.qrcode
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.session.crypto.verification.VerificationMethod
import im.vector.matrix.android.api.session.crypto.verification.VerificationService
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.TestConstants
import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth
import im.vector.matrix.android.api.session.crypto.verification.PendingVerificationRequest
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.session.crypto.verification.VerificationMethod
import org.matrix.android.sdk.api.session.crypto.verification.VerificationService
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.model.rest.UserPasswordAuth
import org.matrix.android.sdk.api.session.crypto.verification.PendingVerificationRequest
import org.amshove.kluent.shouldBe
import org.junit.FixMethodOrder
import org.junit.Test

View File

@@ -0,0 +1,358 @@
/*
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.matrix.android.sdk.internal.session.room.send
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.commonmark.parser.Parser
import org.commonmark.renderer.html.HtmlRenderer
import org.junit.Assert.assertEquals
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.matrix.android.sdk.InstrumentedTest
/**
* It will not be possible to test all combinations. For the moment I add a few tests, then, depending on the problem discovered in the wild,
* we can add more tests to cover the edge cases.
* Some tests are suffixed with `_not_passing`, maybe one day we will fix them...
* Element Web should be used as a reference for expected results, but not always.
* Also Element Web does not provide plain text body when formatted text is provided. The body contains what the user has entered. We are doing
* the same to be able to edit messages (See #1939)
* See https://matrix.org/docs/spec/client_server/latest#m-room-message-msgtypes
*/
@Suppress("SpellCheckingInspection")
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
class MarkdownParserTest : InstrumentedTest {
/**
* Create the same parser than in the RoomModule
*/
private val markdownParser = MarkdownParser(
Parser.builder().build(),
HtmlRenderer.builder().build()
)
@Test
fun parseNoMarkdown() {
testIdentity("")
testIdentity("a")
testIdentity("1")
testIdentity("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et " +
"dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea com" +
"modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pari" +
"atur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
}
@Test
fun parseSpaces() {
testIdentity(" ")
testIdentity(" ")
testIdentity("\n")
}
@Test
fun parseNewLines() {
testIdentity("line1\nline2")
testIdentity("line1\nline2\nline3")
}
@Test
fun parseBold() {
testType(
name = "bold",
markdownPattern = "**",
htmlExpectedTag = "strong"
)
}
@Test
fun parseBoldNewLines() {
testTypeNewLines(
name = "bold",
markdownPattern = "**",
htmlExpectedTag = "strong"
)
}
@Test
fun parseItalic() {
testType(
name = "italic",
markdownPattern = "*",
htmlExpectedTag = "em"
)
}
@Test
fun parseItalicNewLines() {
testTypeNewLines(
name = "italic",
markdownPattern = "*",
htmlExpectedTag = "em"
)
}
@Test
fun parseItalic2() {
// Element Web format
"_italic_".let { markdownParser.parse(it).expect(it, "<em>italic</em>") }
}
/**
* Note: the test is not passing, it does not work on Element Web neither
*/
@Test
fun parseStrike_not_passing() {
testType(
name = "strike",
markdownPattern = "~~",
htmlExpectedTag = "del"
)
}
@Test
fun parseStrikeNewLines() {
testTypeNewLines(
name = "strike",
markdownPattern = "~~",
htmlExpectedTag = "del"
)
}
@Test
fun parseCode() {
testType(
name = "code",
markdownPattern = "`",
htmlExpectedTag = "code"
)
}
@Test
fun parseCodeNewLines() {
testTypeNewLines(
name = "code",
markdownPattern = "`",
htmlExpectedTag = "code"
)
}
@Test
fun parseCode2() {
testType(
name = "code",
markdownPattern = "``",
htmlExpectedTag = "code"
)
}
@Test
fun parseCode2NewLines() {
testTypeNewLines(
name = "code",
markdownPattern = "``",
htmlExpectedTag = "code"
)
}
@Test
fun parseCode3() {
testType(
name = "code",
markdownPattern = "```",
htmlExpectedTag = "code"
)
}
@Test
fun parseCode3NewLines() {
testTypeNewLines(
name = "code",
markdownPattern = "```",
htmlExpectedTag = "code"
)
}
@Test
fun parseUnorderedList() {
"- item1".let { markdownParser.parse(it).expect(it, "<ul>\n<li>item1</li>\n</ul>") }
"- item1\n- item2".let { markdownParser.parse(it).expect(it, "<ul>\n<li>item1</li>\n<li>item2</li>\n</ul>") }
}
@Test
fun parseOrderedList() {
"1. item1".let { markdownParser.parse(it).expect(it, "<ol>\n<li>item1</li>\n</ol>") }
"1. item1\n2. item2".let { markdownParser.parse(it).expect(it, "<ol>\n<li>item1</li>\n<li>item2</li>\n</ol>") }
}
@Test
fun parseHorizontalLine() {
"---".let { markdownParser.parse(it).expect(it, "<hr />") }
}
@Test
fun parseH2AndContent() {
"a\n---\nb".let { markdownParser.parse(it).expect(it, "<h2>a</h2>\n<p>b</p>") }
}
@Test
fun parseQuote() {
"> quoted".let { markdownParser.parse(it).expect(it, "<blockquote>\n<p>quoted</p>\n</blockquote>") }
}
@Test
fun parseQuote_not_passing() {
"> quoted\nline2".let { markdownParser.parse(it).expect(it, "<blockquote><p>quoted<br />line2</p></blockquote>") }
}
@Test
fun parseBoldItalic() {
"*italic* **bold**".let { markdownParser.parse(it).expect(it, "<em>italic</em> <strong>bold</strong>") }
"**bold** *italic*".let { markdownParser.parse(it).expect(it, "<strong>bold</strong> <em>italic</em>") }
}
@Test
fun parseHead() {
"# head1".let { markdownParser.parse(it).expect(it, "<h1>head1</h1>") }
"## head2".let { markdownParser.parse(it).expect(it, "<h2>head2</h2>") }
"### head3".let { markdownParser.parse(it).expect(it, "<h3>head3</h3>") }
"#### head4".let { markdownParser.parse(it).expect(it, "<h4>head4</h4>") }
"##### head5".let { markdownParser.parse(it).expect(it, "<h5>head5</h5>") }
"###### head6".let { markdownParser.parse(it).expect(it, "<h6>head6</h6>") }
}
@Test
fun parseHeads() {
"# head1\n# head2".let { markdownParser.parse(it).expect(it, "<h1>head1</h1>\n<h1>head2</h1>") }
}
@Test
fun parseBoldNewLines_not_passing() {
"**bold**\nline2".let { markdownParser.parse(it).expect(it, "<strong>bold</strong><br />line2") }
}
@Test
fun parseLinks() {
"[link](target)".let { markdownParser.parse(it).expect(it, """<a href="target">link</a>""") }
}
@Test
fun parseParagraph() {
"# head\ncontent".let { markdownParser.parse(it).expect(it, "<h1>head</h1>\n<p>content</p>") }
}
private fun testIdentity(text: String) {
markdownParser.parse(text).expect(text, null)
}
private fun testType(name: String,
markdownPattern: String,
htmlExpectedTag: String) {
// Test simple case
"$markdownPattern$name$markdownPattern"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag>")
}
// Test twice the same tag
"$markdownPattern$name$markdownPattern and $markdownPattern$name bis$markdownPattern"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag> and <$htmlExpectedTag>$name bis</$htmlExpectedTag>")
}
val textBefore = "a"
val textAfter = "b"
// With sticked text before
"$textBefore$markdownPattern$name$markdownPattern"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "$textBefore<$htmlExpectedTag>$name</$htmlExpectedTag>")
}
// With text before and space
"$textBefore $markdownPattern$name$markdownPattern"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "$textBefore <$htmlExpectedTag>$name</$htmlExpectedTag>")
}
// With sticked text after
"$markdownPattern$name$markdownPattern$textAfter"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag>$textAfter")
}
// With space and text after
"$markdownPattern$name$markdownPattern $textAfter"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag> $textAfter")
}
// With sticked text before and text after
"$textBefore$markdownPattern$name$markdownPattern$textAfter"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "a<$htmlExpectedTag>$name</$htmlExpectedTag>$textAfter")
}
// With text before and after, with spaces
"$textBefore $markdownPattern$name$markdownPattern $textAfter"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "$textBefore <$htmlExpectedTag>$name</$htmlExpectedTag> $textAfter")
}
}
private fun testTypeNewLines(name: String,
markdownPattern: String,
htmlExpectedTag: String) {
// With new line inside the block
"$markdownPattern$name\n$name$markdownPattern"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "<$htmlExpectedTag>$name<br />$name</$htmlExpectedTag>")
}
// With new line between two blocks
"$markdownPattern$name$markdownPattern\n$markdownPattern$name$markdownPattern"
.let {
markdownParser.parse(it)
.expect(expectedText = it,
expectedFormattedText = "<$htmlExpectedTag>$name</$htmlExpectedTag><$htmlExpectedTag>$name</$htmlExpectedTag>")
}
}
private fun TextContent.expect(expectedText: String, expectedFormattedText: String?) {
assertEquals("TextContent are not identical", TextContent(expectedText, expectedFormattedText), this)
}
}

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.util
package org.matrix.android.sdk.internal.util
import androidx.test.ext.junit.runners.AndroidJUnit4
import im.vector.matrix.android.InstrumentedTest
import org.matrix.android.sdk.InstrumentedTest
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,21 +14,21 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.room.send.SendState
import im.vector.matrix.android.internal.database.helper.addTimelineEvent
import im.vector.matrix.android.internal.database.helper.merge
import im.vector.matrix.android.internal.database.mapper.toEntity
import im.vector.matrix.android.internal.database.model.ChunkEntity
import im.vector.matrix.android.internal.database.model.SessionRealmModule
import im.vector.matrix.android.internal.session.room.timeline.PaginationDirection
import im.vector.matrix.android.session.room.timeline.RoomDataHelper.createFakeListOfEvents
import im.vector.matrix.android.session.room.timeline.RoomDataHelper.createFakeMessageEvent
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.room.send.SendState
import org.matrix.android.sdk.internal.database.helper.addTimelineEvent
import org.matrix.android.sdk.internal.database.helper.merge
import org.matrix.android.sdk.internal.database.mapper.toEntity
import org.matrix.android.sdk.internal.database.model.ChunkEntity
import org.matrix.android.sdk.internal.database.model.SessionRealmModule
import org.matrix.android.sdk.internal.session.room.timeline.PaginationDirection
import org.matrix.android.sdk.session.room.timeline.RoomDataHelper.createFakeListOfEvents
import org.matrix.android.sdk.session.room.timeline.RoomDataHelper.createFakeMessageEvent
import io.realm.Realm
import io.realm.RealmConfiguration
import io.realm.kotlin.createObject

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,11 +14,11 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import im.vector.matrix.android.internal.session.room.timeline.GetContextOfEventTask
import im.vector.matrix.android.internal.session.room.timeline.PaginationDirection
import im.vector.matrix.android.internal.session.room.timeline.TokenChunkEventPersistor
import org.matrix.android.sdk.internal.session.room.timeline.GetContextOfEventTask
import org.matrix.android.sdk.internal.session.room.timeline.PaginationDirection
import org.matrix.android.sdk.internal.session.room.timeline.TokenChunkEventPersistor
import kotlin.random.Random
internal class FakeGetContextOfEventTask constructor(private val tokenChunkEventPersistor: TokenChunkEventPersistor) : GetContextOfEventTask {

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import im.vector.matrix.android.internal.session.room.timeline.PaginationTask
import im.vector.matrix.android.internal.session.room.timeline.TokenChunkEventPersistor
import org.matrix.android.sdk.internal.session.room.timeline.PaginationTask
import org.matrix.android.sdk.internal.session.room.timeline.TokenChunkEventPersistor
import javax.inject.Inject
import kotlin.random.Random

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.internal.session.room.timeline.TokenChunkEvent
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.internal.session.room.timeline.TokenChunkEvent
internal data class FakeTokenChunkEvent(override val start: String?,
override val end: String?,

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,16 +14,16 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import im.vector.matrix.android.api.session.events.model.Content
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toContent
import im.vector.matrix.android.api.session.room.model.Membership
import im.vector.matrix.android.api.session.room.model.RoomMemberSummary
import im.vector.matrix.android.api.session.room.model.message.MessageTextContent
import im.vector.matrix.android.api.session.room.model.message.MessageType
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toContent
import org.matrix.android.sdk.api.session.room.model.Membership
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
import org.matrix.android.sdk.api.session.room.model.message.MessageTextContent
import org.matrix.android.sdk.api.session.room.model.message.MessageType
import kotlin.random.Random
object RoomDataHelper {

View File

@@ -14,18 +14,18 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.extensions.orFalse
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.model.message.MessageContent
import im.vector.matrix.android.api.session.room.timeline.Timeline
import im.vector.matrix.android.api.session.room.timeline.TimelineSettings
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.checkSendOrder
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
import org.matrix.android.sdk.api.session.room.timeline.Timeline
import org.matrix.android.sdk.api.session.room.timeline.TimelineSettings
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.checkSendOrder
import org.amshove.kluent.shouldBeFalse
import org.amshove.kluent.shouldBeTrue
import org.junit.Assert.assertTrue

View File

@@ -14,18 +14,18 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.extensions.orFalse
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.model.message.MessageContent
import im.vector.matrix.android.api.session.room.timeline.Timeline
import im.vector.matrix.android.api.session.room.timeline.TimelineSettings
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.checkSendOrder
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
import org.matrix.android.sdk.api.session.room.timeline.Timeline
import org.matrix.android.sdk.api.session.room.timeline.TimelineSettings
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.checkSendOrder
import org.amshove.kluent.shouldBeFalse
import org.amshove.kluent.shouldBeTrue
import org.junit.FixMethodOrder

View File

@@ -14,18 +14,18 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.extensions.orFalse
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.model.message.MessageContent
import im.vector.matrix.android.api.session.room.timeline.Timeline
import im.vector.matrix.android.api.session.room.timeline.TimelineSettings
import im.vector.matrix.android.common.CommonTestHelper
import im.vector.matrix.android.common.CryptoTestHelper
import im.vector.matrix.android.common.checkSendOrder
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
import org.matrix.android.sdk.api.session.room.timeline.Timeline
import org.matrix.android.sdk.api.session.room.timeline.TimelineSettings
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.checkSendOrder
import org.amshove.kluent.shouldBeFalse
import org.amshove.kluent.shouldBeTrue
import org.junit.FixMethodOrder

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2019 New Vector Ltd
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.session.room.timeline
package org.matrix.android.sdk.session.room.timeline
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.InstrumentedTest
import org.matrix.android.sdk.InstrumentedTest
internal class TimelineTest : InstrumentedTest {

View File

@@ -14,22 +14,22 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.database
package org.matrix.android.sdk.internal.database
import im.vector.matrix.android.internal.crypto.store.db.model.CrossSigningInfoEntity
import im.vector.matrix.android.internal.crypto.store.db.model.CryptoMetadataEntity
import im.vector.matrix.android.internal.crypto.store.db.model.CryptoRoomEntity
import im.vector.matrix.android.internal.crypto.store.db.model.DeviceInfoEntity
import im.vector.matrix.android.internal.crypto.store.db.model.GossipingEventEntity
import im.vector.matrix.android.internal.crypto.store.db.model.IncomingGossipingRequestEntity
import im.vector.matrix.android.internal.crypto.store.db.model.KeyInfoEntity
import im.vector.matrix.android.internal.crypto.store.db.model.KeysBackupDataEntity
import im.vector.matrix.android.internal.crypto.store.db.model.MyDeviceLastSeenInfoEntity
import im.vector.matrix.android.internal.crypto.store.db.model.OlmInboundGroupSessionEntity
import im.vector.matrix.android.internal.crypto.store.db.model.OlmSessionEntity
import im.vector.matrix.android.internal.crypto.store.db.model.OutgoingGossipingRequestEntity
import im.vector.matrix.android.internal.crypto.store.db.model.TrustLevelEntity
import im.vector.matrix.android.internal.crypto.store.db.model.UserEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.CrossSigningInfoEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.CryptoMetadataEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.CryptoRoomEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.DeviceInfoEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.GossipingEventEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.IncomingGossipingRequestEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.KeyInfoEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.KeysBackupDataEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.MyDeviceLastSeenInfoEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.OlmInboundGroupSessionEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.OlmSessionEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.OutgoingGossipingRequestEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.TrustLevelEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.UserEntity
import io.realm.Realm
import io.realm.RealmConfiguration
import io.realm.kotlin.where

View File

@@ -15,9 +15,9 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.network.interceptors
package org.matrix.android.sdk.internal.network.interceptors
import im.vector.matrix.android.internal.di.MatrixScope
import org.matrix.android.sdk.internal.di.MatrixScope
import okhttp3.Interceptor
import okhttp3.Response
import okio.Buffer

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package im.vector.matrix.android.internal.network.interceptors
package org.matrix.android.sdk.internal.network.interceptors
import androidx.annotation.NonNull
import im.vector.matrix.android.BuildConfig
import org.matrix.android.sdk.BuildConfig
import okhttp3.logging.HttpLoggingInterceptor
import org.json.JSONArray
import org.json.JSONException

View File

@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="im.vector.matrix.android">
package="org.matrix.android.sdk">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
@@ -13,7 +13,7 @@
read access permission
-->
<provider
android:name="im.vector.matrix.android.api.session.file.MatrixSDKFileProvider"
android:name=".api.session.file.MatrixSDKFileProvider"
android:authorities="${applicationId}.mx-sdk.fileprovider"
android:exported="false"
android:grantUriPermissions="true">

View File

@@ -1,48 +0,0 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.pushrules
import im.vector.matrix.android.api.session.events.model.Event
abstract class Condition(val kind: Kind) {
enum class Kind(val value: String) {
EventMatch("event_match"),
ContainsDisplayName("contains_display_name"),
RoomMemberCount("room_member_count"),
SenderNotificationPermission("sender_notification_permission"),
Unrecognised("");
companion object {
fun fromString(value: String): Kind {
return when (value) {
"event_match" -> EventMatch
"contains_display_name" -> ContainsDisplayName
"room_member_count" -> RoomMemberCount
"sender_notification_permission" -> SenderNotificationPermission
else -> Unrecognised
}
}
}
}
abstract fun isSatisfied(event: Event, conditionResolver: ConditionResolver): Boolean
open fun technicalDescription(): String {
return "Kind: $kind"
}
}

View File

@@ -1,74 +0,0 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.pushrules
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.model.message.MessageContent
import timber.log.Timber
class ContainsDisplayNameCondition : Condition(Kind.ContainsDisplayName) {
override fun isSatisfied(event: Event, conditionResolver: ConditionResolver): Boolean {
return conditionResolver.resolveContainsDisplayNameCondition(event, this)
}
override fun technicalDescription(): String {
return "User is mentioned"
}
fun isSatisfied(event: Event, displayName: String): Boolean {
val message = when (event.type) {
EventType.MESSAGE -> {
event.content.toModel<MessageContent>()
}
// TODO the spec says:
// Matches any message whose content is unencrypted and contains the user's current display name
// EventType.ENCRYPTED -> {
// event.root.getClearContent()?.toModel<MessageContent>()
// }
else -> null
} ?: return false
return caseInsensitiveFind(displayName, message.body)
}
companion object {
/**
* Returns whether a string contains an occurrence of another, as a standalone word, regardless of case.
*
* @param subString the string to search for
* @param longString the string to search in
* @return whether a match was found
*/
fun caseInsensitiveFind(subString: String, longString: String): Boolean {
// add sanity checks
if (subString.isEmpty() || longString.isEmpty()) {
return false
}
try {
val regex = Regex("(\\W|^)" + Regex.escape(subString) + "(\\W|$)", RegexOption.IGNORE_CASE)
return regex.containsMatchIn(longString)
} catch (e: Exception) {
Timber.e(e, "## caseInsensitiveFind() : failed")
}
return false
}
}
}

View File

@@ -1,213 +0,0 @@
/*
* Copyright 2016 OpenMarket Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.internal.crypto.attachments
import android.util.Base64
import im.vector.matrix.android.internal.crypto.model.rest.EncryptedFileInfo
import im.vector.matrix.android.internal.crypto.model.rest.EncryptedFileKey
import timber.log.Timber
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.InputStream
import java.security.MessageDigest
import java.security.SecureRandom
import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec
internal object MXEncryptedAttachments {
private const val CRYPTO_BUFFER_SIZE = 32 * 1024
private const val CIPHER_ALGORITHM = "AES/CTR/NoPadding"
private const val SECRET_KEY_SPEC_ALGORITHM = "AES"
private const val MESSAGE_DIGEST_ALGORITHM = "SHA-256"
/***
* Encrypt an attachment stream.
* @param attachmentStream the attachment stream. Will be closed after this method call.
* @param mimetype the mime type
* @return the encryption file info
*/
fun encryptAttachment(attachmentStream: InputStream, mimetype: String?): EncryptionResult {
val t0 = System.currentTimeMillis()
val secureRandom = SecureRandom()
// generate a random iv key
// Half of the IV is random, the lower order bits are zeroed
// such that the counter never wraps.
// See https://github.com/matrix-org/matrix-ios-kit/blob/3dc0d8e46b4deb6669ed44f72ad79be56471354c/MatrixKit/Models/Room/MXEncryptedAttachments.m#L75
val initVectorBytes = ByteArray(16) { 0.toByte() }
val ivRandomPart = ByteArray(8)
secureRandom.nextBytes(ivRandomPart)
System.arraycopy(ivRandomPart, 0, initVectorBytes, 0, ivRandomPart.size)
val key = ByteArray(32)
secureRandom.nextBytes(key)
ByteArrayOutputStream().use { outputStream ->
val encryptCipher = Cipher.getInstance(CIPHER_ALGORITHM)
val secretKeySpec = SecretKeySpec(key, SECRET_KEY_SPEC_ALGORITHM)
val ivParameterSpec = IvParameterSpec(initVectorBytes)
encryptCipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec)
val messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM)
val data = ByteArray(CRYPTO_BUFFER_SIZE)
var read: Int
var encodedBytes: ByteArray
attachmentStream.use { inputStream ->
read = inputStream.read(data)
while (read != -1) {
encodedBytes = encryptCipher.update(data, 0, read)
messageDigest.update(encodedBytes, 0, encodedBytes.size)
outputStream.write(encodedBytes)
read = inputStream.read(data)
}
}
// encrypt the latest chunk
encodedBytes = encryptCipher.doFinal()
messageDigest.update(encodedBytes, 0, encodedBytes.size)
outputStream.write(encodedBytes)
return EncryptionResult(
encryptedFileInfo = EncryptedFileInfo(
url = null,
mimetype = mimetype,
key = EncryptedFileKey(
alg = "A256CTR",
ext = true,
key_ops = listOf("encrypt", "decrypt"),
kty = "oct",
k = base64ToBase64Url(Base64.encodeToString(key, Base64.DEFAULT))
),
iv = Base64.encodeToString(initVectorBytes, Base64.DEFAULT).replace("\n", "").replace("=", ""),
hashes = mapOf("sha256" to base64ToUnpaddedBase64(Base64.encodeToString(messageDigest.digest(), Base64.DEFAULT))),
v = "v2"
),
encryptedByteArray = outputStream.toByteArray()
)
.also { Timber.v("Encrypt in ${System.currentTimeMillis() - t0}ms") }
}
}
/**
* Decrypt an attachment
*
* @param attachmentStream the attachment stream. Will be closed after this method call.
* @param encryptedFileInfo the encryption file info
* @return the decrypted attachment stream
*/
fun decryptAttachment(attachmentStream: InputStream?, encryptedFileInfo: EncryptedFileInfo?): InputStream? {
if (encryptedFileInfo?.isValid() != true) {
Timber.e("## decryptAttachment() : some fields are not defined, or invalid key fields")
return null
}
val elementToDecrypt = encryptedFileInfo.toElementToDecrypt()
return decryptAttachment(attachmentStream, elementToDecrypt)
}
/**
* Decrypt an attachment
*
* @param attachmentStream the attachment stream. Will be closed after this method call.
* @param elementToDecrypt the elementToDecrypt info
* @return the decrypted attachment stream
*/
fun decryptAttachment(attachmentStream: InputStream?, elementToDecrypt: ElementToDecrypt?): InputStream? {
// sanity checks
if (null == attachmentStream || elementToDecrypt == null) {
Timber.e("## decryptAttachment() : null stream")
return null
}
val t0 = System.currentTimeMillis()
ByteArrayOutputStream().use { outputStream ->
try {
val key = Base64.decode(base64UrlToBase64(elementToDecrypt.k), Base64.DEFAULT)
val initVectorBytes = Base64.decode(elementToDecrypt.iv, Base64.DEFAULT)
val decryptCipher = Cipher.getInstance(CIPHER_ALGORITHM)
val secretKeySpec = SecretKeySpec(key, SECRET_KEY_SPEC_ALGORITHM)
val ivParameterSpec = IvParameterSpec(initVectorBytes)
decryptCipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec)
val messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM)
var read: Int
val data = ByteArray(CRYPTO_BUFFER_SIZE)
var decodedBytes: ByteArray
attachmentStream.use { inputStream ->
read = inputStream.read(data)
while (read != -1) {
messageDigest.update(data, 0, read)
decodedBytes = decryptCipher.update(data, 0, read)
outputStream.write(decodedBytes)
read = inputStream.read(data)
}
}
// decrypt the last chunk
decodedBytes = decryptCipher.doFinal()
outputStream.write(decodedBytes)
val currentDigestValue = base64ToUnpaddedBase64(Base64.encodeToString(messageDigest.digest(), Base64.DEFAULT))
if (elementToDecrypt.sha256 != currentDigestValue) {
Timber.e("## decryptAttachment() : Digest value mismatch")
return null
}
return ByteArrayInputStream(outputStream.toByteArray())
.also { Timber.v("Decrypt in ${System.currentTimeMillis() - t0}ms") }
} catch (oom: OutOfMemoryError) {
Timber.e(oom, "## decryptAttachment() failed: OOM")
} catch (e: Exception) {
Timber.e(e, "## decryptAttachment() failed")
}
}
return null
}
/**
* Base64 URL conversion methods
*/
private fun base64UrlToBase64(base64Url: String): String {
return base64Url.replace('-', '+')
.replace('_', '/')
}
internal fun base64ToBase64Url(base64: String): String {
return base64.replace("\n".toRegex(), "")
.replace("\\+".toRegex(), "-")
.replace('/', '_')
.replace("=", "")
}
private fun base64ToUnpaddedBase64(base64: String): String {
return base64.replace("\n".toRegex(), "")
.replace("=", "")
}
}

View File

@@ -1,138 +0,0 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.internal.session
import dagger.BindsInstance
import dagger.Component
import im.vector.matrix.android.api.auth.data.SessionParams
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.internal.crypto.CancelGossipRequestWorker
import im.vector.matrix.android.internal.crypto.CryptoModule
import im.vector.matrix.android.internal.crypto.SendGossipRequestWorker
import im.vector.matrix.android.internal.crypto.SendGossipWorker
import im.vector.matrix.android.internal.crypto.verification.SendVerificationMessageWorker
import im.vector.matrix.android.internal.di.MatrixComponent
import im.vector.matrix.android.internal.di.SessionAssistedInjectModule
import im.vector.matrix.android.internal.network.NetworkConnectivityChecker
import im.vector.matrix.android.internal.session.account.AccountModule
import im.vector.matrix.android.internal.session.cache.CacheModule
import im.vector.matrix.android.internal.session.call.CallModule
import im.vector.matrix.android.internal.session.content.ContentModule
import im.vector.matrix.android.internal.session.content.UploadContentWorker
import im.vector.matrix.android.internal.session.filter.FilterModule
import im.vector.matrix.android.internal.session.group.GetGroupDataWorker
import im.vector.matrix.android.internal.session.group.GroupModule
import im.vector.matrix.android.internal.session.homeserver.HomeServerCapabilitiesModule
import im.vector.matrix.android.internal.session.identity.IdentityModule
import im.vector.matrix.android.internal.session.integrationmanager.IntegrationManagerModule
import im.vector.matrix.android.internal.session.openid.OpenIdModule
import im.vector.matrix.android.internal.session.profile.ProfileModule
import im.vector.matrix.android.internal.session.pushers.AddHttpPusherWorker
import im.vector.matrix.android.internal.session.pushers.PushersModule
import im.vector.matrix.android.internal.session.room.RoomModule
import im.vector.matrix.android.internal.session.room.relation.SendRelationWorker
import im.vector.matrix.android.internal.session.room.send.EncryptEventWorker
import im.vector.matrix.android.internal.session.room.send.MultipleEventSendingDispatcherWorker
import im.vector.matrix.android.internal.session.room.send.RedactEventWorker
import im.vector.matrix.android.internal.session.room.send.SendEventWorker
import im.vector.matrix.android.internal.session.signout.SignOutModule
import im.vector.matrix.android.internal.session.sync.SyncModule
import im.vector.matrix.android.internal.session.sync.SyncTask
import im.vector.matrix.android.internal.session.sync.SyncTokenStore
import im.vector.matrix.android.internal.session.sync.job.SyncWorker
import im.vector.matrix.android.internal.session.terms.TermsModule
import im.vector.matrix.android.internal.session.user.UserModule
import im.vector.matrix.android.internal.session.user.accountdata.AccountDataModule
import im.vector.matrix.android.internal.session.widgets.WidgetModule
import im.vector.matrix.android.internal.task.TaskExecutor
import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers
@Component(dependencies = [MatrixComponent::class],
modules = [
SessionModule::class,
RoomModule::class,
SyncModule::class,
HomeServerCapabilitiesModule::class,
SignOutModule::class,
GroupModule::class,
UserModule::class,
FilterModule::class,
GroupModule::class,
ContentModule::class,
CacheModule::class,
CryptoModule::class,
PushersModule::class,
OpenIdModule::class,
WidgetModule::class,
IntegrationManagerModule::class,
IdentityModule::class,
TermsModule::class,
AccountDataModule::class,
ProfileModule::class,
SessionAssistedInjectModule::class,
AccountModule::class,
CallModule::class
]
)
@SessionScope
internal interface SessionComponent {
fun coroutineDispatchers(): MatrixCoroutineDispatchers
fun session(): Session
fun syncTask(): SyncTask
fun syncTokenStore(): SyncTokenStore
fun networkConnectivityChecker(): NetworkConnectivityChecker
fun taskExecutor(): TaskExecutor
fun inject(worker: SendEventWorker)
fun inject(worker: SendRelationWorker)
fun inject(worker: EncryptEventWorker)
fun inject(worker: MultipleEventSendingDispatcherWorker)
fun inject(worker: RedactEventWorker)
fun inject(worker: GetGroupDataWorker)
fun inject(worker: UploadContentWorker)
fun inject(worker: SyncWorker)
fun inject(worker: AddHttpPusherWorker)
fun inject(worker: SendVerificationMessageWorker)
fun inject(worker: SendGossipRequestWorker)
fun inject(worker: CancelGossipRequestWorker)
fun inject(worker: SendGossipWorker)
@Component.Factory
interface Factory {
fun create(
matrixComponent: MatrixComponent,
@BindsInstance sessionParams: SessionParams): SessionComponent
}
}

Some files were not shown because too many files have changed in this diff Show More