Codesigning, Resource Fork, Detritus, etc

I’m using Xojo2016r3 on a Mac (10.12.2) writing a Mac app (actually upgrading an old Carbon app to Cocoa, etc.) It seems to be going well, and thought I’d see if I could codesign it. When I did so, I got the “Resource Fork…Detritus” error message in Terminal, which I’m sure is familiar to many here. I did a little digging and found out about the “xattr -cr MyApp” Terminal fix. I tried that, and it ultimately worked. My app is now codesigned and seems to work just fine.

BUT…I was curious what exactly the “xattr -cr” trick did, and more importantly what it removed! I wanted to know if, even though my app seems to work fine, did the “xattr -cr” trick remove something I might have needed.

In Terminal, you can do this " xattr -lr MyApp.app" and it will list, I believe, those things that will be removed if you use xattr -cr. I did that, and had a slew of findings. I’m writing this in hopes someone can help explain the things that are being removed. I think it’s removing things I don’t need, but I sure want to double check.

For instance, I have a ton of PNG pictures in my app, and all of them appeared to be flagged. I use GraphicConverter mostly to deal with pictures, and it may have added a resource fork with info it needs that Xojo does NOT need. Or maybe that resource fork info in the PNG was a remnant of when, long ago, I converted some old Mac PICT’s to PNGs? The pictures flagged still work fine in my app, so I’m thinking, who cares if that info was removed! Right?

Similarly, I have a list of WAV files that were also flagged. Again, I’m thinking the program I used to massage audio files might have added resource fork info to the WAV that I don’t need. And, the final app (after “xattr -cr”) seems to play the sounds as it should without balking. So, I think I’m cool there too. Yes?

Again, similarly, I include text files in my app (for instance, for use in a Help Window), those files were all flagged, and I believe some of the flagged text files refer to BBEdit which is the program I often use to manage TEXT files. I’m guessing (unknown to me) it too may have added a resource fork with info it wanted to save, or maybe an old filetype or something, but again, the completed app works fine, the Help Window shows the proper text, so again, I’m thinking that I’m fine with “xattr -cr” removing that unneeded info too. Yes?

But, not all of the lines in the flagged list was (I don’t think) my own doing. Some of the flagged items seemed to be in the Xojo framework part of the app. For instance, here’s two lines in the listing…

MyApp.app/Contents/Frameworks/XojoFramework.framework/Versions/A/Resources/ScrubberTrackLoadedMiddle.tiff: com.apple.quarantine: 0181;57d7fef8;Firefox.app;

MyApp.app/Contents/Frameworks/XojoFramework.framework/Versions/A/Resources/ScrubberTrackLoadedRight.tiff: com.apple.FinderInfo:

I’m not sure what those two lines are all about. Anybody? If it’s a problem and within Xojo’s responsibility, I would have thought they’d remove it (or maybe they do on a later rev of Xojo?) I’m not sure why those lines refer to “Firefox.app” (an app I DO use), or what that “quarantine” is all about either. I’m in a bit over my head. Anybody?

Thanks!

Nothing to worry about, just remove the FinderInfo and ResourceForks for submitting to App Store.

Finder stored various Flags and Creator/Type codes in the FinderInfo.
GraphicConverter stores a custom icon in resource fork (can be disabled).
Some other apps may store data in metadata.

Thanks Christian, I’m sure you’re right, but I’m still hoping to learn more. I’m not so worried for reasons I stated in my first message about resource fork parts of PNGs, WAVs or TEXTs being removed, but, for instance, look at this line…

MyApp.app/Contents/Frameworks/XojoFramework.framework/Versions/A/Resources/ScrubberTrackLoadedMiddle.tiff: com.apple.quarantine: 0181;57d7fef8;Firefox.app;

…what’s that all about? What’s the “quarantine” and the “Firefox.app” mentions?

Quarantine is the attribute that brings up this dialog:

Not sure where Firefox came from.

well, that’s where Finder remembers where the file came from.
So this picture was downloaded by FireFox.

Very curious. Thanks for the thoughts, but it just brings up more questions. First of all, the line in question sure appears to refer to a part of my app (XojoFramework) that I am not responsible for but Xojo is. So, to me, it still seems odd that the fix “xattr - cr MyApp.app” would remove that part of Xojo’s framework in my app. Wouldn’t Xojo know NOT to include it if it caused trouble? As to the Firefox mention, I actually do often acquire pictures (don’t we all) by using a browser, maybe copying a portion of the screen, etc. But, all the FIREFOX mentions in the files of attributes to be removed are NOT my resources, but Xojo’s Framework stuff. Still seems strange…

It didn’t come from Xojo. It came from you when you downloaded Xojo.
For example, when I check the extended attributes on things I build, mine says Safari instead of Firefox.

It’s not strange, it’s just miscellaneous information Finder stores to inform you about where you got files from, and keep you safe from malicious ones. Apple has started requiring the attributes to be gone when you deliver, that’s all.

Think of it like a manufacturer making sure their packages contain only the product you want. Who wants to open a toy with plastic bits from molding left inside the box?

Makes sense to eliminate useless information and that’s what it sounds like Apple is doing, thanks for the example. But I feel like the phrase “Trust but Verify”…I want to trust everything “xattr -cr MyApp.app” does, I just wish I could verify (or make sense of) it all. You do make sense, and I’ll take that as one vote for “trust it”! :slight_smile: How about a reverse take on it…can you think of an instance where the use of “xattr -cr MyApp.app” would hurt an app?