ndkbuild hev-socks5-tunnel (#4800)
This commit is contained in:
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -31,19 +31,19 @@ jobs:
|
|||||||
- name: Install NDK
|
- name: Install NDK
|
||||||
run: |
|
run: |
|
||||||
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
|
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
|
||||||
--channel=3 \
|
--channel=0 \
|
||||||
--install "ndk;29.0.13113456"
|
--install "ndk;28.2.13676358"
|
||||||
echo "NDK_HOME=$ANDROID_HOME/ndk/29.0.13113456" >> $GITHUB_ENV
|
echo "NDK_HOME=$ANDROID_HOME/ndk/28.2.13676358" >> $GITHUB_ENV
|
||||||
sed -i '10i\
|
sed -i '10i\
|
||||||
\
|
\
|
||||||
ndkVersion = "29.0.13113456"' ${{ github.workspace }}/V2rayNG/app/build.gradle.kts
|
ndkVersion = "28.2.13676358"' ${{ github.workspace }}/V2rayNG/app/build.gradle.kts
|
||||||
|
|
||||||
- name: Restore cached libtun2socks
|
- name: Restore cached libtun2socks
|
||||||
id: cache-libtun2socks-restore
|
id: cache-libtun2socks-restore
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/libs
|
path: ${{ github.workspace }}/libs
|
||||||
key: libtun2socks-${{ runner.os }}-${{ env.NDK_HOME }}-${{ hashFiles('.git/modules/badvpn/HEAD') }}-${{ hashFiles('.git/modules/libancillary/HEAD') }}
|
key: libtun2socks-${{ runner.os }}-${{ env.NDK_HOME }}-${{ hashFiles('.git/modules/hev-socks5-tunnel/HEAD') }}-${{ hashFiles('.git/modules/badvpn/HEAD') }}-${{ hashFiles('.git/modules/libancillary/HEAD') }}
|
||||||
|
|
||||||
- name: Build libtun2socks
|
- name: Build libtun2socks
|
||||||
if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true'
|
if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true'
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/libs
|
path: ${{ github.workspace }}/libs
|
||||||
key: libtun2socks-${{ runner.os }}-${{ env.NDK_HOME }}-${{ hashFiles('.git/modules/badvpn/HEAD') }}-${{ hashFiles('.git/modules/libancillary/HEAD') }}
|
key: libtun2socks-${{ runner.os }}-${{ env.NDK_HOME }}-${{ hashFiles('.git/modules/hev-socks5-tunnel/HEAD') }}-${{ hashFiles('.git/modules/badvpn/HEAD') }}-${{ hashFiles('.git/modules/libancillary/HEAD') }}
|
||||||
|
|
||||||
- name: Copy libtun2socks
|
- name: Copy libtun2socks
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -10,3 +10,7 @@
|
|||||||
[submodule "libancillary"]
|
[submodule "libancillary"]
|
||||||
path = libancillary
|
path = libancillary
|
||||||
url = https://github.com/shadowsocks/libancillary
|
url = https://github.com/shadowsocks/libancillary
|
||||||
|
[submodule "hev-socks5-tunnel"]
|
||||||
|
path = hev-socks5-tunnel
|
||||||
|
url = https://github.com/heiher/hev-socks5-tunnel
|
||||||
|
branch = master
|
||||||
|
|||||||
@@ -30,3 +30,29 @@ $NDK_HOME/ndk-build \
|
|||||||
cp -r $TMPDIR/libs $__dir/
|
cp -r $TMPDIR/libs $__dir/
|
||||||
popd
|
popd
|
||||||
rm -rf $TMPDIR
|
rm -rf $TMPDIR
|
||||||
|
|
||||||
|
#build hev-socks5-tunnel
|
||||||
|
HEVTUN_TMP=$(mktemp -d)
|
||||||
|
trap 'rm -rf "$HEVTUN_TMP"' EXIT
|
||||||
|
|
||||||
|
mkdir -p "$HEVTUN_TMP/jni"
|
||||||
|
pushd "$HEVTUN_TMP"
|
||||||
|
|
||||||
|
echo 'include $(call all-subdir-makefiles)' > jni/Android.mk
|
||||||
|
|
||||||
|
ln -s "$__dir/hev-socks5-tunnel" jni/hev-socks5-tunnel
|
||||||
|
|
||||||
|
"$NDK_HOME/ndk-build" \
|
||||||
|
NDK_PROJECT_PATH=. \
|
||||||
|
APP_BUILD_SCRIPT=jni/Android.mk \
|
||||||
|
"APP_ABI=armeabi-v7a arm64-v8a x86 x86_64" \
|
||||||
|
APP_PLATFORM=android-21 \
|
||||||
|
NDK_LIBS_OUT="$HEVTUN_TMP/libs" \
|
||||||
|
NDK_OUT="$HEVTUN_TMP/tmp" \
|
||||||
|
"APP_CFLAGS=O3 -DPKGNAME=com/v2ray/ang/service" \
|
||||||
|
"APP_LDFLAGS=-WI,--build-id=none -WI,--hash-style=gnu" \
|
||||||
|
|
||||||
|
cp -r "$HEVTUN_TMP/libs/"* "$__dir/libs/"
|
||||||
|
popd
|
||||||
|
|
||||||
|
rm -rf "$HEVTUN_TMP"
|
||||||
1
hev-socks5-tunnel
Submodule
1
hev-socks5-tunnel
Submodule
Submodule hev-socks5-tunnel added at f2cbad55b6
Reference in New Issue
Block a user