summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-07-29 18:49:52 +0200
committercyBerta <cyberta@riseup.net>2019-08-02 01:49:37 +0200
commit8d0a10f8ca92de4766aee8d41f3e235590c3a848 (patch)
tree7c728357b8cd95e5de94cf7ae5a23812a99212af
parent4f7455bb6ea37928bd44d8579deaa05402975bc5 (diff)
update shapeshifter lib build script using gomobile
-rwxr-xr-xbuild_deps.sh9
-rwxr-xr-xgo/android_build_shapeshifter_lib.sh18
-rw-r--r--go/lib/shapeshifter-sources.jarbin0 -> 6294 bytes
-rw-r--r--go/lib/shapeshifter.aarbin0 -> 8464902 bytes
-rw-r--r--shapeshifter/shapeshifter-sources.jarbin0 -> 6294 bytes
-rw-r--r--shapeshifter/shapeshifter.aarbin8479553 -> 8464902 bytes
6 files changed, 22 insertions, 5 deletions
diff --git a/build_deps.sh b/build_deps.sh
index b95475a3..7f0c8e89 100755
--- a/build_deps.sh
+++ b/build_deps.sh
@@ -8,8 +8,7 @@ function quit {
DIR_OVPNASSETS=./ics-openvpn/main/build/ovpnassets
DIR_OVPNLIBS=./ics-openvpn/main/build/intermediates/cmake/noovpn3/release/obj
-DIR_GOLANG=./go/golang/
-DIR_SHAPESHIFTER_DISPATCHER=./go/src/
+DIR_GOLIBS=./go/lib/
FILE_X86=./go/out/x86/piedispatcherlib
FILE_ARM=./go/out/armeabi-v7a/piedispatcherlib
@@ -26,13 +25,13 @@ else
cd ..
fi
-if [[ $(ls -A ${FILE_X86}) && $(ls -A ${FILE_ARM}) ]]
+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"
- ./android_build_shapeshifter.sh clean || quit "android_build_shapeshifter_dispatcher.sh clean failed"
./install_go.sh || quit "install_go.sh failed"
- ./android_build_shapeshifter.sh --library || quit "android_build_shapeshifter_dispatcher.sh failed"
+ ./android_build_shapeshifter_lib.sh || quit "android_build_shapeshifter_dispatcher.sh failed"
+ cd ..
fi
diff --git a/go/android_build_shapeshifter_lib.sh b/go/android_build_shapeshifter_lib.sh
new file mode 100755
index 00000000..e3cd22d2
--- /dev/null
+++ b/go/android_build_shapeshifter_lib.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+export GOPATH=`pwd`
+export GO_LANG=`pwd`/golang/go/bin
+export GO_COMPILED=`pwd`/bin
+PATH="${GO_LANG}:${GO_COMPILED}:${PATH}"
+
+if [ -z $ANDROID_NDK_HOME ]; then
+ echo "Android NDK path not specified!"
+ echo "Please set \$ANDROID_NDK_HOME before starting this script!"
+ exit 1;
+fi
+
+./golang/go/bin/go get golang.org/x/mobile/cmd/gomobile
+
+gomobile init
+gomobile bind -target=android -o ./lib/shapeshifter.aar se.leap.bitmaskclient/shapeshifter/
+cp lib/shapeshifter* ../shapeshifter/. \ No newline at end of file
diff --git a/go/lib/shapeshifter-sources.jar b/go/lib/shapeshifter-sources.jar
new file mode 100644
index 00000000..e0a94055
--- /dev/null
+++ b/go/lib/shapeshifter-sources.jar
Binary files differ
diff --git a/go/lib/shapeshifter.aar b/go/lib/shapeshifter.aar
new file mode 100644
index 00000000..6b8acaf1
--- /dev/null
+++ b/go/lib/shapeshifter.aar
Binary files differ
diff --git a/shapeshifter/shapeshifter-sources.jar b/shapeshifter/shapeshifter-sources.jar
new file mode 100644
index 00000000..e0a94055
--- /dev/null
+++ b/shapeshifter/shapeshifter-sources.jar
Binary files differ
diff --git a/shapeshifter/shapeshifter.aar b/shapeshifter/shapeshifter.aar
index bf4aa7bc..6b8acaf1 100644
--- a/shapeshifter/shapeshifter.aar
+++ b/shapeshifter/shapeshifter.aar
Binary files differ