manifest_ldiff.proto 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. File taken from GitHub user Lightczx (DGP-Studio/Snap.Hutao/issues/2446)
  3. That repository is licensed under MIT, thus assuming the same for this comment.
  4. */
  5. syntax = "proto3";
  6. message DiffManifest {
  7. repeated DiffFileInfo files = 1;
  8. repeated DeleteFile files_delete = 2;
  9. }
  10. message DiffFileInfo {
  11. string filename = 1; // Path to the file relative to the game directory
  12. int32 size = 2; // Size of the entire file
  13. string hash = 3; // md5 file hash AFTER patching
  14. repeated Patch patches = 4;
  15. }
  16. message Patch {
  17. string key = 1; // Game version, e.g. "5.5.0" or "5.4.0" (when updating to "5.6.0")
  18. PatchInfo info = 2;
  19. }
  20. // A patch file usually contains multiple concatenated hpatchz files, thus
  21. // this structure describes which section of the file patches which game file.
  22. message PatchInfo {
  23. // File hash on disk "[8 bytes -> hex]_[16 bytes -> hex]" and
  24. // the "suffix" for the URL found in getPatchBuild -> '.data.manifests.[N].diff_download.url_prefix'
  25. // The official launcher uses the same naming scheme.
  26. string patch_id = 1; // unique identifier (hash)
  27. string tag = 2; // same as `Patch.key`
  28. string build_id = 3; // same as in the getBuild API (unused in this script)
  29. int64 patch_size = 4; // in bytes
  30. string patch_name = 5; // = "[8 bytes -> hex]" from 'id' above
  31. int64 patch_offset = 6; // in bytes
  32. int64 patch_length = 7; // in bytes
  33. string original_name = 8; // relative game file path to patch
  34. int64 original_size = 9; // in bytes
  35. string original_hash = 10; // md5 file hash BEFORE patching
  36. }
  37. message DeleteFile
  38. {
  39. string key = 1; // same as `Patch.key`
  40. DeleteFiles info = 2;
  41. }
  42. message DeleteFiles
  43. {
  44. repeated DeleteFileInfo list = 1;
  45. }
  46. message DeleteFileInfo
  47. {
  48. string filename = 1; // relative game file path
  49. int64 size = 2; // file size
  50. string hash = 3; // md5
  51. }