Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Banner for GenaCleaner

Deep Android cleaning via ADB — a gorgeous, modular TUI

Platform Rust TUI License


Clean ALL the caches. Keep ALL your data. Watch it happen live.

✨ Features

  • 📱 Device management — pair devices over USB (serial) or Wi-Fi (IP:port), persisted in a config file (~/.config/genacleaner/devices.json or %APPDATA%\genacleaner\devices.json). Live connection status every 2 s: ● connected / ○ disconnected. Add (a), remove (d), save detected devices (g), connect Wi-Fi (c) and refresh (r).
  • 🧹 Deep cleaning that never touches user data
    1. Cache of every installed app with pm clear --cache-only (only each app's cache directory — never app data).
    2. Residual & shared caches swept with cmd package trim-caches.
    3. System logs (logcat -c) and temp files (/data/local/tmp).
    4. With root (emulator, userdebug build, or Magisk/KernelSU): crash residue (tombstones / ANR / dropbox) plus regenerable system caches (package_cache, /cache, /data/cache).
  • 🎨 Spectacular real-time TUI
    • Animated ASCII title with 3D shadow and slowly cycling colors.
    • Progress bar on top with the current phase (package n/m).
    • Two huge block-font indicators, updated constantly:
      • Free space with a green arrow and the % gained by the cleanup.
      • Freed this session, ticking up step by step.
    • Styled log console (colors per type: step ✓ ok ⚠ warn ✗ error, items).
  • ⚡ Threaded pipeline — the cleaner runs on its own thread and streams events to the UI through an mpsc channel; the UI never blocks.

🖼️ The TUI at a glance

Real captures rendered by the app itself (genacleaner --screenshot).

Devices view — animated title, live connection status
                     ██████         ████         ██████ ██                    ████                                    
                     █      ██████ █    █  ████  █      ██     ██████  ████  █    █ ██████ ████                       
                     █      █    █ █    █ █    █ █      ██     █    █ █    █ █    █ █    █ █   █                      
                     █ ████ █    █ █    █ █    █ █      ██     █    █ █    █ █    █ █    █ █   █                      
                     █    █ ██████ █    █ ██████ █      ██     ██████ ██████ █    █ ██████ ██                         
                     █    █ █      █    █ █    █ █      ██     █      █    █ █    █ █      █                          
                     █    █ █    █ █    █ █    █ █      ██     █    █ █    █ █    █ █    █ █                          
                     ██████ ██████ █    █  ████  ██████ ██████ ██████  ████  █    █ ██████ █                          
                                                                                                                      
                                            DEEP ANDROID CLEANER · VIA ADB                                            
● adb available  ·  Android Debug Bridge version 1.0.41                                                               
Connect a device or press [a] to add one                                                                              
┌ DEVICE LIST ───────────────────────────────────────────────────────────────────────────────────────────────────────┐
│▸ ◉ Pixel 8  (RF8N1234567) [usb] — connected                                                                        │
│  ○ Mi Phone  (192.168.1.42:5555) [wifi] — disconnected                                                             │
│  ◉ sdk_gphone64_x86_64  (emulator-5554) [usb] — connected  [detected · g to save]                                  │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
 ↑/↓ move · [Enter] clean · [a] add · [d] remove · [g] save detected · [c] connect Wi-Fi · [r] refresh · [q] quit     
Cleaning view — progress bar, big indicators, styled console
 GenaCleaner — Deep Clean ◉ Pixel 8 (RF8N1234567) · no root                                                           
┌ PROGRESS ──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│██████████████████████████████████████ Clearing app caches (132/280) ◐ — 47%                                        │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌ FREE SPACE ─────────────────────────────────────────────┐┌ FREED THIS SESSION ─────────────────────────────────────┐
│Current free space                                       ││Space freed by GenaCleaner                               │
│  █     █         █████  ███         ████ ████           ││  █          ███   ███         ████ ████                 │
│ ██    ██         █     █   █       █     █   █          ││ ██         █   █ █   █       █     █   █                │
│  █     █         ████  █   █       █     █   █          ││  █         █   █     █       █     █   █                │
│  █     █             █  ████       █ ███ ████           ││  █         █   █    █        █ ███ ████                 │
│  █     █             █     █       █   █ █   █          ││  █         █   █   █         █   █ █   █                │
│  █     █     ██  █   █     █       █   █ █   █          ││  █     ██  █   █  █          █   █ █   █                │
│ ███   ███    ██   ███   ███         ███  ████           ││ ███    ██   ███  █████        ███  ████                 │
│▲ +2.1% thanks to cleanup                                ││cleanup in progress…                                     │
└─────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────┘
┌ CONSOLE ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│[00:42] ▸ === Deep cleanup started ===                                                                              │
│[00:42]   Initial free space: 11.90 GB                                                                              │
│[00:43] ✓ Root access obtained: extended cleanup enabled                                                            │
│[00:43] ▸ App caches — 280 packages                                                                                 │
│[00:43]   Cache of com.google.android.youtube — 1.2 GB cleared                                                      │
│[00:43]   Cache of com.instagram.android — 512 MB cleared                                                           │
│[00:44]   Cache of com.spotify.music — 340 MB cleared                                                               │
│[00:44] ⚠ com.example.broken: Failed                                                                                │
│[00:44] ✓ Cache progress: +2.10 GB                                                                                  │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
 [Esc] devices · [q] quit                                                                                             

Regenerate them anytime with cargo run -- --screenshot.

🚀 Quick start

Prerequisites

  • Rust (edition 2021, MSRV ~1.85+).
  • ADB (Android platform-tools) on your PATH, or point to the binary with the GENACLEANER_ADB environment variable.
  • On the phone: enable Developer options → USB debugging (and Wireless debugging for Wi-Fi).

Build & run

# Linux / macOS-style shells
cargo build --release
./target/release/genacleaner
# Windows (PowerShell)
cargo build --release
.\target\release\genacleaner.exe

Cross-compile from Windows to Linux:

rustup target add x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu   # needs a cross linker
cargo check --target x86_64-unknown-linux-gnu             # type-check only

🎮 Usage

View Key Action
Devices / (or k/j) Move through the list
Devices Enter Select device and start the deep clean
Devices a Add device (USB serial or IP:port for Wi-Fi)
Devices d Remove a saved device
Devices g Save a detected device to the list
Devices c Connect a saved Wi-Fi device
Devices r Refresh connection status
Cleaning Enter/s Start / rerun the cleanup
Anywhere Esc Back to the device list
Anywhere q / Ctrl+C Quit

📡 Wi-Fi setup (once per device)

  1. On the phone: Settings → Developer options → Wireless debugging → enable and note the IP:port.
  2. In GenaCleaner press a and enter IP:port (e.g. 192.168.1.42:5555). The device is saved and auto-connects on startup.

🧹 How the cleaning works (and why your data is safe)

What gets cleaned Command Touches user data?
Every app cache pm clear --cache-only <pkg> ❌ No — only the app's cache/ dir
Residual/shared caches cmd package trim-caches ❌ No
System logs logcat -c ❌ No
Shell/adb temp files rm -rf /data/local/tmp/* ❌ No
Tombstones / ANR / dropbox (root) rm -rf /data/tombstones/* … ❌ No
System caches (root) rm -rf /data/system/package_cache/* /cache/* … ❌ No

🔒 Core guarantee: pm clear --cache-only was designed by Android to clear only the cache. GenaCleaner never runs plain pm clear — which would wipe app data. What gets freed is regenerable: caches, logs, temp files and crash residue.

🗂️ Project structure

src/
├── main.rs         # entry point, event loop, terminal guard
├── tui.rs          # terminal setup/restore (crossterm)
├── app.rs          # app state & TUI state machine
├── adb.rs          # adb command wrapper
├── cleaner.rs      # cleaning pipeline (own thread, progress events)
├── config.rs       # saved-device persistence (JSON)
├── screenshots.rs  # dev tool: real UI captures via TestBackend
└── ui/
    ├── mod.rs       # general rendering, banner & input modals
    ├── banner.rs    # big block-font title, animated colors + shine
    ├── devices.rs   # device list view
    ├── clean.rs     # cleaning view (bar, indicators, console)
    └── bigtext.rs   # 5×7 block font for the big indicators

assets/            # icon.png · icon.ico · github-banner.png (scripts/gen_icons.py)
packaging/         # genacleaner.desktop (Linux launcher entry)
scripts/           # gen_icons.py · install.sh
screenshots/       # real UI captures (cargo run -- --screenshot)
.github/workflows/ # release.yml (Windows .exe + Linux tarball)

📜 License

MIT

About

Deep Android cleaning via ADB — a gorgeous, modular TUI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages