Skip to content

Commit 80a573f

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/hy2-gecko-native
# Conflicts: # app/src/main/java/io/nekohasekai/sagernet/bg/proto/BoxInstance.kt
2 parents a9e4943 + 3f82b8e commit 80a573f

26 files changed

Lines changed: 1140 additions & 50 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
env:
1010
MIERU_VERSION: v3.34.0
1111
HYSTERIA_VERSION: v2.9.2
12+
MDVPN_REF: android-vpnservice-protect-hook
13+
MDVPN_COMMIT: d481d72d4b86783a87d536c214d2c68cc4e9320e
1214
NAIVE_VERSION: v149.0.7827.114-1
1315
permissions:
1416
contents: read
@@ -25,7 +27,7 @@ jobs:
2527
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
2628
- name: LibCore Cache
2729
id: cache
28-
uses: actions/cache@v5
30+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
2931
with:
3032
path: |
3133
app/libs/libcore.aar
@@ -45,14 +47,14 @@ jobs:
4547
- name: Checkout
4648
uses: actions/checkout@v5
4749
- name: Sidecars Status
48-
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
50+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
4951
- name: Sidecars Cache
5052
id: cache
51-
uses: actions/cache@v5
53+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
5254
with:
5355
path: |
5456
app/executableSo
55-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
57+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
5658
- name: Install Golang
5759
if: steps.cache.outputs.cache-hit != 'true'
5860
uses: actions/setup-go@v6
@@ -64,6 +66,9 @@ jobs:
6466
- name: Hysteria2 Download
6567
if: steps.cache.outputs.cache-hit != 'true'
6668
run: ./run lib hysteria2
69+
- name: MasterDnsVPN Build
70+
if: steps.cache.outputs.cache-hit != 'true'
71+
run: ./run lib masterdnsvpn
6772
- name: Naive Download
6873
if: steps.cache.outputs.cache-hit != 'true'
6974
run: ./run lib naive
@@ -81,32 +86,32 @@ jobs:
8186
- name: Libcore Status
8287
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
8388
- name: LibCore Cache
84-
uses: actions/cache@v5
89+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
8590
with:
8691
path: |
8792
app/libs/libcore.aar
8893
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
8994
- name: Sidecars Status
90-
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
95+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
9196
- name: Sidecars Cache
9297
id: sidecars-cache
93-
uses: actions/cache@v5
98+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
9499
with:
95100
path: |
96101
app/executableSo
97-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
102+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
98103
- name: Verify Sidecar Artifacts
99104
run: |
100105
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
101-
for so in libmieru.so libhysteria2.so libnaive.so; do
106+
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
102107
if [ ! -f "app/executableSo/$abi/$so" ]; then
103108
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
104109
exit 1
105110
fi
106111
done
107112
done
108113
- name: Gradle cache
109-
uses: actions/cache@v5
114+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
110115
with:
111116
path: ~/.gradle
112117
key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }}

.github/workflows/ci.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
env:
1010
MIERU_VERSION: v3.34.0
1111
HYSTERIA_VERSION: v2.9.2
12+
MDVPN_REF: android-vpnservice-protect-hook
13+
MDVPN_COMMIT: d481d72d4b86783a87d536c214d2c68cc4e9320e
1214
NAIVE_VERSION: v149.0.7827.114-1
1315
permissions:
1416
contents: read
@@ -30,7 +32,7 @@ jobs:
3032
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
3133
- name: LibCore Cache
3234
id: cache
33-
uses: actions/cache@v5
35+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
3436
with:
3537
path: |
3638
app/libs/libcore.aar
@@ -50,14 +52,14 @@ jobs:
5052
- name: Checkout
5153
uses: actions/checkout@v5
5254
- name: Sidecars Status
53-
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
55+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
5456
- name: Sidecars Cache
5557
id: cache
56-
uses: actions/cache@v5
58+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
5759
with:
5860
path: |
5961
app/executableSo
60-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars-ci
62+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars-ci
6163
- name: Install Golang
6264
if: steps.cache.outputs.cache-hit != 'true'
6365
uses: actions/setup-go@v6
@@ -69,6 +71,9 @@ jobs:
6971
- name: Hysteria2 Download
7072
if: steps.cache.outputs.cache-hit != 'true'
7173
run: ./run lib hysteria2
74+
- name: MasterDnsVPN Build
75+
if: steps.cache.outputs.cache-hit != 'true'
76+
run: ./run lib masterdnsvpn
7277
- name: Naive Download
7378
if: steps.cache.outputs.cache-hit != 'true'
7479
run: ./run lib naive
@@ -91,32 +96,32 @@ jobs:
9196
- name: Libcore Status
9297
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
9398
- name: LibCore Cache
94-
uses: actions/cache@v5
99+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
95100
with:
96101
path: |
97102
app/libs/libcore.aar
98103
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}-ci
99104
- name: Sidecars Status
100-
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
105+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
101106
- name: Sidecars Cache
102107
id: sidecars-cache
103-
uses: actions/cache@v5
108+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
104109
with:
105110
path: |
106111
app/executableSo
107-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars-ci
112+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars-ci
108113
- name: Verify Sidecar Artifacts
109114
run: |
110115
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
111-
for so in libmieru.so libhysteria2.so libnaive.so; do
116+
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
112117
if [ ! -f "app/executableSo/$abi/$so" ]; then
113118
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
114119
exit 1
115120
fi
116121
done
117122
done
118123
- name: Gradle cache
119-
uses: actions/cache@v5
124+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
120125
with:
121126
path: ~/.gradle
122127
key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }}-ci
@@ -132,8 +137,8 @@ jobs:
132137
APK=$(find app/build/outputs/apk -name '*arm64-v8a*.apk')
133138
APK=$(dirname $APK)
134139
echo "APK=$APK" >> $GITHUB_ENV
135-
# - name: Upload Artifacts
136-
# uses: actions/upload-artifact@v5
137-
# with:
138-
# name: APKs
139-
# path: ${{ env.APK }}
140+
- name: Upload Artifacts
141+
uses: actions/upload-artifact@v5
142+
with:
143+
name: NekoBox-debug-apks
144+
path: ${{ env.APK }}

.github/workflows/preview.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
env:
66
MIERU_VERSION: v3.34.0
77
HYSTERIA_VERSION: v2.9.2
8+
MDVPN_REF: android-vpnservice-protect-hook
9+
MDVPN_COMMIT: d481d72d4b86783a87d536c214d2c68cc4e9320e
810
NAIVE_VERSION: v149.0.7827.114-1
911
permissions:
1012
contents: read
@@ -21,7 +23,7 @@ jobs:
2123
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
2224
- name: LibCore Cache
2325
id: cache
24-
uses: actions/cache@v5
26+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
2527
with:
2628
path: |
2729
app/libs/libcore.aar
@@ -41,14 +43,14 @@ jobs:
4143
- name: Checkout
4244
uses: actions/checkout@v5
4345
- name: Sidecars Status
44-
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
46+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
4547
- name: Sidecars Cache
4648
id: cache
47-
uses: actions/cache@v5
49+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
4850
with:
4951
path: |
5052
app/executableSo
51-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
53+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
5254
- name: Install Golang
5355
if: steps.cache.outputs.cache-hit != 'true'
5456
uses: actions/setup-go@v6
@@ -60,6 +62,9 @@ jobs:
6062
- name: Hysteria2 Download
6163
if: steps.cache.outputs.cache-hit != 'true'
6264
run: ./run lib hysteria2
65+
- name: MasterDnsVPN Build
66+
if: steps.cache.outputs.cache-hit != 'true'
67+
run: ./run lib masterdnsvpn
6368
- name: Naive Download
6469
if: steps.cache.outputs.cache-hit != 'true'
6570
run: ./run lib naive
@@ -77,32 +82,32 @@ jobs:
7782
- name: Libcore Status
7883
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
7984
- name: LibCore Cache
80-
uses: actions/cache@v5
85+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
8186
with:
8287
path: |
8388
app/libs/libcore.aar
8489
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
8590
- name: Sidecars Status
86-
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
91+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
8792
- name: Sidecars Cache
8893
id: sidecars-cache
89-
uses: actions/cache@v5
94+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
9095
with:
9196
path: |
9297
app/executableSo
93-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
98+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
9499
- name: Verify Sidecar Artifacts
95100
run: |
96101
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
97-
for so in libmieru.so libhysteria2.so libnaive.so; do
102+
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
98103
if [ ! -f "app/executableSo/$abi/$so" ]; then
99104
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
100105
exit 1
101106
fi
102107
done
103108
done
104109
- name: Gradle cache
105-
uses: actions/cache@v5
110+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
106111
with:
107112
path: ~/.gradle
108113
key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }}

.github/workflows/release.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ on:
1111
env:
1212
MIERU_VERSION: v3.34.0
1313
HYSTERIA_VERSION: v2.9.2
14+
MDVPN_REF: android-vpnservice-protect-hook
15+
MDVPN_COMMIT: d481d72d4b86783a87d536c214d2c68cc4e9320e
1416
NAIVE_VERSION: v149.0.7827.114-1
1517
permissions:
16-
contents: write
18+
contents: read
1719
jobs:
1820
libcore:
1921
name: Native Build (LibCore)
@@ -27,7 +29,7 @@ jobs:
2729
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
2830
- name: LibCore Cache
2931
id: cache
30-
uses: actions/cache@v5
32+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
3133
with:
3234
path: |
3335
app/libs/libcore.aar
@@ -47,14 +49,14 @@ jobs:
4749
- name: Checkout
4850
uses: actions/checkout@v5
4951
- name: Sidecars Status
50-
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
52+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
5153
- name: Sidecars Cache
5254
id: cache
53-
uses: actions/cache@v5
55+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
5456
with:
5557
path: |
5658
app/executableSo
57-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
59+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
5860
- name: Install Golang
5961
if: steps.cache.outputs.cache-hit != 'true'
6062
uses: actions/setup-go@v6
@@ -66,6 +68,9 @@ jobs:
6668
- name: Hysteria2 Download
6769
if: steps.cache.outputs.cache-hit != 'true'
6870
run: ./run lib hysteria2
71+
- name: MasterDnsVPN Build
72+
if: steps.cache.outputs.cache-hit != 'true'
73+
run: ./run lib masterdnsvpn
6974
- name: Naive Download
7075
if: steps.cache.outputs.cache-hit != 'true'
7176
run: ./run lib naive
@@ -83,32 +88,32 @@ jobs:
8388
- name: Libcore Status
8489
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
8590
- name: LibCore Cache
86-
uses: actions/cache@v5
91+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
8792
with:
8893
path: |
8994
app/libs/libcore.aar
9095
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
9196
- name: Sidecars Status
92-
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
97+
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
9398
- name: Sidecars Cache
9499
id: sidecars-cache
95-
uses: actions/cache@v5
100+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
96101
with:
97102
path: |
98103
app/executableSo
99-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.NAIVE_VERSION }}-sidecars
104+
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
100105
- name: Verify Sidecar Artifacts
101106
run: |
102107
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
103-
for so in libmieru.so libhysteria2.so libnaive.so; do
108+
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
104109
if [ ! -f "app/executableSo/$abi/$so" ]; then
105110
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
106111
exit 1
107112
fi
108113
done
109114
done
110115
- name: Gradle cache
111-
uses: actions/cache@v5
116+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
112117
with:
113118
path: ~/.gradle
114119
key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }}
@@ -132,6 +137,8 @@ jobs:
132137
name: Publish Release
133138
if: github.event.inputs.publish != 'y'
134139
runs-on: namespace-profile-nekoyay
140+
permissions:
141+
contents: write
135142
needs: build
136143
steps:
137144
- name: Checkout

0 commit comments

Comments
 (0)