Any data saved from RecordStore is saved to disk in an easy to parse format
which includes a JSON metadata file along with the individual records in their
own binary files. This makes it simple to implement and allows for efficient
handling of save data and for the transfer of such data between different
emulators. The format is derived from SquirrelJME's save format with
modifications, note that SquirrelJME now follows this specification.
This specification is implemented by:
- SquirrelJME
- FreeJ2ME-Plus
There are two main file formats:
[baseName].rms-- RecordStore Metadata- JSON containing metadata for the RecordStore.
[baseName].[recordId]-- Individual record data- This is flat binary data with no headers, footers, or otherwise.
- If a record has ID 3 and contains 300 bytes of data then this
would be a file called
[baseName].3containing 300 bytes of data.
[baseName].rms -- RecordStore Metadata
Specific types:
dateString- A date in the following format:
"2025-05-30 01:43:04"
- A date in the following format:
versionString- A MIDP 3+ compatible version number:
"[0-9]+.[0-9]+.[0-9]"+.
- A MIDP 3+ compatible version number:
The following JSON keys are defined:
rmsVersion: versionString- The currently defined version of this specification.
- Current value is
"1.1.0"
rmsDate: dateString- A human-readable timestamp of the last modification date of the record store.
- SquirrelJME: Not implemented.
authentication: integer- The authentication mode of the record store, determines if other applications have access to it.
AUTHMODE_PRIVATEis0,AUTHMODE_ANYis1.
baseName: string- The base name used for the
.rmsand record data files. - SquirrelJME: This is used to relocate records in the event the file's base name has been renamed.
- The base name used for the
ids: array[int]- The record IDs which are currently valid and existing for this record store.
- These IDs will correlate to
[baseName].[recordId]files.
modificationCount: int- The number of times the record store has been modified.
- SquirrelJME: Includes metadata modifications.
- FreeJ2ME-Plus: Only includes data modifications.
lastModified: int- Milliseconds since the UNIX epoch in UTC when the record store was last modified.
- Equivalent to:
System.currentTimeMillis().
otherWrite: int- Are other MIDlets permitted to write data into this record store?
- Read-only is
0, Writable is1.
ownerName: string- The owner name of this record store.
- This is derived from
MIDlet-Name.
ownerVendor: string- The owner vendor of this record store.
- This is derived from
MIDlet-Vendor.
ownerVersion: versionString- The owner version of this record store, when a record store is loaded the version number need not be considered unless there is a desire to have version specific storage.
- This is derived from
MIDlet-Version. - SquirrelJME: This is ignored and will always be treated as
"0.0.0".
password: string- The password used to lock access to the record store.
- Note that this is stored as plain text.
recordName: string- The name of the record.
- At creation time this is set from
RecordStore.openRecordStore().
tag:[recordId]: int- For every valid
recordIdinids, each record will have a tag value specified. - Only valid for MIDP 3+, if unsupported this value will be
0. - FreeJ2ME-Plus: Ignored as only up to MIDP 2.1 is supported.
- For every valid
baseName Calculation
The baseName hash is calculated as:
public class BaseNameCalculation
{
public static String calculate(String __ownerName,
String __ownerVendor, String __recordName)
{
/* Encoded with the Basic alphabet: A-Z a-z + / = */
String base64Encoded = Base64.getEncoder()
.encodeToString(__recordName.getBytes("utf-8"))
.toLowerCase()
.replace('=', '_')
.replace('/', '~');
return String.format("%08x%02d%s",
__ownerName.hashCode() ^ __ownerVendor.hashCode(),
__recordName.length(),
base64Encoded);
}
}
DoJa/Star Scratchpads
For DoJa/Star Scratchpads, the following metadata values are always set with the specific values:
ownerVendor:Keitai-DoJaownerName: Derived from the ADF/JAM valueAppNamerecordName:ScratchPad-[0-16]- Represents which scratchpad this belongs to, all scratchpads go into their own record stores and are differentiated by record name.
All scratchpad data for the given scratchpad is placed into the first
record ID of one (1).
[baseName].[recordId] -- Individual record data
This is solely a flat binary file with no headers, footers, or otherwise. It
consists only of the bytes that were passed to RecordStore.addRecord()
or RecordStore.setRecord().
Changelog
- SquirrelJME to RMS Save Format Specification 1.0.0
rmsVersionadded.rmsDateadded.lastModifiedadded.ownerVersionis now optional and need not be always0.0.0.- For DoJa,
ownerVendoris nowKeitai-DoJainstead ofSquirrelJME-DoJa.
- Version 1.0.0 to Version 1.1.0
- Base64 encoding changes
/to~for storage systems which do not support storing into directories.
- Base64 encoding changes