1
0
mirror of https://github.com/PurpleI2P/i2pd-android.git synced 2025-03-13 05:51:12 +00:00

Compare commits

...

19 Commits

Author SHA1 Message Date
8c533cbbfc
2.56.0
Signed-off-by: r4sas <r4sas@i2pmail.org>
2025-02-12 20:37:43 +00:00
8236649d2e
update boost submodule
Signed-off-by: r4sas <r4sas@i2pmail.org>
2025-01-09 21:08:22 +00:00
d6347329e1
update boost submodule, add exit code check
Signed-off-by: r4sas <r4sas@i2pmail.org>
2025-01-09 20:57:29 +00:00
99ee7d7f57
2.55.0
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-12-31 15:39:58 +00:00
3711a70495
semicolon
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-12-19 19:24:08 +00:00
66809c5ae4
add app dir creation on assets processing, update i2pd to trunk
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-12-19 18:57:50 +00:00
06f337f717
2.54.0
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-10-06 21:16:58 +00:00
orignal
cb322c6467 update i2pd 2024-08-30 12:41:04 -04:00
orignal
cae2700b20 removed dependency from boost::date_time and boost::filesystem 2024-08-30 12:33:21 -04:00
9203ba68a7
update boost submodule
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-08-05 20:29:18 +00:00
440b565c4b
2.53.1
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-08-05 20:10:55 +00:00
ed54b2692b
update README build section
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-07-29 23:44:15 +00:00
503f8a003e
revert switching from JNI to binary
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-07-29 23:26:17 +00:00
nonlin-lin-chaos-order-etc-etal
8347c04fb1 Remove copying of subscriptions.txt. Fix #74 2024-07-25 17:20:34 +03:00
c912f81429
2.53.0
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-07-23 19:12:25 +00:00
27cdad53ba
update README, add libraries rebuild skip flag
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-07-23 19:02:05 +00:00
734693ba94
move submodules, delete jni, remove ndkBuild from gradle
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-07-21 20:15:07 +00:00
031c536945
[chore] update i2pd to 2.53.0, change build script
Signed-off-by: r4sas <r4sas@i2pmail.org>
2024-07-21 19:23:54 +00:00
nonlin-lin-chaos-order-etc-etal
988940f50a
Try to fix #50 (#76)
* Fix foreground notification
* Trying to fix app quit
* Remove unsupported UI items
* Remove misleading exceptions
* Set Unix exec bit on build scripts
* Revamp processAssets point to be launched
* Corrected logic of daemon status events
* Fix double I2PActivity.onCreate call hangup
* Fix exception processing @ processAssets
2024-07-21 20:44:19 +03:00
32 changed files with 405 additions and 356 deletions

View File

@ -20,10 +20,8 @@ jobs:
- name: Build required modules
run: |
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
pushd app/jni
./build_boost.sh
./build_openssl.sh
./build_miniupnpc.sh
pushd binary/jni
./build.sh
popd
- name: Build with Gradle
run: ./gradlew --no-daemon assembleDebug
@ -47,18 +45,11 @@ jobs:
run: export JAVA_HOME=$JAVA_HOME_11_X64
- name: Install required Android SDK packages
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.22.1" "ndk;23.2.8568313"
- name: Build required modules
- name: Build binary with NDK
run: |
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
pushd binary/jni
./build_boost.sh
./build_openssl.sh
./build_miniupnpc.sh
popd
- name: Build binaries with NDK
run: |
pushd binary/jni
$ANDROID_NDK_HOME/ndk-build -j2 NDK_MODULE_PATH=$PWD
./build.sh -b
popd
- name: Create package with built binaries
run: |

1
.gitignore vendored
View File

@ -10,7 +10,6 @@ obj
.externalNativeBuild
ant.properties
local.properties
build.sh
android.iml
build
*.iml

10
.gitmodules vendored
View File

@ -1,16 +1,16 @@
[submodule "android-ifaddrs"]
path = app/jni/android-ifaddrs
path = binary/jni/android-ifaddrs
url = https://github.com/PurpleI2P/android-ifaddrs.git
[submodule "i2pd"]
path = app/jni/i2pd
path = binary/jni/i2pd
url = https://github.com/PurpleI2P/i2pd.git
branch = openssl
[submodule "miniupnp"]
path = app/jni/miniupnp
path = binary/jni/miniupnp
url = https://github.com/miniupnp/miniupnp.git
[submodule "openssl"]
path = app/jni/openssl
path = binary/jni/openssl
url = https://github.com/openssl/openssl.git
[submodule "boost"]
path = app/jni/boost
path = binary/jni/boost
url = https://github.com/moritz-wundke/Boost-for-Android.git

View File

@ -42,6 +42,7 @@ unzip commandlinetools-linux-8092744_latest.zip
```bash
git clone --recurse-submodules https://github.com/PurpleI2P/i2pd-android.git
cd i2pd-android
```
### Compile application
@ -53,10 +54,8 @@ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export ANDROID_HOME=/opt/android-sdk
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
pushd app/jni
./build_boost.sh
./build_openssl.sh
./build_miniupnpc.sh
pushd binary/jni
./build.sh -d
popd
gradle clean assembleDebug

View File

@ -29,8 +29,8 @@ android {
targetSdkVersion 33
// TODO: 24?
minSdkVersion 16
versionCode 2520000
versionName "2.52.0"
versionCode 2560000
versionName "2.56.0"
archivesBaseName += "-$versionName"
ndkVersion "23.2.8568313"
@ -43,7 +43,7 @@ android {
externalNativeBuild {
ndkBuild {
arguments "NDK_MODULE_PATH:=${rootProject.projectDir}/app/jni"
arguments "NDK_MODULE_PATH:=${rootProject.projectDir}/binary/jni"
arguments "-j${Runtime.getRuntime().availableProcessors()}"
}
}

View File

@ -4,9 +4,6 @@ LOCAL_MODULE := i2pd
LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_C_INCLUDES += $(IFADDRS_PATH) $(LIB_SRC_PATH) $(LIB_CLIENT_SRC_PATH) $(LANG_SRC_PATH) $(DAEMON_SRC_PATH)
LOCAL_STATIC_LIBRARIES := \
boost_system \
boost_date_time \
boost_filesystem \
boost_program_options \
crypto \
ssl \
@ -29,27 +26,6 @@ LOCAL_SRC_FILES := \
include $(BUILD_SHARED_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_system
LOCAL_SRC_FILES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/lib/libboost_system.a
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_date_time
LOCAL_SRC_FILES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/lib/libboost_date_time.a
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_filesystem
LOCAL_SRC_FILES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/lib/libboost_filesystem.a
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_program_options

@ -1 +0,0 @@
Subproject commit f302cc7ead971d4068661d34c2f3ba06063d8ea2

@ -1 +0,0 @@
Subproject commit 53e6c16ea80c7dcb2683fd548e0c7a09ddffbfc1

View File

@ -1,80 +0,0 @@
#!/bin/bash
set -e
BOOST_VERSION=1.78.0
BOOST_LIBS=date_time,filesystem,program_options,system
function build_one {
echo "Configuring and building..."
CXXFLAGS="-std=c++14" \
NCPU=$(nproc) \
./build-android.sh \
--boost=$BOOST_VERSION \
--arch=$CPU \
--target-version=$API \
--with-libraries=$BOOST_LIBS \
--layout=system \
$ANDROID_NDK_HOME
}
function checkPreRequisites {
if ! [ -d "boost" ] || ! [ "$(ls -A boost)" ]; then
echo -e "\033[31mFailed! Submodule 'boost' not found!\033[0m"
echo -e "\033[31mTry to run: 'git submodule update --init'\033[0m"
exit
fi
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit
fi
}
function build {
for arg in "$@"; do
case "$arg" in
x86_64)
API=21
TARGET=x86_64
build_one
;;
arm64)
API=21
CPU=arm64-v8a
build_one
;;
x86)
API=16
CPU=x86
build_one
;;
arm)
API=16
CPU=armeabi-v7a
build_one
;;
all)
API=16
build_one
;;
*)
;;
esac
done
}
checkPreRequisites
cd boost
# disable verbose output
sed -i -E -e 's/d\+2/d\+0/' build-android.sh
sed -i -E -e 's/\"23\.1\"\|\"25\.0\"/\"23\.1\"\|\"23\.2\"\|\"25\.0\"/' build-android.sh
if (( $# == 0 )); then
build all
else
build $@
fi

View File

@ -1,92 +0,0 @@
#!/bin/bash
set -e
CMAKE_VERSION=3.22.1
function build_one {
mkdir -p build out/$CPU
cd build
cmake \
-G "Unix Makefiles" \
-DUPNPC_BUILD_SHARED=False \
-DUPNPC_BUILD_TESTS=False \
-DUPNPC_BUILD_SAMPLE=False \
-DANDROID_NATIVE_API_LEVEL=$API \
-DANDROID_ABI=$CPU \
-DCMAKE_BUILD_TYPE=Release \
-DANDROID_NDK=$ANDROID_NDK_HOME \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=../out/$CPU \
..
echo "Building..."
cmake --build . -- libminiupnpc-static
make install
cd ..
rm -rf build
}
function checkPreRequisites {
if ! [ -d "miniupnp" ] || ! [ "$(ls -A miniupnp)" ]; then
echo -e "\033[31mFailed! Submodule 'miniupnp' not found!\033[0m"
echo -e "\033[31mTry to run: 'git submodule update --init'\033[0m"
exit
fi
if [ -z "$ANDROID_HOME" -a "$ANDROID_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_HOME is empty. Run 'export ANDROID_HOME=[PATH_TO_NDK]'\033[0m"
exit
fi
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit
fi
}
function build {
for arg in "$@"; do
case "$arg" in
x86_64)
API=21
CPU=x86_64
build_one
;;
arm64)
API=21
CPU=arm64-v8a
build_one
;;
arm)
API=16
CPU=armeabi-v7a
build_one
;;
x86)
API=16
CPU=x86
build_one
;;
*)
;;
esac
done
}
checkPreRequisites
cd miniupnp/miniupnpc
rm -rf build out
# add cmake from Android SDK to PATH
PATH=$ANDROID_HOME/cmake/$CMAKE_VERSION/bin:$PATH
if (( $# == 0 )); then
build x86_64 arm64 arm x86
else
build $@
fi

View File

@ -1,93 +0,0 @@
#!/bin/bash
set -e
HOST_OS=`uname -a`
function build_one {
mkdir -p out/$CPU
echo "Configuring OpenSSL for $CPU..."
./Configure \
--prefix="$PWD/out/$CPU" \
$TARGET \
no-shared \
no-tests \
-D__ANDROID_API__=$API \
-Wno-macro-redefined
echo "Building OpenSSL for $CPU..."
make -j $(nproc) > out/build.log
make install_sw >> out/build.log
make clean
}
function checkPreRequisites {
if ! [ -d "openssl" ] || ! [ "$(ls -A openssl)" ]; then
echo -e "\033[31mFailed! Submodule 'openssl' not found!\033[0m"
echo -e "\033[31mTry to run: 'git submodule update --init'\033[0m"
exit
fi
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit
fi
}
function build {
for arg in "$@"; do
case "$arg" in
x86_64)
API=21
CPU=x86_64
TARGET=android-x86_64
build_one
;;
arm64)
API=21
CPU=arm64-v8a
TARGET=android-arm64
build_one
;;
arm)
API=16
CPU=armeabi-v7a
TARGET=android-arm
build_one
;;
x86)
API=16
CPU=x86
TARGET=android-x86
build_one
;;
*)
;;
esac
done
}
checkPreRequisites
cd openssl
rm -rf out
if [[ "$HOST_OS" == *"_NT-"* ]]; then
PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin:$PATH
else
PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
fi
if [[ -f 'Makefile' ]]; then
make clean
fi
if (( $# == 0 )); then
build x86_64 arm64 arm x86
else
build $@
fi

@ -1 +0,0 @@
Subproject commit 4163542125925e0b098d43e1471c86e1bd935cdd

@ -1 +0,0 @@
Subproject commit 6576eb611b670c4841cc65095914275d6be008b2

@ -1 +0,0 @@
Subproject commit e04bd3433fd84e1861bf258ea37928d9845e6a86

View File

@ -1 +1 @@
../../../jni/i2pd/contrib/certificates
../../../../binary/jni/i2pd/contrib/certificates

View File

@ -203,7 +203,15 @@ public class DaemonWrapper {
}
private void processAssets() {
File holderFile = new File(i2pdpath, "assets.ready");
// Checking if application folder exists, and create it if not
Log.d(TAG, "checking app directory");
File appPath = new File(i2pdpath);
if (!appPath.exists()) {
boolean result = appPath.mkdir();
Log.d(TAG, "appPath.mkdir() returned " + result + " for " + appPath);
}
File holderFile = new File(appPath, "assets.ready");
String versionName = BuildConfig.VERSION_NAME; // here will be app version, like 2.XX.XX
StringBuilder text = new StringBuilder();
Log.d(TAG, "checking assets");
@ -246,7 +254,7 @@ public class DaemonWrapper {
boolean deleteResult = holderFile.delete();
if (!deleteResult)
Log.e(TAG, "holderFile.delete() returned " + deleteResult + ", absolute path='" + holderFile.getAbsolutePath() + "'");
File certPath = new File(i2pdpath, "certificates");
File certPath = new File(appPath, "certificates");
deleteRecursive(certPath);
// copy assets. If processed file exists, it won't be overwritten
@ -254,7 +262,6 @@ public class DaemonWrapper {
copyAsset("certificates");
copyAsset("tunnels.d");
copyAsset("i2pd.conf");
copyAsset("subscriptions.txt");
copyAsset("tunnels.conf");
// update holder file about successful copying

View File

@ -4,9 +4,6 @@ LOCAL_MODULE := i2pd
LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_C_INCLUDES += $(IFADDRS_PATH) $(LIB_SRC_PATH) $(LIB_CLIENT_SRC_PATH) $(LANG_SRC_PATH) $(DAEMON_SRC_PATH)
LOCAL_STATIC_LIBRARIES := \
boost_system \
boost_date_time \
boost_filesystem \
boost_program_options \
crypto \
ssl \
@ -29,27 +26,6 @@ LOCAL_SRC_FILES := \
include $(BUILD_EXECUTABLE)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_system
LOCAL_SRC_FILES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/lib/libboost_system.a
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_date_time
LOCAL_SRC_FILES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/lib/libboost_date_time.a
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_filesystem
LOCAL_SRC_FILES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/lib/libboost_filesystem.a
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/build/out/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_program_options

View File

@ -1 +0,0 @@
../../app/jni/android-ifaddrs

@ -0,0 +1 @@
Subproject commit f302cc7ead971d4068661d34c2f3ba06063d8ea2

View File

@ -1 +0,0 @@
../../app/jni/boost

1
binary/jni/boost Submodule

@ -0,0 +1 @@
Subproject commit 51924ec5533a4fefb5edf99feaeded794c06a4fb

103
binary/jni/build.sh Executable file
View File

@ -0,0 +1,103 @@
#!/bin/bash
# https://stackoverflow.com/a/246128
SOURCE="${0}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
# Checking Android SDK
if [ -z "$ANDROID_HOME" -a "$ANDROID_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_HOME is empty. Run 'export ANDROID_HOME=[PATH_TO_SDK]'\033[0m"
exit
fi
# Checking Android NDK
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit 1
fi
_NDK_OPTS="-j `nproc` NDK_MODULE_PATH=$DIR"
_help()
{
echo "Syntax: $(basename "$SOURCE") [-m|d|s|h|v]"
echo "Options:"
echo "b Build binary."
echo "d Debug build."
echo "s Strip binaries."
echo "x Skip libraries rebuild."
echo "v Verbose NDK output."
echo "h Print this Help."
echo
}
_failed()
{
echo "Compilation failed";
exit 1;
}
while getopts ":dbsvxh" option; do
case $option in
d) # debug build
_NDK_OPTS="$_NDK_OPTS NDK_DEBUG=1"
;;
b) # build binary
_BINARY=1
;;
s) # strip binaries
_STRIP=1
;;
x) # skip libraries rebuild
_SKIP_LIBS=1
;;
v) # verbose output
_NDK_OPTS="$_NDK_OPTS V=1 NDK_LOG=1"
;;
h) # display help
_help
exit;;
\?) # Invalid option
echo "Error: Invalid option. Use $(basename "$SOURCE") -h for help"
exit;;
esac
done
# Building
if [ -z "$_SKIP_LIBS" ]; then
echo "Building boost..."
./build_boost.sh
[ $? -ne 0 ] && _failed
echo "Building openssl..."
./build_openssl.sh
[ $? -ne 0 ] && _failed
echo "Building miniupnpc..."
./build_miniupnpc.sh
[ $? -ne 0 ] && _failed
fi
if [ ! -z "$_BINARY" ]; then
echo "Building i2pd..."
$ANDROID_NDK_HOME/ndk-build $_NDK_OPTS
fi
echo "Processing binaries (if requested)..."
pushd $DIR/../libs > /dev/null
for xarch in $(ls .); do
if [ ! -z "$_STRIP" ]; then
$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip -s $xarch/i2pd
fi
if [ ! -z "$_MODULE" ]; then
mv $xarch/i2pd $xarch/libi2pd.so
fi
done
popd > /dev/null
echo "Compilation finished"

View File

@ -1 +0,0 @@
../../app/jni/build_boost.sh

79
binary/jni/build_boost.sh Executable file
View File

@ -0,0 +1,79 @@
#!/bin/bash
set -e
BOOST_VERSION=1.84.0
BOOST_LIBS=program_options
function build_one {
echo "Configuring and building..."
CXXFLAGS="-std=c++14" \
NCPU=$(nproc) \
./build-android.sh \
--boost=$BOOST_VERSION \
--arch=$CPU \
--target-version=$API \
--with-libraries=$BOOST_LIBS \
--layout=system \
$ANDROID_NDK_HOME
}
function checkPreRequisites {
if ! [ -d "boost" ] || ! [ "$(ls -A boost)" ]; then
echo -e "\033[31mFailed! Submodule 'boost' not found!\033[0m"
echo -e "\033[31mTry to run: 'git submodule update --init'\033[0m"
exit
fi
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit
fi
}
function build {
for arg in "$@"; do
case "$arg" in
x86_64)
API=21
TARGET=x86_64
build_one
;;
arm64)
API=21
CPU=arm64-v8a
build_one
;;
x86)
API=16
CPU=x86
build_one
;;
arm)
API=16
CPU=armeabi-v7a
build_one
;;
all)
API=16
build_one
;;
*)
;;
esac
done
}
checkPreRequisites
cd boost
# disable verbose output
sed -i -E -e 's/d\+2/d\+0/' build-android.sh
if (( $# == 0 )); then
build all
else
build $@
fi

View File

@ -1 +0,0 @@
../../app/jni/build_miniupnpc.sh

92
binary/jni/build_miniupnpc.sh Executable file
View File

@ -0,0 +1,92 @@
#!/bin/bash
set -e
CMAKE_VERSION=3.22.1
function build_one {
mkdir -p build out/$CPU
cd build
cmake \
-G "Unix Makefiles" \
-DUPNPC_BUILD_SHARED=False \
-DUPNPC_BUILD_TESTS=False \
-DUPNPC_BUILD_SAMPLE=False \
-DANDROID_NATIVE_API_LEVEL=$API \
-DANDROID_ABI=$CPU \
-DCMAKE_BUILD_TYPE=Release \
-DANDROID_NDK=$ANDROID_NDK_HOME \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=../out/$CPU \
..
echo "Building..."
cmake --build . -- libminiupnpc-static
make install
cd ..
rm -rf build
}
function checkPreRequisites {
if ! [ -d "miniupnp" ] || ! [ "$(ls -A miniupnp)" ]; then
echo -e "\033[31mFailed! Submodule 'miniupnp' not found!\033[0m"
echo -e "\033[31mTry to run: 'git submodule update --init'\033[0m"
exit
fi
if [ -z "$ANDROID_HOME" -a "$ANDROID_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_HOME is empty. Run 'export ANDROID_HOME=[PATH_TO_SDK]'\033[0m"
exit
fi
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit
fi
}
function build {
for arg in "$@"; do
case "$arg" in
x86_64)
API=21
CPU=x86_64
build_one
;;
arm64)
API=21
CPU=arm64-v8a
build_one
;;
arm)
API=16
CPU=armeabi-v7a
build_one
;;
x86)
API=16
CPU=x86
build_one
;;
*)
;;
esac
done
}
checkPreRequisites
cd miniupnp/miniupnpc
rm -rf build out
# add cmake from Android SDK to PATH
PATH=$ANDROID_HOME/cmake/$CMAKE_VERSION/bin:$PATH
if (( $# == 0 )); then
build x86_64 arm64 arm x86
else
build $@
fi

View File

@ -1 +0,0 @@
../../app/jni/build_openssl.sh

93
binary/jni/build_openssl.sh Executable file
View File

@ -0,0 +1,93 @@
#!/bin/bash
set -e
HOST_OS=`uname -a`
function build_one {
mkdir -p out/$CPU
echo "Configuring OpenSSL for $CPU..."
./Configure \
--prefix="$PWD/out/$CPU" \
$TARGET \
no-shared \
no-tests \
-D__ANDROID_API__=$API \
-Wno-macro-redefined
echo "Building OpenSSL for $CPU..."
make -j $(nproc) > out/build.log
make install_sw >> out/build.log
make clean
}
function checkPreRequisites {
if ! [ -d "openssl" ] || ! [ "$(ls -A openssl)" ]; then
echo -e "\033[31mFailed! Submodule 'openssl' not found!\033[0m"
echo -e "\033[31mTry to run: 'git submodule update --init'\033[0m"
exit
fi
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit
fi
}
function build {
for arg in "$@"; do
case "$arg" in
x86_64)
API=21
CPU=x86_64
TARGET=android-x86_64
build_one
;;
arm64)
API=21
CPU=arm64-v8a
TARGET=android-arm64
build_one
;;
arm)
API=16
CPU=armeabi-v7a
TARGET=android-arm
build_one
;;
x86)
API=16
CPU=x86
TARGET=android-x86
build_one
;;
*)
;;
esac
done
}
checkPreRequisites
cd openssl
rm -rf out
if [[ "$HOST_OS" == *"_NT-"* ]]; then
PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin:$PATH
else
PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
fi
if [[ -f 'Makefile' ]]; then
make clean
fi
if (( $# == 0 )); then
build x86_64 arm64 arm x86
else
build $@
fi

View File

@ -1 +0,0 @@
../../app/jni/i2pd

1
binary/jni/i2pd Submodule

@ -0,0 +1 @@
Subproject commit fb90b01f6c2f71831f854b3f43fc79fde246ee33

View File

@ -1 +0,0 @@
../../app/jni/miniupnp

1
binary/jni/miniupnp Submodule

@ -0,0 +1 @@
Subproject commit 6576eb611b670c4841cc65095914275d6be008b2

View File

@ -1 +0,0 @@
../../app/jni/openssl

1
binary/jni/openssl Submodule

@ -0,0 +1 @@
Subproject commit e04bd3433fd84e1861bf258ea37928d9845e6a86

0
binary/libs/.gitkeep Normal file
View File

View File

@ -0,0 +1,2 @@
* Updated codebase to 2.53.0
* Change application service algorithm to work with binary instead of library. More changes about status in main activity are pending

View File

@ -0,0 +1,2 @@
* Updated codebase to 2.53.1
* Revert to usage of the JNI

View File

@ -0,0 +1 @@
* Updated codebase to 2.54.0

View File

@ -0,0 +1 @@
* Updated codebase to 2.55.0

View File

@ -0,0 +1 @@
* Updated codebase to 2.56.0