Apple Sandbox and AXUIElementRefs - xcode

How can i access another app if my app is in this strange Sandboxing thing which is required to release a app in the MAC App Store?
I'm reading with this Method an UIElement:
AXUIElementCopyElementAtPosition(xxx)
This works fine so far. But if i enable App Sandboxing, i no longer get reference to the MenuItem!!!
Thanks for help.

Such Apis are not supported from within the sandbox. All you can do is file a radar and sell your app outside of the store

Filed a bug... radar: 12174743 Keep filing Bugs maybe someday they'll relent.
Flawed / illegal sandbox leads to failure of all Accesability API's,
aka AXUIElementRef's.
Have you guys gone crazy over there??? Ever heard of the ADA act?
Get ready to get sued..
The sandbox is such a SAD result of your success. It really pisses
me off, actually. It goes against every reason I have ever stood
behind this platform... through thick and thin.

Related

Security settings dialog does not list my app

My app requires to access the calendar. Up to Catalina that worked with the sandbox with no big issues. Now under Catalina the app does not show in the security settings:
I have set the Hardened Runtime with calendar access (also tried Sandbox with no different effects):
Since I believe this is related to that signing stuff, here's my setting:
Strangely enough I have another app which had been developed in parallel also using the calendar. And that app is listed in the security setting.
So likely I'm missing something. But what?
Try: reboot the Mac, try your app again. Sometimes, weird problems resolve by themselves after a reboot.
Edited: This is not meant to be a bad joke, or to insult the skill and capability of the person asking the question, but when I read:
Strangely enough I have another app which had been developed in parallel also using the calendar. And that app is listed in the security setting.
I assume the other app has a very similar or identical set-up and signing config, etc., otherwise the person asking the question would have tried changing something to make them similar or identical.
So it sounds like the kind of situation that doesn't make sense. I have a few (painful) memories when I rebooted my Mac and situations like that went away. I suspect that memory corruption, bugs in the OS, etc., can cause small failures as time goes on, and a fresh start can sometimes help.

Copy Protection and Trial Creation for OSX Applications - Suggestions Please?

Silicon Realms (Digital River - Armadillo) used to have a Mac application protection/trial builder. They discontinued it this year most likely due to Mac App store not allowing 3rd party protection mechanisms or trials. Does anybody know of alternatives for creating trials and generally wrapping apps for copy protection which will not be sold on the app store? I am not expecting iron clad solutions... just simple copy deterrents and 30 day trial mechanisms.
The only solution I've found is ExeShield. No idea how well it works, but since I just discovered that Silicon Realms discontinued their program I'll probably have to go with that.
Apple is working harder and harder to get you into their store - and take their 30% of the gross off the top. Eventually Apple will do anything, legal or no, to make sure that they make more money out of your program than you do...

Allow HID control for the sandboxed app

We're trying to sandbox our app to submit it to the Mac App Store (for the first time). It makes hard use of the lower level Carbon APIs and cannot operate the other way.
When I enabled the sandboxing, some features stopped working and I see this message in the log:
9/14/12 10:51:58.863 PM sandboxd[41243]: ([41237]) MouseRecorder(41237) deny hid-control
Is there any hidden entitlement I could use or we have no chance in the App Store with this app?
Even though I'm several years too late, I assume I can help others looking for the same. It's taken me days wondering why I couldn't connect to the keyboard. Today, the thought of the sandbox hit me, and I finally allowed my app access.
As described here, I added the following to the .entitlements file, and got access.
<key>com.apple.security.device.usb</key>
<true/>
To be specific, and not mislead:
I do not use Carbon; I use IOKit.hid, with Swift.
EDIT: See the new accepted answer
Just to answer my own question – it's not possible, there is no workaround and it's unlikely it will be possible in the future.

Can you update a sandboxed Mac app using Sparkle or something similar?

For those distributing Mac apps outside the Mac App Store, how are you planning to support updating and sandboxing? I'm guessing most people's answers for the time being is that they're not, but I hope that eventually non-MAS apps could be sandboxed just like MAS apps.
To use Sparkle, your app would need network access, which could be granted, as well as the ability to overwrite itself in Applications. Currently you could do this with the com.apple.security.temporary-exception.files.absolute-path.read-write entitlement, but that's not a good solution. It will likely go away, and even if it doesn't there's little point in sandboxing an app if you're going to give it full filesystem read-write access as well as network access.
Has anyone already gone down this path and found a good solution? I ask because I try to keep my MAS build and my non-MAS build as identical as possible, and I'm currently looking at having my MAS build sandboxed and my non-MAS build not.
In a conversation started by #chockenberry on twitter, #andy_matuschak responded favorably to creating an XPC service for Sparkle.
I have a pull request open on GitHub that actually creates the XPC service. Hopefully, this will get incorporated into Sparkle soon.
We actually have two versions of our app: one for our own web site and one for the app store.
I recommend using Sam Deane's approach which you can find in his GitHub repository. It works well for us.
Not yet.
As of 1.15 Sparkle does not support sandboxing, and the patch that is floating around has a vulnerability that allows complete bypass of sandbox security.

Check if Mac App was taken from Mac App Store with Cocoa

I'm trying to give a license to all the users who have bought my app from Mac App Store in order to give them faster updates.
What i was thinking is to do an update for the Mac App Store version of the app that will let user register from within the application itself. But i'm having problems figuring out how to test if the application was really taken from Mac App Store and not from a pirated source.
Is there a way to test if the user bought the app from AppStore. Apple does not release this info - as if it would - i could just test if that user email is in the list of people who downloaded the app from AppStore.
Thank you in advance for the help,
Bogdan Vladu
You could have the MAS version of your application copy the Apple-issued receipt to the Application Support folder.
The independent version could look there for a valid receipt. If there is, it will behave like the fully licensed version. If there is not, it would go to demo mode.
If you're making enough money from this app to pay money for DRM and obsfucation, go for it. It might slow down the pirates enough for it to be a profit for you.
Otherwise, you're pitting your own time and skill against everyone who's interested in pirating your app. It's a losing battle, unless your app is really unpopular, in which case you've lost again.
In short, there's no algorithmic way of making sure. Code obsfucation is the way to go, and hope that the pirates don't find the "check-for-tampering" module.

Resources