refactor: format project layout
This commit is contained in:
parent
4f7adf3db7
commit
87a026a13e
|
@ -8,8 +8,8 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
|
||||
"hack-browser-data/internal/browser"
|
||||
"hack-browser-data/internal/browser/outputter"
|
||||
"hack-browser-data/internal/log"
|
||||
"hack-browser-data/internal/outputter"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"hack-browser-data/internal/browser/data"
|
||||
"hack-browser-data/internal/data"
|
||||
)
|
||||
|
||||
type Browser interface {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"hack-browser-data/internal/browser/outputter"
|
||||
"hack-browser-data/internal/log"
|
||||
"hack-browser-data/internal/outputter"
|
||||
)
|
||||
|
||||
func TestPickChromium(t *testing.T) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"hack-browser-data/internal/browser/data"
|
||||
"hack-browser-data/internal/data"
|
||||
"hack-browser-data/internal/item"
|
||||
)
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"hack-browser-data/internal/browser/data"
|
||||
"hack-browser-data/internal/data"
|
||||
"hack-browser-data/internal/item"
|
||||
)
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"sort"
|
||||
|
||||
"hack-browser-data/internal/browser/item"
|
||||
|
||||
"hack-browser-data/internal/decrypter"
|
||||
"hack-browser-data/internal/utils"
|
||||
|
|
@ -7,6 +7,7 @@ import (
|
|||
_ "github.com/mattn/go-sqlite3"
|
||||
|
||||
"hack-browser-data/internal/browser/item"
|
||||
|
||||
"hack-browser-data/internal/decrypter"
|
||||
)
|
||||
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/tidwall/gjson"
|
||||
|
||||
"hack-browser-data/internal/browser/item"
|
||||
|
||||
"hack-browser-data/internal/utils"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
|
@ -6,6 +6,7 @@ import (
|
|||
"sort"
|
||||
|
||||
"hack-browser-data/internal/browser/item"
|
||||
|
||||
"hack-browser-data/internal/utils"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
|
@ -10,6 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"hack-browser-data/internal/browser/item"
|
||||
|
||||
decrypter2 "hack-browser-data/internal/decrypter"
|
||||
"hack-browser-data/internal/utils"
|
||||
|
|
@ -1,34 +1,7 @@
|
|||
package item
|
||||
|
||||
import (
|
||||
"hack-browser-data/internal/browser/data"
|
||||
)
|
||||
|
||||
type Item int
|
||||
|
||||
const (
|
||||
ChromiumKey Item = iota
|
||||
ChromiumPassword
|
||||
ChromiumCookie
|
||||
ChromiumBookmark
|
||||
ChromiumHistory
|
||||
ChromiumDownload
|
||||
ChromiumCreditCard
|
||||
ChromiumLocalStorage
|
||||
ChromiumExtension
|
||||
|
||||
YandexPassword
|
||||
YandexCreditCard
|
||||
|
||||
FirefoxKey4
|
||||
FirefoxPassword
|
||||
FirefoxCookie
|
||||
FirefoxBookmark
|
||||
FirefoxHistory
|
||||
FirefoxDownload
|
||||
FirefoxCreditCard
|
||||
FirefoxLocalStorage
|
||||
FirefoxExtension
|
||||
data2 "hack-browser-data/internal/data"
|
||||
)
|
||||
|
||||
var DefaultFirefox = []Item{
|
||||
|
@ -67,6 +40,33 @@ var DefaultChromium = []Item{
|
|||
ChromiumExtension,
|
||||
}
|
||||
|
||||
type Item int
|
||||
|
||||
const (
|
||||
ChromiumKey Item = iota
|
||||
ChromiumPassword
|
||||
ChromiumCookie
|
||||
ChromiumBookmark
|
||||
ChromiumHistory
|
||||
ChromiumDownload
|
||||
ChromiumCreditCard
|
||||
ChromiumLocalStorage
|
||||
ChromiumExtension
|
||||
|
||||
YandexPassword
|
||||
YandexCreditCard
|
||||
|
||||
FirefoxKey4
|
||||
FirefoxPassword
|
||||
FirefoxCookie
|
||||
FirefoxBookmark
|
||||
FirefoxHistory
|
||||
FirefoxDownload
|
||||
FirefoxCreditCard
|
||||
FirefoxLocalStorage
|
||||
FirefoxExtension
|
||||
)
|
||||
|
||||
func (i Item) FileName() string {
|
||||
switch i {
|
||||
case ChromiumKey:
|
||||
|
@ -161,40 +161,40 @@ func (i Item) String() string {
|
|||
}
|
||||
}
|
||||
|
||||
func (i Item) NewBrowsingData() data.BrowsingData {
|
||||
func (i Item) NewBrowsingData() data2.BrowsingData {
|
||||
switch i {
|
||||
case ChromiumKey:
|
||||
return nil
|
||||
case ChromiumPassword:
|
||||
return &data.ChromiumPassword{}
|
||||
return &data2.ChromiumPassword{}
|
||||
case ChromiumCookie:
|
||||
return &data.ChromiumCookie{}
|
||||
return &data2.ChromiumCookie{}
|
||||
case ChromiumBookmark:
|
||||
return &data.ChromiumBookmark{}
|
||||
return &data2.ChromiumBookmark{}
|
||||
case ChromiumDownload:
|
||||
return &data.ChromiumDownload{}
|
||||
return &data2.ChromiumDownload{}
|
||||
case ChromiumLocalStorage:
|
||||
return nil
|
||||
case ChromiumCreditCard:
|
||||
return &data.ChromiumCreditCard{}
|
||||
return &data2.ChromiumCreditCard{}
|
||||
case ChromiumExtension:
|
||||
return nil
|
||||
case ChromiumHistory:
|
||||
return &data.ChromiumHistory{}
|
||||
return &data2.ChromiumHistory{}
|
||||
case YandexPassword:
|
||||
return &data.ChromiumPassword{}
|
||||
return &data2.ChromiumPassword{}
|
||||
case YandexCreditCard:
|
||||
return &data.ChromiumCreditCard{}
|
||||
return &data2.ChromiumCreditCard{}
|
||||
case FirefoxPassword:
|
||||
return &data.FirefoxPassword{}
|
||||
return &data2.FirefoxPassword{}
|
||||
case FirefoxCookie:
|
||||
return &data.FirefoxCookie{}
|
||||
return &data2.FirefoxCookie{}
|
||||
case FirefoxBookmark:
|
||||
return &data.FirefoxBookmark{}
|
||||
return &data2.FirefoxBookmark{}
|
||||
case FirefoxDownload:
|
||||
return &data.FirefoxDownload{}
|
||||
return &data2.FirefoxDownload{}
|
||||
case FirefoxHistory:
|
||||
return &data.FirefoxHistory{}
|
||||
return &data2.FirefoxHistory{}
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"github.com/gocarina/gocsv"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
|
||||
"hack-browser-data/internal/browser/data"
|
||||
"hack-browser-data/internal/data"
|
||||
)
|
||||
|
||||
type outPutter struct {
|
Loading…
Reference in New Issue