diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 40321d5b0..eb24c003b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,10 @@ +import com.google.firebase.crashlytics.buildtools.gradle.tasks.InjectMappingFileIdTask +import com.google.firebase.crashlytics.buildtools.gradle.tasks.UploadMappingFileTask +import com.google.gms.googleservices.GoogleServicesTask + plugins { alias(libs.plugins.android.application) + alias(libs.plugins.crashlytics) alias(libs.plugins.detekt) alias(libs.plugins.hilt) alias(libs.plugins.kotlin.android) @@ -7,6 +12,7 @@ plugins { alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.ksp) + alias(libs.plugins.google.services) kotlin("kapt") } @@ -89,6 +95,10 @@ android { } dependencies { + fun standardImplementation(dependencyNotation: Any) { + add("standardImplementation", dependencyNotation) + } + implementation(libs.androidx.activity.compose) implementation(libs.androidx.browser) implementation(platform(libs.androidx.compose.bom)) @@ -107,11 +117,8 @@ dependencies { implementation(libs.androidx.room.ktx) implementation(libs.androidx.room.runtime) implementation(libs.androidx.splashscreen) - implementation(platform(libs.google.firebase.bom)) implementation(libs.bitwarden.sdk) implementation(libs.bumptech.glide) - implementation(libs.google.firebase.cloud.messaging) - implementation(libs.google.firebase.crashlytics) implementation(libs.google.hilt.android) kapt(libs.google.hilt.compiler) implementation(libs.jakewharton.retrofit.kotlinx.serialization) @@ -128,6 +135,11 @@ dependencies { debugImplementation(libs.androidx.compose.ui.test.manifest) debugImplementation(libs.androidx.compose.ui.tooling) + // Standard-specific flavor dependencies + standardImplementation(libs.google.firebase.cloud.messaging) + standardImplementation(platform(libs.google.firebase.bom)) + standardImplementation(libs.google.firebase.crashlytics) + testImplementation(libs.androidx.compose.ui.test) testImplementation(libs.google.hilt.android.testing) testImplementation(libs.junit.junit5) @@ -207,3 +219,13 @@ tasks { useJUnitPlatform() } } + +afterEvaluate { + // Disable Fdroid-specific tasks that we want to exclude + val tasks = tasks.withType() + + tasks.withType() + + tasks.withType() + tasks + .filter { it.name.contains("Fdroid") } + .forEach { it.enabled = false } +} diff --git a/app/src/standard/google-services.json b/app/src/standard/google-services.json new file mode 100644 index 000000000..eb8252261 --- /dev/null +++ b/app/src/standard/google-services.json @@ -0,0 +1,73 @@ +{ + "project_info": { + "project_number": "1093287226212", + "firebase_url": "https://bitwarden-dev.firebaseio.com", + "project_id": "bitwarden-dev", + "storage_bucket": "bitwarden-dev.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1093287226212:android:f8d67b786db1b844", + "android_client_info": { + "package_name": "com.x8bit.bitwarden.dev" + } + }, + "oauth_client": [ + { + "client_id": "1093287226212-m4mv8ho387tdgosc9lsltnmruul7ouo0.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyA4Xkn0do7Ky_OLff2L_7MXeNK6s-JVgXg" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:1093287226212:android:f8d67b786db1b844", + "android_client_info": { + "package_name": "com.x8bit.bitwarden" + } + }, + "oauth_client": [ + { + "client_id": "1093287226212-m4mv8ho387tdgosc9lsltnmruul7ouo0.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyA4Xkn0do7Ky_OLff2L_7MXeNK6s-JVgXg" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} diff --git a/app/src/standard/google-services.json.enc b/app/src/standard/google-services.json.enc new file mode 100644 index 000000000..1a4c873cb Binary files /dev/null and b/app/src/standard/google-services.json.enc differ diff --git a/build.gradle.kts b/build.gradle.kts index 313f1b86c..9a69204f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,4 +5,5 @@ plugins { alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.kotlinx.kover) apply false alias(libs.plugins.ksp) apply false + alias(libs.plugins.google.services) apply false } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d43e70a8b..4dbd42d9d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,9 +24,11 @@ androidxSplash = "1.1.0-alpha02" # Once the app and SDK reach a critical point of completeness we should begin fixing the version # here (BIT-311). bitwardenSdk = "0.3.1-20231221.163756-59" +crashlytics = "2.9.9" detekt = "1.23.1" firebaseBom = "32.7.0" glide = "1.0.0-beta01" +googleServices = "4.4.0" hilt = "2.48" junit5 = "5.8.2" jvmTarget = "1.8" @@ -98,7 +100,9 @@ zxing-zxing-core = { module = "com.google.zxing:core", version.ref = "zxing" } [plugins] android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }