Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I download Mac applications they come in a .app extension. When I right click and view package info I see a lot of files in it. What are these files? Does it mean the apps are open source? Also how can I go about on decompiling an application? On Windows I was able to use s hex editor and decompiling sofware to mess with the internals in making the app do new things. How does it work on the Mac??

share|improve this question
add comment

3 Answers

.app folders are called bundles. They are a simple presentation for application and allow easy move or uninstallation. Mac OS uses bundles in every places when it needs to show one entity that contains multiple files (Frameworks, Preferences Pane, Plugins, etc.).

See http://developer.apple.com/mac/library/DOCUMENTATION/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple%5Fref/doc/uid/10000123i-CH101-SW13 to learn more about how they are structured.

share|improve this answer
5  
This is a good summary, but I wanted to add that being able to view the files used by an application has nothing to do with that application being "open source." The license you obtained with your application should indicate whether or not it is open source, as well as other usage rights/restrictions. –  shawnr Dec 6 '09 at 21:59
add comment

Most applications on OS X are distributed as bundles, which looks like a file but is really a folder containing other files and folders. These "other" files and folders are resources used by the application. On OS X, resources (images, sound files, etc.) are distributed as separate files, rather than one big file containing all the resources -- thus you don't need a hex editor to view these resource files.

The contents of a .app bundle typically contain items like this:

.app/                  <- The app bundle
  Contents/
    _CodeSignature/    <- Used to verify an application
    Frameworks/        <- Frameworks used by and distributed with the application
    Info.plist         <- Application metadata
    Library/           <- Files that enable various OS X functionality
      QuickLook/       <- Custom QuickLook renderers
      Spotlight/       <- Custom Spotlight importers
    MacOS/             <- Contains the actual binary code executed when double-clicking on the application
    PlugIns/           <- Application plugins
    Resources/         <- Resource files, such as icons, UI layouts, sound files, image files

Note that every application on OS X contains a layout like this, regardless of whether they are open-source apps or not.

share|improve this answer
add comment

.app "files" are folders containing multiple files. What you're seeing are the files distributed with the program, not the source code.

The best analogy I can think of is if Windows programs were distributed in .zip files and you just dropped them in C:\Program Files to install them instead of extracting them. (So the files you're seeing are the files you would see in that program's "Program Files\program name" folder on Windows)

share|improve this answer
1  
Not really so much archives, as you can navigate into the .app directory directly at the command line, which you can't do with an archive. –  Matrix Mole Jul 5 '11 at 20:48
    
@Matrix Mole, I haven't done any research on this, but I'd guess that that's just some OS X magic, like how Windows will let you treat Zip files as folders. –  Brendan Long Jul 5 '11 at 21:46
    
Nope, it's literally just a folder with a specific folder and file layout, and the info.plist combines it all together into a "virtual" file sort of, the icon file is in /Contents/Resources/APPNAME.icns and the info.plist points to that, which OS X then displays the folder as, making it appear to be a file, but in reality it's not. –  MarcusJ Jan 8 at 1:52
    
@MarcusJ Ah, so it is. Interesting. I guess that's why people distribute them instead a .dmg file.. –  Brendan Long Jan 8 at 17:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.