diff --git a/lib/clean/user.sh b/lib/clean/user.sh index 690694d..849a9bd 100644 --- a/lib/clean/user.sh +++ b/lib/clean/user.sh @@ -207,6 +207,12 @@ clean_application_support_logs() { [[ "$is_protected" == "true" ]] && continue + # Explicit safety check for System Settings / Login Items (Issue #122) + if [[ "$app_name" =~ backgroundtaskmanagement || "$app_name" =~ loginitems ]]; then + debug_log "Skipping critical system component: $app_name" + continue + fi + # Clean log directories - simple direct removal without deep scanning [[ -d "$app_dir/log" ]] && safe_clean "$app_dir/log"/* "App logs: $app_name" [[ -d "$app_dir/logs" ]] && safe_clean "$app_dir/logs"/* "App logs: $app_name" diff --git a/lib/core/app_protection.sh b/lib/core/app_protection.sh index 7704435..58570ca 100755 --- a/lib/core/app_protection.sh +++ b/lib/core/app_protection.sh @@ -24,6 +24,11 @@ readonly SYSTEM_CRITICAL_BUNDLES=( "systempreferences" "finder" "safari" + "com.apple.backgroundtaskmanagement*" + "com.apple.loginitems*" + "com.apple.sharedfilelist*" + "com.apple.sfl*" + "backgroundtaskmanagementagent" "keychain*" "security*" "bluetooth*"