feat(cli): add archive command for cross-host data transport (#610)

* feat(cli): add archive command for cross-host data transport
* fix(archive): correct flat-layout path and entry-count wording
* refactor(archive): rename BuildArchive to WriteArchive
This commit is contained in:
Roger
2026-06-07 15:58:33 +08:00
committed by GitHub
parent f1219e49ab
commit cd0b2daaf3
11 changed files with 543 additions and 15 deletions
+4 -4
View File
@@ -1,8 +1,6 @@
package chromium
import (
"path/filepath"
"github.com/moond4rk/hackbrowserdata/masterkey"
"github.com/moond4rk/hackbrowserdata/types"
)
@@ -14,8 +12,10 @@ type sourcePath struct {
isDir bool // true for directory targets (LevelDB, Session Storage)
}
func file(rel string) sourcePath { return sourcePath{rel: filepath.FromSlash(rel), isDir: false} }
func dir(rel string) sourcePath { return sourcePath{rel: filepath.FromSlash(rel), isDir: true} }
// rel stays slash-canonical (e.g. "Network/Cookies"); filepath.Join converts at resolve time, and
// archive reuses it verbatim as a forward-slash zip entry name.
func file(rel string) sourcePath { return sourcePath{rel: rel, isDir: false} }
func dir(rel string) sourcePath { return sourcePath{rel: rel, isDir: true} }
// chromiumSources defines the standard Chromium file layout.
// Each category maps to one or more candidate paths tried in priority order;