summaryrefslogtreecommitdiff
path: root/main/misc
diff options
context:
space:
mode:
Diffstat (limited to 'main/misc')
-rw-r--r--main/misc/build-native.bat22
-rwxr-xr-xmain/misc/build-native.sh52
-rwxr-xr-xmain/misc/fetchtranslations.sh38
-rwxr-xr-xmain/misc/prepareovpn3.sh3
4 files changed, 115 insertions, 0 deletions
diff --git a/main/misc/build-native.bat b/main/misc/build-native.bat
new file mode 100644
index 00000000..73a19a00
--- /dev/null
+++ b/main/misc/build-native.bat
@@ -0,0 +1,22 @@
+
+@echo on
+echo Currently broken, feel free to fix and send me a patch, see .sh file
+exit 1
+
+call ndk-build APP_API=all -j 8
+
+
+cd libs
+mkdir ..\assets
+mkdir ..\build\
+
+for /D %%f in (*) do (
+ copy %%f\minivpn ..\assets\minivpn.%%f
+ del %%f\libcrypto.so
+ del %%f\libssl.so
+
+ mkdir ..\build\native-libs\%%f\
+ copy %%f\*.so ..\build\native-libs\%%f\
+)
+
+cd ..
diff --git a/main/misc/build-native.sh b/main/misc/build-native.sh
new file mode 100755
index 00000000..52cb18aa
--- /dev/null
+++ b/main/misc/build-native.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+# Exit on errors
+set -e
+
+# Generate git config if the openvpn directory is checked out from git
+if [ -d openvpn/.git ]; then
+ GIT=git
+ cd openvpn
+ CONFIGURE_GIT_CHFILES=$($GIT diff-files --name-status -r --ignore-submodules --quiet -- || echo "+")
+ CONFIGURE_GIT_UNCOMMITTED=$($GIT diff-index --cached --quiet --ignore-submodules HEAD || echo "*")
+ CONFIGURE_GIT_REVISION=$($GIT rev-parse --symbolic-full-name HEAD | cut -d/ -f3)-$($GIT rev-parse --short=16 HEAD)
+ echo "#define CONFIGURE_GIT_REVISION \"${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \
+ echo "#define CONFIGURE_GIT_FLAGS \"${CONFIGURE_GIT_CHFILES}${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp
+
+ if ! [ -f config-version.h ] || ! cmp -s config-version.h.tmp config-version.h; then \
+ echo "replacing config-version.h"
+ mv config-version.h.tmp config-version.h
+ else
+ rm -f config-version.h.tmp
+ fi
+ cd ..
+fi
+
+if [ "x$1" = "x" ]; then
+ ndk-build APP_API=all -j 8
+else
+ ndk-build $@
+fi
+
+if [ $? = 0 ]; then
+ rm -rf ovpnlibs/
+
+ cd libs
+ mkdir -p ../ovpnlibs/assets
+ for i in *
+ do
+ cp -v $i/minivpn ../ovpnlibs/assets/minivpn.$i
+ done
+ # Removed compiled openssl libs, will use platform so libs
+ # Reduces size of apk
+ rm -v */libcrypto.so */libssl.so
+
+ for arch in *
+ do
+ builddir=../ovpnlibs/jniLibs/$arch
+ mkdir -p $builddir
+ cp -v $arch/*.so $builddir
+ done
+else
+ exit $?
+fi
diff --git a/main/misc/fetchtranslations.sh b/main/misc/fetchtranslations.sh
new file mode 100755
index 00000000..d92c24b5
--- /dev/null
+++ b/main/misc/fetchtranslations.sh
@@ -0,0 +1,38 @@
+#! /bin/sh
+
+
+if [ "$ICSCROWDAPIKEY" != "" ]
+then
+ echo "Generating new translation archives"
+ fetch -q -1 -o - http://api.crowdin.net/api/project/ics-openvpn/export?key=$ICSCROWDAPIKEY
+fi
+
+echo "Fetch translation archive"
+fetch -q http://crowdin.net/download/project/ics-openvpn.zip
+
+langtoinclude="ca cs de es et fr id it ja ko no nl pl ro ru sv tr uk"
+
+for lang in $langtoinclude
+do
+ tar -xvf ics-openvpn.zip -C src/main res/values-$lang/
+done
+
+# Chinese language require zh-CN and zh-TW
+
+for lang in zh-CN zh-TW id
+do
+ if [ $lang = "zh-CN" ] ; then
+ rlang="zh-rCN"
+ elif [ $lang = "zh-TW" ] ; then
+ rlang="zh-rTW"
+ elif [ $lang = "id" ] ; then
+ rlang="id"
+ fi
+
+ echo "Fetch archive for $lang"
+ fetch http://crowdin.net/download/project/ics-openvpn/$lang.zip
+ tar -xv -C src/main/res/values-$rlang/ --strip-components 3 -f $lang.zip
+ rm $lang.zip
+done
+
+rm -v ics-openvpn.zip
diff --git a/main/misc/prepareovpn3.sh b/main/misc/prepareovpn3.sh
new file mode 100755
index 00000000..15982727
--- /dev/null
+++ b/main/misc/prepareovpn3.sh
@@ -0,0 +1,3 @@
+export O3=$PWD/openvpn3
+mkdir -p src/ovpn3/java/net/openvpn/ovpn3
+swig -outdir src/ovpn3/java/net/openvpn/ovpn3/ -c++ -java -package net.openvpn.ovpn3 -I$O3/client -I$O3 $O3/javacli/ovpncli.i \ No newline at end of file