4 Commits
Author SHA1 Message Date
lucioandClaude Opus 5 c0031c00da polish P1: CipherScheme (.legacy/.modern) in the cipher stream
The legacy scheme is what every PowerToys up to v0.100.2 speaks: a fixed
PBKDF2 salt (UTF-16LE of "18446744073709551615", 40 bytes), 50 000
iterations, a fixed ASCII IV "1844674407370955" and no cleartext header —
citations to the pre-a9e1f0f20e Encryption.cs. The sacrificial block is
still the first ciphertext block under both schemes.

- CipherWriter/CipherReader take the scheme; the writer's header is 16
  bytes under .legacy and 48 under .modern, the reader consumes as many.
- MacCipherScheme setting, default legacy, Mac-only key in the same file.
- InvalidKeyReason.cipherSchemeMismatch and SocketStatus
  .cipherSchemeMismatch (raw value 100, outside the Windows range) with
  its menu text, for the diagnostic the network layer raises next.

Verified offline against Python cryptography in both directions: our
legacy writer's stream decrypts under
pbkdf2_hmac('sha512', key, '18446744073709551615'.encode('utf-16-le'),
50000, 32) + AES-CBC, and our reader recovers Python's.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-16 21:06:41 -07:00
lucioandClaude Opus 5 21c886165e extras: awake assertion, fullscreen rule, drawn cursor, transfer notices
- MWBMac/Awake.swift: DisplayAwake renews an IOPMAssertion
  (PreventUserIdleDisplaySleep, 90 s timeout) on every Awake (21), the
  macOS answer to Common.HumanBeingDetected/PokeMyself
  (Receiver.cs:244-249, Common.cs:561-591) without posting input.
- MWBMac/Fullscreen.swift: the frontmost app's excluded-apps test and a
  covers-a-whole-display window check, cached 250 ms; gated in the
  Engine by IsEasyMouseSwitchAllowed's two early outs
  (Common.cs:1638-1650), so it is asked only on the edge path.
- MWBMac/FakeCursor.swift: CursorOverlay draws NSCursor.arrow at the
  last injected position (Receiver.cs:186-188) and hides on park, local
  input and shutdown (Common.cs:1495, InputHook.cs:256-264); FakeCursor
  coalesces the main-thread hops.
- Settings.drawMouseCursor accessor + the Behaviour-pane toggle,
  answering app-ui's open request.
- UIBridge.TransferNotices wires ClipboardAction.note to the Notifier,
  answering clipboard's open request (Clipboard.cs:610-618, 869-881, 916).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-16 05:25:10 -07:00
lucioandClaude Opus 5 f76eb8fabc app-engine: settings.json is 0600 whatever the old file's mode was
QA finding 1. `FileManager.replaceItemAt` copies the *original* item's
metadata onto the replacement unless `.usingNewMetadataOnly` is passed,
so a `settings.json` that arrived from another machine (README D3:
copying the file is a supported way to share the key and the matrix)
kept its permissive mode through every later `SettingsStore.update()` —
with `SecurityKey` in the clear. Pass the option, and set the mode on
the final path afterwards so the guarantee does not depend on which
branch wrote the file.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-16 03:54:57 -07:00
lucioandClaude Opus 5 679dee27af app-engine: Settings in the PowerToys schema, and the rotating log
Settings.swift keeps the raw property tree so properties this port does
not implement round-trip untouched (README D3), with typed accessors for
the ones we do: the `{"value": …}` boxing, the HotkeySettings shape
(HotkeySettings.cs:121-136) and the defaults of
MouseWithoutBordersProperties.cs:165-206. SettingsStore loads, saves
atomically at 0600 and watches the file (Setting.cs:197-207); a corrupt
file throws rather than being replaced by defaults, which would discard
the user's security key.

Log.swift is os.Logger plus a 1 MB x 3 rotating file. Nothing here can
take a KeyboardData or a key string (CLAUDE.md invariant 2).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-16 03:19:17 -07:00