Error in Sandboxed App, When loading Helper (LoginItems), code signing issue - xcode

I'm trying to get out of this problem (I hope it's the last!)
Briefly, I have one status bar app, which needs to start at login.
I followed this tutorial http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/
Everything it's working, but when it's time for testing the app in a real contest, outside xcode, I end up with this message in the console system.log:
appleeventsd[52]: <rdar://problem/11489077> A sandboxed application with pid 1258, "xxxxx" checked in with appleeventsd, but its code signature could not be validated ( either because it was corrupt, or could not be read by appleeventsd ) and so it cannot receive AppleEvents targeted by name, bundle id, or signature. Error=ERROR: #-67061 { "NSDescription"="SecCodeCheckValidity() returned -67061, <SecCode 0x7fb0ea714300 [0x7fff71381e10]>." } (handleMessage()/appleEventsD.cp #2072) client-reqs-q
What i did was checking the code signature with this command: spctl --assess --type execute AppName
The result was code signature ok for both the Main app, and the Helper app.
As you can see in the tutorial the helper app project is kept inside the main app project. Maybe this is the cause?
I've tried different Signing profiles, now i'm using "Mac Distribuition"
I'm using OsX Mavericks DP6 And Xcode 5 beta ..
Any ideas?

For anyone else finding this post, I believe the answer is here: Can't code sign helper app properly
Try running from /Applications and see if you still get the message in the console.

Check the permissions of the application bundle ( and the path to the bundle ) to insure that the appleeventsd and/or securityd daemons can read the executable.

Try to run the helper itself (from Xcode or Finder) to see that everything is fine with that.
In my case it did not run, because the appdelegate object was missing from xib.
After I fixed that it run fine and launched my app from the Application folder

Related

Electron app crashes when I ask permission to use camera. Error message asks for string in com.apple.security.device.camera. Shouldn't it be boolean?

I have an Electron app that needs access to the camera. On Windows it works fine but on MacOS it doesn't and even crashes when I try to ask permisson.
When I call the routine to check the permission status (shown bellow) it gives me a not-determined answer.
systemPreferences.getMediaAccessStatus('camera')
Then, to ask for permission (and hopefully show the allow/deny pop-up) I use the following:
const { systemPreferences } = require('electron')
systemPreferences.askForMediaAccess('camera')
But when I do, it instantaneously crashes the app and gives me a long detailed crash report that, among other things, says this:
This app has crashed because it attempted to access privacy-sensitive data without a usage description.
The app's Info.plist must contain an com.apple.security.device.camera key with a string value explaining to the user how the app uses this data.
Additionally, the Info.plist generated in the root of the app instalation has all of the entries needed. I even included the hardenedRuntime as true.
<key>NSCameraUsageDescription</key>
<string>This app needs access to the Camera</string>
<key>com.apple.security.device.camera</key>
<true/>
<key>hardenedRuntime</key>
<true/>
Some final notes...
I was struggling with app signing and finally made it to use a valid certificate to sign during the build. Before that the app did not crash when I asked for the permission. It simply did nothing at all. The crashing started as soon as I managed to sign the App.
I'm using electron-builder to build the .dmg and installing from that. npm run electron:build. When I run the app in dev mode through npm run electron:serve it works perfectly and doesn't even pop the permission pop-up. The access status returns as granted.
Shouldn't com.apple.security.device.camera be a boolean? Everywhere I read about it it is a Boolean. Although the error message asks me to define a string with a description. (which I already tried and did not change anything)
Any ideas on how to solve that?
I already tried to change the Info.plist mannualy. Didn't work. How can I make sure I'm working on the right Info.plist file. There are a few. The one I was using is the largest and seems to be the main one. The others are helpers.
I also tried to manage the permission in the MacOS System Preferences. Did not work either.
Try to add "com.apple.security.cs.allow-unsigned-executable-memory": true
mac: {
....
extendInfo: {
"NSCameraUsageDescription": "some description",
"com.apple.security.device.camera": true,
"com.apple.security.cs.allow-unsigned-executable-memory": true
}
}

Fileprovider does not get loaded when application is run from /Applications folder

I have developed a functional Application that uses the new NSFileProviderReplicatedExtension.
Everything worked as expected until I started deployment and realized, that my application cannot add domain successfully while being run from /Applications folder.
Calling:
[NSFileProviderManager addDomain:fileProviderDomain completionHandler:^(NSError * _Nullable error){}];
This call results in error:
Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." UserInfo={NSLocalizedDescription=The application cannot be used right now.}
Running the application from XCode build dir or ˜/Desktop fileprovider extension works as expected.
Upon closer inspection in console around a moment of calling "addDomain", I can see a line that does not come up when running the application from a different location.
kernel Sandbox: fileproviderd(448) deny(1) file-read-data /Applications/TestFileProvider.app
I have tried changing about everything in codesign and sandbox in build settings but no change.
I have also tried making app in Obj-C and swift too - makes no difference.
Any suggestions?
For reference here is my question on apple developer forums:
https://developer.apple.com/forums/thread/696254

Windows Universal app crashes after Associating identity with Store

I'm creating a cordova app for Windows.
Now when I build this normally (with my own identity of which I have no clue where he gets it from) everything works fine and my app launches with success.
Although when I then associate my app with the Store, and have my actual app name + package name etc filled in for me, I get a blank screen when trying to run my app.
The head and body tags stay empty and no error is thrown in my JavaScript console.
Any idea of why this happens? The problem definitely is that I associate my app with the Store and then something happens which makes my app crash or fail to start.
But why does it do this? And how can I resolve it?
(currently building with VS2017)
edit
Alright, so I figured out that because the package name changed, I had to edit that as well in the manifest. Now My main root component is loaded, but it isn't setting the app root to any page, just a blank screen. (with a menu that can open on swipe).
Alright, so my Microsoft assigned package name was different than my own. This caused the app to look for my own package name instead of the Microsoft one I associated with.
The solution was quite simple, just set your widget-id in your config.xml to the Microsoft assigned package name and rebuild your solution.
(I was using Ionic framework so re-execute ionic build windows --release --prod --arch="arm")

Very Frustrating Sandboxing Error

To preface, I haven't changed any code or entitlements in my app. It always built and worked great but now all of a sudden I am getting this error.
12/8/15 10:05:45.388 AM appleeventsd[51]: A
sandboxed application with pid 2414, "XXX" checked in with
appleeventsd, but its code signature could not be read and validated
by appleeventsd, and so it cannot receive AppleEvents targeted by
name, bundle id, or signature. Install the application in
/Applications/ or some other world readable location to resolve this
issue. Error=ERROR: #100013 {
"NSDescription"="SecCodeCopySigningInformation() returned 100013, -."
} (handleMessage()/appleEventsD.cp #2098) com.apple.root.default-qos
I have tried the following
Install the app in "Applications" as the error suggest.
Restart the computer.
Delete the container and empty the trash.
Killing off cfprefsd. Both root and user.
Re-installing Xcode.
Removing the "Developer" folder in my Library.
Running the app in a virtual machine with a brand new install of my app.
Recreate all my developer certificates, provisioning profiles, etc...
None of the above works.
I have also tried all suggestions in the following links
Mac sandbox created but no NSUserDefaults plist
Error while implementing Sandbox: "deny file-read-metadata /Library"
Can't code sign helper app properly
Error in Sandboxed App, When loading Helper (LoginItems), code signing issue
And nothing has resolved the issue. My app, all of a sudden stopped working.
I think I figured it out. I re-wrote the code for creating a security scoped bookmark... all is working again. I couldn't find any differences but I think it was something in my code.

iOS App development with Facebook API bundle ID error message

I'm developing an iOS App with Facebook API. The app was working fine but I started to get the below error;
"There was an error:fbplatse:{"message": "No Bundle ID has been set on the server" }. Please tap Cancel to return to APPNAME and try again."
Actually I don't think I made any changes to the server. Can you please help me to fix this?
Thanks,
E.
Ok, I solved this problem.
add your app's bundle ID into the 'Native iOS App' tab under 'developers.facebook.com/apps'
Your app's bundle ID should be the same with the one above (Facebook developer page)
After I added up my bundle ID, I started to receive 'com.facebook.sdk error code=2' messages. It is good to check this link which explains everything step by step about the error code and how to get rid of it.
So, in my specific situation following worked; Device's Settings => Facebook and then log in with the credentials.
I spent too much time on that but now it works!
Facebook has updated it's documentation since this post in 2013. They have provided a screenshot showing where to get the bundle identifier. It's not the code with the variable in it from the Info.plist in Supporting Files directory. Rather, tap on the project file in Xcode (the topmost file in the directory) and see General tab (which is open by default).
I've attached a screen grab. Hopefully this helps someone.

Resources