refactor(chromium): isolate Yandex protocol specifics design (#598)

This commit is contained in:
Roger
2026-05-16 14:46:18 +08:00
committed by GitHub
parent 00be145044
commit 0234f75495
5 changed files with 116 additions and 115 deletions
-25
View File
@@ -32,24 +32,6 @@ var chromiumSources = map[types.Category][]sourcePath{
types.SessionStorage: {dir("Session Storage")},
}
// yandexSourceOverrides contains only the entries that differ from chromiumSources.
var yandexSourceOverrides = map[types.Category][]sourcePath{
types.Password: {file("Ya Passman Data")},
types.CreditCard: {file("Ya Credit Cards")},
}
// yandexSources returns chromiumSources with Yandex-specific overrides applied.
func yandexSources() map[types.Category][]sourcePath {
sources := make(map[types.Category][]sourcePath, len(chromiumSources))
for k, v := range chromiumSources {
sources[k] = v
}
for k, v := range yandexSourceOverrides {
sources[k] = v
}
return sources
}
// sourcesForKind returns the source mapping for a browser kind.
func sourcesForKind(kind types.BrowserKind) map[types.Category][]sourcePath {
switch kind {
@@ -106,13 +88,6 @@ func (e creditCardExtractor) extract(keys keyretriever.MasterKeys, path string,
return err
}
// yandexExtractors overrides Password and CreditCard extraction for Yandex, which wraps its data-encryption key inside
// meta.local_encryptor_data, binds per-row AAD to GCM, and stores cards as JSON blobs in a records table.
var yandexExtractors = map[types.Category]categoryExtractor{
types.Password: passwordExtractor{fn: extractYandexPasswords},
types.CreditCard: creditCardExtractor{fn: extractYandexCreditCards},
}
// operaExtractors overrides Extension extraction for Opera,
// which stores settings under "extensions.opsettings".
var operaExtractors = map[types.Category]categoryExtractor{