Skip to content

v1.3.4 Improve Archive Command and update UnityFileSystemAPI#62

Open
SkowronskiAndrew wants to merge 8 commits intomainfrom
next
Open

v1.3.4 Improve Archive Command and update UnityFileSystemAPI#62
SkowronskiAndrew wants to merge 8 commits intomainfrom
next

Conversation

@SkowronskiAndrew
Copy link
Copy Markdown
Collaborator

@SkowronskiAndrew SkowronskiAndrew commented Apr 2, 2026

Example of new info command with an AssetBundle:

$ UnityDataTool archive info .\scenes
Unity Version                  2019.4.0f1
File Size                      70,290 bytes
Data Size                      70,123 bytes
Uncompressed Data Size         307,872 bytes
Compression Ratio              4.39x
Compression                    Lzma
Block Count                    1
File Count                     4
Serialized File Count          4

Example output from a small compressed player build

=== data.unity3d ===
--- header ---
Signature                      UnityFS
Version                        8
Unity Version                  6000.2.0a7
File Size                      3,033,272 bytes
Compressed Metadata Size       488
Uncompressed Metadata Size     934
Metadata Compression           Lz4HC
Flags                          BlocksAndDirectoryInfoCombined, BlockInfoNeedPaddingAtStart

--- blocks ---
Blocks: 67
  #0    Offset: 560  Uncompressed: 131,072  Compressed: 65,983  Compression: Lz4HC
  #1    Offset: 66,543  Uncompressed: 131,072  Compressed: 38,895  Compression: Lz4HC
  #2    Offset: 105,438  Uncompressed: 131,072  Compressed: 27,302  Compression: Lz4HC
  #3    Offset: 132,740  Uncompressed: 131,072  Compressed: 35,741  Compression: Lz4HC
  #4    Offset: 168,481  Uncompressed: 131,072  Compressed: 28,373  Compression: Lz4HC

<snip similar lines> 

  #64   Offset: 2,975,373  Uncompressed: 131,072  Compressed: 17,748  Compression: Lz4HC
  #65   Offset: 2,993,121  Uncompressed: 131,072  Compressed: 35,650  Compression: Lz4HC
  #66   Offset: 3,028,771  Uncompressed: 8,660  Compressed: 4,501  Compression: Lz4HC

--- list ---
globalgamemanagers
  Offset: 0
  Size: 115316
  Flags: SerializedFile

Resources/unity_builtin_extra
  Offset: 115316
  Size: 339424
  Flags: SerializedFile

globalgamemanagers.assets
  Offset: 454740
  Size: 7665720
  Flags: SerializedFile

sharedassets0.assets
  Offset: 8120460
  Size: 532924
  Flags: SerializedFile

level0
  Offset: 8653384
  Size: 2960
  Flags: SerializedFile

resources.assets
  Offset: 8656344
  Size: 3068
  Flags: SerializedFile

And JSON versions also available for header, list and blocks

{
  "signature": "UnityFS",
  "version": 8,
  "unityVersion": "6000.2.0a7",
  "fileSize": 3033272,
  "compressedMetadataSize": 488,
  "uncompressedMetadataSize": 934,
  "metadataCompression": "Lz4HC",
  "flags": [
    "BlocksAndDirectoryInfoCombined",
    "BlockInfoNeedPaddingAtStart"
  ]
}


{
  "blocks": [
    {
      "index": 0,
      "offset": 560,
      "uncompressedSize": 131072,
      "compressedSize": 65983,
      "compression": "Lz4HC",
      "isStreamed": false
    },
...
<snip>


[
  {
    "path": "globalgamemanagers",
    "offset": 0,
    "size": 115316,
    "flags": "SerializedFile"
  },
  {
    "path": "Resources/unity_builtin_extra",
    "offset": 115316,
    "size": 339424,
    "flags": "SerializedFile"
  },
<snip>

Add P/Invoke declarations and public wrappers for 7 missing native API
functions: GetDllVersion, GetUnityVersion, GetSerializedFileVersion,
GetTypeTreeCount, GetTypeTreeInfo, GetTypeTreeByIndex, and
RemoveTypeTreeSource. Also adds TypeTreeCategory enum and TypeTreeInfo
struct. Fixes TypeTreeInfo name ambiguity in SerializedFileCommands.
Move all WebBundle-specific code (detection, parsing, extraction,
listing) out of Archive.cs into a dedicated WebBundleHelper class.
Archive now delegates to WebBundleHelper for web bundle operations.
Add -f/--format option to "archive list" supporting Text (default) and
Json output, matching the existing serialized-file commands. Includes
tests for both AssetBundle and WebBundle archive types in both formats,
plus an extract test with file size verification.
Parse and print the header for Unity Archive files.  This is similar to the header command already implemented for serialized files.
Useful to extract just a single file or group of files out of an archive
Summarize the key metrics about the archive
Add an example compressed player file (used to test info and useful for manual testing)
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