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

Bundles each browser's decryption-relevant files + Local State into a <browser-key>/<User Data> zip (forward-slash entries) for cross-host restore.
This commit is contained in:
moonD4rk
2026-06-06 20:45:06 +08:00
parent f1219e49ab
commit 96ed041fa0
10 changed files with 420 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;