Repository navigation
feat(app): prepare the iOS app for its first App Store submission - #1737
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merge-pass review (head 1f6d916), done by a gate reviewer running a different model than the author's. I'm not merging yet: the privacy answer is wrong. What checked out:
Please fix before merge:
Once that's in and the checks are green, this goes back into the merge queue. |
|
Fix for the merge pass's finding on 1f6d916, in 6218535. I declared the data rather than adding a native-only path, so both stores tell the same story as #1736. "Data Not Collected" vs. the telemetry path:
Checks:
|
|
Merging without a CodeRabbit review: CodeRabbit was rate-limited, so no review ran. The merge pass reviewed it instead. Two gate reviews were done on a different model from the author's.
|
…1744) The Android half of the phone app's push: the PC's alerts reach an Android phone through Firebase Cloud Messaging and are decrypted on the phone. The relay side is a commit on #1695 (`feat/push-relay`), so that PR grows instead of a second one touching `push-relay/`. ## Shape: a module of its own This PR must not touch any file #1697 changes (`app/android/app/build.gradle`, `AndroidManifest.xml`, `MainActivity.java`, `app/package.json`, …). The owner chose a self-contained library module, `app/android/ovis-push`: - `settings.gradle` includes the module and adds it to `:app`, from `plugins.withId('com.android.application')`. - The module's manifest merges in the messaging service, `POST_NOTIFICATIONS` and a startup provider. - `OvisPushInitializer` (the provider) registers the plugin with the app's `BridgeActivity` from `onActivityCreated`. That callback runs inside `Activity.onCreate`, before `BridgeActivity` builds its bridge. - Once #1697 is merged, the dependency and the registration can move into `app/build.gradle` and `MainActivity`, and the two hooks go away. ## What it does - **`OvisPush` plugin** (`subscribe({ applicationServerKey })`, `getSubscription()`, `unsubscribe()`), called from the PC page: - asks for notifications on Android 13+; - gets the FCM token and registers it with the relay as `{service:"fcm", token, vapid_key}`, once per PC; - answers like a browser's `PushSubscriptionJSON`: `{endpoint, expirationTime, keys:{p256dh, auth}}`; - makes a new endpoint when the FCM token or the PC's key changes. - Error codes: `unavailable`, `permission`, `no_pc`, `invalid_key`, `failed`. - **`OvisMessagingService`**: - receives the relay's data-only message; - decrypts its `ovis` field (RFC 8291 / RFC 8188 aes128gcm, `WebPushDecrypt`) with the phone's P-256 keys (`PushKeys`, kept in app-private preferences by `PushStore`); - shows the PC's title and body per tag, as `public/sw.js` does, or "herdr needs you" when it cannot decrypt. - **No Google contact until a PC subscribes**: `firebase_messaging_auto_init_enabled=false`. - **Firebase config without the google-services plugin**: `ovis-push/build.gradle` reads `app/android/app/google-services.json` (gitignored) or `$OVIS_GOOGLE_SERVICES`, and generates the resources Firebase's own startup reads. - Without the file the app builds and runs with push unavailable. - `google-services.example.json` is a placeholder with fake values. - The client side (`src/lib/push.ts` calling the plugin) is a later, separate change. ## Verification - `./gradlew :ovis-push:testDebugUnitTest`: 4 pass. - The RFC 8291 appendix A message decrypts to its plaintext. - A changed ciphertext is refused. - Other keys are refused. - Generated key halves agree. - `:ovis-push:lintDebug`: 0 errors, 2 deliberate warnings. - `commit()` on first key generation, so keys persist before the public half is handed out. - No `onNewToken`: endpoints re-register lazily at the next `subscribe`. - Android 16 Play emulator, against an isolated QA server: - Without `google-services.json`: `OvisPush` is registered (`Capacitor.PluginHeaders`). `subscribe` answers `no_pc` on the connect screen and `unavailable` on the PC page; `getSubscription` returns null. - With the placeholder config: Android's "Allow Ovis to send you notifications?" dialog appears. After Allow, `POST_NOTIFICATIONS` is granted and Firebase's token request fails on the fake API key, as it should. A bad `applicationServerKey` answers `invalid_key`, and the PC's real key from `GET /api/push` gets to Firebase. - Real FCM delivery needs the owner's Firebase project; see below. - `bun run check fast`: pass. - Gate review: round 1 rejected `readAllBytes()` (needs API 33; minSdk is 26). It was replaced, and the re-review approved. ## What the owner sets up (`ovis-push/README.md`) 1. A Firebase project, with an Android app `sh.ovis.app` in it. 2. Download `google-services.json` into `app/android/app/`. It is never committed. 3. A service-account JSON key, which goes only into the relay: `wrangler secret put FCM_SERVICE_ACCOUNT`. 4. Before this ships in a Play build, update the data safety form and the privacy policy: the FCM token goes to the relay. ## No overlap New files plus `app/android/settings.gradle`, `app/android/.gitignore` and a changelog fragment. Nothing here is in #1697, #1695, #1736 or #1737.
Everything for the iOS app's first App Store submission that does not need the owner's Apple login. Nothing is uploaded or submitted, no app record is created, and no key is made.
App changes (small)
app/ios/App/App/PrivacyInfo.xcprivacy(new, added to the App target's resources inproject.pbxproj):PCStore), reasonCA92.1;Info.plist:UIRequiredDeviceCapabilitieschanges fromarmv7toarm64. The binary is arm64-only, and armv7 is the Capacitor template's leftover.app/store/ios.md(new)sh.ovis.app, version 1.0, build 1 (raise it for every upload);Screenshots (
app/store/ios/)Verification (eamac, fresh clone in /tmp)
PrivacyInfo.xcprivacyis insideApp.app.xcodebuild archive -sdk iphoneos CODE_SIGNING_ALLOWED=NO): ARCHIVE SUCCEEDED. The archive is arm64-only, requires the arm64 capability, includes the manifest, and reports 1.0 (1),sh.ovis.app.bun run check fast: pass.No overlap
Nothing here is in #1697, #1695, #1719 or #1736. The Android closed test is #1736. The fix for a white screen on iOS while the first page loads (dark web view background) went into #1697, because it touches
app/capacitor.config.json.