Files
SimpleRemoter/macos
yuanyuanxiang ef8165c3b4 Feature: sub-connection auth (TOKEN_CONN_AUTH) with HMAC + clientID binding
Client first packet on every sub-connection signs (clientID || timestamp ||
nonce) and waits for server ack. Server verifies signature and pins clientID
on the sub-connection ctx, eliminating IP-reverse-lookup unreliability for
NAT/localhost scenarios. Sub-conn coverage: Win 12 sites, Linux/macOS 3-4
each. Main connection keeps existing TOKEN_LOGIN flow unchanged.

Includes:
- Protocol structs sized to 512/256 bytes with reserved space for future
  extensions (locale, OS info, session token, etc.)
- 5-min timestamp tolerance (Kerberos-grade replay window)
- 10-sec client wait for cross-pacific / weak-network tolerance
- Fix RemoveFromHostList side-effect ordering: MarkDeviceOffline and
  m_ActiveWndW.erase now only fire when ctx is actually removed from
  m_HostList, preventing sub-conn disconnects from misreporting main as
  offline (regression introduced by auth-set clientID on sub ctx)
- Fix latent bug: IOCPClient::m_conn was never assigned in ctor, leaving
  GetConnectionAddress() always NULL and FileManager V2 transfer's
  srcClientID always 0

Breaking change: new client cannot use sub-features against old server.
New server tolerates legacy clients (no auth). Future tightening can reject
unauthenticated sub-connections via IsAuthenticated() flag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 00:04:40 +02:00
..

macOS Remote Desktop Client
===========================

Prerequisites:
  1. Xcode Command Line Tools: xcode-select --install
  2. CMake: brew install cmake

Build:
  chmod +x build.sh
  ./build.sh

Or manually:
  mkdir build && cd build
  cmake ..
  make

Run:
  ./build/bin/ghost

Configuration:
  Server address is configured in main.mm (g_SETTINGS variable).
  Modify before building if needed.

Permissions Required:
  1. Screen Recording - System Settings > Privacy & Security > Screen Recording
  2. Accessibility - System Settings > Privacy & Security > Accessibility

Features:
  [x] Screen capture (CGDisplayCreateImage)
  [x] H264 video encoding (VideoToolbox)
  [x] Mouse control (move, click, drag, scroll)
  [x] Keyboard control (full VK code mapping)
  [x] Retina display support (coordinate scaling)
  [x] Network connection (IOCPClient)
  [x] LOGIN_INFOR (system info reporting)
  [x] Heartbeat with RTT estimation
  [x] Active window tracking
  [x] Quality level adjustment (FPS/algorithm)

Files:
  CMakeLists.txt      - Build configuration
  Permissions.h/mm    - macOS permission handling
  ScreenHandler.h/mm  - Screen capture and H264 encoding
  InputHandler.h/mm   - Mouse/keyboard simulation
  H264Encoder.h/mm    - VideoToolbox H264 encoder
  SystemManager.h/mm  - Process management
  main.mm             - Entry point, LOGIN_INFOR, heartbeat

Quality Levels:
  Level 0: 5 FPS,  Grayscale (emergency low bandwidth)
  Level 1: 10 FPS, RGB565
  Level 2: 15 FPS, H264 (default, office work)
  Level 3: 20 FPS, H264
  Level 4: 25 FPS, H264
  Level 5: 30 FPS, H264 (smooth)

Notes:
  - First frame is always raw bitmap (TOKEN_FIRSTSCREEN)
  - Subsequent frames use H264 encoding (TOKEN_NEXTSCREEN)
  - Coordinates are scaled for Retina displays automatically
  - Windows VK codes are mapped to macOS key codes