Mobile Development 6 min read

Extracting iOS Private Documentation APIs Using lzfse and Dash

This article explains how to build an iOS private library by extracting document_apis from the SDK using the lzfse compression method and the Dash documentation tool, detailing file paths, database structures, and parsing techniques for API metadata.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Extracting iOS Private Documentation APIs Using lzfse and Dash

The article begins by acknowledging the scarcity of tutorials on building iOS private libraries and builds upon a previous guide that extracted iOS Run-header information, focusing on extracting document_apis for iOS 15.0.

It reviews the historical format of Apple documentation (docSet) before version 9.0 and notes that modern Xcode (13.1) stores SDKs at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk , with version details in SDKSettings.json . After Xcode 9, the API data is embedded in the DNTDocumentationSupport.framework under /Applications/Xcode.app/Contents/SharedFrameworks/DNTDocumentationSupport.framework/Versions/A/Resources/external , containing map.db and cache.db .

Since the newer environment presents documentation via an embedded browser and lacks map.db , the guide proposes two extraction methods: the lzfse method and the Dash method .

01 lzfse method : The external path contains a cache.db file and an fs folder. cache.db stores rows with fields such as row_id , uuid , data_id , offset , and length . The fs folder holds binary files; by filtering with uuid and decompressing with the lzfse algorithm (e.g., using the pyliblzfse library), the original text files can be recovered. The extracted metadata JSON includes title (API name), roleHeading (method type), and externalID (identifier linking to class or header).

02 Dash method : Dash is a macOS documentation manager that can download offline iOS docsets. The docset resides at ~/Library/Application Support/Dash/DocSets . Inside the Resources folder are two database files: docSet.dsidx and optimizedindex.dsidx , which can be renamed to .db and opened with a database client. The searchindex table provides API names, types, and paths, while the cache table contains id , name , request_key , and request_key_alias (the same uuid as in the lzfse approach). Although convenient, this method may miss headers and some APIs, making it less suitable for building a comprehensive private library.

The article concludes with screenshots confirming that the number of extracted files matches the records in the databases, and thanks contributors for their efforts.

iOSdocumentationdashAPI extractionlzfseprivate library
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.