USBCloudBackup is a native Android application that automatically detects USB storage devices, scans their contents, and backs up files to Firebase Cloud Storage with content-based deduplication and automatic filename versioning.
Many users store important files on USB drives but rarely create cloud backups. This app removes all friction from the backup process.
The user installs the app once, completes first-run setup once, and never needs to manually open the app again. Whenever a USB drive is attached:
- App detects the USB device via
UsbManagerandBroadcastReceiver. - App discovers storage volume via hybrid storage access (SAF /
MANAGE_EXTERNAL_STORAGE). - WorkManager enqueues a background job chain.
- Files are scanned recursively and SHA-256 hashes are computed.
- Files already backed up are skipped (content-based deduplication).
- New files are uploaded to Firebase Cloud Storage.
- Filename collisions produce automatic versioned names (
name(1).ext,name(2).ext) reserved transactionally in Firestore. - Operation details are indexed in Firestore and local Room DB for crash recovery.
- Minimum SDK: Android 10 (API 29)
- Target SDK: Android 16 (API 36)
- Compile SDK: Android 16 (API 36)
- Language: Kotlin
- Jetpack Libraries: Room 2.6+, WorkManager 2.9+, Lifecycle
- Firebase Platform: BoM 34.17.0 (
firebase-auth,firebase-storage,firebase-firestore)
- Zero-interaction backup — Headless operation after first-run setup.
- Content-based deduplication — SHA-256 identity, not filename identity.
- Never overwrite — Existing cloud files are never replaced.
- Automatic versioning — Filename collisions produce
(1),(2),(3)suffixes. - Crash-safe — Multi-stage state machine with upload session resume and cloud reconciliation.
- Event-driven — No polling, no permanent idle service.
Master Architecture Specification:
- FINAL_IMPLEMENTATION_SPEC.md — Master Blueprint
Detailed Architectural Specifications:
- USB_ACCESS_DECISION.md — Hybrid Storage Access Strategy
- FIRESTORE_SCHEMA.md — Firestore Database Hierarchy & Rules
- CLOUD_STORAGE_SCHEMA.md — Cloud Storage Paths & Metadata
- FIREBASE_DEPENDENCIES.md — Firebase Dependency Setup
- CLOUD_CONSISTENCY.md — Crash Recovery & Upload Lifecycle
- NAME_RESERVATION.md — Atomic Filename Reservation Protocol
- INVARIANTS.md — System Invariants (I-001 to I-014)
- DEVICE_VALIDATION_PLAN.md — 50-Test Physical Validation Matrix
- CONTEXT_AUDIT.md — Initial Audit & Finding Analysis
- IMPLEMENTATION_PLAN.md — Sequential Phase Execution Plan
Original Reference Specs:
- ARCHITECTURE.md
- REQUIREMENTS.md
- ANDROID_APIS.md
- USB_STORAGE.md
- FILE_DISCOVERY.md
- HASHING_AND_DEDUPLICATION.md
- VERSIONING_AND_NAMING.md
- CLOUD_BACKEND.md
- BACKGROUND_EXECUTION.md
- PERMISSIONS.md
- DATA_MODEL.md
- STATE_MACHINE.md
- ERROR_HANDLING.md
- SECURITY.md
- OFFLINE_AND_RETRY.md
- TESTING.md
- BUILD_AND_TOOLCHAIN.md
- PUBLIC_APIS.md
- AGENT_RULES.md
- DECISIONS.md
- PROJECT_STRUCTURE.md