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

fix: Enhance system protection by explicitly preventing cleaning of critical background task and login item components

This commit is contained in:
Tw93
2025-12-12 20:17:47 +08:00
parent 648f49d4d2
commit 3601b14dc8
2 changed files with 11 additions and 0 deletions

View File

@@ -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"

View File

@@ -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*"