Skip to content

Commit d950e99

Browse files
author
uoosef
committed
prepare for android
1 parent 2dbefd6 commit d950e99

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

main.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ func main() {
3535
flag.Usage = usage
3636
flag.Parse()
3737

38+
RunWarp(*psiphonEnabled, *gool, *scan, *verbose, *country, *bindAddress, *endpoint, *license)
39+
}
40+
41+
func RunWarp(psiphonEnabled, gool, scan, verbose bool, country, bindAddress, endpoint, license string) {
3842
// check if user input is not correct
39-
if (*psiphonEnabled && *gool) || (!*psiphonEnabled && *country != "") {
43+
if (psiphonEnabled && gool) || (!psiphonEnabled && country != "") {
4044
log.Println("Wrong command!")
4145
flag.Usage()
4246
return
@@ -46,26 +50,26 @@ func main() {
4650
makeDirs()
4751

4852
//create identities
49-
createPrimaryAndSecondaryIdentities(*license)
53+
createPrimaryAndSecondaryIdentities(license)
5054

5155
//Decide Working Scenario
52-
endpoints := []string{*endpoint, *endpoint}
56+
endpoints := []string{endpoint, endpoint}
5357

54-
if *scan {
58+
if scan {
5559
endpoints = wiresocks.RunScan()
5660
log.Println("Cooling down please wait 5 seconds...")
5761
time.Sleep(5 * time.Second)
5862
}
5963

60-
if !*psiphonEnabled && !*gool {
64+
if !psiphonEnabled && !gool {
6165
// just run primary warp on bindAddress
62-
runWarp(*bindAddress, endpoints, "./primary/wgcf-profile.ini", *verbose, true, true)
63-
} else if *psiphonEnabled && !*gool {
66+
runWarp(bindAddress, endpoints, "./primary/wgcf-profile.ini", verbose, true, true)
67+
} else if psiphonEnabled && !gool {
6468
// run primary warp on a random tcp port and run psiphon on bind address
65-
runWarpWithPsiphon(*bindAddress, endpoints, *country, *verbose)
66-
} else if !*psiphonEnabled && *gool {
69+
runWarpWithPsiphon(bindAddress, endpoints, country, verbose)
70+
} else if !psiphonEnabled && gool {
6771
// run warp in warp
68-
runWarpInWarp(*bindAddress, endpoints, *verbose)
72+
runWarpInWarp(bindAddress, endpoints, verbose)
6973
}
7074

7175
//End Decide Working Scenario

0 commit comments

Comments
 (0)