Accessibility API stops working after sandboxing
Asked Answered
T

1

5

My Mac App uses accessibility API to move an resize window (of other apps).

I would like to submit my app to the MAS (Mac App Store). I have read that to submit an app to the MAS is mandatory to turn on sandboxing.

When I turn on the sandboxing my code can´t find the focused window through the accessibility API (always return NULL). The question is: the accessibility API can´t be used with sandboxing?

I notice that there are applications in the Mac App Store that uses accessibility API, is not mandatory sandboxing by now?

Thanks in advance.

Trichina answered 15/1, 2012 at 16:16 Comment(0)
A
6

First, by March June, 2012, all Apps on the Mac Apple Store will be required to be Sandboxed, from the research I've found. Not Sandboxing isn't going to future-proof your app.

Second, I've found 3 strategies that you may consider:

  1. Look up the list of entitlements, and see if you can grant your app access via the Entitlements (Apple's way of allowing Apps special privileges to access key features they'lll need). Here's a walk-through via Apple's documentation on how you can stack-trace through which entitlements you're missing and might need.
  2. Submit a bug request to Apple on the specific feature you want access to. Who knows, they may actually update their codebase to allow you access.
  3. Consider selling the app as a product on an e-commerce site, and not selling on the Mac Apple Store. People can still buy and install your app on a regular website (as Versions, TextMate, and other wonderful applications have done before going on MAS), especially if your application does things that can't be found on the MAS.

If you look at the documentation, you'll find that it explicitly states you cannot sandbox an assistive app.

Here's an excerpt from their documentation on preparing an App for Sandbox:

Use of accessibility APIs in assistive apps

With App Sandbox, you can and should enable your app for accessibility, as described in Accessibility Overview. However, you cannot sandbox an assistive app such as a screen reader, and you cannot sandbox an app that controls another app.

Here's an excerpt from their documentation on Accesibility in Cocoa:

Note: With App Sandbox, you can and should enable your app for accessibility, as described in this document. However, you cannot sandbox an assistive app such as a screen reader, and you cannot sandbox an app that controls another app.

It sounds a bit like double-speak: you should enable your app to be Accessible however you cannot sandbox an assistant app...

Aurelia answered 15/1, 2012 at 16:23 Comment(6)
Thanks for your answer Dominic. So I cannot sandbox my app because it controls the windows of other apps? And I have to sandbox my app if I want to submit it to the MAS? How is possible that there are apps in the MAS like Divvy or Breeze that uses accessibility API if sandboxing is mandatory?Trichina
Thanks again Dominic, your really fast answering. I´ve tried activating all entitlements and it doesn´t work. I will try to contact Apple support tomorrow asking for a solution...Trichina
I wonder what will happen with apps in MAS that cannot be sandboxed in first march 2012...Trichina
No problem Azpiri. I'll check out those apps, I'm not familiar with them. My first impressions are that they must be using Entitlements.Aurelia
Regarding activating entitlements, have you found any that are specific to your application requirements? It might be a separate SO question.Aurelia
I don't know of any appropriate entitlements. How's your progress?Rainband

© 2022 - 2024 — McMap. All rights reserved.