blob: fde8f878329ba45facc26198f6b47a82e69e3b62 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
#!/bin/bash
function quit {
echo "Task failed. $1."
exit 1
}
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=./bitmaskcore/lib/
#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
cd $BASE_DIR
if [[ $(ls -A ${DIR_OVPNASSETS}) && $(ls -A ${DIR_OVPNLIBS}) ]]
then
echo "Dirty build: skipped externalNativeBuild - reusing existing libs"
else
echo "Clean build: starting externalNativeBuild"
cd ./ics-openvpn || quit "Directory ics-opevpn not found"
./gradlew clean main:externalNativeBuildCleanSkeletonRelease main:externalNativeBuildSkeletonRelease --debug --stacktrace || quit "Build ics-openvpn native libraries failed"
cd ..
fi
if [[ $(ls -A ${DIR_GOLIBS}) ]]
then
echo "Dirty build: Reusing go libraries"
else
echo "Clean build: compiling Go libraries"
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
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
|