Files
SimpleRemoter/server
yuanyuanxianganddeepseek-flash e39b9d1ed5 Feature: add a remote file hash query for the file manager
Add COMMAND_FILE_HASH/TOKEN_FILE_HASH (182/183) and the
CLIENT_CAP_FILE_HASH capability so the server can ask a client for a
single file's exact size, mtime and SHA-256 without transferring it.
This is the P2 half of the double-click preview design; old clients do
not advertise the capability and are skipped by the caller.

Windows hashes with BCrypt through the existing VerifyV2 helper; Unix
and Android stream Sha256 while reading. Both clamp the peer-supplied
maxBytes to FILE_PREVIEW_MAX_BYTES, echo the original request path bytes
for correlation, and return TOO_LARGE without reading the file. The Unix
loop also verifies the bytes hashed match stat() so a file changed
mid-read reports an error instead of a mismatched hash.

No existing command changes; the new values are explicit and the four
DefaultCaps branches advertise the capability.

Co-Authored-By: deepseek-flash
2026-12-05 15:02:59 +01:00
..