Skip to content

Commit

Permalink
Use a fixed modification date when zipping
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jul 17, 2024
1 parent 30a614d commit 4c366e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/virtual-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,15 @@ class VirtualMachine extends EventEmitter {
zip.file('project.json', projectJson);
this._addFileDescsToZip(this.serializeAssets(), zip);

// Use a fixed modification date for the files in the zip instead of letting JSZip use the
// current time to avoid a very small metadata leak and make zipping deterministic. The magic
// number is from the first TurboWarp/scratch-vm commit after forking
// (4a93dab4fa3704ab7a1374b9794026b3330f3433).
const date = new Date(1591657163000);
for (const file of Object.values(zip.files)) {
file.date = date;
}

return zip;
}

Expand Down

0 comments on commit 4c366e0

Please sign in to comment.