ios

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package ios provides iOS-specific IPA inspection logic. It locates and parses Info.plist and embedded entitlements from the Payload/<AppName>.app bundle inside the ZIP archive and normalizes the extracted data into the mobilepkg report model.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInfoPlistNotFound indicates that Info.plist is missing from the IPA.
	ErrInfoPlistNotFound = errors.New("ios: Info.plist not found in IPA archive")
	// ErrInfoPlistParseFailed indicates that Info.plist could not be parsed.
	ErrInfoPlistParseFailed = errors.New("ios: failed to parse Info.plist")
)

Sentinel errors for iOS inspection failures.

Functions

func Inspect

func Inspect(zr *zip.Reader, sections uint64, maxEntryBytes int64) (*Result, []Diagnostic, error)

Inspect extracts information from an IPA ZIP archive. The sections parameter is a bitmask controlling which data to extract. Bit positions match the mobilepkg.Section constants:

bit 0: Identity, bit 1: Version, bit 2: EntryPoint,
bit 3: Permissions, bit 4: Icon, bit 5: PlatformRaw

Types

type CertResult

type CertResult struct {
	Subject            string
	Issuer             string
	NotBefore          string // RFC 3339
	NotAfter           string // RFC 3339
	SHA256Fingerprint  string // hex
	SerialNumber       string
	SignatureAlgorithm string
	PublicKeyAlgorithm string
	KeySize            int
	SelfSigned         bool
}

CertResult holds a parsed X.509 certificate summary.

type Diagnostic

type Diagnostic struct {
	Code     string
	Severity string
	Message  string
}

Diagnostic is a non-fatal issue found during iOS inspection.

type PermissionEntry

type PermissionEntry struct {
	RawName string
	Source  string // "info_plist" or "entitlement"
}

PermissionEntry represents a single iOS permission or entitlement.

type ProvisionInfo

type ProvisionInfo struct {
	TeamID      string
	TeamName    string
	CreatedAt   string // RFC 3339
	ExpiresAt   string // RFC 3339
	Certs       []CertResult
	AppIDName   string
	ProfileName string
}

ProvisionInfo holds signing information from an iOS provisioning profile.

func ExtractProvisioningInfo

func ExtractProvisioningInfo(data []byte) (*ProvisionInfo, error)

ExtractProvisioningInfo parses an embedded.mobileprovision file and extracts signing/certificate information.

type Result

type Result struct {
	BundleID         string
	DisplayName      string
	ShortVersion     string
	BundleVersion    string
	Executable       string
	MinimumOSVersion string
	Signing          *ProvisionInfo
	Permissions      []PermissionEntry
	IconPath         string
	IconBytes        []byte
	IconWidth        int
	IconHeight       int
	IconFormat       string
	InfoPlist        map[string]any
	Entitlements     map[string]any
}

Result holds the extracted data from an iOS IPA.

Jump to

Keyboard shortcuts

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