Home

Awesome

bom

Apple iOS / macOS Assets.car decoder, write in golang.

ipa-server use this to decode app icons in Assets.cart

Decode bom file

import "github.com/iineva/bom/pkg/bom"

fileName := "Assets.car"
f, _ := os.Open(fileName)
defer f.Close()
b := bom.New(f)
err := b.Parse() // parse header first

// read block names
names := b.BlockNames()
// read block
r, err := b.ReadBlock(names[0])
// read tree block
err := b.ReadTree("FACETKEYS", func(k io.Reader, d io.Reader) error {
    // handle tree block item
})

Decode Asset Catalog

import "github.com/iineva/bom/pkg/asset"

fileName := "Assets.car"
f, _ := os.Open(fileName)
defer f.Close()
b, _ := asset.NewWithReadSeeker(f)
// read image with name
img, err := b.Image("AppIcon")

Reference