fix(archive): correct flat-layout path and entry-count wording

Drop the phantom <basename>/ level for flat-layout installs (profileDir == root), say "entries" not "files" (count is per source path), and add ZipDir/Unzip (>1MB, empty, Zip-Slip) + flat-layout tests.
This commit is contained in:
moonD4rk
2026-06-06 21:04:24 +08:00
parent 96ed041fa0
commit 8851ef63ba
5 changed files with 126 additions and 3 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ type Archivable interface {
// BuildArchive packs each browser's decryption-relevant files into a zip whose internal layout is
// <browser-key>/<User Data layout>, so a restore can re-expand it and decrypt with a keys.json. Files
// are staged through a locked-file session first because Windows holds exclusive SQLite locks. Returns
// the number of files captured.
// the number of source entries staged (a directory source counts once).
func BuildArchive(browsers []Browser, categories []types.Category, outPath string) (int, error) {
session, err := filemanager.NewSession()
if err != nil {