Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabling debug dumping-as-json mode for v6 files #25

Closed
adq opened this issue Apr 27, 2024 · 8 comments
Closed

enabling debug dumping-as-json mode for v6 files #25

adq opened this issue Apr 27, 2024 · 8 comments

Comments

@adq
Copy link
Contributor

adq commented Apr 27, 2024

If you set SCENE_FILE_V6_DEBUG=1 prior to running xochitl will start dumping the rm files as json files for debug when it saves them - it'll output in journalctl what the filenames are.

If you wanna enable this persistently:

[Unit]
Description=reMarkable main application
StartLimitIntervalSec=600
StartLimitBurst=4
OnFailure=remarkable-fail.service
After=home.mount
Wants=rm-sync.service

[Service]
ExecStart=/usr/bin/xochitl --system
Restart=on-failure
WatchdogSec=60
Environment="SCENE_FILE_V6_DEBUG=1"

[Install]
WantedBy=multi-user.target
@adq adq changed the title enable debug dumping-as-json mode for v6 files enabling debug dumping-as-json mode for v6 files Apr 27, 2024
@Azeirah
Copy link
Contributor

Azeirah commented Apr 27, 2024

Super interesting! Do you have an example of what such a file looks like? I don't have access to my ReMarkable at the moment since it's bricked :x

@adq
Copy link
Contributor Author

adq commented Apr 27, 2024

Sorry to hear that!

I'll get a sample one together soon, but they can be pretty huge. Its the entire file in plain JSON format. For example here's block type 13:

    "SceneInfo": {
        "backgroundVisible": {
            "timestamp": "0:0",
            "value": 1
        },
        "currentLayer": {
            "timestamp": "1:1892",
            "value": "0:11"
        },
        "rootDocumentVisible": {
            "timestamp": "1:1887",
            "value": 1
        }
    },

and block type 8:

        {
            "CrdtTombstoneItem": {
                "deletedLength": 20,
                "id": "1:43",
                "left": "1:42",
                "parentId": "0:11",
                "right": "0:0"
            }
        },

patches incoming :D

@Azeirah
Copy link
Contributor

Azeirah commented Apr 27, 2024

Oh my

Did you discover this debugging flag yourself? It's stupidly useful for what we're doing here 😅😅

I did a bit of digging a while ago, even went as far as downloading ghidra and even getting a book on it.. but I felt it was a bit much given my other responsibilities.. glad to see there are other people digging!

@adq
Copy link
Contributor Author

adq commented Apr 27, 2024

yeah, just found it this afternoon! I'd spotted there were some interesting strings which were clearly tracing from functions about "writing scene files out as JSON" so I went poking about.. and there it was!

@Azeirah
Copy link
Contributor

Azeirah commented Apr 27, 2024

Awesome! You should really share this discovery in the remarkable discord!

@adq
Copy link
Contributor Author

adq commented Apr 27, 2024

Good plan: done!

Here's a simple sample of the RM file and its matching json file.

2584527c-7667-4b1c-994c-ae70215653e4.rm.gz
2584527c-7667-4b1c-994c-ae70215653e4.rm.tmp.json.gz

@ricklupton
Copy link
Owner

@adq that's great! Thanks for sharing and for the patches.

@ricklupton
Copy link
Owner

I've added a link to this issue in the README and so will close it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants