ota

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockSpecial     entryType = 'B'
	CharacterSpecial entryType = 'C'
	Directory        entryType = 'D'
	RegularFile      entryType = 'F'
	SymbolicLink     entryType = 'L'
	Metadata         entryType = 'M'
	Fifo             entryType = 'P'
	Socket           entryType = 'S'
)
View Source
const HeaderLen = 12

HeaderLen provides the length of the xz file header.

View Source
const (
	RIDIFF10Magic = 0x3031464649444952
)

Variables

This section is empty.

Functions

func Extract

func Extract(otaZIP, extractPattern, folder string) error

Extract extracts and decompresses OTA payload files

func List

func List(otaZIP string) ([]os.FileInfo, error)

List lists the files in the OTA payloads

func ListZip

func ListZip(otaZIP string) ([]os.FileInfo, error)

ListZip lists the files in the OTA zip file

func NewXZReader

func NewXZReader(r io.Reader) (io.ReadCloser, error)

NewXZReader uses the xz command to extract the Apple Archives (xz streams) or falls back to the pure Golang xz decompression lib

func Parse

func Parse(payload *zip.File, folder, extractPattern string) (bool, string, error)

Parse parses a ota payload file inside the zip

func RemoteExtract

func RemoteExtract(zr *zip.Reader, extractPattern, destPath string, shouldStop func(string) bool) error

RemoteExtract extracts and decompresses remote OTA payload files

func RemoteList

func RemoteList(zr *zip.Reader) ([]os.FileInfo, error)

RemoteList lists the files in a remote ota payloads

Types

type Control

type Control struct {
	Offset uint64
	Size   uint64
}

type Entry

type Entry struct {
	Type entryType   // entry type
	Path string      // entry path
	Link string      // link path
	Uid  uint16      // user id
	Gid  uint16      // group id
	Mod  fs.FileMode // access mode
	Flag uint32      // BSD flags
	Mtm  time.Time   // modification time
	Size uint32      // file data size
	Aft  byte
	Afr  uint32
	Fli  uint32
}

Entry is a YAA entry type

type Extent

type Extent struct {
	Offset uint64
	Size   uint64
}

type Fork

type Fork struct {
	Size        uint64
	Compressed  uint64
	Variant     uint64
	ExtentIndex uint64 // I think
	ExtentCount uint64
	Algorithm   uint8
	ForkHeader  uint64 // all zeros

}

type ForkChunk

type ForkChunk struct {
	Size  uint32
	Total uint64
}

type MetaData

type MetaData struct {
	Extents []Extent
	Forks   []Fork
	// contains filtered or unexported fields
}

type RIDIFF10

type RIDIFF10 struct {
	PatchDataOffset []uint64 // len(Variants)
	PatchSize       uint64
	MetaData        []byte
	Controls        []Control
	PatchData       [][]byte
	// contains filtered or unexported fields
}

func ParseRawImageDiff10

func ParseRawImageDiff10(r *bytes.Reader) (*RIDIFF10, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL