[GH-ISSUE #480] [Feature] Decode compiled Apple storyboard and nib archives into UI graphs #256

Closed
opened 2026-10-15 18:23:04 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Sep 28, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/480

Before submitting

  • I searched the open and closed issues and pull requests for a related proposal.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Current limitation

REA can inventory Apple application bundles and recover some UI clues from resources, strings, and native class metadata. Compiled UIKit/AppKit storyboard and nib archives remain opaque to the static artifact workflow. On current Apple tooling, ibtool cannot inspect already-compiled nib archives. Without decoding those archives, an analyst can find controller-to-nib mappings and code-populated outlets, but cannot recover the authored view hierarchy, segue connections, constraints, or most directly configured control properties in a systematic, evidence-linked way.

Use cases

  • Reconstruct screen structure and navigation for an application when source XIB/storyboard files are not shipped.
  • Connect view controllers, controls, action selectors, outlets, segue identifiers, and bundled assets to code references.
  • Compare compiled interface resources across application versions.

Current artifact inventory and string/xref operations provide useful resource discovery, but they do not produce an interface-object graph or recover Auto Layout relationships.

Desired outcome and success criteria

Provide a read-only operation that analyzes compiled Apple storyboard/nib resources and returns a bounded, paginated UI graph with Evidence v2 provenance. When recoverable, include:

  • scene/controller identifiers, class/module names, and source nib/storyboard membership;
  • view and control object hierarchy, labels, accessibility values, identifiers, and selected style/state properties;
  • outlet, action, segue, placeholder, and external-object connections with source and destination IDs;
  • Auto Layout constraints, priorities, layout guides, and authored frames where encoded;
  • referenced images, colors, fonts, and other interface resources;
  • archive format/version, decoding coverage, and explicit unsupported or ambiguous nodes.

Success requires deterministic fixture coverage for storyboards and nibs compiled from source fixtures on supported Xcode versions; stable behavior on malformed and partially supported archives; exact totals and truncation metadata; and cross-references from decoded selectors/classes/resources to existing binary Evidence. Unsupported data must remain unknown rather than being rendered as an empty hierarchy.

Authority boundaries and non-goals

  • Static archive decoding only: do not launch the target or instantiate its views.
  • Do not extract or write archive contents implicitly; use the existing explicit artifact extraction boundary when needed.
  • Preserve original artifact hashes, occurrence paths, and provider limitations.
  • Do not promise pixel-perfect runtime rendering from archived constraints alone; trait collections, code-created views, and runtime state may affect the final screen.
  • Do not infer reachability from a storyboard identifier alone.

Alternatives considered

  • strings, Objective-C/Swift metadata, and controller decompilation recover useful names and code behavior but not the complete authored UI graph.
  • ibtool is useful for source interface documents but refuses compiled nib archives.
  • Runtime screenshot capture can show rendered states but does not replace the archive's authored connections or constraints and requires a separately authorized runtime workflow.

Possible direction

Add an Apple interface archive parser to the artifact provider, or a dedicated read-only UI-resource capability. Normalize relationships into the artifact graph and preserve raw archive object IDs and decode provenance so claims can be traced back to the shipped resource.

References

Originally created by @morluto on GitHub (Sep 28, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/480 ## Before submitting - [x] I searched the open and closed issues and pull requests for a related proposal. - [x] I removed credentials, tokens, private paths, and sensitive target data. ## Area Evidence, artifacts, or reconstruction ## Current limitation REA can inventory Apple application bundles and recover some UI clues from resources, strings, and native class metadata. Compiled UIKit/AppKit storyboard and nib archives remain opaque to the static artifact workflow. On current Apple tooling, `ibtool` cannot inspect already-compiled nib archives. Without decoding those archives, an analyst can find controller-to-nib mappings and code-populated outlets, but cannot recover the authored view hierarchy, segue connections, constraints, or most directly configured control properties in a systematic, evidence-linked way. ## Use cases - Reconstruct screen structure and navigation for an application when source XIB/storyboard files are not shipped. - Connect view controllers, controls, action selectors, outlets, segue identifiers, and bundled assets to code references. - Compare compiled interface resources across application versions. Current artifact inventory and string/xref operations provide useful resource discovery, but they do not produce an interface-object graph or recover Auto Layout relationships. ## Desired outcome and success criteria Provide a read-only operation that analyzes compiled Apple storyboard/nib resources and returns a bounded, paginated UI graph with Evidence v2 provenance. When recoverable, include: - scene/controller identifiers, class/module names, and source nib/storyboard membership; - view and control object hierarchy, labels, accessibility values, identifiers, and selected style/state properties; - outlet, action, segue, placeholder, and external-object connections with source and destination IDs; - Auto Layout constraints, priorities, layout guides, and authored frames where encoded; - referenced images, colors, fonts, and other interface resources; - archive format/version, decoding coverage, and explicit unsupported or ambiguous nodes. Success requires deterministic fixture coverage for storyboards and nibs compiled from source fixtures on supported Xcode versions; stable behavior on malformed and partially supported archives; exact totals and truncation metadata; and cross-references from decoded selectors/classes/resources to existing binary Evidence. Unsupported data must remain unknown rather than being rendered as an empty hierarchy. ## Authority boundaries and non-goals - Static archive decoding only: do not launch the target or instantiate its views. - Do not extract or write archive contents implicitly; use the existing explicit artifact extraction boundary when needed. - Preserve original artifact hashes, occurrence paths, and provider limitations. - Do not promise pixel-perfect runtime rendering from archived constraints alone; trait collections, code-created views, and runtime state may affect the final screen. - Do not infer reachability from a storyboard identifier alone. ## Alternatives considered - `strings`, Objective-C/Swift metadata, and controller decompilation recover useful names and code behavior but not the complete authored UI graph. - `ibtool` is useful for source interface documents but refuses compiled nib archives. - Runtime screenshot capture can show rendered states but does not replace the archive's authored connections or constraints and requires a separately authorized runtime workflow. ## Possible direction Add an Apple interface archive parser to the artifact provider, or a dedicated read-only UI-resource capability. Normalize relationships into the artifact graph and preserve raw archive object IDs and decode provenance so claims can be traced back to the shipped resource. ## References - Apple Interface Builder command-line tool: https://developer.apple.com/library/archive/recipes/xcode_help-IBCommandLineTool/chapters/Introduction.html - Related bounded Objective-C runtime observation: #385
bsakaguchi 2026-10-15 18:23:04 +00:00
Author
Owner

@morluto commented on GitHub (Oct 2, 2026):

Additional reverse-engineering evidence may help shape the decoder's supported visual-property output and fixtures. A real bundled Apple app contained 460 compiled .nib archives. A static census recovered 1,615 UIFont records, 1,256 UIColor records, and 33 distinct archived color tuples. Those records exposed useful authored fonts, point sizes, alpha values, and view bounds for screens and reusable controls.

The same investigation also showed the evidence boundary: archived properties did not establish the final appearance of custom drawRect controls or their pressed/selected states. Those required separate native-code analysis and screenshots. It would be useful for this decoder to return supported authored style values with object-level provenance, while preserving unsupported custom classes and runtime-dependent styling as explicit unknowns. This kind of bundle corpus should be a good coverage fixture for nested archives, repeated reusable controls, and exact truncation accounting.

<!-- gh-comment-id:5957818243 --> @morluto commented on GitHub (Oct 2, 2026): Additional reverse-engineering evidence may help shape the decoder's supported visual-property output and fixtures. A real bundled Apple app contained 460 compiled `.nib` archives. A static census recovered 1,615 `UIFont` records, 1,256 `UIColor` records, and 33 distinct archived color tuples. Those records exposed useful authored fonts, point sizes, alpha values, and view bounds for screens and reusable controls. The same investigation also showed the evidence boundary: archived properties did not establish the final appearance of custom `drawRect` controls or their pressed/selected states. Those required separate native-code analysis and screenshots. It would be useful for this decoder to return supported authored style values with object-level provenance, while preserving unsupported custom classes and runtime-dependent styling as explicit unknowns. This kind of bundle corpus should be a good coverage fixture for nested archives, repeated reusable controls, and exact truncation accounting.
Author
Owner

@morluto commented on GitHub (Oct 8, 2026):

Verified fixed on main (7a7460f0). NibArchive.ts + InterfaceBuilderAnalysis ship storyboard/nib to UI graph decoding with NibArchive.test.ts passing (3/3). Closing per audit.

<!-- gh-comment-id:6071373204 --> @morluto commented on GitHub (Oct 8, 2026): Verified fixed on main (7a7460f0). NibArchive.ts + InterfaceBuilderAnalysis ship storyboard/nib to UI graph decoding with NibArchive.test.ts passing (3/3). Closing per audit.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#256
No description provided.