forked from 2dust/v2rayNG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62e0511
commit 3bbfad3
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
targets=( | ||
"aarch64-linux-android21 arm64 arm64-v8a" | ||
"armv7a-linux-androideabi21 arm armeabi-v7a" | ||
"x86_64-linux-android21 amd64 x86_64" | ||
"i686-linux-android21 386 x86" | ||
) | ||
|
||
for target in "${targets[@]}"; do | ||
IFS=' ' read -r ndk_target goarch abi <<< "$target" | ||
|
||
CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ndk_target}-clang" | ||
CGO_ENABLED=1 | ||
CGO_LDFLAGS="-Wl,-z,max-page-size=16384" | ||
GOOS=android | ||
GOARCH=$goarch | ||
FOLDER=$abi | ||
|
||
echo "Building for ${abi} with ${ndk_target} (${goarch})" | ||
|
||
cd "hysteria" || exit | ||
go build -v -o libs/$FOLDER/libhysteria2.so -trimpath -ldflags "-s -w -buildid=" ./app | ||
|
||
echo "Built libhysteria2.so for ${abi}" | ||
done |