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

Owns the frame-background catalogue and the enciphered archives that back each frame. More...

#include <TweetResourceManager.h>

Inheritance diagram for TweetResourceManager:
Collaboration diagram for TweetResourceManager:

Instance Methods

(nullable NSArray< NSDictionary * > *) - getResourceList
 The frame-background catalogue, each entry a descriptor dictionary.
(int) - getInstallApplicationNum
 The cached install-application count, seeded from the reward store at init.
(void) - setInstallApplicationNum:
 Sets the cached install-application count.

Class Methods

(instancetype) + sharedManager
 The shared instance, built once.
(NSString *) + getAppendResourcePath
 The path of the append-data directory, creating it and its parents on demand.
(NSString *) + getFrameDirectoryPath:
 The directory that holds one frame's archive, creating it on demand.
(nullable NSString *) + getFrameFilePath:
 The path of one frame's twitterResources.zip archive when it exists on disk.
(BOOL) + checkResourceName:dirName:
 Verifies that a frame archive names the expected directory.
(BOOL) + checkMD5:
 Verifies a frame archive against its trailing MD5 digest.
(nullable KUnzip *) + getResourceData:
 Opens a frame's archive, falling back to the default frame when it is missing or corrupt.
(BOOL) + checkResourceData
 Verifies every catalogued background frame's archive, deleting any that fails.
(void) + removeResourceData:
 Deletes a frame's stored archive.
(BOOL) + moveResourceDataInDoc
 Copies each bundled background-frame archive into the append-data layout.
(BOOL) + checkEnableSelecteFrame:
 Reports whether a persisted frame selection is currently unlocked.

Detailed Description

Owns the frame-background catalogue and the enciphered archives that back each frame.

Method Documentation

◆ checkEnableSelecteFrame:

+ (BOOL) checkEnableSelecteFrame: (nullable NSString *) frameName

Reports whether a persisted frame selection is currently unlocked.

Finds the background frame whose fileName equals frameName and reports it enabled when it is unconditionally free (termType zero) or unlocked by the install count reaching the frame's threshold (termType one).

Parameters
frameNameThe persisted frame selection's directory name.
Returns
YES when the frame exists and is unlocked, NO otherwise.
Ghidra address:
0x7ad84

◆ checkMD5:

+ (BOOL) checkMD5: (nullable NSData *) data

Verifies a frame archive against its trailing MD5 digest.

The last sixteen bytes are the expected digest; the MD5 is taken over everything before them.

Parameters
dataThe archive bytes, digest included.
Returns
YES when the digest matches and data is longer than the digest, NO otherwise.
Ghidra address:
0x7a19c

◆ checkResourceData

+ (BOOL) checkResourceData

Verifies every catalogued background frame's archive, deleting any that fails.

Walks the frames whose itemType is zero, and for each confirms the archive is present, its MD5 digest matches, and its stored directory name is correct; a failing archive is removed.

Returns
YES when every frame's archive is present and valid, NO otherwise.
Ghidra address:
0x7a430
Ghidra address:
0x7a430

◆ checkResourceName:dirName:

+ (BOOL) checkResourceName: (NSData *) data
dirName: (NSString *) dirName 

Verifies that a frame archive names the expected directory.

Opens data as an archive (stripping its trailing sixteen-byte digest), reads the twitterResources/filename.txt entry, and compares its UTF-8 contents to dirName.

Parameters
dataThe archive bytes, digest included.
dirNameThe expected frame directory name.
Returns
YES when the archive's stored name matches dirName, NO otherwise.
Ghidra address:
0x7a03c
Ghidra address:
0x7a03c

◆ getAppendResourcePath

+ (NSString *) getAppendResourcePath

The path of the append-data directory, creating it and its parents on demand.

The directory is <Library>/Private Documents/appendData ; the method creates the library directory, the Private Documents directory, and the appendData directory in turn when any is absent.

Returns
The appendData directory path.
Ghidra address:
0x79c4c
Ghidra address:
0x79c4c

◆ getFrameDirectoryPath:

+ (NSString *) getFrameDirectoryPath: (NSString *) frameName

The directory that holds one frame's archive, creating it on demand.

Parameters
frameNameThe frame's directory name (its fileName catalogue value).
Returns
The frame's directory path under the append-data directory.
Ghidra address:
0x79e1c
Ghidra address:
0x79e1c

◆ getFrameFilePath:

+ (NSString *) getFrameFilePath: (NSString *) frameName

The path of one frame's twitterResources.zip archive when it exists on disk.

Parameters
frameNameThe frame's directory name.
Returns
The archive path, or nil when either the frame directory or the archive is absent.
Ghidra address:
0x79f10
Ghidra address:
0x79f10

◆ getInstallApplicationNum

- (int) getInstallApplicationNum

The cached install-application count, seeded from the reward store at init.

Returns
The install count.
Ghidra address:
0x79570
Ghidra address:
0x79570

◆ getResourceData:

+ (KUnzip *) getResourceData: (NSString *) frameName

Opens a frame's archive, falling back to the default frame when it is missing or corrupt.

Loads frameName 's archive, verifies its digest, and returns it as an archive reader with the trailing digest stripped. When that fails it retries with the default frame. The bytes still need deciphering by the caller.

Parameters
frameNameThe requested frame's directory name.
Returns
The archive reader, or nil when neither the requested nor the default frame is usable.
Ghidra address:
0x7a298
Ghidra address:
0x7a298

◆ getResourceList

- (NSArray< NSDictionary * > *) getResourceList

The frame-background catalogue, each entry a descriptor dictionary.

Returns
The catalogue array.
Ghidra address:
0x79550
Ghidra address:
0x79550

◆ moveResourceDataInDoc

+ (BOOL) moveResourceDataInDoc

Copies each bundled background-frame archive into the append-data layout.

For every frame whose itemType is zero, copies twitterResources.zip out of the app bundle's appendData/<frameName> directory into the frame's on-disk directory, replacing any existing copy.

Returns
Always NO ; the binary discards the per-frame copy results and returns a fixed value.
Ghidra address:
0x7a8f4
Ghidra address:
0x7a8f4

◆ removeResourceData:

+ (void) removeResourceData: (NSString *) frameName

Deletes a frame's stored archive.

Parameters
frameNameThe frame's directory name.
Ghidra address:
0x7a7fc
Ghidra address:
0x7a7fc

◆ setInstallApplicationNum:

- (void) setInstallApplicationNum: (int) installApplicationNum

Sets the cached install-application count.

Parameters
installApplicationNumThe new count.
Ghidra address:
0x79560
Ghidra address:
0x79560

◆ sharedManager

+ (instancetype) sharedManager

The shared instance, built once.

Returns
The shared manager.
Ghidra address:
0x79434
Ghidra address:
0x79434
Ghidra address:
0x79474

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