Shredder is a high-security Android application designed to permanently and irrecoverably delete files and directories. It implements industry-standard multi-pass shredding algorithms to thwart data recovery even from specialized hardware forensic tools.
- Multi-Pass Shredding: Implements a robust 3-pass overwrite algorithm.
- Metadata Wiping: Renames files to random strings and truncates them before final deletion to hide original file identities.
- Free Space Wiper: Securely wipes available free space on the device storage to prevent recovery of previously deleted files.
- Nuclear Option: Integrated device administrator capability to trigger a secure factory reset (wiping all data).
- Foreground Execution: Uses Android Foreground Services to ensure long-running shredding tasks complete successfully even if the app is in the background.
- Biometric Security: Protects the entire application and high-risk operations (like the Nuclear Option) with Biometric/PIN authentication.
- Notification Support: Fully compatible with Android 13+ notification permissions for reliable foreground execution.
- Modern UI: Built entirely with Jetpack Compose for a responsive, fluid user experience, featuring a collapsible real-time console.
The core engine implements a 3-pass overwrite strategy:
- Pass 1 (Random): Overwrites the entire file with cryptographically strong random data using
java.security.SecureRandom. - Pass 2 (Pattern): Overwrites with alternating bit patterns (
0xAA,0x55) to stress test and flip bits on magnetic and flash storage cells. - Pass 3 (Random): A final pass of random entropy.
I/O Optimization:
- Uses
RandomAccessFilein"rw"mode for direct disk access. - Employs a 1MB buffer to maximize throughput on modern high-speed storage.
- Explicitly calls
FileDescriptor.sync()after every pass to ensure the OS flushes the write buffer to physical hardware.
Shredding is an I/O intensive and potentially long-running operation. To prevent the system from killing the process:
- The app promotes itself to a Foreground Service.
- Uses
START_NOT_STICKYto manage lifecycle efficiently. - Provides real-time progress updates via a persistent notification.
MANAGE_EXTERNAL_STORAGE: Utilizes the Scoped Storage "All Files Access" permission (on Android 11+) to allow deep shredding across the entire user-accessible storage.- Device Administration: Registered as a Device Admin to enable the
wipeData()system call for the "Nuclear Option". POST_NOTIFICATIONS: Required on Android 13+ to show the foreground service notification, ensuring the shredding process is not interrupted.- No Backups:
android:allowBackup="false"is set in the Manifest to prevent sensitive app states from being cached in cloud backups.
- Android SDK: 36 (target), 24 (min)
- Language: Kotlin
- UI Framework: Jetpack Compose
- Build System: Gradle Kotlin DSL (
.kts)
The application is configured for production with:
- R8/ProGuard: Enabled for code shrinking and obfuscation.
- Resource Shrinking: Enabled to minimize APK footprint.
- Log Sanitization: Verbose and debug logging is disabled in the core engine to prevent metadata leakage in
logcat.
- App-wide Lock: Added biometric authentication barrier on application start.
- Refactored Architecture: Optimized
MainActivityfor better performance and maintainability using decomposed composables and state-driven UI. - Kotlin Intrinsics: Migrated core math operations to
kotlin.mathfor improved platform integration. - Bug Fixes: Resolved resource linking issues and optimized file listing logic.
Disclaimer: Data deleted with Shredder is IRREVERSIBLE. Use with caution.