device

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const RemoteRoot = "/var/mobile/Media/ipadecrypt"

Variables

View Source
var ErrSudoPasswordRejected = errors.New("sudo password rejected")

Functions

This section is empty.

Types

type Client

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

func Connect

func Connect(ctx context.Context, dev config.Device) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Download

func (c *Client) Download(src string, dst io.Writer) error

Download streams the remote file at src into dst. Caller owns dst (open, close, atomic rename if needed). Wrap dst for progress.

func (*Client) EnsureHelper

func (c *Client) EnsureHelper() (string, error)

func (*Client) Exists

func (c *Client) Exists(path string) bool

func (*Client) FindInstalled

func (c *Client) FindInstalled(appDirName string) (string, error)

FindInstalled locates an installed app bundle directory by its .app name. Installed apps live under /var/containers/Bundle/Application/<uuid>/X.app on rootful and rootless setups alike. Requires sudo because /var/containers is readable only by _installd + root.

func (*Client) FindInstalledByBundleID added in v0.5.0

func (c *Client) FindInstalledByBundleID(bundleID string) (string, error)

FindInstalledByBundleID returns the first installed .app whose Info.plist contains bundleID

func (*Client) HashFile added in v0.3.0

func (c *Client) HashFile(target string) (string, error)

HashFile computes the sha256 of a path on-device. Installed bundles under /var/containers are readable only by root + _installd, hence sudo. Relies on a `shasum` binary being on PATH (procursus/dopamine/palera1n all ship it at /var/jb/usr/bin/shasum).

func (*Client) Install

func (c *Client) Install(appinstPath, ipaRemote string) error

func (*Client) InstalledVersion added in v0.4.0

func (c *Client) InstalledVersion(bundlePath string) (string, error)

InstalledVersion reads CFBundleShortVersionString (falling back to CFBundleVersion) from an installed app bundle's Info.plist.

func (*Client) LocateAppSync

func (c *Client) LocateAppSync() (string, error)

func (*Client) LocateAppinst

func (c *Client) LocateAppinst() (string, error)

func (*Client) LocateBinary

func (c *Client) LocateBinary(name string) (string, error)

func (*Client) Mkdir

func (c *Client) Mkdir(path string) error

func (*Client) Probe

func (c *Client) Probe() (ProbeResult, error)

func (*Client) Remove

func (c *Client) Remove(path string) error

func (*Client) Run

func (c *Client) Run(cmd string) (string, string, int, error)

func (*Client) RunHelper

func (c *Client) RunHelper(helperPath, bundleID, bundlePath, outIPA string, onEvent EventHandler, humanFallback io.Writer) (string, string, int, error)

RunHelper spawns the on-device helper for a bundle. bundleID goes to the SpringBoard SBS SPI (only accepted for the main app; empty string skips the main-app pass and just decrypts PlugIns/*.appex + Extensions/*.appex).

func (*Client) RunSudo

func (c *Client) RunSudo(cmd string) (string, string, int, error)

func (*Client) RunSudoStream

func (c *Client) RunSudoStream(cmd string, stdoutW, stderrW io.Writer) (string, string, int, error)

func (*Client) Stat added in v0.5.2

func (c *Client) Stat(p string) (os.FileInfo, error)

func (*Client) Upload

func (c *Client) Upload(src io.Reader, dst string, mode os.FileMode) error

func (*Client) VerifyHelper

func (c *Client) VerifyHelper(helperPath string) error

VerifyHelper is a best-effort sanity: invoke the helper with no args; it should exit 2 with a usage string we can recognize. Catches common issues (binary not executable, sudo denied, missing codesign).

type Event

type Event struct {
	Name  string
	Attrs map[string]string
}

func ParseEvent

func ParseEvent(line string) (Event, bool)

ParseEvent parses "@evt event=foo key=value ..." lines. Values may be double-quoted to allow spaces. Returns (_, false) for non-event lines.

func (Event) Attr

func (e Event) Attr(key string) string

type EventHandler

type EventHandler func(Event)

type ProbeResult

type ProbeResult struct {
	IOSVersion string
	Arch       string // "arm64" or "arm64e"
	Model      string // "iPhone10,2", "iPad7,3", …
	// DeviceFamily mirrors UIDeviceFamily values from Info.plist:
	// 1 = iPhone/iPod, 2 = iPad. 0 if unknown.
	DeviceFamily int
}

Jump to

Keyboard shortcuts

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