Commit bef337c
authored
Add ability to fix zip corruption (#87)
`@turbowarp/[email protected]` now includes a recovery mode where it tries to find file entries by scanning the zip if the central directory is missing. The way that JSZip is really nice as it puts all the sizes and everything directly in the local header, so we don't need to do a lot of guesswork. If we had to support a bunch of random zip generators, this would be more work.
The sb3fix changes are to enable this mode, add logs, and remove files that have mismatched uncompressed data sizes so that regular Scratch will be able to load it.
These projects now get automatically fixed instead of waiting for me to run `zip -FF` manually:
- All 3 projects in #82 (comment)
- #80
- #59
- #32
- #31
- #30
- #28
- #7
It probably would've automatically fixed these but the links no longer work, so can't verify for certain:
- #81
- #50
- #22
- #5
- #4
- #31 parent 7792865 commit bef337c
File tree
6 files changed
+46
-6
lines changed- src
- tests
- expected-output
- samples
6 files changed
+46
-6
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
612 | 621 | | |
613 | 622 | | |
614 | 623 | | |
615 | | - | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
616 | 652 | | |
617 | 653 | | |
618 | 654 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Binary file not shown.
0 commit comments