From 0f4a9929792db63e749eaf4ffd2c396ce524280e Mon Sep 17 00:00:00 2001 From: Alex Yong Date: Mon, 11 Aug 2025 16:35:49 +0000 Subject: [PATCH] feat: Adding in dummy google services json file, and updating documentation --- .devcontainer/devcontainer.json | 2 +- app/google-services.json.example | 68 ++++++++++++++++++++ docs/src/content/docs/contributing/setup.mdx | 25 +++++-- 3 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 app/google-services.json.example diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9c8861e5..7b70f8bf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ "jdkDistro": "oracle" } }, - "postCreateCommand": "chmod +x gradlew && deno run -A scripts/download_deps.ts --yes && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties && git submodule update --init --recursive", + "postCreateCommand": "chmod +x gradlew && deno run -A scripts/download_deps.ts --yes && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties && cp app/google-services.json.example app/google-services.json && git submodule update --init --recursive", "customizations": { "vscode": { "extensions": [ diff --git a/app/google-services.json.example b/app/google-services.json.example new file mode 100644 index 00000000..315d6b30 --- /dev/null +++ b/app/google-services.json.example @@ -0,0 +1,68 @@ +{ + "project_info": { + "project_number": "123456789012", + "project_id": "revolt-android-dev", + "storage_bucket": "revolt-android-dev.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:123456789012:android:abcdef1234567890", + "android_client_info": { + "package_name": "chat.revolt" + } + }, + "oauth_client": [ + { + "client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDummyKeyForDevelopmentOnly1234567890" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:123456789012:android:abcdef1234567891", + "android_client_info": { + "package_name": "chat.revolt.debug" + } + }, + "oauth_client": [ + { + "client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDummyKeyForDevelopmentOnly1234567890" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/docs/src/content/docs/contributing/setup.mdx b/docs/src/content/docs/contributing/setup.mdx index e69c28a3..578e2696 100644 --- a/docs/src/content/docs/contributing/setup.mdx +++ b/docs/src/content/docs/contributing/setup.mdx @@ -6,10 +6,12 @@ template: doc This page contains the guidelines for setting up your development environment for Revolt on Android. These guidelines are important to ensure that your development environment is set up correctly and you can start contributing to the project. -If you want to compile the app for yourself, you can also follow these guidelines, however you may not need Android Studio and it may be possible to build the app using the command line, out of the scope of this guide. +If you want to compile the app yourself, you can follow these guidelines. You may not need Android Studio, as it’s possible to build the app from the command line. GitHub Codespaces automates most of the process for you if you want to go that route and this guide covers those steps, but won’t go into detail on other command-line methods. :::danger It may be tempting to skip some of these steps, but make sure you follow them to ensure that your development environment is set up correctly. + +Note: If you are doing this in Github Codespaces, steps 1-10 will be done for you. Also note that while small codespace instances can build this app, it's recommend to use 8-core or above for best results. ::: import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" @@ -137,11 +139,26 @@ import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" You can get these values from the Sentry dashboard. -10. Build the project. +10. Copy the `google-services.json.example` file within the `app` directory to `google-services.json`. + + Firebase services are integrated into the project, so we need a `google-services.json` file for the build to succeed. For development purposes, use the provided example file: + + ```sh + cp app/google-services.json.example app/google-services.json + ``` + + :::note + This is a mock configuration file for development purposes only. In a production environment, you would use a real Firebase project configuration. + ::: + +11. Build the project. You can build the project by clicking on the 'Run' button in Android Studio. If asked, build the `:app` module. -11. **You're all set!** You can now start contributing to Revolt on Android. + If building within Github Codespaces, you can build a fresh debug apk by running `./gradlew asembledebug --no-daemon` from the root of the project. + Upon completion, the apk will be within `app/build/outputs/apk/debug/` - +12. **You're all set!** You can now start contributing to Revolt on Android. + + \ No newline at end of file