Commit Graph

65 Commits

Author SHA1 Message Date
Jorge Martin Espinosa 55b0273a4b Fix rustls failing the certification revocation checks on app start (#7817)
* Fix rustls failing the certification revocation checks on app start
* Also add dispatchers.io to `isElementProEnforced`
2026-09-30 10:10:59 +00:00
Benoit Marty 6887092ce4 Replace String by AccountProvider to be able to get baseUrl and serverName. 2026-09-14 09:56:16 +02:00
Benoit Marty a817b6f219 Rename methods and update documentation. 2026-09-08 17:06:53 +02:00
Benoit Marty 1f18a18917 Iterate on hooks implementation 2026-09-08 16:47:57 +02:00
Jorge Martin Espinosa dcd0bc782f Make sure enforce_element_pro is taken into account in FOSS (#7631)
* Make sure `enforce_element_pro` is taken into account in FOSS

* Make sure we crate `RustTemporaryMatrixClient` instances with a proper `serverName` value
2026-09-03 10:05:40 +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
Benoit Marty b59afe7561 No need for @SingleIn 2026-08-21 18:11:26 +02:00
Benoit Marty 27b58705f3 Fix compilation issue. 2026-08-21 17:51:18 +02:00
Jorge Martín c56bb66307 Fix ClientBuilderEnterpriseHook not returning an updated ClientBuilder 2026-08-21 17:32:45 +02:00
Jorge Martín 4b32816b32 Add ClientEnterpriseHook and ClientBuilderEnterpriseHook
These allow us to not expose the enterprise internal when setting up custom configs for both `ClientBuilder` and `Client`
2026-08-21 10:05:00 +02:00
Jorge Martin Espinosa a1e86ad499 Use the right base URL for the ESS config/well known endpoints (#7469)
* Rename `UrlContentFetcher` to `ClientUrlContentFetcher` and add missing base URL data (server name, homeserver URL)

* Avoid passing the `homeserverUrl/serverName` around.

Calculate the URL in `DefaultRemoteEnterpriseConfigRetriever` using the newly added `homserver` and `server` values as the possible base URLs, depending on the remote config source

* Make sure we don't perform blocking requests to fetch the remote config when restoring a session

Add a `needsRefresh` parameter to `RemoteEnterpriseConfigResult.NotFound` to handle this, and store a `no-config` value in the store to indicate an endpoint has been checked and no config was found

* Bump enterprise module
2026-08-19 09:24:22 +02: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
Benoit Marty 7f3d896a3e Add KDoc to the features/enterprise API interfaces
Document EnterpriseService, SessionEnterpriseService and
RemoteEnterpriseConfigProvider along with all their members and parameters.

Two points that callers get wrong are stated explicitly: these services return
permissive defaults on a standard build, so there is no need to branch on the
build type, and SessionEnterpriseService only answers meaningfully once init has
run. The many nullable getters now say what null means in each case, which is
generally "no override, use the app default".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 10:01:14 +02:00
Jorge Martín e371b46c68 Rename GetUrlResolver to UrlContentFetcher and TemporaryMatrixClientFactory.createTemporaryMatrixClient to just create 2026-08-11 13:18:49 +02:00
Jorge Martín e24468c74f Fix and add tests 2026-08-11 13:18:49 +02:00
Jorge Martín 90d4fbe0bd Apply the GetUrlResolver pattern using unauthenticated matrix clients where possible 2026-08-11 13:18:49 +02:00
Jorge Martín fd3c671301 Create RemoteEnterpriseConfigProvider wrapper
For Pro, this will check different remote config sources and return the result. For FOSS, this will always return a `NotFound` result
2026-08-11 13:18:49 +02:00
Jorge Martín 59758a20a5 Add RemoteEnterpriseConfig typealias for ElementWellKnown
In the future, we want to move the enterprise config to the private Element Pro repo, this is a first step
2026-08-11 13:18:49 +02:00
Jorge Martin Espinosa 925376b6af Allow adding extra elements to the developer settings from external modules (#7230)
* Add `ExtraDeveloperOptionsRenderer` to display extra UI components in the developer settings screen. It defaults to not displaying anything, using `NoopExtraDeveloperOptionsRenderer`

* Add `EnterpriseService.overriddenElementWellKnown` method to fetch the current overridden element well known value, if any

* Modify the well known retrievers to use the overridden value if it's there. Also extract the JSON parsing to its own `ElementWellKnownParser` component.

* Bump enterprise repo reference.
2026-07-21 10:18:56 +02:00
Jorge Martin Espinosa 62cc7e0505 Allow homeserver to disable encryption in Element Pro (#7198)
* Allow HS to disable encryption in Element Pro

Add `force_disable_e2ee` support in the Element well known retriever and cache to allow a homeserver to disable encrypted room creation and enabling encryption in an existing room in Element Pro clients

* Bump enterprise repo back to `main` branch
2026-07-15 13:29:16 +02:00
Benoit Marty 2f45ca8835 Merge pull request #6682 from element-hq/feature/bma/customMasScheme
Add a way to tweak MAS url.
2026-05-07 10:51:32 +02:00
Benoit Marty 4d0be69b4c In the module :libraries:matrix.api, change the dependencies to:
- libraries.sessionStorage.api
- projects.libraries.architecture
from `api` to `implementation`.

Modules who need `:libraries:matrix.api` do not necessarily need to use the session storage api.
2026-04-30 09:52:10 +02:00
Benoit Marty a76b55e580 Add a way to tweak MAS url. 2026-04-29 22:29:40 +02:00
Benoit Marty df4c719151 Let enterprise build be able to use a different notification channel for noisy notification. 2026-02-11 11:57:01 +01:00
Benoit Marty eb31505dc7 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty f86431e663 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty c4e0370f41 Copyright: run command uv run license-editor --repository ../element-x-android 2025-11-10 10:09:26 +01:00
Benoit Marty 57ac39673d Notification: show userId in notification when several accounts are configured. 2025-10-31 09:25:01 +01:00
Benoit Marty b6b0ad91ce Let notifications uses the brandColor. 2025-10-24 18:22:41 +02:00
Benoit Marty 6e9af83b6a Let notifications uses the brandColor. 2025-10-24 17:04:48 +02:00
Benoit Marty 263e761907 Remove @Inject, not necessary anymore when class is annotated with @ContributesBinding 2025-10-22 18:52:37 +02:00
Benoit Marty b4ce7ce9ff Add missing tests on DefaultEnterpriseService 2025-10-22 11:55:58 +02:00
Benoit Marty 2396464eee Fix tests. 2025-10-22 10:15:32 +02:00
Benoit Marty 07b9a8456b Move SemanticColorsLightDark to compound module 2025-10-22 09:35:55 +02:00
Benoit Marty 49c23a922e Improve API and fix theme glitch when switching between accounts. 2025-10-22 09:32:15 +02:00
Benoit Marty c5da479065 Improve API and documentation 2025-10-21 11:53:36 +02:00
Benoit Marty 38908a42a2 Update API around brandColor. 2025-10-20 16:33:46 +02:00
Benoit Marty 844e1d2ce5 Let the enterprise build be able to update the colors. 2025-10-15 11:25:58 +02:00
Benoit Marty 95f1dc9bae Import Compound code from project https://github.com/element-hq/compound-android 2025-10-03 18:23:27 +02:00
Benoit Marty a575019760 Use DependencyHandlerScope.testCommonDependencies() 2025-09-16 14:38:31 +02:00
Benoit Marty e88743bd6a Rename anvil modules to annotations and codegen 2025-09-05 14:26:27 +02:00
Jorge Martín e8328858ab Fixes after rebase 2025-09-04 16:49:21 +02:00
Jorge Martín 4ab62a6a38 Redo DI gradle setup code 2025-09-04 16:49:20 +02:00
Jorge Martín 29a97fc0d9 Fix lint issues and restore commented out code 2025-09-04 16:49:18 +02:00
Jorge Martín b76a71ebf5 Start migrating Anvil KSP to Metro 2025-09-04 16:48:34 +02:00
Benoit Marty 0927a502f5 Do not let default enterprise impl module be implemented for enterprise build. 2025-09-04 13:33:37 +02:00
Benoit Marty d9b274b6cf Let enterprise build be able to override (or disable) the bug report URL. 2025-08-08 17:23:39 +02:00
Benoit Marty 25ba79a681 Move isElementCallAvailable fun to new SessionEnterpriseService, which implementations can get the current MatrixClient. 2025-06-24 11:28:25 +02:00
Benoit Marty 5b9da3c41b Hide Element Call entry point if Element Call service is not available. (#4783)
* Hide Element Call entry point if Element Call service is not available.

* No need to preview the case RoomCallState.Unavailable

* Hide start call action from user profile if Element Call is not available.

* Add mising `use` and cover the problem by a test.

* Update screenshots

* Update enterprise submodule ref.

* Ensure `enterpriseService.isElementCallAvailable()` is not called several times.
And fix unit tests on CI

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-27 16:31:05 +02:00
Benoit Marty b926f5f5dc On boarding flow: add a screen to select account provider among a fixed list (#4769)
* Hide login with QrCode when the app is opened by a link

* Fix UI on ChangeAccountProviderView.

* Add flow to choose between a fixed list of account provider

* Update screenshots

* Fix licence header

* Rename preview.

* Ensure that the default account provider cannot be "*"
This should not happen IRL, but better be robust against issue in application configuration.

* Create const of any account provider value

* Fix typo

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-23 18:36:48 +02:00