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:
@@ -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"
|
||||
|
||||
@@ -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*"
|
||||
|
||||
Reference in New Issue
Block a user