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