From 278cc4a565c4d0cc6e0728eec57e284390d2866a Mon Sep 17 00:00:00 2001 From: Tw93 Date: Wed, 17 Dec 2025 18:59:36 +0800 Subject: [PATCH] feat: Enhance clean protection by explicitly excluding critical system components and adding case-insensitive bundle ID checks. --- lib/clean/user.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/clean/user.sh b/lib/clean/user.sh index 53b9fdd..06e9c7a 100644 --- a/lib/clean/user.sh +++ b/lib/clean/user.sh @@ -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"