System Architecture & Design Invariants¶
fparted is designed with strict layering to decouple user interface actions from privileged operating system commands. Every action operates across well-defined boundaries to prevent accidental disk corruption or malicious command injection.
🏛️ Layered Architecture¶
┌──────────────────────────────────────────────────────────┐
│ User Interface (UI) │
│ • Navigation Rail • Partition Graph / List │
│ • Dialogs & Modals • Desktop Shortcut Menus │
└────────────────────────────┬─────────────────────────────┘
│ Dispatches Typed Intents
▼
┌──────────────────────────────────────────────────────────┐
│ Storage Operations Layer │
│ • StorageOperation • PlannedCommand Planner │
│ • Preflight Validation • Disk Prediction Engine │
│ • Operation Queue • Risk Classification │
└────────────────────────────┬─────────────────────────────┘
│ Validated Commands
▼
┌──────────────────────────────────────────────────────────┐
│ Privileged Execution Subsystem │
│ • Manifest-Backed Executable Registry │
│ • Central POSIX Single-Quote Sanitizer │
│ • Deterministic Environment Builder │
│ • First-Failure Stop Execution Loop │
└────────────────────────────┬─────────────────────────────┘
│ Transport: /system/bin/su -c
▼
┌──────────────────────────────────────────────────────────┐
│ Verified Toolchain (Repo A) / System Root │
│ • parted, blkid, mkfs.*, fsck.*, resize2fs, cryptsetup │
│ • Exact prefix: /data/data/vn.shadichy.parted/files │
└──────────────────────────────────────────────────────────┘
🔒 Fixed Invariants¶
- Privilege Boundary: Widgets never construct raw shell strings, join lists with spaces, or invoke root processes directly. All user mutations produce immutable
StorageOperationrecords. - Deterministic Toolchain: Binaries must resolve from the manifest-backed registry under
/data/data/vn.shadichy.parted/files/usr/bin. Android system$PATHbuiltins andtoyboxaliases are never used for toolchain-owned tools. - First-Failure Stop: When executing a batch of planned commands, execution stops immediately upon the first non-zero exit code. Later commands are aborted, and a device rescan is performed to synchronize UI state with hardware reality.
- No Rollback Illusion: The application never falsely claims that destructive storage mutations (such as filesystem resizing or reformatting) can be automatically rolled back if cancelled mid-flight. Pending operations can be discarded before execution, but in-flight I/O is non-interruptible.
- Deterministic Environment: All commands run with an explicit environment: