@@ -14,7 +14,6 @@ import (
1414 "strings"
1515
1616 "filippo.io/age"
17- saveRuntime "github.com/botherder/go-savetime/runtime"
1817 "github.com/mvt-project/androidqf/log"
1918)
2019
@@ -44,17 +43,15 @@ func (a *Acquisition) StoreSecurely() error {
4443 return nil
4544 }
4645
47- cwd := saveRuntime .GetExecutableDirectory ()
48-
49- keyFilePath := filepath .Join (cwd , "key.txt" )
46+ keyFilePath := filepath .Join (a .BaseDir , "key.txt" )
5047 if _ , err := os .Stat (keyFilePath ); os .IsNotExist (err ) {
5148 return nil
5249 }
5350
5451 log .Info ("You provided an age public key, storing the acquisition securely." )
5552
5653 zipFileName := fmt .Sprintf ("%s.zip" , a .UUID )
57- zipFilePath := filepath .Join (cwd , zipFileName )
54+ zipFilePath := filepath .Join (a . BaseDir , zipFileName )
5855
5956 log .Info ("Compressing the acquisition folder. This might take a while..." )
6057
@@ -83,7 +80,7 @@ func (a *Acquisition) StoreSecurely() error {
8380 defer zipFile .Close ()
8481
8582 encFileName := fmt .Sprintf ("%s.age" , zipFileName )
86- encFilePath := filepath .Join (cwd , encFileName )
83+ encFilePath := filepath .Join (a . BaseDir , encFileName )
8784 encFile , err := os .OpenFile (encFilePath , os .O_WRONLY | os .O_CREATE | os .O_APPEND , 0o600 )
8885 if err != nil {
8986 return fmt .Errorf ("unable to create encrypted file: %v" , err )
0 commit comments