From fd9ca8f5443ff2386ea929c5ea5ccd66a87f5756 Mon Sep 17 00:00:00 2001 From: Sean Weiser <125889608+sean-livefront@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:31:45 -0600 Subject: [PATCH] BIT-946: Add Google Services and Crashlytics to standard builds (#473) --- app/build.gradle.kts | 28 ++++++++- app/src/standard/google-services.json | 73 ++++++++++++++++++++++ app/src/standard/google-services.json.enc | Bin 0 -> 1520 bytes build.gradle.kts | 1 + gradle/libs.versions.toml | 4 ++ 5 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 app/src/standard/google-services.json create mode 100644 app/src/standard/google-services.json.enc 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 0000000000000000000000000000000000000000..1a4c873cb3eaa40e90d153557964bfc3d436dd06 GIT binary patch literal 1520 zcmVqq9V zs|a#u9+C{3696l+i**x*K7bm&yWC)q~WgeJ^i{hF`-*Og4Zd$};Y7Y>mx+un%fj$wv(k~?It`qu&8%rX>I)x8KsL z^Dw^Bag9CJ+SlNx^LFq{$7QH~`utl7rBi)^1ARRk4^NcND)NhQ8$DHw0uIv3?`kTt zfw-@lYgPdD-Is#}^M^)Yu;f#ll{}+h==*xPa9F;wN^0!Zb)*!~)No0D*z@l@q_W~c zi=t3WM($I_!uz*yxXK^&xK_kyzzKZ6l+lVhsrR0PC4M5JkBWy1_QjP|#&{!aW@a78 za;;72i&fh7sRTEtk)*V|Cr;)HK^M&$zu{8h)NDRfIV`Nx=tJO%z3UP-jm84j2nI>J z+Lq8ph5upI&k51#i*fWI>EgxbvEKMwHmKfT+OGjiIib~3c>hZhvu4j5^+?EwGNN7s z!!J0ieF}$u&`w}7QB&?p?ZO)q|5ow9feh=5z=puXjbXm3oRQB6U)6AmnAe@qH@CDC z8nJayYfiWe&XV~p?wJ$G%fwwFJ<7$BX?=+g8F|~|BtF|CCnMd~4HjTC-(1kjy6JW+ zNkEvJBFj1<+(@;S!7cJ6(&fx#W1psF2K*_}&uPVQ;(&Lc@Z0Los7bKKWqR^bN8MAt zZP&=1%e#Abg#j~LP1!?etUvn@Ma9z+fcP$zm3chuHDr)*JHuwk7S`h>UywC4Px<~N zIgfc^EMijOn4ytrZHGr%PHCk4T}tRf2kMjL0D@z{v>%7@fM=hvN74i2R7xAd zi!@0saIdoc<3Ea&7evMzoLS*r-<46;dl0vYoMlr@!kP`6)FI=@m&*H%hLlv|kf8`i zm%Vog9pjy5M4jKaMnGbLT)oUzg|P_}MGM5Xh#I6a^ZCe*2O_&c_`7EiZW*JFhtm3E zMb{J_BIBCPL=cx!(0eYIwWj^qne1f{&5EPV!J(t2_|llMy&D5h_k|cf z`-CrpX>Yra#P`V0ZQ(k)nPyfxyc9B|smQAnJ#K@5gk`9UAY(`c6Q+o9gv1kAu9p<4{JTR?%}iKJ zJVd^VMLQWfvvZ%nC90D1rf@=(f9_u;o0#DTD3M@M%|i`c2PbJ`;-$5vLbaEDW2DxC zC44RqCzY8w`*jJE2YhT|EHu~s>+T$}Qb5uN9YBYLd6^ocEhveWXBWnC9w+oR4!n#5 W%oTRMS0swMf}@jzO6)2#JjYK>R02H! literal 0 HcmV?d00001 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" }