1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 14:26:46 +00:00
Commit Graph

498 Commits

Author SHA1 Message Date
dekran
dcac6a3391 fix: handle dotfiles in Trash cleanup (#395)
Replace glob pattern with find command to properly clean dotfiles
in Trash when osascript fallback is used. The old pattern
~/.Trash/* does not match files starting with "." in bash.

This fix ensures that hidden files like .DS_Store, .hidden_file,
etc. are properly removed when cleaning the Trash.
2026-01-31 17:37:22 +08:00
tw93
8b9436e244 feat(check): detect third-party firewalls before built-in check
(#374)

    Support Little Snitch, LuLu, Radio Silence, Hands Off!, Murus, Vallum.
2026-01-27 20:04:29 +08:00
tw93
37e6994c34 feat(clean): add Yandex Browser cache cleanup support 2026-01-27 11:34:21 +08:00
tw93
3919a70300 fix: enhance uninstall security per audit review
- Validate bundle_id format (reverse-DNS) in stop_launch_services() to prevent glob injection attacks
    - Add common word exclusion list for LaunchAgents name search to avoid false positive matches (Music, Notes, Photos, etc.) - Add security comments explaining symlink handling in remove_file_list()
    - Improve brew_uninstall_cask() timeout handling: exit code 124 now returns failure immediately
    - Update SECURITY_AUDIT.md with remediation details
2026-01-26 20:27:46 +08:00
tw93
0fbf88a6c6 fix: harden cleanup path validation 2026-01-26 15:43:11 +08:00
Tw93
587b127c01 chore: auto format code 2026-01-26 07:24:38 +00:00
tw93
610a4fc0a7 chore: simplify optimize maintenance cleanup 2026-01-26 15:22:20 +08:00
tw93
864bade7c6 fix: improve uninstall guidance and timeouts 2026-01-26 15:22:16 +08:00
tw93
8c4cd7f82e feat: log cleanup operations for troubleshooting 2026-01-26 15:22:07 +08:00
tw93
e0aba780c8 feat: remove automatic Rosetta 2 installation prompt
- Change Rosetta 2 status from warning to info
- Remove auto-fix suggestion for missing Rosetta 2
- Update tests to reflect new behavior (3 -> 2 expected fixes)
2026-01-26 14:36:12 +08:00
tw93
e966838c82 style: standardize punctuation across codebase
- Replace parentheses with commas for supplementary info
- Use commas instead of em-dashes for separators
- Update bullet points from - to * in some contexts
- Improve version extraction regex with fallback logic
2026-01-26 14:36:06 +08:00
tw93
b8c25e4056 fix: improve cleanup code and fix Edge test isolation
- Refactor JetBrains Toolbox cleanup with _restore_whitelist helper
- Add MOLE_EDGE_APP_PATHS env var for test isolation
- Fix Edge old versions tests to avoid scanning system Edge installation
2026-01-26 11:09:38 +08:00
TomP0
61723e8d86 fix: handle empty arrays in clean_dev_jetbrains_toolbox (#361)
Add checks for empty product_dirs and version_dirs arrays before
iterating to prevent "unbound variable" errors when running with
set -u (pipefail) and the JetBrains Toolbox directory doesn't exist
or contains no products.
2026-01-26 10:49:30 +08:00
Tw93
5a29f506dc chore: auto format code 2026-01-26 02:46:32 +00:00
tw93
ee32a63673 Merge branch 'main' of https://github.com/tw93/Mole 2026-01-26 10:45:32 +08:00
tw93
e803c46304 style: unify DRY_RUN variable check in trash cleanup 2026-01-26 10:44:36 +08:00
Tw93
4bacba7fec chore: auto format code 2026-01-26 02:28:41 +00:00
Andrei Murariu
89eb442866 bug-fix: add automatic trash emptying to clean command (#363)
- Empty trash using macOS Finder API (osascript) for proper permission handling
- Respects whitelist protection (skips if Trash is whitelisted)
- Shows item count when emptying trash
- Fallback to direct cleanup if Finder API fails
- Supports dry-run mode

Issue: #362
2026-01-26 10:28:03 +08:00
Tw93
a4f1f49fab feat: improve version detection and error handling
- Add fallback to mo --version when brew list fails
- Add error handling for debug log write failures
- Improve version extraction with multiple fallback strategies
2026-01-23 22:25:35 +08:00
Tw93
83166f2fe8 fix: avoid orphan service false positives and warm large file threshold 2026-01-23 20:16:06 +08:00
Tw93
500b6dc554 fix(clean): silence ShellCheck SC2053 2026-01-23 18:32:33 +08:00
Tw93
d7a0d480bc fix: improve dry-run mode and error handling
- Export MOLE_DRY_RUN env var for subprocess visibility
- Add || true to grep commands to prevent pipeline failures
- Add dry-run test for clean_orphaned_system_services
- Simplify clean_local_snapshots tests
2026-01-23 18:05:09 +08:00
Tw93
8c9cd1f90c feat(clean): add JetBrains Toolbox old IDE cleanup with whitelist-safe handling 2026-01-23 17:37:37 +08:00
Tw93
1ad7d7e79b refactor: simplify Puppeteer cache cleanup to match browser cache pattern
- Replace 48-line custom function with one-line safe_clean call
- Remove unnecessary interactive confirmation (consistent with other browser caches)
- Simplify tests to verify Puppeteer cache is in clean_browsers output
- Net: -93 lines of code for same functionality
2026-01-23 09:56:14 +08:00
Shakeel Mohamed
5a8d766667 Add Puppeteer cache cleanup (#353) 2026-01-23 09:55:02 +08:00
Tw93
be2e9ddeca change reminder icon to be more comfortable 2026-01-23 09:33:12 +08:00
Tw93
cde39aaeb2 feat(clean): add large file review and unify warnings 2026-01-22 20:15:13 +08:00
Tw93
9d824d0ad2 fix: restore uninstall traps and remove dead search key 2026-01-22 17:45:53 +08:00
Tw93
8188f4b81b fix: clean update packages with SIP enabled 2026-01-22 16:16:50 +08:00
Tw93
6817f93075 Merge branch 'main' of github.com:tw93/Mole 2026-01-20 15:10:05 +08:00
Tw93
3f85c8238f Use gray color for warning icons to reduce visual noise 2026-01-20 15:07:37 +08:00
Tw93
58522b4f90 Fix undefined ICON_INFO variable 2026-01-20 15:03:08 +08:00
Tw93
a96e53d988 chore: auto format code 2026-01-20 06:46:06 +00:00
Tw93
acdf40dd2c Unify output format for multiple versions check 2026-01-20 14:44:11 +08:00
Tw93
b4b9b0c474 Add cleanup for orphaned system services
Detect and remove leftover LaunchDaemons, LaunchAgents, and
PrivilegedHelperTools from uninstalled apps like Sogou Input,
ClashX, ClashMac, and Nektony App Cleaner.
2026-01-20 14:25:32 +08:00
Tw93
d044b2876e Fix unable to uninstall data-protected apps like Clash Party
Previously, apps matching DATA_PROTECTED_BUNDLES patterns (VPNs, dev tools, etc.)
could not be uninstalled because should_protect_path blocked their deletion.
Now use MOLE_UNINSTALL_MODE to distinguish between cleanup and explicit uninstall,
allowing users to remove these apps when they choose to while still protecting
their data during normal cleanup operations.

Also allow deletion of installer receipts in /private/var/db/receipts/.
2026-01-20 11:54:17 +08:00
Tw93
127e589291 Fix test error case 2026-01-20 10:26:13 +08:00
Tw93
4d16db926d Merge branch 'main' of github.com:tw93/Mole 2026-01-19 17:08:54 +08:00
Tw93
2d5ccf5d71 fix: exclude Flutter/CocoaPods/Pub caches from cleanup (#334)
Prevent forced re-downloads and re-installations by not cleaning:
- ~/Library/Caches/CocoaPods (spec repo cache)
- ~/.cache/flutter (engine/artifacts cache)
- ~/.pub-cache (Dart package cache)

Also standardize redirection syntax to '> /dev/null' for consistency.

Fixes #334
2026-01-19 17:08:35 +08:00
Tw93
cec385efc7 chore: auto format code 2026-01-19 08:54:45 +00:00
Tw93
d25c9f7637 refactor(uninstall): remove search and optimize scan performance
- Remove complex search/filter feature from menu (simplify UX)
  - Optimize Homebrew cask detection (only check Caskroom symlinks)
  - Cache whoami outside loop, use bash parameter expansion
  - Fix spinner overlap with error messages
  - Add trap for Ctrl+C cleanup
  - Use ICON_ERROR for failure messages
2026-01-19 16:53:51 +08:00
Tw93
72f42a363e chore: remove redundant sensors card and bump version to 1.22.1
- Disable sensors data collection (CPU temp already shown in CPU card)
- Remove unused sensor-related functions (collectSensors, prettifyLabel, hasSensorData, renderSensorsCard)
- Remove unused gopsutil/sensors import
- Fix inline spinner disown call with explicit PID
- Update version from 1.22.0 to 1.22.1
- Update SECURITY_AUDIT.md to match new version and date
2026-01-17 10:46:11 +08:00
Tw93
46472bc86e chore: auto format code 2026-01-17 02:13:54 +00:00
Tw93
e6fc0613d5 perf: improve cleanup UI responsiveness and reduce visual flicker
- Speed up spinner animation from 100ms to 50ms for smoother visuals
- Fix spinner flicker by deferring stop until output is ready
- Remove unnecessary 'Preparing...' spinner at section start
- Hide whitelist-protected items from output (Trash, Finder metadata)
- Add spinner feedback for system diagnostic log cleanup
- Remove redundant stop_section_spinner calls in cleanup modules

The cleanup process now feels significantly faster and more polished,
with continuous visual feedback and no jarring gaps between operations.
2026-01-17 10:12:23 +08:00
Tw93
b9072c2389 chore: auto format code 2026-01-17 01:59:47 +00:00
Tw93
234dad5531 Merge branch 'main' of github.com:tw93/Mole 2026-01-17 09:58:13 +08:00
Tw93
bacc782e41 ShellCheck SC2001 Warning 2026-01-17 09:58:08 +08:00
Tw93
fe296de814 chore: auto format code 2026-01-17 01:53:40 +00:00
Tw93
060c48c48d refactor: enhance uninstall safety and fix dock removal
- Add symlink/bundle_id/BOM validation to prevent injection attacks
- Fix Dock removal for /Applications symlink (use pwd not pwd -P)
- Fix brew uninstall test hanging (skip sudo in non-interactive mode)
- Remove unused SENSITIVE_DATA_REGEX
2026-01-17 09:49:42 +08:00
Tw93
12cacaa6cc refactor: enhance pattern detection and symlink safety
- Expand sensitive data patterns (credentials, cloud configs, media folders)
- Add symlink target validation in path deletion checks
- Remove shared Gradle cache from Android Studio cleanup
2026-01-17 09:09:11 +08:00