From a6931dab5b15a082012036bea150e6fcffd2afe9 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 14 Mar 2026 23:20:18 +0800 Subject: [PATCH] fix: clean HTTPStorages binarycookies files and Preferences directories on uninstall Add ~/Library/HTTPStorages/.binarycookies to targeted uninstall cleanup. WKWebView creates both a directory and a .binarycookies file under HTTPStorages; only the directory was previously covered. Affected apps include cmux (com.cmuxterm.app) and Tuna (com.brnbw.Tuna). Also add ~/Library/Preferences/ directory detection for apps like VLC (org.videolan.vlc) that store preferences in a directory rather than a .plist file. --- lib/core/app_protection.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/core/app_protection.sh b/lib/core/app_protection.sh index d4c732f..400203b 100755 --- a/lib/core/app_protection.sh +++ b/lib/core/app_protection.sh @@ -950,6 +950,7 @@ find_app_files() { "$HOME/Library/WebKit/$bundle_id" "$HOME/Library/WebKit/com.apple.WebKit.WebContent/$bundle_id" "$HOME/Library/HTTPStorages/$bundle_id" + "$HOME/Library/HTTPStorages/$bundle_id.binarycookies" "$HOME/Library/Cookies/$bundle_id.binarycookies" "$HOME/Library/LaunchAgents/$bundle_id.plist" "$HOME/Library/Application Scripts/$bundle_id" @@ -1044,6 +1045,7 @@ find_app_files() { # Handle Preferences and ByHost variants (only if bundle_id is valid) if [[ -n "$bundle_id" && "$bundle_id" != "unknown" && ${#bundle_id} -gt 3 ]]; then [[ -f ~/Library/Preferences/"$bundle_id".plist ]] && files_to_clean+=("$HOME/Library/Preferences/$bundle_id.plist") + [[ -d ~/Library/Preferences/"$bundle_id" ]] && files_to_clean+=("$HOME/Library/Preferences/$bundle_id") [[ -d ~/Library/Preferences/ByHost ]] && while IFS= read -r -d '' pref; do files_to_clean+=("$pref") done < <(command find ~/Library/Preferences/ByHost -maxdepth 1 \( -name "$bundle_id*.plist" \) -print0 2> /dev/null)