Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
env:
MIERU_VERSION: v3.34.0
HYSTERIA_VERSION: v2.9.2
NAIVE_VERSION: v149.0.7827.114-1
permissions:
contents: read
jobs:
Expand Down Expand Up @@ -44,14 +45,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v5
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
Comment thread
hawkff marked this conversation as resolved.
- name: Install Golang
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-go@v6
Expand All @@ -63,6 +64,9 @@ jobs:
- name: Hysteria2 Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib hysteria2
- name: Naive Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib naive
build:
name: Build OSS APK
runs-on: ubuntu-latest
Expand All @@ -83,18 +87,18 @@ jobs:
app/libs/libcore.aar
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: sidecars-cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
- name: Verify Sidecar Artifacts
run: |
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
for so in libmieru.so libhysteria2.so; do
for so in libmieru.so libhysteria2.so libnaive.so; do
if [ ! -f "app/executableSo/$abi/$so" ]; then
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
exit 1
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
env:
MIERU_VERSION: v3.34.0
HYSTERIA_VERSION: v2.9.2
NAIVE_VERSION: v149.0.7827.114-1
permissions:
contents: read
jobs:
Expand Down Expand Up @@ -49,14 +50,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v5
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars-ci
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars-ci
Comment thread
hawkff marked this conversation as resolved.
- name: Install Golang
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-go@v6
Expand All @@ -68,6 +69,9 @@ jobs:
- name: Hysteria2 Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib hysteria2
- name: Naive Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib naive
build:
name: Build OSS APK
runs-on: ubuntu-latest
Expand All @@ -93,18 +97,18 @@ jobs:
app/libs/libcore.aar
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}-ci
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: sidecars-cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars-ci
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars-ci
- name: Verify Sidecar Artifacts
run: |
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
for so in libmieru.so libhysteria2.so; do
for so in libmieru.so libhysteria2.so libnaive.so; do
if [ ! -f "app/executableSo/$abi/$so" ]; then
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
exit 1
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
env:
MIERU_VERSION: v3.34.0
HYSTERIA_VERSION: v2.9.2
NAIVE_VERSION: v149.0.7827.114-1
permissions:
contents: read
jobs:
Expand Down Expand Up @@ -40,14 +41,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v5
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
- name: Install Golang
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-go@v6
Expand All @@ -59,6 +60,9 @@ jobs:
- name: Hysteria2 Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib hysteria2
- name: Naive Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib naive
build:
name: Build OSS APK
runs-on: ubuntu-latest
Expand All @@ -79,18 +83,18 @@ jobs:
app/libs/libcore.aar
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: sidecars-cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
- name: Verify Sidecar Artifacts
run: |
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
for so in libmieru.so libhysteria2.so; do
for so in libmieru.so libhysteria2.so libnaive.so; do
if [ ! -f "app/executableSo/$abi/$so" ]; then
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
exit 1
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
MIERU_VERSION: v3.34.0
HYSTERIA_VERSION: v2.9.2
NAIVE_VERSION: v149.0.7827.114-1
permissions:
contents: write
jobs:
Expand Down Expand Up @@ -46,14 +47,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v5
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
Comment thread
hawkff marked this conversation as resolved.
- name: Install Golang
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-go@v6
Expand All @@ -65,6 +66,9 @@ jobs:
- name: Hysteria2 Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib hysteria2
- name: Naive Download
if: steps.cache.outputs.cache-hit != 'true'
run: ./run lib naive
build:
name: Build OSS APK
runs-on: ubuntu-latest
Expand All @@ -85,18 +89,18 @@ jobs:
app/libs/libcore.aar
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
- name: Sidecars Status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
- name: Sidecars Cache
id: sidecars-cache
uses: actions/cache@v5
with:
path: |
app/executableSo
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-sidecars
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
- name: Verify Sidecar Artifacts
run: |
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
for so in libmieru.so libhysteria2.so; do
for so in libmieru.so libhysteria2.so libnaive.so; do
if [ ! -f "app/executableSo/$abi/$so" ]; then
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
exit 1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ source version. Please do not download it.**
* MasterDnsVPN (DNS-tunnel, bundled)
* Mieru (bundled)
* Trojan-Go (trojan-go-plugin)
* NaïveProxy (naive-plugin)
* NaïveProxy (bundled)

<details>
<summary>XHTTP Extra TLS configuration example</summary>
Expand Down Expand Up @@ -188,7 +188,7 @@ source version. Please do not download it.**
</code></pre>
</details>

Trojan-Go and NaïveProxy require their external plugins for full proxy support.
Trojan-Go requires its external plugin for full proxy support.

## Supported Subscription Format

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ object PluginManager {
"hysteria-plugin" -> soIfExist("libhysteria.so")
"hysteria2-plugin" -> soIfExist("libhysteria2.so")
"mieru-plugin" -> soIfExist("libmieru.so")
"naive-plugin" -> soIfExist("libnaive.so")
else -> null
}
}
Expand Down
46 changes: 46 additions & 0 deletions buildScript/lib/naive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
# Extract the official naiveproxy client binary from klzgrad/naiveproxy plugin
# APKs and install it as a bundled native executable
# (app/executableSo/<abi>/libnaive.so).
#
# This lets NekoBox run NaïveProxy profiles without installing the separate
# external plugin (moe.matsuri.exe.naive). PluginManager.initNativeInternal
# resolves "naive-plugin" -> libnaive.so from nativeLibraryDir, mirroring the
# bundled Mieru / Hysteria mechanism, and falls back to the external APK plugin
# when the bundled binary is absent.
#
# Usage: ./run lib naive
set -e
set -o pipefail

# Pinned naiveproxy release.
NAIVE_VERSION="${NAIVE_VERSION:-v149.0.7827.114-1}"
BASE="https://github.com/klzgrad/naiveproxy/releases/download/${NAIVE_VERSION}"

OUT="$(pwd)/app/executableSo"
WORK="$(pwd)/.naive-build"
mkdir -p "$WORK"

# Map Android ABI -> naiveproxy plugin APK ABI tag (identical here).
extract_abi() {
local abi="$1"
local apk="naiveproxy-plugin-${NAIVE_VERSION}-${abi}.apk"
echo ">> fetching libnaive.so for $abi ($apk)"
curl -fL --retry 3 --retry-delay 2 --max-time 300 "$BASE/$apk" -o "$WORK/$apk"
mkdir -p "$OUT/$abi"
# The plugin APK ships the client as lib/<abi>/libnaive.so.
unzip -o -j "$WORK/$apk" "lib/$abi/libnaive.so" -d "$OUT/$abi" >/dev/null
if [ ! -f "$OUT/$abi/libnaive.so" ]; then
echo "Error: libnaive.so not found in $apk" >&2
exit 1
fi
chmod +x "$OUT/$abi/libnaive.so"
}

extract_abi "arm64-v8a"
extract_abi "armeabi-v7a"
extract_abi "x86"
extract_abi "x86_64"

echo ">> installed naive binaries:"
ls -la "$OUT"/*/libnaive.so
Loading