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

feat: Enhance clean protection by explicitly excluding critical system components and adding case-insensitive bundle ID checks.

This commit is contained in:
Tw93
2025-12-17 18:59:36 +08:00
parent 825992cdbb
commit 278cc4a565

View File

@@ -118,8 +118,17 @@ clean_sandboxed_app_caches() {
# Extract bundle ID and check protection status early
local bundle_id=$(basename "$container_dir")
local bundle_id_lower=$(echo "$bundle_id" | tr '[:upper:]' '[:lower:]')
# Check explicit critical system components (case-insensitive regex)
if [[ "$bundle_id_lower" =~ backgroundtaskmanagement || "$bundle_id_lower" =~ loginitems ]]; then
continue
fi
if should_protect_data "$bundle_id"; then
continue
elif should_protect_data "$bundle_id_lower"; then
continue
fi
local cache_dir="$container_dir/Data/Library/Caches"