xpc

package
v1.0.154 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 10 Imported by: 4

Documentation

Overview

Package xpc contains a connection stuct and the codec for the xpc protocol. The xpc protocol is used to communicate with services on iOS17+ devices.

Index

Constants

View Source
const (
	AlwaysSetFlag        = uint32(0x00000001)
	DataFlag             = uint32(0x00000100)
	HeartbeatRequestFlag = uint32(0x00010000)
	HeartbeatReplyFlag   = uint32(0x00020000)
	FileOpenFlag         = uint32(0x00100000)
	InitHandshakeFlag    = uint32(0x00400000)
)

Variables

This section is empty.

Functions

func EncodeMessage added in v1.0.122

func EncodeMessage(w io.Writer, message Message) error

EncodeMessage creates a RemoteXPC message encoded with the body and flags provided

Types

type Connection added in v1.0.122

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

Connection represents a http2 based connection to an XPC service on an iOS17 device.

func New added in v1.0.122

func New(clientServer io.ReadWriter, serverClient io.ReadWriter, closer io.Closer) (*Connection, error)

New creates a new connection to an XPC service on an iOS17 device.

func (*Connection) Close added in v1.0.122

func (c *Connection) Close() error

func (*Connection) ReceiveOnClientServerStream added in v1.0.122

func (c *Connection) ReceiveOnClientServerStream() (map[string]interface{}, error)

func (*Connection) ReceiveOnServerClientStream added in v1.0.122

func (c *Connection) ReceiveOnServerClientStream() (map[string]interface{}, error)

func (*Connection) Send added in v1.0.122

func (c *Connection) Send(data map[string]interface{}, flags ...uint32) error

Send sends the passed data as XPC message. Additional flags can be passed via the flags argument (the default ones are AlwaysSetFlag and if data != nil DataFlag)

type FileTransfer added in v1.0.122

type FileTransfer struct {
	MsgId        uint64
	TransferSize uint64
}

type Message

type Message struct {
	Flags uint32
	Body  map[string]interface{}
	Id    uint64
}

func DecodeMessage

func DecodeMessage(r io.Reader) (Message, error)

DecodeMessage expects a full RemoteXPC message and decodes the message body into a map

func (Message) IsFileOpen added in v1.0.122

func (m Message) IsFileOpen() bool

Jump to

Keyboard shortcuts

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