Skip to content

Commit

Permalink
support multi platform compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
lantongxue committed Apr 23, 2022
1 parent eba9a21 commit 7fc4f24
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ go install github.com/tc-hib/go-winres@latest

# Build
### Windows
```shell
go-winres make && go build -ldflags="-H windowsgui"
```batch
go-winres make
go build -ldflags="-H windowsgui -s -w" -buildvcs=false
```

`-buildvcs=false` is an optional

### Linux & MacOS
```shell
go build
Expand Down
3 changes: 2 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@echo off
echo Start Building...

go-winres make

go build -ldflags="-H windowsgui"
go build -ldflags="-H windowsgui -s -w" -buildvcs=false

echo Success
6 changes: 1 addition & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package main

import (
"os"
"os/exec"
"path"
"syscall"
)

func PathExists(path string) bool {
Expand Down Expand Up @@ -38,7 +36,5 @@ func main() {
jdk = default_jdk
}

cmd := exec.Command(jdk, "--illegal-access=permit", "-javaagent:BurpLoaderKeygen.jar", "-noverify", "-jar", burpsuite_pro_jar)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
cmd.Start()
run(jdk, burpsuite_pro_jar)
}
11 changes: 11 additions & 0 deletions main_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"os/exec"
)

// for macos
func run(jdk string, burpsuite_pro_jar string) {
cmd := exec.Command(jdk, "--illegal-access=permit", "-javaagent:BurpLoaderKeygen.jar", "-noverify", "-jar", burpsuite_pro_jar)
cmd.Start()
}
11 changes: 11 additions & 0 deletions main_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"os/exec"
)

// for linux
func run(jdk string, burpsuite_pro_jar string) {
cmd := exec.Command(jdk, "--illegal-access=permit", "-javaagent:BurpLoaderKeygen.jar", "-noverify", "-jar", burpsuite_pro_jar)
cmd.Start()
}
13 changes: 13 additions & 0 deletions main_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import (
"os/exec"
"syscall"
)

// for windows, set HideWindow flag
func run(jdk string, burpsuite_pro_jar string) {
cmd := exec.Command(jdk, "--illegal-access=permit", "-javaagent:BurpLoaderKeygen.jar", "-noverify", "-jar", burpsuite_pro_jar)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
cmd.Start()
}

0 comments on commit 7fc4f24

Please sign in to comment.