|
JubeatPlus 3.9.11
|
Odds and ends the store screens share. More...
#include <StoreUtil.h>


Class Methods | |
| (int) | + storeTabHeaderHeight |
| The store tab header height, 44 points. | |
| (int) | + storeTabFooterHeight |
| The store tab footer height, 49 points. | |
| (int) | + storeCategoryListHeight |
| The store category list height, 80 points. | |
| (int) | + storeCategoryTitleHeight |
| The store category title height, 100 points. | |
| (nullable NSString *) | + queryStringForDictionary: |
Builds a "&key=value" query fragment from a dictionary's string entries. | |
| (nullable NSURL *) | + storeNewInfoURL |
| The store's new-information URL, carrying the client info as a query. | |
| (nullable NSURL *) | + packListURL:limit:genre: |
| The pack-list URL for a page, optionally filtered by genre. | |
| (nullable NSURL *) | + recommendPackListURL: |
The recommended-pack-list URL: head 0, limit 8, and a random genre when useGenre is set. | |
| (nullable NSURL *) | + selectivePackListURL: |
| The optional-pack-list URL for a set of pack identifiers. | |
| (nullable NSURL *) | + packInfoURL: |
| The pack-info URL for a pack, carrying the client info as a query. | |
| (nullable NSURL *) | + restorePackInfoURL: |
| The restore-pack-info URL for a pack, carrying the client info as a query. | |
| (nullable NSURL *) | + musicInfoURL: |
| The music-info URL for a tune, carrying the client info as a query. | |
| (nullable NSURL *) | + privilegeListURL: |
| The free-music-list (privilege) URL keyed by a value. | |
| (nullable NSURL *) | + privilegeMusicInfoURL: |
The privilege music-info URL; forwards to +musicInfoURL: . | |
| (nullable NSURL *) | + verifyReceiptNewURL |
The receipt-verify URL for a new purchase; delegates to ScratchUtil . | |
| (nullable NSURL *) | + verifyReceiptConsumeURL |
The receipt-verify URL for a consumable purchase; delegates to ScratchUtil . | |
| (nullable NSURL *) | + campaignListURL |
| The campaign-list URL. | |
| (nullable NSURL *) | + campaignSerialCheckURL |
| The campaign serial-check URL. | |
| (nullable NSURL *) | + campaignItemURL |
| The campaign-item fetch URL. | |
| (nullable NSURL *) | + markerListURL |
| The marker-list check URL. | |
| (nullable NSURL *) | + recommendPackURL: |
| The recommended-pack URL for a tune, carrying the client info as a query. | |
| (nullable NSURL *) | + startNewsURL |
| The startup-news URL. | |
| (nullable NSURL *) | + passedInfoListURL |
| The passed-information list URL. | |
| (nullable NSURL *) | + storeUserPolicyURL |
| The store user-policy URL, carrying the agreed licence version. | |
| (nullable NSURL *) | + storeExtendListURL |
| The store extend-list URL, carrying the last-update timestamp. | |
| (nullable NSDictionary *) | + checkStoreResponse: |
| Verifies a signed store response and returns its JSON body. | |
| (nullable NSString *) | + priceString:withLocale: |
| Formats a price number as a currency string in a locale. | |
| (BOOL) | + isValidURL: |
| Whether a string is a URL worth keeping. | |
| (nullable NSString *) | + productIDForPackID: |
| Maps a pack identifier to its App Store product identifier. | |
| (int) | + packIDForProductID: |
| Maps an App Store product identifier back to its pack identifier. | |
| (BOOL) | + existMusicFile: |
| Whether a tune's file is present, whether built in or downloaded. | |
| (BOOL) | + existDownloadableExtendMusic: |
| Whether any entry has a downloadable extend tune that is not yet on disk. | |
| (nullable NSDictionary *) | + affiliateParametersFromURL: |
| Extracts the App Store affiliate parameters from an iTunes URL. | |
| (nullable NSString *) | + filePathForMusicID: |
| Where a downloaded tune's data would live. | |
| (nullable NSURL *) | + knitColorURL |
| The endpoint the store's knit background colour is fetched from. | |
Odds and ends the store screens share.
| + (nullable NSDictionary *) affiliateParametersFromURL: | (nullable NSURL *) | url |
Extracts the App Store affiliate parameters from an iTunes URL.
Returns nil unless the host is itunes.apple.com and the query carries a positive i item identifier and an at affiliate token; a ct campaign token is added when present.
| url | The affiliate URL. |
SKStoreProductParameter dictionary, or nil. | + (NSURL *) campaignItemURL |
The campaign-item fetch URL.
| + (NSURL *) campaignListURL |
The campaign-list URL.
| + (NSURL *) campaignSerialCheckURL |
The campaign serial-check URL.
| + (nullable NSDictionary *) checkStoreResponse: | (nullable NSData *) | response |
Verifies a signed store response and returns its JSON body.
The first 64 bytes are the expected lowercase SHA-256 hex of the body with a fixed salt in place of that prefix; when it matches, the remaining bytes are parsed as a JSON dictionary. Returns nil for a response shorter than 64 bytes or a failed signature.
| response | The raw signed response. |
| + (BOOL) existDownloadableExtendMusic: | (nullable NSArray *) | entries |
Whether any entry has a downloadable extend tune that is not yet on disk.
Answers YES for the first entry whose base tune is in the store list and present on disk while its non-zero extendMusicID is not.
| entries | The store music entries. |
| + (BOOL) existMusicFile: | (int) | musicID |
Whether a tune's file is present, whether built in or downloaded.
When the bundled Music resource exists it answers YES for any identifier in StoreMusicListManager 's built-in list; otherwise it tests whether "<documents>/%d.jbt" exists on disk.
| musicID | The tune identifier. |
| + (NSString *) filePathForMusicID: | (unsigned int) | musicID |
Where a downloaded tune's data would live.
DECLARED ONLY. Returns the path whether or not anything is there; the caller tests it with -[NSFileManager fileExistsAtPath:] .
| musicID | The tune. |
| + (BOOL) isValidURL: | (nullable NSString *) | url |
Whether a string is a URL worth keeping.
StoreMusicInfo gates three of its six string fields on this and leaves them nil when it answers NO, so an unusable URL is dropped rather than stored. DECLARED ONLY.
| url | The candidate, as it arrived from the server. |
| + (NSURL *) knitColorURL |
The endpoint the store's knit background colour is fetched from.
DECLARED ONLY — the body has not been reconstructed yet. Fetched during -[LogoViewController loadView] , alongside the event type.
| + (NSURL *) markerListURL |
The marker-list check URL.
| + (NSURL *) musicInfoURL: | (unsigned int) | musicID |
The music-info URL for a tune, carrying the client info as a query.
| musicID | The tune identifier. |
| + (int) packIDForProductID: | (nullable NSString *) | productID |
Maps an App Store product identifier back to its pack identifier.
Strips the "jubeat.pack" prefix and parses the remainder; returns -1 when the string does not carry the prefix or the number is not positive.
| productID | The product identifier. |
| + (NSURL *) packInfoURL: | (unsigned int) | packID |
The pack-info URL for a pack, carrying the client info as a query.
| packID | The pack identifier. |
| + (NSURL *) packListURL: | (unsigned int) | head | |
| limit: | (unsigned int) | limit | |
| genre: | (unsigned int) | genre |
The pack-list URL for a page, optionally filtered by genre.
Formats packlist_secure with the head and limit and appends "&genre=%d" only when genre is non-zero, then the client-info query.
| head | The first index. |
| limit | The page size. |
| genre | The genre filter, or 0 for none. |
| + (NSURL *) passedInfoListURL |
The passed-information list URL.
| + (nullable NSString *) priceString: | (nullable NSNumber *) | price | |
| withLocale: | (nullable NSLocale *) | locale |
Formats a price number as a currency string in a locale.
Returns the empty string when either argument is nil; otherwise uses an NSNumberFormatterCurrencyStyle formatter in the 10.4 behaviour.
| price | The price number. |
| locale | The store-front locale. |
"". | + (NSURL *) privilegeListURL: | (int) | key |
The free-music-list (privilege) URL keyed by a value.
| key | The list key. |
| + (NSURL *) privilegeMusicInfoURL: | (unsigned int) | musicID |
The privilege music-info URL; forwards to +musicInfoURL: .
| musicID | The tune identifier. |
+musicInfoURL: returns for the tune. | + (NSString *) productIDForPackID: | (int) | packID |
Maps a pack identifier to its App Store product identifier.
DECLARED ONLY.
| packID | The pack's identifier, as StorePackInfo carries it. |
| + (nullable NSString *) queryStringForDictionary: | (nullable NSDictionary *) | dictionary |
Builds a "&key=value" query fragment from a dictionary's string entries.
Every pair, including the first, is prefixed with "&" , so the result is not a well-formed query string on its own; non-string keys or values are skipped and nothing is percent-encoded.
| dictionary | The parameters. |
| + (NSURL *) recommendPackListURL: | (unsigned int) | useGenre |
The recommended-pack-list URL: head 0, limit 8, and a random genre when useGenre is set.
When useGenre is non-zero it appends "&genre=%d" with a value chosen at random from a ten-entry table.
| useGenre | Whether to append a random genre filter. |
| + (NSURL *) recommendPackURL: | (unsigned int) | musicID |
The recommended-pack URL for a tune, carrying the client info as a query.
| musicID | The tune identifier. |
| + (NSURL *) restorePackInfoURL: | (unsigned int) | packID |
The restore-pack-info URL for a pack, carrying the client info as a query.
| packID | The pack identifier. |
| + (nullable NSURL *) selectivePackListURL: | (nullable NSArray *) | packIDs |
The optional-pack-list URL for a set of pack identifiers.
Formats optional_packlist with a comma-separated packs list. Returns nil for an empty set.
| packIDs | The pack identifiers, as NSNumber s. |
| + (NSURL *) startNewsURL |
The startup-news URL.
| + (int) storeCategoryListHeight |
The store category list height, 80 points.
| + (int) storeCategoryTitleHeight |
The store category title height, 100 points.
| + (NSURL *) storeExtendListURL |
The store extend-list URL, carrying the last-update timestamp.
Structurally identical to +storeUserPolicyURL but the version value is read from PrefExtendListLastUpdate .
| + (NSURL *) storeNewInfoURL |
The store's new-information URL, carrying the client info as a query.
| + (int) storeTabFooterHeight |
The store tab footer height, 49 points.
| + (int) storeTabHeaderHeight |
The store tab header height, 44 points.
| + (NSURL *) storeUserPolicyURL |
The store user-policy URL, carrying the agreed licence version.
The query is {version: <PrefStoreAgreeLicenseVersion or "">, target: "JP"} .
| + (NSURL *) verifyReceiptConsumeURL |
The receipt-verify URL for a consumable purchase; delegates to ScratchUtil .
Identical to +verifyReceiptNewURL .
| + (NSURL *) verifyReceiptNewURL |
The receipt-verify URL for a new purchase; delegates to ScratchUtil .