From f7bd8f8d4c57c279e05dfafa729292aae9735245 Mon Sep 17 00:00:00 2001 From: Rebecca Franks Date: Fri, 4 Jul 2025 12:01:31 +0100 Subject: [PATCH 1/4] Remove local google-services.json file, and pull debug file down in build_and_test.yml workflow instead. Add to .gitignore --- .github/workflows/build_and_test.yml | 5 +++++ README.md | 3 +-- app/.gitignore | 3 ++- app/google-services.json | 29 ---------------------------- 4 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 app/google-services.json diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c991d1ad..521af31c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -38,6 +38,11 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Decode google-services.json + env: + DEBUG_GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_BASE64 }} + run: | + echo DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json - name: Apply Spotless run: ./gradlew spotlessApply diff --git a/README.md b/README.md index e1ed07cf..a1bdb77a 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,7 @@ The app combines a variety of different Google technologies, such as: 1. Clone the repository. 2. Create a [Firebase project](https://firebase.google.com/products/firebase-ai-logic) and generate a `google-services.json` file. - Replace the current placeholder [`app/google-services.json`](app/google-services.json) file with your own JSON file created - above. Be sure to enable [Vertex AI API](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com). + Place the file in the app folder: [`app/google-services.json`](app/google-services.json). Be sure to enable [Vertex AI API](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com). Ensure to also enable [AppCheck](https://console.firebase.google.com/project/_/appcheck) on your Firebase project to prevent API abuse. 3. This project makes use of remote config on Firebase too, you can import the [Firebase Remote config](https://firebase.google.com/docs/remote-config) settings from diff --git a/app/.gitignore b/app/.gitignore index 42afabfd..65d12b95 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1,2 @@ -/build \ No newline at end of file +/build +google-services.json \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 479980dc..00000000 --- a/app/google-services.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "project_info": { - "project_number": "abc", - "project_id": "YourProjectId", - "storage_bucket": "abc" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "APlaceholderAPIKeyWith-ThirtyNineCharsX", - "android_client_info": { - "package_name": "com.android.developers.androidify" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "APlaceholderAPIKeyWith-ThirtyNineCharsX" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - } - ], - "configuration_version": "1" -} From d6b91da0d2f57a2b7de8b3933e61910c65aabefd Mon Sep 17 00:00:00 2001 From: Rebecca Franks Date: Fri, 4 Jul 2025 12:04:37 +0100 Subject: [PATCH 2/4] Fix build error for accessing token --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 521af31c..20fcc86b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -42,7 +42,7 @@ jobs: env: DEBUG_GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_BASE64 }} run: | - echo DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json + echo $DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json - name: Apply Spotless run: ./gradlew spotlessApply From 86d22f5865bee4a14130deacc5013f2ae07da8ab Mon Sep 17 00:00:00 2001 From: Rebecca Franks Date: Fri, 4 Jul 2025 12:05:43 +0100 Subject: [PATCH 3/4] Update README.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1bdb77a..cfac5c60 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The app combines a variety of different Google technologies, such as: 1. Clone the repository. 2. Create a [Firebase project](https://firebase.google.com/products/firebase-ai-logic) and generate a `google-services.json` file. - Place the file in the app folder: [`app/google-services.json`](app/google-services.json). Be sure to enable [Vertex AI API](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com). + Place the file in the app folder: `app/google-services.json`. Be sure to enable [Vertex AI API](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com). Ensure to also enable [AppCheck](https://console.firebase.google.com/project/_/appcheck) on your Firebase project to prevent API abuse. 3. This project makes use of remote config on Firebase too, you can import the [Firebase Remote config](https://firebase.google.com/docs/remote-config) settings from From 4ee1a05527686c16826d7dce6edb042716f3bd05 Mon Sep 17 00:00:00 2001 From: Rebecca Franks Date: Fri, 4 Jul 2025 12:09:24 +0100 Subject: [PATCH 4/4] Add export services for instrumented tests too. --- .github/workflows/build_and_test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 20fcc86b..cc5fd4a2 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -127,6 +127,11 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Decode google-services.json + env: + DEBUG_GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_BASE64 }} + run: | + echo $DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json - name: Build run: ./gradlew assembleDebug assembleDebugAndroidTest