The iphone module

The iphone module contains the necessary classes for creating a concrete connection which is responsible for managing the connection between pysiriproxy and the iPhone.

The _iPhone class

Inheritance diagram of pysiriproxy.connections.iphone._iPhone

class pysiriproxy.connections.iphone._iPhone(logger)[source]

The _iPhone class manages the SSL connection to Siri on the iPhone client. It processes requests from Siri and forwards them to Apple’s server, and then intercepts the response and provides the ability to inject custom responses.

connectionLost(reason)[source]

Called when the connection is lost.

  • reason – The reason the connection was lost
connectionMade()[source]

Called when a connection is made.

reconnectServer()[source]

Disconnect and then re-connect the server connection.

The Connection class

Inheritance diagram of pysiriproxy.connections.iphone.Connection

class pysiriproxy.connections.iphone.Connection(name, direction, logger, logColor=0)

The Connection class implements the base functionaltiy for creating a concrete twisted internet protocol which is able to receive data in the form of lines.

This base class implements the functionality of receiving data from the iPhone or from Apple’s web server. The iPhone Apple’s web server transmit plist objects which are compressed using zlib compression. This class implements the necessary functionality for receiving the data, and decompressing it to retrieve the plist object data that is being transmitted.

The Connection objects are connected to the connections.ConnectionManager which provides the ability for one Connection to forward data to another Connection.

Note

This class is intended to be subclassed to create a connection between two specific machines.

connectionFailed(reason)

This function is called when a connection failed.

  • reason – The reason the connection was lost
connectionLost(reason)

This function is called when a connection is lost.

  • reason – The reason the connection was lost
connectionMade()

This function is called when a connection is made.

getConnectionManager()

Get the ConnectionManager object for this Connection.

getDirection()

Get the direction for this connection.

getMode()

Get the current receiving mode the server is in.

getRefId()

Get the most recently used reference id.

injectObjectToOutputStream(obj)

Inject the given object into the output stream of this connection. This effectively sends the object to the foward destination connection for this connection.

  • obj – The object to inject into the output stream
lineReceived(line)

This function is called when a line of data is received.

  • line – The line of data
rawDataReceived(data)

This function is called when raw data is received.

  • data – The raw data
reset()

Reset this connection.

setLineMode()

Set the server to receive lines.

setRawMode()

Set the server to receive raw data.

setRefId(refId)

Set the reference id.

  • refId – The reference id

The _Factory class

Inheritance diagram of pysiriproxy.connections.iphone._Factory

class pysiriproxy.connections.iphone._Factory(logger)[source]

The _Factory class is responsible for creating an _iPhone connection.

buildProtocol(addr)[source]

build the protocol for an _iPhone connection.

  • _addr – The address

Table Of Contents

Previous topic

The connections module

Next topic

The manager module

This Page