Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Close()
- func (c *Client) Download(src string, dst io.Writer) error
- func (c *Client) EnsureHelper() (string, error)
- func (c *Client) Exists(path string) bool
- func (c *Client) FindInstalledByBundleID(bundleID string) (string, string, error)
- func (c *Client) HashFile(target string) (string, error)
- func (c *Client) Install(appinstPath, ipaRemote string) error
- func (c *Client) InstalledVersion(bundlePath string) (string, error)
- func (c *Client) LocateAppSync() (string, error)
- func (c *Client) LocateAppinst() (string, error)
- func (c *Client) Mkdir(path string) error
- func (c *Client) Probe() (ProbeResult, error)
- func (c *Client) Remove(path string) error
- func (c *Client) Run(cmd string) (string, string, int, error)
- func (c *Client) RunHelper(helperPath, bundleID, bundlePath string, verbose, skipAppex bool, ...) (int, error)
- func (c *Client) RunHelperExecs(helperPath, bundleID, bundlePath string, verbose, skipAppex bool, ...) (int, error)
- func (c *Client) RunSudo(cmd string) (string, string, int, error)
- func (c *Client) RunSudoStream(cmd string, stdoutW, stderrW io.Writer) (string, string, int, error)
- func (c *Client) Stat(p string) (os.FileInfo, error)
- func (c *Client) Uninstall(bundlePath string) error
- func (c *Client) Upload(src io.Reader, dst string, mode os.FileMode) error
- func (c *Client) VerifyHelper(helperPath string) error
- type Event
- type EventHandler
- type FrameHandler
- type ProbeResult
Constants ¶
const RemoteRoot = "/var/mobile/Media/ipadecrypt"
Variables ¶
var ErrSudoPasswordRejected = errors.New("sudo password rejected")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Download ¶
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 (*Client) FindInstalledByBundleID ¶ added in v0.5.0
FindInstalledByBundleID returns the .app path and canonical CFBundleIdentifier matching bundleID case-insensitively. grep is a prefilter; each hit is parsed to confirm (binary plists embed bundle ids as URL-scheme substrings).
func (*Client) HashFile ¶ added in v0.3.0
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) InstalledVersion ¶ added in v0.4.0
InstalledVersion reads CFBundleShortVersionString (falling back to CFBundleVersion) from an installed app bundle's Info.plist.
func (*Client) LocateAppSync ¶
func (*Client) LocateAppinst ¶
func (*Client) Probe ¶
func (c *Client) Probe() (ProbeResult, error)
func (*Client) RunHelper ¶
func (c *Client) RunHelper(helperPath, bundleID, bundlePath string, verbose, skipAppex bool, onEvent EventHandler, ipaW io.Writer) (int, error)
RunHelper spawns the on-device helper for a bundle and streams the decrypted IPA bytes into ipaW. 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). When skipAppex is true the helper passes --skip-appex, leaving extensions encrypted.
In this mode the helper writes IPA bytes to stdout and event lines to stderr; we tee stderr through the event splitter while ipaW receives the binary stream - no on-device output file, no sftp pull.
func (*Client) RunHelperExecs ¶ added in v0.7.0
func (c *Client) RunHelperExecs(helperPath, bundleID, bundlePath string, verbose, skipAppex bool, onEvent EventHandler, onFrame FrameHandler) (int, error)
RunHelperExecs runs the helper in --execs-only mode: the helper streams framed Mach-O records on stdout, events on stderr. onFrame is called once per record. Use this when the host has the source IPA and will assemble the output by substituting the helper-provided execs.
func (*Client) RunSudoStream ¶
func (*Client) Uninstall ¶
Uninstall removes an installed app. Two steps wrapped in a single `sudo sh -c '…'` so both commands run as root (sudo only elevates the first command in a `cmd1; cmd2` chain, otherwise rm runs as mobile and hits the _installd-owned files with EACCES). Order matters:
- uicache -u <bundlePath> - unregister from LSApplicationWorkspace so SpringBoard drops the icon and the LS registry forgets the bundle.
- rm -rf <UUID-dir> - remove the bundle dir under /var/containers/Bundle/Application/.
The data container at /var/mobile/Containers/Data/Application/<other-UUID>/ is left behind finding it would require scanning every container's metadata plist for the bundle id, and the next install spins a fresh one regardless.
func (*Client) VerifyHelper ¶
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 ¶
func ParseEvent ¶
ParseEvent parses "@evt event=foo key=value ..." lines. Values may be double-quoted to allow spaces. Returns (_, false) for non-event lines.
type EventHandler ¶
type EventHandler func(Event)
type FrameHandler ¶ added in v0.7.0
FrameHandler is invoked once per Mach-O record the helper streams in --execs-only mode. path is the IPA-relative bundle path ("Payload/AppName.app/Frameworks/X.framework/X"). r yields exactly size bytes; the handler must read them fully before returning, or the next frame will deserialize garbage.
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
// Jailbreak is the detected jailbreak: "Dopamine", "palera1n",
// "checkra1n", "rootless?" (rootless but brand unknown) or "unknown".
Jailbreak string
}