Modern Apps git

← Modern-Apps.git

findfamily, office, voxels: share an https link instead of a raw deep link (#550)

Commit
f560b969383ae0590046be1ed88dad9cb0b3b6b5
Author
vayun-mathur <[email protected]>
When
2026-08-17 21:32 UTC (3 months ago)
Parents
a2bbdfa
Many popular apps won't make a findfamily:// URI tappable, so the share sheet
now sends ma.vayunmathur.com/{ff,of,vx}/share, which bounces to the same custom
scheme (see location_share_server handlers::deeplink).

The ids go in the fragment (#id=<id>&owner=<deviceId>), which browsers never
send, so the server can't see who shared what with whom - it only learns that
some share page was opened.

Only the generated strings change: the intent-filters and parsers are untouched,
so nothing claims the domain as a verified App Link and already-installed builds
keep working, since the page redirects to the scheme they already handle.

Diff

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 1344d12cfd..5f784413ec 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@@ -77,12 +77,14 @@ fun AddPersonDialog(                     readOnly = true                 ) -                // Share sheet instead of copy/paste: sends findfamily://add/<myId>,-                // which prefills the recipient's Add Person dialog. The link carries-                // only a public id — never a key — so it's safe to share anywhere.+                // Share sheet instead of copy/paste: sends an https link that bounces to+                // 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. The id rides in the fragment, which browsers never send, so the+                // server sees only that some share page was opened.                 OutlinedButton(                     {-                        val link = "findfamily://add/${Networking.userid.encodeBase26()}"+                        val link = "https://ma.vayunmathur.com/ff/share#id=${Networking.userid.encodeBase26()}"                         ExternalIntents.shareText(                             context,                             link,
games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/MenuScreens.kt
diff --git a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/MenuScreens.kt b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/MenuScreens.ktindex cf839a89cd..346cca2d8c 100644--- a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/MenuScreens.kt+++ b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/MenuScreens.kt@@ -232,11 +232,12 @@ fun ShareOnlineDialog(             Column(Modifier.padding(20.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) {                 Text(stringResource(R.string.share_world), style = MaterialTheme.typography.titleLarge, color = MaterialTheme.colorScheme.primary)                 Text(world.meta.name, style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurface)-                // Share sheet: sends voxels://join/<worldId>?owner=<ownerId> (public ids only) so the-                // invitee can request access without you typing their device id.+                // Share sheet: sends an https link that bounces to voxels://join/<worldId>?owner=<ownerId>+                // (public ids only) so the invitee can request access without you typing their device id.+                // The ids ride in the fragment, which browsers never send to the server.                 OutlinedButton(                     onClick = {-                        val link = "voxels://join/${world.meta.worldId}?owner=${world.meta.ownerDeviceId}"+                        val link = "https://ma.vayunmathur.com/vx/share#id=${world.meta.worldId}&owner=${world.meta.ownerDeviceId}"                         ExternalIntents.shareText(context, link, context.getString(R.string.share_link_chooser))                     },                     modifier = Modifier.fillMaxWidth(),
office/src/main/java/com/vayunmathur/office/MainActivity.kt
diff --git a/office/src/main/java/com/vayunmathur/office/MainActivity.kt b/office/src/main/java/com/vayunmathur/office/MainActivity.ktindex 243bcfbe2b..219448ae0b 100644--- a/office/src/main/java/com/vayunmathur/office/MainActivity.kt+++ b/office/src/main/java/com/vayunmathur/office/MainActivity.kt@@ -560,8 +560,8 @@ fun ShareOnlineDialog(                         TextButton(enabled = docName.isNotBlank() && docName.trim() != initialName, onClick = { onRename(docName.trim()) }) { Text(stringResource(UiR.string.rename)) }                         Spacer(Modifier.height(8.dp))                     }-                    // Share sheet: sends office://join/<docId>?owner=<deviceId> (public ids only) so-                    // the recipient can request access without you typing their device id.+                    // Share sheet: sends an https link that bounces to office://join/<docId>?owner=<deviceId>+                    // (public ids only) so the recipient can request access without you typing their device id.                     shareLink?.let { link ->                         OutlinedButton(                             onClick = { ExternalIntents.shareText(context, link, context.getString(R.string.share_link_chooser)) },
office/src/main/java/com/vayunmathur/office/util/OfficeViewModel.kt
diff --git a/office/src/main/java/com/vayunmathur/office/util/OfficeViewModel.kt b/office/src/main/java/com/vayunmathur/office/util/OfficeViewModel.ktindex f5d719058b..d671b453e8 100644--- a/office/src/main/java/com/vayunmathur/office/util/OfficeViewModel.kt+++ b/office/src/main/java/com/vayunmathur/office/util/OfficeViewModel.kt@@ -2349,8 +2349,11 @@ class OfficeViewModel(application: Application) : AndroidViewModel(application)         }     } -    /** Builds a tappable invite link for a document this device owns (public ids only). */-    fun shareLinkFor(docId: String): String = "office://join/$docId?owner=${OfficeSync.deviceId}"+    /** Builds a tappable invite link for a document this device owns (public ids only).+     *  An https link that bounces to `office://join/...`, since messengers won't linkify+     *  a bare custom scheme. The ids ride in the fragment, which browsers never send. */+    fun shareLinkFor(docId: String): String =+        "https://ma.vayunmathur.com/of/share#id=$docId&owner=${OfficeSync.deviceId}"      /**      * Sends a PQC-sealed join request to [ownerId]'s inbox after ensuring this device is registered.