Documentation ¶
Index ¶
- Constants
- func ApplyPatches(metadata map[string]interface{}, src, dst string) error
- func CloneRequest(req *proxy.Request) (*http.Request, error)
- func DownloadApp(app *AppInfo, userAgent string, overwrite bool) (filename string, exists bool, err error)
- func DownloadFile(url string, filepath string, userAgent string) (err error)
- func GzipDecode(p []byte) ([]byte, error)
- func GzipDecodeReader(r io.Reader) ([]byte, error)
- func ReplicateSinf(sinfs []*Sinf, packagePath string) error
- type Addon
- type AppInfo
- type DownloadItemResult
- type DownloadResult
- type Pair
- type Sinf
- type WriteCounter
Constants ¶
View Source
const DefaultUserAgent = "" /* 134-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func ApplyPatches ¶
ApplyPatches creates iTunesMetadata.plist and appends to dst file.
func DownloadApp ¶
func GzipDecode ¶
func ReplicateSinf ¶
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 }
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: 快速 & 安全 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 ¶
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 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()
Click to show internal directories.
Click to hide internal directories.