1
0
mirror of https://github.com/element-hq/element-x-android.git synced 2026-10-23 18:49:00 +03:00

571 Commits

Author SHA1 Message Date
Benoit Marty
08a0885cfc Merge pull request #7821 from element-hq/bma/removeUnusedDependencies
Remove unused Gradle dependencies
2026-10-06 12:23:32 +02:00
Benoit Marty
ab20281b26 Fix wrong package names and namespaces in several modules
Some modules were using package names or namespaces inherited from copy-paste
or from older module names (e.g. `features.logout.impl` in the deactivation
module, `features.api` in the migration api module, `sessionstorage` in the
cachestore module), or containing typos (`roomaliasesolver`,
`roomdetetailsedit`).

Move the sources to the package matching their module, update the imports, and
rename the impacted screenshots accordingly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:43:22 +02:00
Benoit Marty
954eb731e7 Remove unused Gradle dependencies
Remove dependencies flagged as unused by the Dependency Analysis Gradle Plugin
(`./gradlew buildHealth`) and explicitly declared in module build files.

Removals were skipped when the dependency provides transitively something the
module (or a consumer of an `api` dependency) uses directly, as well as for
runtime-only dependencies (element-call-embedded, sentry-android,
rustls-platform-verifier). Dependencies added by the convention plugin helpers
(composeDependencies, testCommonDependencies) are left untouched.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:47:48 +02:00
Jorge Martin Espinosa
558c4541cd Fix StrictMode config (#7837)
Remove `penaltyDialog()` as it makes the app unusable even in debug builds
2026-10-02 10:05:08 +02:00
Jorge Martin Espinosa
a3ff7e1486 Make StrictMode more lenient for network on main thread violations (#7830)
* Make `StrictMode` more lenient for network on main thread violations

`rustls-platform-verifier-android:0.2.0` performs the certification revocation checks in whatever thread called the Rust code that triggered the network request. In our codebase, sometimes this is the main thread through `MainScope`.

This would usually be fine if we were using suspend APIs, since it would just wait for a result and not block the main thread. However, the cert verification logic uses some `HttpUrlConnection` calls under the hood that are fully blocking and this triggers `NetworkOnMainThreadException`, which in turn make the revocation fail.

With these changes, we log those issues but don't make them break the certificate verification. That said, we should revert this logic once a fix lands in the verifier.

* Make the `StrictMode` weaker only for release and nightly builds

This way we can fix the issues when we detect them in debug builds.

* Fix `org.matrix.rustsdk.Android.init` not being called immediately in `PlatformInitializer`

This must be called before `platformService.init(tracingConfiguration)`

* Add `penaltyDialog`, to check if it's useful or just annoying
2026-10-01 16:55:23 +00:00
Valere
f052f755b6 Follow a native call into picture-in-picture from the app
supportsPictureInPicture and smallestScreenSize have to be declared here, because a library cannot change a host Activity's manifest entry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 18:44:49 +02:00
Jorge Martin Espinosa
ed80c5c537 Remove Firebase push integration from Posthog (#7810)
This causes issues with F-Droid, since now Posthog unconditionally references some Firebase classes, which are detected by their checks.

Note these don't do anything if Firebase messaging isn't included, which is already the case for the F-droid variant of the app.

The R8 changes should remove any code referencing Firebase in Posthog, making the offending classes unused and removing them from the final APKs.

This is not the ideal fix, that would be Posthog actually extracting these classes to an optional dependency, but it's a workaround to be able to publish F-droid versions.
2026-09-29 18:35:36 +02:00
Jorge Martin Espinosa
03fd288c47 Upgrade to rustls-platform-verifier:0.2.0 (#7791)
* Upgrade to `rustls-platform-verifier:0.2.0`.

This re-enables certificate revocation checks, but v0.2.0 contains a list of CRL servers that can be accessed using clear text requests to check the validity of certain certificates, which should fix the issue that prevented us from using certificate revocation and at the same time strengthening the security of the client app.

Since we already had some network configuration in Element X, and `network_security_config.xml` files can't be merged, what we can do is manually download and merge the XML contents using `tools/dependencies/update_rustls_platform_verifier.py` like this:

```sh
./update_rustls_platform_verifier.py 0.2.0
```

It will automatically bump the Gradle dependency and merge the security config entries.

* Bump SDK bindings to `v26.09.28`, containing the rustls bump on the SDK side

* Fix unused resources caused by `app/src/main/res/xml/network_security_config_element.xml`
2026-09-28 15:35:33 +00:00
bxdxnn
b772aebf49 Address review 2026-09-15 14:45:26 +00:00
bxdxnn
7191313ce5 Allow changing keystore path 2026-09-12 18:10:53 +00:00
ganfra
f72e1ad2cc Support Google Play Services fused location backend 2026-09-07 18:11:38 +02:00
ganfra
7045465ffe Allow BSD-2 clause 2026-09-07 15:25:39 +02:00
jmartinesp
dfccde93c6 Sync Strings from Localazy 2026-09-02 10:07:17 +00:00
Benoit Marty
c204d867a2 Merge pull request #7585 from element-hq/rav/app_startup_hook
Implement a hook allowing enterprise modules to perform actions on startup
2026-08-28 16:06:25 +02:00
Benoit Marty
65878c6a34 Log the SDK git Sha at application startup
Also improve the rendering of the log
2026-08-28 12:18:49 +02:00
Richard van der Hoff
712fe5b217 Implement a hook allowing enterprise modules to perform actions on startup
Add an interface `io.element.android.features.enterprise.api.AppStartupHook`,
which can be implemented in the enterprise build to perform certain actions on
startup.

It's a bit of a kludge for now since it doesn't block the rest of the app from
proceeding, but it will serve our purposes for now.
2026-08-27 22:36:47 +01:00
hayaksi1
6d28d91541 Offer conversations in the system share sheet
Sharing from another app listed Element X once, with no way to pick a
conversation: the Direct Share row never showed any.

The app already publishes a long-lived, conversation-categorised shortcut per
room, which is most of what the sharing shortcuts API needs. The part that was
missing is the declaration that ties those shortcuts to the share intent: the
launcher activity had no `android.app.shortcuts` meta-data, so there was no
`<share-target>` for the system to match them against.

It now ships one, matching the activity that already receives ACTION_SEND, and
the shortcuts carry the category it names.

The system offers these from Android 10 onwards, where sharing shortcuts are
handled natively. Reaching further back would additionally need the
androidx.sharetarget library, which is not added here.

Part of #3835
2026-08-26 03:18:28 +03:00
Benoit Marty
e6116d5840 Move all binding containers to a di package and normalize their method names
Every @BindingContainer now lives in a di subpackage, in a file named after
it. Containers that were declared inside a shared file (SimplePlayer.kt,
LockScreenConfig.kt, VoiceMessagePresenter.kt, TimelineItemPresenterFactories.kt,
MediaItemPresenterFactories.kt) are extracted into their own file.

Method names are made consistent too:
- @Binds functions are named bind<ConcreteParameterType>, fixing three that
  named something else (notably RoomAliasResolverBindingContainer, whose
  provider was still called providesJoinRoomPresenterFactory).
- @Provides functions are named after what they provide, and all use the
  provides prefix rather than a mix of provide and provides.

ANDROID_KEYSTORE moves back to the cryptography impl package, next to
KeyStoreSecretKeyRepository which uses it; it is not DI specific and would
otherwise be unreachable from there.

No behaviour change: Metro discovers containers via @ContributesTo and does
not care about method names, so the only call site to follow was in
DefaultVoiceRecorderTest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 11:38:11 +02:00
Benoit Marty
1018d26211 Rename all @BindingContainer types with a BindingContainer suffix
Metro's @BindingContainer replaced Dagger's @Module, but the declarations
kept the old Module suffix. Rename them (and their dedicated files) so the
type name matches the annotation, matching UserStatusBindingContainer which
already followed this convention.

No behaviour change: Metro discovers containers via @ContributesTo, so there
were only two call sites to update, both in tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 10:08:54 +02:00
Benoit Marty
eb8574e042 Remove dependency on shared module.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 10:59:20 +02:00
Jorge Martin Espinosa
feef42db5a Fix warning about deprecated Gradle keepRules.file API (#7498)
* Fix warning about deprecated `keepRules.file` API

The proguard files have been moved to `app/proguard` in several directories for `common`, `foss`, and `enterprise` rules and it's those directories that are added through `keepRules.addStaticSourceDirectory(dir)`.

* Use `findPropery` instead of the deprecated `project.properties["key"]` API for `allWarningsAsErrors`

* Remove very legacy .gitignore rule and restore proguard `.keep` rules
2026-08-21 13:23:34 +00:00
Jorge Martin Espinosa
8b2c207728 Move the :libraries:wellknown logic into enterprise modules (#7429)
* Extract `IsEnterpriseBuild` use case

Having it inside `EnterpriseService` made having DI cycles with the `BuildMeta` provider too easy

* Rename `EnterpriseService.defaultHomeserverList()` to `homeserverAllowList()`

This seems more aligned with the way this list works

* Move most of the logic from `:libraries:wellknown` to `:enterprise:feature:enterprise`, both `shared` and `impl` modules

Ideally I would have added everything into `impl`, but some of the classes needed to be shared between the different `:enterprise:features` modules, and those are in the `shared` module, lacking a better name/strategy

* Add `EnterpriseService.isElementProEnforced`

With this, we don't need to provide the `RemoteEnterpriseConfig` anymore to any consumers, everything goes through `EnterpriseService` or other providers

* Remove `EnterpriseService.overriddenElementWellKnown`

This leaks the remote enterprise config/element well known contents to the app in a public interface.

* Create `CustomMapTilerConfigProvider` to avoid leaking the `RemoteEnterpriseConfig` in public APIs

This commit also starts moving some of the well-known related values to the enterprise modules

* Add missing docs to `EnterpriseService` and `SessionEnterpriseService`

* Fix tests

* Fix lint issues

* Bump enterprise module
2026-08-17 13:21:47 +00:00
ganfra
5d8290b240 Extract EmojiPicker into libraries/emoji with Renderer/Presenter pattern 2026-07-22 15:48:54 +02:00
ganfra
e492f06386 Migrate libraries/recentemojis into libraries/emoji 2026-07-22 15:48:54 +02:00
Jorge Martin Espinosa
d0b4a21cfe Fix timelines not loading after marking a room as read from notification when app was killed (#7202)
This can only happen when the app was killed by the OS and then you received some notification.

This notification action creates a new `DefaultSessionPreferencesStore` when trying to fetch `isSendPublicReadReceiptsEnabled`, which would contain a different session coroutine scope than the one created when instantiating the navigation graph (`@SessionCoroutineScope`), resulting in flows that never emit any items and close automatically as 'completed'.

This in turn prevented the timeline items subscription in `TimelinePresenter` from progressing, since we're also checking `isRenderReadReceiptsEnabled` there, which is closed and in turn closes the timeline items flow.
2026-07-15 15:01:35 +02:00
Benoit Marty
28abf3049e Cleanup AndroidManifest.xml files. 2026-07-08 11:55:50 +02:00
Jorge Martin Espinosa
e370b33771 Fix Sonar with AGP 9 (some workarounds) (#7055)
Since it'll try to resolve their output, first they need to complete.
2026-06-19 13:12:54 +02:00
Benoit Marty
c430877d87 Ensure Robolectric test are run using API 36 until the library support API 37. 2026-06-18 12:18:32 +02:00
renovate[bot]
f0a6cba6db fix(deps): update android.gradle.plugin to v9 (major) (#6021)
* Update android.gradle.plugin to v9

* Separate extensions between app and library ones

`CommonExtension` has been split and its properties are now duplicated in `ApplicationExtension` and `LibraryExtension` without a shared interface, so we now need to duplicate the helper extension functions

* Bump Gradle wrapper to `9.3.1`

* Remove `kotlin-android` plugin usage: it's no longer needed

* Enable `resValues` build feature for the modules that have resources in custom variants like gplay, debug, etc.

Otherwise this now fails saying the resources are there but the feature is disabled

* Remove `retrofit` dependency from `:features:call:impl`

It wasn't in use and the build was failing

* Update kotlin to v2.4.0

* Update plugin paparazzi to v2.0.0-alpha05

* Update gradle wrapper to 9.5.1

./gradlew wrapper --gradle-version 9.5.1 --gradle-distribution-sha256-sum bafc141b619ad6350fd975fc903156dd5c151998cc8b058e8c1044ab5f7b031f

* Update com.android.tools.build:gradle to 9.2.1

* Update plugin sonarqube to v7.3.1.8318

* Kotlin 2.4.0

* Context parameters are enabled by default in Kotlin 2.4.0

* Fix code issue

* Fix record screenshot issue

* Workaround for https://github.com/cashapp/paparazzi/issues/2342

* Workaround for another issue with Paparazzi

* Remove unused import

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: Benoit Marty <benoitm@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: ElementBot <android@element.io>
2026-06-11 09:51:47 +02:00
Benoit Marty
c88edc9621 Notification settings: pick custom sounds for messages and call ringtones (#6897)
* Notification settings: pick custom sounds for messages and call ringtones (#6702)

* Feature: add notification sound settings for messages and calls

* Add sound not available banner, accessibility checks

* Fix build and Konsist convention violations

- libraries:preferences:api now uses io.element.android-compose-library
  so NotificationSound's @Immutable annotation can resolve, matching the
  pattern in libraries:matrix:api.
- Rename SoundUnavailableBannerStateProvider to
  NotificationSoundUnavailableStateProvider so the class name contains
  the parameter type as required by KonsistClassNameTest.

* Suppress LargeClass on RoomListPresenterTest

The three new sound-unavailable tests pushed the class past Detekt's
default LargeClass threshold. Matches the suppression pattern already
used on five presenter test classes under features/messages/impl/test.

* NotificationSettingsView: guard ringtone-picker launchers in inspection mode

rememberLauncherForActivityResult requires a LocalActivityResultRegistryOwner,
which Paparazzi-driven preview snapshot tests don't provide, causing
NotificationSettingsViewPreview to throw IllegalStateException for every
preview parameter. Extract the click handlers into a helper that returns a
no-op when LocalInspectionMode.current is true; the runtime path is unchanged.

* Handle unresolved notification sounds mid session

* Quality checks, refactor mid session error ui

* Suppress detekt LargeClass on NotificationSettingsPresenterTest

* Remove notification sound resilience layer, replace with file copy

* Reselect element sound option, code cleanup

* Add element fade notification sound option

* Fix new file headers

* Revert to flowOf(Unit) for announcement service

* Add ringtone picker dialog to match message selector

* Update strings in conjunction with ios

* Update test to reflect new string

* Sync strings.

* Update screenshots

* Fix test

* Remove not properly located translations.
This will be fixed in the next String sync.

* Fix test on CI

---------

Co-authored-by: Jenna Vassar <jenna.vassar@toptal.com>
Co-authored-by: ElementBot <android@element.io>
2026-05-28 16:54:12 +02:00
bxdxnn
bdedf41f99 Fix FLAG_SECURE splash screen having a pink top bar (#6903) 2026-05-28 16:52:59 +02:00
ElementBot
0aaa80cbdc Sync Strings from Localazy (#6856)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-05-26 08:05:07 +00:00
Jorge Martin Espinosa
367995303d Rename OIDC components and variables to OAuth (#6686)
* Rename `OIDC` components and variables to `OAuth`. This matches the new behavior in the SDK.
2026-04-29 11:41:47 +02:00
Timur Gilfanov
f7cfa6cda8 Merge branch 'develop' into feature-oled-black 2026-04-14 10:13:46 +04:00
bmarty
23c1112dcf Sync Strings from Localazy 2026-04-13 00:48:40 +00:00
Benoit Marty
2a5e9956e4 Reduce log level of activity lifecycle from warning to debug. (#6548) 2026-04-08 16:45:22 +02:00
Timur Gilfanov
5e6a6af409 Add "Allow black theme" feature flag 2026-04-05 12:03:50 +04:00
ganfra
92920b862b Merge pull request #6342 from element-hq/feature/fga/live_location_sharing_setup
Setup live location sharing feature
2026-03-24 15:46:45 +01:00
renovate[bot]
2f99806603 fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha15 (#6306)
* fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha15

* Fix deprecations

* Add bottom sheet workaround

* Fix new lint issues

* Fix and ignore broken tests

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <android@element.io>
2026-03-24 11:24:07 +01:00
ganfra
9a984e1423 Merge branch 'develop' into feature/fga/live_location_sharing_setup 2026-03-24 10:17:24 +01:00
renovate[bot]
0c8a01d2cf fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v26.03.19 (#6411)
* fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v26.03.18

* Fix API breaks

* Add compatibility with rustls (#6367)

A new `rustls-platform-verifier-android` library has to be added to the project, it'll be called from Rust to get access to the certificates on Android.

Originally, this was supposed to be added as a local maven repo pointing to the rust crate that publishes the AAR, but that's just plain terrible (more details [here](https://github.com/rustls/rustls-platform-verifier#android).

Instead, what we can do is use a script that uses `cargo-download` to download the latest crate or a specified version, unzip it and add the `aar` file to the `:libraries:matrix:impl` module.

* Try fixing Sonar with local AAR files

* Remove `UserCertificatesProvider`: this is no longer needed after integrating rustls

* Added some docs for rustls and its `platform-verifier` library

* Upgrade SDK to `26.03.19`: this version contains a workaround that allows the app to use the same TLS verifier as before, fixing the Let's Encrypt issues we saw with some homeservers (like element.io)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-03-20 16:20:37 +01:00
Jorge Martin Espinosa
e79d9b627e Improve Kover setup by using only convention plugins (#6213)
* Improve Kover setup using convention plugins.
* Add a new JVM library convention plugin with Kover support
2026-03-16 14:41:07 +00:00
Benoit Marty
015cad90b6 Remove matrix.to intent filter from the AndroidManifest. Closes #6344. 2026-03-13 15:40:45 +01:00
ganfra
e8c2790595 Merge branch 'develop' into feature/fga/live_location_sharing_setup 2026-03-12 12:48:55 +01:00
Jorge Martin Espinosa
861f268447 Replace knit with generate_toc.py (#6279) 2026-03-10 09:05:20 +01:00
ganfra
00dc289e93 Add maplibre-compose to gradle catalog 2026-03-09 20:54:01 +01:00
Jorge Martin Espinosa
e821f75a88 Add code to help debugging the saved nav state graph (#6295)
* Add code to help debugging the saved nav state graph: this would help us diagnose the `TransactionTooLargeException` reports we've been seeing for months.
2026-03-06 14:44:30 +00:00
Jorge Martin Espinosa
9509121ffe Remove obfuscation in proguard (#6067)
* Remove obfuscation in proguard for the OSS app. Fully allow it by default for enterprise ones.

* Add logic to use additional customizable proguard files depending on whether the build is an enterprise one or not.
2026-01-23 16:39:11 +01:00
renovate[bot]
e92cf3c118 fix(deps): update metro to v0.9.3 (#5967)
* fix(deps): update metro to v0.9.3

* R8: allowshrinking to fix compilation issue.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2026-01-05 18:12:43 +01:00
Jorge Martín
d0fd2f4a98 Make sure we don't obfuscate Metro classes 2025-12-22 14:16:35 +01:00