backup

package
v0.0.0-...-922514a Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 23 Imported by: 1

Documentation

Overview

Package backup wraps an iOS backup directory.

Index

Constants

View Source
const BackupVersioniOS10 string = "3.0"
View Source
const BackupVersioniOS101 string = "3.1"
View Source
const BackupVersioniOS102 string = "3.2"

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

type Backup struct {
	DeviceName string
	FileName   string
	Date       time.Time
	Version    string
	Device     string
	Encrypted  bool
}

func Enumerate

func Enumerate(pathToBackups string) ([]Backup, error)

Enumerate lists the available backups

type DBReader

type DBReader struct {
	io.Reader
	// contains filtered or unexported fields
}

type Manifest

type Manifest struct {
	BackupKeyBag []byte
	Lockdown     struct {
		DeviceName     string
		ProductVersion string
		ProductType    string
	}
	Applications map[string]map[string]interface{}
	Date         time.Time
	IsEncrypted  bool
	ManifestKey  []byte // this is wrapped
}

type MetaData

type MetaData struct {
	Mode          uint16
	Inode         uint64
	Uid           uint32
	Gid           uint32
	Mtime         uint32
	Atime         uint32
	Ctime         uint32
	Length        uint64
	ProtClass     uint8
	PropertyCount uint8
}

type MobileBackup

type MobileBackup struct {
	Dir      string
	Manifest Manifest
	Records  []Record
	Keybag   keybag.Keybag
	Version  string

	BlobKey []byte
}

MobileBackup encapsulates a mobile backup manifest

func Open

func Open(pathToBackups string, guid string) (*MobileBackup, error)

Open opens a MobileBackup directory corresponding to a given guid.

func (*MobileBackup) Domains

func (mb *MobileBackup) Domains() []string

Domains lists the file domains in a backup manifest.

func (*MobileBackup) FileKey

func (mb *MobileBackup) FileKey(rec Record) []byte

FileKey finds the key for a given file record

func (*MobileBackup) FileReader

func (mb *MobileBackup) FileReader(rec Record) (io.ReadCloser, error)

FileReader returns an io.Reader for the unencrypted contents of a file record

func (*MobileBackup) Load

func (mb *MobileBackup) Load() error

Load loads the backup. It must be called after "SetPassword" for ios 10.2+ encrypted backups, and must be called before attempting to use any other methods on MobileBackup.

func (*MobileBackup) ReadFile

func (mb *MobileBackup) ReadFile(rec Record) ([]byte, error)

ReadFile reads the contents of an encrypted file.

func (*MobileBackup) SetPassword

func (mb *MobileBackup) SetPassword(pass string) error

SetPassword decrypts the keychain.

type Record

type Record struct {
	MetaData
	Domain     string
	Path       string
	LinkTarget string
	Digest     []byte
	Key        []byte
	Properties map[string][]byte
}

func (*Record) HashCode

func (r *Record) HashCode() string

type StatusPlist

type StatusPlist struct {
	Version string
}

StatusPlist encapsulates a mobile backup status file

Jump to

Keyboard shortcuts

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