How mdp43140/ltecleanerfoss works
1. Repository shape
- This is an Android application repo with one primary app module (app) plus a separate baselineprofile module for startup/performance optimization.
- The app is a local, on-device cleanup tool: it scans the file system for safe-to-delete content and removes it, with user-controlled whitelist/blacklist rules.
2. Top-level runtime architecture
- The app is built around standard Android components: an Application (App.kt), a main Activity (MainActivity.kt), several Fragments, a background Service (CleanupService.kt), a BroadcastReceiver (BootReceiver.kt), and a background Worker (ScheduledWorker.kt).
- This suggests a split between foreground UI and background cleanup/automation paths.
3. User-facing shell
- MainActivity is the host for the main screen and fragment navigation.
- The main UI is divided into:
- MainFragment for the primary cleanup workflow,
- WhitelistFragment and BlacklistFragment for rule management,
- SettingsFragment for preferences.
- BaseFragment and ListItemAdapter provide shared UI behavior and list rendering.
4. Cleanup engine
- FileScanner.kt is the core scanning subsystem: it likely traverses storage, classifies files/folders, and selects candidates for deletion.
- CleanupService.kt is the execution boundary for actual cleanup work, isolating file deletion from the UI thread.
- CommonFunctions.kt and Constants.kt hold shared logic and policy values used by scanning/cleanup paths.
- The README indicates the app targets categories such as logs, temporary files, caches, advertisement folders, empty folders, and clipboard clearing.
5. Rules and persistence
- The app persists user choices through PreferenceRepository.kt and the SharedPreferencesExtension.kt helper.
- The whitelist/blacklist UI likely feeds directly into the scanner’s filtering logic, controlling what paths are excluded or targeted.
- Preferences are defined in res/xml/preferences.xml, tying the settings screen to stored app state.
6. Automation and background execution
- ScheduledWorker.kt is the periodic automation path for daily cleanup.
- BootReceiver.kt indicates the app restores or re-arms scheduled behavior after device reboot.
- Together these components form the app’s non-interactive maintenance flow: boot/event trigger → worker/service → scanner → cleanup.
7. Emergency/auxiliary entry points
- PanicResponderActivity.kt is a separate activity used as an auxiliary runtime entry point, likely for a fast response action such as immediate cleanup or a shortcut-triggered action.
- res/xml/shortcuts.xml confirms the app exposes at least one launcher shortcut path into core functionality.
8. Data flow
- The main flow is: user configures rules/settings in fragments → preferences are saved locally → cleanup is initiated manually or scheduled → scanner evaluates filesystem against rules → service performs deletions.
- There is no evidence of a server-side backend; the app appears to be fully local/offline, with no runtime cloud dependency.
9. Platform/storage boundary
- Because the app cleans device storage, the main architectural boundary is between Android UI/process lifecycle and filesystem access.
- Any cleanup action must pass through Android’s permission/runtime constraints, which is why scanning and deletion are encapsulated in dedicated background components.
10. Resources and presentation
- The UI is classic Android XML-based layout (activity_main, fragment layouts, list item layout) with drawable icons and a dark-theme color overlay.
- The large locale set under res/values-* shows the app is heavily internationalized; translation files are part of the product architecture, not just packaging.
11. Performance layer
- The baselineprofile module contains startup benchmarks and baseline profile generation.
- This affects app startup performance at install/run time, but not business logic; it is a build-time optimization layer.
12. Build, quality, and release infrastructure
- The repo uses Gradle Kotlin DSL, Android lint, ProGuard rules, instrumented tests, and signing configuration.
- GitHub Actions workflows cover Android builds, CodeQL analysis, image optimization, and GitHub Pages/Jekyll publishing.
- Crowdin integration (crowdin.yml) indicates translation management is part of the release pipeline.
Main entry points: MainFragment.kt Cleanup home · CleanupService.kt Cleanup service · MainActivity.kt Main screen · WhitelistFragment.kt Rule editors
Components 19
App module
Primary Android application and runtime cleanup flow
- Application · Process entrypoint and global app setup
app/src/main/java/io/mdp43140/ltecleaner/App.kt - Main screen · Hosts the app shell and fragment navigation
app/src/main/java/io/mdp43140/ltecleaner/MainActivity.kt - Cleanup home · Primary user workflow for scanning and cleanup
app/src/main/java/io/mdp43140/ltecleaner/fragment/MainFragment.kt - Rule editors · Whitelist and blacklist management screens
app/src/main/java/io/mdp43140/ltecleaner/fragment/WhitelistFragment.kt - Settings · Preference and app configuration screen
app/src/main/java/io/mdp43140/ltecleaner/fragment/SettingsFragment.kt - Base fragment · Shared fragment behavior and lifecycle helpers
app/src/main/java/io/mdp43140/ltecleaner/fragment/BaseFragment.kt - List adapter · Renders rule and candidate lists
app/src/main/java/io/mdp43140/ltecleaner/fragment/ListItemAdapter.kt - File scanner · Traverses storage and classifies cleanup candidates
app/src/main/java/io/mdp43140/ltecleaner/FileScanner.kt - Cleanup service · Executes deletion work off the UI thread
app/src/main/java/io/mdp43140/ltecleaner/CleanupService.kt - Scheduled worker · Runs automated daily cleanup jobs
app/src/main/java/io/mdp43140/ltecleaner/ScheduledWorker.kt - Boot receiver · Re-arms scheduled automation after reboot
app/src/main/java/io/mdp43140/ltecleaner/BootReceiver.kt - Panic action · Alternate entrypoint for fast cleanup actions
app/src/main/java/io/mdp43140/ltecleaner/PanicResponderActivity.kt - Preferences · Persists rules, settings, and cleanup policy
app/src/main/java/io/mdp43140/ltecleaner/PreferenceRepository.kt - Prefs helper · Convenience wrapper around shared preferences access
app/src/main/java/io/mdp43140/ltecleaner/util/SharedPreferencesExtension.kt - Shared logic · Common functions and constants used by cleanup paths
app/src/main/java/io/mdp43140/ltecleaner/CommonFunctions.kt
Baseline profile
Startup performance optimization module
- Profile gen · Generates startup baseline profiles
baselineprofile/src/main/java/io/mdp43140/baselineprofile/BaselineProfileGenerator.kt - Startup bench · Measures startup behavior for profile generation
baselineprofile/src/main/java/io/mdp43140/baselineprofile/StartupBenchmarks.kt
Repo infra
Build, release, and project automation
- Android build · App module build, lint, and packaging configuration
app/build.gradle.kts - Repo CI · Build, analysis, image, and publishing workflows
.github/workflows/android.yml
Connections 23
- Application → Main screen: starts · Application launches the main UI host
- Main screen → Cleanup home: navigates · Main screen hosts the cleanup workflow
- Main screen → Rule editors: navigates · Main screen switches to rule editors
- Main screen → Settings: navigates · Main screen opens settings
- Cleanup home → File scanner: requests scan · User-initiated cleanup begins with filesystem scanning
- Cleanup home → Cleanup service: starts cleanup · Foreground workflow hands off deletion work
- Rule editors → Preferences: updates rules · Whitelist and blacklist changes are persisted locally
- Settings → Preferences: saves settings · Preference screen writes configuration state
- Preferences → Prefs helper: uses · Repository wraps shared preference storage
- File scanner → Shared logic: applies policy · Scanner uses shared constants and helper logic
- Cleanup service → File scanner: drives · Service runs scan-and-delete execution
- Cleanup service → Preferences: reads rules · Cleanup honors stored user configuration
- Scheduled worker → Cleanup service: schedules · Periodic automation triggers cleanup execution
- Boot receiver → Scheduled worker: re-arms · Boot event restores scheduled maintenance
- Panic action → Cleanup service: triggers · Auxiliary entrypoint can invoke immediate cleanup
- Base fragment → Cleanup home: shared by · Core fragment base supports the main screen
- Base fragment → Rule editors: shared by · Core fragment base supports rule screens
- Base fragment → Settings: shared by · Core fragment base supports settings screen
- Cleanup home → List adapter: renders · Main UI uses reusable list rendering
- Rule editors → List adapter: renders · Rule editors use the same list adapter
- Profile gen → Startup bench: uses · Profile generation is driven by startup benchmarks
- Android build → Repo CI: consumed by · Module build is exercised by repository automation
- Android build → Profile gen: includes · Build configuration includes baseline profile module