ValenceDrop

A local-first, secure file-sharing and transfer application bridging Linux and Android via BLE and RFCOMM channels.

File Sharing MIT / Apache-2.0 Rust / Kotlin Active Status

Overview

ValenceDrop is a high-performance, local-first file transfer utility that enables users to securely drop files between Linux desktops and Android devices. Rejecting cloud servers and internet-routing, it uses Bluetooth Low Energy (BLE) for discovery and RFCOMM channels for payload transfer.

The project consists of three main components: a platform-agnostic Rust protocol core (valencedrop-core), a systemd-integrated Linux daemon with a GTK4/libadwaita user interface, and a Kotlin-based Android foreground service.

Core Capabilities

Advanced Protocol & Frame Codec

  • Custom Binary Framing: Uses structured headers with magic bytes, frame types, flags, and size fields. Frames are limited to 512 KiB to prevent memory exhaustion.
  • Integrity Checksums: Appends CRC32 checksums to every frame for packet verification, and validates completed transfers using streaming SHA-256 file hashes.

State-Based Session Tracking

  • Strict State Machine: The transport layer strictly validates connection lifecycles: IdleConnectedPairingAuthenticatedTransferring.
  • Resumable Transfers: If a connection is dropped mid-transfer, ValenceDrop logs the byte offset. Upon reconnection, the daemon requests a seek-point resume, avoiding re-transmitting already sent bytes.

Pairing & Trust Architecture

  • Cryptographic Trust Store: Peer identities are validated via public key fingerprints and written to ~/.config/valencedrop/trust.json under strict 0600 permissions.
  • Out-of-Band Validation: Pairing is verified interactively using dynamic QR code generation or PIN verification.
  • Configurable Policies: Android devices can toggle between auto-accept, prompt, or auto-reject modes.

Operations & CLI

ValenceDrop packages a CLI tool inside the Linux client binary. You can inspect peers, check transfers, or start the daemon directly:

Trust Registry CLI

bash - CLI Commands
# Show current daemon status valencedrop status # List all trusted mobile device fingerprints valencedrop trust list # Revoke a specific fingerprint valencedrop trust revoke <device-id>

Testing & Diagnostics

The codebase includes loopback mock tests to simulate transfers without requiring active Bluetooth hardware:

bash - Local Diagnostics
# Run loopback transfer verification script ./scripts/integration-loopback.sh # Run discovery diagnostics for BLE tracking ./scripts/capture-nearby-sync.sh --strict-ble --fail-on-mismatch

Compilation & Deploy

1. Build Linux Stack

bash - Rust Compilation
# Clone and build cargo workspace git clone https://gitlab.com/quantum-hue/valencedrop.git cd valencedrop cargo build --release

2. Build Android App

bash - Gradle Android
# Build debug APK via Gradle wrapper ./gradlew assembleDebug