1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 17:55:08 +00:00
Commit Graph

1902 Commits

Author SHA1 Message Date
Tw93
1b98041e0f fix: preserve gatekeeper state in optimize 2026-03-22 19:36:54 +08:00
Tw93
0c71ee9363 fix(main): preserve versioned app names and clean mise cache 2026-03-22 14:45:21 +08:00
Tw93
dca5bd5b0e chore(release): 1.31.0 V1.31.0 2026-03-21 16:16:53 +08:00
Tw93
68a83c7862 fix(status): cache Finder probe failures to avoid repeated timeout 2026-03-21 16:06:55 +08:00
Tw93
4f178c1d7a fix(clean/uninstall): harden external cleanup accounting and relative app symlink resolution 2026-03-21 16:06:44 +08:00
Tw93
599ea21a22 perf(optime): parallelize and harden brew outdated checks 2026-03-21 16:06:37 +08:00
Tw93
c5d6cdc2f9 perf(purge/uninstall): eliminate per-item subprocess forks in scan phase
purge:
- is_safe_project_artifact: replace echo|tr|wc depth calc with pure bash
  string arithmetic (2 forks → 0 per item)
- process_scan_results: replace dirname subprocess with ${item%/*}
- is_recently_modified: accept pre-computed epoch to avoid redundant
  get_epoch_seconds call (N date forks → 1 before loop)
- fd pattern construction: replace 45 per-target sed forks with single
  printf|sed pass (45 forks → 2)
- pre-compute _cached_project_paths alongside existing name/basename
  cache so display loop avoids get_project_path subshell per item

uninstall/app-selector:
- default size display: N/A → -- for apps without cached size data
  (cleaner UX on first scan; real sizes populate from background refresh)
- Pass 1 scan: replace basename/dirname subshells with parameter expansion
2026-03-21 15:33:57 +08:00
Tw93
4f07a5aa0a perf(clean): speed up scan phase across all modules
- Parallelize project cache indicator checks and root scans in caches.sh
  (sequential find per $HOME/* dir → throttled background jobs)
- Pre-compute project name cache before purge display loop, eliminating
  O(N²) filesystem traversals in get_artifact_display_name
- Replace basename/dirname subshells with parameter expansion in
  get_project_name/get_project_path hot loops; depth counter via
  bash string arithmetic instead of echo|tr|wc|tr pipeline
- Eliminate mktemp/awk/rm per call in app_support_item_size_bytes,
  use command substitution to capture du output directly
- Defer tr lowercase in clean_application_support_logs to only when
  first 3 protection checks fail; replace basename with ${var##*/}
- Optimize trash item counting: find -print0|tr -dc '\0'|wc -c
  avoids per-file fork from -exec printf
- Add -maxdepth 5 to /private/var/folders find (X dir is always at
  depth 3, code_sign_clone at depth 5 max; verified on real machine)
2026-03-21 15:19:32 +08:00
Tw93
694c191c6f fix: correct glob expansion in downloads cleanup, add purge index bounds guard, update security audit
- lib/clean/user.sh: quote glob patterns in _clean_incomplete_downloads so
  they are not expanded at array assignment time; filenames with spaces would
  previously be word-split before reaching safe_clean, causing silent failures
- lib/clean/project.sh: replace silent array fallback with explicit bounds
  check before reading PURGE_CATEGORY_FULL_PATHS_ARRAY, guarding against
  future index drift if menu filtering is added
- SECURITY_AUDIT.md: document double validatePath in analyze delete, native
  PAM passthrough for sudo prompts, dry-run dedup by filesystem identity,
  atomic purge config write, pre-commit hook mirroring CI, and new test suites
2026-03-21 14:17:52 +08:00
Tw93
d6b9d9f3f3 Fix cleanup regressions and analyze navigation
Refs #605 #607 #608 #609 #610
2026-03-21 13:05:21 +08:00
github-actions[bot]
d51e1a621d chore: update contributors [skip ci] 2026-03-21 00:22:23 +00:00
Felix
82e25632e0 feat(status): alert on persistent high-cpu processes (#602)
* feat(status): alert on persistent high-cpu processes

* refactor(status): keep high-cpu alerts read-only

* fix(status): address lint and sudo test regressions

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-21 08:22:01 +08:00
github-actions[bot]
a99f9f97f2 chore: update contributors [skip ci] 2026-03-20 23:34:06 +00:00
Yuval Dinodia
7403f4d35e fix: pass through sudo's native prompt instead of hardcoding 'Password:' (#599)
* pass through sudo prompt instead of hardcoding Password:

* simplify: remove redundant retry loop, sudo handles retries internally

* keep stty safety net and styled prefix

* fix: clear clamshell sudo prompt lines correctly

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-21 07:33:44 +08:00
Tw93
2c2249b9a5 Merge pull request #606 from teee32/fix/status-resize-ghost-lines
refactor(status): extract view height padding helper
2026-03-21 07:19:21 +08:00
Tw93
546a5a292f test(core): fix shellcheck warnings in common bats 2026-03-21 07:18:28 +08:00
Tw93
78fe1d124a refactor(status): extract view height padding helper 2026-03-21 06:55:16 +08:00
github-actions[bot]
e3a4fa2bbd chore: update contributors [skip ci] 2026-03-20 22:46:19 +00:00
Tw93
bc8424607f Merge pull request #601 from sibisai/fix/status-resize-ghost-lines
fix(status): pad View output to terminal height to prevent ghost lines on resize
2026-03-21 06:46:01 +08:00
sibisai
02c0e1e78a fix(status): pad View output to terminal height to prevent ghost lines on resize 2026-03-19 18:38:09 -07:00
Tw93
c0dabc1ffb Merge pull request #596 from fishwww-ww/docs/security-audit-update
docs(security): polish wording in SECURITY_AUDIT
2026-03-19 14:21:03 +08:00
Tw93
6e1dfd20e7 fix(status): correct external disk capacity totals 2026-03-19 13:33:22 +08:00
fishwww-ww
61da2dcdc5 docs(security): polish wording in SECURITY_AUDIT 2026-03-19 11:41:29 +08:00
Tw93
584e10cdc4 fix(log): preserve Mole runtime logs during clean 2026-03-19 09:52:27 +08:00
Tw93
3b46b4ade6 fix(ui): use system sleep for inline spinner 2026-03-19 00:40:39 +08:00
Tw93
821a824d81 fix: dedupe cleanup previews by filesystem identity 2026-03-19 00:32:28 +08:00
github-actions[bot]
03db800709 chore: update contributors [skip ci] 2026-03-18 16:28:53 +00:00
Jason Costello
e617ed2e76 Fix: Removed duplicate calls to clean_xcode_tools and clean_code_editors (#593)
* removed duplicate calls to clean_xcode_tools and clean_code_editors

in lib/clean/app_caches.sh clean_user_gui_application() was making calls
to clean_xcode_tools and clean_code_editors.

in lib/clean/dev.sh clean_xcode_tools and clean_code_editors was also
being called, causing the duplication when executing the clean command.

removed the calls from lib/clean/app_caches.sh
clean_user_gui_application since these two calls are developer focused.

* test: cover removed developer app calls

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-19 00:25:49 +08:00
Tw93
06d2a3d029 fix: keep tealdeer tldr pages cache 2026-03-19 00:24:54 +08:00
Tw93
88521a14c2 fix: remove jq dependency from optimize command (#588)
Replace jq with bash-native JSON parsing helpers (json_get_value,
json_validate, parse_optimization_items) so that mo optimize no
longer requires jq to be installed.

Closes #588
2026-03-18 17:36:39 +08:00
Tw93
6e1048a70a Revert "fix(ui): unify ICON_LIST dot size with ICON_SOLID"
This reverts commit 112d134829.
2026-03-18 15:24:07 +08:00
github-actions[bot]
dda9ee9c4a chore: update contributors [skip ci] 2026-03-18 07:17:29 +00:00
Tw93
112d134829 fix(ui): unify ICON_LIST dot size with ICON_SOLID
Change ICON_LIST from • (small bullet) to ● (filled circle) so both
checkbox indicators and list bullets render at the same balanced size.
2026-03-18 15:17:03 +08:00
Tw93
49c16a3450 Merge branch 'bugfix/fix-software-update-available-false-positive'
# Conflicts:
#	lib/check/all.sh
#	tests/clean_system_maintenance.bats
2026-03-18 15:05:37 +08:00
Tw93
90949f7fdf test(purge): fix glob quoting in path assertion 2026-03-18 14:55:26 +08:00
Tw93
702f299e78 fix(ui): rename Filter to Search in paginated menu 2026-03-18 14:55:20 +08:00
Tw93
5a2a5d9179 fix(uninstall): detect bundle-id-derived extension leftovers
Scan Application Scripts, Containers and FileProvider directories for
entries that share the app bundle-id prefix (e.g. share extensions,
file-provider extensions) so they are included in uninstall cleanup.
2026-03-18 14:54:59 +08:00
Tw93
fa935548b0 fix(optimize): warn before bluetooth refresh
Show "Bluetooth devices may disconnect briefly during refresh" before
actually restarting bluetoothd, so the user is not surprised by a
momentary disconnect.
2026-03-18 14:50:04 +08:00
Tw93
b8f3a0ecd3 fix(clean): avoid container cache scan stalls
Add a lightweight top-level entry cap to Containers and Group
Containers scanning.  When a cache directory exceeds the threshold,
skip the expensive per-item du/find size scan and take a partial-size
/ "cleaned" output path instead.  Replace find-piped-to-read loops
with pure-bash glob iteration to cut external process overhead.

Closes #586
2026-03-18 14:49:12 +08:00
Tw93
f88b2116ab fix(check): use softwareupdate output for macOS update detection
Replace LastRecommendedUpdatesAvailable defaults check with unified
softwareupdate -l --no-scan parsing.  Add caching layer and teach the
parser to distinguish macOS updates, Background Security Improvements,
Rapid Security Responses, and non-macOS entries so each gets an
accurate title in the output.

Fix reset_softwareupdate_cache() to also reset the in-memory
SOFTWARE_UPDATE_LIST_LOADED flag, and add a regression test.

Closes #585
2026-03-18 14:48:39 +08:00
corevibe555
2d8c938333 trust softwareupdate for macOS status and harden tests 2026-03-18 04:59:33 +01:00
root
e6ee9ec490 fix macOS update false positives 2026-03-18 03:15:39 +01:00
Tw93
25892594b0 fix: show full purge paths during confirmation
Fixes #576
2026-03-17 19:20:32 +08:00
dependabot[bot]
13274154d4 chore(deps): bump actions/download-artifact from 8.0.0 to 8.0.1 (#580)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](70fc10c6e5...3e5f45b2cf)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-17 16:52:06 +08:00
dependabot[bot]
f461ab77f4 chore(deps): bump softprops/action-gh-release from 2.5.0 to 2.6.1 (#579)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.5.0 to 2.6.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](a06a81a03e...153bb8e044)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-17 16:51:51 +08:00
Tw93
6c53906427 fix brew uninstall fallback consistency 2026-03-17 16:39:42 +08:00
Tw93
e1f427c9aa fix: stop cleaning aerial wallpaper assets by default 2026-03-17 16:35:10 +08:00
Tw93
ea4cd9d0e3 fix(tests): prevent permission dialogs during test runs
Add MOLE_TEST_MODE=1 checks to skip AppleScript osascript calls
and sudo operations that trigger system permission dialogs during tests:

- lib/check/all.sh: Skip login items listing
- lib/clean/apps.sh: Skip running app detection
- lib/clean/user.sh: Skip Finder trash operations and sudo test calls
- lib/core/log.sh: Skip sudo status check in debug log
- lib/uninstall/batch.sh: Skip login item removal

Also add MOLE_TEST_MODE=1 export to all test files that load
these modules to ensure consistent test isolation.
2026-03-16 20:43:35 +08:00
Tw93
0cc4862f9c fix(touchid): add Q key support to quit menu
Allow users to press 'q' or 'Q' to quit the Touch ID setup menu,
in addition to ESC key. This fixes the "Invalid key" error when
users press Q as suggested by the prompt.

Fixes #575
2026-03-16 20:19:32 +08:00
Tw93
cfa0a82057 fix: skip incomplete downloads that are actively in use
Before deleting .download/.crdownload/.part files, check lsof to
detect open file handles. Files held by an active browser process
are skipped with a warning instead of being deleted.

Fixes a case where a 12GB IPSW being downloaded in Safari was
removed mid-download because the .download bundle matched the glob.
2026-03-16 07:39:41 +08:00