{"id":28101487,"url":"https://github.com/jjtech0130/launchservices","last_synced_at":"2025-06-17T09:35:01.593Z","repository":{"id":262029510,"uuid":"885922067","full_name":"JJTech0130/launchservices","owner":"JJTech0130","description":"Experimenting with the Launch Services system on iOS and macOS","archived":false,"fork":false,"pushed_at":"2024-11-20T15:59:03.000Z","size":68079,"stargazers_count":29,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T19:14:52.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JJTech0130.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-09T18:39:26.000Z","updated_at":"2025-05-11T15:19:31.000Z","dependencies_parsed_at":"2025-05-13T19:06:38.999Z","dependency_job_id":null,"html_url":"https://github.com/JJTech0130/launchservices","commit_stats":null,"previous_names":["jjtech0130/launchservices"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JJTech0130/launchservices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJTech0130%2Flaunchservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJTech0130%2Flaunchservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJTech0130%2Flaunchservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJTech0130%2Flaunchservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JJTech0130","download_url":"https://codeload.github.com/JJTech0130/launchservices/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJTech0130%2Flaunchservices/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260329115,"owners_count":22992832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-13T18:56:17.958Z","updated_at":"2025-06-17T09:35:01.580Z","avatar_url":"https://github.com/JJTech0130.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is LaunchServices?\n\nLaunchServices is an almost completely undocumented service that is critical for launching applications on macOS and iOS.\n\n# How does LaunchServices work?\n\n`lsd`, the LaunchServices daemon, is responsible for most of the heavy lifting. APIs such as `LSApplicationWorkspace` communicate with it over XPC in order to perform tasks and register applications with it.\n\n`lsd` creates a giant database of all applications on the system, and uses this database to determine which application to launch when a file is opened or a URL is clicked.\n\n# What does this repository contain?\n- `samples/`: contains a bunch of files sampled from macOS and iOS that are related to LaunchServices\n- `objc/`: contains Objective-C code for using CoreServicesStore.framework on macOS\n- `csstore.py`: a command line tool for reversing the LaunchServices database\n\n### How do I use `csstore.py`?\n```shell\npython ./csstore.py ./samples/com.apple.LaunchServices-5019-v2.csstore dump ./csstore.txt\n```\n\n## LaunchServices Database\n\n### Where is the database located?\nOn macOS, several versions of the database exist, one for each user. \nThey are stored in `DARWIN_USER_DIR/com.apple.LaunchServices.dv/com.apple.LaunchServices-\u003cVERSION\u003e-v2.csstore`.\n\n`DARWIN_USER_DIR` can be found with `getconf DARWIN_USER_DIR`, it is derived from the user's UID and UUID[^1].\n\nFor example, the path might look like this:\n```\n/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/0/com.apple.LaunchServices.dv/com.apple.LaunchServices-5019-v2.csstore\n```\n\nOn iOS 15, the database is located at \n```\n/private/var/containers/Data/System/\u003cUUID\u003e/Library/Caches/com.apple.LaunchServices-\u003cVERSION\u003e-v2.csstore\n```\nWith iOS 16, the database was moved to \n```\n/private/var/mobile/Containers/Data/InternalDaemon/\u003cUUID\u003e/Library/Caches/com.apple.LaunchServices-\u003cVERSION\u003e-v2.csstore\n```\n\nThe version number seems to be tied to the macOS/iOS version that created the database, here are the known associations:\n- macOS 14.3.1: `5019`\n- iOS 15.8.3: `3027`\n- iOS 16.1.2: `4031`\n\n### How is the database structured?\nAs evidenced by the `.csstore` extension, the database is in the proprietary and undocumented `CoreServicesStore` format.\nLaunchServices structures the database contents with the following tables:\n\n- `\u003carray\u003e`: ?\n- `DB Header`: ?\n- `Bundle`: ?\n- `Claim`: ?\n- `Service`: ?\n- `Type`: ?\n- `HandlerPref`: ?\n- `Container`: ?\n- `Alias`: ?\n- `Plugin`: ?\n- `ExtensionPoint`: ?\n- `BindingList`: ?\n- `PropertyList`: ?\n- `LocalizedString`: ?\n- `CanonicalString`: ?\n- `BindableKeyMap`: ?\n- `UTIBinding`: ?\n- `ExtensionBinding`: ?\n- `OSTypeBinding`: ?\n- `MIMEBinding`: ?\n- `NSPasteboardBinding`: ?\n- `DeviceModelCodeBinding`: ?\n- `BluetoothVendorProductIDBinding`: ?\n- `URLSchemeBinding`: ?\n- `BundleIDBinding`: ?\n- `BundleNameBinding`: ?\n- `ActivityTypeBinding`: ?\n- `PluginBundleIDBinding`: ?\n- `PluginProtocolBinding`: ?\n- `PluginUUIDBinding`: ?\n- `ExtensionPointIDBinding`: ?\n- `\u003cstring\u003e`: ?\n\n### How can I inspect the database contents?\nOn macOS, a handy tool is included: `lsregister`. You can use it to dump the contents of the database in a human readable form:\n```shell\n/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump\n```\n\nOn iOS, a similar tool is located at `/usr/bin/lsdiagnose`\n\n### A note about sysdiagnose\nA dump of the database is also included in sysdiganose tarballs. The dump in the sysdiagnose is ends with `.csstoredump`, and it is NOT the raw database, but rather a human readable version that was serialized (why?)\n\nAccording to the README included with every sysdiagnose...\n```\n.csstoredump files:\nsysdiagnose generates the output of lregister/lsaw in a binary form. To convert\nthese .csstoredump files to text files, use the following command: \n\n\tlsaw dump --file \"PATH TO DUMP FILE\" \u003e lsaw.txt\n\nThese files can also be opened in CSStore Viewer.\n```\n...however, I have no idea where one can obtain `lsaw` or `CSStore Viewer`.\n\n[^1]: https://www.swiftforensics.com/2017/04/the-mystery-of-varfolders-on-osx.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjtech0130%2Flaunchservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjtech0130%2Flaunchservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjtech0130%2Flaunchservices/lists"}