tppc_linksc(和小冋)
HMTransIn Progress
简体中文
HMTransIn Progress

LAN file transfer between Mac and MatePad, no cloud required

HMTrans

HMTrans is a vibecoding product born from the developer's frustration with existing cross-platform file transfer options: AirDrop doesn't work with MatePad, Huawei Share is unreliable on Mac, IM apps compress files, and cloud storage requires uploading. HMTrans does one thing: auto-discover devices on the same Wi-Fi via UDP broadcast, then transfer raw files over a direct TCP connection — no cloud, no compression. First-time connections require confirmation; trusted devices are auto-accepted. Real-time progress, speed, and direction are shown throughout. Any file type is supported; folders are zipped before transfer. Files save to ~/Downloads/HMTrans (Mac) and Download/HMTrans (HarmonyOS).

Design

Dual-platform native design following each platform's design language: macOS uses SwiftUI + AppKit with a menu bar app, main window, Dock drag-and-drop, and light/dark mode support; HarmonyOS uses ArkUI with split-screen adaptation, system file picker, and immersive UI. Device discovery uses UDP broadcasting. File transfer uses TCP streaming with 1MB chunks; the receiver writes to a .part temp file and renames it after SHA-256 verification. Previously connected devices are cached for short-term fallback probing; offline devices are evicted via TTL.

Architecture

Six-layer architecture: 1) Device Discovery — UDP broadcast with JSON device info; 2) Connection — direct TCP, first-time confirmation & trust; 3) Protocol — custom message protocol, file metadata JSON + 1MB chunks; 4) Transfer — TCP raw byte streaming; 5) Verification — SHA-256 integrity check; 6) UI — platform-native UIs with live transfer list and history. Code is split by platform: apps/macos (Swift Package with Core/CLI/App modules) and apps/harmonyos (ArkTS + hvigor build system).

Tech Stack

SwiftArkTS

Links

GitHubLive

Messages

Anyone can leave a message or reply. Author replies are labeled automatically when logged in.

Sort
Loading...