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

The shared chart-editor data model. More...

#include <EditDataManager.h>

Inheritance diagram for EditDataManager:
Collaboration diagram for EditDataManager:

Instance Methods

(instancetype) - init
 Initialises an empty manager with copying enabled and no loaded data.
(nullable NSArray< NSString * > *) - getCustomSequenceDirectoryList
 Returns the names of the per-music custom-sequence directories, or nil if none exist.
(void) - deleteCustomSequenceDirectory:
 Deletes the custom-sequence directory for a boxed music identifier.
(BOOL) - addIgnoreBackUpAttribute:
 Marks a path so it is excluded from iCloud/iTunes backup.
(nullable NSString *) - getDirectoryPath:
 Returns the per-music custom-sequence directory path, creating the tree if needed.
(nullable NSString *) - createJCFName
 Builds a fresh .jcf file name from the current date and time.
(BOOL) - deleteJCF:
 Deletes a .jcf file at a path if it exists.
(BOOL) - loadJCF:
 Loads and decodes a .jcf file into the model.
(BOOL) - saveJCF:
 Encodes the model and writes it to a .jcf file.
(BOOL) - createEditDataWithNSData:
 Stores raw data as the current custom data and decodes it.
(nullable NSMutableData *) - exeSaveBFEnc:
 Blowfish-encrypts a copy of a buffer with the save-data key.
(nullable NSMutableData *) - exeLoadBFDec:
 Blowfish-decrypts a copy of a buffer with the save-data key.
(nullable NSData *) - exeBFEnc:
 The second-layer encrypt hook for downloaded charts.
(nullable NSData *) - exeBFDec:
 The second-layer decrypt hook for downloaded charts.
(nullable NSString *) - createDLString:isDL:
 Fills an eight-character random tag whose sixth character's low bit records the DL flag.
(BOOL) - checkDownLoad:
 Tests whether a tag buffer's DL bit marks a downloaded chart.
(BOOL) - checkDownloadFile:
 Tests whether a decrypted blob's DL tag marks a downloaded chart.
(BOOL) - localSaveDLFile:serial:usrTag:
 Saves a downloaded chart locally, either loading an existing copy or installing a new one.
(nullable NSMutableDictionary *) - pickUpEditorInfoFromData:
 Reads a fixed-size blob into a scratch buffer and picks up its editor info.
(void) - setCharArray:setData:byte:
 Writes an unsigned value into a buffer as byte little-endian bytes.
(unsigned int) - getCharArrayValue:byte:
 Reads byte little-endian bytes from a buffer into an unsigned value.
(BOOL) - validateHash:
 Recomputes the current custom data's integrity hash and compares it to the stored value.
(void) - scoreDataReset
 Resets the score dictionary to its default (no best score, no full combo, zero hashes).
(nullable NSMutableDictionary *) - pickUpScoreData:
 Parses the score fields of a packed blob into a new dictionary, resetting on hash failure.
(nullable NSMutableDictionary *) - pickUpEditorInfo:
 Parses the editor-info fields of a packed blob into a new dictionary.
(nullable NSMutableDictionary *) - pickUpEditSimpleData:
 Parses the simple-data fields (counts, sectors, music bar, notes hash) of a packed blob.
(nullable NSMutableArray< NSNumber * > *) - pickUpSequenceTable:
 Parses the 2000-entry note-word table of a packed blob into a boxed array.
(BOOL) - decodeBinary
 Decodes the current custom data into the editor-info, score, simple-data, and sequence table models.
(BOOL) - encodeBinary
 Encodes the editor-info, score, simple-data, and sequence table models into a packed blob stored as the current custom data.
(nullable NSMutableArray< NSMutableDictionary * > *) - getFileInfoList:
 Returns the editor-info dictionaries for every .jcf file in a music's directory.
(BOOL) - isEnableEdit
 Whether editing is currently enabled (the copy-lock flag is clear).
(void) - disableEdit
 Disables editing by setting the copy-lock flag.
(nullable NSMutableDictionary *) - getScoreData
 Returns the score dictionary.
(void) - setScoreData:
 Replaces the score dictionary with a mutable copy of the given dictionary.
(nullable NSMutableDictionary *) - getEditorInfo
 Returns the editor-info dictionary.
(void) - setEditorInfo:
 Replaces the editor-info dictionary with a mutable copy of the given dictionary.
(nullable NSMutableDictionary *) - getEditSimpleData
 Returns the simple-data dictionary.
(void) - setEditSimpleData:
 Replaces the simple-data dictionary with a mutable copy of the given dictionary.
(void) - clearEditData
 Clears every loaded model reference.
(void) - resetEditorInfo
 Rebuilds the editor-info and score dictionaries from application defaults.
(nullable NSMutableArray< NSNumber * > *) - getSequenceTable
 Returns the sequence table.
(void) - setSequenceTable:
 Sets the sequence table.
(nullable NSString *) - getLastEditFileName:
 Returns the recorded last-edited file name for a music, if it still exists.
(nullable NSString *) - getLastEditFilePath:
 Returns the full path of the recorded last-edited file for a music.
(void) - setLastEditFileName:fileName:
 Records a file name as the last-edited file for a music.
(BOOL) - IsExistEditFile:
 Returns whether a last-edited marker file exists for a music.
(nullable NSString *) - getScoreHash:
 Returns the MD5 hash of a score packed as four little-endian bytes.
(BOOL) - checkScoreHash
 Returns whether the stored score hash matches the stored best score.
(void) - scoreUpdate:fullCombo:tuneID:
 Updates the best score and full-combo flag for a tune and saves the chart.
(nullable NSMutableArray< NSString * > *) - getMusicIDList
 Returns the identifiers of every built-in and purchased music, as strings.
(int) - getMusicNum
 Returns the count of built-in and purchased music.
(int) - getEditSlotLimit
 Returns the number of editable slots: four plus one per forty music.
(nullable NSMutableData *) - getCurrentCustomData
 Returns the current encoded custom-data buffer.

Class Methods

(instancetype) + sharedManager
 Returns the process-wide shared manager, creating it once.

Properties

BOOL bEnableCopy
 Whether copying the current chart is allowed.
BOOL bIsDownload
 Whether the current chart is a downloaded chart.

Detailed Description

The shared chart-editor data model.

Method Documentation

◆ addIgnoreBackUpAttribute:

- (BOOL) addIgnoreBackUpAttribute: (nullable NSString *) path

Marks a path so it is excluded from iCloud/iTunes backup.

The binary body only returns YES ; the attribute call was compiled out.

Parameters
pathThe file-system path.
Returns
YES always.
Ghidra address:
0x1c5c98

◆ checkDownLoad:

- (BOOL) checkDownLoad: (nullable const char *) buffer

Tests whether a tag buffer's DL bit marks a downloaded chart.

Parameters
bufferThe tag buffer (the sixth byte's low bit is tested), or nullptr .
Returns
YES if the low bit of buffer[5] is clear.
Ghidra address:
0x1c6644

◆ checkDownloadFile:

- (BOOL) checkDownloadFile: (nullable NSData *) data

Tests whether a decrypted blob's DL tag marks a downloaded chart.

Parameters
dataThe decrypted blob.
Returns
YES if the blob is a downloaded chart.
Ghidra address:
0x1c6660

◆ checkScoreHash

- (BOOL) checkScoreHash

Returns whether the stored score hash matches the stored best score.

Returns
YES if the score dictionary is self-consistent.
Ghidra address:
0x1c9a80

◆ clearEditData

- (void) clearEditData

Clears every loaded model reference.

Ghidra address:
0x1c91f0

◆ createDLString:isDL:

- (NSString *) createDLString: (char *) buffer
isDL: (BOOL) isDL 

Fills an eight-character random tag whose sixth character's low bit records the DL flag.

Parameters
bufferThe eight-byte destination.
isDLYES to mark the tag as downloaded (low bit clear).
Returns
The tag as an NSString .
Ghidra address:
0x1c64ec

◆ createEditDataWithNSData:

- (BOOL) createEditDataWithNSData: (nullable NSData *) data

Stores raw data as the current custom data and decodes it.

Parameters
dataThe raw edit-data blob.
Returns
YES always.
Ghidra address:
0x1c6300

◆ createJCFName

- (NSString *) createJCFName

Builds a fresh .jcf file name from the current date and time.

Returns
A name of the form <yyyyMMddHHmmssSSS>.jcf .
Ghidra address:
0x1c5e6c

◆ decodeBinary

- (BOOL) decodeBinary

Decodes the current custom data into the editor-info, score, simple-data, and sequence table models.

Returns
YES if the blob's integrity hash matched and it was decoded.
Ghidra address:
0x1c7d9c

◆ deleteCustomSequenceDirectory:

- (void) deleteCustomSequenceDirectory: (nullable NSNumber *) musicID

Deletes the custom-sequence directory for a boxed music identifier.

Parameters
musicIDThe music identifier, boxed as an NSNumber .
Ghidra address:
0x1c5c08

◆ deleteJCF:

- (BOOL) deleteJCF: (nullable NSString *) path

Deletes a .jcf file at a path if it exists.

Parameters
pathThe file path, or nil .
Returns
NO if path is nil , YES otherwise.
Ghidra address:
0x1c5f54

◆ disableEdit

- (void) disableEdit

Disables editing by setting the copy-lock flag.

Ghidra address:
0x1c902c

◆ encodeBinary

- (BOOL) encodeBinary

Encodes the editor-info, score, simple-data, and sequence table models into a packed blob stored as the current custom data.

Returns
YES always.
Ghidra address:
0x1c81a4

◆ exeBFDec:

- (nullable NSData *) exeBFDec: (nullable NSData *) data

The second-layer decrypt hook for downloaded charts.

The binary returns its argument unchanged.

Parameters
dataThe buffer.
Returns
data unchanged.
Ghidra address:
0x1c64d4

◆ exeBFEnc:

- (nullable NSData *) exeBFEnc: (nullable NSData *) data

The second-layer encrypt hook for downloaded charts.

The binary returns its argument unchanged.

Parameters
dataThe buffer.
Returns
data unchanged.
Ghidra address:
0x1c64bc

◆ exeLoadBFDec:

- (nullable NSMutableData *) exeLoadBFDec: (nullable NSData *) data

Blowfish-decrypts a copy of a buffer with the save-data key.

Parameters
dataThe ciphertext buffer.
Returns
A new decrypted buffer.
Ghidra address:
0x1c640c

◆ exeSaveBFEnc:

- (nullable NSMutableData *) exeSaveBFEnc: (nullable NSData *) data

Blowfish-encrypts a copy of a buffer with the save-data key.

Parameters
dataThe plaintext buffer.
Returns
A new encrypted buffer.
Ghidra address:
0x1c635c

◆ getCharArrayValue:byte:

- (unsigned int) getCharArrayValue: (const char *) buffer
byte: (int) byte 

Reads byte little-endian bytes from a buffer into an unsigned value.

Parameters
bufferThe source buffer.
byteThe number of bytes to read.
Returns
The decoded value.
Ghidra address:
0x1c6cd8

◆ getCurrentCustomData

- (NSMutableData *) getCurrentCustomData

Returns the current encoded custom-data buffer.

Returns
The encoded custom-data buffer.
Ghidra address:
0x1ca3b8

◆ getCustomSequenceDirectoryList

- (NSArray< NSString * > *) getCustomSequenceDirectoryList

Returns the names of the per-music custom-sequence directories, or nil if none exist.

Returns
The directory entry names under the edit folder, or nil .
Ghidra address:
0x1c5b2c

◆ getDirectoryPath:

- (NSString *) getDirectoryPath: (int) musicID

Returns the per-music custom-sequence directory path, creating the tree if needed.

The path is <documents>/edit/<%09d> where the last component is the zero-padded nine-digit music identifier. Both the edit folder and the music subfolder are created on demand, and the edit folder is flagged no-backup on creation.

Parameters
musicIDThe music identifier.
Returns
The directory path.
Ghidra address:
0x1c5ca0

◆ getEditorInfo

- (NSMutableDictionary *) getEditorInfo

Returns the editor-info dictionary.

Returns
The editor-info dictionary.
Ghidra address:
0x1c90d0

◆ getEditSimpleData

- (NSMutableDictionary *) getEditSimpleData

Returns the simple-data dictionary.

Returns
The simple-data dictionary.
Ghidra address:
0x1c9160

◆ getEditSlotLimit

- (int) getEditSlotLimit

Returns the number of editable slots: four plus one per forty music.

Returns
The editable slot limit.
Ghidra address:
0x1ca380

◆ getFileInfoList:

- (NSMutableArray< NSMutableDictionary * > *) getFileInfoList: (unsigned int) musicID

Returns the editor-info dictionaries for every .jcf file in a music's directory.

Parameters
musicIDThe music identifier.
Returns
An array of editor-info dictionaries, each tagged with its fileName .
Ghidra address:
0x1c8c7c

◆ getLastEditFileName:

- (NSString *) getLastEditFileName: (int) musicID

Returns the recorded last-edited file name for a music, if it still exists.

Parameters
musicIDThe music identifier.
Returns
The last-edited file name, or nil .
Ghidra address:
0x1c95c4

◆ getLastEditFilePath:

- (NSString *) getLastEditFilePath: (int) musicID

Returns the full path of the recorded last-edited file for a music.

Parameters
musicIDThe music identifier.
Returns
The last-edited file path, or nil .
Ghidra address:
0x1c976c

◆ getMusicIDList

- (NSMutableArray< NSString * > *) getMusicIDList

Returns the identifiers of every built-in and purchased music, as strings.

Returns
The music identifier list.
Ghidra address:
0x1c9e70

◆ getMusicNum

- (int) getMusicNum

Returns the count of built-in and purchased music.

Returns
The music count.
Ghidra address:
0x1ca224

◆ getScoreData

- (NSMutableDictionary *) getScoreData

Returns the score dictionary.

Returns
The score dictionary.
Ghidra address:
0x1c9040

◆ getScoreHash:

- (NSString *) getScoreHash: (int) score

Returns the MD5 hash of a score packed as four little-endian bytes.

Parameters
scoreThe score value.
Returns
The 32-character hexadecimal hash.
Ghidra address:
0x1c9a40

◆ getSequenceTable

- (NSMutableArray< NSNumber * > *) getSequenceTable

Returns the sequence table.

Returns
The sequence table.
Ghidra address:
0x1c95a0

◆ init

- (instancetype) init

Initialises an empty manager with copying enabled and no loaded data.

Returns
The initialised manager.
Ghidra address:
0x1c5a5c

◆ isEnableEdit

- (BOOL) isEnableEdit

Whether editing is currently enabled (the copy-lock flag is clear).

Returns
YES if editing is enabled.
Ghidra address:
0x1c9014

◆ IsExistEditFile:

- (BOOL) IsExistEditFile: (int) musicID

Returns whether a last-edited marker file exists for a music.

Parameters
musicIDThe music identifier.
Returns
YES if the marker file exists.
Ghidra address:
0x1c9960

◆ loadJCF:

- (BOOL) loadJCF: (nullable NSString *) path

Loads and decodes a .jcf file into the model.

Parameters
pathThe file path.
Returns
YES if the file was read and decoded successfully.
Ghidra address:
0x1c5ff4

◆ localSaveDLFile:serial:usrTag:

- (BOOL) localSaveDLFile: (nullable NSData *) data
serial: (nullable NSString *) serial
usrTag: (int) usrTag 

Saves a downloaded chart locally, either loading an existing copy or installing a new one.

Parameters
dataThe downloaded, still-encoded chart blob.
serialThe download sequence identifier string.
usrTagThe user tag to record.
Returns
YES on success.
Ghidra address:
0x1c6718

◆ pickUpEditorInfo:

- (nullable NSMutableDictionary *) pickUpEditorInfo: (nullable const char *) buffer

Parses the editor-info fields of a packed blob into a new dictionary.

Parameters
bufferThe packed edit-data buffer.
Returns
The editor-info dictionary, or nil for a nullptr buffer.
Ghidra address:
0x1c74bc

◆ pickUpEditorInfoFromData:

- (nullable NSMutableDictionary *) pickUpEditorInfoFromData: (nullable NSData *) data

Reads a fixed-size blob into a scratch buffer and picks up its editor info.

Parameters
dataThe raw edit-data blob.
Returns
The editor-info dictionary.
Ghidra address:
0x1c6b58

◆ pickUpEditSimpleData:

- (nullable NSMutableDictionary *) pickUpEditSimpleData: (nullable const char *) buffer

Parses the simple-data fields (counts, sectors, music bar, notes hash) of a packed blob.

Parameters
bufferThe packed edit-data buffer.
Returns
The simple-data dictionary.
Ghidra address:
0x1c7990

◆ pickUpScoreData:

- (nullable NSMutableDictionary *) pickUpScoreData: (nullable const char *) buffer

Parses the score fields of a packed blob into a new dictionary, resetting on hash failure.

Parameters
bufferThe packed edit-data buffer.
Returns
The score dictionary, or nil for a nullptr buffer.
Ghidra address:
0x1c6fb8

◆ pickUpSequenceTable:

- (nullable NSMutableArray< NSNumber * > *) pickUpSequenceTable: (nullable const char *) buffer

Parses the 2000-entry note-word table of a packed blob into a boxed array.

Parameters
bufferThe packed edit-data buffer.
Returns
The sequence table of boxed packed note words.
Ghidra address:
0x1c7cb4

◆ resetEditorInfo

- (void) resetEditorInfo

Rebuilds the editor-info and score dictionaries from application defaults.

Ghidra address:
0x1c926c

◆ saveJCF:

- (BOOL) saveJCF: (nullable NSString *) path

Encodes the model and writes it to a .jcf file.

Parameters
pathThe file path.
Returns
NO if path is nil , YES otherwise.
Ghidra address:
0x1c6194

◆ scoreDataReset

- (void) scoreDataReset

Resets the score dictionary to its default (no best score, no full combo, zero hashes).

Ghidra address:
0x1c6e48

◆ scoreUpdate:fullCombo:tuneID:

- (void) scoreUpdate: (int) score
fullCombo: (BOOL) fullCombo
tuneID: (int) tuneID 

Updates the best score and full-combo flag for a tune and saves the chart.

Parameters
scoreThe new score.
fullComboWhether the play was a full combo.
tuneIDThe music identifier whose last-edited chart is updated.
Ghidra address:
0x1c9b58

◆ setCharArray:setData:byte:

- (void) setCharArray: (char *) buffer
setData: (unsigned int) data
byte: (int) byte 

Writes an unsigned value into a buffer as byte little-endian bytes.

Parameters
bufferThe destination buffer.
dataThe value to store.
byteThe number of bytes to write.
Ghidra address:
0x1c6bf4

◆ setEditorInfo:

- (void) setEditorInfo: (nullable NSDictionary *) editorInfo

Replaces the editor-info dictionary with a mutable copy of the given dictionary.

Parameters
editorInfoThe source dictionary.
Ghidra address:
0x1c90e0

◆ setEditSimpleData:

- (void) setEditSimpleData: (nullable NSDictionary *) editSimpleData

Replaces the simple-data dictionary with a mutable copy of the given dictionary.

Parameters
editSimpleDataThe source dictionary.
Ghidra address:
0x1c9170

◆ setLastEditFileName:fileName:

- (void) setLastEditFileName: (int) musicID
fileName: (nullable NSString *) fileName 

Records a file name as the last-edited file for a music.

Parameters
musicIDThe music identifier.
fileNameThe file name to record.
Ghidra address:
0x1c9808

◆ setScoreData:

- (void) setScoreData: (nullable NSDictionary *) scoreData

Replaces the score dictionary with a mutable copy of the given dictionary.

Parameters
scoreDataThe source dictionary.
Ghidra address:
0x1c9050

◆ setSequenceTable:

- (void) setSequenceTable: (nullable NSMutableArray< NSNumber * > *) sequenceTable

Sets the sequence table.

Parameters
sequenceTableThe sequence table.
Ghidra address:
0x1c95b0

◆ sharedManager

+ (instancetype) sharedManager

Returns the process-wide shared manager, creating it once.

Returns
The shared manager.
Ghidra address:
0x1c59d4
Ghidra address:
0x1c5a18

◆ validateHash:

- (BOOL) validateHash: (nullable NSData *) data

Recomputes the current custom data's integrity hash and compares it to the stored value.

Parameters
dataUnused; the check reads the current writeData buffer.
Returns
YES if the hashes match.
Ghidra address:
0x1c6d7c

Property Documentation

◆ bEnableCopy

- (BOOL) bEnableCopy
readnonatomicassign

Whether copying the current chart is allowed.

Ghidra address:
0x1ca3c8

◆ bIsDownload

- (BOOL) bIsDownload
readwritenonatomicassign

Whether the current chart is a downloaded chart.

The getter is at 0x1ca3d8 and the setter at 0x1ca3e8.


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