Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.
fix(windows): the sparse package registers again (#84)
Beec82e3e3ecf64
diff --git a/desktop/app/src/win/share_target.rs b/desktop/app/src/win/share_target.rsindex c576f94..5cd588c 100644--- a/desktop/app/src/win/share_target.rs+++ b/desktop/app/src/win/share_target.rs@@ -238,6 +238,7 @@ mod tests {for format in ["StorageItems", "WebLink", "Uri", "Text", "Bitmap"] {assert!(xml_str.contains(&format!("<uap:DataFormat>{format}</uap:DataFormat>")));}- assert!(xml_str.contains(r#"ToastActivatorCLSID="{7B9E0E64-5C5A-4E8B-9D31-5A4C2B10F6E1}""#));+ // Without braces: the schema rejects them, and the package then never registers (#84).+ assert!(xml_str.contains(r#"ToastActivatorCLSID="7B9E0E64-5C5A-4E8B-9D31-5A4C2B10F6E1""#));}}diff --git a/desktop/installer/AppxManifest.xml b/desktop/installer/AppxManifest.xmlindex c9420a3..35b0ca1 100644--- a/desktop/installer/AppxManifest.xml+++ b/desktop/installer/AppxManifest.xml@@ -56,7 +56,7 @@</uap:ShareTarget></uap:Extension><desktop:Extension Category="windows.toastNotificationActivation">- <desktop:ToastNotificationActivation ToastActivatorCLSID="{7B9E0E64-5C5A-4E8B-9D31-5A4C2B10F6E1}" />+ <desktop:ToastNotificationActivation ToastActivatorCLSID="7B9E0E64-5C5A-4E8B-9D31-5A4C2B10F6E1" /></desktop:Extension><com:Extension Category="windows.comServer"><com:ComServer>diff --git a/desktop/installer/nectarlink.nsi b/desktop/installer/nectarlink.nsiindex 53cd015..6b8859f 100644--- a/desktop/installer/nectarlink.nsi+++ b/desktop/installer/nectarlink.nsi@@ -231,8 +231,12 @@ Section "Install"CreateShortCut "$SMPROGRAMS\${DISPLAY}.lnk" "$INSTDIR\${EXE}" "" "$INSTDIR\${EXE}" 0 "" "" "Your phone, on your PC"CreateShortCut "$DESKTOP\${DISPLAY}.lnk" "$INSTDIR\${EXE}" "" "$INSTDIR\${EXE}" 0 "" "" "Your phone, on your PC"- ; Best-effort Sparse Package registration for the Windows Share sheet target.- nsExec::Exec 'powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "try { Add-AppxPackage -Register \"$INSTDIR\AppxManifest.xml\" -ExternalLocation \"$INSTDIR\" -ErrorAction SilentlyContinue } catch {}"'+ ; The Windows Share sheet and Widgets board need the app's sparse package+ ; registered, which Windows allows for an unsigned one only with Developer+ ; Mode on. Why it didn't register goes to sparse-package.log (#84).+ CreateDirectory "$INSTDIR\Widgets"+ Delete "$INSTDIR\sparse-package.log"+ nsExec::Exec 'powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "try { Add-AppxPackage -Register \"$INSTDIR\AppxManifest.xml\" -ExternalLocation \"$INSTDIR\" -ErrorAction Stop } catch { $$_ | Out-File -Encoding utf8 \"$INSTDIR\sparse-package.log\" }"'WriteRegStr HKLM "Software\${APP}" "InstallDir" "$INSTDIR"WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayName" "${DISPLAY}"@@ -285,6 +289,8 @@ Section "Uninstall"Delete "$INSTDIR\nectarlink_vcam.dll"Delete "$INSTDIR\AppxManifest.xml"RMDir /r "$INSTDIR\Assets"+ RMDir "$INSTDIR\Widgets"+ Delete "$INSTDIR\sparse-package.log"Delete "$INSTDIR\update.log"Delete "$INSTDIR\uninstall.exe"${EndIf}diff --git a/docs/guide/known-limitations.md b/docs/guide/known-limitations.mdindex 99a3837..24f7683 100644--- a/docs/guide/known-limitations.md+++ b/docs/guide/known-limitations.md@@ -10,7 +10,7 @@ NectarLink aims to be completely transparent about what works out of the box, wh| **Clipboard: Automatic background phone-to-PC sync** | At `Standard` and `Assist`, copying text on your phone does not send it to your PC automatically in the background. | Android 10 and newer block background apps from reading the system clipboard unless they run as the foreground app, the active keyboard (IME), or the `shell` user (`UID 2000`). | Enable the **`Elevated`** power level once (Wireless Debugging) for automatic background phone-to-PC clipboard sync, or tap the **Send clipboard** Quick Settings tile, share sheet target, or widget. || **Notifications: Sensitive text & OTPs on Android 15+** | At `Standard` and `Assist`, Android 15 and newer may redact notification text containing two-factor authentication codes from third-party notification listeners. | Android 15's Enhanced Confirmation Mode withholds sensitive notification content unless the listener holds the privileged `RECEIVE_SENSITIVE_NOTIFICATIONS` appop. | Enable the **`Elevated`** power level once. NectarLink's shell helper automatically grants `RECEIVE_SENSITIVE_NOTIFICATIONS` to NectarLink. || **Messages: Third-party chat app threads** | Unified Conversations from WhatsApp, Signal, Telegram, and RCS show messages that arrive while connected and let you reply via `RemoteInput`, but cannot load older historical chat databases or start a brand-new thread with a contact who has not messaged you. | Android sandboxes each third-party chat app's internal SQLite database and does not expose a public API for reading historical third-party messages or RCS databases. | Open the chat app directly on your PC in its own **`app window`** (`Elevated` on Android 11+) when you need to browse old chat history or start a new chat. |-| **Windows Integration: System Share sheet (`Win+Share`) & Widgets board (`Win+W`)** | File Explorer's right-click **Send to** menu, Explorer context menu, taskbar **Jump List**, drag-and-drop, and `--share` CLI work on all installs, but appearing in the Windows 11 `Win+Share` popup and `Win+W` Widgets board requires package identity. | Windows 11 requires `windows.shareTarget` and `com.microsoft.windows.widgets` COM extensions to belong to a package signed with a trusted code-signing certificate (or have Windows Developer Mode enabled). | Use File Explorer's right-click **Send to** menu, drag files to the `Shelf` (`Ctrl+Alt+S`), or enable Windows Developer Mode if registering the sparse package locally. |+| **Windows Integration: System Share sheet (`Win+Share`) & Widgets board (`Win+W`)** | File Explorer's right-click **Send to** menu, Explorer context menu, taskbar **Jump List**, drag-and-drop, and `--share` CLI work on all installs, but appearing in the Windows 11 `Win+Share` popup and `Win+W` Widgets board requires package identity. | Windows 11 requires `windows.shareTarget` and `com.microsoft.windows.widgets` COM extensions to belong to a package signed with a trusted code-signing certificate (or have Windows Developer Mode enabled). | Use File Explorer's right-click **Send to** menu, drag files to the `Shelf` (`Ctrl+Alt+S`), or turn on Windows Developer Mode and run setup again. If NectarLink still isn't in the Share sheet, `sparse-package.log` in its install folder says why. || **Mirroring: `FLAG_SECURE` windows** | Banking apps, password managers, and DRM-protected streaming video apps render black when mirrored at `Standard` or `Assist`. | Android's window compositor strips `FLAG_SECURE` layers from standard `MediaProjection` virtual displays to protect credentials and DRM video. | Normal apps and the Android home screen render normally as soon as you leave the protected window. || **Mirroring: `Elevated` `/dev/uhid` and `REMOTE_SUBMIX` on some OEM ROMs** | On some non-AOSP OEM Android ROMs, virtual physical keyboard/gamepad registration (`/dev/uhid`) or internal audio capture for apps that block playback capture (`REMOTE_SUBMIX`) may be denied to `shell` (`UID 2000`). | Custom OEM SELinux policies sometimes restrict `/dev/uhid` or `AUDIO_SOURCE_REMOTE_SUBMIX` to `system` (`UID 1000`) or `root` rather than `shell` (`UID 2000`). | NectarLink detects the permission denial automatically and falls back cleanly to standard `InputManager` key/touch injection and standard Android 10+ `AudioPlaybackCapture`. || **Webcam: 4K sensor support and 8-bit SDR color** | 4K (`2160p`) webcam streaming requires a physical phone camera sensor and hardware encoder that support 3840x2160 at 30 fps. Video is streamed in 8-bit SDR (`NV12` / `RGB32`), not 10-bit HDR. | Emulators and some front-facing phone cameras max out at 1080p. Windows Media Foundation virtual cameras in video conferencing apps expect standard 8-bit SDR formats (`NV12` / `RGB32`), so 10-bit HDR is omitted to avoid tone-mapping mismatches. | Use **1080p** or **720p** if your phone's selected camera lens does not support 4K capture. |diff --git a/scripts/package.ps1 b/scripts/package.ps1index 9910d0d..5a55697 100644--- a/scripts/package.ps1+++ b/scripts/package.ps1@@ -236,10 +236,32 @@ foreach ($spec in @(@{ Name = 'Square44x44Logo.png'; Size = 44 }, @{ Name = 'Squ$ico.Dispose()}$manifest = Get-Content (Join-Path $root 'desktop\installer\AppxManifest.xml') -Raw-$manifest = $manifest -replace 'Version="\d+\.\d+\.\d+\.\d+"', "Version=`"$numeric.0`""+# Only the package's own version: MinVersion is the oldest Windows it runs on.+$manifest = $manifest -replace '(<Identity\b[^>]*?\s)Version="[^"]*"', "`${1}Version=`"$numeric.0`""$manifest = $manifest -replace 'ProcessorArchitecture="x64"', "ProcessorArchitecture=`"$Arch`""Set-Content -Path (Join-Path $stage 'AppxManifest.xml') -Value $manifest -Encoding UTF8 -NoNewline+# Windows checks the manifest only when setup registers it, and setup can't+# show why it failed, so it's checked here the way makeappx packs it (#84).+$makeappx = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\makeappx.exe" -ErrorAction SilentlyContinue |+ Sort-Object { [version]$_.Directory.Parent.Name } -Descending | Select-Object -First 1+if ($makeappx) {+ $check = Join-Path ([IO.Path]::GetTempPath()) "nectarlink-appx-$PID"+ try {+ New-Item -ItemType Directory -Force (Join-Path $check 'content') | Out-Null+ Copy-Item (Join-Path $stage 'AppxManifest.xml'), $assetsDir -Destination (Join-Path $check 'content') -Recurse+ # The app is outside the package (its install folder); any file stands in for it.+ Set-Content (Join-Path $check 'content\nectarlink-desktop.exe') 'app'+ Invoke-Native "the package manifest check" {+ & $makeappx.FullName pack /o /d (Join-Path $check 'content') /p (Join-Path $check 'check.msix')+ }+ } finally {+ Remove-Item -Recurse -Force $check -ErrorAction SilentlyContinue+ }+} else {+ Write-Warning "makeappx isn't installed (Windows SDK), so the package manifest isn't checked"+}+$size = (Get-ChildItem $stage -Recurse -File | Measure-Object Length -Sum).Sum / 1MBWrite-Host ("Staged {0:N1} MB in {1}" -f $size, $stage)if ($StageOnly) { return }