111 Commits
Author SHA1 Message Date
Roger fce4f288df refactor: drop the archive manifest (#678)
Restore must read v1.1.0's manifest-less archives from the layout, and that path reads every new archive too,
so the manifest only described the layout a second time.
2026-11-02 11:11:55 +08:00
Roger 3e9150249c refactor: rename core types and spell out every name (#677)
Def, Request, DirID, and Source said too little, and short variables and doc comments that skip their name hid intent.
varnamelen and staticcheck ST1020-22 now keep both from coming back.
2026-11-02 11:06:05 +08:00
Roger 0ed920f846 docs: trim code comments to the why (#676)
Comments that restated names or narrated the code are gone, and multi-line ones are cut to a line of why.
Only comments change: each edited Go file has the same token stream as before. winapi and abe come later.
2026-11-02 00:03:03 +08:00
Roger 4e98ba7884 fix: report unreadable sources and tidy the pipeline (#675)
A Stat error other than not-exist was reported as absent, and the --zip archive was readable by other users.
The rest is review follow-up: export no longer prints, one runner type, shared name helpers, a trimmed log API.
2026-11-01 23:42:13 +08:00
Roger d00239f9f2 docs: Safari, keychain flags, and the full browser list (#671)
The help text and README named only Chromium and Firefox; they now add Safari and
--keychain-pw-stdin, correct the cookie-editor note (other categories are written, not skipped),
and align the browser names with the code, adding Browser from Vought.
2026-10-29 16:56:46 +08:00
Roger 07b66adc4d test: move compat tests into the packages they cover (#669)
The pipeline goldens now live in app, export in export, and keys.json in masterkey, each with its own
testdata; cmd keeps the flag and list goldens. Shared fixtures and golden helpers became the
internal/browser/browsertest and internal/golden packages. The binary is byte-identical.
2026-10-29 16:12:50 +08:00
Roger c0a03769f1 fix: stop cleanly on Ctrl-C, SIGTERM, and SIGHUP (#668)
A signal killed the process mid-run and left the snapshot's copies of browser files in the temp dir.
The run now stops at its next step, removes them, and ends by the same signal, so the exit status and
calling scripts see what they did before. RFC-012 also keeps the list goldens in cmd.
2026-10-29 15:12:30 +08:00
Roger a794674bd7 refactor: delete the superseded top-level packages (#667)
After the switch-over only two cmd tests used browser/, filemanager/, types/, and utils/fileutil.
The list test now compares against goldens of the output it proved equal to the old code's, and the
export test keeps its own fixture records; the binaries built before and after are byte-identical.
2026-10-29 14:59:13 +08:00
Roger bbd353f314 refactor: run every command on the pipeline (#665)
dump, dumpkeys, archive, restore, and list now run on the app stages, so cmd's old path goes away.
archive writes manifest.json and restore reads it, falling back to today's layout for older archives.
Windows and macOS smoke matched today's output apart from the planned changes.
2026-10-29 14:15:59 +08:00
Roger 8c9c9901a1 fix(export): pack --zip before removing the outputs (#663)
CompressDir deleted each file as it was added and wrote the zip last, so a failure lost the output,
and it packed and deleted every file in -d. The writer now packs only the files it wrote, renames
the zip into place, and only then removes them.
2026-10-28 17:05:28 +08:00
Roger 4add07e825 refactor: add the Safari base under internal/browser (#660)
Parsers move with git mv and hand records to a Collector; discovery reads a copy
of SafariTabs.db, and app hands the run's login keychain to the default profile's
password extractor. The old browser/safari runs the new extractors.
2026-10-28 15:51:15 +08:00
Roger 2093045664 refactor: add the Firefox base under internal/browser (#659)
Parsers move with git mv and hand records to a Collector; the old browser/firefox
runs them, and app now discovers Firefox. A profile without a usable key exports
its logins instead of panicking, as RFC-008 now lists.
2026-10-28 15:06:07 +08:00
Roger bc59bd57bb test(cmd): add Firefox and Safari extract goldens (#658)
Phase 6 moves the Firefox and Safari parsers, so today's output is locked
first, as the Chromium goldens were before Phase 5.
2026-10-28 11:35:44 +08:00
Roger 2b70e4ad65 refactor: run Chromium through the internal/app pipeline (#656)
Validate, Discover, NewPlan, Execute, and Report run beside today's path: one snapshot per user
data dir, each dir's keys retrieved once on first use, every record stamped by the collector.
On the Chromium fixtures it writes the extract goldens byte for byte; the CLI switches over later.
2026-10-27 17:17:41 +08:00
Roger 0b8cc23216 refactor: introduce internal/snapshot for copy and zip (#653)
One copier and one zip transport serve archive, restore, and every profile copy, so locked-file handling has one home.
Dropping otiai10/copy takes x/sync out of every binary and testing out of the Windows exe.
2026-10-27 14:54:54 +08:00
Roger 49747bf0ce refactor: move crypto and key retrieval under internal/ (#652)
Crypto stays free of OS calls, so every secret-store read sits behind one masterkey contract.
The macOS v10 retriever reads one run-scoped login keychain handle that Safari will share.
2026-10-27 13:19:45 +08:00
Roger b04c436a73 refactor: introduce category, record, and export packages (#651)
Later layers speak categories and records, and export needs nothing else.
Ordering rows once in the exporter fixes Firefox history, written least visited first.
2026-10-26 19:55:19 +08:00
Roger 9937dbf9fb refactor: move leaf utilities under internal/ (#650)
Phase 1: the packages with no project dependencies move first, so every
later phase builds on finished leaves; the goldens pin the behavior.
2026-10-26 16:41:52 +08:00
Roger fb86bd368e test: pin today's output with compatibility goldens (#649)
Phase 0, part 2: freeze the output files, keys.json, and archives today's
code writes, so every later phase can prove it changes nothing.
2026-10-26 16:22:58 +08:00
Roger f4c05f861f chore: add refactor RFCs and compatibility guardrails (#648)
Phase 0 of the refactor: settle the design record and pin the CLI flag
surface and wire names before any code moves.
2026-10-26 15:41:47 +08:00
Roger bf96ba8c80 feat(restore): cross-platform restore via dump engine rebuild (#606) (#611)
* feat(restore): cross-platform restore via dump engine rebuild (#606)

Restore previously required the dump's origin OS, overlaying keys onto locally-discovered browsers. It now rebuilds Chromium engines from the dump's vaults (v2 adds engine kind), so copied data or an archive zip decrypts on any OS.

* fix(restore): polish help text, drop dead check, dedup dump kinds

pflag treats backticked words in flag usage as the value placeholder,
so --data-zip rendered as "--data-zip archive" in help output.
2026-06-12 20:53:00 +08:00
Roger cd0b2daaf3 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
2026-06-07 15:58:33 +08:00
Roger 8936c42d10 refactor(cli): flatten keys export/import into dumpkeys/restore (#608)
* refactor(cli): flatten keys export/import into dumpkeys/restore

The keys noun-group clashed with the flat dump/list verbs; unify on flat verbs and drop the keys parent. Pure rename, no behavior change.

* docs(rfc): add RFC-013 CLI redesign & cross-host restore

The accepted design doc for the flat-verb CLI redesign and cross-platform restore.
2026-06-06 14:34:40 +08:00
Roger c444314832 refactor: extract master-key code into masterkey package (#604) 2026-06-01 16:08:32 +08:00
Roger b901f7dff0 refactor(browser): split installation and profile abstractions (#603)
* refactor(browser): split installation and profile abstractions

A Chromium installation shares one master key across its profiles, but
modeling each profile as its own Browser re-derived the key per profile.
Browser now represents one installation holding its profiles and derives
the key once; new types.Profile/ExtractResult/CountResult carry per-profile
results.

* style: gofumpt safari_test.go

* test(chromium): rename shadowed loop var to path
2026-05-31 16:37:23 +08:00
Roger d5dc81f1c0 feat(keys): add keys import subcommand (#601) 2026-05-24 20:41:30 +08:00
Roger b468c5d0dc feat(keys): add --keys flag to dump for cross-host decryption (#600)
* feat(keys): add --keys flag to dump for cross-host decryption

Consumer side of the cross-host key workflow (pairs with #599).
ApplyDump wires StaticProviders from a dump.json into matching
browsers, so dump --keys f.json -p /copied/data decrypts without
native retrievers.

* fix(keys): guard --keys against misuse + hint Safari

Without -p, dumped keys would be applied to local profile data and
decrypt to garbage; -b all hits the same path because pickFromConfigs
ignores -p when name == "all". Require both.

* chore(keys): address PR #600 Copilot review

- example: add -b chrome (without it, --keys + default -b all errors out)
- use %q for keysPath in error wrap, matching surrounding style
2026-05-23 21:44:57 +08:00
Roger 0fe35542f2 feat(keys): add cross-host master key export (#599) 2026-05-16 20:24:19 +08:00
Roger 439ff52b02 fix(windows): silent default dump on double-click (#591) 2026-04-27 14:47:59 +08:00
Roger 76e2615db2 refactor(windows): clean up Chrome ABE module (#574)
* refactor(abe): remove --abe-key flag and its global state
* refactor(abe): rework scratch protocol and Go/C structure
2026-04-19 15:20:51 +08:00
slimwang c3d30b9e8a feat(windows): Chrome App-Bound Encryption implementation (#573)
* build(abe): add zig-cc payload build system + C reflective loader
* feat(abe): add reflective injector and Go ABE key-retriever primitives
* feat(abe): wire ABERetriever into DefaultRetriever chain + --abe-key CLI
* feat(abe): route Chromium v20 ciphertext through AES-GCM with ABE key
2026-04-18 23:25:59 +08:00
Roger 370c5882c4 feat: add Safari password extraction from macOS Keychain (#568) 2026-04-13 21:34:40 +08:00
Roger b3bbc0dadf feat: add CountEntries to skip decryption for list --detail (#562)
* feat: add CountEntries to skip decryption for list --detail (#549)
* test: add CountEntries and countCategory tests at browser level
* fix: address review feedback on CountRows and countLocalStorage
* test: add CountRows unit tests
2026-04-07 22:28:39 +08:00
Roger 5f42d4fe5f refactor: redesign logging system for CLI-friendly output (#561)
* refactor: redesign logging system for CLI-friendly output
* refactor: remove ANSI color support from logger
* fix: address PR review feedback
2026-04-07 16:50:01 +08:00
Roger 4af2ded428 feat: cli migrate to cobra with subcommands (#550)
* feat: migrate CLI to cobra with dump/list/version subcommands (#546)
* fix: remove residual duckduckgo references and add README/LICENSE to release archives
* fix: address PR review feedback from Copilot
2026-04-05 14:25:51 +08:00
Roger 0ace27ce9a feat: wire V2 architecture into CLI entry point (#540)
* feat: wire V2 architecture into CLI entry point
* fix: warn and exit early when no browsers found
2026-04-04 14:11:08 +08:00
ᴍᴏᴏɴD4ʀᴋ ad020cf135 chore: downgrade golang version to 1.20, support Windows 7. (#435)
* chore: downgrade golang version to 1.20, support windows 7

* chore: Update dependencies for Go project.

- Update dependencies in go.sum
- Improvements and optimizations in various files
- Bug fixes and error handling enhancements

* chore: Update modernc.org/sqlite library versions in go.mod and go.sum files

- Update version of `modernc.org/sqlite` to `v1.31.1` in `go.mod` and `go.sum` files
- Update module hash in `go.sum` file for `modernc.org/sqlite`
- Ensure consistency between `go.mod` and `go.sum` files in relation to `modernc.org/sqlite` version

* chore: replace log/slog with standard logger (#436)

* chore: replace log/slog with standard logger

* chore: Update Go dependencies and versions

- Update Go version from `1.22.5` to `1.20` and other dependencies
- Update critical dependencies to latest versions
- Ensure compatibility with new versions of dependencies

* chore: Optimize dependency management in workflows

- Update build and lint workflows to use `go mod tidy` for getting dependencies
- Change modules download mode to `'mod'` in linters configuration
- Add step to get dependencies in lint workflow

* refactor: Update dependencies and refactor Chromium key deletion logic

- Update `modernc.org/sqlite` to `v1.31.1` in `go.mod` and `go.sum`
- Increase version number to `0.5.0` in `cmd/hack-browser-data/main.go`
- Refactor and update logic for filtering and copying items in `browser/chromium/chromium.go`

* Improve logging functionality and data type conversion

- Add `String()` method to `DataType` enum in types.go
- Update log level to Debug in logger_test.go
- Set log level to Debug in `TestLoggerDebug` and `TestLoggerDebugf` functions
2024-10-22 13:01:13 +08:00
ᴍᴏᴏɴD4ʀᴋ 271e052481 fix: Improve error handling and fix wrong compress dir for windows (#367) (#368)
* fix: Improve error handling and fix wrong compress dir for windows
* refactor: Refactor fileutil package for pass linter
2024-07-17 22:32:29 +08:00
ᴍᴏᴏɴD4ʀᴋ c9beee2662 docs: Update the document version to 0.4.6 (#363)
* docs: Update README with version `0.4.6` and improvements
2024-07-16 12:01:21 +08:00
ᴍᴏᴏɴD4ʀᴋ e48f35cfd3 feat: refactor logger to standard library (#280)
* refactor: Refactor logging to use structured slog package.

- Remove `gookit` dependencies from `go.sum`
- Improve error logging in multiple packages by replacing `log` with `log/slog`
- Update dependencies in `go.mod`
- Add new `logger` package with test cases
- Refactor logging statements in multiple packages to use `slog` instead of `log`
- Change logging format and level in multiple packages for better structured logging

* refactor: Refactor logger package and add handler interface

- Refactor logger package
- Rename `defaultHandler` to `DefaultLogger`
- Move `ReplaceAttr` function to `Logger` struct
- Implement `LogHandler` struct with `slog.Handler` interface
- Add new `Logger` methods for configuration
- Add `SetMaxLevel`, `SetJSONHandler`, `SetTextHandler`, `SetOutput`, `SetVerbose`, `SetReplaceAttrFunc`
- Add verbose flag to `cmd/hack-browser-data/main.go` to increase logging

* refactor: Refactor logger package to use simplified handler initialization.

- Refactor logger package to use Default instead of DefaultLogger
- Update `NewHandler` method to correctly reference `Default` logger and simplify handler initialization
- Update tests for logger to reflect changes in Default usage
- Rename `DefaultLogger` to `Default` and update comments to better reflect its purpose
- Update function calls in hack-browser-data main.go to reflect logger package updates

* refactor: Refactor logging in Chromium implementation

Refactor logging and simplify decryption in chromium files
- Replace logger package import with shared slog package
- Change logging messages to use slog instead of logger
- Simplify decryption process by removing first 5 characters of encrypted key
- Refactor error logging in linux file to use shared slog package
- Replace string concatenation with formatted string in linux error message
2024-01-16 14:06:13 +08:00
moonD4rk 5a34d1c176 chore: Downgrade version number and remove unused flag
Refactor version number changes and remove unused flag in CLI

- Downgrade version number from `0.4.7` to `0.4.5` in main.go and README files
- Remove `HelpCommand` flag from `cli.App`
- Update `Github Link` in usage text of hack-browser-data CLI
2024-01-09 18:10:14 +08:00
moonD4rk 23daf093b8 chore: Update version number to 0.4.7 in README and main.go files
- Update version number to `0.4.7` in `README` and `README_ZH`
- Update version number to `0.4.7` in `cmd/hack-browser-data/main.go`
2024-01-09 18:10:14 +08:00
stevenlele 038e97e2dc chore: fix typos (#232) 2024-01-09 18:10:14 +08:00
Andrii UrsulenkoandAndrii Ursulenko ab4d3e14db fix: nil browsing data in case error and walkdir instead of walk (#229)
* fix: nil browsing data in case error

Signed-off-by: Andrii Ursulenko <a.ursulenko@gmail.com>

* fix: ignore walk error, use walkdir instead of walk

---------

Signed-off-by: Andrii Ursulenko <a.ursulenko@gmail.com>
Co-authored-by: Andrii Ursulenko <a.ursulenko@gmail.com>
2023-07-10 17:53:13 +08:00
moonD4rk 0a7f19ab91 refactor: lowercase library module name 2023-06-04 13:47:43 +08:00
moonD4rk 4b7ad4d505 feat: add is export full data option 2023-03-11 17:51:40 +08:00
moonD4rk cc4edc5cb6 refactor: initial default logger 2023-03-10 15:58:10 +08:00
moonD4rk b0cb59ec2c chore: update version flag 2023-03-10 14:54:47 +08:00
moonD4rk b65d3186c4 chore: update project layout 2023-03-10 14:52:26 +08:00
yuxiaojun bec3e3a1b0 fix: the bug that the command line Usage prompt is incomplete
The full prompt is "password|bookmark|cookie|history|credit card|download|localStorage|extension"

Signed-off-by: yuxiaojun <yuxiaojun@uniontech.com>
2023-01-05 15:06:48 +08:00