summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2021-11-12 00:46:35 +0000
committercyberta <cyberta@riseup.net>2021-11-12 00:46:35 +0000
commitc5d722f555b952407dade3abb1ffd537e6747317 (patch)
treea9ebb8b33438589a33ed9ce54ade50371c9fe147 /scripts
parent571c0479f7400e56cfdb27408160d8a816cc8610 (diff)
parent8aeb4791b6e024de9aa9c61b574d8c798a3c0a2c (diff)
Merge branch 'tor-snowflake' into 'master'
tor-over-snowflake Closes #9045 See merge request leap/bitmask_android!138
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_deps.sh71
-rwxr-xr-xscripts/cleanProject.sh10
2 files changed, 72 insertions, 9 deletions
diff --git a/scripts/build_deps.sh b/scripts/build_deps.sh
index 1785fca8..470b39b6 100755
--- a/scripts/build_deps.sh
+++ b/scripts/build_deps.sh
@@ -9,14 +9,54 @@ SCRIPT_DIR=$(dirname "$0")
BASE_DIR="$SCRIPT_DIR/.."
DIR_OVPNASSETS=./ics-openvpn/main/build/ovpnassets
DIR_OVPNLIBS=./ics-openvpn/main/build/intermediates/cmake/noovpn3/release/obj
-DIR_GOLIBS=./go/lib/
-FILE_X86=./go/out/x86/piedispatcherlib
-FILE_ARM=./go/out/armeabi-v7a/piedispatcherlib
+DIR_GOLIBS=./bitmaskcore/lib/
+#FILE_X86=./go/out/x86/piedispatcherlib
+#FILE_ARM=./go/out/armeabi-v7a/piedispatcherlib
+DIR_TORLIBS=./tor-android/external/lib
+EXPECTED_NDK_VERSION="21.4.7075529"
+EXPECTED_ANDROID_NDK_RELEASE_VERSION="r21e"
# init
# look for empty dir
cd $BASE_DIR
+
+# try to set the expected ndk version
+if [[ $(ls -A ${ANDROID_HOME}/ndk/${EXPECTED_NDK_VERSION}) ]]
+then
+ ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${EXPECTED_NDK_VERSION}
+else
+ # ndk was manually downloaded from http://dl.google.com/android/repository
+ ANDROID_NDK_HOME=${ANDROID_HOME}/android-ndk-${EXPECTED_ANDROID_NDK_RELEASE_VERSION}
+fi
+NDK_VERSION=`cat ${ANDROID_NDK_HOME}/source.properties | grep Pkg.Revision | cut -d "=" -f2 | sed 's/ //g'`
+
+ls -la ${ANDROID_HOME}/*/*ndk
+echo "ndk version: $NDK_VERSION"
+echo "ANDROID_NDK_HOME: $ANDROID_NDK_HOME"
+
+# build tor libs
+if [[ $(ls -A ${DIR_TORLIBS}) ]]
+then
+ echo "Dirty build: Reusing tor libraries"
+else
+ echo "Clean build: compiling tor libraries"
+ if [[ ! -d $DIR_TORLIBS ]]
+ then
+ mkdir $DIR_TORLIBS
+ fi
+ cd ./tor-android
+ if [[ $NDK_VERSION == $EXPECTED_NDK_VERSION ]]
+ then
+ ./tor-droid-make.sh fetch -c || quit "failed to checkout tor dependencies"
+ ./tor-droid-make.sh build -b release || quit "failed to build tor release binaries"
+ else
+ quit "expected NDK VERSION: $EXPECTED_NDK_VERSION. But found: $NDK_VERSION"
+ fi
+ cd ..
+fi
+
+# build openvpn libs
if [[ $(ls -A ${DIR_OVPNASSETS}) && $(ls -A ${DIR_OVPNLIBS}) ]]
then
echo "Dirty build: skipped externalNativeBuild - reusing existing libs"
@@ -27,14 +67,29 @@ else
cd ..
fi
+# build bitmask core (shapeshifter, snowflake, pgpverify)
if [[ $(ls -A ${DIR_GOLIBS}) ]]
then
echo "Dirty build: Reusing go libraries"
else
echo "Clean build: compiling Go libraries"
- cd ./go || quit "Directory go not found"
- ./install_go.sh || quit "install_go.sh failed"
- ./android_build_web_core.sh || quit "android_build_web_core.sh (shapeshifter + pgpverify) failed"
- ./android_build_core.sh || quit "android build core (shapeshifter) failed"
+ cd ./bitmaskcore || quit "Directory go not found"
+ if [[ ! -d lib ]]
+ then
+ mkdir lib
+ fi
+ ./build_core.sh || quit "failed to build bitmaskcore"
+ cp lib/bitmaskcore.aar ../lib-bitmask-core/.
+ cp lib/bitmaskcore-sources.jar ../lib-bitmask-core/.
+ cp lib/bitmaskcore_web.aar ../lib-bitmask-core-web/.
+ cp lib/bitmaskcore_web-sources.jar ../lib-bitmask-core-web/.
+ cp lib/bitmaskcore_arm.aar ../lib-bitmask-core-armv7/.
+ cp lib/bitmaskcore_arm-sources.jar ../lib-bitmask-core-armv7/.
+ cp lib/bitmaskcore_arm64.aar ../lib-bitmask-core-arm64/.
+ cp lib/bitmaskcore_arm64-sources.jar ../lib-bitmask-core-arm64/.
+ cp lib/bitmaskcore_x86.aar ../lib-bitmask-core-x86/.
+ cp lib/bitmaskcore_x86-sources.jar ../lib-bitmask-core-x86/.
+ cp lib/bitmaskcore_x86_64.aar ../lib-bitmask-core-x86_64/.
+ cp lib/bitmaskcore_x86_64-sources.jar ../lib-bitmask-core-x86_64/.
cd ..
-fi
+fi \ No newline at end of file
diff --git a/scripts/cleanProject.sh b/scripts/cleanProject.sh
index 058ef20e..e7d8460e 100755
--- a/scripts/cleanProject.sh
+++ b/scripts/cleanProject.sh
@@ -9,7 +9,15 @@ git checkout -- \.\*
rm -r $BASE_DIR/ics-openvpn
rm -r $BASE_DIR/build
rm -r $BASE_DIR/app/build
-rm -r $BASE_DIR/go/lib/*
+rm -r $BASE_DIR/bitmaskcore/lib/*
+rm -r $BASE_DIR/bitmaskcore/golang/
rm -r $BASE_DIR/currentReleases
+rm -r $BASE_DIR/tor-android/build
+rm -r $BASE_DIR/tor-android/tor-android-binary/build
+rm -r $BASE_DIR/tor-android/external/bin
+rm -r $BASE_DIR/tor-android/external/include/
+rm -r $BASE_DIR/tor-android/external/*.build-stamp
+rm -r $BASE_DIR/tor-android/external/lib
+git submodule foreach --recursive git reset --hard HEAD
git submodule sync --recursive
git submodule update --init --recursive