From aa9aabdf2eb8c655ac11ae7e270e8bf3f5760cfc Mon Sep 17 00:00:00 2001 From: David Zhang Date: Sat, 8 Aug 2026 19:13:11 -0400 Subject: [PATCH 1/8] fix: make mobile emulator and beta Firebase profiles explicit Failure-Class: none --- .github/workflows/mobile-app-checks.yml | 12 +- .gitignore | 1 + app/README.md | 26 +++ app/android/app/src/dev/AndroidManifest.xml | 12 + app/android/app/src/main/AndroidManifest.xml | 6 - app/android/app/src/prod/AndroidManifest.xml | 18 ++ app/ios/Flutter/Base.xcconfig | 1 + app/ios/Flutter/devDebug.xcconfig | 2 + app/ios/Flutter/devProfile.xcconfig | 2 + app/ios/Flutter/devRelease.xcconfig | 2 + app/ios/Flutter/raybanDatDebug.xcconfig | 2 + app/ios/Flutter/raybanDatProfile.xcconfig | 2 + app/ios/Flutter/raybanDatRelease.xcconfig | 2 + app/ios/Runner/Info-Dev.plist | 216 ++++++++++++++++++ app/ios/Runner/Info.plist | 2 +- app/lib/env/env.dart | 114 ++++++++- app/lib/env/environment_profile.dart | 62 +++++ app/lib/firebase_options_local.dart | 62 +++++ app/lib/main.dart | 20 +- app/lib/services/auth_service.dart | 12 +- app/lib/startup_routing.dart | 10 +- app/setup.sh | 153 +++++++++---- .../prebuilt/GoogleService-Info-Local.plist | 30 +++ .../prebuilt/firebase_options_local.dart | 62 +++++ app/setup/prebuilt/google-services-local.json | 28 +++ app/setup/scripts/setup.ps1 | 104 ++++++--- app/test.sh | 20 +- app/test/unit/env_test.dart | 68 +++++- 28 files changed, 931 insertions(+), 120 deletions(-) create mode 100644 app/android/app/src/dev/AndroidManifest.xml create mode 100644 app/android/app/src/prod/AndroidManifest.xml create mode 100644 app/ios/Runner/Info-Dev.plist create mode 100644 app/lib/env/environment_profile.dart create mode 100644 app/lib/firebase_options_local.dart create mode 100644 app/setup/prebuilt/GoogleService-Info-Local.plist create mode 100644 app/setup/prebuilt/firebase_options_local.dart create mode 100644 app/setup/prebuilt/google-services-local.json diff --git a/.github/workflows/mobile-app-checks.yml b/.github/workflows/mobile-app-checks.yml index 4120cf6ec45..2cac7a0e888 100644 --- a/.github/workflows/mobile-app-checks.yml +++ b/.github/workflows/mobile-app-checks.yml @@ -126,8 +126,8 @@ jobs: - name: Prepare Flutter dev compile inputs working-directory: app run: | - cp setup/prebuilt/firebase_options.dart lib/firebase_options_dev.dart - cp setup/prebuilt/firebase_options.dart lib/firebase_options_prod.dart + cp setup/prebuilt/firebase_options_local.dart lib/firebase_options_dev.dart + cp setup/prebuilt/firebase_options_local.dart lib/firebase_options_prod.dart { echo "API_BASE_URL=" echo "USE_WEB_AUTH=true" @@ -262,10 +262,10 @@ jobs: working-directory: app run: | mkdir -p android/app/src/dev/ android/app/src/prod/ - cp setup/prebuilt/firebase_options.dart lib/firebase_options_dev.dart - cp setup/prebuilt/firebase_options.dart lib/firebase_options_prod.dart - cp setup/prebuilt/google-services.json android/app/src/dev/ - cp setup/prebuilt/google-services.json android/app/src/prod/ + cp setup/prebuilt/firebase_options_local.dart lib/firebase_options_dev.dart + cp setup/prebuilt/firebase_options_local.dart lib/firebase_options_prod.dart + cp setup/prebuilt/google-services-local.json android/app/src/dev/google-services.json + cp setup/prebuilt/google-services-local.json android/app/src/prod/google-services.json cp setup/prebuilt/key.properties android/key.properties { echo "API_BASE_URL=" diff --git a/.gitignore b/.gitignore index 284d5bb7c5d..ed030823669 100644 --- a/.gitignore +++ b/.gitignore @@ -125,6 +125,7 @@ src/recordings # Apps /app/lib/firebase_options.dart /app/lib/firebase_options_*.dart +!/app/lib/firebase_options_local.dart /app/firebase.json # Solidworks models diff --git a/app/README.md b/app/README.md index 0a3dc52d92c..985ef243b91 100644 --- a/app/README.md +++ b/app/README.md @@ -27,7 +27,33 @@ Before getting started, make sure your device is connected and unlocked. If you' .\setup\scripts\setup.ps1 android ``` + `bash setup.sh ios` is the safe local-development path: it uses the local + API/emulator harness and the `demo-omi-local` Firebase project. For a real + iPhone, set `OMI_DEV_HOST` to the Mac's LAN address when the local harness is + reachable from the device. + iOS setup requires macOS/Xcode, so Windows developers should use the Android setup path. + +### Mobile beta / dogfood + +The mobile beta is an explicit production-data profile. It uses the production +Firebase project and user IDs, but routes serving traffic to +`https://api.omiapi.com/`, matching the macOS beta serving plane: + +```bash +export FIREBASE_SERVICE_ACCOUNT_KEY=/secure/path/to/firebase-service-account.json +bash setup.sh ios beta + +# Android beta uses the existing prod flavor and package +bash setup.sh android beta +``` + +The Firebase service account must be able to generate the production mobile +configuration, and the beta bundle ID must be registered with both Firebase and +the Apple team. Override the default bundle ID with +`OMI_MOBILE_BETA_BUNDLE_ID` when your team uses a different registered ID. The +beta build uses the `mobile_beta` profile and the `omi-beta://auth/callback` +scheme; it must not be treated as a local-emulator build. 3. Ensure GitHub SSH access is set up correctly for pulling certificates from repositories. After running the command below, if you're prompted for a passphrase, enter your SSH passphrase — or simply press Enter/Return if you haven't set one. ```bash diff --git a/app/android/app/src/dev/AndroidManifest.xml b/app/android/app/src/dev/AndroidManifest.xml new file mode 100644 index 00000000000..2edddbeea29 --- /dev/null +++ b/app/android/app/src/dev/AndroidManifest.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/app/android/app/src/main/AndroidManifest.xml b/app/android/app/src/main/AndroidManifest.xml index b05eeaf9d1d..368a1768aeb 100644 --- a/app/android/app/src/main/AndroidManifest.xml +++ b/app/android/app/src/main/AndroidManifest.xml @@ -169,12 +169,6 @@ android:scheme="https" android:pathPattern="/tasks/.*" /> - - - - - -