> For AI agents: the complete documentation index is available at https://renmori.mewbaka.cn/en/llms.txt, the full documentation bundle is available at https://renmori.mewbaka.cn/en/llms-full.txt.

# renmori verify

`renmori verify` uses the protected build's own `renmori-manifest.json` to check whether the build has been modified since protection, whether any file required to run it is missing, and whether plaintext scripts or archives that could be extracted directly remain on disk. It only reads files and modifies nothing, so it can be run manually before release or used as a gate step in a CI pipeline.

## Syntax

```bash
renmori verify <protected-dir> [--lang {auto,en,zh}] [--no-color] [--quiet]
```

| Argument        | Description                                                                                                                                   |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `protected-dir` | The root directory of a protected build generated by `renmori protect`, that is, the directory containing `renmori-manifest.json` and `game/` |

## Checks

| Check                                                                                               | Problem reported on failure                                                        |
| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `renmori-manifest.json` exists in the build root                                                    | `no renmori-manifest.json in <dir>`; the command ends immediately with exit code 2 |
| `game/renmori.rmc` exists                                                                           | `missing renmori.rmc`                                                              |
| `game/renmori.rpe` exists                                                                           | `missing renmori.rpe`                                                              |
| The SHA-256 of the container file matches `container_sha256` in the manifest                        | `container sha mismatch`                                                           |
| No `.rpa`, `.rpyc`, `.rpy`, `.rpyb` or `.rpymc` files exist in `game/` or any of its subdirectories | `plaintext left: <path>`; only the first one found is reported                     |

Except for a missing build manifest, which ends the command immediately, the results of the checks are collected and reported together. If any check fails, the command lists all problems and exits with code 1.

The container hash check detects the following: the container was replaced, truncated or corrupted in transit after protection, or the build manifest comes from a different protection run. The plaintext leftover check covers the `cache/` directory, because the `.rpyb` files in that directory contain the compiled bytecode of the scripts.

## Out of scope

`verify` is a static file check; the following are outside its scope:

- It does not run the game or decrypt the container, so it cannot confirm that every asset can be read correctly by the engine. For end-to-end verification, use [`tools/verify_in_renpy.py`](https://github.com/MewBaka/RenMori/blob/main/tools/verify_in_renpy.py) from the repository, which loads the protected build in a real Ren'Py SDK
- It does not check files outside `game/`, such as the per-platform launchers and the runtime in `lib/`
- It does not check non-script files kept on disk by `exclude` or `keep_on_disk`; these files exist as plaintext by design
- It does not judge whether the protection strength used by the build meets release requirements; the protection strength is recorded in the `strength` field of the manifest and can be checked separately by the pipeline

## Output

Progress output goes to stderr, and the final JSON line goes to stdout.

Verification passed:

```json
{"status": "ok", "file_count": 842, "container_sha256": "9f2c…"}
```

Verification failed:

```json
{"status": "error", "problems": ["container sha mismatch", "plaintext left: game/script.rpyc"]}
```

Build manifest missing:

```json
{"status": "error", "message": "no renmori-manifest.json in /path/to/build"}
```

For the meaning of the fields and exit codes, see [Output, Build Manifest and Exit Codes](https://renmori.mewbaka.cn/en/cli/output.md).

## Exit codes

| Exit code | Meaning                                                 |
| --------: | ------------------------------------------------------- |
|         0 | All checks passed                                       |
|         1 | At least one check failed                               |
|         2 | `renmori-manifest.json` does not exist in the directory |

## Examples

Verify manually before release:

```bash
renmori verify ./dist/MyGame-1.0-pc-protected
```

Use as a gate in CI, printing only JSON:

```bash
renmori verify ./build/MyGame-pc-protected --quiet
```

Decide in a shell script whether to proceed with the upload based on the result:

```bash
if renmori verify ./out --quiet > verify.json; then
  echo "verified"
else
  cat verify.json
  exit 1
fi
```

:::tip
No further changes should be made to the build between `protect` and `verify`. If the content needs adjusting, run `protect` again from a fresh distribution build or the backup instead of modifying the protected directory.
:::
