Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions Snapzy/Services/AppIdentity/AppIdentityManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,22 @@ final class AppIdentityManager: ObservableObject {
issues.append(.unexpectedBundleIdentifier(Bundle.main.bundleIdentifier))
}

if quarantined && !bundleURL.path.hasPrefix("/Applications/") {
issues.append(.outsideApplications(bundleURL))
}

// Quarantine flag check: Only flag as an issue if the app is running from
// outside standard Applications folders. Homebrew Cask upgrades (`brew upgrade`)
// use command-line `mv`/`cp` which preserves the quarantine xattr even after
// the app is placed in /Applications. Since the app is Apple Notarized, macOS
// Gatekeeper handles the quarantine-to-clearance flow automatically on first
// launch. Flagging quarantine inside /Applications would be a false positive
// that blocks permissions after every Cask upgrade (see issue #337).
if quarantined {
issues.append(.quarantined)
let homePath = NSHomeDirectory()
let isInsideApplications =
bundleURL.path.hasPrefix("/Applications/")
|| bundleURL.path.hasPrefix("\(homePath)/Applications/")
if !isInsideApplications {
issues.append(.outsideApplications(bundleURL))
issues.append(.quarantined)
}
}

// Skip strict signature validation in debug builds — Xcode uses ad-hoc
Expand Down
Loading