An efficient, lightweight Xposed/LSPosed module that automatically clears application caches upon launch.
CachePurge is designed to keep your device clean and maintain storage space automatically. Instead of manually clearing caches for bloated apps, this module hooks into the application startup process and silently purges temporary files in the background.
It is built with a "Steel Core" architecture, ensuring zero impact on app startup time (Cold Start) and strict safety protocols to prevent accidental data loss.
- 🚀 Automated Cleanup: Triggers automatically when the target application starts (
Application.onCreate). - 🧹 Deep Cleaning: Removes files from:
- Internal Cache (
/data/user/0/.../cache) - External Cache (
/sdcard/Android/data/.../cache) - Code Cache (
code_cache- JIT compiled artifacts)
- Internal Cache (
- ⚡ Zero-Lag Performance:
- Runs on a dedicated Background Thread with
MIN_PRIORITY. - Does not block the UI thread or slow down app launch.
- Runs on a dedicated Background Thread with
- 🛡️ Safety First:
- Scope Isolation: Only runs on apps you explicitly select in LSPosed.
- Smart Deletion: Recursively cleans files while preserving directory structures to prevent permission errors.
- Fail-Safe: Built-in safeguards to prevent hooking into critical system processes (e.g.,
android,com.android.systemui).
- span_0Android OS: Android 11 (SDK 30) or higherspan_0.
- Root Access: Magisk or KernelSU.
- Xposed Framework: LSPosed (Zygisk or Riru variant recommended).
- Install: Download and install the
app-release.apk. - Activate: Open the LSPosed Manager notification.
- Enable: Toggle the switch to enable CachePurge.
- Scope (Crucial Step):
- Select the applications you want to auto-clean (e.g., Facebook, Instagram, TikTok, Chrome).
⚠️ WARNING: Do NOT scope "System Framework" (android) or "System UI" unless you are a developer debugging specific issues. The module has built-in protections, but it is best practice to only scope user apps.
- Reboot: Restart your device (or force stop the target apps) for changes to take effect.
Technically, CachePurge hooks the onCreate method of the android.app.Application class.
- It verifies the package name to ensure it matches the target scope.
- It spawns a low-priority daemon thread.
- It safely iterates through standard Android cache directories (
context.cacheDir,context.externalCacheDir,context.codeCacheDir) and deletes the contents.
If you need to check if the module is working or report an issue, you can view the logs via ADB or Termux (Root):
# Filter specifically for CachePurge logs
su -c "logcat -s CachePurge"