Hello, everyone.
My name is Matt, I'm the developer of Eternal Storms Software.
I recently released a freeware app: SiriMote, outside of the Mac App Store.
The reason I could not release it on the Mac App Store is that it uses CGEventPost to simulate keypresses (for example, when the play/pause button is pressed on the Siri Remote, the Play/Pause media key (on the F8 key) of the Mac's keyboard is pressed), and CGEventPost is ignored inside the sandbox.
So I was wondering - is there a way to do this inside the sandbox?
I guess an alternative would be using the Scripting Bridge, but then I would have to specifically communicate with particular apps. The nice thing about CGEventPost is that any app that responds to the media keys can be used with SiriMote.
I'd love a more open approach, like CGEventPost.
Any hints appreciated!
Thank you kindly,
Matt
[did] something changers re sandboxing rules that's it allowed now?
I recently researched a very similar situation as part of a DTS incident, so I have concrete info to share on that front. I think it’s safe to extrapolate this to your issue, but lemme explain and you can make your own call.
In my case the developer was trying to get the Input Monitoring privilege. My immediate thought was that this is not available to sandboxed apps but, on researching it in detail, I discovered that’s not the case.
In recently releases [1] we’ve added user data protection (aka TCC) checks to various facilities, including Input Monitoring. As part of that we made it possible for a sandboxed app to gain such privileges. Starting with 10.15 a sandboxed app can use APIs like CGEventTap to monitor input events as long as the user approves that in Security > Security & Privacy > Privacy > Input Monitoring.
I think the same logic applies to event generation but I haven’t actually researched that privilege in detail. If you want me to do that, open a DTS tech support incident. Alternatively, you could just suck it and see.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Starting with 10.14 but, in this specific case, the Input Monitoring privilege was added in 10.15.