Skip to content

Commit baa0e09

Browse files
authored
dev: Remove CGO go-sqlite3 with pure go driver (#292)
* chore: Resize logo and update browser support in READMEs (#284) * chore: Resize logo and update browser support in READMEs * docs: Update Coverage Status badge URL * chore: add typos check linter in github actions (#285) * refactor: Disable JSON handling in logger/logger.go. * chore: Standardize spelling and add typos check workflows. * refactor: Update SQLite driver import for browsing data package. * refactor: Refactor browsing data package to use SQLite driver instead of SQLite3. * docs: Add contribution guidelines to README file (#289) * chore: Refactor file and directory names for improved organization and consistency
1 parent cd2b196 commit baa0e09

14 files changed

Lines changed: 101 additions & 28 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Check spelling with custom config file
2121
uses: crate-ci/typos@master
2222
with:
23-
config: ./typos.toml
23+
config: ./.typos.toml
2424

2525
- name: Lint
2626
uses: golangci/golangci-lint-action@v3

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,4 @@ hack-browser-data
204204
!CONTRIBUTING.md
205205

206206
# CICD Config
207-
!typos.toml
207+
!.typos.toml

.typos.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos
2+
[default.extend-words]
3+
Readed = "Readed"
4+
Sie = "Sie"
5+
OT = "OT"
6+
[files]
7+
extend-exclude = ["go.mod", "go.sum"]

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ PS C:\Users\User\Desktop> .\hack-browser-data.exe -b chrome -p "C:\Users\User\Ap
184184

185185
[Reflective-HackBrowserData](https://github.com/idiotc4t/Reflective-HackBrowserData)
186186

187+
## Contributing
188+
189+
We welcome and appreciate any contributions made by the community (GitHub issues/pull requests, email feedback, etc.).
190+
191+
Please see the [Contribution Guide](CONTRIBUTING.md) before contributing.
192+
187193

188194
## Contributors
189195

browsingdata/bookmark/bookmark.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import (
77
"sort"
88
"time"
99

10-
// import sqlite3 driver
11-
_ "github.com/mattn/go-sqlite3"
1210
"github.com/tidwall/gjson"
11+
_ "modernc.org/sqlite" // import sqlite3 driver
1312

1413
"github.com/moond4rk/hackbrowserdata/item"
1514
"github.com/moond4rk/hackbrowserdata/utils/fileutil"
@@ -94,7 +93,7 @@ const (
9493
)
9594

9695
func (f *FirefoxBookmark) Parse(_ []byte) error {
97-
db, err := sql.Open("sqlite3", item.FirefoxBookmark.TempFilename())
96+
db, err := sql.Open("sqlite", item.FirefoxBookmark.TempFilename())
9897
if err != nil {
9998
return err
10099
}

browsingdata/cookie/cookie.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"time"
99

1010
// import sqlite3 driver
11-
_ "github.com/mattn/go-sqlite3"
11+
_ "modernc.org/sqlite"
1212

1313
"github.com/moond4rk/hackbrowserdata/crypto"
1414
"github.com/moond4rk/hackbrowserdata/item"
@@ -36,7 +36,7 @@ const (
3636
)
3737

3838
func (c *ChromiumCookie) Parse(masterKey []byte) error {
39-
db, err := sql.Open("sqlite3", item.ChromiumCookie.TempFilename())
39+
db, err := sql.Open("sqlite", item.ChromiumCookie.TempFilename())
4040
if err != nil {
4141
return err
4242
}
@@ -104,7 +104,7 @@ const (
104104
)
105105

106106
func (f *FirefoxCookie) Parse(_ []byte) error {
107-
db, err := sql.Open("sqlite3", item.FirefoxCookie.TempFilename())
107+
db, err := sql.Open("sqlite", item.FirefoxCookie.TempFilename())
108108
if err != nil {
109109
return err
110110
}

browsingdata/creditcard/creditcard.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"os"
77

88
// import sqlite3 driver
9-
_ "github.com/mattn/go-sqlite3"
9+
_ "modernc.org/sqlite"
1010

1111
"github.com/moond4rk/hackbrowserdata/crypto"
1212
"github.com/moond4rk/hackbrowserdata/item"
@@ -29,7 +29,7 @@ const (
2929
)
3030

3131
func (c *ChromiumCreditCard) Parse(masterKey []byte) error {
32-
db, err := sql.Open("sqlite3", item.ChromiumCreditCard.TempFilename())
32+
db, err := sql.Open("sqlite", item.ChromiumCreditCard.TempFilename())
3333
if err != nil {
3434
return err
3535
}
@@ -85,7 +85,7 @@ func (c *ChromiumCreditCard) Len() int {
8585
type YandexCreditCard []card
8686

8787
func (c *YandexCreditCard) Parse(masterKey []byte) error {
88-
db, err := sql.Open("sqlite3", item.YandexCreditCard.TempFilename())
88+
db, err := sql.Open("sqlite", item.YandexCreditCard.TempFilename())
8989
if err != nil {
9090
return err
9191
}

browsingdata/download/download.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import (
88
"strings"
99
"time"
1010

11-
// import sqlite3 driver
12-
_ "github.com/mattn/go-sqlite3"
1311
"github.com/tidwall/gjson"
12+
_ "modernc.org/sqlite" // import sqlite3 driver
1413

1514
"github.com/moond4rk/hackbrowserdata/item"
1615
"github.com/moond4rk/hackbrowserdata/utils/typeutil"
@@ -32,7 +31,7 @@ const (
3231
)
3332

3433
func (c *ChromiumDownload) Parse(_ []byte) error {
35-
db, err := sql.Open("sqlite3", item.ChromiumDownload.TempFilename())
34+
db, err := sql.Open("sqlite", item.ChromiumDownload.TempFilename())
3635
if err != nil {
3736
return err
3837
}
@@ -83,7 +82,7 @@ const (
8382
)
8483

8584
func (f *FirefoxDownload) Parse(_ []byte) error {
86-
db, err := sql.Open("sqlite3", item.FirefoxDownload.TempFilename())
85+
db, err := sql.Open("sqlite", item.FirefoxDownload.TempFilename())
8786
if err != nil {
8887
return err
8988
}

browsingdata/history/history.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"time"
99

1010
// import sqlite3 driver
11-
_ "github.com/mattn/go-sqlite3"
11+
_ "modernc.org/sqlite"
1212

1313
"github.com/moond4rk/hackbrowserdata/item"
1414
"github.com/moond4rk/hackbrowserdata/utils/typeutil"
@@ -28,7 +28,7 @@ const (
2828
)
2929

3030
func (c *ChromiumHistory) Parse(_ []byte) error {
31-
db, err := sql.Open("sqlite3", item.ChromiumHistory.TempFilename())
31+
db, err := sql.Open("sqlite", item.ChromiumHistory.TempFilename())
3232
if err != nil {
3333
return err
3434
}
@@ -79,7 +79,7 @@ const (
7979
)
8080

8181
func (f *FirefoxHistory) Parse(_ []byte) error {
82-
db, err := sql.Open("sqlite3", item.FirefoxHistory.TempFilename())
82+
db, err := sql.Open("sqlite", item.FirefoxHistory.TempFilename())
8383
if err != nil {
8484
return err
8585
}

browsingdata/localstorage/localstorage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const (
106106
)
107107

108108
func (f *FirefoxLocalStorage) Parse(_ []byte) error {
109-
db, err := sql.Open("sqlite3", item.FirefoxLocalStorage.TempFilename())
109+
db, err := sql.Open("sqlite", item.FirefoxLocalStorage.TempFilename())
110110
if err != nil {
111111
return err
112112
}

0 commit comments

Comments
 (0)