mirror of
https://github.com/dyhkwong/Exclave.git
synced 2026-06-22 03:12:45 +08:00
37 lines
1.0 KiB
Bash
Executable File
37 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
source "bin/init/env.sh"
|
|
|
|
export CGO_ENABLED=1
|
|
export GOOS=android
|
|
|
|
CURR="plugin/xtls"
|
|
CURR_PATH="$PROJECT/$CURR"
|
|
|
|
ROOT="$CURR_PATH/src/main/jniLibs"
|
|
OUTPUT="xrayexec"
|
|
LIB_OUTPUT="lib$OUTPUT.so"
|
|
|
|
git submodule update --init "$CURR/*"
|
|
cd $CURR_PATH/src/main/go/Xray-core
|
|
|
|
DIR="$ROOT/armeabi-v7a"
|
|
mkdir -p $DIR
|
|
env CC=$ANDROID_ARM_CC GOARCH=arm GOARM=7 go build -x -o $DIR/$LIB_OUTPUT -trimpath -ldflags "-s -w -buildid=" ./main
|
|
$ANDROID_ARM_STRIP $DIR/$LIB_OUTPUT
|
|
|
|
DIR="$ROOT/arm64-v8a"
|
|
mkdir -p $DIR
|
|
env CC=$ANDROID_ARM64_CC GOARCH=arm64 go build -x -o $DIR/$LIB_OUTPUT -trimpath -ldflags "-s -w -buildid=" ./main
|
|
$ANDROID_ARM64_STRIP $DIR/$LIB_OUTPUT
|
|
|
|
DIR="$ROOT/x86"
|
|
mkdir -p $DIR
|
|
env CC=$ANDROID_X86_CC GOARCH=386 go build -x -o $DIR/$LIB_OUTPUT -trimpath -ldflags "-s -w -buildid=" ./main
|
|
$ANDROID_X86_STRIP $DIR/$LIB_OUTPUT
|
|
|
|
DIR="$ROOT/x86_64"
|
|
mkdir -p $DIR
|
|
env CC=$ANDROID_X86_64_CC GOARCH=amd64 go build -x -o $DIR/$LIB_OUTPUT -trimpath -ldflags "-s -w -buildid=" ./main
|
|
$ANDROID_X86_64_STRIP $DIR/$LIB_OUTPUT
|