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.
This commit is contained in:
moonD4rk
2026-05-31 03:58:12 +08:00
parent d5dc81f1c0
commit c9f89dc682
28 changed files with 1359 additions and 1205 deletions
+2 -2
View File
@@ -67,12 +67,12 @@ func platformBrowsers() []types.BrowserConfig {
}
}
// newPlatformInjector returns a closure that wires the Linux Chromium master-key retrievers into
// newCredentialInjector returns a closure that wires the Linux Chromium master-key retrievers into
// each Browser. Linux has two tiers: V10 uses the "peanuts" hardcoded password (kV10Key); V11
// uses the D-Bus Secret Service keyring (kV11Key). V20 is nil — App-Bound Encryption is Windows-
// only. Both V10 and V11 run independently so a profile carrying mixed cipher prefixes decrypts
// both tiers.
func newPlatformInjector(_ PickOptions) func(Browser) {
func newCredentialInjector(_ PickOptions) browserInjector {
retrievers := keyretriever.DefaultRetrievers()
return func(b Browser) {
if km, ok := b.(KeyManager); ok {