1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:40:07 +00:00

fix(uninstall): improve LaunchServices path detection for macOS 14+

- Add fallback paths for lsregister tool
- Check executable permission before using path
This commit is contained in:
tw93
2026-02-26 11:47:46 +08:00
parent 3bd3e400b6
commit 980bbcd3c3

View File

@@ -12,7 +12,19 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# Batch uninstall with a single confirmation. # Batch uninstall with a single confirmation.
get_lsregister_path() { get_lsregister_path() {
echo "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister" local -a candidates=(
"/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"
"/System/Library/CoreServices/Frameworks/LaunchServices.framework/Support/lsregister"
)
local candidate=""
for candidate in "${candidates[@]}"; do
if [[ -x "$candidate" ]]; then
echo "$candidate"
return 0
fi
done
echo ""
return 0
} }
# High-performance sensitive data detection (pure Bash, no subprocess) # High-performance sensitive data detection (pure Bash, no subprocess)