2022-06-19 14:57:37 -04:00
|
|
|
#!/bin/bash
|
2022-10-17 21:15:01 -04:00
|
|
|
OBFS4PROXY_TAG=obfs4proxy-0.0.14
|
2022-06-19 14:57:37 -04:00
|
|
|
|
2022-12-30 16:23:52 -05:00
|
|
|
OS=$(uname -s)
|
|
|
|
|
2022-06-19 14:57:37 -04:00
|
|
|
mkdir -p ./build/obfs4proxy
|
|
|
|
cd ./build/obfs4proxy
|
|
|
|
git clone https://gitlab.com/yawning/obfs4 || echo "already cloned"
|
|
|
|
cd obfs4
|
|
|
|
git checkout $OBFS4PROXY_TAG
|
2022-12-30 16:23:52 -05:00
|
|
|
if [ "$OS" == "Darwin" ]; then
|
2023-02-06 21:31:02 -05:00
|
|
|
if [[ $(uname -m) == 'arm64' ]]; then
|
|
|
|
go build -o ../../../onionshare/resources/tor/obfs4proxy-arm64 ./obfs4proxy
|
|
|
|
GOOS=darwin GOARCH=amd64 go build -o ../../../onionshare/resources/tor/obfs4proxy-amd64 ./obfs4proxy
|
|
|
|
lipo -create -output ../../../onionshare/resources/tor/obfs4proxy ../../../onionshare/resources/tor/obfs4proxy-arm64 ../../../onionshare/resources/tor/obfs4proxy-amd64
|
|
|
|
rm ../../../onionshare/resources/tor/obfs4proxy-arm64 ../../../onionshare/resources/tor/obfs4proxy-amd64
|
|
|
|
elif [[ $(uname -m) == 'x86_64' ]]; then
|
|
|
|
go build -o ../../../onionshare/resources/tor/obfs4proxy ./obfs4proxy
|
|
|
|
fi
|
2022-12-30 16:23:52 -05:00
|
|
|
else
|
|
|
|
go build -o ../../../onionshare/resources/tor/obfs4proxy ./obfs4proxy
|
|
|
|
fi
|