diff --git a/build.sh b/build.sh index 7edd5cfc..ca95dfe4 100755 --- a/build.sh +++ b/build.sh @@ -65,6 +65,24 @@ build_windows_amd64() { scp -C winvm:$DIR/bettercap.exe . > /dev/null } +build_android_arm() { + host_dep 'shield' + + THEPATH="/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:/system/xbin:/system/bin" + LPATH="/data/data/com.termux/files/usr/lib" + GPATH=/data/data/com.termux/files/home/go + DIR=/data/data/com.termux/files/home/go/src/github.com/bettercap/bettercap + + echo "@ Updating repo on Android host ..." + ssh -p 8022 root@shield "su -c 'export PATH=$THEPATH && export LD_LIBRARY_PATH="$LPATH" && cd "$DIR" && rm -rf bettercap* && git pull && export GOPATH=$GPATH && go get ./...'" + + echo "@ Building android/arm ..." + ssh -p 8022 root@shield "su -c 'export PATH=$THEPATH && export LD_LIBRARY_PATH="$LPATH" && cd "$DIR" && export GOPATH=$GPATH && go build -o bettercap . && setenforce 0'" + + echo "@ Downloading bettercap ..." + scp -C -P 8022 root@shield:$DIR/bettercap . +} + rm -rf $BUILD_FOLDER mkdir $BUILD_FOLDER cd $BUILD_FOLDER @@ -72,6 +90,7 @@ cd $BUILD_FOLDER build_linux_amd64 && create_archive bettercap_linux_amd64_$VERSION.zip build_macos_amd64 && create_archive bettercap_macos_amd64_$VERSION.zip build_windows_amd64 && create_exe_archive bettercap_windows_amd64_$VERSION.zip +build_android_arm && create_archive bettercap_android_arm_$VERSION.zip sha256sum * > checksums.txt