README 및 install.sh, razer-tilt.swift 파일 업데이트: 권한 설정 및 자동 재시작 로직 개선

This commit is contained in:
jsahn
2026-09-28 01:30:25 +09:00
parent a6bdd85385
commit f29845d981
3 changed files with 63 additions and 13 deletions
+9
View File
@@ -14,7 +14,13 @@ fi
if /bin/launchctl print "$service" >/dev/null 2>&1; then
/bin/launchctl bootout "$service"
fi
/bin/rm -rf -- "$app_dir"
/usr/bin/ditto "$project_dir/.build/Razer Tilt Mapper.app" "$app_dir"
# tccutil resolves the bundle ID through Launch Services, so register the new copy first.
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "$app_dir"
# Each ad-hoc build gets a new signature, so old grants go stale; clear them so re-adding is clean.
/usr/bin/tccutil reset Accessibility local.razer-tilt 2>/dev/null || true
/usr/bin/tccutil reset ListenEvent local.razer-tilt 2>/dev/null || true
# Use plutil so spaces or XML characters in the home path are encoded safely.
/usr/bin/plutil -create xml1 "$agent_file"
@@ -33,3 +39,6 @@ fi
/bin/launchctl bootstrap "gui/$(/usr/bin/id -u)" "$agent_file"
/bin/launchctl print "$service"
print "Installed: $app_dir"
# Reveal the app so it can be dragged into Input Monitoring / Accessibility.
/usr/bin/open -R "$app_dir"
/usr/bin/open "x-apple.systempreferences:com.apple.preference.security?Privacy_ListenEvent"