2

I have an application which uses FFMPEG and FFPROBE to perform some tasks on a video the user can open with my application.

For non-sandboxed applications everything works fine, but when my app is running in a sandbox FFPROBE doesn't seem to get started. The Console says the following:

08.06.15 12:27:55,803 secinitd[281]: ffprobe[4049]: registration request failed: (0x11, 0x0) Container object initialization failed. failed to get bundleid for app "/Users/Alex/.../ffprobe"

The path to ffprobe mentioned in this messages points to the MacOS directory within the app bundle (a Build Phase copies these two binaries into the executable directory).

I've searched a lot and found some hints regarding entitlements. Of course my sandboxed app has its entitlements and when building my application it gets signed (with --deep signing flag). It even passes the technical App Store check for entitlements.

Now I'm stuck and wonder why my application is not able to launch FFPROBE (and FFMPEG).

Does anybody have a clue?

Alex
  • 1,221
  • 1
  • 10
  • 19
  • Yeah those sub-processes need entitlements too. If I recall correctly they are embedded as part of the signing process. There shouldn't be a problem finding official documentation on this from Apple themselves. – Droppy Jun 08 '15 at 14:01
  • Yepp. When I try to submit my app to the App Store all entitlements are shown (even those for both binaries). So this seems (!) not to be the issue, because if the entitlements were wrong submitting to the app store won't work. – Alex Jun 09 '15 at 05:46
  • See [this](http://prod.lists.apple.com/archives/xcode-users/2013/Oct/msg00066.html) (and the follow-up) where it's stated that an `Info.plist` also needs to be embedded within the spawned executable. – Droppy Jun 09 '15 at 06:40
  • When I get this post right the TO wants to sign his own binary (a command line tool). What I need is a way to execute a third party command line tool (not developed by me). I've added a `plist` file and set the linker flag `-sectcreate __TEXT __info_plist ffprobe.plist` but nothing changes. The issue still remains. – Alex Jun 09 '15 at 12:16

1 Answers1

0

It seems like I've found a solution. I don't know whether all of these steps are necessary, but here is what I've tried and what seems (!) to work:

  1. I added an entitlements file which contains true for the keys com.apple.security.inheritand com.apple.security.app-sandbox
  2. I added a plist file for each used binary and filled the keys CFBundleName and CFBundleIdentifier with suitable values (I don't know whether this step is necessary)
  3. I added a Run Script build phase which executes codesign -f -s "your certificate" --entitlements ./ffmpeg.entitlements ./Build/Intermediates/ArchiveIntermediates/App\ Store/InstallationBuildProductsLocation/Applications/<my app>/Contents/MacOS/ffmpeg for each binary used.

These steps result in suitable entitlements when trying to submit the app to the Mac App Store and it results in a correct usage of the embedded binaries (at least on my development Mac and the Mac of some colleagues).

Alex
  • 1,221
  • 1
  • 10
  • 19