Helper Apps and the Sandbox

Here is the how to :

How-to documentation : How-to

And the files : Helper Files and Helper integrator

Helper Integrator is donationware :slight_smile:

[quote=97150:@Valdemar De SOUSA]Here is the how to :

How-to documentation : How-to

And the files : Helper Files and Helper integrator

Helper Integrator is donationware :)[/quote]

Impressive. I shall try it tomorrow.

Thank you.

There are several things Iā€™ve done differently, and Iā€™m ever hopeful that I will get my application through the vetting service! Then Iā€™ll be able to confirm if the way I did is accepted or not.

[quote=97267:@Sam Rowlands][/quote]

Sam, I have completed an app which uses Valdemar de Sousaā€™s Helper Integrator. It works perfectly unsandboxed, but when Sandboxed with App Wrapper 2.5, the helper app never launches. Here is the message I get in the Console :

8/8/14 1:51:56.821 AM lsboxd[285]: Not allowing process 890 to launch "/Applications/StartMenu.app/Contents/Library/LoginItems/Helper-Test.app" because the security assessment verdict was denied.

Could it be because the Helper needs to be wrapped before it is integrated, or is it something else ?

Yes Michel, you need to wrap first the helper then integrate it with helper integrator. And so, Wrap the all App with AppWrapper 2.5

Allright. Thank you Valdemar :slight_smile:

Well. The problem is still here. I have now sandboxed the helper, but I get the same message, plus an excessive number of wakeups.

8/8/14 4:58:35.497 AM lsboxd[288]: Not allowing process 274 to launch "/Applications/StartMenu.app/Contents/Library/LoginItems/Helper-Test.app" because the security assessment verdict was denied. 8/8/14 4:58:35.497 AM lsboxd[288]: Not allowing process 274 to register app "/Applications/StartMenu.app/Contents/Library/LoginItems/Helper-Test.app" for launch. 8/8/14 4:58:36.000 AM kernel[0]: process Helper-Test[274] caught causing excessive wakeups. Observed wakeups rate (per sec): 1752; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 64809

Is it possible that the problem comes from the wakeups ? Can I set that, and where ?

Have you try the project as is ?

The unsandboxed project My App with helper works perfectly. But when I sandbox the helper, then integrate and sandbox all, it no longer works. Here are the errors in the console :

[code]8/8/14 1:55:00.232 PM lsboxd[286]: Not allowing process 272 to launch ā€œ/Applications/StartMenu.app/Contents/Library/LoginItems/Helper-Test.appā€ because the security assessment verdict was denied.
8/8/14 1:55:00.232 PM lsboxd[286]: Not allowing process 272 to register app ā€œ/Applications/StartMenu.app/Contents/Library/LoginItems/Helper-Test.appā€ for launch.
8/8/14 1:55:05.000 PM kernel[0]: process Helper-Test[272] caught causing excessive wakeups. Observed wakeups rate (per sec): 3073; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 58944
8/8/14 1:55:05.349 PM lsboxd[286]: Not allowing process 273 to launch ā€œ/Applications/My App with Helper.app/Contents/Library/LoginItems/Helper-Test.appā€ because the security assessment verdict was denied.
8/8/14 1:55:05.350 PM lsboxd[286]: Not allowing process 273 to register app ā€œ/Applications/My App with Helper.app/Contents/Library/LoginItems/Helper-Test.appā€ for launch.
8/8/14 1:55:08.000 PM kernel[0]: process Helper-Test[273] caught causing excessive wakeups. Observed wakeups rate (per sec): 2081; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 46524
8/8/14 1:55:16.502 PM Helper-Test[273]: spawn_via_launchd() failed, errno=93 label=[0x0-0x2a02a].fr.vdsc.helpertest path=/Users/Mitch/Documents/MatchFonts/1-Development/StartMenu/helperapp/My App with Helper.app/Contents/MacOS/My App with Helper flags=0 : LaunchApplicationClient.cp #990 LaunchApplicationWithSpawnViaLaunchD() q=com.apple.main-thread
8/8/14 1:55:16.502 PM Helper-Test[273]: spawn_via_launchd() failed, errno=93 label=[0x0-0x2a02a].fr.vdsc.helpertest path=/Users/Mitch/Documents/MatchFonts/1-Development/StartMenu/helperapp/My App with Helper.app/Contents/MacOS/My App with Helper flags=0
8/8/14 1:55:22.891 PM Helper-Test[273]: spawn_via_launchd() failed, errno=93 label=[0x0-0x2b02b].fr.vdsc.helpertest path=/Users/Mitch/Documents/MatchFonts/1-Development/StartMenu/helperapp/My App with Helper.app/Contents/MacOS/My App with Helper flags=0 : LaunchApplicationClient.cp #990 LaunchApplicationWithSpawnViaLaunchD() q=com.apple.main-thread
8/8/14 1:55:22.891 PM Helper-Test[273]: spawn_via_launchd() failed, errno=93 label=[0x0-0x2b02b].fr.vdsc.helpertest path=/Users/Mitch/Documents/MatchFonts/1-Development/StartMenu/helperapp/My App with Helper.app/Contents/MacOS/My App with Helper flags=0

[/code]

Apparently Helper-Test is first refused to register at 1:55:00.232 PM, then it somehow knocks on the door again and again then finally launches at 1:55:16.502 PM but is unable to spawn the main application. It tries again at 1:55:22.891 PM and gets the same result.

All this appears to be the result of sandboxing.

Well ; if it cannot work I will instruct the user to set the Open at login option through the dock icon :frowning:

Valdemar,

I finally found out what was going on.

When I built my app, then I copied it to the folder where is the helper and the integrator, then after integration wrapped it with App Wrapper which placed the sandboxed version in a new folder.

When the helper starts, it uses LaunchServicesFindApplicationForInfoMBS to locate the app. And for some reason, instead of looking first in /Applications/ it reported all other versions. So the helper tried to launch non sandboxed versions in the build folder, and it the folder where the integrator is. Hence the security issue.

After deleting all other versions but the one that is wrapped, everything works fine.

You may want to add a Read Me to your documentation about the way to sandbox correctly the helper before integration, and warn against keeping precious copies of the app as I did.

Thank you.

Gonna make a small tutorialā€¦

Great. Thank you.