Skip to content

Commit

Permalink
ABI parameter for compile-tun2socks.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
UjuiUjuMandan committed Jan 11, 2025
1 parent d996c70 commit d825552
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ conf/demo/
demo/
assets/
libv2ray*.[a|j]ar

*.so
*.so.tgz
25 changes: 24 additions & 1 deletion compile-tun2socks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,36 @@ clear_tmp () {
trap 'echo -e "Aborted, error $? in command: $BASH_COMMAND"; trap ERR; clear_tmp; exit 1' ERR INT
install -m644 $__dir/tun2socks.mk $TMPDIR/

abi_filter="all"
if [ "$#" -eq 1 ]; then
case $1 in
arm64-v8a)
abi_filter="arm64-v8a"
;;
armeabi-v7a)
abi_filter="armeabi-v7a"
;;
x86_64)
abi_filter="x86_64"
;;
x86)
abi_filter="x86"
;;
*)
echo "Invalid ABI specified: $1"
echo "Valid options are: arm64-v8a, armeabi-v7a, x86_64, x86"
exit 1
;;
esac
fi

pushd $TMPDIR
ln -s $__dir/badvpn badvpn
ln -s $__dir/libancillary libancillary
$NDK_HOME/ndk-build \
NDK_PROJECT_PATH=. \
APP_BUILD_SCRIPT=./tun2socks.mk \
APP_ABI=all \
APP_ABI=$abi_filter \
APP_PLATFORM=android-19 \
NDK_LIBS_OUT=$TMPDIR/libs \
NDK_OUT=$TMPDIR/tmp \
Expand Down

0 comments on commit d825552

Please sign in to comment.