Skip to content

Commit 540b936

Browse files
authored
Merge branch 'main' into update_deps
2 parents aebc02b + 16f44dc commit 540b936

File tree

6 files changed

+96
-67
lines changed

6 files changed

+96
-67
lines changed

.github/workflows/release.yaml

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,70 @@ name: Build and release
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
99
releases-matrix:
1010
name: Release Go Binary
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- run: echo $(go env GOPATH)/bin >> $GITHUB_PATH
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-go@v5
15+
with:
16+
go-version: "1.22"
17+
cache: true
18+
- run: echo $(go env GOPATH)/bin >> $GITHUB_PATH
1519

16-
- name: Build collector
17-
run: UPX_COMPRESS=1 make collector
18-
- name: Build Windows binary
19-
run: make windows
20-
- name: Build Linux binary
21-
run: make linux
22-
- name: Build Darwin binary
23-
run: make darwin
20+
- name: Build collector
21+
run: UPX_COMPRESS=1 make collector
22+
- name: Build Windows binary
23+
run: make windows
24+
- name: Build Linux binary
25+
run: make linux
26+
- name: Build Darwin binary
27+
run: make darwin
2428

25-
- name: Upload Windows binary
26-
uses: svenstaro/upload-release-action@v2
27-
with:
28-
repo_token: ${{ secrets.GITHUB_TOKEN }}
29-
file: build/androidqf_windows_amd64.exe
30-
asset_name: androidqf_$tag_windows_amd64.exe
31-
tag: ${{ github.ref }}
32-
overwrite: true
29+
- name: Upload Windows binary
30+
uses: svenstaro/upload-release-action@v2
31+
with:
32+
repo_token: ${{ secrets.GITHUB_TOKEN }}
33+
file: build/androidqf_windows_amd64.exe
34+
asset_name: androidqf_$tag_windows_amd64.exe
35+
tag: ${{ github.ref }}
36+
overwrite: true
3337

34-
- name: Upload Linux binary
35-
uses: svenstaro/upload-release-action@v2
36-
with:
37-
repo_token: ${{ secrets.GITHUB_TOKEN }}
38-
file: build/androidqf_linux_amd64
39-
asset_name: androidqf_$tag_linux_amd64
40-
tag: ${{ github.ref }}
41-
overwrite: true
38+
- name: Upload Linux binary
39+
uses: svenstaro/upload-release-action@v2
40+
with:
41+
repo_token: ${{ secrets.GITHUB_TOKEN }}
42+
file: build/androidqf_linux_amd64
43+
asset_name: androidqf_$tag_linux_amd64
44+
tag: ${{ github.ref }}
45+
overwrite: true
4246

43-
- name: Upload Linux arm64 binary
44-
uses: svenstaro/upload-release-action@v2
45-
with:
46-
repo_token: ${{ secrets.GITHUB_TOKEN }}
47-
file: build/androidqf_linux_arm64
48-
asset_name: androidqf_$tag_linux_arm64
49-
tag: ${{ github.ref }}
50-
overwrite: true
47+
- name: Upload Linux arm64 binary
48+
uses: svenstaro/upload-release-action@v2
49+
with:
50+
repo_token: ${{ secrets.GITHUB_TOKEN }}
51+
file: build/androidqf_linux_arm64
52+
asset_name: androidqf_$tag_linux_arm64
53+
tag: ${{ github.ref }}
54+
overwrite: true
5155

52-
- name: Upload Darwin binary
53-
uses: svenstaro/upload-release-action@v2
54-
with:
55-
repo_token: ${{ secrets.GITHUB_TOKEN }}
56-
file: build/androidqf_darwin_amd64
57-
asset_name: androidqf_$tag_darwin_amd64
58-
tag: ${{ github.ref }}
59-
overwrite: true
56+
- name: Upload Darwin binary
57+
uses: svenstaro/upload-release-action@v2
58+
with:
59+
repo_token: ${{ secrets.GITHUB_TOKEN }}
60+
file: build/androidqf_darwin_amd64
61+
asset_name: androidqf_$tag_darwin_amd64
62+
tag: ${{ github.ref }}
63+
overwrite: true
6064

61-
- name: Upload Darwin arm64 binary
62-
uses: svenstaro/upload-release-action@v2
63-
with:
64-
repo_token: ${{ secrets.GITHUB_TOKEN }}
65-
file: build/androidqf_darwin_arm64
66-
asset_name: androidqf_$tag_darwin_arm64
67-
tag: ${{ github.ref }}
68-
overwrite: true
65+
- name: Upload Darwin arm64 binary
66+
uses: svenstaro/upload-release-action@v2
67+
with:
68+
repo_token: ${{ secrets.GITHUB_TOKEN }}
69+
file: build/androidqf_darwin_arm64
70+
asset_name: androidqf_$tag_darwin_arm64
71+
tag: ${{ github.ref }}
72+
overwrite: true

.github/workflows/staticcheck.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ jobs:
66
name: "Run CI"
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
with:
11-
fetch-depth: 1
12-
- name: download assets
13-
run: make download
14-
- name: build collector
15-
run: make collector
16-
- uses: dominikh/staticcheck-action@v1.3.0
17-
with:
18-
version: "2022.1.3"
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 1
12+
- uses: actions/setup-go@v5
13+
with:
14+
go-version: "1.23"
15+
cache: true
16+
- name: download assets
17+
run: make download
18+
- name: build collector
19+
run: make collector
20+
- uses: dominikh/staticcheck-action@v1.3.1
21+
with:
22+
version: "latest"
23+
install-go: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ androidqf is intended to provide a simple and portable cross-platform utility to
1616

1717
Executable binaries for Linux, Windows and Mac should be available in the [latest release](https://github.com/mvt-project/androidqf/releases/latest). In case you have issues running the binary you might want to build it by yourself.
1818

19-
In order to build androidqf you will need Go 1.15+ installed. You will also need to install `make`. AndroidQF includes a cross-compiled `collector` which runs on the target device to more reliably extract forensically relevant information. Android shell quirkes can make running shell commands to gather information too brittle.
19+
In order to build androidqf you will need Go 1.15+ installed. You will also need to install `make`, `git`, `unzip` and `wget`. AndroidQF includes a cross-compiled `collector` which runs on the target device to more reliably extract forensically relevant information. Android shell quirkes can make running shell commands to gather information too brittle.
2020

2121
When ready you can clone the repository and first build the `collector` module with:
2222

acquisition/secure.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,38 @@
66
package acquisition
77

88
import (
9+
"archive/zip"
910
"fmt"
1011
"io"
1112
"os"
1213
"path/filepath"
1314
"strings"
1415

1516
"filippo.io/age"
16-
"github.com/botherder/go-savetime/files"
1717
saveRuntime "github.com/botherder/go-savetime/runtime"
1818
"github.com/mvt-project/androidqf/log"
1919
)
2020

21+
func createZipFile(sourceDir, zipPath string) error {
22+
zipFile, err := os.Create(zipPath)
23+
if err != nil {
24+
return fmt.Errorf("failed to create ZIP file: %v", err)
25+
}
26+
defer zipFile.Close()
27+
28+
zipWriter := zip.NewWriter(zipFile)
29+
defer zipWriter.Close()
30+
31+
// Use AddFS to add the entire directory
32+
fsys := os.DirFS(sourceDir)
33+
err = zipWriter.AddFS(fsys)
34+
if err != nil {
35+
return fmt.Errorf("failed to add directory to ZIP: %v", err)
36+
}
37+
38+
return nil
39+
}
40+
2141
func (a *Acquisition) StoreSecurely() error {
2242
cwd := saveRuntime.GetExecutableDirectory()
2343

@@ -33,7 +53,7 @@ func (a *Acquisition) StoreSecurely() error {
3353

3454
log.Info("Compressing the acquisition folder. This might take a while...")
3555

36-
err := files.Zip(a.StoragePath, zipFilePath)
56+
err := createZipFile(a.StoragePath, zipFilePath)
3757
if err != nil {
3858
return err
3959
}

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
module github.com/mvt-project/androidqf
22

3+
34
go 1.23
45

56
require (
67
filippo.io/age v1.2.1
78
github.com/avast/apkverifier v0.0.0-20250626104651-727e33396aec
89
github.com/botherder/go-savetime v1.5.0
910
github.com/google/uuid v1.6.0
11+
1012
github.com/i582/cfmt v1.4.0
1113
github.com/manifoldco/promptui v0.9.0
1214
)
@@ -19,4 +21,5 @@ require (
1921
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
2022
golang.org/x/crypto v0.40.0 // indirect
2123
golang.org/x/sys v0.34.0 // indirect
24+
2225
)

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObk
1717
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
1818
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
1919
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
20-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2120
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2221
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2322
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -43,8 +42,6 @@ golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
4342
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
4443
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E=
4544
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
46-
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
47-
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4845
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
4946
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
5047
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)