summaryrefslogtreecommitdiff
path: root/main/misc
diff options
context:
space:
mode:
Diffstat (limited to 'main/misc')
-rw-r--r--main/misc/build-native.bat76
-rwxr-xr-xmain/misc/build-native.sh2
-rwxr-xr-xmain/misc/dump_syms.sh18
-rwxr-xr-xmain/misc/fetchtranslations.sh2
4 files changed, 84 insertions, 14 deletions
diff --git a/main/misc/build-native.bat b/main/misc/build-native.bat
index 9885557a..8f1323e5 100644
--- a/main/misc/build-native.bat
+++ b/main/misc/build-native.bat
@@ -1,25 +1,77 @@
+@echo off
-@echo on
-echo Currently broken, feel free to fix and send me a patch, see the build-native.sh file how native libraries are build on UNIX
-exit 1
+setlocal EnableDelayedExpansion
-call ndk-build APP_ABI=x86_64 -j 8 USE_BREAKPAD=0
+if not exist openvpn\.git (
+ set lasterror=Cannot find .git directory in openvpn, aborting
+ goto :error
+) else (
+ cd openvpn
+ set head=HEAD
+ for /F "tokens=3 delims=/" %%F in ('git rev-parse --symbolic-full-name HEAD') do (
+ set head=%%F
+ )
+
+ git rev-parse --short=16 HEAD > commit.tmp
+ set /p commit=<commit.tmp
+ del commit.tmp
+
+ set revision=%head%-%commit%
+
+ echo #define CONFIGURE_GIT_REVISION "%revision%"> config-version.h.tmp
+
+ git diff-files --name-status -r --ignore-submodules --quiet -- > flags.tmp || echo +> flags.tmp
+ git diff-index --cached --quiet --ignore-submodules HEAD > flags.tmp || echo *>> flags.tmp
+ set /p flags=<flags.tmp
+ del flags.tmp
+
+ echo #define CONFIGURE_GIT_FLAGS "%flags%">> config-version.h.tmp
+
+ fc /b config-version.h.tmp config-version.h 1>nul 2>nul
+ if not errorlevel 1 goto keep
+
+ echo replacing config-version.h
+ copy config-version.h.tmp config-version.h
+
+:keep
+ del config-version.h.tmp
+
+ cd ..
+)
+
+if [%1] == [] (
+ call ndk-build USE_SHORT_COMMANDS=1 -j 8 USE_BREAKPAD=0
+) else (
+ call ndk-build USE_SHORT_COMMANDS=1 %*
+)
+
+if not errorlevel 0 goto error
+
+if exist ovpnlibs rmdir /Q /S ovpnlibs
cd libs
mkdir ..\ovpnlibs
mkdir ..\ovpnlibs\assets
+mkdir ..\ovpnlibs\jniLibs
for /D %%f in (*) do (
- copy %%f\nopievpn ..\ovpnlibs\assets\nopievpn.%%f
- copy %%f\pievpn ..\ovpnlibs\assets\pievpn.%%f
+ copy %%f\nopie_openvpn ..\ovpnlibs\assets\nopie_openvpn.%%f
+ copy %%f\pie_openvpn ..\ovpnlibs\assets\pie_openvpn.%%f
- del %%f\libcrypto.so
- del %%f\libssl.so
+ rem Remove compiled openssl libs, will use platform .so libs
+ rem Reduces size of apk
+ del /Q %%f\libcrypto.so
+ del /Q %%f\libssl.so
- mkdir ..\ovpnlibs\jniLibs
- mkdir ..\ovpnlibs\jniLibs\%%f\
- copy %%f\*.so ..\ovpnlibs\jniLibs\%%f\
+ mkdir ..\ovpnlibs\jniLibs\%%f\
+ copy %%f\*.so ..\ovpnlibs\jniLibs\%%f\
)
-cd ..
+goto :exit
+
+:error
+echo(%lasterror%
+exit /b %errorlevel%
+
+:exit \ No newline at end of file
diff --git a/main/misc/build-native.sh b/main/misc/build-native.sh
index 892b075d..75706e21 100755
--- a/main/misc/build-native.sh
+++ b/main/misc/build-native.sh
@@ -44,7 +44,7 @@ if [ $? = 0 ]; then
# Removed compiled openssl libs, will use platform so libs
# Reduces size of apk
#
- rm -v */libcrypto.so */libssl.so
+ rm -v */libcrypto.so */libssl.so || true
for arch in *
do
diff --git a/main/misc/dump_syms.sh b/main/misc/dump_syms.sh
new file mode 100755
index 00000000..1173555c
--- /dev/null
+++ b/main/misc/dump_syms.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+
+function dumplib()
+{
+ LIB=$1
+ for arch in armeabi-v7a armeabi arm64-v8a x86 x86_64; do
+ VER=$(dump_syms obj/local/$arch/$LIB |grep MODULE | cut -d " " -f 4)
+ mkdir -p symbols/$LIB/$VER
+ dump_syms obj/local/$arch/$LIB > symbols/$LIB/$VER/$LIB.sym
+ done
+}
+
+dumplib libopenvpn.so
+dumplib pie_openvpn
+
+
+
diff --git a/main/misc/fetchtranslations.sh b/main/misc/fetchtranslations.sh
index 4d03730a..b6589ce9 100755
--- a/main/misc/fetchtranslations.sh
+++ b/main/misc/fetchtranslations.sh
@@ -9,7 +9,7 @@ then
fi
echo "Fetch translation archive"
-wget -q http://crowdin.net/download/project/ics-openvpn.zip
+wget -q https://crowdin.com/download/project/ics-openvpn.zip
# Chinese language require zh-CN and zh-TW