manager

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountInvalid = errors.New("account invalid")
View Source
var ErrCertificateResetRequired = errors.New("certificate reset required")

ErrCertificateResetRequired marks an Apple ID installation that stopped because the account holds as many signing certificates as Apple allows and revoking one was not authorized. The engine revoked nothing; a user has to pick a certificate on the install page first.

Functions

func CheckAfcServiceStatus

func CheckAfcServiceStatus(udid string) error

func CheckDeviceStatus added in v0.2.5

func CheckDeviceStatus(udid string) error

func CleanUploadTempFiles added in v0.6.0

func CleanUploadTempFiles(files ...string)

CleanUploadTempFiles removes the given upload temp files without needing an InstallManager instance. Paths outside the upload temp directory are skipped.

func DeleteAccountDevice added in v0.3.0

func DeleteAccountDevice(email, deviceID string) error

func ExportCertificate added in v0.3.0

func ExportCertificate(email, password string) ([]byte, error)

func GetAccountDevices added in v0.3.0

func GetAccountDevices(email string) ([]model.AccountDevice, error)

func GetAppleAccounts added in v0.3.0

func GetAppleAccounts() (*model.Accounts, error)

func GetCertificates added in v0.3.0

func GetCertificates(email string) ([]model.Certificate, error)

func GetDeviceByID

func GetDeviceByID(id string) (*model.Device, bool)

func GetDeviceByUDID added in v0.3.0

func GetDeviceByUDID(udid string) (*model.Device, bool)

func GetDeviceDetail added in v0.4.0

func GetDeviceDetail(id string) (*model.Device, bool)

func GetDeviceInfo added in v0.3.0

func GetDeviceInfo(dev *model.Device) (*model.DeviceInfo, error)

GetDeviceInfo queries the device for its lockdown values, including the hardware UniqueDeviceID.

func GetDevices

func GetDevices() ([]model.Device, error)

func GetRunEnvs added in v0.3.0

func GetRunEnvs() []string

func ImportCertificate added in v0.3.0

func ImportCertificate(email, password string, p12 []byte) error

func ImportPairingFile added in v0.3.0

func ImportPairingFile(ip string, port string, data []byte) error

func LogoutAppleAccount added in v0.3.0

func LogoutAppleAccount(email string) error

func ReleaseUploadTempFiles added in v0.6.0

func ReleaseUploadTempFiles(paths ...string)

ReleaseUploadTempFiles drops the ownership marks of ReserveUploadTempFiles, letting stale-file sweeps remove the files again.

func ReloadDevices

func ReloadDevices()

func ReserveUploadTempFiles added in v0.6.0

func ReserveUploadTempFiles(paths ...string)

ReserveUploadTempFiles marks upload temp files as owned by a queued or running installation so that stale-file sweeps keep them. Remote URLs and unresolvable paths are ignored.

func RevokeCertificate added in v0.3.0

func RevokeCertificate(email string, serialNumber string) error

func ScanDevices

func ScanDevices()

func ScanServices added in v0.3.0

func ScanServices(ctx context.Context, callback func(serviceType string, name string, host string, address string, port uint16, txt [][]byte)) error

func ScanWirelessDevices added in v0.3.0

func ScanWirelessDevices(ctx context.Context, timeout time.Duration) ([]model.Device, error)

func ScreenshotDataBase64 added in v0.4.3

func ScreenshotDataBase64(png []byte) string

ScreenshotDataBase64 returns the base64 encoding of the screenshot bytes.

func ScreenshotFilename added in v0.6.0

func ScreenshotFilename(now time.Time) string

ScreenshotFilename builds the filename offered when a screenshot is downloaded as an attachment.

func SetDeviceConnectedCallback added in v0.3.0

func SetDeviceConnectedCallback(callback func(device model.Device))

SetDeviceConnectedCallback Set the callback function for device connection (exported function)

func SetDeviceDisconnectedCallback added in v0.3.0

func SetDeviceDisconnectedCallback(callback func(device model.Device))

SetDeviceDisconnectedCallback Set the callback function for device disconnection (exported function)

func StartDeviceManager

func StartDeviceManager()

func StopDeviceManager added in v0.3.0

func StopDeviceManager()

func UploadTempFileReserved added in v0.6.0

func UploadTempFileReserved(path string) bool

UploadTempFileReserved reports whether the upload temp file at path is owned by a queued or running installation and must be kept by stale-file sweeps.

Types

type AccountManager added in v0.3.0

type AccountManager struct{}

func (*AccountManager) DeleteAccountDevice added in v0.3.0

func (am *AccountManager) DeleteAccountDevice(email, deviceID string) error

func (*AccountManager) GetAccountDevices added in v0.3.0

func (am *AccountManager) GetAccountDevices(email string) ([]model.AccountDevice, error)

func (*AccountManager) GetAccounts added in v0.3.0

func (am *AccountManager) GetAccounts() (*model.Accounts, error)

GetAccounts reads account file and returns simplified account info. The accounts.json may be an array or an object; normalize both to a slice.

func (*AccountManager) LogoutAccount added in v0.3.0

func (am *AccountManager) LogoutAccount(email string) error

type CertificateManager added in v0.3.0

type CertificateManager struct{}

func (*CertificateManager) ExportCertificate added in v0.3.0

func (m *CertificateManager) ExportCertificate(email, password, path string) (string, error)

func (*CertificateManager) GetCertificates added in v0.3.0

func (m *CertificateManager) GetCertificates(email string) ([]model.Certificate, error)

func (*CertificateManager) ImportCertificate added in v0.3.0

func (m *CertificateManager) ImportCertificate(email, password string, p12 []byte) error

ImportCertificate imports the certificate of the PKCS#12 file p12 for email through the signing engine.

The file is decoded in process and written again as a legacy PKCS#12 file before the engine runs. SideStore's "Export Full (.p12)" stores the private key as a plain keyBag without a MAC, which the engine's reader reports as holding no private key.

password only decodes the input here: the engine is handed the throwaway password of the re-wrapped file, so the password of the user never reaches the command line or the debug log. The input is never written to disk; only the re-wrapped copy is, for the duration of the engine run.

func (*CertificateManager) RevokeCertificate added in v0.3.0

func (m *CertificateManager) RevokeCertificate(email string, serialNumber string) error

type DeviceManager

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

func (*DeviceManager) AppendProductInfo added in v0.2.5

func (dm *DeviceManager) AppendProductInfo(dev *model.Device, devInfo model.DeviceInfo)

func (*DeviceManager) CheckAfcServiceStatus

func (dm *DeviceManager) CheckAfcServiceStatus(dev *model.Device) error

func (*DeviceManager) CheckDevicePaired added in v0.4.0

func (dm *DeviceManager) CheckDevicePaired(identifier string, authTag string) (*model.RemoteDevice, error)

func (*DeviceManager) CheckDevicePairedContext added in v0.4.8

func (dm *DeviceManager) CheckDevicePairedContext(ctx context.Context, identifier string, authTag string) (*model.RemoteDevice, error)

CheckDevicePairedContext is CheckDevicePaired with a cancellable context: when ctx is cancelled (e.g. the device disconnects), the plumesign subprocess is killed and the goroutine returns promptly.

func (*DeviceManager) DeleteDevice added in v0.3.0

func (dm *DeviceManager) DeleteDevice(id string)

func (*DeviceManager) DeleteDeviceByMacAddr added in v0.3.0

func (dm *DeviceManager) DeleteDeviceByMacAddr(macAddr string)

func (*DeviceManager) DeleteDeviceByServiceName added in v0.4.0

func (dm *DeviceManager) DeleteDeviceByServiceName(serviceName string, conection model.DeviceConnection)

func (*DeviceManager) DeleteDeviceByUDID added in v0.4.0

func (dm *DeviceManager) DeleteDeviceByUDID(udid string)

func (*DeviceManager) GetDeviceByID

func (dm *DeviceManager) GetDeviceByID(id string) (*model.Device, bool)

func (*DeviceManager) GetDeviceByUDID

func (dm *DeviceManager) GetDeviceByUDID(udid string) (*model.Device, bool)

func (*DeviceManager) GetDeviceInfo added in v0.3.0

func (dm *DeviceManager) GetDeviceInfo(dev *model.Device) (*model.DeviceInfo, error)

func (*DeviceManager) GetDevices

func (dm *DeviceManager) GetDevices() []model.Device

func (*DeviceManager) HasCheckedDevice added in v0.4.0

func (dm *DeviceManager) HasCheckedDevice(ip string, port uint16, name string) bool

func (*DeviceManager) ReloadDevices

func (dm *DeviceManager) ReloadDevices()

func (*DeviceManager) SaveDevice added in v0.3.0

func (dm *DeviceManager) SaveDevice(dev model.Device)

func (*DeviceManager) Scan

func (dm *DeviceManager) Scan()

func (*DeviceManager) ScanServices added in v0.3.0

func (dm *DeviceManager) ScanServices(ctx context.Context, callback func(serviceType string, name string, host string, address string, port uint16, txt [][]byte)) error

func (*DeviceManager) ScanWirelessDevices added in v0.3.0

func (dm *DeviceManager) ScanWirelessDevices(ctx context.Context, timeout time.Duration) ([]model.Device, error)

func (*DeviceManager) SetOnDeviceConnected added in v0.3.0

func (dm *DeviceManager) SetOnDeviceConnected(callback func(device model.Device))

SetOnDeviceConnected Set the callback function for device connection

func (*DeviceManager) SetOnDeviceDisconnected added in v0.3.0

func (dm *DeviceManager) SetOnDeviceDisconnected(callback func(device model.Device))

SetOnDeviceDisconnected Set the callback function for device disconnection

func (*DeviceManager) Start

func (dm *DeviceManager) Start()

需要依赖socket套接字: /var/run/dbus /var/run/avahi-daemon

func (*DeviceManager) Stop added in v0.3.0

func (dm *DeviceManager) Stop()

Stop Stop the device manager

type ExternalSigning added in v0.6.0

type ExternalSigning struct {
	CertificatePath string
	PrivateKeyPath  string
	ProfilePath     string
	// OutputPath receives the signed IPA; the engine writes it after installing.
	OutputPath string
	// CustomIdentifier is passed as --custom-identifier=<id> when not empty.
	CustomIdentifier string
	// PairingFile is the remote pairing record of an RSD device. Empty selects
	// the device record of the atvloadly data directory.
	PairingFile string
	// HomeDir and TempDir isolate the engine from the Apple ID accounts and
	// from the staging directories of other installations.
	HomeDir string
	TempDir string
}

ExternalSigning is the materialized signing material of an installation in SigningModeExternalCertificate. Every path lives in the private workspace of the installation, except PairingFile.

type InstallManager added in v0.2.1

type InstallManager struct {
	ProvisioningProfile *model.MobileProvisioningProfile
	// contains filtered or unexported fields
}

func NewInstallManager added in v0.2.1

func NewInstallManager() *InstallManager

func NewInteractiveInstallManager added in v0.2.1

func NewInteractiveInstallManager() *InstallManager

func (*InstallManager) CleanTempFiles added in v0.2.1

func (t *InstallManager) CleanTempFiles(files ...string)

func (*InstallManager) Close added in v0.2.1

func (t *InstallManager) Close()

func (*InstallManager) ErrorLog added in v0.2.1

func (t *InstallManager) ErrorLog() string

func (*InstallManager) GetMobileProvisionPath added in v0.3.0

func (t *InstallManager) GetMobileProvisionPath() string

func (*InstallManager) IsAccountInvalid added in v0.3.1

func (t *InstallManager) IsAccountInvalid() bool

func (*InstallManager) IsSuccess added in v0.3.1

func (t *InstallManager) IsSuccess() bool

func (*InstallManager) NeedsCertificateReset added in v0.6.4

func (t *InstallManager) NeedsCertificateReset() bool

NeedsCertificateReset reports whether the run stopped because a certificate slot had to be freed and the user never authorized revoking one.

func (*InstallManager) OnOutput added in v0.2.1

func (t *InstallManager) OnOutput(fn func(string))

func (*InstallManager) OutputLog added in v0.2.1

func (t *InstallManager) OutputLog() string

func (*InstallManager) ResetLog added in v0.6.0

func (t *InstallManager) ResetLog()

ResetLog clears the captured output. Apple ID runs reset it at every attempt; external certificate installations reset it once per installation so their SIGNING_REPORT lines and every attempt stay in the task log.

func (*InstallManager) SaveLog added in v0.2.5

func (t *InstallManager) SaveLog(id uint)

func (*InstallManager) Start added in v0.2.1

func (t *InstallManager) Start(ctx context.Context, opts InstallOptions) error

Start signs and installs the IPA once with the signing mode of opts. External certificate failures are *signing.Error values classified from the engine output.

func (*InstallManager) TryStart added in v0.2.1

func (t *InstallManager) TryStart(ctx context.Context, opts InstallOptions) error

func (*InstallManager) Write added in v0.2.1

func (t *InstallManager) Write(p []byte)

func (*InstallManager) WriteLog added in v0.2.1

func (t *InstallManager) WriteLog(msg string)

type InstallOptions added in v0.3.1

type InstallOptions struct {
	UDID       string
	IP         string
	Port       uint16
	Account    string
	IpaPath    string
	CustomName string
	// CustomIdentifier is the main bundle identifier the app is installed
	// under, in both signing modes; empty keeps the bundle identifiers of the
	// IPA. The app is a different app on the device for each identifier.
	CustomIdentifier string
	RemoveExtensions bool
	RefreshMode      bool
	// SigningMode selects how the app is signed; empty means SigningModeAppleID.
	SigningMode model.SigningMode
	// External holds the signing material of SigningModeExternalCertificate.
	External *ExternalSigning
	// RevokeCertificateSerial authorizes the engine to revoke this one
	// certificate when the Apple ID account is at its certificate limit.
	// Apple ID mode only; empty keeps every certificate untouched.
	RevokeCertificateSerial string
}

type LoginManager added in v0.3.0

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

func NewLoginManager added in v0.3.0

func NewLoginManager() *LoginManager

func (*LoginManager) Close added in v0.3.0

func (t *LoginManager) Close()

func (*LoginManager) ErrorLog added in v0.3.0

func (t *LoginManager) ErrorLog() string

func (*LoginManager) OnOutput added in v0.3.0

func (t *LoginManager) OnOutput(fn func(string))

func (*LoginManager) OutputLog added in v0.3.0

func (t *LoginManager) OutputLog() string

func (*LoginManager) Start added in v0.3.0

func (t *LoginManager) Start(ctx context.Context, account, password string) error

func (*LoginManager) Write added in v0.3.0

func (t *LoginManager) Write(p []byte)

type PairManager added in v0.2.1

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

func NewPairManager added in v0.2.1

func NewPairManager() *PairManager

func (*PairManager) Close added in v0.2.1

func (t *PairManager) Close()

func (*PairManager) ErrorLog added in v0.2.1

func (t *PairManager) ErrorLog() string

func (*PairManager) OnOutput added in v0.2.1

func (t *PairManager) OnOutput(fn func(string))

func (*PairManager) OutputLog added in v0.2.1

func (t *PairManager) OutputLog() string

func (*PairManager) Start added in v0.2.1

func (t *PairManager) Start(ctx context.Context, device model.Device) error

func (*PairManager) Write added in v0.2.1

func (t *PairManager) Write(p []byte)

type ScreenshotManager added in v0.4.3

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

ScreenshotManager orchestrates mounting the developer disk image and capturing a screenshot of the target device over an RSD tunnel.

func NewScreenshotManager added in v0.4.3

func NewScreenshotManager() *ScreenshotManager

func (*ScreenshotManager) EnsureMounted added in v0.4.3

func (m *ScreenshotManager) EnsureMounted(ctx context.Context, dev *model.Device) (string, error)

EnsureMounted mounts the personalized developer disk image on the device if it has not been mounted yet in this process. The mount state is shared across all callers, matching the requirement that mount only needs to happen once before the first screenshot.

func (*ScreenshotManager) TakeScreenshot added in v0.4.3

func (m *ScreenshotManager) TakeScreenshot(ctx context.Context, dev *model.Device) ([]byte, error)

TakeScreenshot runs plumesign screenshot, transcodes the resulting PNG into a 1920x1080 (max) JPEG at 80% quality and returns the JPEG bytes. The intermediate PNG file is removed before returning.

type UsbmuxdManager added in v0.4.0

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

func Usbmuxd added in v0.4.0

func Usbmuxd() *UsbmuxdManager

func (*UsbmuxdManager) Restart added in v0.4.0

func (m *UsbmuxdManager) Restart() error

func (*UsbmuxdManager) TryWaitReady added in v0.4.0

func (m *UsbmuxdManager) TryWaitReady(d time.Duration)

type WebsocketManager added in v0.2.1

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

func NewWebsocketManager added in v0.2.1

func NewWebsocketManager(conn *websocket.Conn) *WebsocketManager

func (*WebsocketManager) Cancel added in v0.2.1

func (mgr *WebsocketManager) Cancel()

func (*WebsocketManager) Context added in v0.2.1

func (mgr *WebsocketManager) Context() context.Context

func (*WebsocketManager) ReadMessage added in v0.2.1

func (mgr *WebsocketManager) ReadMessage() (*model.Message, error)

func (*WebsocketManager) WriteMessage added in v0.2.1

func (mgr *WebsocketManager) WriteMessage(msg string)

Jump to

Keyboard shortcuts

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