ipa

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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInfoPlistNotFound = errors.New("info.plist not found")
)
View Source
var ErrPlatformMismatch = errors.New("ipa platform does not match the device")

ErrPlatformMismatch reports an IPA built for another platform than the device.

Functions

func CheckPlatform added in v0.6.0

func CheckPlatform(platforms []string, deviceClass string) error

CheckPlatform verifies that an IPA supporting platforms (CFBundleSupportedPlatforms) can run on a device of deviceClass. It returns nil when this cannot be verified.

func IsRemoteURL added in v0.6.0

func IsRemoteURL(p string) bool

IsRemoteURL reports whether p is an http(s) URL rather than a local path.

Types

type DownloadProgressFn added in v0.4.6

type DownloadProgressFn func(downloaded, total int64)

DownloadProgressFn is called during download with bytes downloaded and total size. total may be -1 if the content length is unknown.

type DownloadResult added in v0.4.6

type DownloadResult struct {
	// LocalPath is the path to the downloaded IPA file on disk.
	LocalPath string
	// Name is the app display name extracted from Info.plist.
	Name string
	// BundleIdentifier is the CFBundleIdentifier from Info.plist.
	BundleIdentifier string
	// Version is the CFBundleShortVersionString from Info.plist.
	Version string
	// IconPath is the path to the extracted icon PNG file, or empty if extraction failed.
	IconPath string
	// Platforms is the CFBundleSupportedPlatforms from Info.plist.
	Platforms []string
}

DownloadResult holds the result of downloading and parsing an IPA.

func DownloadAndParse added in v0.4.6

func DownloadAndParse(rawURL string, progressFn DownloadProgressFn) (*DownloadResult, error)

DownloadAndParse downloads an IPA from rawURL, saves it to a temp file, parses its metadata, and extracts the app icon. The caller is responsible for removing the downloaded IPA file and icon file when no longer needed.

If progressFn is nil, no progress is reported.

func DownloadAndParseWithHeaders added in v0.6.1

func DownloadAndParseWithHeaders(rawURL string, header http.Header, progressFn DownloadProgressFn) (*DownloadResult, error)

DownloadAndParseWithHeaders is DownloadAndParse with headers applied to the initial HTTP request. Go's redirect policy removes sensitive headers such as Authorization when a redirect crosses to an unrelated host.

func ParseLocalIPA added in v0.4.6

func ParseLocalIPA(localPath string) (*DownloadResult, error)

ParseLocalIPA parses a locally-available IPA file and extracts its icon. The caller is responsible for removing the icon file when no longer needed.

type IPA

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

func Parse

func Parse(readerAt io.ReaderAt, size int64) (*IPA, error)

func ParseFile

func ParseFile(path string) (*IPA, error)

func (*IPA) Build

func (i *IPA) Build() string

func (*IPA) Channel

func (i *IPA) Channel() string

func (*IPA) Icon

func (i *IPA) Icon() image.Image

func (*IPA) Identifier

func (i *IPA) Identifier() string

func (*IPA) Name

func (i *IPA) Name() string

func (*IPA) Platforms added in v0.6.0

func (i *IPA) Platforms() []string

Platforms returns CFBundleSupportedPlatforms, e.g. AppleTVOS or iPhoneOS.

func (*IPA) Size

func (i *IPA) Size() int64

func (*IPA) Version

func (i *IPA) Version() string

type InfoPlist

type InfoPlist struct {
	CFBundleDisplayName        string   `json:"CFBundleDisplayName,omitempty"`
	CFBundleExecutable         string   `json:"CFBundleExecutable,omitempty"`
	CFBundleIconName           string   `json:"CFBundleIconName,omitempty"`
	CFBundleIdentifier         string   `json:"CFBundleIdentifier,omitempty"`
	CFBundleName               string   `json:"CFBundleName,omitempty"`
	CFBundleShortVersionString string   `json:"CFBundleShortVersionString,omitempty"`
	CFBundleSupportedPlatforms []string `json:"CFBundleSupportedPlatforms,omitempty"`
	CFBundleVersion            string   `json:"CFBundleVersion,omitempty"`
	// not standard
	Channel string `json:"channel"`
}

type InfoPlistIcon

type InfoPlistIcon struct {
	CFBundlePrimaryIcon struct {
		CFBundleIconFiles []string `json:"CFBundleIconFiles,omitempty"`
		CFBundleIconName  string   `json:"CFBundleIconName,omitempty"`
	} `json:"CFBundlePrimaryIcon,omitempty"`
}

TODO: use InfoPlistIcon to parse icon files

Jump to

Keyboard shortcuts

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