-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
80 lines (69 loc) · 2.02 KB
/
Copy pathmain.go
File metadata and controls
80 lines (69 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package main
import (
"AttackSec/backend"
"AttackSec/backend/utilities"
"embed"
"github.com/leaanthony/adfer"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/logger"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/windows"
"log"
)
//go:embed all:frontend/dist
var assets embed.FS
//go:embed build/appicon.png
var icon []byte
var crashReporter = adfer.New(adfer.Options{
DumpToFile: true,
FilePath: utilities.GetFilePath("crash_reports.json"),
IncludeSystemInfo: true,
})
func main() {
settings, _ := utilities.LoadSettings()
hardwareAcceleration := settings.HardwareAcceleration
alwaysOnTop := settings.AlwaysOnTop
defer crashReporter.Recover()
app := backend.NewApp()
err := wails.Run(&options.App{
Title: "AttackSec",
Width: 1424,
Height: 705,
DisableResize: true,
Fullscreen: false,
WindowStartState: options.Normal,
HideWindowOnClose: false,
Frameless: true,
StartHidden: false,
AlwaysOnTop: alwaysOnTop,
Assets: assets,
Menu: nil,
Logger: nil,
LogLevel: logger.DEBUG,
OnStartup: app.Startup,
OnBeforeClose: app.BeforeClose,
OnDomReady: app.OnDomReady,
EnableDefaultContextMenu: false,
/*SingleInstanceLock: &options.SingleInstanceLock{
UniqueId: "ATTACKSEC-e3984e08-28dc-4e3d-b70a-45e961589cdc",
OnSecondInstanceLaunch: app.onSecondInstanceLaunch,
},*/
DragAndDrop: &options.DragAndDrop{
EnableFileDrop: true,
DisableWebViewDrop: false,
},
Bind: []interface{}{
app,
},
Windows: &windows.Options{
WebviewIsTransparent: true,
WindowIsTranslucent: true,
DisableWindowIcon: true,
WebviewGpuIsDisabled: hardwareAcceleration,
WebviewUserDataPath: utilities.Directory,
},
})
if err != nil {
log.Fatal(err)
}
}