2021-01-16 16:25:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-02-26 06:08:07 +00:00
|
|
|
# v4.34.0
|
2021-02-25 04:58:04 +00:00
|
|
|
V2RAY_CORE_VERSION="a6efb4d60b86789a68ed8ac8d52cfcec2d80229a"
|
2021-01-16 16:25:30 +00:00
|
|
|
|
|
|
|
source "bin/init/env.sh"
|
2021-02-18 02:32:07 +00:00
|
|
|
export GO111MOUDLE=on
|
|
|
|
export PATH="$PATH:$(go env GOPATH)/bin"
|
2021-01-16 16:25:30 +00:00
|
|
|
|
2021-02-26 06:08:07 +00:00
|
|
|
mkdir -p "$PROJECT/build"
|
2021-02-18 02:32:07 +00:00
|
|
|
cd "$PROJECT/build"
|
2021-02-26 02:28:51 +00:00
|
|
|
[ -d "v2ray" ] || git clone https://github.com/2dust/AndroidLibV2rayLite v2ray || exit 1
|
2021-02-18 02:32:07 +00:00
|
|
|
cd v2ray
|
|
|
|
git reset --hard && git clean -fdx
|
2021-02-25 04:58:04 +00:00
|
|
|
sed -i -e "s|go 1.14|go 1.16|g" go.mod
|
|
|
|
sed -i -e "s|core master|core $V2RAY_CORE_VERSION|g" go.mod
|
|
|
|
go mod download -x || exit 1
|
2021-02-23 21:47:48 +00:00
|
|
|
go get -v golang.org/x/mobile/cmd/...
|
|
|
|
gomobile init
|
2021-02-18 02:32:07 +00:00
|
|
|
gomobile bind -v -ldflags='-s -w' . || exit 1
|
2021-01-16 16:25:30 +00:00
|
|
|
|
2021-02-18 02:32:07 +00:00
|
|
|
/bin/cp -f libv2ray.aar "$PROJECT/TMessagesProj/libs"
|