fix: find cookies file failed

pull/162/head
ᴍᴏᴏɴD4ʀᴋ 2 years ago
parent 86a747143b
commit cf4ffeca51
  1. 2
      internal/browser/browser_windows.go
  2. 13
      internal/browser/chromium/chromium.go
  3. 2
      internal/decrypter/decrypter_darwin.go
  4. 2
      internal/decrypter/decrypter_linux.go
  5. 2
      internal/decrypter/decrypter_windows.go

@ -96,7 +96,7 @@ var (
braveProfilePath = homeDir + "/AppData/Local/BraveSoftware/Brave-Browser/User Data/Default/" braveProfilePath = homeDir + "/AppData/Local/BraveSoftware/Brave-Browser/User Data/Default/"
speed360ProfilePath = homeDir + "/AppData/Local/360chrome/Chrome/User Data/Default/" speed360ProfilePath = homeDir + "/AppData/Local/360chrome/Chrome/User Data/Default/"
qqBrowserProfilePath = homeDir + "/AppData/Local/Tencent/QQBrowser/User Data/Default/" qqBrowserProfilePath = homeDir + "/AppData/Local/Tencent/QQBrowser/User Data/Default/"
operaProfilePath = homeDir + "/AppData/Roaming/Opera Software/Opera Stable/Default/" operaProfilePath = homeDir + "/AppData/Roaming/Opera Software/Opera Stable/"
operaGXProfilePath = homeDir + "/AppData/Roaming/Opera Software/Opera GX Stable/" operaGXProfilePath = homeDir + "/AppData/Roaming/Opera Software/Opera GX Stable/"
vivaldiProfilePath = homeDir + "/AppData/Local/Vivaldi/User Data/Default/" vivaldiProfilePath = homeDir + "/AppData/Local/Vivaldi/User Data/Default/"
coccocProfilePath = homeDir + "/AppData/Local/CocCoc/Browser/User Data/Default/" coccocProfilePath = homeDir + "/AppData/Local/CocCoc/Browser/User Data/Default/"

@ -124,14 +124,17 @@ func chromiumWalkFunc(items []item.Item, multiItemPaths map[string]map[item.Item
return func(path string, info fs.FileInfo, err error) error { return func(path string, info fs.FileInfo, err error) error {
for _, v := range items { for _, v := range items {
if info.Name() == v.FileName() { if info.Name() == v.FileName() {
parentBaseDir := fileutil.ParentBaseDir(path) if strings.Contains(path, "System Profile") {
if parentBaseDir == "System Profile" {
continue continue
} }
if _, exist := multiItemPaths[parentBaseDir]; exist { profileFolder := fileutil.ParentBaseDir(path)
multiItemPaths[parentBaseDir][v] = path if strings.Contains(filepath.ToSlash(path), "/Network/Cookies") {
profileFolder = fileutil.BaseDir(strings.ReplaceAll(filepath.ToSlash(path), "/Network/Cookies", ""))
}
if _, exist := multiItemPaths[profileFolder]; exist {
multiItemPaths[profileFolder][v] = path
} else { } else {
multiItemPaths[parentBaseDir] = map[item.Item]string{v: path} multiItemPaths[profileFolder] = map[item.Item]string{v: path}
} }
} }
} }

@ -1,3 +1,5 @@
//go:build darwin
package decrypter package decrypter
func Chromium(key, encryptPass []byte) ([]byte, error) { func Chromium(key, encryptPass []byte) ([]byte, error) {

@ -1,3 +1,5 @@
//go:build linux
package decrypter package decrypter
func Chromium(key, encryptPass []byte) ([]byte, error) { func Chromium(key, encryptPass []byte) ([]byte, error) {

@ -1,3 +1,5 @@
//go:build windows
package decrypter package decrypter
import ( import (

Loading…
Cancel
Save