diff options
author | cyBerta <cyberta@riseup.net> | 2021-07-15 00:36:00 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-07-21 22:02:28 +0200 |
commit | 0822d3e0f62d9dcc9c1ce15bea941860affbf94f (patch) | |
tree | 65ddab5726d6bd8537c5f2d2c0553596cd760e0d | |
parent | 818281a7fdf8b43437e14478a2276dc821b69284 (diff) |
build tor binaries from source
-rwxr-xr-x | scripts/build_deps.sh | 32 | ||||
-rwxr-xr-x | scripts/cleanProject.sh | 8 |
2 files changed, 36 insertions, 4 deletions
diff --git a/scripts/build_deps.sh b/scripts/build_deps.sh index 1d8d26d5..fde8f878 100755 --- a/scripts/build_deps.sh +++ b/scripts/build_deps.sh @@ -10,9 +10,11 @@ BASE_DIR="$SCRIPT_DIR/.." DIR_OVPNASSETS=./ics-openvpn/main/build/ovpnassets DIR_OVPNLIBS=./ics-openvpn/main/build/intermediates/cmake/noovpn3/release/obj DIR_GOLIBS=./bitmaskcore/lib/ -FILE_X86=./go/out/x86/piedispatcherlib -FILE_ARM=./go/out/armeabi-v7a/piedispatcherlib - +#FILE_X86=./go/out/x86/piedispatcherlib +#FILE_ARM=./go/out/armeabi-v7a/piedispatcherlib +DIR_TORLIBS=./tor-android/external/lib +NDK_VERSION=`cat $ANDROID_NDK_HOME/source.properties | grep Pkg.Revision | cut -d "=" -f2 | sed 's/ //g'` +EXPECTED_NDK_VERSION="21.4.7075529" # init # look for empty dir @@ -51,4 +53,28 @@ else 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 + +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 + ./tor-droid-make.sh build -b release + else + echo "expected NDK VERSION: $EXPECTED_NDK_VERSION. But found: $NDK_VERSION" + fi + + cd .. +fi
\ No newline at end of file diff --git a/scripts/cleanProject.sh b/scripts/cleanProject.sh index 058ef20e..c1d5df7a 100755 --- a/scripts/cleanProject.sh +++ b/scripts/cleanProject.sh @@ -9,7 +9,13 @@ 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/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 sync --recursive git submodule update --init --recursive |