Where does Android store the "default application for file type (open with)" settings?
On Jelly Bean, the preferred activities are stored in the XML file /data/system/users/0/package-restrictions.xml for the primary user. Other users have their user ID in place of 0 in that path. If encrypted file system is enabled, it starts with /data/secure/system instead of /data/system.

Other than through the PackageManager service, this file can only be accessed by root. You can see the code that reads and writes the file (and thus infer the format) in the class com.android.server.pm.Settings.