JubeatPlus 3.9.11
Loading...
Searching...
No Matches
StoreUtil Class Reference

Odds and ends the store screens share. More...

#include <StoreUtil.h>

Inheritance diagram for StoreUtil:
Collaboration diagram for StoreUtil:

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.

Detailed Description

Odds and ends the store screens share.

Method Documentation

◆ affiliateParametersFromURL:

+ (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.

Parameters
urlThe affiliate URL.
Returns
The SKStoreProductParameter dictionary, or nil.
Ghidra address:
0xbad90

◆ campaignItemURL

+ (NSURL *) campaignItemURL

The campaign-item fetch URL.

Returns
The campaign-item fetch URL.
Ghidra address:
0xba720
Ghidra address:
0xba720

◆ campaignListURL

+ (NSURL *) campaignListURL

The campaign-list URL.

Returns
The campaign-list URL.
Ghidra address:
0xba578
Ghidra address:
0xba578

◆ campaignSerialCheckURL

+ (NSURL *) campaignSerialCheckURL

The campaign serial-check URL.

Returns
The campaign serial-check URL.
Ghidra address:
0xba64c
Ghidra address:
0xba64c

◆ checkStoreResponse:

+ (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.

Parameters
responseThe raw signed response.
Returns
The verified JSON dictionary, or nil.
Ghidra address:
0xba9a4

◆ existDownloadableExtendMusic:

+ (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.

Parameters
entriesThe store music entries.
Returns
YES when at least one entry has a downloadable extend tune, NO otherwise.
Ghidra address:
0xbbda8

◆ existMusicFile:

+ (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.

Parameters
musicIDThe tune identifier.
Returns
YES when the tune's file is present, NO otherwise.
Ghidra address:
0xbbaf4
Ghidra address:
0xbbaf4

◆ filePathForMusicID:

+ (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:] .

Parameters
musicIDThe tune.
Returns
The path.
Ghidra address:
0xbb310

◆ isValidURL:

+ (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.

Parameters
urlThe candidate, as it arrived from the server.
Returns
YES when the string is a URL worth keeping, NO when it should be dropped.

◆ knitColorURL

+ (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.

Returns
The knit-colour URL.
Ghidra address:
0xba7f4
Ghidra address:
0xba7f4

◆ markerListURL

+ (NSURL *) markerListURL

The marker-list check URL.

Returns
The marker-list check URL.
Ghidra address:
0xba8c8
Ghidra address:
0xba8c8

◆ musicInfoURL:

+ (NSURL *) musicInfoURL: (unsigned int) musicID

The music-info URL for a tune, carrying the client info as a query.

Parameters
musicIDThe tune identifier.
Returns
The music-info URL.
Ghidra address:
0xba1c8
Ghidra address:
0xba1c8

◆ packIDForProductID:

+ (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.

Parameters
productIDThe product identifier.
Returns
The pack identifier, or -1.
Ghidra address:
0xbabc8

◆ packInfoURL:

+ (NSURL *) packInfoURL: (unsigned int) packID

The pack-info URL for a pack, carrying the client info as a query.

Parameters
packIDThe pack identifier.
Returns
The pack-info URL.
Ghidra address:
0xb9f28
Ghidra address:
0xb9f28

◆ packListURL:limit:genre:

+ (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.

Parameters
headThe first index.
limitThe page size.
genreThe genre filter, or 0 for none.
Returns
The pack-list URL for the page.
Ghidra address:
0xb9a2c
Ghidra address:
0xb9a2c

◆ passedInfoListURL

+ (NSURL *) passedInfoListURL

The passed-information list URL.

Returns
The passed-information list URL.
Ghidra address:
0xbb5e8
Ghidra address:
0xbb5e8

◆ priceString:withLocale:

+ (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.

Parameters
priceThe price number.
localeThe store-front locale.
Returns
The formatted price, or "".
Ghidra address:
0xbaca0

◆ privilegeListURL:

+ (NSURL *) privilegeListURL: (int) key

The free-music-list (privilege) URL keyed by a value.

Parameters
keyThe list key.
Returns
The free-music-list URL.
Ghidra address:
0xba48c
Ghidra address:
0xba48c

◆ privilegeMusicInfoURL:

+ (NSURL *) privilegeMusicInfoURL: (unsigned int) musicID

The privilege music-info URL; forwards to +musicInfoURL: .

Parameters
musicIDThe tune identifier.
Returns
Whatever +musicInfoURL: returns for the tune.
Ghidra address:
0xba56c
Ghidra address:
0xba56c

◆ productIDForPackID:

+ (NSString *) productIDForPackID: (int) packID

Maps a pack identifier to its App Store product identifier.

DECLARED ONLY.

Parameters
packIDThe pack's identifier, as StorePackInfo carries it.
Returns
The product identifier, or nil for a pack with no product.
Ghidra address:
0xbab70
Ghidra address:
0xbab70

◆ queryStringForDictionary:

+ (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.

Parameters
dictionaryThe parameters.
Returns
The concatenated fragment.
Ghidra address:
0xb9864

◆ recommendPackListURL:

+ (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.

Parameters
useGenreWhether to append a random genre filter.
Returns
The recommended-pack-list URL.
Ghidra address:
0xb9ba0
Ghidra address:
0xb9ba0

◆ recommendPackURL:

+ (NSURL *) recommendPackURL: (unsigned int) musicID

The recommended-pack URL for a tune, carrying the client info as a query.

Parameters
musicIDThe tune identifier.
Returns
The recommended-pack URL.
Ghidra address:
0xbb3bc
Ghidra address:
0xbb3bc

◆ restorePackInfoURL:

+ (NSURL *) restorePackInfoURL: (unsigned int) packID

The restore-pack-info URL for a pack, carrying the client info as a query.

Parameters
packIDThe pack identifier.
Returns
The restore-pack-info URL.
Ghidra address:
0xba078
Ghidra address:
0xba078

◆ selectivePackListURL:

+ (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.

Parameters
packIDsThe pack identifiers, as NSNumber s.
Returns
The optional-pack-list URL, or nil for an empty set.
Ghidra address:
0xb9d48

◆ startNewsURL

+ (NSURL *) startNewsURL

The startup-news URL.

Returns
The startup-news URL.
Ghidra address:
0xbb50c
Ghidra address:
0xbb50c

◆ storeCategoryListHeight

+ (int) storeCategoryListHeight

The store category list height, 80 points.

Returns
Always 80.
Ghidra address:
0xb9854
Ghidra address:
0xb9854

◆ storeCategoryTitleHeight

+ (int) storeCategoryTitleHeight

The store category title height, 100 points.

Returns
Always 100.
Ghidra address:
0xb985c
Ghidra address:
0xb985c

◆ storeExtendListURL

+ (NSURL *) storeExtendListURL

The store extend-list URL, carrying the last-update timestamp.

Structurally identical to +storeUserPolicyURL but the version value is read from PrefExtendListLastUpdate .

Returns
The store extend-list URL.
Ghidra address:
0xbb8b8
Ghidra address:
0xbb8b8

◆ storeNewInfoURL

+ (NSURL *) storeNewInfoURL

The store's new-information URL, carrying the client info as a query.

Returns
The new-information URL.
Ghidra address:
0xba318
Ghidra address:
0xba318

◆ storeTabFooterHeight

+ (int) storeTabFooterHeight

The store tab footer height, 49 points.

Returns
Always 49.
Ghidra address:
0xb984c
Ghidra address:
0xb984c

◆ storeTabHeaderHeight

+ (int) storeTabHeaderHeight

The store tab header height, 44 points.

Returns
Always 44.
Ghidra address:
0xb9844
Ghidra address:
0xb9844

◆ storeUserPolicyURL

+ (NSURL *) storeUserPolicyURL

The store user-policy URL, carrying the agreed licence version.

The query is {version: <PrefStoreAgreeLicenseVersion or "">, target: "JP"} .

Returns
The store user-policy URL.
Ghidra address:
0xbb67c
Ghidra address:
0xbb67c

◆ verifyReceiptConsumeURL

+ (NSURL *) verifyReceiptConsumeURL

The receipt-verify URL for a consumable purchase; delegates to ScratchUtil .

Identical to +verifyReceiptNewURL .

Returns
The receipt-verify URL.
Ghidra address:
0xba478
Ghidra address:
0xba478

◆ verifyReceiptNewURL

+ (NSURL *) verifyReceiptNewURL

The receipt-verify URL for a new purchase; delegates to ScratchUtil .

Returns
The receipt-verify URL.
Ghidra address:
0xba464
Ghidra address:
0xba464

The documentation for this class was generated from the following files: