1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-08 22:34:22 +00:00

Do not clean up the system panel cache

This commit is contained in:
Tw93
2025-12-06 20:09:32 +08:00
parent 4852383767
commit cec6d7a462
2 changed files with 16 additions and 4 deletions

View File

@@ -230,6 +230,17 @@ safe_clean() {
;;
esac
# Protect system app containers from accidental cleanup
# Extract bundle ID from ~/Library/Containers/<bundle_id>/... paths
if [[ "$path" == */Library/Containers/* ]] && [[ "$path" =~ /Library/Containers/([^/]+)/ ]]; then
local container_bundle_id="${BASH_REMATCH[1]}"
if should_protect_data "$container_bundle_id"; then
debug_log "Protecting system container: $container_bundle_id"
skip=true
((skipped_count++))
fi
fi
[[ "$skip" == "true" ]] && continue
# Check user-defined whitelist