afc

package
v1.0.150 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Afc_magic                              uint64 = 0x4141504c36414643
	Afc_header_size                        uint64 = 40
	Afc_operation_status                   uint64 = 0x00000001
	Afc_operation_data                     uint64 = 0x00000002
	Afc_operation_read_dir                 uint64 = 0x00000003
	Afc_operation_remove_path              uint64 = 0x00000008
	Afc_operation_make_dir                 uint64 = 0x00000009
	Afc_operation_file_info                uint64 = 0x0000000A
	Afc_operation_device_info              uint64 = 0x0000000B
	Afc_operation_file_open                uint64 = 0x0000000D
	Afc_operation_file_close               uint64 = 0x00000014
	Afc_operation_file_write               uint64 = 0x00000010
	Afc_operation_file_open_result         uint64 = 0x0000000E
	Afc_operation_file_read                uint64 = 0x0000000F
	Afc_operation_remove_path_and_contents uint64 = 0x00000022
)
View Source
const (
	Afc_Mode_RDONLY   uint64 = 0x00000001
	Afc_Mode_RW       uint64 = 0x00000002
	Afc_Mode_WRONLY   uint64 = 0x00000003
	Afc_Mode_WR       uint64 = 0x00000004
	Afc_Mode_APPEND   uint64 = 0x00000005
	Afc_Mode_RDAPPEND uint64 = 0x00000006
)
View Source
const (
	Afc_Err_Success                = 0
	Afc_Err_UnknownError           = 1
	Afc_Err_OperationHeaderInvalid = 2
	Afc_Err_NoResources            = 3
	Afc_Err_ReadError              = 4
	Afc_Err_WriteError             = 5
	Afc_Err_UnknownPacketType      = 6
	Afc_Err_InvalidArgument        = 7
	Afc_Err_ObjectNotFound         = 8
	Afc_Err_ObjectIsDir            = 9
	Afc_Err_PermDenied             = 10
	Afc_Err_ServiceNotConnected    = 11
	Afc_Err_OperationTimeout       = 12
	Afc_Err_TooMuchData            = 13
	Afc_Err_EndOfData              = 14
	Afc_Err_OperationNotSupported  = 15
	Afc_Err_ObjectExists           = 16
	Afc_Err_ObjectBusy             = 17
	Afc_Err_NoSpaceLeft            = 18
	Afc_Err_OperationWouldBlock    = 19
	Afc_Err_IoError                = 20
	Afc_Err_OperationInterrupted   = 21
	Afc_Err_OperationInProgress    = 22
	Afc_Err_InternalError          = 23
	Afc_Err_MuxError               = 30
	Afc_Err_NoMemory               = 31
	Afc_Err_NotEnoughData          = 32
	Afc_Err_DirNotEmpty            = 33
)

Variables

This section is empty.

Functions

func Encode added in v1.0.71

func Encode(packet AfcPacket, writer io.Writer) error

Types

type AFCDeviceInfo added in v1.0.84

type AFCDeviceInfo struct {
	Model      string
	TotalBytes uint64
	FreeBytes  uint64
	BlockSize  uint64
}

type AfcPacket added in v1.0.71

type AfcPacket struct {
	Header        AfcPacketHeader
	HeaderPayload []byte
	Payload       []byte
}

func Decode added in v1.0.71

func Decode(reader io.Reader) (AfcPacket, error)

type AfcPacketHeader added in v1.0.71

type AfcPacketHeader struct {
	Magic         uint64
	Entire_length uint64
	This_length   uint64
	Packet_num    uint64
	Operation     uint64
}

type Connection

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

func New added in v1.0.71

func New(device ios.DeviceEntry) (*Connection, error)

func NewFromConn

func NewFromConn(deviceConn ios.DeviceConnectionInterface) *Connection

NewFromConn allows to use AFC on a DeviceConnectionInterface, see crashreport for an example

func (*Connection) Close

func (conn *Connection) Close()

func (*Connection) CloseFile added in v1.0.109

func (conn *Connection) CloseFile(fd uint64) error

func (*Connection) GetSpaceInfo added in v1.0.84

func (conn *Connection) GetSpaceInfo() (*AFCDeviceInfo, error)

func (*Connection) ListFiles

func (conn *Connection) ListFiles(cwd string, matchPattern string) ([]string, error)

ListFiles returns all files in the given directory, matching the pattern. Example: ListFiles(".", "*") returns all files and dirs in the current path the afc connection is in

func (*Connection) MkDir added in v1.0.71

func (conn *Connection) MkDir(path string) error

func (*Connection) OpenFile added in v1.0.109

func (conn *Connection) OpenFile(path string, mode uint64) (uint64, error)

func (*Connection) Pull added in v1.0.71

func (conn *Connection) Pull(srcPath, dstPath string) error

func (*Connection) PullSingleFile added in v1.0.71

func (conn *Connection) PullSingleFile(srcPath, dstPath string) error

func (*Connection) Push added in v1.0.71

func (conn *Connection) Push(srcPath, dstPath string) error

func (*Connection) Remove added in v1.0.71

func (conn *Connection) Remove(path string) error

func (*Connection) RemoveAll added in v1.0.104

func (conn *Connection) RemoveAll(srcPath string) error

func (*Connection) RemovePathAndContents added in v1.0.107

func (conn *Connection) RemovePathAndContents(path string) error

func (*Connection) Stat added in v1.0.71

func (conn *Connection) Stat(path string) (*statInfo, error)

func (*Connection) TreeView added in v1.0.71

func (conn *Connection) TreeView(dpath string, prefix string, treePoint bool) error

func (*Connection) WriteToFile added in v1.0.107

func (conn *Connection) WriteToFile(reader io.Reader, dstPath string) error

Jump to

Keyboard shortcuts

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