Skip to content

Commit 94d4f6c

Browse files
committed
Ensure enterprise build only use the application names.
1 parent e7de056 commit 94d4f6c

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

app/src/main/kotlin/io/element/android/x/di/AppModule.kt

+20-17
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,26 @@ object AppModule {
7373
@ApplicationContext context: Context,
7474
buildType: BuildType,
7575
enterpriseService: EnterpriseService,
76-
) = BuildMeta(
77-
isDebuggable = BuildConfig.DEBUG,
78-
buildType = buildType,
79-
applicationName = ApplicationConfig.APPLICATION_NAME.takeIf { it.isNotEmpty() } ?: context.getString(R.string.app_name),
80-
productionApplicationName = ApplicationConfig.PRODUCTION_APPLICATION_NAME,
81-
desktopApplicationName = ApplicationConfig.DESKTOP_APPLICATION_NAME,
82-
applicationId = BuildConfig.APPLICATION_ID,
83-
isEnterpriseBuild = enterpriseService.isEnterpriseBuild,
84-
// TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
85-
lowPrivacyLoggingEnabled = false,
86-
versionName = BuildConfig.VERSION_NAME,
87-
versionCode = context.getVersionCodeFromManifest(),
88-
gitRevision = BuildConfig.GIT_REVISION,
89-
gitBranchName = BuildConfig.GIT_BRANCH_NAME,
90-
flavorDescription = BuildConfig.FLAVOR_DESCRIPTION,
91-
flavorShortDescription = BuildConfig.SHORT_FLAVOR_DESCRIPTION,
92-
)
76+
): BuildMeta {
77+
val applicationName = ApplicationConfig.APPLICATION_NAME.takeIf { it.isNotEmpty() } ?: context.getString(R.string.app_name)
78+
return BuildMeta(
79+
isDebuggable = BuildConfig.DEBUG,
80+
buildType = buildType,
81+
applicationName = applicationName,
82+
productionApplicationName = if (enterpriseService.isEnterpriseBuild) applicationName else ApplicationConfig.PRODUCTION_APPLICATION_NAME,
83+
desktopApplicationName = if (enterpriseService.isEnterpriseBuild) applicationName else ApplicationConfig.DESKTOP_APPLICATION_NAME,
84+
applicationId = BuildConfig.APPLICATION_ID,
85+
isEnterpriseBuild = enterpriseService.isEnterpriseBuild,
86+
// TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
87+
lowPrivacyLoggingEnabled = false,
88+
versionName = BuildConfig.VERSION_NAME,
89+
versionCode = context.getVersionCodeFromManifest(),
90+
gitRevision = BuildConfig.GIT_REVISION,
91+
gitBranchName = BuildConfig.GIT_BRANCH_NAME,
92+
flavorDescription = BuildConfig.FLAVOR_DESCRIPTION,
93+
flavorShortDescription = BuildConfig.SHORT_FLAVOR_DESCRIPTION,
94+
)
95+
}
9396

9497
@Provides
9598
@SingleIn(AppScope::class)

0 commit comments

Comments
 (0)