mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 15:04:42 +00:00
feat: Expand critical system component protection in clean user logic and apply minor shell script fixes.
This commit is contained in:
@@ -51,7 +51,7 @@ is_safe_project_artifact() {
|
|||||||
|
|
||||||
# Must not be a direct child of HOME directory
|
# Must not be a direct child of HOME directory
|
||||||
# e.g., ~/.gradle is NOT safe, but ~/Projects/foo/.gradle IS safe
|
# e.g., ~/.gradle is NOT safe, but ~/Projects/foo/.gradle IS safe
|
||||||
local relative_path="${path#$search_path/}"
|
local relative_path="${path#"$search_path"/}"
|
||||||
local depth=$(echo "$relative_path" | tr -cd '/' | wc -c)
|
local depth=$(echo "$relative_path" | tr -cd '/' | wc -c)
|
||||||
|
|
||||||
# Require at least 1 level deep (inside a project folder)
|
# Require at least 1 level deep (inside a project folder)
|
||||||
@@ -323,6 +323,7 @@ clean_project_artifacts() {
|
|||||||
# Set up cleanup on interrupt
|
# Set up cleanup on interrupt
|
||||||
local scan_pids=()
|
local scan_pids=()
|
||||||
local scan_temps=()
|
local scan_temps=()
|
||||||
|
# shellcheck disable=SC2329
|
||||||
cleanup_scan() {
|
cleanup_scan() {
|
||||||
# Kill all background scans
|
# Kill all background scans
|
||||||
for pid in "${scan_pids[@]}"; do
|
for pid in "${scan_pids[@]}"; do
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ clean_sandboxed_app_caches() {
|
|||||||
local bundle_id_lower=$(echo "$bundle_id" | tr '[:upper:]' '[:lower:]')
|
local bundle_id_lower=$(echo "$bundle_id" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
# Check explicit critical system components (case-insensitive regex)
|
# Check explicit critical system components (case-insensitive regex)
|
||||||
if [[ "$bundle_id_lower" =~ backgroundtaskmanagement || "$bundle_id_lower" =~ loginitems ]]; then
|
if [[ "$bundle_id_lower" =~ backgroundtaskmanagement || "$bundle_id_lower" =~ loginitems || "$bundle_id_lower" =~ systempreferences || "$bundle_id_lower" =~ controlcenter || "$bundle_id_lower" =~ biometrickit || "$bundle_id_lower" =~ sfl || "$bundle_id_lower" =~ tcc ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -262,7 +262,7 @@ clean_application_support_logs() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$app_name" =~ backgroundtaskmanagement || "$app_name" =~ loginitems ]]; then
|
if [[ "$app_name_lower" =~ backgroundtaskmanagement || "$app_name_lower" =~ loginitems || "$app_name_lower" =~ systempreferences || "$app_name_lower" =~ controlcenter || "$app_name_lower" =~ biometrickit || "$app_name_lower" =~ sfl || "$app_name_lower" =~ tcc ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
2
mole
2
mole
@@ -198,7 +198,7 @@ show_version() {
|
|||||||
if command -v csrutil > /dev/null; then
|
if command -v csrutil > /dev/null; then
|
||||||
sip_status=$(csrutil status 2> /dev/null | grep -o "enabled\|disabled" || echo "Unknown")
|
sip_status=$(csrutil status 2> /dev/null | grep -o "enabled\|disabled" || echo "Unknown")
|
||||||
# Capitalize first letter
|
# Capitalize first letter
|
||||||
sip_status="$(tr '[:lower:]' '[:upper:]' <<< ${sip_status:0:1})${sip_status:1}"
|
sip_status="$(tr '[:lower:]' '[:upper:]' <<< "${sip_status:0:1}")${sip_status:1}"
|
||||||
else
|
else
|
||||||
sip_status="Unknown"
|
sip_status="Unknown"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ YELLOW='\033[1;33m'
|
|||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
echo "==============================="
|
echo "==============================="
|
||||||
echo " Mole Test Runner"
|
echo "Mole Test Runner"
|
||||||
echo "==============================="
|
echo "==============================="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user