Files
workavia-mail-front/lib/main/utils/app_config.dart
T
stanig2106 3fda5649c3
Build Docker images with Sentry / Build release image with Sentry (push) Failing after 1m59s
Release / Release (android, ubuntu-latest) (push) Failing after 38m31s
Release / Release (ios, macos-14) (push) Has been cancelled
Integration tests / Run integration tests for mobile apps (push) Failing after 15s
Build dev binaries / Build app (ios, macos-14) (push) Waiting to run
Build dev binaries / Build app (android, ubuntu-latest) (push) Failing after 34m13s
rebrand: Workavia Mail (tier 1+2+3+4)
Tier 1+2 - web/UI user-facing:
- Replace all visible "Twake Mail" / "Linagora" with "Workavia Mail"
- Swap 3 logo SVGs (icon kept, wordmark replaced via SVG <text>)
- Splash: replace icon_twp.png with HTML <div>Workavia</div>
- Remove power_by_linagora.svg, replace with AGPL SourceLinkWidget
- Patch web/index.html, manifest.json, login/logout-callback HTMLs
- Patch all 16 ARB locales + scribe ARB + app_localizations.dart
- Patch 4 web/i18n/*.json (FR/EN/DE/VI smart banner titles)
- App grid reduced to "Mail" + "Calendar"
- User-Agent: Twake-Mail -> Workavia-Mail

Tier 3+4 - mobile native:
- Bundle ID: com.linagora.{android,ios}.teammail -> com.workavia.mail
- URL schemes consolidated: teammail.mobile/twakemail.mobile -> workaviamail.mobile
- Android: applicationId, namespace, AndroidManifest, strings.xml
- Android: move Kotlin sources com.linagora.android.tmail -> com.workavia.mail
- Android: empty branding.xml + android12branding.xml (vector text not patchable)
- iOS: Info.plist (CFBundleDisplayName/Name, schemes), Runner.entitlements
- iOS: TwakeMailNSE + TeamMailShareExtension entitlements + Info.plist
- iOS: Runner.xcodeproj (12x PRODUCT_BUNDLE_IDENTIFIER, 9x APP_GROUP_ID)
- iOS: TokenRefreshManager.swift redirect URLs
- iOS: fastlane Appfile + Matchfile
- Dart: oidc_constant, app_config keychain, notification MethodChannel

Known follow-ups (require user action):
- Apple Team ID KUT463DS29 (still Linagora) -> needs Workavia team for App Store
- Android branding.xml emptied: need PNG/path-converted wordmark for splash
- iOS sub-bundle paths (TwakeMailNSE/, TeamMailShareExtension/) on disk unchanged
- iOS App Store URL emptied; Play Store ID points to com.workavia.mail
2026-04-29 18:12:55 +02:00

82 lines
3.0 KiB
Dart

import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:tmail_ui_user/features/login/data/network/config/oidc_constant.dart';
class AppConfig {
const AppConfig._();
static const int defaultMinInputLengthAutocomplete = 3;
static const int warningAttachmentFileSizeInMegabytes = 10;
static const int defaultLimitAutocomplete = 8;
static const String appDashboardConfigurationPath = "configurations/app_dashboard.json";
static const String attachmentKeywordsConfigurationPath = "configurations/attachment_keywords.json";
static const String iOSKeychainSharingGroupId = 'KUT463DS29.com.workavia.mail.shared';
static const String iOSKeychainSharingService = 'com.workavia.mail.sessions';
static const String saasPlatform = 'saas';
static const String linagoraPrivacyUrl = 'https://github.com/linagora/tmail-flutter/blob/master/privacy.md';
static const String saasRegistrationUrl = 'https://sign-up.twake.app';
static const String saasJmapServerUrl = 'https://jmap.twake.app';
static String get baseUrl => dotenv.get('SERVER_URL', fallback: '');
static String get domainRedirectUrl => dotenv.get('DOMAIN_REDIRECT_URL', fallback: '');
static String get webOidcClientId => dotenv.get('WEB_OIDC_CLIENT_ID', fallback: '');
static bool get appGridDashboardAvailable {
final supported = dotenv.get('APP_GRID_AVAILABLE', fallback: 'unsupported');
if (supported == 'supported') {
return true;
}
return false;
}
static bool get fcmAvailable {
final supportedOtherPlatform = dotenv.get('FCM_AVAILABLE', fallback: 'unsupported');
final supportedIOSPlatform = dotenv.get('IOS_FCM', fallback: 'unsupported');
if (kIsWeb) return supportedOtherPlatform == 'supported';
if (Platform.isIOS) {
return supportedIOSPlatform == 'supported';
} else {
return supportedOtherPlatform == 'supported';
}
}
static List<String> get oidcScopes {
try {
final envScopes = dotenv.get('OIDC_SCOPES', fallback: '');
if (envScopes.isNotEmpty) {
return envScopes.split(',');
}
return OIDCConstant.oidcScope;
} catch (e) {
return OIDCConstant.oidcScope;
}
}
static String? get forwardWarningMessage {
final forwardWarningMessage = dotenv.get(
'FORWARD_WARNING_MESSAGE',
fallback: '',
);
if (forwardWarningMessage.trim().isEmpty) {
return null;
}
return forwardWarningMessage;
}
static String get _platformEnv => dotenv.get('PLATFORM', fallback: 'other');
static bool get isSaasPlatForm => _platformEnv.toLowerCase() == saasPlatform;
static bool get isWebSocketEchoPingEnabled => dotenv.get('WS_ECHO_PING', fallback: 'false') == 'true';
static bool get isCozyIntegrationEnabled => dotenv.get('COZY_INTEGRATION', fallback: 'false') == 'true';
static String get cozyExternalBridgeVersion => dotenv.get('COZY_EXTERNAL_BRIDGE_VERSION', fallback: '0.16.1');
static bool get isForceEmailQueryEnabled =>
dotenv.get('FORCE_EMAIL_QUERY', fallback: 'false') == 'true';
}