support custom browser profile path

This commit is contained in:
moond4rk
2020-12-20 15:18:19 +08:00
parent 60570bd5b6
commit 0de5496295
3 changed files with 111 additions and 21 deletions
+4
View File
@@ -3,6 +3,7 @@ package core
import (
"encoding/base64"
"errors"
"fmt"
"os"
"hack-browser-data/core/decrypt"
@@ -109,6 +110,9 @@ func (c *Chromium) InitSecretKey() error {
if c.keyPath == "" {
return nil
}
if _, err := os.Stat(c.keyPath); os.IsNotExist(err) {
return fmt.Errorf("%s secret key path is empty", c.name)
}
keyFile, err := utils.ReadFile(c.keyPath)
if err != nil {
return err