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??
.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_ref/doc/uid/10000123i-CH101-SW13 to learn more about how they are structured.
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.
.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)