Skip to content

Commit

Permalink
[chore] update i2pd to 2.53.0, change build script
Browse files Browse the repository at this point in the history
Signed-off-by: r4sas <[email protected]>
  • Loading branch information
r4sas committed Jul 21, 2024
1 parent 988940f commit 031c536
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 62 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ obj
.externalNativeBuild
ant.properties
local.properties
build.sh
android.iml
build
*.iml
Expand Down
2 changes: 1 addition & 1 deletion app/jni/build_miniupnpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function checkPreRequisites {
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"
echo -e "\033[31mFailed! ANDROID_HOME is empty. Run 'export ANDROID_HOME=[PATH_TO_SDK]'\033[0m"
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion app/jni/i2pd
Submodule i2pd updated 54 files
+26 −0 ChangeLog
+1 −1 build/win_installer.iss
+3 −3 contrib/apparmor/usr.bin.i2pd
+0 −32 contrib/certificates/reseed/ls_at_mail.i2p.crt
+2 −2 contrib/debian/trusty/patches/02-service.patch
+2 −2 contrib/debian/xenial/patches/02-service.patch
+1 −1 contrib/i2pd.service
+1 −1 contrib/openrc/i2pd.openrc
+6 −3 contrib/rpm/i2pd-git.spec
+6 −3 contrib/rpm/i2pd.spec
+1 −1 contrib/upstart/i2pd.upstart
+1 −1 daemon/Daemon.cpp
+7 −0 daemon/UPnP.cpp
+5 −0 debian/NEWS
+7 −0 debian/changelog
+1 −1 debian/i2pd.init
+2 −2 debian/i2pd.install
+0 −137 libi2pd/ChaCha20.cpp
+0 −72 libi2pd/ChaCha20.h
+2 −3 libi2pd/Config.cpp
+1 −112 libi2pd/Crypto.cpp
+7 −94 libi2pd/Crypto.h
+6 −1 libi2pd/Destination.cpp
+7 −3 libi2pd/Destination.h
+6 −4 libi2pd/I2NPProtocol.cpp
+3 −3 libi2pd/I2NPProtocol.h
+12 −4 libi2pd/Identity.cpp
+2 −2 libi2pd/Identity.h
+25 −6 libi2pd/NTCP2.cpp
+2 −1 libi2pd/NTCP2.h
+49 −240 libi2pd/NetDb.cpp
+25 −31 libi2pd/NetDb.hpp
+343 −87 libi2pd/NetDbRequests.cpp
+49 −15 libi2pd/NetDbRequests.h
+0 −25 libi2pd/Poly1305.cpp
+0 −261 libi2pd/Poly1305.h
+11 −2 libi2pd/Profiling.cpp
+4 −0 libi2pd/Profiling.h
+54 −30 libi2pd/RouterContext.cpp
+6 −3 libi2pd/RouterContext.h
+16 −3 libi2pd/RouterInfo.cpp
+4 −1 libi2pd/RouterInfo.h
+130 −88 libi2pd/SSU2.cpp
+10 −3 libi2pd/SSU2.h
+113 −42 libi2pd/SSU2Session.cpp
+6 −1 libi2pd/SSU2Session.h
+165 −39 libi2pd/Streaming.cpp
+18 −7 libi2pd/Streaming.h
+5 −0 libi2pd/Timestamp.cpp
+2 −1 libi2pd/Timestamp.h
+2 −2 libi2pd/Transports.cpp
+13 −5 libi2pd/TunnelPool.cpp
+2 −2 libi2pd/version.h
+1 −0 libi2pd_client/ClientContext.cpp
83 changes: 83 additions & 0 deletions binary/jni/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/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 "m Rename binaries as libraries."
echo "d Debug build."
echo "s Strip binaries."
echo "h Print this Help."
echo "v Verbose NDK output."
echo
}

while getopts ":dmsvh" option; do
case $option in
d) # debug build
_NDK_OPTS="$_NDK_OPTS NDK_DEBUG=1"
;;
m) # make module
_MODULE=1
;;
s) # strip binaries
_STRIP=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
echo Building boost...
./build_boost.sh

echo Building openssl...
./build_openssl.sh

echo Building miniupnpc...
./build_miniupnpc.sh

echo Building i2pd...
$ANDROID_NDK_HOME/ndk-build $_NDK_OPTS

pushd $DIR/../libs
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
23 changes: 0 additions & 23 deletions binary/jni/build_debug.sh

This file was deleted.

20 changes: 0 additions & 20 deletions binary/jni/build_release.sh

This file was deleted.

16 changes: 0 additions & 16 deletions binary/jni/ndkbuild-wrapper.sh

This file was deleted.

0 comments on commit 031c536

Please sign in to comment.