Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrInfoPlistNotFound = errors.New("info.plist not found")
)
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
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
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 (*IPA) Identifier ¶
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