mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 09:23:31 +00:00
feat: Add com.apple.finder cache to cleaning, protect specific apps from critical cleaning, implement login item whitelist checks
This commit is contained in:
@@ -223,7 +223,7 @@ safe_clean() {
|
|||||||
|
|
||||||
# Hard-coded protection for critical apps (cannot be disabled by user)
|
# Hard-coded protection for critical apps (cannot be disabled by user)
|
||||||
case "$path" in
|
case "$path" in
|
||||||
*clash* | *Clash* | *surge* | *Surge* | *mihomo* | *openvpn* | *OpenVPN* | *verge* | *Verge* | *shadowsocks* | *Shadowsocks* | *v2ray* | *V2Ray* | *sing-box* | *tailscale* | *nordvpn* | *NordVPN* | *expressvpn* | *ExpressVPN* | *protonvpn* | *ProtonVPN* | *mullvad* | *Mullvad* | *hiddify* | *Hiddify* | *loon* | *Loon* | *Cursor* | *cursor* | *Claude* | *claude* | *ChatGPT* | *chatgpt* | *Ollama* | *ollama* | *lmstudio* | *Chatbox* | *Gemini* | *gemini* | *Perplexity* | *perplexity* | *Windsurf* | *windsurf* | *Poe* | *poe* | *DiffusionBee* | *diffusionbee* | *DrawThings* | *drawthings*)
|
*clash* | *Clash* | *surge* | *Surge* | *mihomo* | *openvpn* | *OpenVPN* | *verge* | *Verge* | *shadowsocks* | *Shadowsocks* | *v2ray* | *V2Ray* | *sing-box* | *tailscale* | *nordvpn* | *NordVPN* | *expressvpn* | *ExpressVPN* | *protonvpn* | *ProtonVPN* | *mullvad* | *Mullvad* | *hiddify* | *Hiddify* | *loon* | *Loon* | *Cursor* | *cursor* | *Claude* | *claude* | *ChatGPT* | *chatgpt* | *Ollama* | *ollama* | *lmstudio* | *Chatbox* | *Gemini* | *gemini* | *Perplexity* | *perplexity* | *Windsurf* | *windsurf* | *Poe* | *poe* | *DiffusionBee* | *diffusionbee* | *DrawThings* | *drawthings* | *Aerial* | *aerial* | *Fliqlo* | *fliqlo* | *com.apple.finder*)
|
||||||
skip=true
|
skip=true
|
||||||
((skipped_count++))
|
((skipped_count++))
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ declare -a DEFAULT_WHITELIST_PATTERNS=(
|
|||||||
"$HOME/Library/Caches/org.R-project.R/R/renv/*"
|
"$HOME/Library/Caches/org.R-project.R/R/renv/*"
|
||||||
"$HOME/Library/Caches/JetBrains*"
|
"$HOME/Library/Caches/JetBrains*"
|
||||||
"$HOME/Library/Caches/com.jetbrains.toolbox*"
|
"$HOME/Library/Caches/com.jetbrains.toolbox*"
|
||||||
|
"$HOME/Library/Caches/com.apple.finder"
|
||||||
"$FINDER_METADATA_SENTINEL"
|
"$FINDER_METADATA_SENTINEL"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ fix_broken_login_items() {
|
|||||||
local launch_agents_dir="$HOME/Library/LaunchAgents"
|
local launch_agents_dir="$HOME/Library/LaunchAgents"
|
||||||
[[ -d "$launch_agents_dir" ]] || return 0
|
[[ -d "$launch_agents_dir" ]] || return 0
|
||||||
|
|
||||||
|
# Check whitelist
|
||||||
|
if command -v is_whitelisted > /dev/null && is_whitelisted "check_login_items"; then return 0; fi
|
||||||
|
|
||||||
local broken_count=0
|
local broken_count=0
|
||||||
|
|
||||||
while IFS= read -r plist_file; do
|
while IFS= read -r plist_file; do
|
||||||
|
|||||||
2
mole
2
mole
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/lib/core/common.sh"
|
source "$SCRIPT_DIR/lib/core/common.sh"
|
||||||
|
|
||||||
# Version info
|
# Version info
|
||||||
VERSION="1.13.0"
|
VERSION="1.13.1"
|
||||||
MOLE_TAGLINE="can dig deep to clean your Mac."
|
MOLE_TAGLINE="can dig deep to clean your Mac."
|
||||||
|
|
||||||
# Check if Touch ID is already configured
|
# Check if Touch ID is already configured
|
||||||
|
|||||||
Reference in New Issue
Block a user