Skip to content

Version 1.1.0

Latest

Choose a tag to compare

@kotique123 kotique123 released this 15 Feb 02:19
· 11 commits to main since this release

FnKeyboard v1.1.0 — Security Hardening

This release significantly hardens FnKeyboard's security posture — from memory safety in low-level system APIs to build-time integrity checks and runtime protections against event flooding.

What's New

Runtime Security

  • Memory-safe event tap lifecycle — replaced raw Unmanaged<Self> pointer with a weak-reference TapContext wrapper, eliminating dangling-pointer dereferences if the monitor is deallocated while the CGEvent tap callback is in-flight
  • Thread-safe monitoring flag — isMonitoring is now protected by NSLock for safe access across the main thread and the CGEvent tap callback
  • CGEvent memory leak fix — switched from passRetained to passUnretained for event return values (listenOnly taps ignore the return, so retaining leaked every keyboard event flowing through the system)
  • Reduced event surface — removed flagsChanged from the event mask; only keyDown and keyUp are intercepted

Rate Limiting & Debouncing

  • Per-key rate limiting in KeySimulator — enforces a 150ms minimum interval between simulated presses, preventing event flooding from rapid automated clicks
  • UI tap debouncing in FunctionKeyView — 200ms cooldown as a second layer of defense
  • Input validation — KeySimulator now validates key IDs (1–12) before processing
  • @MainActor annotation on KeySimulator to guarantee thread-safe access to mutable state

Build & Signing

  • Hardened Runtime with zero entitlement exceptions — protects against DYLD_INSERT_LIBRARIES injection, unsigned executable memory, and debugger attachment
  • Code signing integrated into build.sh with support for CODESIGN_IDENTITY (distribution) and ad-hoc fallback (development)
  • SHA-256 integrity verification of generate_icon.swift against the committed version before execution (supply-chain protection)
  • --timestamp on distribution signatures for notarization support

Other Improvements

  • Added NSAccessibilityUsageDescription to Info.plist for a clear permission prompt
  • Added comprehensive Security section to README documenting permissions, privilege model, and runtime protections
  • Added installation guide with download and build-from-source paths
  • Dual-architecture release builds (arm64 + x86_64 DMGs) via .build.sh --release

Download

File Architecture
FnKeyboard-macos-arm64.dmg Apple Silicon (M1/M2/M3/M4)
FnKeyboard-macos-x86_64.dmg Intel

Upgrading

Drop-in replacement — just replace the app in Applications. Make sure to remove and add permissions in Accesibility and Input Monitoring. Run xattr -cr /path/to/FnKeyboard.app to bypass Gatekeeper due to a lack of a developer certificate at the time of building.