findfamily: remove security-code verification from pairing
- Commit
dda8293d86f1bdfb458dd12645146cb9cde3322d- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-06 02:39 UTC (1 hour ago)
- Parents
fef9eff
Remove the SecurityCodeDialog route and content, the PersonSheet verify button, and the KeyMismatchDialog. Pairing no longer carries an invite fingerprint: AddInvite and Route.AddPersonDialog drop the fingerprint, MainActivity ignores any legacy k= query, share invites carry only the id, and connectUser/peerCryptoStatus accept a PQC peer directly with no KEY_MISMATCH gate (the classic-only NEEDS_UPDATE capability check remains). Networking.securityCode/securityCodePqc, ViewModel.securityCodeFor, and Networking.myInviteFingerprint are removed as orphans. PairAuth sender pinning and ML-DSA powered-off signature verification (signAsMe/verifyFrom) are unrelated protocol auth and stay. Dead strings and the security-code screenshot preview are removed, and tests covering the removed dialogs, fingerprint mismatch, and security code are deleted or updated to the direct pairing path. Verified: ./gradlew :findfamily:testDevUnitTest passes (also compileDevKotlin). Baseline at origin/main was fully green. Server impact: none required in this repo; the relay wsGetKey response is still used for capability, old links with k= are ignored by the app, and Pqc.securityCode/inviteFingerprint remain in :library:e2ee-p2p for other callers/tests.
Diff
findfamily/src/main/java/com/vayunmathur/findfamily/MainActivity.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/MainActivity.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/MainActivity.ktindex d53a7b38ab..199daf049e 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/MainActivity.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/MainActivity.kt@@ -163,9 +163,9 @@ class MainActivity : MaActivity() { } /**- * Decodes a `findfamily://add/<base26Userid>[?k=<fingerprint>]` invite, or null for any- * other intent. `k` is a truncated hash of the sender's public bundle, which the connect- * flow checks the relay's key against; links from builds before it existed have no `k`.+ * Decodes a `findfamily://add/<base26Userid>` invite, or null for any+ * other intent. A `k=` query left by an older invite link is ignored:+ * pairing no longer verifies a security code or invite fingerprint. */ private fun parseAddDeepLink(intent: Intent?): AddInvite? { val data = intent?.data ?: return null@@ -173,8 +173,6 @@ class MainActivity : MaActivity() { val segment = data.lastPathSegment?.trim()?.uppercase() ?: return null if (segment.isEmpty() || segment.any { it !in 'A'..'Z' }) return null val id = runCatching { segment.decodeBase26() }.getOrNull() ?: return null- val fingerprint = runCatching { data.getQueryParameter("k")?.trim() }.getOrNull()- ?.takeIf { it.isNotEmpty() && it.all { c -> c.isLetterOrDigit() || c == '-' || c == '_' } }- return AddInvite(id, fingerprint)+ return AddInvite(id) } }
findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.ktindex 0ba59c9e88..233ea88a15 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt@@ -13,7 +13,6 @@ import com.vayunmathur.findfamily.ui.dialogs.AddLinkDialog import com.vayunmathur.findfamily.ui.dialogs.AddPersonDialog import com.vayunmathur.findfamily.ui.dialogs.AddTrackerDialog import com.vayunmathur.findfamily.ui.dialogs.NoShowAlertDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.PersonActions import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue@@ -78,7 +77,7 @@ fun Navigation( // accepts, so the connection/crypto flow is unchanged. LaunchedEffect(deepLinkAddInvite) { if (deepLinkAddInvite != null) {- backStack.add(Route.AddPersonDialog(deepLinkAddInvite.id, deepLinkAddInvite.fingerprint))+ backStack.add(Route.AddPersonDialog(deepLinkAddInvite.id)) onDeepLinkAddConsumed() } }@@ -119,7 +118,7 @@ fun Navigation( ) } entry<Route.AddPersonDialog>(metadata = DialogPage()) {- AddPersonDialog(backStack, ffViewModel, platform, it.id, it.fingerprint)+ AddPersonDialog(backStack, ffViewModel, platform, it.id) } entry<Route.AddLinkDialog>(metadata = DialogPage()) { AddLinkDialog(backStack, ffViewModel)@@ -136,13 +135,6 @@ fun Navigation( entry<Route.UwbRangingPage> { UwbRangingScreen(backStack, ffViewModel, it.userId) }- entry<Route.SecurityCodeDialog>(metadata = DialogPage()) {- val users by ffViewModel.users.collectAsState()- val user = users.firstOrNull { u -> u.id == it.userId }- if (user != null) {- SecurityCodeDialog(user, ffViewModel) { backStack.pop() }- }- } entry<Route.NoShowAlertDialog>(metadata = DialogPage()) { val users by ffViewModel.users.collectAsState() val waypoints by ffViewModel.waypoints.collectAsState()
findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/Route.ktindex cb6dc22196..c86a3b0d84 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt@@ -29,7 +29,7 @@ sealed interface Route: NavKey { @Serializable /** Dialog for connecting to a person, optionally prefilled from an invite link. */- data class AddPersonDialog(val id: Long? = null, val fingerprint: String? = null): Route+ data class AddPersonDialog(val id: Long? = null): Route @Serializable /** Dialog for creating a temporary share link. */@@ -47,10 +47,6 @@ sealed interface Route: NavKey { @Serializable data class UwbRangingPage(val userId: Long): Route - @Serializable- /** Dialog showing the verification security code for the given person. */- data class SecurityCodeDialog(val userId: Long): Route- @Serializable /** Dialog for setting a no-show watch for the given person. */ data class NoShowAlertDialog(val userId: Long): Route
findfamily/src/main/java/com/vayunmathur/findfamily/domain/AddInvite.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/domain/AddInvite.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/domain/AddInvite.ktindex b791b75b15..713f21f012 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/domain/AddInvite.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/domain/AddInvite.kt@@ -1,4 +1,4 @@ package com.vayunmathur.findfamily.domain -/** A tapped invite link: the sender's id, plus the bundle fingerprint it vouched for. */-data class AddInvite(val id: Long, val fingerprint: String?)+/** A tapped invite link: the sender's id. */+data class AddInvite(val id: Long)
findfamily/src/main/java/com/vayunmathur/findfamily/domain/PlatformBackup.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/domain/PlatformBackup.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/domain/PlatformBackup.ktindex 8426e310a1..31330bea84 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/domain/PlatformBackup.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/domain/PlatformBackup.kt@@ -51,7 +51,7 @@ package com.vayunmathur.findfamily.domain * no-show watches. Restored people are reset to * `RequestStatus.AWAITING_REQUEST`: they are remembered, but no location * flows to or from them until the user re-pairs through the existing- * Add Person flow, which fingerprint-checks the peer's current bundle,+ * Add Person flow, * pins the verified key and mints a fresh outbound pair ID for the new * identity. That is the clean re-pair path; there is deliberately no * silent re-trust of a relay-served bundle for a restored contact.@@ -95,7 +95,7 @@ object FindFamilyPlatformBackup { } // People survive as remembered contacts only: no cached peer bundle, // no pair-ID secrets, and no location flow until an explicit,- // fingerprint-checked re-pair through Add Person.+ // re-pair through Add Person. add( "UPDATE `User` SET `encryptionKey` = NULL, `pqcEncryptionKey` = NULL, " + "`inboundPairId` = NULL, `outboundPairId` = NULL, " +
findfamily/src/main/java/com/vayunmathur/findfamily/network/Networking.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/network/Networking.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/network/Networking.ktindex 6a12c514f1..16e7f97a1e 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/network/Networking.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/network/Networking.kt@@ -605,26 +605,6 @@ object Networking { /** Generated PQC identity public and private bundles for a device unable to run keygen itself. */ data class PqcIdentityKeyPair(val publicBundleB64: String, val privateBundleB64: String) - /**- * Computes the quantum-safe verification "security code" for a connection: a fingerprint of- * *both* this device's and [user]'s PQC bundles. Identical on both peers; comparing them- * confirms the channel isn't intercepted. Null if PQC is unavailable or the peer has no bundle.- */- suspend fun securityCode(user: User): String? {- if (!pqcReady) return null- val theirBundle = peerPqcBundle(user) ?: return null- return runCatching { Pqc.securityCode(pqcIdentity.publicBundle, theirBundle) }.getOrNull()- }-- /** PQC safety number from a cached peer bundle (no lookup). */- fun securityCodePqc(user: User): String? {- // Malformed stored bundle = no usable bundle, not an exception (UI paths read this).- val theirBundle = user.pqcEncryptionKey- ?.let { runCatching { Base64.decode(it) }.getOrNull() } ?: return null- if (!pqcReady) return null- return runCatching { Pqc.securityCode(pqcIdentity.publicBundle, theirBundle) }.getOrNull()- }- /** * The peer's PQC public bundle — from cached `User.pqcEncryptionKey` or looked up over the * socket. If looked up, caches it. Non-null means the peer supports post-quantum sharing.@@ -673,54 +653,23 @@ object Networking { /** Peer is not registered, or the lookup couldn't complete (socket down/timeout). */ UNKNOWN, - /** The relay's bundle doesn't match the fingerprint the invite link vouched for. */- KEY_MISMATCH, } - /**- * Outcome of the connect-time key check. [verifiedBundleB64] is set only when an invite- * fingerprint was supplied and matched, and is meant to go straight onto the [User] row being- * created — pinning the key that was checked, so [peerPqcBundle] prefers it and a later lookup- * can't swap in one the fingerprint never covered.- */- data class PeerKeyCheck(val status: PeerCrypto, val verifiedBundleB64: String? = null)- /** * Checks a peer's post-quantum capability "when connecting", over the socket. PQC bundle → * [PeerCrypto.PQC]; only a classic key → [PeerCrypto.NEEDS_UPDATE] (show the update dialog); * neither, or the socket is down/times out → [PeerCrypto.UNKNOWN]. *- * [expectedFingerprint] is the `k=` value of the invite link this connection came from, when- * there was one. The relay's bundle has to hash to it, or the result is- * [PeerCrypto.KEY_MISMATCH] — this is what stops the relay handing out a key it controls- * instead of the sender's.+ * Pairing performs no security-code or fingerprint verification, so a+ * PQC bundle is accepted as returned by the relay. */- suspend fun peerCryptoStatus(userId: Long, expectedFingerprint: String? = null): PeerKeyCheck {- val res = wsGetKey(userId) ?: return PeerKeyCheck(PeerCrypto.UNKNOWN)+ suspend fun peerCryptoStatus(userId: Long): PeerCrypto {+ val res = wsGetKey(userId) ?: return PeerCrypto.UNKNOWN return when (res.status) {- WS_KEY_PQC -> {- if (expectedFingerprint == null) return PeerKeyCheck(PeerCrypto.PQC)- val bundle = res.bundle ?: return PeerKeyCheck(PeerCrypto.UNKNOWN)- if (!fingerprintMatches(userId, bundle, expectedFingerprint)) {- Log.status(TAG, "invite fingerprint mismatch for ${userId.toULong()}")- return PeerKeyCheck(PeerCrypto.KEY_MISMATCH)- }- PeerKeyCheck(PeerCrypto.PQC, Base64.encode(bundle))- }- WS_KEY_CLASSIC -> PeerKeyCheck(PeerCrypto.NEEDS_UPDATE)- else -> PeerKeyCheck(PeerCrypto.UNKNOWN)+ WS_KEY_PQC -> PeerCrypto.PQC+ WS_KEY_CLASSIC -> PeerCrypto.NEEDS_UPDATE+ else -> PeerCrypto.UNKNOWN } } - /**- * Whether [bundle] is the one [expected] (unpadded base64url) names. A malformed or truncated- * value fails rather than being skipped, so a mangled link is treated as unverified instead of- * silently trusting whatever the relay returned.- */- private fun fingerprintMatches(userId: Long, bundle: ByteArray, expected: String): Boolean {- val padded = if (expected.length % 4 == 0) expected else expected + "=".repeat(4 - expected.length % 4)- val want = runCatching { Base64.UrlSafe.decode(padded) }.getOrNull() ?: return false- return want.contentEquals(Pqc.inviteFingerprint(userId, bundle))- }- }
findfamily/src/main/java/com/vayunmathur/findfamily/network/NetworkingPqc.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/network/NetworkingPqc.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/network/NetworkingPqc.ktindex 55c4f90499..04499ddc4a 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/network/NetworkingPqc.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/network/NetworkingPqc.kt@@ -18,18 +18,6 @@ fun Networking.generatePqcLinkKey(): Networking.PqcLinkKey { ) } -/**- * This device's invite fingerprint, as the unpadded base64url `k=` value of a share link.- * Null when PQC is unavailable — the link then goes out without it and the recipient simply- * has nothing to pre-verify against, exactly as before this parameter existed.- */-fun Networking.myInviteFingerprint(): String? {- if (!pqcReady) return null- return runCatching {- Base64.UrlSafe.encode(Pqc.inviteFingerprint(userid, pqcIdentity.publicBundle)).trimEnd('=')- }.onFailure { Log.status(TAG, "invite fingerprint failed", it) }.getOrNull()-}- /** * Generates a full PQC identity (ML-KEM + ML-DSA) for a device we own but that cannot * run keygen itself — currently only UWB trackers, whose private bundle we hold on
findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyViewModel.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyViewModel.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyViewModel.ktindex 86f9bac9fa..48e10c0973 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyViewModel.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyViewModel.kt@@ -153,10 +153,6 @@ class FindFamilyViewModel( } } - /** Computes the end-to-end verification security code for a connected [user] (off the main thread). */- suspend fun securityCodeFor(user: User): String? =- withContext(Dispatchers.IO) { Networking.securityCode(user) }- fun upsertUser(user: User, onDone: () -> Unit = {}) { viewModelScope.launch(Dispatchers.IO) { repository.upsertUser(user)@@ -171,31 +167,24 @@ class FindFamilyViewModel( * Unknown (not-yet-registered) peers are allowed through — they may register with PQC * once they install the app. *- * [inviteFingerprint] is the `k=` value of the invite link this started from, if any. The- * relay's key must hash to it, otherwise [onKeyMismatch] fires and the peer is not added.+ * Pairing carries no security-code or invite-fingerprint verification:+ * a peer who passes the capability check is added directly. */ fun connectUser( user: User,- inviteFingerprint: String? = null, onNeedsUpdate: () -> Unit,- onKeyMismatch: () -> Unit = {}, onDone: () -> Unit, ) { viewModelScope.launch(Dispatchers.IO) {- val check = Networking.peerCryptoStatus(user.id, inviteFingerprint)- when (check.status) {+ when (Networking.peerCryptoStatus(user.id)) { Networking.PeerCrypto.NEEDS_UPDATE -> withContext(Dispatchers.Main) { onNeedsUpdate() }- Networking.PeerCrypto.KEY_MISMATCH -> withContext(Dispatchers.Main) { onKeyMismatch() } else -> {- // Store the fingerprint-checked key with the row itself, so the key that was- // verified is the one used from here on rather than a fresh relay lookup.- val withKey = check.verifiedBundleB64?.let { user.copy(pqcEncryptionKey = it) } ?: user // Hidden sender-auth secret (GHSA-x94x-v6f7-wwpp): the outbound pair ID this // device puts in every packet to this peer. Minted once at explicit connect // time — never rotated (the peer pins the first value it sees), never // overwritten here (a re-add must not invalidate the peer's pin).- val withPair = withKey.outboundPairId?.let { withKey }- ?: withKey.copy(+ val withPair = user.outboundPairId?.let { user }+ ?: user.copy( outboundPairId = com.vayunmathur.findfamily.domain.PairAuth.generatePairId() ) repository.upsertUser(withPair)
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.ktindex 9ff4ff0cac..7eb12f0759 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt@@ -112,7 +112,6 @@ import com.vayunmathur.findfamily.data.Waypoint import com.vayunmathur.findfamily.data.toGeoPoint import com.vayunmathur.findfamily.ui.dialogs.encodeBase26 import com.vayunmathur.findfamily.ui.dialogs.GpsFallbackWarningDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.FamilyListActions import com.vayunmathur.findfamily.notifications.FindFamilyNotificationChannels import com.vayunmathur.findfamily.platform.FamilyListUiState
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainMapSlot.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainMapSlot.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainMapSlot.ktindex c966aa65f6..dcff775f2f 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainMapSlot.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainMapSlot.kt@@ -111,7 +111,6 @@ import com.vayunmathur.findfamily.data.Waypoint import com.vayunmathur.findfamily.data.toGeoPoint import com.vayunmathur.findfamily.ui.dialogs.encodeBase26 import com.vayunmathur.findfamily.ui.dialogs.GpsFallbackWarningDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.FamilyListActions import com.vayunmathur.findfamily.notifications.FindFamilyNotificationChannels import com.vayunmathur.findfamily.platform.FamilyListUiState
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.ktindex b2b8193822..ca771801e4 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt@@ -111,7 +111,6 @@ import com.vayunmathur.findfamily.data.Waypoint import com.vayunmathur.findfamily.data.toGeoPoint import com.vayunmathur.findfamily.ui.dialogs.encodeBase26 import com.vayunmathur.findfamily.ui.dialogs.GpsFallbackWarningDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.FamilyListActions import com.vayunmathur.findfamily.notifications.FindFamilyNotificationChannels import com.vayunmathur.findfamily.platform.FamilyListUiState
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.ktindex 3d1a2dee3b..1a73bb9577 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt@@ -111,7 +111,6 @@ import com.vayunmathur.findfamily.data.Waypoint import com.vayunmathur.findfamily.data.toGeoPoint import com.vayunmathur.findfamily.ui.dialogs.encodeBase26 import com.vayunmathur.findfamily.ui.dialogs.GpsFallbackWarningDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.FamilyListActions import com.vayunmathur.findfamily.notifications.FindFamilyNotificationChannels import com.vayunmathur.findfamily.platform.FamilyListUiState
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageEffects.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageEffects.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageEffects.ktindex f9959b9866..5935df6314 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageEffects.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageEffects.kt@@ -111,7 +111,6 @@ import com.vayunmathur.findfamily.data.Waypoint import com.vayunmathur.findfamily.data.toGeoPoint import com.vayunmathur.findfamily.ui.dialogs.encodeBase26 import com.vayunmathur.findfamily.ui.dialogs.GpsFallbackWarningDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.FamilyListActions import com.vayunmathur.findfamily.notifications.FindFamilyNotificationChannels import com.vayunmathur.findfamily.platform.FamilyListUiState
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.ktindex b589ef22b8..13de336d37 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt@@ -111,7 +111,6 @@ import com.vayunmathur.findfamily.data.Waypoint import com.vayunmathur.findfamily.data.toGeoPoint import com.vayunmathur.findfamily.ui.dialogs.encodeBase26 import com.vayunmathur.findfamily.ui.dialogs.GpsFallbackWarningDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.FamilyListActions import com.vayunmathur.findfamily.notifications.FindFamilyNotificationChannels import com.vayunmathur.findfamily.platform.FamilyListUiState
findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.ktindex 982036556d..2a9b3712df 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt@@ -35,8 +35,8 @@ import com.vayunmathur.library.util.NavBackStack * bottom panel (see `MainSheetContent`) while a person is selected, and * back returns the panel to the family list. It is not a dialog. *- * Hosts the person detail sheet plus the selection actions: Find Nearby,- * verify, and entering history mode (the scrubber renders here; the map+ * Hosts the person detail sheet plus the selection actions: Find Nearby+ * and entering history mode (the scrubber renders here; the map * behind the panel keeps showing the historical pin for [userId]). */ @Composable@@ -152,10 +152,6 @@ fun PersonSheet( Modifier.weight(1f), ) { Text(stringResource(R.string.find_nearby_content_description)) } }- OutlinedButton(- { backStack.add(Route.SecurityCodeDialog(userId)) },- Modifier.weight(1f),- ) { Text(stringResource(R.string.verify_security_code_content_description)) } } OutlinedButton( { ffViewModel.mapState.setShowingPresent(false) },
findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddPersonDialog.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddPersonDialog.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddPersonDialog.ktindex 8f7cb5b399..21834ab46f 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddPersonDialog.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddPersonDialog.kt@@ -1,5 +1,4 @@ package com.vayunmathur.findfamily.ui.dialogs-import com.vayunmathur.findfamily.network.myInviteFingerprint import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.PressInteraction import androidx.compose.foundation.layout.Arrangement@@ -45,7 +44,6 @@ fun AddPersonDialog( ffViewModel: FindFamilyViewModel, platform: Platform, id: Long?,- fingerprint: String? = null, ) { val usersByID by ffViewModel.usersById.collectAsState() @@ -64,11 +62,6 @@ fun AddPersonDialog( val context = LocalContext.current val shareInviteChooser = stringResource(R.string.share_invite_link_chooser) var showOutdatedPeer by remember { mutableStateOf(false) }- var showKeyMismatch by remember { mutableStateOf(false) }-- // The fingerprint only vouches for the id that arrived in the link, so it stops applying- // if the field gets edited to a different one.- val inviteFingerprint = fingerprint?.takeIf { id != null && parsedUserId == id } Dialog({backStack.pop()}) { AddPersonContent(@@ -80,8 +73,7 @@ fun AddPersonDialog( onUseridChange = { userid = it.uppercase().filter { c -> c in 'A'..'Z' } }, onCopyMyId = { platform.copy(Networking.userid.encodeBase26()) }, onShareInvite = {- val base = "https://maproj.org/ff/share#id=${Networking.userid.encodeBase26()}"- val link = Networking.myInviteFingerprint()?.let { "$base&k=$it" } ?: base+ val link = "https://maproj.org/ff/share#id=${Networking.userid.encodeBase26()}" ExternalIntents.shareText(context, link, shareInviteChooser) }, onPickContact = { requestPickContact2() },@@ -99,9 +91,7 @@ fun AddPersonDialog( ) ffViewModel.connectUser( userToAdd,- inviteFingerprint = inviteFingerprint, onNeedsUpdate = { showOutdatedPeer = true },- onKeyMismatch = { showKeyMismatch = true }, onDone = { backStack.pop() }, ) },@@ -112,9 +102,6 @@ fun AddPersonDialog( OutdatedPeerDialog(onDismiss = { showOutdatedPeer = false }) } - if (showKeyMismatch) {- KeyMismatchDialog(onDismiss = { showKeyMismatch = false })- } } /**@@ -153,12 +140,10 @@ internal fun AddPersonContent( ) // Share sheet instead of copy/paste: sends an https link that bounces to- // findfamily://add/<myId>?k=<fingerprint>, which prefills the recipient's Add+ // findfamily://add/<myId>, which prefills the recipient's Add // Person dialog. The web hop exists because many messengers won't linkify a bare- // custom scheme. Both values ride in the fragment, which browsers never send, so- // the server sees only that some share page was opened. `k` is a 22-character- // hash of our public bundle, not the bundle itself (~4 kB base64) - the recipient- // fetches the key from the relay and checks it against this.+ // custom scheme. The id rides in the fragment, which browsers never send, so+ // the server sees only that some share page was opened. OutlinedButton( onShareInvite, Modifier.fillMaxWidth()
findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/KeyMismatchDialog.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/KeyMismatchDialog.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/KeyMismatchDialog.ktdeleted file mode 100644index 89c2b6ce6d..0000000000--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/KeyMismatchDialog.kt+++ /dev/null@@ -1,25 +0,0 @@-package com.vayunmathur.findfamily.ui.dialogs--import androidx.compose.runtime.Composable-import androidx.compose.ui.res.stringResource-import com.vayunmathur.library.ui.AlertDialog-import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TextButton-import com.vayunmathur.library.ui.R as UiR-import com.vayunmathur.findfamily.R--/**- * Shown when the key the relay returned for a peer doesn't match the fingerprint their- * invite link carried. Either the link was copied incompletely, or the key isn't the one- * the sender published — so the connection is refused rather than made with a key nothing- * vouches for.- */-@Composable-fun KeyMismatchDialog(onDismiss: () -> Unit) {- AlertDialog(- onDismissRequest = onDismiss,- title = { Text(stringResource(R.string.key_mismatch_title)) },- text = { Text(stringResource(R.string.key_mismatch_body)) },- confirmButton = { TextButton(onClick = onDismiss) { Text(stringResource(UiR.string.done)) } }- )-}
findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/SecurityCodeDialog.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/SecurityCodeDialog.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/SecurityCodeDialog.ktdeleted file mode 100644index 5a9a8f6dca..0000000000--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/SecurityCodeDialog.kt+++ /dev/null@@ -1,64 +0,0 @@-package com.vayunmathur.findfamily.ui.dialogs--import androidx.compose.foundation.layout.Column-import androidx.compose.foundation.layout.Spacer-import androidx.compose.foundation.layout.height-import com.vayunmathur.library.ui.R as UiR-import com.vayunmathur.library.ui.AlertDialog-import com.vayunmathur.library.ui.MaterialTheme-import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TextButton-import androidx.compose.runtime.Composable-import androidx.compose.runtime.LaunchedEffect-import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableStateOf-import androidx.compose.runtime.remember-import androidx.compose.runtime.setValue-import androidx.compose.ui.Modifier-import androidx.compose.ui.text.font.FontFamily-import androidx.compose.ui.unit.dp-import com.vayunmathur.findfamily.data.User-import com.vayunmathur.findfamily.platform.FindFamilyViewModel-import androidx.compose.ui.res.stringResource-import com.vayunmathur.findfamily.R--/**- * Shows the connection's verification **security code**. Both people open this for each other and- * compare the numbers; if they match, the end-to-end-encrypted link is verified and no one (not- * even the server) has substituted a key to intercept it.- */-@Composable-fun SecurityCodeDialog(user: User, ffViewModel: FindFamilyViewModel, onDismiss: () -> Unit) {- var code by remember(user.id) { mutableStateOf<String?>(null) }- var loading by remember(user.id) { mutableStateOf(true) }- LaunchedEffect(user.id) {- code = ffViewModel.securityCodeFor(user)- loading = false- }- SecurityCodeContent(userName = user.name, code = code, loading = loading, onDismiss = onDismiss)-}--/** Stateless security-code dialog content: the route entry supplies the computed code. */-@Composable-internal fun SecurityCodeContent(userName: String, code: String?, loading: Boolean, onDismiss: () -> Unit) {- AlertDialog(- onDismissRequest = onDismiss,- title = { Text(stringResource(R.string.security_code)) },- text = {- Column {- Text(stringResource(R.string.compare_this_code_with_on_their_device_i, userName))- Spacer(Modifier.height(16.dp))- when {- loading -> Text(stringResource(R.string.computing))- code == null -> Text(stringResource(R.string.couldn_t_compute_yet_s_key_isn_t_availab, userName))- else -> Text(- code!!,- style = MaterialTheme.typography.titleLarge,- fontFamily = FontFamily.Monospace- )- }- }- },- confirmButton = { TextButton(onClick = onDismiss) { Text(stringResource(UiR.string.done)) } }- )-}
findfamily/src/main/res/values-ar/strings.xml
diff --git a/findfamily/src/main/res/values-ar/strings.xml b/findfamily/src/main/res/values-ar/strings.xmlindex 1431c13d19..ac01f80de8 100644--- a/findfamily/src/main/res/values-ar/strings.xml+++ b/findfamily/src/main/res/values-ar/strings.xml@@ -163,10 +163,6 @@ <string name="uwb_status_peer_disconnected">فقدت الجهاز الآخر. تحرك أقرب.</string> <string name="uwb_status_unsupported">البحث القريب (UWB) غير مدعوم على هذا الجهاز.</string> <string name="uwb_status_failed">فشل البحث القريب (UWB).</string>- <string name="security_code">رمز الأمان</string>- <string name="compare_this_code_with_on_their_device_i">قارن هذا الرمز مع <xliff:g id="person_name" example="Bob">%1$s</xliff:g> على جهازه. إذا تطابقت الأرقام على كلا الهاتفين، فاتصالك متحقق منه من طرف-إلى-طرف — لا أحد يعترضه.</string>- <string name="computing">جارٍ الحوسبة…</string>- <string name="couldn_t_compute_yet_s_key_isn_t_availab">تعذّر الحساب حتى الآن — مفتاح <xliff:g id="person_name" example="Bob">%1$s</xliff:g> غير متاح. تأكد من كلا اتصالكما، ثم حاول مرة أخرى.</string> <string name="dist">مسافة:</string> <string name="az">سمت:</string> <string name="el">ارتفاع:</string>@@ -174,15 +170,12 @@ <string name="gps_fallback_warning_content_description">موقع الشبكة غير متاح</string> <string name="map_menu_content_description">المزيد من الخيارات</string> <string name="find_nearby_content_description">البحث القريب</string>- <string name="verify_security_code_content_description">التحقق من رمز الأمان</string> <string name="delete_person_content_description">إزالة الشخص</string> <string name="delete_place_content_description">حذف المكان المحفوظ</string> <string name="gps_fallback_warning_title">استخدام GPS فقط</string> <string name="gps_fallback_warning_body">لم يتم تشغيل موقع الشبكة لهذا الجهاز، لذلك يستخدم FindFamily الـ GPS فقط لمواصلة تتبع موقعك. GPS دقته أكبر لكنه قد يتسبب في استنزاف كبير للبطارية. لتقليل استهلاك البطارية، شغّل موقع الشبكة (Wi-Fi وشبكة الهاتف المحمول) في إعدادات جهازك.</string> <string name="outdated_peer_title">التحديث مطلوب</string> <string name="outdated_peer_body">يستخدم هذا الشخص إصدارًا أقدم من FindFamily لا يدعم التشفير الآمن كميًا. اطلب منه تحديث تطبيقه، ثم حاول الاتصال مرة أخرى.</string>- <string name="key_mismatch_title">تعذّر التحقق من هذا الشخص</string>- <string name="key_mismatch_body">لا يتطابق مفتاح التشفير الخاص بهذا الشخص مع المفتاح المدرج في رابط الدعوة الخاص به، لذلك لم تتم إضافته. تحقق من أنك فتحت الرابط بأكمله، واطلب منه إرسال رابط جديد.</string> <string name="tile_label">FindFamily يتتبع</string> <string name="tile_subtitle_on">مفعّل</string> <string name="tile_subtitle_off">معطّل</string>
findfamily/src/main/res/values-cs/strings.xml
diff --git a/findfamily/src/main/res/values-cs/strings.xml b/findfamily/src/main/res/values-cs/strings.xmlindex 68b0225cb5..e98fb0aa1e 100644--- a/findfamily/src/main/res/values-cs/strings.xml+++ b/findfamily/src/main/res/values-cs/strings.xml@@ -129,10 +129,6 @@ <string name="disable_after">Vypnout po</string> <string name="enable_after">Zapnout po</string> <string name="auto_toggle_never">Nikdy</string>- <string name="security_code">Kód zabezpečení</string>- <string name="compare_this_code_with_on_their_device_i">Porovnejte tento kód s <xliff:g id="person_name" example="Janem">%1$s</xliff:g> na jeho/jejím zařízení. Pokud jsou kódy stejné, připojení je E2E šifrováno - nikdo vás nesleduje.</string>- <string name="computing">Počítání…</string>- <string name="couldn_t_compute_yet_s_key_isn_t_availab">Nepodařilo se spočítat - <xliff:g id="person_name" example="Janův">%1$s</xliff:g> klíč není dostupný. Ujistěte se, že jste oba připojeni, poté zkuste znovu.</string> <string name="dist">vzdá:</string> <string name="az">azm:</string> <string name="el">el:</string>
findfamily/src/main/res/values-et/strings.xml
diff --git a/findfamily/src/main/res/values-et/strings.xml b/findfamily/src/main/res/values-et/strings.xmlindex 1c5d98c0d1..ba0f2f082f 100644--- a/findfamily/src/main/res/values-et/strings.xml+++ b/findfamily/src/main/res/values-et/strings.xml@@ -113,8 +113,6 @@ <string name="history_step_plus_1m">+1 min</string> <string name="history_step_plus_5m">+5 min</string> <string name="auto_toggle_never">Mitte kunagi</string>- <string name="security_code">Turvakood</string>- <string name="computing">Arvutan…</string> <string name="disable_after">Lülita antud aja möödumisel välja</string> <string name="enable_after">Lülita antud aja möödumisel sisse</string> <string name="link_pqc_unavailable">Seadmes lingi loomine ei õnnestunud.</string>@@ -122,8 +120,6 @@ <string name="az">as:</string> <string name="el">krg:</string> <string name="point_the_back_of_your_phone_toward_your">Pööra oma telefoni tagaosa kontakti suunas</string>- <string name="couldn_t_compute_yet_s_key_isn_t_availab">Arvutamine veel ei õnnestunud: kasutaja „<xliff:g id="person_name" example="Bob">%1$s</xliff:g>“ võti pole saadaval. Palun kontrolli, et teil mõlemal ühendus toimib ja proovi siis uuesti.</string>- <string name="compare_this_code_with_on_their_device_i">Võrdle sead koodi kasutajaga „<xliff:g id="person_name" example="Mati">%1$s</xliff:g>“ tema seadmes kuvatavaga. Kui numbrid on mõlemas seadmes samad, siis on ühendus läbivalt krüptitud ja verifitseeritud ning mitte keegi ei saa seda vahepealt jälgida.</string> <string name="share_invite_link">Jaga kutselinki</string> <string name="share_invite_link_chooser">Jaga Pere asukoha (FindFamily) rakenduse kutset</string> <string name="gps_fallback_warning_content_description">Võrgupõhine tuvastus pole saadaval</string>@@ -143,8 +139,6 @@ <string name="add_tracker_scanning">Otsin nutimärgiseid…</string> <string name="add_tracker_binding">Seon nutimärgist…</string> <string name="add_tracker_failed">Nutimärgise sidumine ei õnnestunud. Proovi uuesti.</string>- <string name="key_mismatch_title">Antud isiku verifitseerimine ei õnnestunud</string>- <string name="key_mismatch_body">Selle isiku krüptovõti ei vasta tema kutselingis märgitud võtmele, seetõttu teda ei lisatud. Kontrolli, kas avasid lingi tervikuna või palu tal saata uus link.</string> <string name="notification_channel_arrival_name"><xliff:g id="person_name" example="Kadri">%1$s</xliff:g> · Saabumised</string> <string name="notification_channel_arrival_desc">Teavita, kui <xliff:g id="person_name" example="Kadri">%1$s</xliff:g> saabub asukohta</string> <string name="notification_channel_departure_name"><xliff:g id="person_name" example="Kadri">%1$s</xliff:g> · Lahkumised</string>@@ -156,7 +150,6 @@ <string name="user_card_network_sighting">Mööduv telefon nägi seda <xliff:g id="last_seen" example="2 tundi tagasi">%1$s</xliff:g>\nKusagil hinnangulises asukohas <xliff:g id="location_name" example="Kodu">%2$s</xliff:g></string> <string name="map_menu_content_description">Lisavalikud</string> <string name="find_nearby_content_description">Otsi lähedusest</string>- <string name="verify_security_code_content_description">Kontrolli turvakoodi</string> <string name="delete_person_content_description">Eemalda isik</string> <string name="delete_place_content_description">Kustuta lisatud asukoht</string> <string name="notification_channel_noshow_name"><xliff:g id="person_name" example="Kadri">%1$s</xliff:g> · Teateid ei kuvata</string>
findfamily/src/main/res/values-fr/strings.xml
diff --git a/findfamily/src/main/res/values-fr/strings.xml b/findfamily/src/main/res/values-fr/strings.xmlindex 74e96e4e1c..20720118ad 100644--- a/findfamily/src/main/res/values-fr/strings.xml+++ b/findfamily/src/main/res/values-fr/strings.xml@@ -119,5 +119,4 @@ <string name="uwb_status_failed">Échec de la recherche « À proximité » (UWB).</string> <string name="request_from">Demande de %1$s</string> <string name="status_already_requested">Demande de partage déjà envoyée à cette personne</string>- <string name="computing">Calcul en cours…</string> </resources>
findfamily/src/main/res/values-it/strings.xml
diff --git a/findfamily/src/main/res/values-it/strings.xml b/findfamily/src/main/res/values-it/strings.xmlindex 2de87891c9..a25f9b8c16 100644--- a/findfamily/src/main/res/values-it/strings.xml+++ b/findfamily/src/main/res/values-it/strings.xml@@ -138,5 +138,4 @@ <string name="link_pqc_unavailable">Impossibile creare il link su questo dispositivo.</string> <string name="share_invite_link">Condividi link di invito</string> <string name="share_invite_link_chooser">Condividi invito FindFamily</string>- <string name="security_code">Codice di sicurezza</string> </resources>
findfamily/src/main/res/values-ru/strings.xml
diff --git a/findfamily/src/main/res/values-ru/strings.xml b/findfamily/src/main/res/values-ru/strings.xmlindex acb670fbbd..fc801d7bdd 100644--- a/findfamily/src/main/res/values-ru/strings.xml+++ b/findfamily/src/main/res/values-ru/strings.xml@@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">- <string name="computing">Вычисление…</string> <string name="notification_channel_battery_desc">Оповещает когда у члена семьи разряжена батарея</string> <string name="notification_channel_entry_exit_name">Прибытие и отправление</string> <string name="notification_channel_entry_exit_desc">Уведомления о том, когда члены семьи входят или покидают путевые точки</string>@@ -129,9 +128,6 @@ <string name="uwb_status_peer_disconnected">Потерял другое устройство. Подойдите ближе.</string> <string name="uwb_status_unsupported">Функция «Найти рядом» (UWB) не поддерживается на этом устройстве.</string> <string name="uwb_status_failed">«Найти рядом» (UWB) не удалось.</string>- <string name="security_code">Код безопасности</string>- <string name="compare_this_code_with_on_their_device_i">Сравните этот код с кодом <xliff:g id="person_name" example="Bob">%1$s</xliff:g> на его устройстве. Если они совпадают на обоих телефонах, ваше соединение проверено сквозным шифрование и его никто не перехватывает.</string>- <string name="couldn_t_compute_yet_s_key_isn_t_availab">Не удалось вычислить — ключ <xliff:g id="person_name" example="Bob">%1$s</xliff:g> недоступен. Убедитесь, что вы оба подключены, затем повторите попытку.</string> <string name="dist">расст:</string> <string name="az">азимут:</string> <string name="el">высота:</string>
findfamily/src/main/res/values-sv/strings.xml
diff --git a/findfamily/src/main/res/values-sv/strings.xml b/findfamily/src/main/res/values-sv/strings.xmlindex 974e52cea8..927b0a0825 100644--- a/findfamily/src/main/res/values-sv/strings.xml+++ b/findfamily/src/main/res/values-sv/strings.xml@@ -132,10 +132,6 @@ <string name="uwb_status_peer_disconnected">Den andra enheten försvann. Gå närmare.</string> <string name="uwb_status_unsupported">Hitta i närheten (UWB) stöds inte på den här enheten.</string> <string name="uwb_status_failed">Hitta i närheten (UWB) misslyckades.</string>- <string name="security_code">Säkerhetskod</string>- <string name="compare_this_code_with_on_their_device_i">Jämför den här koden med <xliff:g id="person_name" example="Bob">%1$s</xliff:g> på personens enhet. Om siffrorna matchar på båda telefonerna är anslutningen verifierad från ände till ände. Ingen avlyssnar den.</string>- <string name="computing">Beräknar…</string>- <string name="couldn_t_compute_yet_s_key_isn_t_availab">Kan inte beräkna ännu: nyckeln för <xliff:g id="person_name" example="Bob">%1$s</xliff:g> är inte tillgänglig. Kontrollera att ni båda är anslutna och försök sedan igen.</string> <string name="dist">avst:</string> <string name="az">az:</string> <string name="el">el:</string>@@ -145,8 +141,6 @@ <string name="gps_fallback_warning_body">Nätverksplats är inte aktiverad på enheten, så Find Family använder endast GPS för att fortsätta spåra din plats. GPS är mer exakt men kan dra mycket batteri. Aktivera nätverksplats (Wi-Fi och mobilnät) i enhetens inställningar för att minska batterianvändningen.</string> <string name="outdated_peer_title">Uppdatering krävs</string> <string name="outdated_peer_body">Den här personen använder en äldre version av Find Family som inte stöder kvantsäker kryptering. Be personen uppdatera appen och försök sedan ansluta igen.</string>- <string name="key_mismatch_title">Kunde inte verifiera den här personen</string>- <string name="key_mismatch_body">Krypteringsnyckeln för den här personen stämmer inte med den som personens inbjudningslänk angav, så personen lades inte till. Kontrollera att du öppnade hela länken och be personen skicka en ny.</string> <string name="tile_label">Find Family-spårning</string> <string name="tile_subtitle_on">På</string> <string name="tile_subtitle_off">Av</string>@@ -156,7 +150,6 @@ <string name="user_card_network_sighting">Sedd av en passerande telefon <xliff:g id="last_seen" example="2 hours ago">%1$s</xliff:g>\nNågonstans nära <xliff:g id="location_name" example="Home">%2$s</xliff:g> (ungefärligt)</string> <string name="map_menu_content_description">Fler alternativ</string> <string name="find_nearby_content_description">Hitta i närheten</string>- <string name="verify_security_code_content_description">Verifiera säkerhetskod</string> <string name="delete_person_content_description">Ta bort person</string> <string name="delete_place_content_description">Ta bort sparad plats</string> <string name="notification_channel_noshow_name"><xliff:g id="person_name" example="Alice">%1$s</xliff:g> · Varningar vid utebliven ankomst</string>
findfamily/src/main/res/values-zh-rCN/strings.xml
diff --git a/findfamily/src/main/res/values-zh-rCN/strings.xml b/findfamily/src/main/res/values-zh-rCN/strings.xmlindex 6a4fe8868a..cbf6a33138 100644--- a/findfamily/src/main/res/values-zh-rCN/strings.xml+++ b/findfamily/src/main/res/values-zh-rCN/strings.xml@@ -106,13 +106,9 @@ <string name="history_step_plus_1m">+1分钟</string> <string name="history_step_plus_5m">+5分钟</string> <string name="point_the_back_of_your_phone_toward_your">请将手机背面朝向您的联系人</string>- <string name="compare_this_code_with_on_their_device_i">请将此验证码与 <xliff:g id="person_name" example="Bob">%1$s</xliff:g> 设备上的验证码进行比对。如果两部手机上的数字一致,则表示您的连接已通过端到端验证 — 没有人截获您的连接。</string> <string name="dist">距离:</string>- <string name="couldn_t_compute_yet_s_key_isn_t_availab">尚无法计算 — <xliff:g id="person_name" example="Bob">%1$s</xliff:g> 的密钥不可用。请确保双方都已连接,然后重试。</string>- <string name="security_code">安全码</string> <string name="el">海拔:</string> <string name="az">方位角:</string>- <string name="computing">正在计算…</string> <string name="disable_after">在此之后禁用</string> <string name="enable_after">在此之后启用</string> <string name="auto_toggle_never">从不</string>
findfamily/src/main/res/values/strings.xml
diff --git a/findfamily/src/main/res/values/strings.xml b/findfamily/src/main/res/values/strings.xmlindex a70dec80f1..8a369d36b6 100644--- a/findfamily/src/main/res/values/strings.xml+++ b/findfamily/src/main/res/values/strings.xml@@ -310,14 +310,6 @@ <!-- UwbRangingScreen: Button that requests RANGING (if needed) and starts ranging. Verb phrase --> <string name="uwb_start_action">Start Find Nearby</string> - <!-- SecurityCodeDialog: Title. Noun phrase -->- <string name="security_code">Security code</string>- <!-- SecurityCodeDialog: Instruction comparing safety number. %1$s = contact name, e.g. Bob. Sentence with E2E explanation -->- <string name="compare_this_code_with_on_their_device_i">Compare this code with <xliff:g id="person_name" example="Bob">%1$s</xliff:g> on their device. If the numbers match on both phones, your connection is verified end-to-end — no one is intercepting it.</string>- <!-- SecurityCodeDialog: Loading placeholder while computing safety number. Verb, progressive -->- <string name="computing">Computing…</string>- <!-- SecurityCodeDialog: Error when other party key not available. %1$s = person name. Sentence -->- <string name="couldn_t_compute_yet_s_key_isn_t_availab">Couldn\'t compute yet — <xliff:g id="person_name" example="Bob">%1$s</xliff:g>\'s key isn\'t available. Make sure you\'re both connected, then try again.</string> <!-- UwbRangingScreen: Debug overlay prefix for distance value. Abbreviation noun, keep short, includes trailing space --> <string name="dist">dist: </string>@@ -338,8 +330,6 @@ <string name="backup_menu_restore">Restore</string> <!-- MainPage: Content description for the map overlay button that starts Find Nearby (UWB) for the selected person. Verb phrase --> <string name="find_nearby_content_description">Find nearby</string>- <!-- MainPage: Content description for the map overlay button that shows the end-to-end encryption security code for the selected person. Verb phrase -->- <string name="verify_security_code_content_description">Verify security code</string> <!-- MainPage: Content description for the map overlay button that removes the selected person. Verb phrase --> <string name="delete_person_content_description">Remove person</string> <!-- MainPage: Content description for the map overlay button that deletes the selected saved place. Verb phrase -->@@ -354,10 +344,6 @@ <!-- OutdatedPeerDialog: Body telling the user the other person must update their app before sharing can work. Sentence --> <string name="outdated_peer_body">This person is using an older version of FindFamily that doesn\'t support quantum-safe encryption. Ask them to update their app, then try connecting again.</string> - <!-- KeyMismatchDialog: Title shown when a peer's encryption key doesn't match the one their invite link vouched for. Noun phrase -->- <string name="key_mismatch_title">Couldn\'t verify this person</string>- <!-- KeyMismatchDialog: Body explaining the key check failed and the connection was refused. Sentence -->- <string name="key_mismatch_body">The encryption key for this person doesn\'t match the one their invite link listed, so they weren\'t added. Check that you opened the whole link, and ask them to send a new one.</string> <!-- TrackingTileService: Quick Settings tile label. Short noun phrase --> <string name="tile_label">FindFamily tracking</string>
findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt
diff --git a/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt b/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.ktindex 746681e770..d7148536de 100644--- a/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt+++ b/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt@@ -40,7 +40,6 @@ import com.vayunmathur.findfamily.ui.dialogs.AddLinkContent import com.vayunmathur.findfamily.ui.dialogs.AddPersonContent import com.vayunmathur.findfamily.ui.dialogs.AddTrackerContent import com.vayunmathur.findfamily.ui.dialogs.NoShowAlertContent-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeContent import com.vayunmathur.library.ui.ConfirmDialog import com.vayunmathur.library.ui.dialog.DatePickerDialog import com.vayunmathur.library.util.LocalNavResultRegistry@@ -400,15 +399,6 @@ class MetadataPreviews { } } - @PreviewTest- @Preview(name = "12-security-code-dialog", device = PHONE, group = "phone", showSystemUi = true)- @Composable- fun Preview12SecurityCodeDialog() {- DynamicTheme(darkTheme = true) {- SecurityCodeContent(userName = "Maya Chen", code = "123 456 789", loading = false, onDismiss = {})- }- }- @PreviewTest @Preview(name = "13-no-show-alert-dialog", device = PHONE, group = "phone", showSystemUi = true) @Composable
findfamily/src/test/java/com/vayunmathur/findfamily/Y3FinalReportTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/Y3FinalReportTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/Y3FinalReportTest.ktindex 800c41deaa..c2d65640ac 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/Y3FinalReportTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/Y3FinalReportTest.kt@@ -110,17 +110,12 @@ class Y3FinalReportTest { val repo = TestFindFamilyRepository.install(ctx) if (Networking.userid == 0L) Networking.init(repo, DataStoreUtils.getInstance(ctx), "Me") assertTrue(Networking.userid != 0L)- val code = Networking.securityCodePqc(- com.vayunmathur.findfamily.data.User("Peer", null, "Place", false, com.vayunmathur.findfamily.data.RequestStatus.MUTUAL_CONNECTION, FIXED_NOW, null, 4242L),- )- // No cached PQC bundle for this peer: no code, no crash.- assertTrue(code == null || code.isNotBlank()) assertFalse(Networking.verifyFrom(4242L, byteArrayOf(1, 2, 3), byteArrayOf(4, 5, 6))) val status = Networking.peerCryptoStatus(4242L) assertNotNullStatus(status) } - private fun assertNotNullStatus(status: Networking.PeerKeyCheck) {+ private fun assertNotNullStatus(status: Networking.PeerCrypto) { assertTrue(status.toString().isNotEmpty()) }
findfamily/src/test/java/com/vayunmathur/findfamily/domain/PlatformBackupTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/domain/PlatformBackupTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/domain/PlatformBackupTest.ktindex d24e93df45..b8ead79a6d 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/domain/PlatformBackupTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/domain/PlatformBackupTest.kt@@ -36,7 +36,7 @@ class PlatformBackupTest { assertTrue("`$column` = NULL" in update, "expected $column nulled in: $update") } // Restored people are remembered contacts, not live pairings: no- // location flows until the fingerprint-checked Add Person re-pair.+ // location flows until the Add Person re-pair. assertTrue("`requestStatus` = 'AWAITING_REQUEST'" in update, update) }
findfamily/src/test/java/com/vayunmathur/findfamily/ui/DialogsWithVmTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/DialogsWithVmTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/DialogsWithVmTest.ktindex c252ee693a..a18c456288 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/DialogsWithVmTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/DialogsWithVmTest.kt@@ -21,9 +21,7 @@ import com.vayunmathur.findfamily.ui.dialogs.AddPersonDialog import com.vayunmathur.findfamily.ui.dialogs.AddTrackerDialog import com.vayunmathur.findfamily.ui.dialogs.DropdownField import com.vayunmathur.findfamily.ui.dialogs.GpsFallbackWarningDialog-import com.vayunmathur.findfamily.ui.dialogs.KeyMismatchDialog import com.vayunmathur.findfamily.ui.dialogs.OutdatedPeerDialog-import com.vayunmathur.findfamily.ui.dialogs.SecurityCodeDialog import com.vayunmathur.findfamily.platform.FindFamilyViewModel import com.vayunmathur.findfamily.platform.Platform import com.vayunmathur.findfamily.platform.UwbSessionManager@@ -101,7 +99,7 @@ class DialogsWithVmTest { @Test fun addPersonDialogWithInviteId() {- rule.setContent { AddPersonDialog(backStack = stack(), ffViewModel = vm, platform = Platform(ctx), id = 123L, fingerprint = "abc") }+ rule.setContent { AddPersonDialog(backStack = stack(), ffViewModel = vm, platform = Platform(ctx), id = 123L) } rule.onNodeWithText("Add Person", substring = true).assertExists() } @@ -117,25 +115,13 @@ class DialogsWithVmTest { rule.waitForIdle() } - @Test- fun securityCodeDialogRenders() {- rule.setContent { SecurityCodeDialog(user = user(), ffViewModel = vm, onDismiss = {}) }- rule.waitForIdle()- }-- @Test+ @Test fun gpsWarningDialogRenders() { rule.setContent { GpsFallbackWarningDialog(onDismiss = {}) } rule.onAllNodesWithText("GPS", substring = true)[0].assertIsDisplayed() } - @Test- fun keyMismatchDialogRenders() {- rule.setContent { KeyMismatchDialog(onDismiss = {}) }- rule.waitForIdle()- }-- @Test+ @Test fun outdatedPeerDialogRenders() { rule.setContent { OutdatedPeerDialog(onDismiss = {}) } rule.waitForIdle()
findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.ktindex 21f771c909..8f35ef4f5c 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt@@ -137,7 +137,7 @@ class MainPageNavigationRealRepoTest { @Test fun addInviteDeepLinkOpensAddPersonDialog() = runBlocking { seedFamily()- composeNavigation(deepLinkAddInvite = AddInvite(123L, "fingerprint"))+ composeNavigation(deepLinkAddInvite = AddInvite(123L)) assertTrue(rule.onAllNodesWithText("Add Person", substring = true).fetchSemanticsNodes().isNotEmpty()) }
findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/Base26AndSmallDialogsTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/Base26AndSmallDialogsTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/Base26AndSmallDialogsTest.ktindex 27043f1d31..3fb19555b7 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/Base26AndSmallDialogsTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/Base26AndSmallDialogsTest.kt@@ -54,17 +54,7 @@ class Base26AndSmallDialogsTest { assertEquals(1, dismissed) } - @Test fun keyMismatchDialogDismisses() {- var dismissed = 0- composeRule.setContent {- DynamicTheme { KeyMismatchDialog(onDismiss = { dismissed++ }) }- }- composeRule.onNodeWithText("Couldn't verify this person").assertIsDisplayed()- composeRule.onNodeWithText("Done").performClick()- assertEquals(1, dismissed)- }-- @Test fun outdatedPeerDialogDismisses() {+ @Test fun outdatedPeerDialogDismisses() { var dismissed = 0 composeRule.setContent { DynamicTheme { OutdatedPeerDialog(onDismiss = { dismissed++ }) }
findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.ktindex 973c22de2c..73dfc0ab2e 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt@@ -197,28 +197,4 @@ class DialogsRealRepoInteractionsTest { assertEquals(Route.MainPage, stack.last()) } - @Test fun securityCodeDialogShowsCodeForBundledPeer() = runBlocking {- // Networking is initialised by the VM; a peer whose bundle is our own- // identity's bundle gets a real, computable security code.- com.vayunmathur.findfamily.network.Networking.init(- repo, com.vayunmathur.library.util.DataStoreUtils.getInstance(app), "Me",- )- val bundle = kotlin.io.encoding.Base64.encode(- com.vayunmathur.findfamily.network.Networking.pqcIdentity.publicBundle- )- val peer = user(201L, "Secure Peer").copy(pqcEncryptionKey = bundle)- repo.upsertUser(peer)- var dismissed = false- rule.setContent { DynamicTheme { SecurityCodeDialog(peer, vm) { dismissed = true } } }- rule.waitForIdle()- Thread.sleep(300)- rule.waitForIdle()- // Either a code or the unavailable message renders (identity state),- // never a stuck "computing" state.- val nodes = rule.onAllNodesWithText("Secure Peer", substring = true).fetchSemanticsNodes()- assertTrue(nodes.isNotEmpty())- rule.onNodeWithText("Done", substring = true).performClick()- assertTrue(dismissed)- assertEquals("Secure Peer", peer.name) }-}
findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/W5DialogsTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/W5DialogsTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/W5DialogsTest.ktindex 25fd13cd54..a957dd4bdf 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/W5DialogsTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/W5DialogsTest.kt@@ -47,15 +47,7 @@ class W5DialogsTest { assertTrue(dismissed) } - @Test- fun keyMismatchDialogDismisses() {- var dismissed = false- rule.setContent { KeyMismatchDialog(onDismiss = { dismissed = true }) }- rule.onNodeWithText("Done", substring = true).assertIsDisplayed().performClick()- assertTrue(dismissed)- }-- @Test+ @Test fun outdatedPeerDialogDismisses() { var dismissed = false rule.setContent { OutdatedPeerDialog(onDismiss = { dismissed = true }) }
findfamily/src/test/java/com/vayunmathur/findfamily/util/CrowdFindingRealRepoTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/CrowdFindingRealRepoTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/CrowdFindingRealRepoTest.ktindex 4422507aa1..5fd3e0d4d5 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/CrowdFindingRealRepoTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/CrowdFindingRealRepoTest.kt@@ -3,7 +3,6 @@ package com.vayunmathur.findfamily.util // FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport
findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelRealRepoTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelRealRepoTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelRealRepoTest.ktindex 23e05ff315..c7e992edea 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelRealRepoTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelRealRepoTest.kt@@ -206,12 +206,7 @@ class FindFamilyViewModelRealRepoTest { } } - @Test fun securityCodeWithoutPeerBundleIsNull() = runBlocking {- val id = repo.upsertUser(user(name = "Alice"))- assertNull(vm.securityCodeFor(repo.getUser(id)!!))- }-- @Test fun permissionRefreshAndFeatureFlagsRun() {+ @Test fun permissionRefreshAndFeatureFlagsRun() { vm.refreshPermissions() // Robolectric grants nothing by default. assertFalse(vm.hasForeground.value)
findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelStatesRealTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelStatesRealTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelStatesRealTest.ktindex 77746a4de4..41e034ae62 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelStatesRealTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/FindFamilyViewModelStatesRealTest.kt@@ -3,7 +3,6 @@ package com.vayunmathur.findfamily.util // FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport@@ -41,7 +40,7 @@ import kotlin.test.assertNull import kotlin.test.assertTrue import kotlin.time.Clock -/** ViewModel derived states, the verified-bundle connect path, and waypoint deletion cascades. */+/** ViewModel derived states, the connect path, and waypoint deletion cascades. */ @RunWith(AndroidJUnit4::class) class FindFamilyViewModelStatesRealTest { @@ -80,7 +79,7 @@ class FindFamilyViewModelStatesRealTest { Unit } - @Test fun connectUserWithVerifiedBundleStoresCheckedKey() = runBlocking {+ @Test fun connectUserStoresExistingKeyAndMintsPairIdOnce() = runBlocking { val repo = TestFindFamilyRepository.install(ctx) val vm = FindFamilyViewModel(app, repo) Networking.repository = repo@@ -92,8 +91,8 @@ class FindFamilyViewModelStatesRealTest { )) val peer = repo.getUser(peerId)!! var done = false- vm.connectUser(peer, inviteFingerprint = null, onNeedsUpdate = {}, onDone = { done = true })- // The verified bundle is stored and the pair id minted once.+ vm.connectUser(peer, onNeedsUpdate = {}, onDone = { done = true })+ // The existing bundle is kept and the pair id minted once. assertTrue(awaitFamilyCondition { val stored = repo.getUser(peerId) stored?.pqcEncryptionKey == identity.publicBundleB64 && stored.outboundPairId != null@@ -102,7 +101,7 @@ class FindFamilyViewModelStatesRealTest { // DataStore; the persisted pair id above is the observable outcome. val firstPairId = repo.getUser(peerId)!!.outboundPairId // Reconnecting must not rotate the pinned pair id.- vm.connectUser(repo.getUser(peerId)!!, inviteFingerprint = null, onNeedsUpdate = {}, onDone = {})+ vm.connectUser(repo.getUser(peerId)!!, onNeedsUpdate = {}, onDone = {}) assertTrue(awaitFamilyCondition { repo.getUser(peerId)?.outboundPairId == firstPairId })
findfamily/src/test/java/com/vayunmathur/findfamily/util/InboundEnrichRealRepoTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/InboundEnrichRealRepoTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/InboundEnrichRealRepoTest.ktindex 29b4d23a85..d5ddce8389 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/InboundEnrichRealRepoTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/InboundEnrichRealRepoTest.kt@@ -3,7 +3,6 @@ package com.vayunmathur.findfamily.util // FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport
findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingCodecTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingCodecTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingCodecTest.ktindex 62bb13d1b3..73a12df650 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingCodecTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingCodecTest.kt@@ -1,7 +1,6 @@ package com.vayunmathur.findfamily.util import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport@@ -43,12 +42,10 @@ class NetworkingCodecTest { assertEquals(listOf(1, 2, 3, 4, 5, 6, 7, 8), b.map { it.toInt() }) } @Test fun noSocketOrPqcFailsClosed() = runTest {- assertNull(Networking.myInviteFingerprint()) assertNull(Networking.signAsMe(byteArrayOf(1))) val user = User(name = "A", photo = null, locationName = "x", sendingEnabled = true, requestStatus = RequestStatus.MUTUAL_CONNECTION, id = 7L)- assertNull(Networking.securityCodePqc(user))- assertEquals(Networking.PeerCrypto.UNKNOWN, Networking.peerCryptoStatus(7L).status)+ assertEquals(Networking.PeerCrypto.UNKNOWN, Networking.peerCryptoStatus(7L)) val fix = LocationValue(userid = 7L, coord = Coord(1.0, 2.0), speed = 0f, acc = 1f, timestamp = Instant.fromEpochMilliseconds(1000), battery = 50f) assertFalse(Networking.publishLocation(fix, user))
findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingDirectBootTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingDirectBootTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingDirectBootTest.ktindex 1a09473be7..fb06a75275 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingDirectBootTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingDirectBootTest.kt@@ -94,8 +94,6 @@ class NetworkingDirectBootTest { // Documented contract: publish returns false when the peer has no usable // bundle; a corrupt stored value is exactly that, not an exception. assertFalse(Networking.publishLocation(fix(), bad))- assertNull(Networking.securityCode(bad))- assertNull(Networking.securityCodePqc(bad)) val envelope = com.vayunmathur.findfamily.domain.UwbEnvelope( sessionId = "s", sender = 1uL, senderPlatform = "android", kind = "request" )
findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingFramesRealRepoTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingFramesRealRepoTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingFramesRealRepoTest.ktindex 7ca1c6f4e9..feb543d26b 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingFramesRealRepoTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingFramesRealRepoTest.kt@@ -3,7 +3,6 @@ package com.vayunmathur.findfamily.util // FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport@@ -191,7 +190,7 @@ class NetworkingFramesRealRepoTest { sessionId = "s", sender = 1uL, senderPlatform = "android", kind = "request", ), 42L, user(), ))- assertEquals(Networking.PeerCrypto.UNKNOWN, Networking.peerCryptoStatus(42L).status)+ assertEquals(Networking.PeerCrypto.UNKNOWN, Networking.peerCryptoStatus(42L)) assertFalse(Networking.verifyFrom(424242L, byteArrayOf(1), byteArrayOf(2))) }
findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingHelperOfflineTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingHelperOfflineTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingHelperOfflineTest.ktindex bb926d9471..2d1b267a08 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingHelperOfflineTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingHelperOfflineTest.kt@@ -1,7 +1,6 @@ package com.vayunmathur.findfamily.util import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport
findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingLiveSessionTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingLiveSessionTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingLiveSessionTest.ktindex bddb8e9dc2..c8767ff5b5 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingLiveSessionTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingLiveSessionTest.kt@@ -3,7 +3,6 @@ package com.vayunmathur.findfamily.util // FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport@@ -184,13 +183,9 @@ class NetworkingLiveSessionTest { assertEquals(listOf(envelope), delivered) } - @Test fun securityCodeAndSignaturesVerify() = runBlocking {+ @Test fun signaturesVerify() = runBlocking { val peer = selfUser(779L) repo.upsertUser(peer)- val code = Networking.securityCode(peer)- assertNotNull(code)- assertEquals(code, Networking.securityCodePqc(peer))- assertNull(Networking.securityCode(selfUser(780L).copy(pqcEncryptionKey = null))) val data = "grant".encodeToByteArray() val signature = Networking.signAsMe(data) assertNotNull(signature)@@ -204,52 +199,27 @@ class NetworkingLiveSessionTest { val classic = async { Networking.peerCryptoStatus(555L) } delay(150) dispatchKeyResp(status = 1, target = 555L, bundle = null)- assertEquals(Networking.PeerCrypto.NEEDS_UPDATE, classic.await().status)+ assertEquals(Networking.PeerCrypto.NEEDS_UPDATE, classic.await()) val pqc = async { Networking.peerCryptoStatus(556L) } delay(150) dispatchKeyResp(status = 2, target = 556L, bundle = Networking.pqcIdentity.publicBundle)- val pqcResult = pqc.await()- assertEquals(Networking.PeerCrypto.PQC, pqcResult.status)- assertNull(pqcResult.verifiedBundleB64)+ assertEquals(Networking.PeerCrypto.PQC, pqc.await()) // The looked-up bundle is cached on the user row when one exists. val cached = async { Networking.peerCryptoStatus(557L) } delay(150) val peerRow = repo.upsertUser(selfUser(557L).copy(pqcEncryptionKey = null, outboundPairId = null)) assertTrue(peerRow > 0) dispatchKeyResp(status = 2, target = 557L, bundle = Networking.pqcIdentity.publicBundle)- assertEquals(Networking.PeerCrypto.PQC, cached.await().status)+ assertEquals(Networking.PeerCrypto.PQC, cached.await()) val unknown = async { Networking.peerCryptoStatus(558L) } delay(150) dispatchKeyResp(status = 0, target = 558L, bundle = null)- assertEquals(Networking.PeerCrypto.UNKNOWN, unknown.await().status)+ assertEquals(Networking.PeerCrypto.UNKNOWN, unknown.await()) } - @Test fun peerCryptoStatusRejectsFingerprintMismatch() = runBlocking {- val fingerprint = Networking.myInviteFingerprint()- assertNotNull(fingerprint)- // Our own bundle with our own fingerprint verifies and pins the bundle.- val ok = async { Networking.peerCryptoStatus(Networking.userid, fingerprint) }- delay(150)- dispatchKeyResp(status = 2, target = Networking.userid, bundle = Networking.pqcIdentity.publicBundle)- val okResult = ok.await()- assertEquals(Networking.PeerCrypto.PQC, okResult.status)- assertEquals(Base64.encode(Networking.pqcIdentity.publicBundle), okResult.verifiedBundleB64)- // A different bundle does not hash to that fingerprint.- val other = Networking.generatePqcIdentityKeyPair()- val mismatch = async { Networking.peerCryptoStatus(600L, fingerprint) }- delay(150)- dispatchKeyResp(status = 2, target = 600L, bundle = Base64.decode(other.publicBundleB64))- assertEquals(Networking.PeerCrypto.KEY_MISMATCH, mismatch.await().status)- // A malformed fingerprint never verifies.- val malformed = async { Networking.peerCryptoStatus(601L, "!!!not-base64!!!") }- delay(150)- dispatchKeyResp(status = 2, target = 601L, bundle = Networking.pqcIdentity.publicBundle)- assertEquals(Networking.PeerCrypto.KEY_MISMATCH, malformed.await().status)- }-- private suspend fun dispatchKeyResp(status: Int, target: Long, bundle: ByteArray?) {+ private suspend fun dispatchKeyResp(status: Int, target: Long, bundle: ByteArray?) { val frame = ByteArray(Networking.KEYRESP_HEADER_LEN + (bundle?.size ?: 0)) frame[0] = Networking.WS_OP_GETKEY_RESP frame[Networking.KEYRESP_STATUS_OFFSET] = status.toByte()
findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingOfflineTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingOfflineTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingOfflineTest.ktindex c8657904c5..f4b8214e53 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingOfflineTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingOfflineTest.kt@@ -1,7 +1,6 @@ package com.vayunmathur.findfamily.util import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport@@ -34,22 +33,13 @@ class NetworkingOfflineTest { sendingEnabled = true, requestStatus = RequestStatus.MUTUAL_CONNECTION, pqcEncryptionKey = key) - @Test fun securityCodeWithoutKeyOrIdentityIsNull() = runTest {- assertNull(Networking.securityCode(user()))- assertNull(Networking.securityCodePqc(user()))- // Even with a cached bundle, an uninitialised identity yields null.- assertNull(Networking.securityCodePqc(user(key = "a2V5")))- assertNull(Networking.myInviteFingerprint())+ @Test fun signingWithoutIdentityIsNull() = runTest { assertNull(Networking.signAsMe("data".encodeToByteArray())) assertEquals(0L, Networking.userid) } @Test fun peerCryptoStatusOfflineIsUnknown() = runTest {- val check = Networking.peerCryptoStatus(123L)- assertEquals(Networking.PeerCrypto.UNKNOWN, check.status)- assertNull(check.verifiedBundleB64)- val withFingerprint = Networking.peerCryptoStatus(123L, expectedFingerprint = "abc")- assertEquals(Networking.PeerCrypto.UNKNOWN, withFingerprint.status)+ assertEquals(Networking.PeerCrypto.UNKNOWN, Networking.peerCryptoStatus(123L)) } @Test fun linkKeyGenerationShape() {
findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingUwbAndBackupTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingUwbAndBackupTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingUwbAndBackupTest.ktindex 21f8e28a52..06042826ac 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingUwbAndBackupTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/util/NetworkingUwbAndBackupTest.kt@@ -3,7 +3,6 @@ package com.vayunmathur.findfamily.util // FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.findfamily.network.generatePqcIdentityKeyPair import com.vayunmathur.findfamily.network.generatePqcLinkKey-import com.vayunmathur.findfamily.network.myInviteFingerprint import com.vayunmathur.findfamily.network.registerTracker import com.vayunmathur.findfamily.network.resolveTrackerBundle import com.vayunmathur.findfamily.network.uploadTrackerReport