ipaversion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultUserAgent = "" /* 134-byte string literal not displayed */

Variables

This section is empty.

Functions

func ApplyPatches

func ApplyPatches(metadata map[string]interface{}, src, dst string) error

ApplyPatches creates iTunesMetadata.plist and appends to dst file.

func CloneRequest

func CloneRequest(req *proxy.Request) (*http.Request, error)

func DownloadApp

func DownloadApp(app *AppInfo, userAgent string, overwrite bool) (filename string, exists bool, err error)

func DownloadFile

func DownloadFile(url string, filepath string, userAgent string) (err error)

func GzipDecode

func GzipDecode(p []byte) ([]byte, error)

func GzipDecodeReader

func GzipDecodeReader(r io.Reader) ([]byte, error)

func ReplicateSinf

func ReplicateSinf(sinfs []*Sinf, packagePath string) error

ReplicateSinf writes sinfs to Payload/{NAME}.app/SC_Info/{NAME}.sinf

Types

type Addon

type Addon struct {
	proxy.BaseAddon
	Lock *sync.Mutex
	Done chan<- bool

	Start           int
	End             int
	HistoryVersions []*AppInfo // This is query result. Do NOT change it from outside!
	ClientUserAgent string     // User-Agent extracted from client request headers. Do NOT change it from outside!
	DumpResponses   bool       // Whether to dump replay responses to files
	// contains filtered or unexported fields
}

func (*Addon) Request

func (c *Addon) Request(f *proxy.Flow)

func (*Addon) Response

func (c *Addon) Response(f *proxy.Flow)

type AppInfo

type AppInfo struct {
	*DownloadItemResult
	Data                               []byte   // the original response data (gzip decoded)
	BundleDisplayName                  string   // ex. Opera
	BundleShortVersionString           string   // ex. 3.0.4
	SoftwareVersionExternalIdentifier  uint64   // ex. 842552350
	SoftwareVersionExternalIdentifiers []uint64 // ex. [842023522, 842552350, 842626028]
	ItemName                           string   // ex. Opera: 快速 &amp; 安全
	ArtistName                         string   // ex. Opera Software AS
}

AppInfo includes all fields from DownloadItemResult, and extracts most commonly used fields from metadata for easy access.

func GetAppInfo

func GetAppInfo(data []byte) (*AppInfo, error)

type DownloadItemResult

type DownloadItemResult struct {
	MD5        string                 `plist:"md5,omitempty"`
	URL        string                 `plist:"URL,omitempty"`        // ex. https://iosapps.itunes.apple.com/itunes-assets/../xx/yy/zz.signed.dpkg.ipa?accessKey=xxx
	ArtworkURL string                 `plist:"artworkURL,omitempty"` // ex. https://is4-ssl.mzstatic.com/image/thumb/Purple122/.../AppIcon-xxx.png/600x600bb.jpg
	Sinfs      []*Sinf                `plist:"sinfs,omitempty"`
	Metadata   map[string]interface{} `plist:"metadata,omitempty"`
}

func GetDownloadItemResult

func GetDownloadItemResult(data []byte) (*DownloadItemResult, error)

type DownloadResult

type DownloadResult struct {
	FailureType     string                `plist:"failureType,omitempty"`
	CustomerMessage string                `plist:"customerMessage,omitempty"`
	Items           []*DownloadItemResult `plist:"songList,omitempty"`
}

type Pair

type Pair[T, U any] struct {
	First  T
	Second U
}

func Zip

func Zip[T, U any](ts []T, us []U) ([]Pair[T, U], error)

type Sinf

type Sinf struct {
	ID   int64  `plist:"id,omitempty"`
	Data []byte `plist:"sinf,omitempty"`
}

type WriteCounter

type WriteCounter struct {
	Total int // total number of bytes to download
	Count int // current number of bytes downloaded
}

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func NewWriteCounter

func NewWriteCounter(total int) *WriteCounter

func (*WriteCounter) PrintProgress

func (wc *WriteCounter) PrintProgress()

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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