ota

package
v0.0.0-prerelease Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderLen = 12

HeaderLen provides the length of the xz file header.

View Source
const (
	MagicYaa1Header = 0x31414159 // "YAA1"

)

Variables

This section is empty.

Functions

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) ([]string, 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 AA

type AA struct {
	Reader
	// contains filtered or unexported fields
}

func NewOTA

func NewOTA(r io.ReaderAt, size int64) (*AA, error)

func Open

func Open(name string, conf *Config) (*AA, error)

Open opens an OTA file with optional configuration If conf is nil, default configuration is used (automatic key lookup)

func (*AA) Close

func (a *AA) Close() error

Close closes the AA file, rendering it unusable for I/O.

func (*AA) Info

func (a *AA) Info() (*info.Info, error)

type Config

type Config struct {
	// SymmetricKey is the base64-encoded AEA symmetric encryption key
	SymmetricKey string
	// Proxy to use when fetching AEA keys
	Proxy string
	// Insecure allows insecure connections when fetching AEA keys
	Insecure bool
}

Config holds optional configuration for opening OTA files

type File

type File struct {
	// contains filtered or unexported fields
}

func (*File) Base

func (f *File) Base() string

func (*File) IsDir

func (f *File) IsDir() bool

func (*File) ModTime

func (f *File) ModTime() time.Time

func (*File) Mode

func (f *File) Mode() fs.FileMode

func (*File) Name

func (f *File) Name() string

func (*File) Open

func (f *File) Open(decomp bool) (io.ReadCloser, error)

func (*File) Size

func (f *File) Size() int64

func (*File) Stat

func (f *File) Stat() (fs.FileInfo, error)

func (*File) Sys

func (f *File) Sys() any

func (*File) Type

func (f *File) Type() fs.FileMode

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

A Reader serves content from a Apple Archive.

func (*Reader) ExtractCryptex

func (r *Reader) ExtractCryptex(cryptex, output string) (string, error)

func (*Reader) ExtractFromCryptexes

func (r *Reader) ExtractFromCryptexes(pattern, output string) ([]string, error)

func (*Reader) Files

func (r *Reader) Files() []*File

func (*Reader) GetPayloadFiles

func (r *Reader) GetPayloadFiles(pattern, payloadRange, output string) error

func (*Reader) Open

func (r *Reader) Open(name string, decomp bool) (fs.File, error)

Open opens the named file in the ZIP archive, using the semantics of fs.FS.Open: paths are always slash separated, with no leading / or ../ elements.

func (*Reader) OpenInPayload

func (r *Reader) OpenInPayload(name string) (fs.File, error)

func (*Reader) PayloadFiles

func (r *Reader) PayloadFiles(pattern string, json bool) error

func (*Reader) PostFiles

func (r *Reader) PostFiles() []fs.FileInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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