mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-07-06 21:37:47 +02:00
feat: update to v0.4.0, based by generics
This commit is contained in:
@@ -30,7 +30,7 @@ func New(name, storage, profilePath string, items []item.Item) (*chromium, error
|
||||
}
|
||||
// TODO: Handle file path is not exist
|
||||
if !fileutil.FolderExists(profilePath) {
|
||||
return nil, fmt.Errorf("%s profile path is not exist: %s", name, profilePath)
|
||||
return nil, fmt.Errorf("%s profile folder is not exist: %s", name, profilePath)
|
||||
}
|
||||
itemsPaths, err := c.getItemPath(profilePath, items)
|
||||
if err != nil {
|
||||
@@ -46,7 +46,7 @@ func (c *chromium) Name() string {
|
||||
return c.name
|
||||
}
|
||||
|
||||
func (c *chromium) GetBrowsingData() (*browingdata.Data, error) {
|
||||
func (c *chromium) BrowsingData() (*browingdata.Data, error) {
|
||||
b := browingdata.New(c.items)
|
||||
|
||||
if err := c.copyItemToLocal(); err != nil {
|
||||
@@ -72,7 +72,7 @@ func (c *chromium) copyItemToLocal() error {
|
||||
// TODO: Handle read file error
|
||||
d, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(filename, d, 0777)
|
||||
if err != nil {
|
||||
|
||||
@@ -2,6 +2,7 @@ package chromium
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"github.com/godbus/dbus/v5"
|
||||
@@ -49,8 +50,7 @@ func (c *chromium) GetMasterKey() ([]byte, error) {
|
||||
if label == c.storage {
|
||||
se, err := i.GetSecret(session.Path())
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return nil, err
|
||||
return nil, errors.New("get storage from dbus error:" + err.Error())
|
||||
}
|
||||
chromiumSecret = se.Value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user