nbu

package
v0.0.0-...-51513de Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2017 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecFS = iota
	SecContacts
	SecGroups
	SecCalendar
	SecMemo
	SecMessages
	SecMMS
	SecBookmarks
	SecSettingsContacts
	SecSettingsCalendar
	SecERROR
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	BackupTime time.Time
	IMEI       string
	Model      string
	Name       string
	Firmware   string
	Language   string

	Sections []Section
}

A FileInfo describes a NBU archive metadata.

type Reader

type Reader struct {
	File interface {
		io.ReaderAt
		io.Closer
	}
	Size int64
}

func OpenFile

func OpenFile(filename string) (*Reader, error)

OpenFile opens a NBU archive for reading.

func (*Reader) Close

func (r *Reader) Close() error

Close closes the underlying file of r.

func (*Reader) Info

func (r *Reader) Info() (info FileInfo, err error)

Info reads archive metadata and TOC.

func (*Reader) ReadMMSFolderAt

func (r *Reader) ReadMMSFolderAt(off int64) (title string, messages [][]byte, err error)

func (*Reader) ReadMessageFolderAt

func (r *Reader) ReadMessageFolderAt(off int64) (title string, messages []string, err error)

type Section

type Section struct {
	Type int
	GUID [2]uint64

	Offset int64
	Length int64

	// For memos, calendar
	Items int64

	// For messages
	Folders map[int]int64 // idx => offset
}

Jump to

Keyboard shortcuts

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