Post

Replies

Boosts

Views

Activity

macOS 27.3: which keyboard-event APIs trigger "System & App Protection Override" for an assistive text expander?
I make a sandboxed Mac App Store text expander, used by many people as an assistive tool: people with motor and neurological conditions type a short abbreviation and get the full text. On a fresh install under macOS 27.3 beta 2, turning on abbreviation expansion brings up the "System & App Protection Override" dialog. Before the user can allow anything, it lists Read, Change, Delete, and Export All Your Data; View Hidden and Recently Deleted Photos; View History and Browse As You; Control Your Mac, Apps, and Settings; and Read and Monitor Everything. My app uses none of that, and for users who rely on it as assistive technology, the dialog reads as a warning to avoid the app. What I actually use: An active CGEventTap at kCGSessionEventTap (keyDown/keyUp/mouse-up) that keeps a short in-memory buffer of the current word. It briefly holds back and replays keystrokes during an expansion, and consumes the trigger key. A listen-only tap at kCGAnnotatedSessionEventTap, reading only kCGEventTargetUnixProcessID. CGEventPost to send backspaces, ⌘V (for rich text and images) and Tab/Return, only to the frontmost app and only in response to the user's typing. CGWindowListCopyWindowInfo, reading only PID, layer and bounds. No AX reads or writes (I only call AXIsProcessTrusted), no Apple Events, no screen capture. Questions: Which of these puts an app under System & App Protection Override rather than the new Accessibility setting? Is it the active tap, CGEventPost, or both? Will an app granted the upcoming assistive-technology entitlement still be able to post keyboard events to the frontmost app? I tried AXUIElementSetAttributeValue(kAXSelectedTextAttribute) instead, but it handles only plain text and fails in browsers, Electron apps and web editors. Is there an entitlement identifier or request route yet? Filed as FB25698042
0
0
141
2d
My app behaves differently when using TestFlight as opposed to running it with my development certificate
My sandboxed macOS app requires the user to grant permission under Privacy & Security / Accessibility in order to support extra functionality. If no permission is granted the app can still be used albeit with very basic functionality. In order to allow the user NOT to have to immediately decide whether to grant this permission when first launching the app, a dialog allows them to say “I’ll do it later”. As such, the app uses a timer with a one second interval to ask the system if permission has been granted and if so, implements the extra functionality. By the way, I would rather have used a notification instead of a timer, but there does not seem to be one. // Schedule a timer to periodically check accessibility status accessibilityTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(checkAccessibilityStatus), userInfo: nil, repeats: true) func isAccessibilityEnabled() -> Bool { let accessibilityEnabled = AXIsProcessTrusted() return accessibilityEnabled } @objc func checkAccessibilityStatus() { if isAccessibilityEnabled() { print("Accessibility is enabled.") accessibilityTimer?.invalidate() if gEventTap == nil { tapper()//as003 gTypeIt4MeMenu?.item(at: kPauseResumeItem)?.title = "Pause" gStatusItem?.button!.image = NSImage(named: "menubar_icon_16x16") NotificationCenter.default.post(name: NSNotification.Name(rawValue: "showGreenTick"), object: nil) } } else { print("Accessibility is disabled.") } } My problem is that when I build the app with my development certificate, it runs as expected. However, when I upload it to TextFlight and download from there, it no longer “notices” when I grant it permission.
0
0
604
Jan ’24
macOS 27.3: which keyboard-event APIs trigger "System & App Protection Override" for an assistive text expander?
I make a sandboxed Mac App Store text expander, used by many people as an assistive tool: people with motor and neurological conditions type a short abbreviation and get the full text. On a fresh install under macOS 27.3 beta 2, turning on abbreviation expansion brings up the "System & App Protection Override" dialog. Before the user can allow anything, it lists Read, Change, Delete, and Export All Your Data; View Hidden and Recently Deleted Photos; View History and Browse As You; Control Your Mac, Apps, and Settings; and Read and Monitor Everything. My app uses none of that, and for users who rely on it as assistive technology, the dialog reads as a warning to avoid the app. What I actually use: An active CGEventTap at kCGSessionEventTap (keyDown/keyUp/mouse-up) that keeps a short in-memory buffer of the current word. It briefly holds back and replays keystrokes during an expansion, and consumes the trigger key. A listen-only tap at kCGAnnotatedSessionEventTap, reading only kCGEventTargetUnixProcessID. CGEventPost to send backspaces, ⌘V (for rich text and images) and Tab/Return, only to the frontmost app and only in response to the user's typing. CGWindowListCopyWindowInfo, reading only PID, layer and bounds. No AX reads or writes (I only call AXIsProcessTrusted), no Apple Events, no screen capture. Questions: Which of these puts an app under System & App Protection Override rather than the new Accessibility setting? Is it the active tap, CGEventPost, or both? Will an app granted the upcoming assistive-technology entitlement still be able to post keyboard events to the frontmost app? I tried AXUIElementSetAttributeValue(kAXSelectedTextAttribute) instead, but it handles only plain text and fails in browsers, Electron apps and web editors. Is there an entitlement identifier or request route yet? Filed as FB25698042
Replies
0
Boosts
0
Views
141
Activity
2d
My app behaves differently when using TestFlight as opposed to running it with my development certificate
My sandboxed macOS app requires the user to grant permission under Privacy & Security / Accessibility in order to support extra functionality. If no permission is granted the app can still be used albeit with very basic functionality. In order to allow the user NOT to have to immediately decide whether to grant this permission when first launching the app, a dialog allows them to say “I’ll do it later”. As such, the app uses a timer with a one second interval to ask the system if permission has been granted and if so, implements the extra functionality. By the way, I would rather have used a notification instead of a timer, but there does not seem to be one. // Schedule a timer to periodically check accessibility status accessibilityTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(checkAccessibilityStatus), userInfo: nil, repeats: true) func isAccessibilityEnabled() -> Bool { let accessibilityEnabled = AXIsProcessTrusted() return accessibilityEnabled } @objc func checkAccessibilityStatus() { if isAccessibilityEnabled() { print("Accessibility is enabled.") accessibilityTimer?.invalidate() if gEventTap == nil { tapper()//as003 gTypeIt4MeMenu?.item(at: kPauseResumeItem)?.title = "Pause" gStatusItem?.button!.image = NSImage(named: "menubar_icon_16x16") NotificationCenter.default.post(name: NSNotification.Name(rawValue: "showGreenTick"), object: nil) } } else { print("Accessibility is disabled.") } } My problem is that when I build the app with my development certificate, it runs as expected. However, when I upload it to TextFlight and download from there, it no longer “notices” when I grant it permission.
Replies
0
Boosts
0
Views
604
Activity
Jan ’24