Skip to content

feat(export)!: census and export the APK's built-in Unity files - #60

Merged
nichinichisou0609 merged 1 commit into
redesign/depotfrom
redesign/apk-builtins
Oct 14, 2026
Merged

nichinichisou0609 merged 1 commit into
redesign/depotfrom
redesign/apk-builtins

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Collaborator

Summary

  • With [paths] apk set, the player's own Unity files under assets/bin/Data/ (data.unity3d, datapack.unity3d, Resources/unity default resources) are subjects of unity.census and unity.export, named apk/<path>. The census always covers them; everything and --select bundle:apk/* export them.
  • A serialized file outside a bundle is loaded under the name references into it use, so unity_builtin_extra:12 or unity default resources:10 name exported objects, and link.addresses maps these files to their subjects.
  • Files without type trees: MonoBehaviours are read with the type trees nnnotes ships (nnnotes.unity.scripttypes, moved out of unity.player), checked by stored type hash and object size; the task context carries the trees used. Others give their header with unsupported.typetree; PlayerSettings gives its fields up to m_ActiveColorSpace. generic.json is version 2.
  • The CRI stages take boot from the built-in inputs.
  • Docs: stages (new section and reason code), configuration, architecture.

Test plan

  • ruff, pyright, import-linter, mkdocs --strict
  • full test suite
  • golden fixtures: artifacts and items unchanged; records regenerated for the converter version and checked with GOLDENS_STRICT=1
  • new synthetic tests: built-in inputs, census naming, export with shipped type trees (fit, missing, other hash, prefab components, prefix read), selection, CLI export and address table

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

With `[paths] apk` set, the player's own Unity files under
`assets/bin/Data/` of the APK are subjects of unity.census and
unity.export: `apk/data.unity3d`, `apk/datapack.unity3d` and
`apk/Resources/unity default resources`. The census always covers them;
everything and `--select bundle:apk/*` export them. A serialized file
outside a bundle is loaded under the name references into it use, so
object ids such as `unity_builtin_extra:12` and
`unity default resources:10` name objects these tasks export, and
link.addresses maps their files to their subjects.

These files store no type trees. MonoBehaviours are read with the type
trees nnnotes ships for the game's classes (nnnotes.unity.scripttypes),
checked against the stored type hash and the object's size; the export
task's context carries the trees its objects use. A MonoBehaviour
without one gives its header with `unsupported.typetree`, and
PlayerSettings gives its fields up to `m_ActiveColorSpace`, the part its
type tree reads right. generic.json is version 2.

The CRI stages take their `boot` input from the built-in inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nichinichisou0609
nichinichisou0609 merged commit a3f2967 into redesign/depot Oct 14, 2026
8 checks passed
@nichinichisou0609
nichinichisou0609 deleted the redesign/apk-builtins branch October 14, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant