Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ZemerTeam/zemer-cipher/llms.txt
Use this file to discover all available pages before exploring further.
PlayerConfigParser is the security and validation boundary for all player config data. Every value that will be evaluated as JavaScript in the cipher WebView is validated against strict regex patterns before use. Pure JVM — no Android imports, fully unit-testable.
Package: com.zemer.cipher
The parser is the only code path that can promote untrusted JSON into the in-memory config table. PlayerConfigStore always routes both the bundled asset and the remote download through PlayerConfigParser.parse() before applying any result.
Constant: SUPPORTED_SCHEMA_VERSION = 1
Members
parse
player_configs.json string. Returns ParseResult.Success with the validated config map and a list of skipped entry keys, or ParseResult.Failure with a human-readable reason string.
The full text of a
player_configs.json file to parse and validate.File-level failures
The following conditions causeParseResult.Failure to be returned for the entire file. The caller keeps its previous config table unchanged.
| Condition | Example |
|---|---|
| Malformed JSON | Syntax error anywhere in the document |
schemaVersion missing or not an integer | "schemaVersion": "1" (string instead of int) |
schemaVersion is zero or negative | "schemaVersion": 0 |
schemaVersion exceeds SUPPORTED_SCHEMA_VERSION (1) | "schemaVersion": 2 |
players field missing or not a JSON object | "players": [] |
| Duplicate primary hash or alias key anywhere in the file | Two entries sharing the same hash or alias |
Entry-level failures
The following conditions cause an individual entry to be skipped and its key added toskippedEntries. The rest of the file is still processed and a ParseResult.Success is returned.
| Condition | Regex / constraint |
|---|---|
| Hash key format invalid | Must match ^[a-f0-9]{8}$ |
sig missing or format invalid | Must match ^[A-Za-z0-9$_]{1,8}\(\d+,\d+,INPUT\)$ |
nClass missing or format invalid | Must match ^[A-Za-z0-9$_]{1,8}$ |
sts missing, not an integer, or not positive | Must be a positive integer literal (not a string) |
aliases not an array | Any non-array value for the aliases key |
| Any alias element not an 8-hex string | Must match ^[a-f0-9]{8}$ |
merge
remote onto bundled. Remote entries win on a per-key basis; keys present only in bundled survive unchanged. The result is a new immutable map.
The config map parsed from the bundled APK asset. Acts as the baseline.
The config map parsed from the remote (GitHub) copy. Wins over bundled entries on collision.
buildNJsExpression
nClass identifier. The IIFE template is defined locally in the library — it is never taken from the remote config file, so a compromised remote cannot inject arbitrary JavaScript for the n-transform path.
INPUT in the returned string is a placeholder that CipherWebView replaces with the actual n-value at evaluation time.
The URL class identifier extracted from the
nClass field of a config entry. Must already be validated against ^[A-Za-z0-9$_]{1,8}$ before this function is called.nClass = "Yx":
Types
ParseResult
Sealed class representing the outcome of a parse() call.
ParseResult.Success
configs is the fully-merged map ready for use (primary hashes and all alias hashes are already registered as keys). skippedEntries lists the primary hash keys of individually-invalid entries that were excluded; an empty list means every entry passed validation.
The validated, alias-expanded config map. Keys are 8-hex strings (both primary hashes and aliases from
aliases arrays).Primary hash keys of entries that failed individual validation and were excluded from
configs. May be empty.ParseResult.Failure
Human-readable description of why the file was rejected (e.g.
"duplicate hash/alias 'a1b2c3d4' (entry 9c249f6f)").