Compare commits

..

224 Commits

Author SHA1 Message Date
clash-meta-maintainer[bot]
a54088edbc Update Dependencies 2026-05-08 10:01:00 +00:00
wwqgtxx
a097966eee remove already applied patch file for go1.26.3 2026-05-08 00:38:34 +08:00
GitHub Action
8851289971 Bump version to 2.11.27 (211027) 2026-04-20 01:45:12 +00:00
clash-meta-maintainer[bot]
750072d7cc Update Dependencies (#697)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-04-20 09:19:30 +08:00
wwqgtxx
066486323b switch to official github action to obtain app token 2026-04-18 22:28:35 +08:00
Zongle Wang
37b8ba6d5c Derive states from MainActivity alias enabled (#703) 2026-04-10 16:41:17 +08:00
Zongle Wang
8453bfc07d Fix crash when Hide App Icon is enabled alongside dynamic shortcuts (#701) 2026-04-10 12:17:41 +08:00
GitHub Action
afd1da50b7 Bump version to 2.11.26 (211026) 2026-04-08 00:59:33 +00:00
clash-meta-maintainer[bot]
3c1cf5b9eb Update Dependencies (#693)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-04-08 07:13:14 +08:00
GitHub Action
ac6f7fe19a Bump version to 2.11.25 (211025) 2026-04-01 05:20:33 +00:00
clash-meta-maintainer[bot]
d1a2a1b745 Update Dependencies (#692)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-04-01 10:42:31 +08:00
clash-meta-maintainer[bot]
6ce881126a Update Dependencies (#688)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-03-30 19:29:39 +08:00
wwqgtxx
71854a9132 switch to our own golang toolchain 2026-03-30 18:54:23 +08:00
wwqgtxx
7c52b36aaa Update update-dependencies.yaml 2026-03-27 20:23:20 +08:00
wwqgtxx
c8fbb363ea update actions version 2026-03-21 17:49:06 +08:00
iKira
acdcd603c5 chore: Adapt the hidden field for proxy groups (#685)
the GUI should not display proxy groups tags where `hidden: true`.
2026-03-20 15:07:00 +08:00
clash-meta-maintainer[bot]
d8e336edf2 Update Dependencies (#680)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-03-20 15:03:14 +08:00
GitHub Action
22f12b7266 Bump version to 2.11.24 (211024) 2026-03-09 16:51:55 +00:00
clash-meta-maintainer[bot]
cc2330c924 Update Dependencies (#664)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-03-10 00:42:20 +08:00
Zongle Wang
98d8b056df Mark MainActivity launched as singleTask (#665) 2026-03-06 09:49:05 +08:00
sleshep
83261bb3f9 Add dynamic App Shortcuts for external automation (Tasker/Samsung Routines) (#676)
Register toggle/start/stop shortcuts via ShortcutManagerCompat on app launch,
enabling Samsung Routines and other launchers to control the Clash service
through long-press app icon shortcuts.

Use launcher icon for shortcut display; suppress activity transitions and
exclude ExternalControlActivity from recents for seamless background control.
2026-03-06 09:39:31 +08:00
wwqgtxx
406e4004f2 Update Proxy.kt 2026-02-25 12:31:56 +08:00
wwqgtxx
5cd01b178a fix seccomp prevented call to disallowed arm system call 422 on 32bits Androids <= 10 2026-02-21 17:53:04 +08:00
wwqgtxx
fb9ffa0b82 update go1.26 2026-02-11 16:58:32 +08:00
Zongle Wang
5e7a01fb60 Bump NDK version to 29.0.14206865 (#667) 2026-02-10 12:05:44 +08:00
Zongle Wang
10d14f8ee0 Remove UseZGC flag from jvmargs (#662) 2026-02-09 20:25:02 +08:00
Zongle Wang
232f318bde Support hiding app from Recents screen (#663) 2026-02-09 15:59:03 +08:00
GitHub Action
bd042125c5 Bump version to 2.11.23 (211023) 2026-02-08 14:49:27 +00:00
wwqgtxx
f16f13b5f2 Update Proxy.kt 2026-02-08 22:48:17 +08:00
clash-meta-maintainer[bot]
cd744af161 Update Dependencies (#654)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-02-08 21:56:20 +08:00
wwqgtxx
6969e1b657 update comment in patchProviders 2026-01-20 14:44:51 +08:00
wwqgtxx
2c106d5a7e using mihomo's entrance for YAML package 2026-01-18 11:08:06 +08:00
GitHub Action
fd7449e939 Bump version to 2.11.22 (211022) 2026-01-16 03:39:04 +00:00
clash-meta-maintainer[bot]
f99c28876b Update Dependencies (#648)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2026-01-16 11:29:29 +08:00
wwqgtxx
8975459dad add check-latest to setup-go action 2026-01-16 08:41:37 +08:00
GitHub Action
9ec91cacf5 Bump version to 2.11.21 (211021) 2025-12-21 13:14:55 +00:00
clash-meta-maintainer[bot]
4496e61cbe Update Dependencies (#641)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-12-21 21:12:44 +08:00
GitHub Action
b93319ba39 Bump version to 2.11.20 (211020) 2025-12-01 01:05:19 +00:00
wwqgtxx
6f78f4aa18 Update Proxy.kt 2025-12-01 08:57:36 +08:00
clash-meta-maintainer[bot]
15de77afe6 Update Dependencies (#633)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-12-01 08:54:17 +08:00
angrylid
ed2f1d70f9 feat: Implement QR Coder scanner (#639)
Co-authored-by: beasonxu <ymwotow411846@gmail.com>
2025-11-30 00:28:24 +08:00
GitHub Action
bb3404a0b0 Bump version to 2.11.19 (211019) 2025-11-09 02:35:47 +00:00
Ran-Mori
e4042d5d9b supports user-defined application_id/package_name (#628) 2025-11-09 10:32:59 +08:00
clash-meta-maintainer[bot]
06677c446e Update Dependencies (#611)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-11-09 10:22:41 +08:00
Ran-Mori
6cf12d4c24 opt: fix readme.md (#627) 2025-11-03 23:59:47 +08:00
wwqgtxx
cd9e586023 follow kernel defaults when overriding dns settings 2025-10-28 15:45:56 +08:00
GitHub Action
f846763814 Bump version to 2.11.18 (211018) 2025-10-14 15:30:23 +00:00
clash-meta-maintainer[bot]
b6393f21d4 Update Dependencies (#604)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-10-14 23:25:10 +08:00
GitHub Action
f2df41f0a6 Bump version to 2.11.17 (211017) 2025-09-24 09:19:58 +00:00
clash-meta-maintainer[bot]
bfff0fe997 Update Dependencies (#602)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-09-24 17:07:14 +08:00
clash-meta-maintainer[bot]
4f8f6b2a8c Update Dependencies (#601)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-09-23 23:25:47 +08:00
clash-meta-maintainer[bot]
b0a9076fcb Update Dependencies (#591)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-09-21 19:42:36 +08:00
xishang0128
f6f410fda8 chore: Changing the User-Agent used to retrieve subscription-userinfo
ClashForWindows is no longer able to retrieve information from some providers.
2025-09-02 03:28:30 +08:00
GitHub Action
fda769cc69 Bump version to 2.11.16 (211016) 2025-08-27 09:46:55 +00:00
clash-meta-maintainer[bot]
7a04dd0e27 Update Dependencies (#579)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-08-27 17:34:26 +08:00
wwqgtxx
f6a4e8987d update go1.25 2025-08-13 18:27:57 +08:00
wwqgtxx
734d0331bc add ca in build actions 2025-08-03 16:38:18 +08:00
GitHub Action
7d9cededeb Bump version to 2.11.15 (211015) 2025-07-27 13:42:58 +00:00
clash-meta-maintainer[bot]
3749da0fbf Update Dependencies (#563)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-07-27 21:04:03 +08:00
ayanamist
61093eb8d6 rewrite dns notify mechanism (#558) 2025-06-29 15:11:16 +08:00
Howard Wu
b2ba3cd20b Update geo file after app updates (#557)
Delete and replace geo files if the app has been updated since the files were last modified. This ensures bundled geo files are refreshed after app updates.
2025-06-29 12:30:01 +08:00
clash-meta-maintainer[bot]
d56d56e2df Update Dependencies (#551)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-06-29 12:24:24 +08:00
ayanamist
99cbc449c2 allow change access packages when vpn enabled (#560) 2025-06-29 12:13:17 +08:00
ayanamist
4ece5c4315 show all internet accessible application packages (#559) 2025-06-29 12:02:07 +08:00
GitHub Action
a597a4611d Bump version to 2.11.14 (211014) 2025-06-25 12:39:31 +00:00
clash-meta-maintainer[bot]
253ae118df Update Dependencies (#548)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-06-25 20:36:35 +08:00
clash-meta-maintainer[bot]
11fe93b8c6 Update Dependencies (#536)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-06-20 09:16:44 +08:00
YuHuanTin
38d0d4397e Fixed the issue with decimal point in Subscription-Userinfo field (#547)
https://github.com/MetaCubeX/ClashMetaForAndroid/discussions/292
2025-06-20 09:06:51 +08:00
GitHub Action
131097a236 Bump version to 2.11.13 (211013) 2025-05-31 07:52:50 +00:00
clash-meta-maintainer[bot]
88c33b1763 Update Dependencies (#533)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-05-31 15:18:56 +08:00
clash-meta-maintainer[bot]
d4ba9fd808 Update Dependencies (#530)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-05-25 01:50:29 +08:00
clash-meta-maintainer[bot]
290d63943f Update Dependencies (#529)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-05-22 11:22:07 +08:00
GitHub Action
a59e87143c Bump version to 2.11.12 (211012) 2025-05-22 02:54:48 +00:00
clash-meta-maintainer[bot]
7178d0f3ec Update Dependencies (#514)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-05-22 10:50:39 +08:00
GitHub Action
618533887d Bump version to 2.11.11 (211011) 2025-05-13 04:32:38 +00:00
clash-meta-maintainer[bot]
adbc68aa62 Update Dependencies (#510)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-05-13 12:23:46 +08:00
GitHub Action
4bf5016921 Bump version to 2.11.10 (211010) 2025-05-10 04:57:24 +00:00
clash-meta-maintainer[bot]
6a9a469073 Update Dependencies (#500)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-05-10 12:43:43 +08:00
GitHub Action
ac6cfa02c8 Bump version to 2.11.9 (211009) 2025-04-21 15:15:17 +00:00
clash-meta-maintainer[bot]
2e852e54f8 Update Dependencies (#493)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-04-21 22:23:12 +08:00
Zongle Wang
309cc6af12 Support opening from app info (#497) 2025-04-17 21:10:49 +08:00
wwqgtxx
39987022c6 fix action 2025-04-10 22:38:44 +08:00
Zongle Wang
6f521d5ac1 Support hiding app icon (#492) 2025-04-10 22:19:19 +08:00
GitHub Action
efb2df507d Bump version to 2.11.8 (211008) 2025-04-01 15:28:37 +00:00
clash-meta-maintainer[bot]
54077cb29f Update Dependencies (#477)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-04-01 22:52:27 +08:00
wwqgtxx
19cc82e0db send all dns server to core 2025-03-17 23:20:44 +08:00
wwqgtxx
4e45661e26 handle ipv6 address's scopeId for dns server 2025-03-17 23:20:44 +08:00
clash-meta-maintainer[bot]
5816076bf6 Update Dependencies (#471)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-03-17 22:00:34 +08:00
clash-meta-maintainer[bot]
59f2a2019e Update Dependencies (#470) 2025-03-11 23:38:04 +08:00
GitHub Action
effbf8f244 Bump version to 2.11.7 (211007) 2025-03-03 04:09:43 +00:00
clash-meta-maintainer[bot]
b240eb7e25 Update Dependencies (#458)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-03-03 12:00:21 +08:00
wwqgtxx
f444075342 update go1.24 2025-02-19 18:30:41 +08:00
clash-meta-maintainer[bot]
a6ceb88956 Update Dependencies (#454)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-02-19 18:18:35 +08:00
ForestL
9db73ea07b fix sniffer.sniff config (#455) 2025-02-19 18:17:56 +08:00
ForestL
356a845b69 hide update function of inline (#415) 2025-02-19 18:15:58 +08:00
汐殇
d344cc8e77 Update Proxy.kt 2025-02-18 16:30:54 +08:00
clash-meta-maintainer[bot]
d8e46ae27d Update Dependencies (#447)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-02-18 16:28:42 +08:00
clash-meta-maintainer[bot]
4f22a46f93 Update Dependencies (#441)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-02-11 01:40:45 +08:00
ForestL
a012d81cd1 fix build error and filter target arch (#443) 2025-02-10 19:56:23 +08:00
GitHub Action
57f043408f Bump version to 2.11.6 (211006) 2025-02-09 13:47:46 +00:00
clash-meta-maintainer[bot]
e5d8c9f355 Update Dependencies (#437)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-02-05 17:52:17 +08:00
5ec1cff
2760de9d40 remove unnecessary READ_EXTERNAL_STORAGE permission (#439) 2025-02-05 17:52:03 +08:00
5ec1cff
64a69e6627 app: refine LogsActivity & LogcatActivity (#431) 2025-01-22 10:07:37 +08:00
clash-meta-maintainer[bot]
9fd394d7c5 Update Dependencies (#422) 2025-01-21 21:38:41 +08:00
5ec1cff
e8e00108e6 Update app (#428) 2025-01-21 21:35:45 +08:00
GitHub Action
3100e1700c Bump version to 2.11.5 (211005) 2024-12-31 17:11:31 +00:00
clash-meta-maintainer[bot]
7598481c01 Update Dependencies (#414)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2025-01-01 00:29:21 +08:00
clash-meta-maintainer[bot]
565d1d7a81 Update Dependencies (#412)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-12-25 20:34:04 +08:00
GitHub Action
e15477cc04 Bump version to 2.11.4 (211004) 2024-12-22 11:55:41 +00:00
汐殇
94c46a04c4 Update Provider.kt 2024-12-22 19:38:14 +08:00
GitHub Action
c513a198f4 Bump version to 2.11.3 (211003) 2024-12-19 13:32:18 +00:00
clash-meta-maintainer[bot]
754f2801ee Update Dependencies (#407)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-12-19 20:59:41 +08:00
汐殇
4b96ce2556 Update Proxy.kt 2024-12-19 20:59:10 +08:00
clash-meta-maintainer[bot]
15f283c1c7 Update Dependencies (#405)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-12-09 18:14:45 +08:00
clash-meta-maintainer[bot]
6c39a894ba Update Dependencies (#401)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-12-06 11:54:36 +08:00
clash-meta-maintainer[bot]
af2a309c7a Update Dependencies (#385)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-12-03 07:56:39 +08:00
clash-meta-maintainer[bot]
94489d1dca Update Dependencies (#384)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-11-06 20:59:01 +08:00
GitHub Action
88f92dd98f Bump version to 2.11.2 (211002) 2024-11-03 09:34:45 +00:00
clash-meta-maintainer[bot]
deeebdb271 Update Dependencies (#371)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-11-03 17:25:29 +08:00
Trịnh Văn Lợi
f75ee05b52 Add Vietnamese (#367) 2024-10-14 20:52:22 +08:00
clash-meta-maintainer[bot]
c39838e631 Update Dependencies (#363)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-10-13 19:54:53 +08:00
wwqgtxx
b7e4ff551a fix dnsList handle 2024-10-06 00:56:02 +08:00
clash-meta-maintainer[bot]
7b828ee0d9 Update Dependencies (#362)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-10-06 00:33:37 +08:00
wwqgtxx
266c9da66d better Version and BuildTime handle 2024-10-06 00:32:33 +08:00
clash-meta-maintainer[bot]
f0f82fb9f9 Update Dependencies (#361)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-10-05 14:22:57 +08:00
clash-meta-maintainer[bot]
54cfb54b8b Update Dependencies (#360)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-10-05 14:02:39 +08:00
clash-meta-maintainer[bot]
1430b29340 Update Dependencies (#359)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-10-05 13:42:06 +08:00
wwqgtxx
d79fbf2519 set GIT_VERSION to core 2024-10-05 13:02:40 +08:00
wwqgtxx
aea7edd2f8 add init log 2024-10-05 10:09:56 +08:00
clash-meta-maintainer[bot]
8f8c7724ba Update Dependencies (#357)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-10-04 16:18:14 +08:00
clash-meta-maintainer[bot]
2ac1ade188 Update Dependencies (#355)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-10-01 13:23:04 +08:00
GitHub Action
6122aeffb5 Bump version to 2.11.1 (211001) 2024-09-30 05:44:31 +00:00
wwqgtxx
97f52bbcb6 adopt external-controller-cors 2024-09-30 13:12:58 +08:00
clash-meta-maintainer[bot]
e39bfe8832 Update Dependencies (#354)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-09-30 13:11:32 +08:00
wwqgtxx
36bc78070a fix patchProviders works abnormally when path is empty 2024-09-28 00:20:17 +08:00
wwqgtxx
e164e219bd code cleanup 2024-09-27 21:57:22 +08:00
clash-meta-maintainer[bot]
309726dddd Update Dependencies (#346)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-09-27 21:53:09 +08:00
clash-meta-maintainer[bot]
786ac02a1d Update Dependencies (#342)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-09-23 11:43:05 +08:00
wwqgtxx
e966e52b77 replace launch_name for alpha 2024-09-12 14:48:37 +08:00
GitHub Action
0e1f3f5823 Bump version to 2.11.0 (211000) 2024-09-12 06:18:29 +00:00
clash-meta-maintainer[bot]
649201f52d Update Dependencies (#332)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-09-12 14:16:50 +08:00
wwqgtxx
bbe9dc42d2 move UpdatableProvider define in here 2024-09-12 11:18:28 +08:00
wwqgtxx
3ce66040b3 don't call provider.Suspend 2024-09-12 11:10:19 +08:00
Larvan2
43337eacd2 remove redundant 'Meta' 2024-09-12 02:55:28 +00:00
wwqgtxx
a197f8fce1 patch more unsupported config 2024-09-12 10:50:27 +08:00
wwqgtxx
8f1c235af5 call FreeOSMemory in forceGc 2024-09-12 09:57:21 +08:00
wwqgtxx
c6810bc441 support set fake-ip-filter-mode 2024-09-12 09:20:17 +08:00
ForestL
fb1c6a2cc3 add asn import (#333) 2024-09-11 22:21:39 +08:00
wwqgtxx
3cc77c7c95 support set tun stack 2024-09-11 19:46:12 +08:00
karin0
bb2c5283f8 only apply ExternalController in Override settings (#330) 2024-09-11 17:17:59 +08:00
wwqgtxx
a04c1883fa switch from dhcp://system to system:// 2024-09-11 16:30:31 +08:00
clash-meta-maintainer[bot]
e834d67922 Update Dependencies (#329) 2024-09-11 16:27:26 +08:00
wwqgtxx
cfe71bbe60 remove unneeded code 2024-09-11 15:57:56 +08:00
wwqgtxx
262a6b563c remove geoip embed and sideload
we had geoip.metadb and geosite.dat in asserts
2024-09-11 14:54:22 +08:00
clash-meta-maintainer[bot]
a1d838a98a Update Dependencies (#328)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-09-11 13:38:57 +08:00
wwqgtxx
b1459134e8 setup grade in update-dependencies.yaml too 2024-09-11 11:01:57 +08:00
wwqgtxx
9edf35c4bc add ipv6 support for tun 2024-09-11 09:37:57 +08:00
Zongle Wang
b661d94278 Migrate to gradle/actions/setup-gradle@v4 (#293)
https://github.com/gradle/actions/releases/tag/v4.0.0
https://github.com/gradle/actions/blob/main/setup-gradle/README.md
2024-09-10 23:13:58 +08:00
clash-meta-maintainer[bot]
c82acb38d5 Update Dependencies (#326) 2024-09-10 21:50:21 +08:00
clash-meta-maintainer[bot]
7e24d7fea3 Update Dependencies (#315) 2024-09-10 17:23:09 +08:00
wwqgtxx
158e47b372 using sing-tun instead of tun2socket 2024-09-10 16:38:59 +08:00
GitHub Action
4df39342a2 Bump version to 2.10.4 (210004) 2024-09-02 08:47:41 +00:00
汐殇
0dc219193b Merge pull request #312 from MetaCubeX/update-dependencies
Update Dependencies
2024-09-02 16:41:25 +08:00
clash-meta-maintainer[bot]
8c587fd22a Update Dependencies 2024-09-02 08:26:41 +00:00
wwqgtxx
c9fa690601 remove depend of gopkg.in/yaml.v2 2024-09-01 00:22:56 +08:00
wwqgtxx
e548b933e2 using hub.ApplyConfig to start the external controller 2024-08-31 22:48:53 +08:00
clash-meta-maintainer[bot]
90f3a09805 Update Dependencies (#311)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-08-31 22:47:18 +08:00
汐殇
d62430af1b Merge pull request #299 from karin0/external-controller
feat: support external controller and its override settings
2024-08-31 18:01:07 +08:00
karin0
bacc75393b feat: support external controller and its override settings 2024-08-31 17:47:17 +08:00
汐殇
fec7df02e4 Merge pull request #304 from aviraxp/patch-1
Avoid starting foreground service repeatedly
2024-08-31 01:35:26 +08:00
汐殇
0a1406eb86 Merge pull request #291 from MetaCubeX/update-dependencies
Update Dependencies
2024-08-31 01:22:57 +08:00
Wang Han
26c2ecef6d Avoid starting foreground service repeatedly 2024-08-31 00:15:22 +08:00
clash-meta-maintainer[bot]
15ef59a856 Update Dependencies 2024-08-30 12:13:34 +00:00
wwqgtxx
a9b10acac2 cleanup code 2024-08-27 11:02:45 +08:00
GitHub Action
08f87e27ed Bump version to 2.10.3 (210003) 2024-08-15 05:53:16 +00:00
Larvan2
2e0d02ac1d ci: bump go version 2024-08-15 05:39:12 +00:00
clash-meta-maintainer[bot]
904353a1f3 Update Dependencies (#278)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-08-15 13:28:54 +08:00
Shun Zi
143c84d47b fix: (native conn.go) closeMatch logic should really close all matching conns; closes PacketConn also (#248) 2024-07-30 13:26:57 +08:00
GitHub Action
65bfd8a132 Bump version to 2.10.2 (210002) 2024-07-28 05:38:37 +00:00
汐殇
e7e870ac0f Merge pull request #269 from MetaCubeX/update-dependencies
Update Dependencies
2024-07-28 13:22:28 +08:00
clash-meta-maintainer[bot]
f64c4b5bc9 Update Dependencies 2024-07-28 03:03:41 +00:00
clash-meta-maintainer[bot]
8d88011c08 Update Dependencies (#247)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-07-01 23:02:01 +08:00
汐殇
bc8c24af3b fix: outbound type 2024-06-15 18:31:26 +08:00
clash-meta-maintainer[bot]
fa627f0da8 Update Dependencies (#234) 2024-06-08 18:28:25 +08:00
wwqgtxx
e701551655 add update-go-mod-replace 2024-05-24 11:40:55 +08:00
clash-meta-maintainer[bot]
7242f2719c Update Dependencies (#228)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-05-21 12:32:43 +08:00
clash-meta-maintainer[bot]
0126d3b09d Update Dependencies (#222) 2024-05-10 14:10:19 +08:00
Larvan2
e5bbbe28c5 fix: reject drop 2024-05-03 03:01:20 +00:00
Esing
5e397c2aed Fix typos in README.md (#185) 2024-04-30 15:25:32 +08:00
clash-meta-maintainer[bot]
5e8d6df9f0 Update Dependencies (#218)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-04-30 15:21:59 +08:00
clash-meta-maintainer[bot]
ef88732a9a Update Dependencies (#214)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-04-26 11:22:24 +08:00
clash-meta-maintainer[bot]
2419d14505 Update Dependencies (#212)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-04-23 12:40:26 +08:00
H1JK
937d9c5d3b ci: Update dependencies & Go version 2024-04-20 13:21:55 +08:00
Larvan2
1f6dbe4278 ci: trigger action when PR merged 2024-04-20 11:01:04 +08:00
Το μοχθηρό ^_^
e2b1b10d33 Update BaseActivity.kt (#198) 2024-04-20 10:58:31 +08:00
clash-meta-maintainer[bot]
f0d388d571 Update Dependencies (#204) 2024-04-19 23:08:05 +08:00
wwqgtxx
667d6b6109 Update build.gradle.kts 2024-04-19 12:04:19 +08:00
clash-meta-maintainer[bot]
58d16cb3de Update Dependencies (#196)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-04-05 15:12:19 +08:00
clash-meta-maintainer[bot]
78ffee360c Update Dependencies (#193)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-03-31 15:53:34 +08:00
Larvan2
53bc1da503 Merge pull request #190 from xixiha5230/patch-1
Use CMake string(TIMESTAMP) for portable compile timestamp
2024-03-31 15:52:23 +08:00
Larvan2
436f8600d2 Merge pull request #194 from shunf4/fix/bad_tz_override
fix: correctly convert timezone offset from Java TimeZone.getRawOffset() to arg for golang time.FixedZone
2024-03-28 15:03:02 +08:00
shunf4
669e644d81 fix: correctly convert timezone offset from Java TimeZone.getRawOffset() to arg for golang time.FixedZone 2024-03-17 18:26:51 +08:00
clash-meta-maintainer[bot]
346096aab7 Update Dependencies (#192)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-02-25 14:35:34 +08:00
clash-meta-maintainer[bot]
9506f50850 Update Dependencies (#187)
Co-authored-by: clash-meta-maintainer[bot] <148681994+clash-meta-maintainer[bot]@users.noreply.github.com>
2024-02-24 19:50:59 +08:00
xixiha5230
d7328953ba Use CMake string(TIMESTAMP) for portable compile timestamp
The previous usage of the date command is not portable across different platforms. date is not guaranteed to be available and the format varies.

Replace it with CMake's built-in string(TIMESTAMP) command which generates a string with the given timestamp format independent of the platform. This commit changes it to use "%y%m%d" format for a YYMMDD timestamp commonly used for compilation.
2024-02-24 17:57:12 +08:00
Το μοχθηρό ^_^
2a2686fa11 Fix high-risk vulnerabilities(CIRCL's Kyber: timing side-channel (kyberslash2) ) (#186)
* chore(deps): bump github.com/cloudflare/circl in /core/src/foss/golang

Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.6 to 1.3.7.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.6...v1.3.7)
2024-02-20 13:42:32 +08:00
clash-meta-maintainer[bot]
1377d42dc2 Update Dependencies (#184) 2024-02-18 16:16:28 +08:00
Το μοχθηρό ^_^
c7c13b3a89 update dependency (#180) 2024-02-14 18:56:48 +08:00
clash-meta-maintainer[bot]
cd3aad232b Update Dependencies (#183) 2024-02-14 18:15:59 +08:00
GitHub Action
c18fe9ab77 Bump version to 2.10.1 (210001) 2024-02-08 07:47:39 +00:00
clash-meta-maintainer[bot]
2832c9ee4c Update Dependencies (#182)
Co-authored-by: clash-meta-maintainer[bot] <clash-meta-maintainer[bot]@users.noreply.github.com>
2024-02-08 11:15:35 +08:00
clash-meta-maintainer[bot]
fa360d83f8 Update Dependencies (#181) 2024-02-05 23:46:28 +08:00
clash-meta-maintainer[bot]
916d6a7777 Update Dependencies (#179)
Co-authored-by: clash-meta-maintainer[bot] <clash-meta-maintainer[bot]@users.noreply.github.com>
2024-01-24 17:59:48 +08:00
Larvan2
dccab90843 fix: delay 2024-01-21 23:38:01 +08:00
clash-meta-maintainer[bot]
c64e1a005e Update Dependencies (#177)
Co-authored-by: clash-meta-maintainer[bot] <clash-meta-maintainer[bot]@users.noreply.github.com>
2024-01-21 17:16:33 +08:00
GitHub Action
4dd7aec7ec Bump version to 2.10.0 (210000) 2024-01-18 09:54:42 +00:00
Το μοχθηρό ^_^
8fa4e33bda Update dependency (#174)
* Add renovate.json

* fix(deps): update dependency org.jetbrains.kotlinx:kotlinx-coroutines-android to v1.7.3

* chore(deps): update dependency gradle to v7.6.3

* chore(deps): update devofure/advance-android-version-actions action to v1.5

* chore(deps): update mikepenz/release-changelog-builder-action action to v3.7.3

* chore(deps): update actions/upload-artifact action to v4

* chore(deps): update mikepenz/release-changelog-builder-action action to v4

* chore(deps): update actions/setup-go action to v5

* chore(deps): update actions/setup-java action to v4

* chore(deps): update actions/cache action to v4

* chore(deps): update actions/checkout action to v4

* chore(deps): update tibdex/github-app-token action to v2

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-18 09:54:42 +00:00
cmfaapp[bot]
1b5ce606e4 Update Dependencies (#1)
Co-authored-by: aylz10 <aylz10@users.noreply.github.com>
2024-01-18 09:54:32 +00:00
aylz10
60974e8672 修复 proxies.go 2024-01-17 05:59:44 +00:00
aylz10
2205a90de9 核心依赖变更mihomo 2024-01-17 05:59:44 +00:00
aylz10
c7666a3e01 更换核心地址 2024-01-17 05:59:44 +00:00
Steve Johnson
a08a0c1dd1 action: fix release tag 2023-11-03 10:29:19 +08:00
Steve Johnson
dc80d751cb action: better pre-release logic 2023-11-03 01:54:56 +08:00
Steve Johnson
80037c2d23 action: better release action 2023-11-03 01:53:59 +08:00
144 changed files with 2479 additions and 2014 deletions

View File

@@ -0,0 +1,33 @@
From 7115c480196f4bdcbdae5e14ebaa4510540680e9 Mon Sep 17 00:00:00 2001
From: Brad Fitzpatrick <bradfitz@tailscale.com>
Date: Tue, 27 Jan 2026 09:52:22 -0800
Subject: [PATCH] [tailscale] os: disable pidfd on Android
Updates tailscale/tailscale#13452
Updates golang/go#70508
Updates tailscale/go#99
---
src/os/pidfd_linux.go | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/os/pidfd_linux.go b/src/os/pidfd_linux.go
index 796d8c018c7f2a..5cdbf1175e0db5 100644
--- a/src/os/pidfd_linux.go
+++ b/src/os/pidfd_linux.go
@@ -138,6 +138,16 @@ func (p *Process) pidfdSendSignal(s syscall.Signal) error {
// pidfdWorks returns whether we can use pidfd on this system.
func pidfdWorks() bool {
+ if runtime.GOOS == "android" {
+ // Tailscale-specific workaround since https://github.com/golang/go/pull/69543/commits/aad6b3b32c81795f86bc4a9e81aad94899daf520
+ // does not solve https://github.com/golang/go/issues/69065 for Android apps using Go libraries.
+ //
+ // See: https://github.com/tailscale/tailscale/issues/13452
+ //
+ // For now (2025-04-09), we'll just disable pidfd
+ // on all Android releases.
+ return false
+ }
return checkPidfdOnce() == nil
}

View File

@@ -3,29 +3,41 @@ on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
push:
branches:
- main
jobs:
BuildDebug:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Checkout submodules
run: git submodule update --init --recursive --remote --force
run: git submodule update --init --recursive --force
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 17
distribution: "temurin"
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
with:
go-version: "1.20"
go-download-base-url: 'https://github.com/MetaCubeX/go/releases/download/build'
go-version: '1.26'
- uses: actions/cache@v3
- name: Apply Patches
run: |
cd $(go env GOROOT)
for p in $GITHUB_WORKSPACE/.github/patch/*.patch; do patch --verbose -p 1 < "$p"; done
- uses: actions/cache@v5
with:
path: |
~/.cache/go-build
@@ -34,6 +46,12 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Update CA
run: |
sudo apt-get update && sudo apt-get install ca-certificates
sudo update-ca-certificates
cp -f /etc/ssl/certs/ca-certificates.crt core/src/foss/golang/clash/component/ca/ca-certificates.crt
# - name: Signing properties
# env:
# SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
@@ -50,47 +68,44 @@ jobs:
- name: Build
if: success()
uses: gradle/gradle-build-action@v2
with:
arguments: --no-daemon app:assembleMeta-AlphaRelease
run: ./gradlew --no-daemon app:assembleAlphaRelease
- name: Upload Aritfact (universal)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: CMFA Debug Unsigned APK (universal)
path: |
app/build/outputs/apk/meta-alpha/release/*-universal-*.apk
app/build/outputs/apk/alpha/release/*-universal-*.apk
- name: Upload Aritfact (arm64-v8a)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: CMFA Debug Unsigned APK (arm64-v8a)
path: |
app/build/outputs/apk/meta-alpha/release/*-arm64-v8a-*.apk
app/build/outputs/apk/alpha/release/*-arm64-v8a-*.apk
- name: Upload Aritfact (armeabi-v7a)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: CMFA Debug Unsigned APK (armeabi-v7a)
path: |
app/build/outputs/apk/meta-alpha/release/*-armeabi-v7a-*.apk
app/build/outputs/apk/alpha/release/*-armeabi-v7a-*.apk
- name: Upload Aritfact (x86_64)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: CMFA Debug Unsigned APK (x86_64)
path: |
app/build/outputs/apk/meta-alpha/release/*-x86_64-*.apk
app/build/outputs/apk/alpha/release/*-x86_64-*.apk
- name: Upload Aritfact (x86)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: CMFA Debug Unsigned APK (x86)
path: |
app/build/outputs/apk/meta-alpha/release/*-x86-*.apk
app/build/outputs/apk/alpha/release/*-x86-*.apk

View File

@@ -1,29 +1,41 @@
name: Build Pre-Release
on:
workflow_dispatch:
push:
branches:
- main
jobs:
BuildPreRelease:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Checkout submodules
run: git submodule update --init --recursive --remote --force
run: git submodule update --init --recursive --force
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 17
distribution: "temurin"
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
with:
go-version: "1.20"
go-download-base-url: 'https://github.com/MetaCubeX/go/releases/download/build'
go-version: '1.26'
- uses: actions/cache@v3
- name: Apply Patches
run: |
cd $(go env GOROOT)
for p in $GITHUB_WORKSPACE/.github/patch/*.patch; do patch --verbose -p 1 < "$p"; done
- uses: actions/cache@v5
with:
path: |
~/.cache/go-build
@@ -32,6 +44,12 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Update CA
run: |
sudo apt-get update && sudo apt-get install ca-certificates
sudo update-ca-certificates
cp -f /etc/ssl/certs/ca-certificates.crt core/src/foss/golang/clash/component/ca/ca-certificates.crt
- name: Signing properties
env:
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
@@ -48,16 +66,14 @@ jobs:
- name: Pre-release Build
if: success()
uses: gradle/gradle-build-action@v2
with:
arguments: --no-daemon app:assembleMeta-AlphaRelease
run: ./gradlew --no-daemon app:assembleAlphaRelease
- name: Delete current release assets
uses: andreaswilli/delete-release-assets-action@v2.0.0
# Delete old Prerelease-alpha
- uses: dev-drprasad/delete-tag-and-release@v1.1
with:
tag_name: Prerelease-alpha
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: Prerelease-alpha
deleteOnlyFromDrafts: false
delete_release: true
- name: Tag Repo
uses: richardsimko/update-tag@v1
@@ -67,13 +83,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Alpha
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: ${{ success() }}
with:
tag_name: Prerelease-alpha
files: app/build/outputs/apk/meta-alpha/release/*
files: app/build/outputs/apk/alpha/release/*
prerelease: true
generate_release_notes: true
- name: Release Changelog Builder
uses: mikepenz/release-changelog-builder-action@v3.6.0
uses: mikepenz/release-changelog-builder-action@v4

View File

@@ -1,40 +1,45 @@
name: Build Release
on:
push:
tags:
- '*' #
workflow_dispatch:
inputs:
auto-bump-version:
description: 'Auto bump project version before building release'
required: false
type: boolean
release-tag:
description: 'Release Tag (v2.x.x)'
required: true
jobs:
BuildRelease:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Checkout submodules
run: git submodule update --init --recursive --remote
run: git submodule update --init --recursive --force
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 17
distribution: "temurin"
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
with:
go-version: "1.20"
go-download-base-url: 'https://github.com/MetaCubeX/go/releases/download/build'
go-version: '1.26'
- uses: actions/cache@v3
- name: Apply Patches
run: |
cd $(go env GOROOT)
for p in $GITHUB_WORKSPACE/.github/patch/*.patch; do patch --verbose -p 1 < "$p"; done
- uses: actions/cache@v5
with:
path: |
~/.cache/go-build
@@ -43,39 +48,46 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
# If auto-bump-version is chosen BEGIN
- name: Configure Git
if: ${{ inputs.auto-bump-version }}
- name: Convert and set version env
id: process-version
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
VERSION_TAG=${{ inputs.release-tag }}
VERSION_TAG=${VERSION_TAG#v} # remove the 'v' prefix
IFS='.' read -ra VERSION_PARTS <<< "$VERSION_TAG" # split into array
VERSION_CODE=$(printf "%1d%02d%03d" "${VERSION_PARTS[0]}" "${VERSION_PARTS[1]}" "${VERSION_PARTS[2]}")
echo "versonName=$VERSION_TAG" >> $GITHUB_OUTPUT # "1.2.3"
echo "versonCode=$VERSION_CODE" >> $GITHUB_OUTPUT # "102003"
- name: Auto bump project version
if: ${{ inputs.auto-bump-version }}
id: bump-version
run: |
versionCode=$(grep -oP 'versionCode = \K\d+' build.gradle.kts)
versionName=$(grep -oP 'versionName = "\K[0-9.]+' build.gradle.kts)
major=$(echo $versionName | cut -d. -f1)
minor=$(echo $versionName | cut -d. -f2)
patch=$(echo $versionName | cut -d. -f3)
newPatch=$((patch + 1))
newVersionName="$major.$minor.$newPatch"
newVersionCode=$((versionCode + 1))
sed -i "s/versionCode = $versionCode/versionCode = $newVersionCode/" build.gradle.kts
sed -i "s/versionName = \"$versionName\"/versionName = \"$newVersionName\"/" build.gradle.kts
echo "newVersionName=$newVersionName" >> $GITHUB_OUTPUT
echo "newVersionCode=$newVersionCode" >> $GITHUB_OUTPUT
# Re-write version in build.gradle.kts
- name: Re-write version
uses: Devofure/advance-android-version-actions@v1.5
with:
gradlePath: build.gradle.kts
versionCode: ${{ steps.process-version.outputs.versonCode }}
versionName: ${{ steps.process-version.outputs.versonName }}
- name: Commit modified version code and make new tag
if: ${{ inputs.auto-bump-version }}
# If any change found, commit it and push
- name: Commit and push if changes
run: |
newVersionName=${{ steps.bump-version.outputs.newVersionName }}
newVersionCode=${{ steps.bump-version.outputs.newVersionCode }}
git commit -am "Bump version to $newVersionName ($newVersionCode)"
git tag "v$newVersionName"
git push --follow-tags
# If auto-bump-version is chosen END
changes=$(git diff --name-only origin/main | wc -l)
if [ $changes -gt 0 ]
then
newVersionName=${{ steps.process-version.outputs.versonName }}
newVersionCode=${{ steps.process-version.outputs.versonCode }}
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add build.gradle.kts
git commit -am "Bump version to $newVersionName ($newVersionCode)"
git tag "v$newVersionName"
git push --follow-tags
fi
- name: Update CA
run: |
sudo apt-get update && sudo apt-get install ca-certificates
sudo update-ca-certificates
cp -f /etc/ssl/certs/ca-certificates.crt core/src/foss/golang/clash/component/ca/ca-certificates.crt
- name: Signing properties
env:
@@ -93,23 +105,12 @@ jobs:
- name: Release Build
if: success()
uses: gradle/gradle-build-action@v2
with:
arguments: --no-daemon app:assembleMetaRelease
- name: Get real tag value (current or auto-bumped?)
id: real_tag
run: |
if [[ "${{ inputs.auto-bump-version }}" == "true" ]]; then
echo "tag=v${{ steps.bump-version.outputs.newVersionName }}" >> $GITHUB_OUTPUT
else
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
fi
run: ./gradlew --no-daemon app:assembleMetaRelease
- name: Tag Repo
uses: richardsimko/update-tag@v1
with:
tag_name: ${{ steps.real_tag.outputs.tag }}
tag_name: ${{ inputs.release-tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -117,9 +118,16 @@ jobs:
uses: softprops/action-gh-release@v1
if: ${{ success() }}
with:
tag_name: ${{ steps.real_tag.outputs.tag }}
tag_name: ${{ inputs.release-tag }}
files: app/build/outputs/apk/meta/release/*
generate_release_notes: true
- name: Release Changelog Builder
uses: mikepenz/release-changelog-builder-action@v3.6.0
uses: mikepenz/release-changelog-builder-action@v4.1.1
with:
configurationJson: |
{
"ignore_labels": [
"Update"
],
}

View File

@@ -10,23 +10,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Checkout submodules
- name: Checkout and Update submodules
run: git submodule update --init --recursive --remote --force
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 17
distribution: "temurin"
java-version: 21
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
with:
go-version: "1.20"
go-download-base-url: 'https://github.com/MetaCubeX/go/releases/download/build'
go-version: '1.26'
- name: Apply Patches
run: |
cd $(go env GOROOT)
for p in $GITHUB_WORKSPACE/.github/patch/*.patch; do patch --verbose -p 1 < "$p"; done
- uses: actions/cache@v3
- uses: actions/cache@v5
with:
path: |
~/.cache/go-build
@@ -34,30 +40,33 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download GeoIP Database
- name: Install update-go-mod-replace
run: |
./gradlew :core:downloadGeoipDatabase
go install github.com/metacubex/update-go-mod-replace@latest
- name: Update Foss Gomod
run: |
cd ${{ github.workspace }}/core/src/foss/golang/
update-go-mod-replace ${{ github.workspace }}/core/src/foss/golang/clash/go.mod $(pwd)/go.mod
go mod tidy
- name: Update Main Gomod
run: |
cd ${{ github.workspace }}/core/src/main/golang/native/
cd ${{ github.workspace }}/core/src/main/golang/
update-go-mod-replace ${{ github.workspace }}/core/src/foss/golang/clash/go.mod $(pwd)/go.mod
go mod tidy
- uses: tibdex/github-app-token@v1
- uses: actions/create-github-app-token@v3
id: generate-token
with:
app_id: ${{ secrets.MAINTAINER_APPID }}
private_key: ${{ secrets.MAINTAINER_APP_PRIVATE_KEY }}
client-id: ${{ secrets.MAINTAINER_APPID }}
private-key: ${{ secrets.MAINTAINER_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v8
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: Update Dependencies

4
.gitmodules vendored
View File

@@ -1,4 +1,4 @@
[submodule "clash-foss"]
path = core/src/foss/golang/clash
url = https://github.com/MetaCubeX/Clash.Meta
branch = android-real
url = https://github.com/MetaCubeX/mihomo
branch = Alpha

View File

@@ -32,7 +32,15 @@ Feature of [Clash.Meta](https://github.com/MetaCubeX/Clash.Meta)
sdk.dir=/path/to/android-sdk
```
4. Create `signing.properties` in project root with
4. (Optional) Custom app package name. Add the following configuration to `local.properties`.
```properties
# config your ownn applicationId, or it will be 'com.github.metacubex.clash'
custom.application.id=com.my.compile.clash
# remove application id suffix, or the applicaion id will be 'com.github.metacubex.clash.alpha'
remove.suffix=true
5. Create `signing.properties` in project root with
```properties
keystore.path=/path/to/keystore/file
@@ -41,10 +49,10 @@ Feature of [Clash.Meta](https://github.com/MetaCubeX/Clash.Meta)
key.password=<key password>
```
5. Build
6. Build
```bash
./gradlew app:assembleMeta-AlphaRelease
./gradlew app:assembleAlphaRelease
```
### Automation
@@ -60,18 +68,20 @@ APP package name is `com.github.metacubex.clash.meta`
- Import a profile
- URL Scheme `clash://install-config?url=<encoded URI>` or `clashmeta://install-config?url=<encoded URI>`
### Kernel Contribution
### Contribution and Project Maintenance
#### Meta Kernel
- CMFA uses the kernel from `android-real` branch under `MetaCubeX/Clash.Meta`, which is a merge of the main `Alpha` branch and `android-open`.
- If you want to contribute to the kernel, make PRs to `Alpha` branch of the Meta kernel repository.
- If you want to contribute Android-specific patches to the kernel, make PRs to `android-open` branch of the Meta kernel repository.
### Project Maintainance
#### Maintenance
- When `MetaCubeX/Clash.Meta` kernel is updated to a new version, the `Update Dependencies` actions in this repo will be triggered automatically.
- It will pull the new version of the meta kernel, update all the golang dependencies, and create a PR without manual intervention.
- If there is any compile error in PR, you need to fix it before merging. Alternatively, you may merge the PR directly.
- Manually triggering `Build Pre-Release` actions will automatically compile and publish a `PreRelease` version.
- Manually triggering `Build Release` actions will automatically compile, tag and publish a `Release` version.
- There is an option `Auto bump project version` in trigger widget. If this option is checked and triggered, the `versionName` and `versionCode` in `build.gradle.kts` will be bumped first, then do the common build release process.
- This option is intended for quickly update and release a new version online, without pulling the repository locally and work around by manual.
- Manually triggering `Build Pre-Release` actions will compile and publish a `PreRelease` version.
- Manually triggering `Build Release` actions will compile, tag and publish a `Release` version.
- You must fill the blank `Release Tag` with the tag you want to release in the format of `v1.2.3`.
- `versionName` and `versionCode` in `build.gradle.kts` will be automatically bumped to the tag you filled above.

View File

@@ -24,6 +24,8 @@ dependencies {
implementation(libs.androidx.coordinator)
implementation(libs.androidx.recyclerview)
implementation(libs.google.material)
implementation(libs.quickie.bundled)
implementation(libs.androidx.activity.ktx)
}
tasks.getByName("clean", type = Delete::class) {
@@ -38,6 +40,7 @@ task("downloadGeoFiles") {
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb" to "geoip.metadb",
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat" to "geosite.dat",
// "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb" to "country.mmdb",
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb" to "ASN.mmdb",
)
doLast {

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.github.kr328.clash">
xmlns:tools="http://schemas.android.com/tools">
<uses-feature
android:name="android.software.leanback"
@@ -12,10 +11,11 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<application
android:name=".MainApplication"
@@ -42,22 +42,33 @@
android:configChanges="uiMode"
android:exported="true"
android:label="@string/launch_name"
android:launchMode="singleTop">
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
</intent-filter>
</activity>
<activity-alias
android:name=".MainActivityAlias"
android:exported="true"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity-alias>
<activity
android:name=".ExternalControlActivity"
android:excludeFromRecents="true"
android:exported="true"
android:label="@string/external_control_activity"
android:noHistory="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@@ -172,7 +183,11 @@
<service
android:name=".LogcatService"
android:exported="false"
android:label="@string/clash_logcat" />
android:label="@string/clash_logcat"
android:foregroundServiceType="specialUse">
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="explanation_for_special_use"/>
</service>
<service
android:name=".TileService"
android:exported="true"
@@ -193,5 +208,14 @@
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
<receiver android:name=".DialerReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<!-- 252746382 is the name of Clash Meta in T9 -->
<data android:scheme="android_secret_code" android:host="252746382" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@@ -11,7 +11,10 @@ import com.github.kr328.clash.design.AccessControlDesign
import com.github.kr328.clash.design.model.AppInfo
import com.github.kr328.clash.design.util.toAppInfo
import com.github.kr328.clash.service.store.ServiceStore
import com.github.kr328.clash.util.startClashService
import com.github.kr328.clash.util.stopClashService
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
@@ -26,7 +29,15 @@ class AccessControlActivity : BaseActivity<AccessControlDesign>() {
defer {
withContext(Dispatchers.IO) {
val changed = selected != service.accessControlPackages
service.accessControlPackages = selected
if (clashRunning && changed) {
stopClashService()
while (clashRunning) {
delay(200)
}
startClashService()
}
}
}
@@ -46,6 +57,7 @@ class AccessControlActivity : BaseActivity<AccessControlDesign>() {
AccessControlDesign.Request.ReloadApps -> {
design.patchApps(loadApps(selected))
}
AccessControlDesign.Request.SelectAll -> {
val all = withContext(Dispatchers.Default) {
design.apps.map(AppInfo::packageName)
@@ -56,11 +68,13 @@ class AccessControlActivity : BaseActivity<AccessControlDesign>() {
design.rebindAll()
}
AccessControlDesign.Request.SelectNone -> {
selected.clear()
design.rebindAll()
}
AccessControlDesign.Request.SelectInvert -> {
val all = withContext(Dispatchers.Default) {
design.apps.map(AppInfo::packageName).toSet() - selected
@@ -71,6 +85,7 @@ class AccessControlActivity : BaseActivity<AccessControlDesign>() {
design.rebindAll()
}
AccessControlDesign.Request.Import -> {
val clipboard = getSystemService<ClipboardManager>()
val data = clipboard?.primaryClip
@@ -85,6 +100,7 @@ class AccessControlActivity : BaseActivity<AccessControlDesign>() {
design.rebindAll()
}
AccessControlDesign.Request.Export -> {
val clipboard = getSystemService<ClipboardManager>()
@@ -118,7 +134,10 @@ class AccessControlActivity : BaseActivity<AccessControlDesign>() {
it.packageName != packageName
}
.filter {
it.packageName == "android" || it.requestedPermissions?.contains(INTERNET) == true
it.applicationInfo != null
}
.filter {
it.requestedPermissions?.contains(INTERNET) == true || it.applicationInfo!!.uid < android.os.Process.FIRST_APPLICATION_UID
}
.filter {
systemApp || !it.isSystemApp
@@ -132,6 +151,6 @@ class AccessControlActivity : BaseActivity<AccessControlDesign>() {
private val PackageInfo.isSystemApp: Boolean
get() {
return applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0
return applicationInfo?.flags?.and(ApplicationInfo.FLAG_SYSTEM) != 0
}
}

View File

@@ -1,9 +1,12 @@
package com.github.kr328.clash
import android.content.ComponentName
import android.content.pm.PackageManager
import androidx.core.content.pm.ShortcutManagerCompat
import com.github.kr328.clash.common.util.componentName
import com.github.kr328.clash.design.AppSettingsDesign
import com.github.kr328.clash.design.model.Behavior
import com.github.kr328.clash.design.store.UiStore.Companion.mainActivityAlias
import com.github.kr328.clash.service.store.ServiceStore
import com.github.kr328.clash.util.ApplicationObserver
import kotlinx.coroutines.isActive
@@ -17,6 +20,7 @@ class AppSettingsActivity : BaseActivity<AppSettingsDesign>(), Behavior {
ServiceStore(this),
this,
clashRunning,
::onHideIconChange,
)
setContentDesign(design)
@@ -59,4 +63,21 @@ class AppSettingsActivity : BaseActivity<AppSettingsDesign>(), Behavior {
PackageManager.DONT_KILL_APP,
)
}
}
private fun onHideIconChange(hide: Boolean) {
val newState = if (hide) {
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
} else {
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
}
packageManager.setComponentEnabledSetting(
mainActivityAlias,
newState,
PackageManager.DONT_KILL_APP
)
if (hide) {
// Prevent launcher activity not found.
ShortcutManagerCompat.removeAllDynamicShortcuts(this)
}
}
}

View File

@@ -1,11 +1,13 @@
package com.github.kr328.clash
import android.app.ActivityManager
import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.activity.result.contract.ActivityResultContract
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.getSystemService
import com.github.kr328.clash.common.compat.isAllowForceDarkCompat
import com.github.kr328.clash.common.compat.isLightNavigationBarCompat
import com.github.kr328.clash.common.compat.isLightStatusBarsCompat
@@ -28,33 +30,20 @@ import java.util.*
import java.util.concurrent.atomic.AtomicInteger
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
import com.github.kr328.clash.design.R
abstract class BaseActivity<D : Design<*>> :
AppCompatActivity(),
abstract class BaseActivity<D : Design<*>> : AppCompatActivity(),
CoroutineScope by MainScope(),
Broadcasts.Observer {
enum class Event {
ServiceRecreated,
ActivityStart,
ActivityStop,
ClashStop,
ClashStart,
ProfileLoaded,
ProfileChanged,
ProfileUpdateCompleted,
ProfileUpdateFailed
}
protected val uiStore by lazy { UiStore(this) }
protected val events = Channel<Event>(Channel.UNLIMITED)
protected var activityStarted: Boolean = false
protected val clashRunning: Boolean
get() = Remote.broadcasts.clashRunning
protected var design: D? = null
private set(value) {
set(value) {
field = value
if (value != null) {
setContentView(value.root)
} else {
@@ -75,14 +64,14 @@ abstract class BaseActivity<D : Design<*>> :
suspend fun <I, O> startActivityForResult(
contracts: ActivityResultContract<I, O>,
input: I
input: I,
): O = withContext(Dispatchers.Main) {
val requestKey = nextRequestKey.getAndIncrement().toString()
ActivityResultLifecycle().use { lifecycle, start ->
suspendCoroutine { c ->
activityResultRegistry.register(requestKey, lifecycle, contracts) {
c.resumeWith(Result.success(it))
c.resume(it)
}.apply { start() }.launch(input)
}
}
@@ -92,7 +81,6 @@ abstract class BaseActivity<D : Design<*>> :
suspendCoroutine<Unit> {
window.decorView.post {
this.design = design
it.resume(Unit)
}
}
@@ -100,49 +88,40 @@ abstract class BaseActivity<D : Design<*>> :
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
applyDayNight()
// Apply excludeFromRecents setting to all app tasks.
checkNotNull(getSystemService<ActivityManager>()).appTasks.forEach { task ->
task.setExcludeFromRecents(uiStore.hideFromRecents)
}
launch {
main()
finish()
}
}
override fun onStart() {
super.onStart()
activityStarted = true
Remote.broadcasts.addObserver(this)
events.trySend(Event.ActivityStart)
}
override fun onStop() {
super.onStop()
activityStarted = false
Remote.broadcasts.removeObserver(this)
events.trySend(Event.ActivityStop)
}
override fun onDestroy() {
design?.cancel()
cancel()
super.onDestroy()
}
override fun finish() {
if (deferRunning) {
return
}
if (deferRunning) return
deferRunning = true
launch {
@@ -172,7 +151,6 @@ abstract class BaseActivity<D : Design<*>> :
override fun onSupportNavigateUp(): Boolean {
this.onBackPressed()
return true
}
@@ -212,49 +190,45 @@ abstract class BaseActivity<D : Design<*>> :
private fun queryDayNight(config: Configuration = resources.configuration): DayNight {
return when (uiStore.darkMode) {
DarkMode.Auto -> {
if (config.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES)
DayNight.Night
else
DayNight.Day
}
DarkMode.ForceLight -> {
DayNight.Day
}
DarkMode.ForceDark -> {
DayNight.Night
}
DarkMode.Auto -> if (config.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES) DayNight.Night else DayNight.Day
DarkMode.ForceLight -> DayNight.Day
DarkMode.ForceDark -> DayNight.Night
}
}
private fun applyDayNight(config: Configuration = resources.configuration) {
val dayNight = queryDayNight(config)
when (dayNight) {
DayNight.Night -> {
theme.applyStyle(R.style.AppThemeDark, true)
}
DayNight.Day -> {
theme.applyStyle(R.style.AppThemeLight, true)
}
DayNight.Night -> theme.applyStyle(R.style.AppThemeDark, true)
DayNight.Day -> theme.applyStyle(R.style.AppThemeLight, true)
}
window.isAllowForceDarkCompat = false
window.isSystemBarsTranslucentCompat = true
window.statusBarColor = resolveThemedColor(android.R.attr.statusBarColor)
window.navigationBarColor = resolveThemedColor(android.R.attr.navigationBarColor)
if (Build.VERSION.SDK_INT >= 23) {
window.isLightStatusBarsCompat =
resolveThemedBoolean(android.R.attr.windowLightStatusBar)
window.isLightStatusBarsCompat = resolveThemedBoolean(android.R.attr.windowLightStatusBar)
}
if (Build.VERSION.SDK_INT >= 27) {
window.isLightNavigationBarCompat =
resolveThemedBoolean(android.R.attr.windowLightNavigationBar)
window.isLightNavigationBarCompat = resolveThemedBoolean(android.R.attr.windowLightNavigationBar)
}
this.dayNight = dayNight
}
enum class Event {
ServiceRecreated,
ActivityStart,
ActivityStop,
ClashStop,
ClashStart,
ProfileLoaded,
ProfileChanged,
ProfileUpdateCompleted,
ProfileUpdateFailed,
}
}

View File

@@ -0,0 +1,13 @@
package com.github.kr328.clash
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
class DialerReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val intent = Intent(context, MainActivity::class.java)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
}
}

View File

@@ -20,10 +20,13 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import java.util.*
import com.github.kr328.clash.design.R
class ExternalControlActivity : Activity(), CoroutineScope by MainScope() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@Suppress("DEPRECATION")
overridePendingTransition(0, 0)
when(intent.action) {
Intent.ACTION_VIEW -> {
@@ -89,4 +92,10 @@ class ExternalControlActivity : Activity(), CoroutineScope by MainScope() {
stopClashService()
Toast.makeText(this, R.string.external_control_stopped, Toast.LENGTH_LONG).show()
}
override fun finish() {
super.finish()
@Suppress("DEPRECATION")
overridePendingTransition(0, 0)
}
}

View File

@@ -81,24 +81,6 @@ class FilesActivity : BaseActivity<FilesDesign>() {
client.renameDocument(it.file.id, newName)
}
is FilesDesign.Request.ImportFile -> {
if (Build.VERSION.SDK_INT >= 23) {
val hasPermission = ContextCompat.checkSelfPermission(
this@FilesActivity,
Manifest.permission.READ_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED
if (!hasPermission) {
val granted = startActivityForResult(
ActivityResultContracts.RequestPermission(),
Manifest.permission.READ_EXTERNAL_STORAGE,
)
if (!granted) {
return@onReceive
}
}
}
val uri: Uri? = startActivityForResult(
ActivityResultContracts.GetContent(),
"*/*"

View File

@@ -28,6 +28,7 @@ import kotlinx.coroutines.withContext
import java.io.OutputStreamWriter
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
import com.github.kr328.clash.design.R
class LogcatActivity : BaseActivity<LogcatDesign>() {
private var conn: ServiceConnection? = null
@@ -111,7 +112,7 @@ class LogcatActivity : BaseActivity<LogcatDesign>() {
when (it) {
LogcatDesign.Request.Close -> {
stopService(LogcatService::class.intent)
startActivity(LogsActivity::class.intent)
finish()
}
else -> Unit

View File

@@ -14,6 +14,7 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import com.github.kr328.clash.common.compat.getColorCompat
import com.github.kr328.clash.common.compat.pendingIntentFlags
import com.github.kr328.clash.common.compat.startForegroundCompat
import com.github.kr328.clash.common.log.Log
import com.github.kr328.clash.common.util.intent
import com.github.kr328.clash.core.model.LogMessage
@@ -130,17 +131,17 @@ class LogcatService : Service(), CoroutineScope by CoroutineScope(Dispatchers.De
NotificationChannelCompat.Builder(
CHANNEL_ID,
NotificationManagerCompat.IMPORTANCE_DEFAULT
).setName(getString(R.string.clash_logcat)).build()
).setName(getString(com.github.kr328.clash.design.R.string.clash_logcat)).build()
)
}
private fun showNotification() {
val notification = NotificationCompat
.Builder(this, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_logo_service)
.setColor(getColorCompat(R.color.color_clash_light))
.setContentTitle(getString(R.string.clash_logcat))
.setContentText(getString(R.string.running))
.setSmallIcon(com.github.kr328.clash.service.R.drawable.ic_logo_service)
.setColor(getColorCompat(com.github.kr328.clash.design.R.color.color_clash_light))
.setContentTitle(getString(com.github.kr328.clash.design.R.string.clash_logcat))
.setContentText(getString(com.github.kr328.clash.design.R.string.running))
.setContentIntent(
PendingIntent.getActivity(
this,
@@ -152,7 +153,7 @@ class LogcatService : Service(), CoroutineScope by CoroutineScope(Dispatchers.De
)
.build()
startForeground(R.id.nf_logcat_status, notification)
startForegroundCompat(R.id.nf_logcat_status, notification)
}
companion object {

View File

@@ -11,11 +11,8 @@ import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
class LogsActivity : BaseActivity<LogsDesign>() {
override suspend fun main() {
if (LogcatService.running) {
return startActivity(LogcatActivity::class.intent)
}
override suspend fun main() {
val design = LogsDesign(this)
setContentDesign(design)
@@ -38,7 +35,6 @@ class LogsActivity : BaseActivity<LogsDesign>() {
when (it) {
LogsDesign.Request.StartLogcat -> {
startActivity(LogcatActivity::class.intent)
finish()
}
LogsDesign.Request.DeleteAll -> {

View File

@@ -1,6 +1,13 @@
package com.github.kr328.clash
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.os.PersistableBundle
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.result.contract.ActivityResultContracts.RequestPermission
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import com.github.kr328.clash.common.util.intent
import com.github.kr328.clash.common.util.ticker
import com.github.kr328.clash.design.MainDesign
@@ -9,11 +16,13 @@ import com.github.kr328.clash.util.startClashService
import com.github.kr328.clash.util.stopClashService
import com.github.kr328.clash.util.withClash
import com.github.kr328.clash.util.withProfile
import com.github.kr328.clash.core.bridge.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.util.concurrent.TimeUnit
import com.github.kr328.clash.design.R
class MainActivity : BaseActivity<MainDesign>() {
override suspend fun main() {
@@ -50,8 +59,13 @@ class MainActivity : BaseActivity<MainDesign>() {
startActivity(ProfilesActivity::class.intent)
MainDesign.Request.OpenProviders ->
startActivity(ProvidersActivity::class.intent)
MainDesign.Request.OpenLogs ->
startActivity(LogsActivity::class.intent)
MainDesign.Request.OpenLogs -> {
if (LogcatService.running) {
startActivity(LogcatActivity::class.intent)
} else {
startActivity(LogsActivity::class.intent)
}
}
MainDesign.Request.OpenSettings ->
startActivity(SettingsActivity::class.intent)
MainDesign.Request.OpenHelp ->
@@ -125,7 +139,23 @@ class MainActivity : BaseActivity<MainDesign>() {
private suspend fun queryAppVersionName(): String {
return withContext(Dispatchers.IO) {
packageManager.getPackageInfo(packageName, 0).versionName
packageManager.getPackageInfo(packageName, 0).versionName + "\n" + Bridge.nativeCoreVersion().replace("_", "-")
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
val requestPermissionLauncher =
registerForActivityResult(RequestPermission()
) { isGranted: Boolean ->
}
if (ContextCompat.checkSelfPermission(
this,
android.Manifest.permission.POST_NOTIFICATIONS
) != PackageManager.PERMISSION_GRANTED) {
requestPermissionLauncher.launch(android.Manifest.permission.POST_NOTIFICATIONS)
}
}
}
}

View File

@@ -2,21 +2,27 @@ package com.github.kr328.clash
import android.app.Application
import android.content.Context
import android.content.Intent
import androidx.core.content.pm.ShortcutInfoCompat
import androidx.core.content.pm.ShortcutManagerCompat
import androidx.core.graphics.drawable.IconCompat
import com.github.kr328.clash.common.Global
import com.github.kr328.clash.common.compat.currentProcessName
import com.github.kr328.clash.common.constants.Intents
import com.github.kr328.clash.common.log.Log
import com.github.kr328.clash.design.store.UiStore
import com.github.kr328.clash.remote.Remote
import com.github.kr328.clash.service.util.sendServiceRecreated
import com.github.kr328.clash.util.clashDir
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
import com.github.kr328.clash.design.R as DesignR
@Suppress("unused")
class MainApplication : Application() {
private val uiStore by lazy(LazyThreadSafetyMode.NONE) { UiStore(this) }
override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
@@ -33,25 +39,94 @@ class MainApplication : Application() {
if (processName == packageName) {
Remote.launch()
setupShortcuts()
} else {
sendServiceRecreated()
}
}
private fun extractGeoFiles() {
clashDir.mkdirs();
private fun setupShortcuts() {
if (uiStore.hideAppIcon) {
// Prevent launcher activity not found.
ShortcutManagerCompat.removeAllDynamicShortcuts(this)
return
}
val icon = IconCompat.createWithResource(this, R.mipmap.ic_launcher)
val flags = Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS or
Intent.FLAG_ACTIVITY_NO_ANIMATION
val toggle = ShortcutInfoCompat.Builder(this, "toggle_clash")
.setShortLabel(getString(DesignR.string.shortcut_toggle_short))
.setLongLabel(getString(DesignR.string.shortcut_toggle_long))
.setIcon(icon)
.setIntent(
Intent(Intents.ACTION_TOGGLE_CLASH)
.setClassName(this, ExternalControlActivity::class.java.name)
.addFlags(flags)
)
.setRank(0)
.build()
val start = ShortcutInfoCompat.Builder(this, "start_clash")
.setShortLabel(getString(DesignR.string.shortcut_start_short))
.setLongLabel(getString(DesignR.string.shortcut_start_long))
.setIcon(icon)
.setIntent(
Intent(Intents.ACTION_START_CLASH)
.setClassName(this, ExternalControlActivity::class.java.name)
.addFlags(flags)
)
.setRank(1)
.build()
val stop = ShortcutInfoCompat.Builder(this, "stop_clash")
.setShortLabel(getString(DesignR.string.shortcut_stop_short))
.setLongLabel(getString(DesignR.string.shortcut_stop_long))
.setIcon(icon)
.setIntent(
Intent(Intents.ACTION_STOP_CLASH)
.setClassName(this, ExternalControlActivity::class.java.name)
.addFlags(flags)
)
.setRank(2)
.build()
ShortcutManagerCompat.setDynamicShortcuts(this, listOf(toggle, start, stop))
}
private fun extractGeoFiles() {
clashDir.mkdirs()
val updateDate = packageManager.getPackageInfo(packageName, 0).lastUpdateTime
val geoipFile = File(clashDir, "geoip.metadb")
if(!geoipFile.exists()) {
if (geoipFile.exists() && geoipFile.lastModified() < updateDate) {
geoipFile.delete()
}
if (!geoipFile.exists()) {
FileOutputStream(geoipFile).use {
assets.open("geoip.metadb").copyTo(it);
assets.open("geoip.metadb").copyTo(it)
}
}
val geositeFile = File(clashDir, "geosite.dat")
if(!geositeFile.exists()) {
if (geositeFile.exists() && geositeFile.lastModified() < updateDate) {
geositeFile.delete()
}
if (!geositeFile.exists()) {
FileOutputStream(geositeFile).use {
assets.open("geosite.dat").copyTo(it);
assets.open("geosite.dat").copyTo(it)
}
}
val asnFile = File(clashDir, "ASN.mmdb")
if (asnFile.exists() && asnFile.lastModified() < updateDate) {
asnFile.delete()
}
if (!asnFile.exists()) {
FileOutputStream(asnFile).use {
assets.open("ASN.mmdb").copyTo(it)
}
}
}
@@ -59,4 +134,4 @@ class MainApplication : Application() {
fun finalize() {
Global.destroy()
}
}
}

View File

@@ -16,6 +16,7 @@ import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.io.File
import java.io.FileOutputStream
import com.github.kr328.clash.design.R
class MetaFeatureSettingsActivity : BaseActivity<MetaFeatureSettingsDesign>() {
@@ -70,6 +71,12 @@ class MetaFeatureSettingsActivity : BaseActivity<MetaFeatureSettingsDesign>() {
"*/*")
importGeoFile(uri, MetaFeatureSettingsDesign.Request.ImportCountry)
}
MetaFeatureSettingsDesign.Request.ImportASN -> {
val uri = startActivityForResult(
ActivityResultContracts.GetContent(),
"*/*")
importGeoFile(uri, MetaFeatureSettingsDesign.Request.ImportASN)
}
}
}
}
@@ -107,6 +114,8 @@ class MetaFeatureSettingsActivity : BaseActivity<MetaFeatureSettingsDesign>() {
"geosite$ext"
MetaFeatureSettingsDesign.Request.ImportCountry ->
"country$ext"
MetaFeatureSettingsDesign.Request.ImportASN ->
"ASN$ext"
else -> ""
}

View File

@@ -6,15 +6,25 @@ import android.content.Intent
import android.net.Uri
import android.provider.Settings
import androidx.activity.result.contract.ActivityResultContracts
import androidx.lifecycle.lifecycleScope
import com.github.kr328.clash.common.constants.Intents
import com.github.kr328.clash.common.util.intent
import com.github.kr328.clash.common.util.setUUID
import com.github.kr328.clash.design.NewProfileDesign
import com.github.kr328.clash.design.R
import com.github.kr328.clash.design.model.ProfileProvider
import com.github.kr328.clash.design.util.showExceptionToast
import com.github.kr328.clash.service.model.Profile
import com.github.kr328.clash.util.withProfile
import io.github.g00fy2.quickie.QRResult
import io.github.g00fy2.quickie.QRResult.QRError
import io.github.g00fy2.quickie.QRResult.QRMissingPermission
import io.github.g00fy2.quickie.QRResult.QRSuccess
import io.github.g00fy2.quickie.QRResult.QRUserCanceled
import io.github.g00fy2.quickie.ScanQRCode
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.util.*
@@ -23,6 +33,8 @@ class NewProfileActivity : BaseActivity<NewProfileDesign>() {
private val self: NewProfileActivity
get() = this
private val scanLauncher = registerForActivityResult(ScanQRCode(), ::scanResultHandler)
override suspend fun main() {
val design = NewProfileDesign(this)
@@ -44,8 +56,14 @@ class NewProfileActivity : BaseActivity<NewProfileDesign>() {
val uuid: UUID? = when (val p = it.provider) {
is ProfileProvider.File ->
create(Profile.Type.File, name)
is ProfileProvider.Url ->
create(Profile.Type.Url, name)
is ProfileProvider.QR -> {
null
}
is ProfileProvider.External -> {
val data = p.get()
@@ -67,9 +85,14 @@ class NewProfileActivity : BaseActivity<NewProfileDesign>() {
launchProperties(uuid)
}
}
is NewProfileDesign.Request.OpenDetail -> {
launchAppDetailed(it.provider)
}
is NewProfileDesign.Request.LaunchScanner -> {
scanLauncher.launch(null)
}
}
}
}
@@ -137,7 +160,41 @@ class NewProfileActivity : BaseActivity<NewProfileDesign>() {
ProfileProvider.External(name.toString(), summary.toString(), icon, intent)
}
listOf(ProfileProvider.File(self), ProfileProvider.Url(self)) + providers
listOf(
ProfileProvider.File(self),
ProfileProvider.Url(self),
ProfileProvider.QR(self)
) + providers
}
}
private fun scanResultHandler(result: QRResult) {
lifecycleScope.launch {
when (result) {
is QRSuccess -> {
val url = result.content.rawValue
?: result.content.rawBytes?.let { String(it) }.orEmpty()
createProfileByQrCode(url)
}
QRUserCanceled -> {}
QRMissingPermission -> design?.showExceptionToast(getString(R.string.import_from_qr_no_permission))
is QRError -> design?.showExceptionToast(getString(R.string.import_from_qr_exception))
}
}
}
private suspend fun createProfileByQrCode(url: String) {
withProfile {
launchProperties(
create(
type = Profile.Type.Url,
name = getString(R.string.new_profile),
url,
)
)
}
}
}

View File

@@ -45,45 +45,14 @@ class OverrideSettingsActivity : BaseActivity<OverrideSettingsDesign>() {
withClash {
clearOverride(Clash.OverrideSlot.Persist)
}
service.sideloadGeoip = ""
}
finish()
}
}
OverrideSettingsDesign.Request.EditSideloadGeoip -> {
withContext(Dispatchers.IO) {
val list = querySideloadProviders()
val initial = service.sideloadGeoip
val exist = list.any { info -> info.packageName == initial }
service.sideloadGeoip =
design.requestSelectSideload(if (exist) initial else "", list)
}
}
}
}
}
}
}
private fun querySideloadProviders(): List<AppInfo> {
val apps = packageManager.getInstalledPackages(PackageManager.GET_META_DATA)
.filter {
it.applicationInfo.metaData?.containsKey(Metadata.GEOIP_FILE_NAME)
?: false
}
.map { it.toAppInfo(packageManager) }
return listOf(
AppInfo(
packageName = "",
label = getString(R.string.use_built_in),
icon = getDrawableCompat(R.drawable.ic_baseline_work)!!,
installTime = 0,
updateDate = 0,
)
) + apps
}
}

View File

@@ -9,7 +9,6 @@ import com.github.kr328.clash.common.util.setUUID
import com.github.kr328.clash.common.util.ticker
import com.github.kr328.clash.design.ProfilesDesign
import com.github.kr328.clash.design.ui.ToastDuration
import com.github.kr328.clash.R
import com.github.kr328.clash.service.model.Profile
import com.github.kr328.clash.util.withProfile
import kotlinx.coroutines.Dispatchers
@@ -19,6 +18,7 @@ import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.util.*
import java.util.concurrent.TimeUnit
import com.github.kr328.clash.design.R
class ProfilesActivity : BaseActivity<ProfilesDesign>() {
override suspend fun main() {

View File

@@ -12,9 +12,11 @@ import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select
import com.github.kr328.clash.design.R
class PropertiesActivity : BaseActivity<PropertiesDesign>() {
private var canceled: Boolean = false
private lateinit var original: Profile
override suspend fun main() {
setResult(RESULT_CANCELED)
@@ -22,7 +24,7 @@ class PropertiesActivity : BaseActivity<PropertiesDesign>() {
val uuid = intent.uuid ?: return finish()
val design = PropertiesDesign(this)
val original = withProfile { queryByUUID(uuid) } ?: return finish()
original = withProfile { queryByUUID(uuid) } ?: return finish()
design.profile = original
@@ -71,7 +73,7 @@ class PropertiesActivity : BaseActivity<PropertiesDesign>() {
design?.apply {
launch {
if (!progressing) {
if (requestExitWithoutSaving())
if (original == profile || requestExitWithoutSaving())
finish()
}
}

View File

@@ -9,6 +9,7 @@ import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select
import java.util.concurrent.TimeUnit
import com.github.kr328.clash.design.R
class ProvidersActivity : BaseActivity<ProvidersDesign>() {
override suspend fun main() {

View File

@@ -9,11 +9,13 @@ import android.os.Build
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import androidx.annotation.RequiresApi
import com.github.kr328.clash.common.compat.registerReceiverCompat
import com.github.kr328.clash.common.constants.Intents
import com.github.kr328.clash.common.constants.Permissions
import com.github.kr328.clash.remote.StatusClient
import com.github.kr328.clash.util.startClashService
import com.github.kr328.clash.util.stopClashService
import com.github.kr328.clash.service.R
@RequiresApi(Build.VERSION_CODES.N)
class TileService : TileService() {
@@ -36,7 +38,7 @@ class TileService : TileService() {
override fun onStartListening() {
super.onStartListening()
registerReceiver(
registerReceiverCompat(
receiver,
IntentFilter().apply {
addAction(Intents.ACTION_CLASH_STARTED)

View File

@@ -5,6 +5,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import com.github.kr328.clash.common.compat.registerReceiverCompat
import com.github.kr328.clash.common.constants.Intents
import com.github.kr328.clash.common.log.Log
import java.util.*
@@ -88,7 +89,7 @@ class Broadcasts(private val context: Application) {
return
try {
context.registerReceiver(broadcastReceiver, IntentFilter().apply {
context.registerReceiverCompat(broadcastReceiver, IntentFilter().apply {
addAction(Intents.ACTION_SERVICE_RECREATED)
addAction(Intents.ACTION_CLASH_STARTED)
addAction(Intents.ACTION_CLASH_STOPPED)

View File

@@ -7,16 +7,12 @@ import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.withContext
class ActivityResultLifecycle : LifecycleOwner {
private val lifecycle = LifecycleRegistry(this)
override val lifecycle = LifecycleRegistry(this)
init {
lifecycle.currentState = Lifecycle.State.INITIALIZED
}
override fun getLifecycle(): Lifecycle {
return lifecycle
}
suspend fun <T> use(block: suspend (lifecycle: ActivityResultLifecycle, start: () -> Unit) -> T): T {
return try {
markCreated()

View File

@@ -9,7 +9,7 @@ buildscript {
repositories {
mavenCentral()
google()
maven("https://maven.kr328.app/releases")
maven("https://raw.githubusercontent.com/MetaCubeX/maven-backup/main/releases")
}
dependencies {
classpath(libs.build.android)
@@ -24,28 +24,50 @@ subprojects {
repositories {
mavenCentral()
google()
maven("https://maven.kr328.app/releases")
maven("https://raw.githubusercontent.com/MetaCubeX/maven-backup/main/releases")
}
val isApp = name == "app"
apply(plugin = if (isApp) "com.android.application" else "com.android.library")
fun queryConfigProperty(key: String): Any? {
val localProperties = Properties()
val localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localProperties.load(localPropertiesFile.inputStream())
} else {
return null
}
return localProperties.getProperty(key)
}
extensions.configure<BaseExtension> {
buildFeatures.buildConfig = true
defaultConfig {
if (isApp) {
applicationId = "com.github.metacubex.clash"
val customApplicationId = queryConfigProperty("custom.application.id") as? String?
applicationId = customApplicationId.takeIf { it?.isNotBlank() == true } ?: "com.github.metacubex.clash"
}
project.name.let { name ->
namespace = if (name == "app") "com.github.kr328.clash"
else "com.github.kr328.clash.$name"
}
minSdk = 21
targetSdk = 31
targetSdk = 35
versionName = "2.9.0"
versionCode = 209000
versionName = "2.11.27"
versionCode = 211027
resValue("string", "release_name", "v$versionName")
resValue("integer", "release_code", "$versionCode")
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
}
externalNativeBuild {
cmake {
abiFilters("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
@@ -59,7 +81,7 @@ subprojects {
}
}
ndkVersion = "23.0.7599858"
ndkVersion = "29.0.14206865"
compileSdkVersion(defaultConfig.targetSdk!!)
@@ -74,26 +96,39 @@ subprojects {
productFlavors {
flavorDimensions("feature")
create("meta-alpha") {
val removeSuffix = (queryConfigProperty("remove.suffix") as? String)?.toBoolean() == true
create("alpha") {
isDefault = true
dimension = flavorDimensionList[0]
versionNameSuffix = ".Meta-Alpha"
if (!removeSuffix) {
versionNameSuffix = ".Alpha"
}
buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")")
if (isApp) {
applicationIdSuffix = ".meta"
resValue("string", "launch_name", "@string/launch_name_alpha")
resValue("string", "application_name", "@string/application_name_alpha")
if (isApp && !removeSuffix) {
applicationIdSuffix = ".alpha"
}
}
create("meta") {
dimension = flavorDimensionList[0]
versionNameSuffix = ".Meta"
if (!removeSuffix) {
versionNameSuffix = ".Meta"
}
buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")")
if (isApp) {
resValue("string", "launch_name", "@string/launch_name_meta")
resValue("string", "application_name", "@string/application_name_meta")
if (isApp && !removeSuffix) {
applicationIdSuffix = ".meta"
}
}
@@ -103,7 +138,7 @@ subprojects {
getByName("meta") {
java.srcDirs("src/foss/java")
}
getByName("meta-alpha") {
getByName("alpha") {
java.srcDirs("src/foss/java")
}
}
@@ -128,7 +163,7 @@ subprojects {
named("release") {
isMinifyEnabled = isApp
isShrinkResources = isApp
signingConfig = signingConfigs.findByName("release")
signingConfig = signingConfigs.findByName("release") ?: signingConfigs["debug"]
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
@@ -152,9 +187,16 @@ subprojects {
abi {
isEnable = true
isUniversalApk = true
reset()
include("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}
}
@@ -172,4 +214,4 @@ tasks.wrapper {
file("gradle/wrapper/gradle-wrapper.properties")
.appendText("distributionSha256Sum=$sha256")
}
}
}

View File

@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.kr328.clash.common">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<permission
android:name="${applicationId}.permission.RECEIVE_BROADCASTS"

View File

@@ -2,8 +2,13 @@
package com.github.kr328.clash.common.compat
import android.annotation.SuppressLint
import android.content.BroadcastReceiver
import android.content.Context
import android.content.IntentFilter
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Handler
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.core.content.ContextCompat
@@ -14,4 +19,19 @@ fun Context.getColorCompat(@ColorRes id: Int): Int {
fun Context.getDrawableCompat(@DrawableRes id: Int): Drawable? {
return ContextCompat.getDrawable(this, id)
}
}
@SuppressLint("UnspecifiedRegisterReceiverFlag")
fun Context.registerReceiverCompat(
receiver: BroadcastReceiver,
filter: IntentFilter,
permission: String? = null,
handler: Handler? = null
) =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
registerReceiver(receiver, filter, permission, handler,
if (permission == null) Context.RECEIVER_EXPORTED else Context.RECEIVER_NOT_EXPORTED
)
else
registerReceiver(receiver, filter, permission, handler)

View File

@@ -1,7 +1,10 @@
package com.github.kr328.clash.common.compat
import android.app.Notification
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.pm.ServiceInfo
import android.os.Build
fun Context.startForegroundServiceCompat(intent: Intent) {
@@ -10,4 +13,12 @@ fun Context.startForegroundServiceCompat(intent: Intent) {
} else {
startService(intent)
}
}
}
fun Service.startForegroundCompat(id: Int, notification: Notification) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
startForeground(id, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
} else {
startForeground(id, notification)
}
}

1
core/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/src/main/cpp/version.h

View File

@@ -1,8 +1,6 @@
import android.databinding.tool.ext.capitalizeUS
import com.github.kr328.golang.GolangBuildTask
import com.github.kr328.golang.GolangPlugin
import java.io.FileOutputStream
import java.net.URL
import java.time.Duration
plugins {
kotlin("android")
@@ -11,20 +9,16 @@ plugins {
id("golang-android")
}
val geoipDatabaseUrl =
"https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb"
val geoipInvalidate = Duration.ofDays(7)!!
val geoipOutput = buildDir.resolve("intermediates/golang_blob")
val golangSource = file("src/main/golang/native")
golang {
sourceSets {
create("meta-alpha") {
tags.set(listOf("foss","with_gvisor"))
create("alpha") {
tags.set(listOf("foss","with_gvisor","cmfa"))
srcDir.set(file("src/foss/golang"))
}
create("meta") {
tags.set(listOf("foss","with_gvisor"))
tags.set(listOf("foss","with_gvisor","cmfa"))
srcDir.set(file("src/foss/golang"))
}
all {
@@ -68,50 +62,17 @@ afterEvaluate {
}
}
task("downloadGeoipDatabase") {
val databaseFile = geoipOutput.resolve("Country.mmdb")
val moduleFile = geoipOutput.resolve("go.mod")
val sourceFile = geoipOutput.resolve("blob.go")
val abis = listOf("arm64-v8a" to "Arm64V8a", "armeabi-v7a" to "ArmeabiV7a", "x86" to "X86", "x86_64" to "X8664")
val moduleContent = """
module "cfa/blob"
""".trimIndent()
androidComponents.onVariants { variant ->
val cmakeName = if (variant.buildType == "debug") "Debug" else "RelWithDebInfo"
val sourceContent = """
package blob
import _ "embed"
//go:embed Country.mmdb
var GeoipDatabase []byte
""".trimIndent()
outputs.dir(geoipOutput)
onlyIf {
System.currentTimeMillis() - databaseFile.lastModified() > geoipInvalidate.toMillis()
}
doLast {
geoipOutput.mkdirs()
moduleFile.writeText(moduleContent)
sourceFile.writeText(sourceContent)
URL(geoipDatabaseUrl).openConnection().getInputStream().use { input ->
FileOutputStream(databaseFile).use { output ->
input.copyTo(output)
abis.forEach { (abi, goAbi) ->
tasks.configureEach {
if (name.startsWith("buildCMake$cmakeName[$abi]")) {
dependsOn("externalGolangBuild${variant.name.capitalizeUS()}$goAbi")
println("Set up dependency: $name -> externalGolangBuild${variant.name.capitalizeUS()}$goAbi")
}
}
}
}
afterEvaluate {
val downloadTask = tasks["downloadGeoipDatabase"]
tasks.forEach {
if (it.name.startsWith("externalGolangBuild")) {
it.dependsOn(downloadTask)
}
}
}
}

View File

@@ -4,110 +4,114 @@ go 1.20
require cfa v0.0.0
require cfa/blob v0.0.0-00010101000000-000000000000 // indirect
require (
github.com/3andne/restls-client-go v0.1.6 // indirect
github.com/Dreamacro/clash v1.7.0 // indirect
github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34 // indirect
github.com/RyuaNerin/go-krypto v1.0.2 // indirect
github.com/RyuaNerin/go-krypto v1.3.0 // indirect
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/cilium/ebpf v0.12.0 // indirect
github.com/coreos/go-iptables v0.7.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/coreos/go-iptables v0.8.0 // indirect
github.com/dlclark/regexp2 v1.12.0 // indirect
github.com/dunglas/httpsfv v1.0.2 // indirect
github.com/enfein/mieru/v3 v3.31.0 // indirect
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358 // indirect
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 // indirect
github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1 // indirect
github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/gaukas/godicttls v0.0.4 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.3.0 // indirect
github.com/gofrs/uuid/v5 v5.0.0 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a // indirect
github.com/gobwas/ws v1.4.0 // indirect
github.com/gofrs/uuid/v5 v5.4.0 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/reedsolomon v1.12.3 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
github.com/mdlayher/socket v0.5.1 // indirect
github.com/metacubex/amneziawg-go v0.0.0-20251104174305-5a0e9f7e361d // indirect
github.com/metacubex/ascon v0.1.0 // indirect
github.com/metacubex/bart v0.26.0 // indirect
github.com/metacubex/bbolt v0.0.0-20250725135710-010dbbbb7a5b // indirect
github.com/metacubex/blake3 v0.1.0 // indirect
github.com/metacubex/chacha v0.1.5 // indirect
github.com/metacubex/chi v0.1.0 // indirect
github.com/metacubex/connect-ip-go v0.0.0-20260412152424-e1625567920a // indirect
github.com/metacubex/cpu v0.1.1 // indirect
github.com/metacubex/edwards25519 v1.2.0 // indirect
github.com/metacubex/fswatch v0.1.1 // indirect
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 // indirect
github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8 // indirect
github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b // indirect
github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966 // indirect
github.com/metacubex/sing-shadowsocks v0.2.5 // indirect
github.com/metacubex/sing-shadowsocks2 v0.1.4 // indirect
github.com/metacubex/sing-tun v0.1.15-0.20231102032628-0f8a17217e56 // indirect
github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74 // indirect
github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170 // indirect
github.com/miekg/dns v1.1.56 // indirect
github.com/metacubex/gvisor v0.0.0-20251227095601-261ec1326fe8 // indirect
github.com/metacubex/hkdf v0.1.0 // indirect
github.com/metacubex/hpke v0.1.0 // indirect
github.com/metacubex/http v0.1.4 // indirect
github.com/metacubex/kcp-go v0.0.0-20260105040817-550693377604 // indirect
github.com/metacubex/mhurl v0.1.0 // indirect
github.com/metacubex/mihomo v1.7.0 // indirect
github.com/metacubex/mlkem v0.1.0 // indirect
github.com/metacubex/nftables v0.0.0-20260426003805-208c2c1ba2cb // indirect
github.com/metacubex/qpack v0.6.0 // indirect
github.com/metacubex/quic-go v0.59.1-0.20260413153657-53bb22f2c306 // indirect
github.com/metacubex/randv2 v0.2.0 // indirect
github.com/metacubex/restls-client-go v0.1.7 // indirect
github.com/metacubex/sing v0.5.7 // indirect
github.com/metacubex/sing-mux v0.3.9 // indirect
github.com/metacubex/sing-quic v0.0.0-20260414034501-3ea3410d197a // indirect
github.com/metacubex/sing-shadowsocks v0.2.12 // indirect
github.com/metacubex/sing-shadowsocks2 v0.2.7 // indirect
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 // indirect
github.com/metacubex/sing-tun v0.4.18 // indirect
github.com/metacubex/sing-vmess v0.2.5 // indirect
github.com/metacubex/sing-wireguard v0.0.0-20260507084707-690d479ec947 // indirect
github.com/metacubex/smux v0.0.0-20260105030934-d0c8756d3141 // indirect
github.com/metacubex/ssh v0.1.0 // indirect
github.com/metacubex/tfo-go v0.0.0-20251130171125-413e892ac443 // indirect
github.com/metacubex/tls v0.1.5 // indirect
github.com/metacubex/utls v1.8.4 // indirect
github.com/metacubex/wireguard-go v0.0.0-20250820062549-a6cecdd7f57f // indirect
github.com/metacubex/yamux v0.0.0-20250918083631-dd5f17c0be49 // indirect
github.com/miekg/dns v1.1.63 // indirect
github.com/mroth/weightedrand/v2 v2.1.0 // indirect
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 // indirect
github.com/onsi/ginkgo/v2 v2.9.5 // indirect
github.com/openacid/low v0.1.21 // indirect
github.com/oschwald/maxminddb-golang v1.12.0 // indirect
github.com/pierrec/lz4/v4 v4.1.14 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/puzpuzpuz/xsync/v2 v2.5.1 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 // indirect
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 // indirect
github.com/sagernet/sing v0.2.14 // indirect
github.com/sagernet/sing-mux v0.1.3 // indirect
github.com/sagernet/sing-shadowtls v0.1.4 // indirect
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 // indirect
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6 // indirect
github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2 // indirect
github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 // indirect
github.com/shirou/gopsutil/v3 v3.23.9 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect
github.com/samber/lo v1.53.0 // indirect
github.com/sina-ghaderi/poly1305 v0.0.0-20220724002748-c5926b03988b // indirect
github.com/sina-ghaderi/rabaead v0.0.0-20220730151906-ab6e06b96e8c // indirect
github.com/sina-ghaderi/rabbitio v0.0.0-20220730151941-9ce26f4f872e // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
github.com/zhangyunhao116/fastrand v0.3.0 // indirect
github.com/vishvananda/netns v0.0.5 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7 // indirect
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.uber.org/mock v0.3.0 // indirect
go4.org/netipx v0.0.0-20230824141953-6213f710f925 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.10.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)
replace github.com/sagernet/sing => github.com/metacubex/sing v0.0.0-20231001053806-1230641572b9
replace cfa => ../../main/golang
replace github.com/Dreamacro/clash => ./clash
replace github.com/metacubex/mihomo => ./clash
replace cfa/blob => ../../../build/intermediates/golang_blob
replace google.golang.org/protobuf => github.com/metacubex/protobuf-go v0.0.0-20260306035419-7ceee0674686

View File

@@ -1,30 +1,27 @@
github.com/3andne/restls-client-go v0.1.6 h1:tRx/YilqW7iHpgmEL4E1D8dAsuB0tFF3uvncS+B6I08=
github.com/3andne/restls-client-go v0.1.6/go.mod h1:iEdTZNt9kzPIxjIGSMScUFSBrUH6bFRNg0BWlP4orEY=
github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34 h1:USCTqih5d1bUXUxWNS9ZD5Tx/lb0jXHEtRIIx/F9dMc=
github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34/go.mod h1:YR9wK13TgI5ww8iKWm91MHiSoHC7Oz0U4beCCmtXqLw=
github.com/RyuaNerin/go-krypto v1.0.2 h1:9KiZrrBs+tDrQ66dNy4nrX6SzntKtSKdm0wKHhdB4WM=
github.com/RyuaNerin/go-krypto v1.0.2/go.mod h1:17LzMeJCgzGTkPH3TmfzRnEJ/yA7ErhTPp9sxIqONtA=
github.com/RyuaNerin/go-krypto v1.3.0 h1:smavTzSMAx8iuVlGb4pEwl9MD2qicqMzuXR2QWp2/Pg=
github.com/RyuaNerin/go-krypto v1.3.0/go.mod h1:9R9TU936laAIqAmjcHo/LsaXYOZlymudOAxjaBf62UM=
github.com/RyuaNerin/testingutil v0.1.0 h1:IYT6JL57RV3U2ml3dLHZsVtPOP6yNK7WUVdzzlpNrss=
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 h1:cDVUiFo+npB0ZASqnw4q90ylaVAbnYyx0JYqK4YcGok=
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344/go.mod h1:9pIqrY6SXNL8vjRQE5Hd/OL5GyK/9MrGUWs87z/eFfk=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.12.0 h1:oQEuIQIXgYhe1v7sYUG0P9vtJTYZLLdA6tiQmrOB1mo=
github.com/cilium/ebpf v0.12.0/go.mod h1:u9H29/Iq+8cy70YqI6p5pfADkFl3vdnV2qXDg5JL0Zo=
github.com/coreos/go-iptables v0.7.0 h1:XWM3V+MPRr5/q51NuWSgU0fqMad64Zyxs8ZUoMsamr8=
github.com/coreos/go-iptables v0.7.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
github.com/coreos/go-iptables v0.8.0 h1:MPc2P89IhuVpLI7ETL/2tx3XZ61VeICZjYqDEgNsPRc=
github.com/coreos/go-iptables v0.8.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 h1:/5RkVc9Rc81XmMyVqawCiDyrBHZbLAZgTTCqou4mwj8=
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I=
github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8=
github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dunglas/httpsfv v1.0.2 h1:iERDp/YAfnojSDJ7PW3dj1AReJz4MrwbECSSE59JWL0=
github.com/dunglas/httpsfv v1.0.2/go.mod h1:zID2mqw9mFsnt7YC3vYQ9/cjq30q41W+1AnDwH8TiMg=
github.com/enfein/mieru/v3 v3.31.0 h1:Fl2ocRCRXJzMygzdRjBHgqI996ZuIDHUmyQyovSf9sA=
github.com/enfein/mieru/v3 v3.31.0/go.mod h1:zJBUCsi5rxyvHM8fjFf+GLaEl4OEjjBXr1s5F6Qd3hM=
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358 h1:kXYqH/sL8dS/FdoFjr12ePjnLPorPo2FsnrHNuXSDyo=
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I=
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 h1:8j2RH289RJplhA6WfdaPqzg1MjH2K8wX5e0uhAxrw2g=
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391/go.mod h1:K2R7GhgxrlJzHw2qiPWsCZXf/kXEJN9PLnQK73Ll0po=
github.com/ericlagergren/saferand v0.0.0-20220206064634-960a4dd2bc5c h1:RUzBDdZ+e/HEe2Nh8lYsduiPAZygUfVXJn0Ncj5sHMg=
@@ -32,90 +29,133 @@ github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1 h1:tlDMEdcPRQKBE
github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1/go.mod h1:4RfsapbGx2j/vU5xC/5/9qB3kn9Awp1YDiEnN43QrJ4=
github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 h1:fuGucgPk5dN6wzfnxl3D0D3rVLw4v2SbBT9jb4VnxzA=
github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010/go.mod h1:JtBcj7sBuTTRupn7c2bFspMDIObMJsVK8TeUvpShPok=
github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk=
github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.3.0 h1:sbeU3Y4Qzlb+MOzIe6mQGf7QR4Hkv6ZD0qhGkBFL2O0=
github.com/gobwas/ws v1.3.0/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs=
github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc=
github.com/gofrs/uuid/v5 v5.4.0 h1:EfbpCTjqMuGyq5ZJwxqzn3Cbr2d0rUZU7v5ycAk/e/0=
github.com/gofrs/uuid/v5 v5.4.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/tink/go v1.6.1 h1:t7JHqO8Ath2w2ig5vjwQYJzhGEZymedQc90lQXUBa4I=
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a h1:S33o3djA1nPRd+d/bf7jbbXytXuK/EoXow7+aa76grQ=
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a/go.mod h1:zmdm3sTSDP3vOOX3CEWRkkRHtKr1DxBx+J1OQFoDQQs=
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905 h1:q3OEI9RaN/wwcx+qgGo6ZaoJkCiDYe/gjDLfq7lQQF4=
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905/go.mod h1:VvGYjkZoJyKqlmT1yzakUs4mfKMNB0XdODP0+rdml6k=
github.com/josharian/native v1.0.1-0.20221213033349-c1e37c09b531/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA=
github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 h1:EnfXoSqDfSNJv0VBNqY/88RNnhSGYkrHaO0mmFGbVsc=
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40/go.mod h1:vy1vK6wD6j7xX6O6hXe621WabdtNkou2h7uRtTfRMyg=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/reedsolomon v1.12.3 h1:tzUznbfc3OFwJaTebv/QdhnFf2Xvb7gZ24XaHLBPmdc=
github.com/klauspost/reedsolomon v1.12.3/go.mod h1:3K5rXwABAvzGeR01r6pWZieUALXO/Tq7bFKGIb4m4WI=
github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g=
github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw=
github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U=
github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA=
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
github.com/metacubex/amneziawg-go v0.0.0-20251104174305-5a0e9f7e361d h1:vAJ0ZT4aO803F1uw2roIA9yH7Sxzox34tVVyye1bz6c=
github.com/metacubex/amneziawg-go v0.0.0-20251104174305-5a0e9f7e361d/go.mod h1:MsM/5czONyXMJ3PRr5DbQ4O/BxzAnJWOIcJdLzW6qHY=
github.com/metacubex/ascon v0.1.0 h1:6ZWxmXYszT1XXtwkf6nxfFhc/OTtQ9R3Vyj1jN32lGM=
github.com/metacubex/ascon v0.1.0/go.mod h1:eV5oim4cVPPdEL8/EYaTZ0iIKARH9pnhAK/fcT5Kacc=
github.com/metacubex/bart v0.26.0 h1:d/bBTvVatfVWGfQbiDpYKI1bXUJgjaabB2KpK1Tnk6w=
github.com/metacubex/bart v0.26.0/go.mod h1:DCcyfP4MC+Zy7sLK7XeGuMw+P5K9mIRsYOBgiE8icsI=
github.com/metacubex/bbolt v0.0.0-20250725135710-010dbbbb7a5b h1:j7dadXD8I2KTmMt8jg1JcaP1ANL3JEObJPdANKcSYPY=
github.com/metacubex/bbolt v0.0.0-20250725135710-010dbbbb7a5b/go.mod h1:+WmP0VJZDkDszvpa83HzfUp6QzARl/IKkMorH4+nODw=
github.com/metacubex/blake3 v0.1.0 h1:KGnjh/56REO7U+cgZA8dnBhxdP7jByrG7hTP+bu6cqY=
github.com/metacubex/blake3 v0.1.0/go.mod h1:CCkLdzFrqf7xmxCdhQFvJsRRV2mwOLDoSPg6vUTB9Uk=
github.com/metacubex/chacha v0.1.5 h1:fKWMb/5c7ZrY8Uoqi79PPFxl+qwR7X/q0OrsAubyX2M=
github.com/metacubex/chacha v0.1.5/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8=
github.com/metacubex/chi v0.1.0 h1:rjNDyDj50nRpicG43CNkIw4ssiCbmDL8d7wJXKlUCsg=
github.com/metacubex/chi v0.1.0/go.mod h1:zM5u5oMQt8b2DjvDHvzadKrP6B2ztmasL1YHRMbVV+g=
github.com/metacubex/connect-ip-go v0.0.0-20260412152424-e1625567920a h1:Ph5UfTWDsGruZ+v95Df1ycTflQFmpZBFg2LUvj2kx/M=
github.com/metacubex/connect-ip-go v0.0.0-20260412152424-e1625567920a/go.mod h1:xYC8Ik7/rN6no+vTRuWMEziGwm3brA0wNM/zZP9qhOQ=
github.com/metacubex/cpu v0.1.1 h1:rRV5HGmeuGzjiKI3hYbL0dCd0qGwM7VUtk4ICXD06mI=
github.com/metacubex/cpu v0.1.1/go.mod h1:09VEt4dSRLR+bOA8l4w4NDuzGZ8n5dkMv7e8axgEeTU=
github.com/metacubex/edwards25519 v1.2.0 h1:pIQZLBsjQgg3Nl/c86YYFEUAbL5qQRnPq4LrgIw0KK4=
github.com/metacubex/edwards25519 v1.2.0/go.mod h1:NCQF3J/Ki7382FJuokwsywEIIEI/gro/3smyXgQJsx0=
github.com/metacubex/fswatch v0.1.1 h1:jqU7C/v+g0qc2RUFgmAOPoVvfl2BXXUXEumn6oQuxhU=
github.com/metacubex/fswatch v0.1.1/go.mod h1:czrTT7Zlbz7vWft8RQu9Qqh+JoX+Nnb+UabuyN1YsgI=
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 h1:cjd4biTvOzK9ubNCCkQ+ldc4YSH/rILn53l/xGBFHHI=
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759/go.mod h1:UHOv2xu+RIgLwpXca7TLrXleEd4oR3sPatW6IF8wU88=
github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8 h1:npBvaPAT145UY8682AzpUMWpdIxJti/WPLjy7gCiYYs=
github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8/go.mod h1:ZR6Gas7P1GcADCVBc1uOrA0bLQqDDyp70+63fD/BE2c=
github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b h1:uZ++sW8yg7Fr/Wvmmrb/V+SfxvRs0iMC+2+u2bRmO8g=
github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b/go.mod h1:4pe6cY+nAMFU/Uxn1rfnxNIowsaJGDQ3uyy4VuiPkP4=
github.com/metacubex/sing v0.0.0-20231001053806-1230641572b9 h1:F0+IuW0tZ96QHEmrebXAdYnz7ab7Gz4l5yYC4g6Cg8k=
github.com/metacubex/sing v0.0.0-20231001053806-1230641572b9/go.mod h1:GQ673iPfUnkbK/dIPkfd1Xh1MjOGo36gkl/mkiHY7Jg=
github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966 h1:wbOsbU3kfD5LRuJIntJwEPmgGSQukof8CgLNypi8az8=
github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966/go.mod h1:GU7g2AZesXItk4CspDP8Dc7eGtlA2GVDihyCwsUXRSo=
github.com/metacubex/sing-shadowsocks v0.2.5 h1:O2RRSHlKGEpAVG/OHJQxyHqDy8uvvdCW/oW2TDBOIhc=
github.com/metacubex/sing-shadowsocks v0.2.5/go.mod h1:Xz2uW9BEYGEoA8B4XEpoxt7ERHClFCwsMAvWaruoyMo=
github.com/metacubex/sing-shadowsocks2 v0.1.4 h1:OOCf8lgsVcpTOJUeaFAMzyKVebaQOBnKirDdUdBoKIE=
github.com/metacubex/sing-shadowsocks2 v0.1.4/go.mod h1:Qz028sLfdY3qxGRm9FDI+IM2Ae3ty2wR7HIzD/56h/k=
github.com/metacubex/sing-tun v0.1.15-0.20231102032628-0f8a17217e56 h1:ietLSuWRlYrNukGEEn/WXioB4OKPebqpZCc93MRKxEU=
github.com/metacubex/sing-tun v0.1.15-0.20231102032628-0f8a17217e56/go.mod h1:Q7zmpJ+qOvMMXyUoYlxGQuWkqALUpXzFSSqO+KLPyzA=
github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74 h1:FtupiyFkaVjFvRa7B/uDtRWg5BNsoyPC9MTev3sDasY=
github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74/go.mod h1:8EWBZpc+qNvf5gmvjAtMHK1/DpcWqzfcBL842K00BsM=
github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170 h1:DBGA0hmrP4pVIwLiXUONdphjcppED+plmVaKf1oqkwk=
github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170/go.mod h1:/VbJfbdLnANE+SKXyMk/96sTRrD4GdFLh5mkegqqFcY=
github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE=
github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY=
github.com/metacubex/gvisor v0.0.0-20251227095601-261ec1326fe8 h1:hUL81H0Ic/XIDkvtn9M1pmfDdfid7JzYQToY4Ps1TvQ=
github.com/metacubex/gvisor v0.0.0-20251227095601-261ec1326fe8/go.mod h1:8LpS0IJW1VmWzUm3ylb0e2SK5QDm5lO/2qwWLZgRpBU=
github.com/metacubex/hkdf v0.1.0 h1:fPA6VzXK8cU1foc/TOmGCDmSa7pZbxlnqhl3RNsthaA=
github.com/metacubex/hkdf v0.1.0/go.mod h1:3seEfds3smgTAXqUGn+tgEJH3uXdsUjOiduG/2EtvZ4=
github.com/metacubex/hpke v0.1.0 h1:gu2jUNhraehWi0P/z5HX2md3d7L1FhPQE6/Q0E9r9xQ=
github.com/metacubex/hpke v0.1.0/go.mod h1:vfDm6gfgrwlXUxKDkWbcE44hXtmc1uxLDm2BcR11b3U=
github.com/metacubex/http v0.1.4 h1:gU1y8WlqslzxGmedW2ah74fGL6wJYU2HXUkCMJtCa2A=
github.com/metacubex/http v0.1.4/go.mod h1:Nxx0zZAo2AhRfanyL+fmmK6ACMtVsfpwIl1aFAik2Eg=
github.com/metacubex/kcp-go v0.0.0-20260105040817-550693377604 h1:hJwCVlE3ojViC35MGHB+FBr8TuIf3BUFn2EQ1VIamsI=
github.com/metacubex/kcp-go v0.0.0-20260105040817-550693377604/go.mod h1:lpmN3m269b3V5jFCWtffqBLS4U3QQoIid9ugtO+OhVc=
github.com/metacubex/mhurl v0.1.0 h1:ZdW4Zxe3j3uJ89gNytOazHu6kbHn5owutN/VfXOI8GE=
github.com/metacubex/mhurl v0.1.0/go.mod h1:2qpQImCbXoUs6GwJrjuEXKelPyoimsIXr07eNKZdS00=
github.com/metacubex/mlkem v0.1.0 h1:wFClitonSFcmipzzQvax75beLQU+D7JuC+VK1RzSL8I=
github.com/metacubex/mlkem v0.1.0/go.mod h1:amhaXZVeYNShuy9BILcR7P0gbeo/QLZsnqCdL8U2PDQ=
github.com/metacubex/nftables v0.0.0-20260426003805-208c2c1ba2cb h1:wk6mHYPURSUvWcUv72gNP79oiylFsscBSDPJ6ieV6Iw=
github.com/metacubex/nftables v0.0.0-20260426003805-208c2c1ba2cb/go.mod h1:73ZrCfhdkW4F2E2GAlta3km/S2RHhFNogCMtWZV2anQ=
github.com/metacubex/protobuf-go v0.0.0-20260306035419-7ceee0674686 h1:PIXmYT2anQt9V8vdmwixtbIJxOpoPXJfIACHPjXEgnE=
github.com/metacubex/protobuf-go v0.0.0-20260306035419-7ceee0674686/go.mod h1:eQV7juxFZIdRgjMxtVqP+6BssKoTZQ1RM0fc58BsCZY=
github.com/metacubex/qpack v0.6.0 h1:YqClGIMOpiRYLjV1qOs483Od08MdPgRnHjt90FuaAKw=
github.com/metacubex/qpack v0.6.0/go.mod h1:lKGSi7Xk94IMvHGOmxS9eIei3bvIqpOAImEBsaOwTkA=
github.com/metacubex/quic-go v0.59.1-0.20260413153657-53bb22f2c306 h1:HlGLmLsWJMLSu0CMI9z/BmEnithB4oXM5Rom6/0Qxtg=
github.com/metacubex/quic-go v0.59.1-0.20260413153657-53bb22f2c306/go.mod h1:oNzMrmylS897M3zSMuapIdwSwfq6F2qW01Z3NhVRJhk=
github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs=
github.com/metacubex/randv2 v0.2.0/go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY=
github.com/metacubex/restls-client-go v0.1.7 h1:eCwiXCTQb5WJu9IlgYvDBA1OgrINv58dEe7hcN5H15k=
github.com/metacubex/restls-client-go v0.1.7/go.mod h1:BN/U52vPw7j8VTSh2vleD/MnmVKCov84mS5VcjVHH4g=
github.com/metacubex/sing v0.5.7 h1:8OC+fhKFSv/l9ehEhJRaZZAOuthfZo68SteBVLe8QqM=
github.com/metacubex/sing v0.5.7/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w=
github.com/metacubex/sing-mux v0.3.9 h1:/aoBD2+sK2qsXDlNDe3hkR0GZuFDtwIZhOeGUx9W0Yk=
github.com/metacubex/sing-mux v0.3.9/go.mod h1:8bT7ZKT3clRrJjYc/x5CRYibC1TX/bK73a3r3+2E+Fc=
github.com/metacubex/sing-quic v0.0.0-20260414034501-3ea3410d197a h1:977o0ZYYbiQAGuOxql7Q6UN3rEy59OyAE0tELq4gZfI=
github.com/metacubex/sing-quic v0.0.0-20260414034501-3ea3410d197a/go.mod h1:6ayFGfzzBE85csgQkM3gf4neFq6s0losHlPRSxY+nuk=
github.com/metacubex/sing-shadowsocks v0.2.12 h1:Wqzo8bYXrK5aWqxu/TjlTnYZzAKtKsaFQBdr6IHFaBE=
github.com/metacubex/sing-shadowsocks v0.2.12/go.mod h1:2e5EIaw0rxKrm1YTRmiMnDulwbGxH9hAFlrwQLQMQkU=
github.com/metacubex/sing-shadowsocks2 v0.2.7 h1:hSuuc0YpsfiqYqt1o+fP4m34BQz4e6wVj3PPBVhor3A=
github.com/metacubex/sing-shadowsocks2 v0.2.7/go.mod h1:vOEbfKC60txi0ca+yUlqEwOGc3Obl6cnSgx9Gf45KjE=
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 h1:gXU+MYPm7Wme3/OAY2FFzVq9d9GxPHOqu5AQfg/ddhI=
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2/go.mod h1:mbfboaXauKJNIHJYxQRa+NJs4JU9NZfkA+I33dS2+9E=
github.com/metacubex/sing-tun v0.4.18 h1:WRzAosG0YkT3aZq5RJWtF+RdCgeJ8EpooS5ZM1lkXo0=
github.com/metacubex/sing-tun v0.4.18/go.mod h1:g4I/JNplDBhXLF+aQWgFbhNeJPSXQOWS9HvLeNvkgeA=
github.com/metacubex/sing-vmess v0.2.5 h1:m9Zt5I27lB9fmLMZfism9sH2LcnAfShZfwSkf6/KJoE=
github.com/metacubex/sing-vmess v0.2.5/go.mod h1:AwtlzUgf8COe9tRYAKqWZ+leDH7p5U98a0ZUpYehl8Q=
github.com/metacubex/sing-wireguard v0.0.0-20260507084707-690d479ec947 h1:IB03BvRQtvjWScyOK5jSQVJYY8osmZXHL+4VCEFMWcM=
github.com/metacubex/sing-wireguard v0.0.0-20260507084707-690d479ec947/go.mod h1:jpAkVLPnCpGSfNyVmj6Cq4YbuZsFepm/Dc+9BAOcR80=
github.com/metacubex/smux v0.0.0-20260105030934-d0c8756d3141 h1:DK2l6m2Fc85H2BhiAPgbJygiWhesPlfGmF+9Vw6ARdk=
github.com/metacubex/smux v0.0.0-20260105030934-d0c8756d3141/go.mod h1:/yI4OiGOSn0SURhZdJF3CbtPg3nwK700bG8TZLMBvAg=
github.com/metacubex/ssh v0.1.0 h1:iGfr99qk/eMHzUnQ/0bTxXT8+8SWqLSHBWDHoAhngzw=
github.com/metacubex/ssh v0.1.0/go.mod h1:NUtl0d+/f2cG9ECEpMM8iCVOpmggQlC13oLeDUONDlU=
github.com/metacubex/tfo-go v0.0.0-20251130171125-413e892ac443 h1:H6TnfM12tOoTizYE/qBHH3nEuibIelmHI+BVSxVJr8o=
github.com/metacubex/tfo-go v0.0.0-20251130171125-413e892ac443/go.mod h1:l9oLnLoEXyGZ5RVLsh7QCC5XsouTUyKk4F2nLm2DHLw=
github.com/metacubex/tls v0.1.5 h1:ECcB83dj+zadnhlKcLnUUf1Sq6+vU0f/zoyU0+9oPTc=
github.com/metacubex/tls v0.1.5/go.mod h1:0XeVdL0cBw+8i5Hqy3lVeP9IyD/LFTq02ExvHM6rzEM=
github.com/metacubex/utls v1.8.4 h1:HmL9nUApDdWSkgUyodfwF6hSjtiwCGGdyhaSpEejKpg=
github.com/metacubex/utls v1.8.4/go.mod h1:kncGGVhFaoGn5M3pFe3SXhZCzsbCJayNOH4UEqTKTko=
github.com/metacubex/wireguard-go v0.0.0-20250820062549-a6cecdd7f57f h1:FGBPRb1zUabhPhDrlKEjQ9lgIwQ6cHL4x8M9lrERhbk=
github.com/metacubex/wireguard-go v0.0.0-20250820062549-a6cecdd7f57f/go.mod h1:oPGcV994OGJedmmxrcK9+ni7jUEMGhR+uVQAdaduIP4=
github.com/metacubex/yamux v0.0.0-20250918083631-dd5f17c0be49 h1:lhlqpYHopuTLx9xQt22kSA9HtnyTDmk5XjjQVCGHe2E=
github.com/metacubex/yamux v0.0.0-20250918083631-dd5f17c0be49/go.mod h1:MBeEa9IVBphH7vc3LNtW6ZujVXFizotPo3OEiHQ+TNU=
github.com/miekg/dns v1.1.63 h1:8M5aAw6OMZfFXTT7K5V0Eu5YiiL8l7nUAkyN6C9YwaY=
github.com/miekg/dns v1.1.63/go.mod h1:6NGHfjhpmr5lt3XPLuyfDJi5AXbNIPM9PY6H6sF1Nfs=
github.com/mroth/weightedrand/v2 v2.1.0 h1:o1ascnB1CIVzsqlfArQQjeMy1U0NcIbBO5rfd5E/OeU=
github.com/mroth/weightedrand/v2 v2.1.0/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU=
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 h1:1102pQc2SEPp5+xrS26wEaeb26sZy6k9/ZXlZN+eXE4=
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7/go.mod h1:UqoUn6cHESlliMhOnKLWr+CBH+e3bazUPvFj1XZwAjs=
github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/openacid/errors v0.8.1/go.mod h1:GUQEJJOJE3W9skHm8E8Y4phdl2LLEN8iD7c5gcGgdx0=
github.com/openacid/low v0.1.21 h1:Tr2GNu4N/+rGRYdOsEHOE89cxUIaDViZbVmKz29uKGo=
github.com/openacid/low v0.1.21/go.mod h1:q+MsKI6Pz2xsCkzV4BLj7NR5M4EX0sGz5AqotpZDVh0=
@@ -128,136 +168,84 @@ github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFu
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU=
github.com/puzpuzpuz/xsync/v2 v2.5.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU=
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=
github.com/quic-go/qtls-go1-20 v0.3.4/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 h1:5+m7c6AkmAylhauulqN/c5dnh8/KssrE9c93TQrXldA=
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61/go.mod h1:QUQ4RRHD6hGGHdFMEtR8T2P6GS6R3D/CXKdaYHKKXms=
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 h1:iL5gZI3uFp0X6EslacyapiRz7LLSJyr4RajF/BhMVyE=
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
github.com/sagernet/sing-mux v0.1.3 h1:fAf7PZa2A55mCeh0KKM02f1k2Y4vEmxuZZ/51ahkkLA=
github.com/sagernet/sing-mux v0.1.3/go.mod h1:wGeIeiiFLx4HUM5LAg65wrNZ/X1muOimqK0PEhNbPi0=
github.com/sagernet/sing-shadowtls v0.1.4 h1:aTgBSJEgnumzFenPvc+kbD9/W0PywzWevnVpEx6Tw3k=
github.com/sagernet/sing-shadowtls v0.1.4/go.mod h1:F8NBgsY5YN2beQavdgdm1DPlhaKQlaL6lpDdcBglGK4=
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 h1:HuE6xSwco/Xed8ajZ+coeYLmioq0Qp1/Z2zczFaV8as=
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37/go.mod h1:3skNSftZDJWTGVtVaM2jfbce8qHnmH/AGDRe62iNOg0=
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6 h1:Px+hN4Vzgx+iCGVnWH5A8eR7JhNnIV3rGQmBxA7cw6Q=
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6/go.mod h1:zovq6vTvEM6ECiqE3Eeb9rpIylPpamPcmrJ9tv0Bt0M=
github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2 h1:kDUqhc9Vsk5HJuhfIATJ8oQwBmpOZJuozQG7Vk88lL4=
github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2/go.mod h1:JKQMZq/O2qnZjdrt+B57olmfgEmLtY9iiSIEYtWvoSM=
github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f h1:Kvo8w8Y9lzFGB/7z09MJ3TR99TFtfI/IuY87Ygcycho=
github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f/go.mod h1:mySs0abhpc/gLlvhoq7HP1RzOaRmIXVeZGCh++zoApk=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 h1:rc/CcqLH3lh8n+csdOuDfP+NuykE0U6AeYSJJHKDgSg=
github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9/go.mod h1:a/83NAfUXvEuLpmxDssAXxgUgrEy12MId3Wd7OTs76s=
github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E=
github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZNjr6sGeT00J8uU7JF4cNUdb44/Duis=
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
github.com/samber/lo v1.53.0 h1:t975lj2py4kJPQ6haz1QMgtId2gtmfktACxIXArw3HM=
github.com/samber/lo v1.53.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
github.com/sina-ghaderi/poly1305 v0.0.0-20220724002748-c5926b03988b h1:rXHg9GrUEtWZhEkrykicdND3VPjlVbYiLdX9J7gimS8=
github.com/sina-ghaderi/poly1305 v0.0.0-20220724002748-c5926b03988b/go.mod h1:X7qrxNQViEaAN9LNZOPl9PfvQtp3V3c7LTo0dvGi0fM=
github.com/sina-ghaderi/rabaead v0.0.0-20220730151906-ab6e06b96e8c h1:DjKMC30y6yjG3IxDaeAj3PCoRr+IsO+bzyT+Se2m2Hk=
github.com/sina-ghaderi/rabaead v0.0.0-20220730151906-ab6e06b96e8c/go.mod h1:NV/a66PhhWYVmUMaotlXJ8fIEFB98u+c8l/CQIEFLrU=
github.com/sina-ghaderi/rabbitio v0.0.0-20220730151941-9ce26f4f872e h1:ur8uMsPIFG3i4Gi093BQITvwH9znsz2VUZmnmwHvpIo=
github.com/sina-ghaderi/rabbitio v0.0.0-20220730151941-9ce26f4f872e/go.mod h1:+e5fBW3bpPyo+3uLo513gIUblc03egGjMM0+5GKbzK8=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 h1:tHNk7XK9GkmKUR6Gh8gVBKXc2MVSZ4G/NnWLtzw4gNA=
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923/go.mod h1:eLL9Nub3yfAho7qB0MzZizFhTU2QkLeoVsWdHtDW264=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695APm9hlsSMoOoE65U4/TcqNj90mc69Rlg=
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/zhangyunhao116/fastrand v0.3.0 h1:7bwe124xcckPulX6fxtr2lFdO2KQqaefdtbk+mqO/Ig=
github.com/zhangyunhao116/fastrand v0.3.0/go.mod h1:0v5KgHho0VE6HU192HnY15de/oDS8UrbBChIFjIhBtc=
github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY=
github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7 h1:UNrDfkQqiEYzdMlNsVvBYOAJWZjdktqFE9tQh5BT2+4=
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7/go.mod h1:E+rxHvJG9H6PUdzq9NRG6csuLN3XUx98BfGOVWNYnXs=
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec h1:FpfFs4EhNehiVfzQttTuxanPIT43FtkkCFypIod8LHo=
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAoRPbCxum9Grlv5aeksu2H8BiKehBYooU2LFiOQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
go4.org/netipx v0.0.0-20230824141953-6213f710f925 h1:eeQDDVKFkx0g4Hyy8pHgmZaK0EqB4SD6rvKbUdN3ziQ=
go4.org/netipx v0.0.0-20230824141953-6213f710f925/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=
lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=

View File

@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.kr328.clash.core">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@@ -1,7 +1,50 @@
cmake_minimum_required(VERSION 3.0)
# 获取git hash
message(STATUS "CMAKE_CURRENT_SOURCE_DIR= ${CMAKE_CURRENT_SOURCE_DIR}")
execute_process(
COMMAND git submodule foreach git log -1 --format=%H
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE COMMIT_HASH
)
string(REPLACE "\n" ";" COMMIT_HASH "${COMMIT_HASH}")
list(GET COMMIT_HASH 1 COMMIT_HASH)
string (REGEX REPLACE "[\n\t\r]" "" COMMIT_HASH ${COMMIT_HASH})
string(SUBSTRING ${COMMIT_HASH} 0 7 COMMIT_HASH)
message(STATUS "git hash= ${COMMIT_HASH}")
# 获取分支名称
execute_process(
COMMAND git submodule foreach git branch -r --contains ${COMMIT_HASH}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE CURRENT_BRANCH
)
string(REPLACE "\n" ";" CURRENT_BRANCH "${CURRENT_BRANCH}")
list(GET CURRENT_BRANCH 1 CURRENT_BRANCH)
string (REGEX REPLACE "origin/" "" CURRENT_BRANCH ${CURRENT_BRANCH})
string (REGEX REPLACE "[\n\t\r]" "" CURRENT_BRANCH ${CURRENT_BRANCH})
#string(SUBSTRING ${CURRENT_BRANCH} 0 8 CURRENT_BRANCH)
message(STATUS "git current branch = ${CURRENT_BRANCH}")
# 获取生成时间
string(TIMESTAMP COMPILE_TIME "%y%m%d")
string (REGEX REPLACE "[\n\t\r]" "" COMPILE_TIME ${COMPILE_TIME})
string(REGEX REPLACE "\"" "" COMPILE_TIME ${COMPILE_TIME})
# 生成版本信息
set(GIT_VERSION "${CURRENT_BRANCH}_${COMMIT_HASH}_${COMPILE_TIME}")
message(STATUS "version info = ${GIT_VERSION}")
# 去除空格
string(REGEX REPLACE "[ ]+" "" GIT_VERSION "${GIT_VERSION}")
# 保存变量到文件
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h @ONLY)
project(clash-bridge C)
set(CMAKE_POSITION_INDEPENDENT_CODE on)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
@@ -23,4 +66,4 @@ include_directories("${GO_SOURCE}")
link_directories("${GO_OUTPUT_BASE}/${CMAKE_ANDROID_ARCH_ABI}")
add_library(bridge SHARED main.c jni_helper.c bridge_helper.c)
target_link_libraries(bridge log clash)
target_link_libraries(bridge log clash)

View File

@@ -8,6 +8,9 @@
#include "jni_helper.h"
#include "trace.h"
#include "version.h" // 添加当前编译core版本号变量
JNIEXPORT void JNICALL
Java_com_github_kr328_clash_core_bridge_Bridge_nativeInit(JNIEnv *env, jobject thiz,
jstring home,
@@ -16,8 +19,9 @@ Java_com_github_kr328_clash_core_bridge_Bridge_nativeInit(JNIEnv *env, jobject t
scoped_string _home = get_string(home);
scoped_string _version_name = get_string(version_name);
char* _git_version = make_String(GIT_VERSION);
coreInit(_home, _version_name, sdk_version);
coreInit(_home, _version_name, _git_version, sdk_version);
}
JNIEXPORT void JNICALL
@@ -108,18 +112,20 @@ Java_com_github_kr328_clash_core_bridge_Bridge_nativeNotifyInstalledAppChanged(J
JNIEXPORT void JNICALL
Java_com_github_kr328_clash_core_bridge_Bridge_nativeStartTun(JNIEnv *env, jobject thiz,
jint fd,
jstring stack,
jstring gateway,
jstring portal,
jstring dns,
jobject cb) {
TRACE_METHOD();
scoped_string _stack = get_string(stack);
scoped_string _gateway = get_string(gateway);
scoped_string _portal = get_string(portal);
scoped_string _dns = get_string(dns);
jobject _interface = new_global(cb);
startTun(fd, _gateway, _portal, _dns, _interface);
startTun(fd, _stack, _gateway, _portal, _dns, _interface);
}
JNIEXPORT void JNICALL
@@ -284,33 +290,6 @@ Java_com_github_kr328_clash_core_bridge_Bridge_nativeClearOverride(JNIEnv *env,
clearOverride(slot);
}
JNIEXPORT void JNICALL
Java_com_github_kr328_clash_core_bridge_Bridge_nativeInstallSideloadGeoip(JNIEnv *env, jobject thiz,
jbyteArray data) {
TRACE_METHOD();
if (data == NULL) {
installSideloadGeoip(NULL, 0);
return;
}
jbyte *bytes = (*env)->GetByteArrayElements(env, data, NULL);
int size = (*env)->GetArrayLength(env, data);
scoped_string err = installSideloadGeoip(bytes, size);
(*env)->ReleaseByteArrayElements(env, data, bytes, JNI_ABORT);
if (err != NULL) {
(*env)->ThrowNew(
env,
find_class("com/github/kr328/clash/core/bridge/ClashException"),
err
);
}
}
JNIEXPORT jstring JNICALL
Java_com_github_kr328_clash_core_bridge_Bridge_nativeQueryConfiguration(JNIEnv *env, jobject thiz) {
TRACE_METHOD();
@@ -330,6 +309,7 @@ Java_com_github_kr328_clash_core_bridge_Bridge_nativeSubscribeLogcat(JNIEnv *env
subscribeLogcat(_callback);
}
static jmethodID m_tun_interface_mark_socket;
static jmethodID m_tun_interface_query_socket_uid;
static jmethodID m_completable_complete;
@@ -537,4 +517,13 @@ JNI_OnLoad(JavaVM *vm, void *reserved) {
release_object_func = &release_jni_object_impl;
return JNI_VERSION_1_6;
}
JNIEXPORT jstring JNICALL
Java_com_github_kr328_clash_core_bridge_Bridge_nativeCoreVersion(JNIEnv *env, jobject thiz) {
TRACE_METHOD();
char* Version = make_String(GIT_VERSION);
return new_string(Version);
}

View File

@@ -0,0 +1,12 @@
#ifndef VERSION_H_IN
#define VERSION_H_IN
/**
* 当前编译core版本号
*/
#define GIT_VERSION @GIT_VERSION@
#define make_Str(x) #x
#define make_String(x) make_Str(x)
#endif

View File

@@ -5,7 +5,6 @@
<option name="MOVE_ALL_IMPORTS_IN_ONE_DECLARATION" value="true" />
<option name="MOVE_ALL_STDLIB_IMPORTS_IN_ONE_GROUP" value="true" />
<option name="GROUP_STDLIB_IMPORTS" value="true" />
<option name="GROUP_CURRENT_PROJECT_IMPORTS" value="true" />
</GoCodeStyleSettings>
</code_scheme>
</component>

View File

@@ -3,106 +3,114 @@ module cfa
go 1.20
require (
github.com/Dreamacro/clash v1.7.0
github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34
github.com/dlclark/regexp2 v1.10.0
github.com/miekg/dns v1.1.56
github.com/oschwald/maxminddb-golang v1.12.0
golang.org/x/sync v0.4.0
gopkg.in/yaml.v2 v2.4.0
github.com/dlclark/regexp2 v1.12.0
github.com/metacubex/mihomo v1.7.0
golang.org/x/sync v0.11.0
)
replace github.com/Dreamacro/clash => ../../foss/golang/clash
replace github.com/sagernet/sing => github.com/metacubex/sing v0.0.0-20231001053806-1230641572b9
replace github.com/metacubex/mihomo => ../../foss/golang/clash
require (
github.com/3andne/restls-client-go v0.1.6 // indirect
github.com/RyuaNerin/go-krypto v1.0.2 // indirect
github.com/RyuaNerin/go-krypto v1.3.0 // indirect
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/cilium/ebpf v0.12.0 // indirect
github.com/coreos/go-iptables v0.7.0 // indirect
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/coreos/go-iptables v0.8.0 // indirect
github.com/dunglas/httpsfv v1.0.2 // indirect
github.com/enfein/mieru/v3 v3.31.0 // indirect
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358 // indirect
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 // indirect
github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1 // indirect
github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/gaukas/godicttls v0.0.4 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.3.0 // indirect
github.com/gofrs/uuid/v5 v5.0.0 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a // indirect
github.com/gobwas/ws v1.4.0 // indirect
github.com/gofrs/uuid/v5 v5.4.0 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/reedsolomon v1.12.3 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
github.com/mdlayher/socket v0.5.1 // indirect
github.com/metacubex/amneziawg-go v0.0.0-20251104174305-5a0e9f7e361d // indirect
github.com/metacubex/ascon v0.1.0 // indirect
github.com/metacubex/bart v0.26.0 // indirect
github.com/metacubex/bbolt v0.0.0-20250725135710-010dbbbb7a5b // indirect
github.com/metacubex/blake3 v0.1.0 // indirect
github.com/metacubex/chacha v0.1.5 // indirect
github.com/metacubex/chi v0.1.0 // indirect
github.com/metacubex/connect-ip-go v0.0.0-20260412152424-e1625567920a // indirect
github.com/metacubex/cpu v0.1.1 // indirect
github.com/metacubex/edwards25519 v1.2.0 // indirect
github.com/metacubex/fswatch v0.1.1 // indirect
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 // indirect
github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8 // indirect
github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b // indirect
github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966 // indirect
github.com/metacubex/sing-shadowsocks v0.2.5 // indirect
github.com/metacubex/sing-shadowsocks2 v0.1.4 // indirect
github.com/metacubex/sing-tun v0.1.15-0.20231102032628-0f8a17217e56 // indirect
github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74 // indirect
github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170 // indirect
github.com/metacubex/gvisor v0.0.0-20251227095601-261ec1326fe8 // indirect
github.com/metacubex/hkdf v0.1.0 // indirect
github.com/metacubex/hpke v0.1.0 // indirect
github.com/metacubex/http v0.1.4 // indirect
github.com/metacubex/kcp-go v0.0.0-20260105040817-550693377604 // indirect
github.com/metacubex/mhurl v0.1.0 // indirect
github.com/metacubex/mlkem v0.1.0 // indirect
github.com/metacubex/nftables v0.0.0-20260426003805-208c2c1ba2cb // indirect
github.com/metacubex/qpack v0.6.0 // indirect
github.com/metacubex/quic-go v0.59.1-0.20260413153657-53bb22f2c306 // indirect
github.com/metacubex/randv2 v0.2.0 // indirect
github.com/metacubex/restls-client-go v0.1.7 // indirect
github.com/metacubex/sing v0.5.7 // indirect
github.com/metacubex/sing-mux v0.3.9 // indirect
github.com/metacubex/sing-quic v0.0.0-20260414034501-3ea3410d197a // indirect
github.com/metacubex/sing-shadowsocks v0.2.12 // indirect
github.com/metacubex/sing-shadowsocks2 v0.2.7 // indirect
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 // indirect
github.com/metacubex/sing-tun v0.4.18 // indirect
github.com/metacubex/sing-vmess v0.2.5 // indirect
github.com/metacubex/sing-wireguard v0.0.0-20260507084707-690d479ec947 // indirect
github.com/metacubex/smux v0.0.0-20260105030934-d0c8756d3141 // indirect
github.com/metacubex/ssh v0.1.0 // indirect
github.com/metacubex/tfo-go v0.0.0-20251130171125-413e892ac443 // indirect
github.com/metacubex/tls v0.1.5 // indirect
github.com/metacubex/utls v1.8.4 // indirect
github.com/metacubex/wireguard-go v0.0.0-20250820062549-a6cecdd7f57f // indirect
github.com/metacubex/yamux v0.0.0-20250918083631-dd5f17c0be49 // indirect
github.com/miekg/dns v1.1.63 // indirect
github.com/mroth/weightedrand/v2 v2.1.0 // indirect
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 // indirect
github.com/onsi/ginkgo/v2 v2.9.5 // indirect
github.com/openacid/low v0.1.21 // indirect
github.com/oschwald/maxminddb-golang v1.12.0 // indirect
github.com/pierrec/lz4/v4 v4.1.14 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/puzpuzpuz/xsync/v2 v2.5.1 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 // indirect
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 // indirect
github.com/sagernet/sing v0.2.14 // indirect
github.com/sagernet/sing-mux v0.1.3 // indirect
github.com/sagernet/sing-shadowtls v0.1.4 // indirect
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 // indirect
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6 // indirect
github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2 // indirect
github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 // indirect
github.com/shirou/gopsutil/v3 v3.23.9 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect
github.com/samber/lo v1.53.0 // indirect
github.com/sina-ghaderi/poly1305 v0.0.0-20220724002748-c5926b03988b // indirect
github.com/sina-ghaderi/rabaead v0.0.0-20220730151906-ab6e06b96e8c // indirect
github.com/sina-ghaderi/rabbitio v0.0.0-20220730151941-9ce26f4f872e // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
github.com/zhangyunhao116/fastrand v0.3.0 // indirect
github.com/vishvananda/netns v0.0.5 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7 // indirect
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.uber.org/mock v0.3.0 // indirect
go4.org/netipx v0.0.0-20230824141953-6213f710f925 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.10.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)
replace google.golang.org/protobuf => github.com/metacubex/protobuf-go v0.0.0-20260306035419-7ceee0674686

View File

@@ -1,30 +1,27 @@
github.com/3andne/restls-client-go v0.1.6 h1:tRx/YilqW7iHpgmEL4E1D8dAsuB0tFF3uvncS+B6I08=
github.com/3andne/restls-client-go v0.1.6/go.mod h1:iEdTZNt9kzPIxjIGSMScUFSBrUH6bFRNg0BWlP4orEY=
github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34 h1:USCTqih5d1bUXUxWNS9ZD5Tx/lb0jXHEtRIIx/F9dMc=
github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34/go.mod h1:YR9wK13TgI5ww8iKWm91MHiSoHC7Oz0U4beCCmtXqLw=
github.com/RyuaNerin/go-krypto v1.0.2 h1:9KiZrrBs+tDrQ66dNy4nrX6SzntKtSKdm0wKHhdB4WM=
github.com/RyuaNerin/go-krypto v1.0.2/go.mod h1:17LzMeJCgzGTkPH3TmfzRnEJ/yA7ErhTPp9sxIqONtA=
github.com/RyuaNerin/go-krypto v1.3.0 h1:smavTzSMAx8iuVlGb4pEwl9MD2qicqMzuXR2QWp2/Pg=
github.com/RyuaNerin/go-krypto v1.3.0/go.mod h1:9R9TU936laAIqAmjcHo/LsaXYOZlymudOAxjaBf62UM=
github.com/RyuaNerin/testingutil v0.1.0 h1:IYT6JL57RV3U2ml3dLHZsVtPOP6yNK7WUVdzzlpNrss=
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 h1:cDVUiFo+npB0ZASqnw4q90ylaVAbnYyx0JYqK4YcGok=
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344/go.mod h1:9pIqrY6SXNL8vjRQE5Hd/OL5GyK/9MrGUWs87z/eFfk=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.12.0 h1:oQEuIQIXgYhe1v7sYUG0P9vtJTYZLLdA6tiQmrOB1mo=
github.com/cilium/ebpf v0.12.0/go.mod h1:u9H29/Iq+8cy70YqI6p5pfADkFl3vdnV2qXDg5JL0Zo=
github.com/coreos/go-iptables v0.7.0 h1:XWM3V+MPRr5/q51NuWSgU0fqMad64Zyxs8ZUoMsamr8=
github.com/coreos/go-iptables v0.7.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
github.com/coreos/go-iptables v0.8.0 h1:MPc2P89IhuVpLI7ETL/2tx3XZ61VeICZjYqDEgNsPRc=
github.com/coreos/go-iptables v0.8.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 h1:/5RkVc9Rc81XmMyVqawCiDyrBHZbLAZgTTCqou4mwj8=
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I=
github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8=
github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dunglas/httpsfv v1.0.2 h1:iERDp/YAfnojSDJ7PW3dj1AReJz4MrwbECSSE59JWL0=
github.com/dunglas/httpsfv v1.0.2/go.mod h1:zID2mqw9mFsnt7YC3vYQ9/cjq30q41W+1AnDwH8TiMg=
github.com/enfein/mieru/v3 v3.31.0 h1:Fl2ocRCRXJzMygzdRjBHgqI996ZuIDHUmyQyovSf9sA=
github.com/enfein/mieru/v3 v3.31.0/go.mod h1:zJBUCsi5rxyvHM8fjFf+GLaEl4OEjjBXr1s5F6Qd3hM=
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358 h1:kXYqH/sL8dS/FdoFjr12ePjnLPorPo2FsnrHNuXSDyo=
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I=
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 h1:8j2RH289RJplhA6WfdaPqzg1MjH2K8wX5e0uhAxrw2g=
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391/go.mod h1:K2R7GhgxrlJzHw2qiPWsCZXf/kXEJN9PLnQK73Ll0po=
github.com/ericlagergren/saferand v0.0.0-20220206064634-960a4dd2bc5c h1:RUzBDdZ+e/HEe2Nh8lYsduiPAZygUfVXJn0Ncj5sHMg=
@@ -32,90 +29,133 @@ github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1 h1:tlDMEdcPRQKBE
github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1/go.mod h1:4RfsapbGx2j/vU5xC/5/9qB3kn9Awp1YDiEnN43QrJ4=
github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 h1:fuGucgPk5dN6wzfnxl3D0D3rVLw4v2SbBT9jb4VnxzA=
github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010/go.mod h1:JtBcj7sBuTTRupn7c2bFspMDIObMJsVK8TeUvpShPok=
github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk=
github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.3.0 h1:sbeU3Y4Qzlb+MOzIe6mQGf7QR4Hkv6ZD0qhGkBFL2O0=
github.com/gobwas/ws v1.3.0/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs=
github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc=
github.com/gofrs/uuid/v5 v5.4.0 h1:EfbpCTjqMuGyq5ZJwxqzn3Cbr2d0rUZU7v5ycAk/e/0=
github.com/gofrs/uuid/v5 v5.4.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/tink/go v1.6.1 h1:t7JHqO8Ath2w2ig5vjwQYJzhGEZymedQc90lQXUBa4I=
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a h1:S33o3djA1nPRd+d/bf7jbbXytXuK/EoXow7+aa76grQ=
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a/go.mod h1:zmdm3sTSDP3vOOX3CEWRkkRHtKr1DxBx+J1OQFoDQQs=
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905 h1:q3OEI9RaN/wwcx+qgGo6ZaoJkCiDYe/gjDLfq7lQQF4=
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905/go.mod h1:VvGYjkZoJyKqlmT1yzakUs4mfKMNB0XdODP0+rdml6k=
github.com/josharian/native v1.0.1-0.20221213033349-c1e37c09b531/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA=
github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 h1:EnfXoSqDfSNJv0VBNqY/88RNnhSGYkrHaO0mmFGbVsc=
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40/go.mod h1:vy1vK6wD6j7xX6O6hXe621WabdtNkou2h7uRtTfRMyg=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/reedsolomon v1.12.3 h1:tzUznbfc3OFwJaTebv/QdhnFf2Xvb7gZ24XaHLBPmdc=
github.com/klauspost/reedsolomon v1.12.3/go.mod h1:3K5rXwABAvzGeR01r6pWZieUALXO/Tq7bFKGIb4m4WI=
github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g=
github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw=
github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U=
github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA=
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
github.com/metacubex/amneziawg-go v0.0.0-20251104174305-5a0e9f7e361d h1:vAJ0ZT4aO803F1uw2roIA9yH7Sxzox34tVVyye1bz6c=
github.com/metacubex/amneziawg-go v0.0.0-20251104174305-5a0e9f7e361d/go.mod h1:MsM/5czONyXMJ3PRr5DbQ4O/BxzAnJWOIcJdLzW6qHY=
github.com/metacubex/ascon v0.1.0 h1:6ZWxmXYszT1XXtwkf6nxfFhc/OTtQ9R3Vyj1jN32lGM=
github.com/metacubex/ascon v0.1.0/go.mod h1:eV5oim4cVPPdEL8/EYaTZ0iIKARH9pnhAK/fcT5Kacc=
github.com/metacubex/bart v0.26.0 h1:d/bBTvVatfVWGfQbiDpYKI1bXUJgjaabB2KpK1Tnk6w=
github.com/metacubex/bart v0.26.0/go.mod h1:DCcyfP4MC+Zy7sLK7XeGuMw+P5K9mIRsYOBgiE8icsI=
github.com/metacubex/bbolt v0.0.0-20250725135710-010dbbbb7a5b h1:j7dadXD8I2KTmMt8jg1JcaP1ANL3JEObJPdANKcSYPY=
github.com/metacubex/bbolt v0.0.0-20250725135710-010dbbbb7a5b/go.mod h1:+WmP0VJZDkDszvpa83HzfUp6QzARl/IKkMorH4+nODw=
github.com/metacubex/blake3 v0.1.0 h1:KGnjh/56REO7U+cgZA8dnBhxdP7jByrG7hTP+bu6cqY=
github.com/metacubex/blake3 v0.1.0/go.mod h1:CCkLdzFrqf7xmxCdhQFvJsRRV2mwOLDoSPg6vUTB9Uk=
github.com/metacubex/chacha v0.1.5 h1:fKWMb/5c7ZrY8Uoqi79PPFxl+qwR7X/q0OrsAubyX2M=
github.com/metacubex/chacha v0.1.5/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8=
github.com/metacubex/chi v0.1.0 h1:rjNDyDj50nRpicG43CNkIw4ssiCbmDL8d7wJXKlUCsg=
github.com/metacubex/chi v0.1.0/go.mod h1:zM5u5oMQt8b2DjvDHvzadKrP6B2ztmasL1YHRMbVV+g=
github.com/metacubex/connect-ip-go v0.0.0-20260412152424-e1625567920a h1:Ph5UfTWDsGruZ+v95Df1ycTflQFmpZBFg2LUvj2kx/M=
github.com/metacubex/connect-ip-go v0.0.0-20260412152424-e1625567920a/go.mod h1:xYC8Ik7/rN6no+vTRuWMEziGwm3brA0wNM/zZP9qhOQ=
github.com/metacubex/cpu v0.1.1 h1:rRV5HGmeuGzjiKI3hYbL0dCd0qGwM7VUtk4ICXD06mI=
github.com/metacubex/cpu v0.1.1/go.mod h1:09VEt4dSRLR+bOA8l4w4NDuzGZ8n5dkMv7e8axgEeTU=
github.com/metacubex/edwards25519 v1.2.0 h1:pIQZLBsjQgg3Nl/c86YYFEUAbL5qQRnPq4LrgIw0KK4=
github.com/metacubex/edwards25519 v1.2.0/go.mod h1:NCQF3J/Ki7382FJuokwsywEIIEI/gro/3smyXgQJsx0=
github.com/metacubex/fswatch v0.1.1 h1:jqU7C/v+g0qc2RUFgmAOPoVvfl2BXXUXEumn6oQuxhU=
github.com/metacubex/fswatch v0.1.1/go.mod h1:czrTT7Zlbz7vWft8RQu9Qqh+JoX+Nnb+UabuyN1YsgI=
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 h1:cjd4biTvOzK9ubNCCkQ+ldc4YSH/rILn53l/xGBFHHI=
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759/go.mod h1:UHOv2xu+RIgLwpXca7TLrXleEd4oR3sPatW6IF8wU88=
github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8 h1:npBvaPAT145UY8682AzpUMWpdIxJti/WPLjy7gCiYYs=
github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8/go.mod h1:ZR6Gas7P1GcADCVBc1uOrA0bLQqDDyp70+63fD/BE2c=
github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b h1:uZ++sW8yg7Fr/Wvmmrb/V+SfxvRs0iMC+2+u2bRmO8g=
github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b/go.mod h1:4pe6cY+nAMFU/Uxn1rfnxNIowsaJGDQ3uyy4VuiPkP4=
github.com/metacubex/sing v0.0.0-20231001053806-1230641572b9 h1:F0+IuW0tZ96QHEmrebXAdYnz7ab7Gz4l5yYC4g6Cg8k=
github.com/metacubex/sing v0.0.0-20231001053806-1230641572b9/go.mod h1:GQ673iPfUnkbK/dIPkfd1Xh1MjOGo36gkl/mkiHY7Jg=
github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966 h1:wbOsbU3kfD5LRuJIntJwEPmgGSQukof8CgLNypi8az8=
github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966/go.mod h1:GU7g2AZesXItk4CspDP8Dc7eGtlA2GVDihyCwsUXRSo=
github.com/metacubex/sing-shadowsocks v0.2.5 h1:O2RRSHlKGEpAVG/OHJQxyHqDy8uvvdCW/oW2TDBOIhc=
github.com/metacubex/sing-shadowsocks v0.2.5/go.mod h1:Xz2uW9BEYGEoA8B4XEpoxt7ERHClFCwsMAvWaruoyMo=
github.com/metacubex/sing-shadowsocks2 v0.1.4 h1:OOCf8lgsVcpTOJUeaFAMzyKVebaQOBnKirDdUdBoKIE=
github.com/metacubex/sing-shadowsocks2 v0.1.4/go.mod h1:Qz028sLfdY3qxGRm9FDI+IM2Ae3ty2wR7HIzD/56h/k=
github.com/metacubex/sing-tun v0.1.15-0.20231102032628-0f8a17217e56 h1:ietLSuWRlYrNukGEEn/WXioB4OKPebqpZCc93MRKxEU=
github.com/metacubex/sing-tun v0.1.15-0.20231102032628-0f8a17217e56/go.mod h1:Q7zmpJ+qOvMMXyUoYlxGQuWkqALUpXzFSSqO+KLPyzA=
github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74 h1:FtupiyFkaVjFvRa7B/uDtRWg5BNsoyPC9MTev3sDasY=
github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74/go.mod h1:8EWBZpc+qNvf5gmvjAtMHK1/DpcWqzfcBL842K00BsM=
github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170 h1:DBGA0hmrP4pVIwLiXUONdphjcppED+plmVaKf1oqkwk=
github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170/go.mod h1:/VbJfbdLnANE+SKXyMk/96sTRrD4GdFLh5mkegqqFcY=
github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE=
github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY=
github.com/metacubex/gvisor v0.0.0-20251227095601-261ec1326fe8 h1:hUL81H0Ic/XIDkvtn9M1pmfDdfid7JzYQToY4Ps1TvQ=
github.com/metacubex/gvisor v0.0.0-20251227095601-261ec1326fe8/go.mod h1:8LpS0IJW1VmWzUm3ylb0e2SK5QDm5lO/2qwWLZgRpBU=
github.com/metacubex/hkdf v0.1.0 h1:fPA6VzXK8cU1foc/TOmGCDmSa7pZbxlnqhl3RNsthaA=
github.com/metacubex/hkdf v0.1.0/go.mod h1:3seEfds3smgTAXqUGn+tgEJH3uXdsUjOiduG/2EtvZ4=
github.com/metacubex/hpke v0.1.0 h1:gu2jUNhraehWi0P/z5HX2md3d7L1FhPQE6/Q0E9r9xQ=
github.com/metacubex/hpke v0.1.0/go.mod h1:vfDm6gfgrwlXUxKDkWbcE44hXtmc1uxLDm2BcR11b3U=
github.com/metacubex/http v0.1.4 h1:gU1y8WlqslzxGmedW2ah74fGL6wJYU2HXUkCMJtCa2A=
github.com/metacubex/http v0.1.4/go.mod h1:Nxx0zZAo2AhRfanyL+fmmK6ACMtVsfpwIl1aFAik2Eg=
github.com/metacubex/kcp-go v0.0.0-20260105040817-550693377604 h1:hJwCVlE3ojViC35MGHB+FBr8TuIf3BUFn2EQ1VIamsI=
github.com/metacubex/kcp-go v0.0.0-20260105040817-550693377604/go.mod h1:lpmN3m269b3V5jFCWtffqBLS4U3QQoIid9ugtO+OhVc=
github.com/metacubex/mhurl v0.1.0 h1:ZdW4Zxe3j3uJ89gNytOazHu6kbHn5owutN/VfXOI8GE=
github.com/metacubex/mhurl v0.1.0/go.mod h1:2qpQImCbXoUs6GwJrjuEXKelPyoimsIXr07eNKZdS00=
github.com/metacubex/mlkem v0.1.0 h1:wFClitonSFcmipzzQvax75beLQU+D7JuC+VK1RzSL8I=
github.com/metacubex/mlkem v0.1.0/go.mod h1:amhaXZVeYNShuy9BILcR7P0gbeo/QLZsnqCdL8U2PDQ=
github.com/metacubex/nftables v0.0.0-20260426003805-208c2c1ba2cb h1:wk6mHYPURSUvWcUv72gNP79oiylFsscBSDPJ6ieV6Iw=
github.com/metacubex/nftables v0.0.0-20260426003805-208c2c1ba2cb/go.mod h1:73ZrCfhdkW4F2E2GAlta3km/S2RHhFNogCMtWZV2anQ=
github.com/metacubex/protobuf-go v0.0.0-20260306035419-7ceee0674686 h1:PIXmYT2anQt9V8vdmwixtbIJxOpoPXJfIACHPjXEgnE=
github.com/metacubex/protobuf-go v0.0.0-20260306035419-7ceee0674686/go.mod h1:eQV7juxFZIdRgjMxtVqP+6BssKoTZQ1RM0fc58BsCZY=
github.com/metacubex/qpack v0.6.0 h1:YqClGIMOpiRYLjV1qOs483Od08MdPgRnHjt90FuaAKw=
github.com/metacubex/qpack v0.6.0/go.mod h1:lKGSi7Xk94IMvHGOmxS9eIei3bvIqpOAImEBsaOwTkA=
github.com/metacubex/quic-go v0.59.1-0.20260413153657-53bb22f2c306 h1:HlGLmLsWJMLSu0CMI9z/BmEnithB4oXM5Rom6/0Qxtg=
github.com/metacubex/quic-go v0.59.1-0.20260413153657-53bb22f2c306/go.mod h1:oNzMrmylS897M3zSMuapIdwSwfq6F2qW01Z3NhVRJhk=
github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs=
github.com/metacubex/randv2 v0.2.0/go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY=
github.com/metacubex/restls-client-go v0.1.7 h1:eCwiXCTQb5WJu9IlgYvDBA1OgrINv58dEe7hcN5H15k=
github.com/metacubex/restls-client-go v0.1.7/go.mod h1:BN/U52vPw7j8VTSh2vleD/MnmVKCov84mS5VcjVHH4g=
github.com/metacubex/sing v0.5.7 h1:8OC+fhKFSv/l9ehEhJRaZZAOuthfZo68SteBVLe8QqM=
github.com/metacubex/sing v0.5.7/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w=
github.com/metacubex/sing-mux v0.3.9 h1:/aoBD2+sK2qsXDlNDe3hkR0GZuFDtwIZhOeGUx9W0Yk=
github.com/metacubex/sing-mux v0.3.9/go.mod h1:8bT7ZKT3clRrJjYc/x5CRYibC1TX/bK73a3r3+2E+Fc=
github.com/metacubex/sing-quic v0.0.0-20260414034501-3ea3410d197a h1:977o0ZYYbiQAGuOxql7Q6UN3rEy59OyAE0tELq4gZfI=
github.com/metacubex/sing-quic v0.0.0-20260414034501-3ea3410d197a/go.mod h1:6ayFGfzzBE85csgQkM3gf4neFq6s0losHlPRSxY+nuk=
github.com/metacubex/sing-shadowsocks v0.2.12 h1:Wqzo8bYXrK5aWqxu/TjlTnYZzAKtKsaFQBdr6IHFaBE=
github.com/metacubex/sing-shadowsocks v0.2.12/go.mod h1:2e5EIaw0rxKrm1YTRmiMnDulwbGxH9hAFlrwQLQMQkU=
github.com/metacubex/sing-shadowsocks2 v0.2.7 h1:hSuuc0YpsfiqYqt1o+fP4m34BQz4e6wVj3PPBVhor3A=
github.com/metacubex/sing-shadowsocks2 v0.2.7/go.mod h1:vOEbfKC60txi0ca+yUlqEwOGc3Obl6cnSgx9Gf45KjE=
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 h1:gXU+MYPm7Wme3/OAY2FFzVq9d9GxPHOqu5AQfg/ddhI=
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2/go.mod h1:mbfboaXauKJNIHJYxQRa+NJs4JU9NZfkA+I33dS2+9E=
github.com/metacubex/sing-tun v0.4.18 h1:WRzAosG0YkT3aZq5RJWtF+RdCgeJ8EpooS5ZM1lkXo0=
github.com/metacubex/sing-tun v0.4.18/go.mod h1:g4I/JNplDBhXLF+aQWgFbhNeJPSXQOWS9HvLeNvkgeA=
github.com/metacubex/sing-vmess v0.2.5 h1:m9Zt5I27lB9fmLMZfism9sH2LcnAfShZfwSkf6/KJoE=
github.com/metacubex/sing-vmess v0.2.5/go.mod h1:AwtlzUgf8COe9tRYAKqWZ+leDH7p5U98a0ZUpYehl8Q=
github.com/metacubex/sing-wireguard v0.0.0-20260507084707-690d479ec947 h1:IB03BvRQtvjWScyOK5jSQVJYY8osmZXHL+4VCEFMWcM=
github.com/metacubex/sing-wireguard v0.0.0-20260507084707-690d479ec947/go.mod h1:jpAkVLPnCpGSfNyVmj6Cq4YbuZsFepm/Dc+9BAOcR80=
github.com/metacubex/smux v0.0.0-20260105030934-d0c8756d3141 h1:DK2l6m2Fc85H2BhiAPgbJygiWhesPlfGmF+9Vw6ARdk=
github.com/metacubex/smux v0.0.0-20260105030934-d0c8756d3141/go.mod h1:/yI4OiGOSn0SURhZdJF3CbtPg3nwK700bG8TZLMBvAg=
github.com/metacubex/ssh v0.1.0 h1:iGfr99qk/eMHzUnQ/0bTxXT8+8SWqLSHBWDHoAhngzw=
github.com/metacubex/ssh v0.1.0/go.mod h1:NUtl0d+/f2cG9ECEpMM8iCVOpmggQlC13oLeDUONDlU=
github.com/metacubex/tfo-go v0.0.0-20251130171125-413e892ac443 h1:H6TnfM12tOoTizYE/qBHH3nEuibIelmHI+BVSxVJr8o=
github.com/metacubex/tfo-go v0.0.0-20251130171125-413e892ac443/go.mod h1:l9oLnLoEXyGZ5RVLsh7QCC5XsouTUyKk4F2nLm2DHLw=
github.com/metacubex/tls v0.1.5 h1:ECcB83dj+zadnhlKcLnUUf1Sq6+vU0f/zoyU0+9oPTc=
github.com/metacubex/tls v0.1.5/go.mod h1:0XeVdL0cBw+8i5Hqy3lVeP9IyD/LFTq02ExvHM6rzEM=
github.com/metacubex/utls v1.8.4 h1:HmL9nUApDdWSkgUyodfwF6hSjtiwCGGdyhaSpEejKpg=
github.com/metacubex/utls v1.8.4/go.mod h1:kncGGVhFaoGn5M3pFe3SXhZCzsbCJayNOH4UEqTKTko=
github.com/metacubex/wireguard-go v0.0.0-20250820062549-a6cecdd7f57f h1:FGBPRb1zUabhPhDrlKEjQ9lgIwQ6cHL4x8M9lrERhbk=
github.com/metacubex/wireguard-go v0.0.0-20250820062549-a6cecdd7f57f/go.mod h1:oPGcV994OGJedmmxrcK9+ni7jUEMGhR+uVQAdaduIP4=
github.com/metacubex/yamux v0.0.0-20250918083631-dd5f17c0be49 h1:lhlqpYHopuTLx9xQt22kSA9HtnyTDmk5XjjQVCGHe2E=
github.com/metacubex/yamux v0.0.0-20250918083631-dd5f17c0be49/go.mod h1:MBeEa9IVBphH7vc3LNtW6ZujVXFizotPo3OEiHQ+TNU=
github.com/miekg/dns v1.1.63 h1:8M5aAw6OMZfFXTT7K5V0Eu5YiiL8l7nUAkyN6C9YwaY=
github.com/miekg/dns v1.1.63/go.mod h1:6NGHfjhpmr5lt3XPLuyfDJi5AXbNIPM9PY6H6sF1Nfs=
github.com/mroth/weightedrand/v2 v2.1.0 h1:o1ascnB1CIVzsqlfArQQjeMy1U0NcIbBO5rfd5E/OeU=
github.com/mroth/weightedrand/v2 v2.1.0/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU=
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 h1:1102pQc2SEPp5+xrS26wEaeb26sZy6k9/ZXlZN+eXE4=
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7/go.mod h1:UqoUn6cHESlliMhOnKLWr+CBH+e3bazUPvFj1XZwAjs=
github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/openacid/errors v0.8.1/go.mod h1:GUQEJJOJE3W9skHm8E8Y4phdl2LLEN8iD7c5gcGgdx0=
github.com/openacid/low v0.1.21 h1:Tr2GNu4N/+rGRYdOsEHOE89cxUIaDViZbVmKz29uKGo=
github.com/openacid/low v0.1.21/go.mod h1:q+MsKI6Pz2xsCkzV4BLj7NR5M4EX0sGz5AqotpZDVh0=
@@ -128,136 +168,84 @@ github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFu
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU=
github.com/puzpuzpuz/xsync/v2 v2.5.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU=
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=
github.com/quic-go/qtls-go1-20 v0.3.4/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 h1:5+m7c6AkmAylhauulqN/c5dnh8/KssrE9c93TQrXldA=
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61/go.mod h1:QUQ4RRHD6hGGHdFMEtR8T2P6GS6R3D/CXKdaYHKKXms=
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 h1:iL5gZI3uFp0X6EslacyapiRz7LLSJyr4RajF/BhMVyE=
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
github.com/sagernet/sing-mux v0.1.3 h1:fAf7PZa2A55mCeh0KKM02f1k2Y4vEmxuZZ/51ahkkLA=
github.com/sagernet/sing-mux v0.1.3/go.mod h1:wGeIeiiFLx4HUM5LAg65wrNZ/X1muOimqK0PEhNbPi0=
github.com/sagernet/sing-shadowtls v0.1.4 h1:aTgBSJEgnumzFenPvc+kbD9/W0PywzWevnVpEx6Tw3k=
github.com/sagernet/sing-shadowtls v0.1.4/go.mod h1:F8NBgsY5YN2beQavdgdm1DPlhaKQlaL6lpDdcBglGK4=
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 h1:HuE6xSwco/Xed8ajZ+coeYLmioq0Qp1/Z2zczFaV8as=
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37/go.mod h1:3skNSftZDJWTGVtVaM2jfbce8qHnmH/AGDRe62iNOg0=
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6 h1:Px+hN4Vzgx+iCGVnWH5A8eR7JhNnIV3rGQmBxA7cw6Q=
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6/go.mod h1:zovq6vTvEM6ECiqE3Eeb9rpIylPpamPcmrJ9tv0Bt0M=
github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2 h1:kDUqhc9Vsk5HJuhfIATJ8oQwBmpOZJuozQG7Vk88lL4=
github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2/go.mod h1:JKQMZq/O2qnZjdrt+B57olmfgEmLtY9iiSIEYtWvoSM=
github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f h1:Kvo8w8Y9lzFGB/7z09MJ3TR99TFtfI/IuY87Ygcycho=
github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f/go.mod h1:mySs0abhpc/gLlvhoq7HP1RzOaRmIXVeZGCh++zoApk=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 h1:rc/CcqLH3lh8n+csdOuDfP+NuykE0U6AeYSJJHKDgSg=
github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9/go.mod h1:a/83NAfUXvEuLpmxDssAXxgUgrEy12MId3Wd7OTs76s=
github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E=
github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZNjr6sGeT00J8uU7JF4cNUdb44/Duis=
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
github.com/samber/lo v1.53.0 h1:t975lj2py4kJPQ6haz1QMgtId2gtmfktACxIXArw3HM=
github.com/samber/lo v1.53.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
github.com/sina-ghaderi/poly1305 v0.0.0-20220724002748-c5926b03988b h1:rXHg9GrUEtWZhEkrykicdND3VPjlVbYiLdX9J7gimS8=
github.com/sina-ghaderi/poly1305 v0.0.0-20220724002748-c5926b03988b/go.mod h1:X7qrxNQViEaAN9LNZOPl9PfvQtp3V3c7LTo0dvGi0fM=
github.com/sina-ghaderi/rabaead v0.0.0-20220730151906-ab6e06b96e8c h1:DjKMC30y6yjG3IxDaeAj3PCoRr+IsO+bzyT+Se2m2Hk=
github.com/sina-ghaderi/rabaead v0.0.0-20220730151906-ab6e06b96e8c/go.mod h1:NV/a66PhhWYVmUMaotlXJ8fIEFB98u+c8l/CQIEFLrU=
github.com/sina-ghaderi/rabbitio v0.0.0-20220730151941-9ce26f4f872e h1:ur8uMsPIFG3i4Gi093BQITvwH9znsz2VUZmnmwHvpIo=
github.com/sina-ghaderi/rabbitio v0.0.0-20220730151941-9ce26f4f872e/go.mod h1:+e5fBW3bpPyo+3uLo513gIUblc03egGjMM0+5GKbzK8=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 h1:tHNk7XK9GkmKUR6Gh8gVBKXc2MVSZ4G/NnWLtzw4gNA=
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923/go.mod h1:eLL9Nub3yfAho7qB0MzZizFhTU2QkLeoVsWdHtDW264=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695APm9hlsSMoOoE65U4/TcqNj90mc69Rlg=
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/zhangyunhao116/fastrand v0.3.0 h1:7bwe124xcckPulX6fxtr2lFdO2KQqaefdtbk+mqO/Ig=
github.com/zhangyunhao116/fastrand v0.3.0/go.mod h1:0v5KgHho0VE6HU192HnY15de/oDS8UrbBChIFjIhBtc=
github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY=
github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7 h1:UNrDfkQqiEYzdMlNsVvBYOAJWZjdktqFE9tQh5BT2+4=
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7/go.mod h1:E+rxHvJG9H6PUdzq9NRG6csuLN3XUx98BfGOVWNYnXs=
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec h1:FpfFs4EhNehiVfzQttTuxanPIT43FtkkCFypIod8LHo=
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAoRPbCxum9Grlv5aeksu2H8BiKehBYooU2LFiOQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
go4.org/netipx v0.0.0-20230824141953-6213f710f925 h1:eeQDDVKFkx0g4Hyy8pHgmZaK0EqB4SD6rvKbUdN3ziQ=
go4.org/netipx v0.0.0-20230824141953-6213f710f925/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=
lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=

View File

@@ -12,5 +12,5 @@ import (
_ "golang.org/x/sync/semaphore"
_ "github.com/Dreamacro/clash/log"
_ "github.com/metacubex/mihomo/log"
)

View File

@@ -9,7 +9,7 @@ import (
"cfa/native/app"
"github.com/Dreamacro/clash/log"
"github.com/metacubex/mihomo/log"
)
func openRemoteContent(url string) (int, error) {

View File

@@ -3,18 +3,14 @@ package app
import (
"strings"
"github.com/Dreamacro/clash/dns"
"github.com/metacubex/mihomo/dns"
)
func NotifyDnsChanged(dnsList string) {
dL := strings.Split(dnsList, ",")
ns := make([]dns.NameServer, 0, len(dnsList))
for _, d := range dL {
ns = append(ns, dns.NameServer{Addr: d})
var addr []string
if len(dnsList) > 0 {
addr = strings.Split(dnsList, ",")
}
dns.UpdateSystemDNS(dL)
dns.UpdateSystemDNS(addr)
dns.FlushCacheWithDefaultResolver()
}

View File

@@ -3,7 +3,7 @@ package app
import (
"github.com/dlclark/regexp2"
"github.com/Dreamacro/clash/log"
"github.com/metacubex/mihomo/log"
)
var uiSubtitlePattern *regexp2.Regexp

View File

@@ -14,7 +14,7 @@ import (
"cfa/native/app"
clashHttp "github.com/Dreamacro/clash/component/http"
clashHttp "github.com/metacubex/mihomo/component/http"
)
type Status struct {
@@ -112,7 +112,7 @@ func FetchAndValid(
return err
}
forEachProviders(rawCfg, func(index int, total int, name string, provider map[string]any) {
forEachProviders(rawCfg, func(index int, total int, name string, provider map[string]any, prefix string) {
bytes, _ := json.Marshal(&Status{
Action: "FetchProviders",
Args: []string{name},

View File

@@ -1,18 +1,17 @@
package config
import (
"io/ioutil"
"os"
P "path"
"runtime"
"strings"
"gopkg.in/yaml.v2"
"cfa/native/app"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/config"
"github.com/Dreamacro/clash/hub/executor"
"github.com/metacubex/mihomo/common/yaml"
"github.com/metacubex/mihomo/config"
"github.com/metacubex/mihomo/hub"
"github.com/metacubex/mihomo/log"
)
func logDns(cfg *config.RawConfig) {
@@ -33,7 +32,7 @@ func logDns(cfg *config.RawConfig) {
func UnmarshalAndPatch(profilePath string) (*config.RawConfig, error) {
configPath := P.Join(profilePath, "config.yaml")
configData, err := ioutil.ReadFile(configPath)
configData, err := os.ReadFile(configPath)
if err != nil {
return nil, err
}
@@ -76,7 +75,8 @@ func Load(path string) error {
return err
}
executor.ApplyConfig(cfg, true)
// like hub.Parse()
hub.ApplyConfig(cfg)
app.ApplySubtitlePattern(rawCfg.ClashForAndroid.UiSubtitlePattern)
@@ -91,5 +91,5 @@ func LoadDefault() {
panic(err.Error())
}
executor.ApplyConfig(cfg, true)
hub.ApplyConfig(cfg)
}

View File

@@ -1,10 +1,10 @@
package config
import (
"io/ioutil"
"io"
"os"
"github.com/Dreamacro/clash/constant"
"github.com/metacubex/mihomo/constant"
)
type OverrideSlot int
@@ -31,7 +31,7 @@ func ReadOverride(slot OverrideSlot) string {
return defaultPersistOverride
}
buf, err := ioutil.ReadAll(file)
buf, err := io.ReadAll(file)
if err != nil {
return defaultPersistOverride
}

View File

@@ -9,18 +9,21 @@ import (
"github.com/dlclark/regexp2"
"cfa/native/common"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/config"
"github.com/Dreamacro/clash/dns"
"github.com/metacubex/mihomo/common/utils"
"github.com/metacubex/mihomo/config"
C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/log"
)
var processors = []processor{
patchExternalController, // must before patchOverride, so we only apply ExternalController in Override settings
patchOverride,
patchGeneral,
patchProfile,
patchDns,
patchTun,
patchListeners,
patchProviders,
validConfig,
}
@@ -38,10 +41,19 @@ func patchOverride(cfg *config.RawConfig, _ string) error {
return nil
}
func patchGeneral(cfg *config.RawConfig, _ string) error {
cfg.Interface = ""
cfg.ExternalUI = ""
func patchExternalController(cfg *config.RawConfig, _ string) error {
cfg.ExternalController = ""
cfg.ExternalControllerTLS = ""
return nil
}
func patchGeneral(cfg *config.RawConfig, profileDir string) error {
cfg.Interface = ""
cfg.RoutingMark = 0
if cfg.ExternalController != "" || cfg.ExternalControllerTLS != "" {
cfg.ExternalUI = profileDir + "/ui"
}
return nil
}
@@ -55,31 +67,56 @@ func patchProfile(cfg *config.RawConfig, _ string) error {
func patchDns(cfg *config.RawConfig, _ string) error {
if !cfg.DNS.Enable {
cfg.DNS = config.RawDNS{
Enable: true,
UseHosts: true,
DefaultNameserver: defaultNameServers,
NameServer: defaultNameServers,
EnhancedMode: C.DNSFakeIP,
FakeIPRange: defaultFakeIPRange,
FakeIPFilter: defaultFakeIPFilter,
}
cfg.DNS = config.DefaultRawConfig().DNS
cfg.DNS.Enable = true
cfg.DNS.NameServer = defaultNameServers
cfg.DNS.EnhancedMode = C.DNSFakeIP
cfg.DNS.FakeIPRange = defaultFakeIPRange
cfg.DNS.FakeIPFilter = defaultFakeIPFilter
cfg.ClashForAndroid.AppendSystemDNS = true
}
if cfg.ClashForAndroid.AppendSystemDNS {
cfg.DNS.NameServer = append(cfg.DNS.NameServer, "dhcp://"+dns.SystemDNSPlaceholder)
cfg.DNS.NameServer = append(cfg.DNS.NameServer, "system://")
}
return nil
}
func patchProviders(cfg *config.RawConfig, profileDir string) error {
forEachProviders(cfg, func(index int, total int, key string, provider map[string]any) {
if path, ok := provider["path"].(string); ok {
provider["path"] = profileDir + "/providers/" + common.ResolveAsRoot(path)
func patchTun(cfg *config.RawConfig, _ string) error {
cfg.Tun.Enable = false
cfg.Tun.AutoRoute = false
cfg.Tun.AutoDetectInterface = false
return nil
}
func patchListeners(cfg *config.RawConfig, _ string) error {
newListeners := make([]map[string]any, 0, len(cfg.Listeners))
for _, mapping := range cfg.Listeners {
if proxyType, existType := mapping["type"].(string); existType {
switch proxyType {
case "tproxy", "redir", "tun":
continue // remove those listeners which is not supported
}
}
newListeners = append(newListeners, mapping)
}
cfg.Listeners = newListeners
return nil
}
func patchProviders(cfg *config.RawConfig, profileDir string) error {
forEachProviders(cfg, func(index int, total int, key string, provider map[string]any, prefix string) {
path, _ := provider["path"].(string)
if len(path) > 0 {
path = common.ResolveAsRoot(path)
} else if url, ok := provider["url"].(string); ok {
path = prefix + "/" + utils.MakeHash([]byte(url)).String() // same as C.GetPathByHash
} else {
return // both path and url are empty, maybe inline provider
}
provider["path"] = profileDir + "/providers/" + path
})
return nil

View File

@@ -3,21 +3,26 @@ package config
import (
"io"
"github.com/Dreamacro/clash/config"
"github.com/metacubex/mihomo/config"
)
func forEachProviders(rawCfg *config.RawConfig, fun func(index int, total int, key string, provider map[string]any)) {
const (
PROXIES = "proxies"
RULES = "rules"
)
func forEachProviders(rawCfg *config.RawConfig, fun func(index int, total int, key string, provider map[string]any, prefix string)) {
total := len(rawCfg.ProxyProvider) + len(rawCfg.RuleProvider)
index := 0
for k, v := range rawCfg.ProxyProvider {
fun(index, total, k, v)
fun(index, total, k, v, PROXIES)
index++
}
for k, v := range rawCfg.RuleProvider {
fun(index, total, k, v)
fun(index, total, k, v, RULES)
index++
}
@@ -25,10 +30,14 @@ func forEachProviders(rawCfg *config.RawConfig, fun func(index int, total int, k
func destroyProviders(cfg *config.Config) {
for _, p := range cfg.Providers {
_ = p.(io.Closer).Close()
if p, ok := p.(io.Closer); ok {
_ = p.Close()
}
}
for _, p := range cfg.RuleProviders {
_ = p.(io.Closer).Close()
if p, ok := p.(io.Closer); ok {
_ = p.Close()
}
}
}

View File

@@ -6,7 +6,7 @@ import (
"net/http"
_ "net/http/pprof"
"github.com/Dreamacro/clash/log"
"github.com/metacubex/mihomo/log"
)
func init() {

View File

@@ -2,26 +2,33 @@ package delegate
import (
"errors"
"fmt"
"strings"
"syscall"
"cfa/blob"
"github.com/Dreamacro/clash/component/process"
"github.com/Dreamacro/clash/log"
"github.com/metacubex/mihomo/component/process"
"github.com/metacubex/mihomo/log"
"cfa/native/app"
"cfa/native/platform"
"github.com/Dreamacro/clash/component/dialer"
"github.com/Dreamacro/clash/component/mmdb"
"github.com/Dreamacro/clash/constant"
"github.com/metacubex/mihomo/component/dialer"
"github.com/metacubex/mihomo/constant"
)
var errBlocked = errors.New("blocked")
func Init(home, versionName string, platformVersion int) {
mmdb.LoadFromBytes(blob.GeoipDatabase)
func Init(home, versionName, gitVersion string, platformVersion int) {
log.Infoln("Init core, home: %s, versionName: %s, gitVersion: %s, platformVersion: %d", home, versionName, gitVersion, platformVersion)
constant.SetHomeDir(home)
// gitVersion = ${CURRENT_BRANCH}_${COMMIT_HASH}_${COMPILE_TIME}
if versions := strings.Split(gitVersion, "_"); len(versions) == 3 {
constant.Version = fmt.Sprintf("%s-%s-CMFA-%s", strings.ToLower(versions[0]), versions[1], strings.ToLower(versionName))
constant.BuildTime = versions[2]
} else {
constant.Version = gitVersion
}
constant.Version = strings.ToLower(constant.Version)
app.ApplyVersionName(versionName)
app.ApplyPlatformVersion(platformVersion)

View File

@@ -1,5 +1,3 @@
//go:build !premium
package main
//#include "bridge.h"
@@ -10,7 +8,7 @@ import (
"time"
"unsafe"
"github.com/Dreamacro/clash/log"
"github.com/metacubex/mihomo/log"
)
type message struct {

View File

@@ -1,75 +0,0 @@
//go:build premium
package main
//#include "bridge.h"
import "C"
import (
"strings"
"time"
"unsafe"
"github.com/Dreamacro/clash/log"
)
type message struct {
Level string `json:"level"`
Message string `json:"message"`
Time int64 `json:"time"`
}
func init() {
go func() {
sub := log.Subscribe()
defer log.UnSubscribe(sub)
for msg := range sub {
cPayload := C.CString(msg.Payload)
switch msg.LogLevel {
case log.INFO:
C.log_info(cPayload)
case log.ERROR:
C.log_error(cPayload)
case log.WARNING:
C.log_warn(cPayload)
case log.DEBUG:
C.log_debug(cPayload)
case log.SILENT:
C.log_verbose(cPayload)
}
}
}()
}
//export subscribeLogcat
func subscribeLogcat(remote unsafe.Pointer) {
go func(remote unsafe.Pointer) {
sub := log.Subscribe()
defer log.UnSubscribe(sub)
for msg := range sub {
if msg.LogLevel < log.Level() && !strings.HasPrefix(msg.Payload, "[APP]") {
continue
}
rMsg := &message{
Level: msg.LogLevel.String(),
Message: msg.Payload,
Time: time.Now().UnixNano() / 1000 / 1000,
}
if C.logcat_received(remote, marshalJson(rMsg)) != 0 {
C.release_object(remote)
log.Debugln("Logcat subscriber closed")
break
}
}
}(remote)
log.Infoln("[APP] Logcat level: %s", log.Level().String())
}

View File

@@ -9,12 +9,13 @@ import "C"
import (
"runtime"
"runtime/debug"
"cfa/native/config"
"cfa/native/delegate"
"cfa/native/tunnel"
"github.com/Dreamacro/clash/log"
"github.com/metacubex/mihomo/log"
)
func main() {
@@ -22,12 +23,13 @@ func main() {
}
//export coreInit
func coreInit(home, versionName C.c_string, sdkVersion C.int) {
func coreInit(home, versionName, gitVersion C.c_string, sdkVersion C.int) {
h := C.GoString(home)
v := C.GoString(versionName)
g := C.GoString(gitVersion)
s := int(sdkVersion)
delegate.Init(h, v, s)
delegate.Init(h, v, g, s)
reset()
}
@@ -39,6 +41,7 @@ func reset() {
tunnel.CloseAllConnections()
runtime.GC()
debug.FreeOSMemory()
}
//export forceGc
@@ -47,5 +50,6 @@ func forceGc() {
log.Infoln("[APP] request force GC")
runtime.GC()
debug.FreeOSMemory()
}()
}

View File

@@ -3,8 +3,8 @@ package proxy
import (
"sync"
"github.com/Dreamacro/clash/listener/http"
"github.com/Dreamacro/clash/tunnel"
"github.com/metacubex/mihomo/listener/http"
"github.com/metacubex/mihomo/tunnel"
)
var listener *http.Listener
@@ -18,7 +18,7 @@ func Start(listen string) (listenAt string, err error) {
listener, err = http.NewWithAuthenticate(listen, tunnel.Tunnel, false)
if err == nil {
listenAt = listener.Listener().Addr().String()
listenAt = listener.Address()
}
return

View File

@@ -64,7 +64,7 @@ func (t *remoteTun) close() {
}
//export startTun
func startTun(fd C.int, gateway, portal, dns C.c_string, callback unsafe.Pointer) C.int {
func startTun(fd C.int, stack, gateway, portal, dns C.c_string, callback unsafe.Pointer) C.int {
rTunLock.Lock()
defer rTunLock.Unlock()
@@ -74,6 +74,7 @@ func startTun(fd C.int, gateway, portal, dns C.c_string, callback unsafe.Pointer
}
f := int(fd)
s := C.GoString(stack)
g := C.GoString(gateway)
p := C.GoString(portal)
d := C.GoString(dns)
@@ -82,7 +83,7 @@ func startTun(fd C.int, gateway, portal, dns C.c_string, callback unsafe.Pointer
app.ApplyTunContext(remote.markSocket, remote.querySocketUid)
closer, err := tun.Start(f, g, p, d)
closer, err := tun.Start(f, s, g, p, d)
if err != nil {
remote.close()

View File

@@ -1,33 +0,0 @@
package tun
import (
"net"
"github.com/Dreamacro/clash/dns"
D "github.com/miekg/dns"
)
func shouldHijackDns(dns net.IP, target net.IP, targetPort int) bool {
if targetPort != 53 {
return false
}
return net.IPv4zero.Equal(dns) || target.Equal(dns)
}
func relayDns(payload []byte) ([]byte, error) {
msg := &D.Msg{}
if err := msg.Unpack(payload); err != nil {
return nil, err
}
r, err := dns.ServeDNSWithDefaultServer(msg)
if err != nil {
return nil, err
}
r.SetRcode(msg, r.Rcode)
return r.Pack()
}

View File

@@ -1,23 +0,0 @@
//go:build !premium
package tun
import (
"net"
C "github.com/Dreamacro/clash/constant"
)
func createMetadata(lAddr, rAddr *net.TCPAddr) *C.Metadata {
return &C.Metadata{
NetWork: C.TCP,
Type: C.SOCKS5,
SrcIP: lAddr.AddrPort().Addr(),
DstIP: rAddr.AddrPort().Addr(),
SrcPort: uint16(lAddr.Port),
DstPort: uint16(rAddr.Port),
Host: "",
RawSrcAddr: lAddr,
RawDstAddr: rAddr,
}
}

View File

@@ -1,29 +0,0 @@
//go:build premium
package tun
import (
"net"
"net/netip"
"strconv"
C "github.com/Dreamacro/clash/constant"
)
func createMetadata(lAddr, rAddr *net.TCPAddr) *C.Metadata {
srcAddr, _ := netip.AddrFromSlice(lAddr.IP)
dstAddr, _ := netip.AddrFromSlice(rAddr.IP)
return &C.Metadata{
NetWork: C.TCP,
Type: C.SOCKS5,
SrcIP: srcAddr,
DstIP: dstAddr,
SrcPort: strconv.Itoa(lAddr.Port),
DstPort: strconv.Itoa(rAddr.Port),
AddrType: C.AtypIPv4,
Host: "",
RawSrcAddr: lAddr,
RawDstAddr: rAddr,
}
}

View File

@@ -1,161 +1,77 @@
package tun
import (
"encoding/binary"
"encoding/json"
"io"
"net"
"os"
"time"
"net/netip"
"strings"
"github.com/Kr328/tun2socket"
"github.com/Dreamacro/clash/adapter/inbound"
"github.com/Dreamacro/clash/common/pool"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/transport/socks5"
"github.com/Dreamacro/clash/tunnel"
C "github.com/metacubex/mihomo/constant"
LC "github.com/metacubex/mihomo/listener/config"
"github.com/metacubex/mihomo/listener/sing_tun"
"github.com/metacubex/mihomo/log"
"github.com/metacubex/mihomo/tunnel"
)
var _, ipv4LoopBack, _ = net.ParseCIDR("127.0.0.0/8")
func Start(fd int, stack, gateway, portal, dns string) (io.Closer, error) {
log.Debugln("TUN: fd = %d, stack = %s, gateway = %s, portal = %s, dns = %s", fd, stack, gateway, portal, dns)
func Start(fd int, gateway, portal, dns string) (io.Closer, error) {
log.Debugln("TUN: fd = %d, gateway = %s, portal = %s, dns = %s", fd, gateway, portal, dns)
device := os.NewFile(uintptr(fd), "/dev/tun")
ip, network, err := net.ParseCIDR(gateway)
if err != nil {
panic(err.Error())
} else {
network.IP = ip
tunStack, ok := C.StackTypeMapping[strings.ToLower(stack)]
if !ok {
tunStack = C.TunSystem
}
stack, err := tun2socket.StartTun2Socket(device, network, net.ParseIP(portal))
if err != nil {
_ = device.Close()
var prefix4 []netip.Prefix
var prefix6 []netip.Prefix
for _, gatewayStr := range strings.Split(gateway, ",") { // "172.19.0.1/30" or "172.19.0.1/30,fdfe:dcba:9876::1/126"
gatewayStr = strings.TrimSpace(gatewayStr)
if len(gatewayStr) == 0 {
continue
}
prefix, err := netip.ParsePrefix(gatewayStr)
if err != nil {
log.Errorln("TUN:", err)
return nil, err
}
if prefix.Addr().Is4() {
prefix4 = append(prefix4, prefix)
} else {
prefix6 = append(prefix6, prefix)
}
}
var dnsHijack []string
for _, dnsStr := range strings.Split(dns, ",") { // "172.19.0.2" or "0.0.0.0"
dnsStr = strings.TrimSpace(dnsStr)
if len(dnsStr) == 0 {
continue
}
dnsHijack = append(dnsHijack, net.JoinHostPort(dnsStr, "53"))
}
options := LC.Tun{
Enable: true,
Device: sing_tun.InterfaceName,
Stack: tunStack,
DNSHijack: dnsHijack,
AutoRoute: false, // had set route in TunService.kt
AutoDetectInterface: false, // implements by VpnService::protect
Inet4Address: prefix4,
Inet6Address: prefix6,
MTU: 9000, // private const val TUN_MTU = 9000 in TunService.kt
FileDescriptor: fd,
}
tunOptions, _ := json.Marshal(options)
log.Debugln(string(tunOptions))
listener, err := sing_tun.New(options, tunnel.Tunnel)
if err != nil {
log.Errorln("TUN:", err)
return nil, err
}
dnsAddr := net.ParseIP(dns)
tcp := func() {
defer stack.TCP().Close()
defer log.Debugln("TCP: closed")
for stack.TCP().SetDeadline(time.Time{}) == nil {
conn, err := stack.TCP().Accept()
if err != nil {
log.Debugln("Accept connection: %v", err)
continue
}
lAddr := conn.LocalAddr().(*net.TCPAddr)
rAddr := conn.RemoteAddr().(*net.TCPAddr)
if ipv4LoopBack.Contains(rAddr.IP) {
conn.Close()
continue
}
if shouldHijackDns(dnsAddr, rAddr.IP, rAddr.Port) {
go func() {
defer conn.Close()
buf := pool.Get(pool.UDPBufferSize)
defer pool.Put(buf)
for {
conn.SetReadDeadline(time.Now().Add(C.DefaultTCPTimeout))
length := uint16(0)
if err := binary.Read(conn, binary.BigEndian, &length); err != nil {
return
}
if int(length) > len(buf) {
return
}
n, err := conn.Read(buf[:length])
if err != nil {
return
}
msg, err := relayDns(buf[:n])
if err != nil {
return
}
_, _ = conn.Write(msg)
}
}()
continue
}
go tunnel.Tunnel.HandleTCPConn(conn, createMetadata(lAddr, rAddr))
}
}
udp := func() {
defer stack.UDP().Close()
defer log.Debugln("UDP: closed")
for {
buf := pool.Get(pool.UDPBufferSize)
n, lRAddr, rRAddr, err := stack.UDP().ReadFrom(buf)
if err != nil {
return
}
raw := buf[:n]
lAddr := lRAddr.(*net.UDPAddr)
rAddr := rRAddr.(*net.UDPAddr)
if ipv4LoopBack.Contains(rAddr.IP) {
pool.Put(buf)
continue
}
if shouldHijackDns(dnsAddr, rAddr.IP, rAddr.Port) {
go func() {
defer pool.Put(buf)
msg, err := relayDns(raw)
if err != nil {
return
}
_, _ = stack.UDP().WriteTo(msg, rAddr, lAddr)
}()
continue
}
pkt := &packet{
local: lAddr,
data: raw,
writeBack: func(b []byte, addr net.Addr) (int, error) {
return stack.UDP().WriteTo(b, addr, lAddr)
},
drop: func() {
pool.Put(buf)
},
}
tunnel.Tunnel.HandleUDPPacket(inbound.NewPacket(socks5.ParseAddrToSocksAddr(rAddr), pkt, C.SOCKS5))
}
}
go tcp()
go udp()
go udp()
return stack, nil
return listener, nil
}

View File

@@ -1,28 +0,0 @@
package tun
import (
"net"
)
type packet struct {
local *net.UDPAddr
data []byte
writeBack func(b []byte, addr net.Addr) (int, error)
drop func()
}
func (pkt *packet) Data() []byte {
return pkt.data
}
func (pkt *packet) WriteBack(b []byte, addr net.Addr) (n int, err error) {
return pkt.writeBack(b, addr)
}
func (pkt *packet) Drop() {
pkt.drop()
}
func (pkt *packet) LocalAddr() net.Addr {
return pkt.local
}

View File

@@ -109,16 +109,3 @@ func updateProvider(completable unsafe.Pointer, pType C.c_string, name C.c_strin
func suspend(suspended C.int) {
tunnel.Suspend(suspended != 0)
}
//export installSideloadGeoip
func installSideloadGeoip(block unsafe.Pointer, blockSize C.int) *C.char {
if block == nil {
_ = tunnel.InstallSideloadGeoip(nil)
return nil
}
bytes := C.GoBytes(block, blockSize)
return marshalString(tunnel.InstallSideloadGeoip(bytes))
}

View File

@@ -1,8 +1,8 @@
package tunnel
import (
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/tunnel/statistic"
C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/tunnel/statistic"
)
func CloseAllConnections() {
@@ -12,20 +12,17 @@ func CloseAllConnections() {
})
}
func closeMatch(filter func(conn C.Conn) bool) {
func closeMatch(filter func(conn C.Connection) bool) {
statistic.DefaultManager.Range(func(c statistic.Tracker) bool {
if cc, ok := c.(C.Conn); ok {
if filter(cc) {
_ = cc.Close()
return true
}
if filter(c) {
_ = c.Close()
}
return false
return true
})
}
func closeConnByGroup(name string) {
closeMatch(func(conn C.Conn) bool {
closeMatch(func(conn C.Connection) bool {
for _, c := range conn.Chains() {
if c == name {
return true

View File

@@ -3,11 +3,10 @@ package tunnel
import (
"sync"
"github.com/Dreamacro/clash/adapter"
"github.com/Dreamacro/clash/adapter/outboundgroup"
"github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/tunnel"
"github.com/metacubex/mihomo/adapter/outboundgroup"
"github.com/metacubex/mihomo/constant/provider"
"github.com/metacubex/mihomo/log"
"github.com/metacubex/mihomo/tunnel"
)
func HealthCheck(name string) {
@@ -19,7 +18,7 @@ func HealthCheck(name string) {
return
}
g, ok := p.(*adapter.Proxy).ProxyAdapter.(outboundgroup.ProxyGroup)
g, ok := p.Adapter().(outboundgroup.ProxyGroup)
if !ok {
log.Warnln("Request health check for `%s`: invalid type %s", name, p.Type().String())

View File

@@ -1,24 +0,0 @@
package tunnel
import (
"fmt"
"github.com/Dreamacro/clash/component/mmdb"
"github.com/oschwald/maxminddb-golang"
)
func InstallSideloadGeoip(block []byte) error {
if block == nil {
mmdb.InstallOverride(nil)
return nil
}
db, err := maxminddb.FromBytes(block)
if err != nil {
return fmt.Errorf("load sideload geoip mmdb: %s", err.Error())
}
mmdb.InstallOverride(db)
return nil
}

View File

@@ -1,5 +1,3 @@
//go:build !premium
package tunnel
import (

View File

@@ -1,7 +0,0 @@
//go:build premium
package tunnel
import "net/netip"
var loopback = netip.MustParseAddr("127.0.0.1")

View File

@@ -1,5 +1,3 @@
//go:build !premium
package tunnel
import (
@@ -7,10 +5,9 @@ import (
"fmt"
"time"
P "github.com/Dreamacro/clash/adapter/provider"
"github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/tunnel"
"github.com/metacubex/mihomo/constant/provider"
"github.com/metacubex/mihomo/log"
"github.com/metacubex/mihomo/tunnel"
)
var ErrInvalidType = errors.New("invalid type")
@@ -22,6 +19,10 @@ type Provider struct {
UpdatedAt int64 `json:"updatedAt"`
}
type UpdatableProvider interface {
UpdatedAt() time.Time
}
func QueryProviders() []*Provider {
r := tunnel.RuleProviders()
p := tunnel.Providers()
@@ -49,7 +50,7 @@ func QueryProviders() []*Provider {
for _, p := range providers {
updatedAt := time.Time{}
if s, ok := p.(P.UpdatableProvider); ok {
if s, ok := p.(UpdatableProvider); ok {
updatedAt = s.UpdatedAt()
}

View File

@@ -1,92 +0,0 @@
//go:build premium
package tunnel
import (
"errors"
"fmt"
"time"
P "github.com/Dreamacro/clash/adapter/provider"
"github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/tunnel"
)
var ErrInvalidType = errors.New("invalid type")
type Provider struct {
Name string `json:"name"`
VehicleType string `json:"vehicleType"`
Type string `json:"type"`
UpdatedAt int64 `json:"updatedAt"`
}
func QueryProviders() []*Provider {
r := tunnel.RuleProviders()
p := tunnel.ProxyProviders()
providers := make([]provider.Provider, 0, len(r)+len(p))
for _, rule := range r {
if rule.VehicleType() == provider.Compatible {
continue
}
providers = append(providers, rule)
}
for _, proxy := range p {
if proxy.VehicleType() == provider.Compatible {
continue
}
providers = append(providers, proxy)
}
result := make([]*Provider, 0, len(providers))
for _, p := range providers {
updatedAt := time.Time{}
if s, ok := p.(P.UpdatableProvider[any]); ok {
updatedAt = s.UpdatedAt()
}
result = append(result, &Provider{
Name: p.Name(),
VehicleType: p.VehicleType().String(),
Type: p.Type().String(),
UpdatedAt: updatedAt.UnixNano() / 1000 / 1000,
})
}
return result
}
func UpdateProvider(t string, name string) error {
err := ErrInvalidType
switch t {
case "Rule":
p := tunnel.RuleProviders()[name]
if p == nil {
return fmt.Errorf("%s not found", name)
}
err = p.Update()
case "Proxy":
p := tunnel.ProxyProviders()[name]
if p == nil {
return fmt.Errorf("%s not found", name)
}
err = p.Update()
}
if err != nil {
log.Warnln("Updating provider %s: %s", name, err.Error())
}
return err
}

View File

@@ -6,13 +6,11 @@ import (
"github.com/dlclark/regexp2"
"github.com/Dreamacro/clash/adapter"
"github.com/Dreamacro/clash/adapter/outboundgroup"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/tunnel"
"github.com/metacubex/mihomo/adapter/outboundgroup"
C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/constant/provider"
"github.com/metacubex/mihomo/log"
"github.com/metacubex/mihomo/tunnel"
)
type SortMode int
@@ -61,7 +59,7 @@ func QueryProxyGroupNames(excludeNotSelectable bool) []string {
return []string{}
}
global := tunnel.Proxies()["GLOBAL"].(*adapter.Proxy).ProxyAdapter.(outboundgroup.ProxyGroup)
global := tunnel.Proxies()["GLOBAL"].Adapter().(outboundgroup.ProxyGroup)
proxies := global.Providers()[0].Proxies()
result := make([]string, 0, len(proxies)+1)
@@ -70,8 +68,11 @@ func QueryProxyGroupNames(excludeNotSelectable bool) []string {
}
for _, p := range proxies {
if _, ok := p.(*adapter.Proxy).ProxyAdapter.(outboundgroup.ProxyGroup); ok {
if g, ok := p.Adapter().(outboundgroup.ProxyGroup); ok {
if !excludeNotSelectable || p.Type() == C.Selector {
if g.Hidden() {
continue
}
result = append(result, p.Name())
}
}
@@ -89,15 +90,15 @@ func QueryProxyGroup(name string, sortMode SortMode, uiSubtitlePattern *regexp2.
return nil
}
g, ok := p.(*adapter.Proxy).ProxyAdapter.(outboundgroup.ProxyGroup)
g, ok := p.Adapter().(outboundgroup.ProxyGroup)
if !ok {
log.Warnln("Query group `%s`: invalid type %s", name, p.Type().String())
return nil
}
proxies := convertProxies(g.Proxies(), uiSubtitlePattern)
// proxies := collectProviders(g.Providers(), uiSubtitlePattern)
proxies := convertProxies(g.Proxies(), uiSubtitlePattern)
// proxies := collectProviders(g.Providers(), uiSubtitlePattern)
switch sortMode {
case Title:
@@ -138,14 +139,14 @@ func PatchSelector(selector, name string) bool {
return false
}
g, ok := p.(*adapter.Proxy).ProxyAdapter.(outboundgroup.ProxyGroup)
g, ok := p.Adapter().(outboundgroup.ProxyGroup)
if !ok {
log.Warnln("Patch selector `%s`: invalid type %s", selector, p.Type().String())
return false
}
s, ok := g.(*outboundgroup.Selector)
s, ok := g.(outboundgroup.SelectAble)
if !ok {
log.Warnln("Patch selector `%s`: invalid type %s", selector, p.Type().String())
@@ -172,7 +173,7 @@ func convertProxies(proxies []C.Proxy, uiSubtitlePattern *regexp2.Regexp) []*Pro
subtitle := p.Type().String()
if uiSubtitlePattern != nil {
if _, ok := p.(*adapter.Proxy).ProxyAdapter.(outboundgroup.ProxyGroup); !ok {
if _, ok := p.Adapter().(outboundgroup.ProxyGroup); !ok {
runes := []rune(name)
match, err := uiSubtitlePattern.FindRunesMatch(runes)
if err == nil && match != nil {
@@ -181,13 +182,20 @@ func convertProxies(proxies []C.Proxy, uiSubtitlePattern *regexp2.Regexp) []*Pro
}
}
}
testURL := "https://www.gstatic.com/generate_204"
for k := range p.ExtraDelayHistories() {
if len(k) > 0 {
testURL = k
break
}
}
result = append(result, &Proxy{
Name: name,
Title: strings.TrimSpace(title),
Subtitle: strings.TrimSpace(subtitle),
Type: p.Type().String(),
Delay: int(p.LastDelay()),
Delay: int(p.LastDelayForTestUrl(testURL)),
})
}
return result
@@ -203,7 +211,7 @@ func collectProviders(providers []provider.ProxyProvider, uiSubtitlePattern *reg
subtitle := px.Type().String()
if uiSubtitlePattern != nil {
if _, ok := px.(*adapter.Proxy).ProxyAdapter.(outboundgroup.ProxyGroup); !ok {
if _, ok := px.Adapter().(outboundgroup.ProxyGroup); !ok {
runes := []rune(name)
match, err := uiSubtitlePattern.FindRunesMatch(runes)
if err == nil && match != nil {
@@ -213,12 +221,20 @@ func collectProviders(providers []provider.ProxyProvider, uiSubtitlePattern *reg
}
}
testURL := "https://www.gstatic.com/generate_204"
for k := range px.ExtraDelayHistories() {
if len(k) > 0 {
testURL = k
break
}
}
result = append(result, &Proxy{
Name: name,
Title: strings.TrimSpace(title),
Subtitle: strings.TrimSpace(subtitle),
Type: px.Type().String(),
Delay: int(px.LastDelay()),
Delay: int(px.LastDelayForTestUrl(testURL)),
})
}
}

View File

@@ -1,7 +1,7 @@
package tunnel
import (
"github.com/Dreamacro/clash/tunnel"
"github.com/metacubex/mihomo/tunnel"
)
func QueryMode() string {

View File

@@ -1,7 +1,7 @@
package tunnel
import (
"github.com/Dreamacro/clash/tunnel/statistic"
"github.com/metacubex/mihomo/tunnel/statistic"
)
func ResetStatistic() {

View File

@@ -1,7 +1,9 @@
package tunnel
import "github.com/Dreamacro/clash/adapter/provider"
func Suspend(s bool) {
provider.Suspend(s)
// cause by ACTION_SCREEN_OFF/ACTION_SCREEN_ON,
// but we don't know what should do so just ignored.
//
// WARNING: don't call core's Tunnel.OnSuspend/OnRunning at here,
// this will cause the core to stop processing new incoming connections when the screen is locked.
}

View File

@@ -49,7 +49,7 @@ object Clash {
}
fun notifyDnsChanged(dns: List<String>) {
Bridge.nativeNotifyDnsChanged(dns.joinToString(separator = ","))
Bridge.nativeNotifyDnsChanged(dns.toSet().joinToString(separator = ","))
}
fun notifyTimeZoneChanged(name: String, offset: Int) {
@@ -64,13 +64,14 @@ object Clash {
fun startTun(
fd: Int,
stack: String,
gateway: String,
portal: String,
dns: String,
markSocket: (Int) -> Boolean,
querySocketUid: (protocol: Int, source: InetSocketAddress, target: InetSocketAddress) -> Int
) {
Bridge.nativeStartTun(fd, gateway, portal, dns, object : TunInterface {
Bridge.nativeStartTun(fd, stack, gateway, portal, dns, object : TunInterface {
override fun markSocket(fd: Int) {
markSocket(fd)
}
@@ -208,10 +209,6 @@ object Clash {
Bridge.nativeClearOverride(slot.ordinal)
}
fun installSideloadGeoip(data: ByteArray?) {
Bridge.nativeInstallSideloadGeoip(data)
}
fun queryConfiguration(): UiConfiguration {
return Json.Default.decodeFromString(
UiConfiguration.serializer(),

View File

@@ -19,7 +19,7 @@ object Bridge {
external fun nativeNotifyDnsChanged(dnsList: String)
external fun nativeNotifyTimeZoneChanged(name: String, offset: Int)
external fun nativeNotifyInstalledAppChanged(uidList: String)
external fun nativeStartTun(fd: Int, gateway: String, portal: String, dns: String, cb: TunInterface)
external fun nativeStartTun(fd: Int, stack: String, gateway: String, portal: String, dns: String, cb: TunInterface)
external fun nativeStopTun()
external fun nativeStartHttp(listenAt: String): String?
external fun nativeStopHttp()
@@ -46,9 +46,9 @@ object Bridge {
external fun nativeReadOverride(slot: Int): String
external fun nativeWriteOverride(slot: Int, content: String)
external fun nativeClearOverride(slot: Int)
external fun nativeInstallSideloadGeoip(data: ByteArray?)
external fun nativeQueryConfiguration(): String
external fun nativeSubscribeLogcat(callback: LogcatInterface)
external fun nativeCoreVersion(): String
private external fun nativeInit(home: String, versionName: String, sdkVersion: Int)
@@ -61,7 +61,7 @@ object Bridge {
.detachFd()
val home = ctx.filesDir.resolve("clash").apply { mkdirs() }.absolutePath
val versionName = ctx.packageManager.getPackageInfo(ctx.packageName, 0).versionName
val versionName = ctx.packageManager.getPackageInfo(ctx.packageName, 0).versionName ?: "unknown"
val sdkVersion = Build.VERSION.SDK_INT
Log.d("Home = $home")

View File

@@ -41,6 +41,18 @@ data class ConfigurationOverride(
@SerialName("ipv6")
var ipv6: Boolean? = null,
@SerialName("external-controller")
var externalController: String? = null,
@SerialName("external-controller-tls")
var externalControllerTLS: String? = null,
@SerialName("external-controller-cors")
var externalControllerCors: ExternalControllerCors = ExternalControllerCors(),
@SerialName("secret")
var secret: String? = null,
@SerialName("hosts")
var hosts: Map<String, String>? = null,
@@ -100,6 +112,9 @@ data class ConfigurationOverride(
@SerialName("fake-ip-filter")
var fakeIpFilter: List<String>? = null,
@SerialName("fake-ip-filter-mode")
var fakeIPFilterMode: FilterMode? = null,
@SerialName("fallback-filter")
val fallbackFilter: DnsFallbackFilter = DnsFallbackFilter(),
@@ -150,14 +165,22 @@ data class ConfigurationOverride(
@SerialName("fake-ip")
FakeIp,
}
@Serializable
enum class FilterMode {
@SerialName("blacklist")
BlackList,
@SerialName("whitelist")
WhiteList,
}
@Serializable
data class Sniffer(
@SerialName("enable")
var enable: Boolean? = null,
@SerialName("sniffing")
var sniffing: List<String>? = null,
@SerialName("sniff")
var sniff: Sniff = Sniff(),
@SerialName("force-dns-mapping")
var forceDnsMapping: Boolean? = null,
@@ -174,8 +197,11 @@ data class ConfigurationOverride(
@SerialName("skip-domain")
var skipDomain: List<String>? = null,
@SerialName("port-whitelist")
var portWhitelist: List<String>? = null,
@SerialName("skip-src-address")
var skipSrcAddress: List<String>? = null,
@SerialName("skip-dst-address")
var skipDstAddress: List<String>? = null,
)
@Serializable
@@ -190,6 +216,36 @@ data class ConfigurationOverride(
var geosite: String? = null,
)
@Serializable
data class ExternalControllerCors(
@SerialName("allow-origins")
var allowOrigins: List<String>? = null,
@SerialName("allow-private-network")
var allowPrivateNetwork: Boolean? = null,
)
@Serializable
data class Sniff(
@SerialName("HTTP")
var http: ProtocolConig = ProtocolConig(),
@SerialName("TLS")
var tls: ProtocolConig = ProtocolConig(),
@SerialName("QUIC")
var quic: ProtocolConig = ProtocolConig(),
)
@Serializable
data class ProtocolConig(
@SerialName("ports")
var ports: List<String>? = null,
@SerialName("override-destination")
var overrideDestination: Boolean? = null,
)
override fun writeToParcel(parcel: Parcel, flags: Int) {
Parcelizer.encodeToParcel(serializer(), parcel, this)
}

View File

@@ -17,7 +17,7 @@ data class Provider(
}
enum class VehicleType {
HTTP, File, Compatible
HTTP, File, Inline, Compatible
}
override fun writeToParcel(parcel: Parcel, flags: Int) {

View File

@@ -17,6 +17,7 @@ data class Proxy(
enum class Type(val group: Boolean) {
Direct(false),
Reject(false),
RejectDrop(false),
Compatible(false),
Pass(false),
@@ -32,6 +33,13 @@ data class Proxy(
Hysteria2(false),
Tuic(false),
WireGuard(false),
Dns(false),
Ssh(false),
Mieru(false),
AnyTLS(false),
Sudoku(false),
Masque(false),
TrustTunnel(false),
Relay(true),

View File

@@ -1 +1 @@
<manifest package="com.github.kr328.clash.design" />
<manifest />

View File

@@ -19,6 +19,7 @@ class AppSettingsDesign(
srvStore: ServiceStore,
behavior: Behavior,
running: Boolean,
onHideIconChange: (hide: Boolean) -> Unit,
) : Design<AppSettingsDesign.Request>(context) {
enum class Request {
ReCreateAllActivities
@@ -65,6 +66,28 @@ class AppSettingsDesign(
}
}
switch(
value = uiStore::hideAppIcon,
icon = R.drawable.ic_baseline_hide,
title = R.string.hide_app_icon_title,
summary = R.string.hide_app_icon_desc,
) {
listener = OnChangedListener {
onHideIconChange(uiStore::hideAppIcon.get())
}
}
switch(
value = uiStore::hideFromRecents,
icon = R.drawable.ic_baseline_stack,
title = R.string.hide_from_recents_title,
summary = R.string.hide_from_recents_desc,
) {
listener = OnChangedListener {
requests.trySend(Request.ReCreateAllActivities)
}
}
category(R.string.service)
switch(

View File

@@ -81,7 +81,7 @@ class MainDesign(context: Context) : Design<MainDesign.Request>(context) {
init {
binding.self = this
binding.colorClashStarted = context.resolveThemedColor(R.attr.colorPrimary)
binding.colorClashStarted = context.resolveThemedColor(com.google.android.material.R.attr.colorPrimary)
binding.colorClashStopped = context.resolveThemedColor(R.attr.colorClashStopped)
}

View File

@@ -15,7 +15,7 @@ class MetaFeatureSettingsDesign(
configuration: ConfigurationOverride
) : Design<MetaFeatureSettingsDesign.Request>(context) {
enum class Request {
ResetOverride, ImportGeoIp, ImportGeoSite, ImportCountry
ResetOverride, ImportGeoIp, ImportGeoSite, ImportCountry, ImportASN
}
private val binding = DesignSettingsMetaFeatureBinding
@@ -137,13 +137,53 @@ class MetaFeatureSettingsDesign(
}
editableTextList(
value = configuration.sniffer::sniffing,
value = configuration.sniffer.sniff.http::ports,
adapter = TextAdapter.String,
title = R.string.sniffing,
title = R.string.sniff_http_ports,
placeholder = R.string.dont_modify,
configure = snifferDependencies::add,
)
selectableList(
value = configuration.sniffer.sniff.http::overrideDestination,
values = booleanValues,
valuesText = booleanValuesText,
title = R.string.sniff_http_override_destination,
configure = snifferDependencies::add,
)
editableTextList(
value = configuration.sniffer.sniff.tls::ports,
adapter = TextAdapter.String,
title = R.string.sniff_tls_ports,
placeholder = R.string.dont_modify,
configure = snifferDependencies::add,
)
selectableList(
value = configuration.sniffer.sniff.tls::overrideDestination,
values = booleanValues,
valuesText = booleanValuesText,
title = R.string.sniff_tls_override_destination,
configure = snifferDependencies::add,
)
editableTextList(
value = configuration.sniffer.sniff.quic::ports,
adapter = TextAdapter.String,
title = R.string.sniff_quic_ports,
placeholder = R.string.dont_modify,
configure = snifferDependencies::add,
)
selectableList(
value = configuration.sniffer.sniff.quic::overrideDestination,
values = booleanValues,
valuesText = booleanValuesText,
title = R.string.sniff_quic_override_destination,
configure = snifferDependencies::add,
)
selectableList(
value = configuration.sniffer::forceDnsMapping,
values = booleanValues,
@@ -185,9 +225,17 @@ class MetaFeatureSettingsDesign(
)
editableTextList(
value = configuration.sniffer::portWhitelist,
value = configuration.sniffer::skipSrcAddress,
adapter = TextAdapter.String,
title = R.string.port_whitelist,
title = R.string.skip_src_address,
placeholder = R.string.dont_modify,
configure = snifferDependencies::add,
)
editableTextList(
value = configuration.sniffer::skipDstAddress,
adapter = TextAdapter.String,
title = R.string.skip_dst_address,
placeholder = R.string.dont_modify,
configure = snifferDependencies::add,
)
@@ -255,6 +303,15 @@ class MetaFeatureSettingsDesign(
requests.trySend(Request.ImportCountry)
}
}
clickable (
title = R.string.import_asn_file,
summary = R.string.press_to_import,
){
clicked {
requests.trySend(Request.ImportASN)
}
}
}
binding.content.addView(screen.root)

View File

@@ -77,6 +77,13 @@ class NetworkSettingsDesign(
configure = vpnDependencies::add,
)
switch(
value = srvStore::allowIpv6,
title = R.string.allow_ipv6,
summary = R.string.allow_ipv6_summary,
configure = vpnDependencies::add,
)
if (Build.VERSION.SDK_INT >= 29) {
switch(
value = srvStore::systemProxy,
@@ -86,6 +93,22 @@ class NetworkSettingsDesign(
)
}
selectableList(
value = srvStore::tunStackMode,
values = arrayOf(
"system",
"gvisor",
"mixed"
),
valuesText = arrayOf(
R.string.tun_stack_system,
R.string.tun_stack_gvisor,
R.string.tun_stack_mixed
),
title = R.string.tun_stack_mode,
configure = vpnDependencies::add,
)
selectableList(
value = srvStore::accessControlMode,
values = AccessControlMode.values(),
@@ -105,8 +128,6 @@ class NetworkSettingsDesign(
clicked {
requests.trySend(Request.StartAccessControlList)
}
vpnDependencies.add(this)
}
if (running) {

View File

@@ -11,6 +11,7 @@ class NewProfileDesign(context: Context) : Design<NewProfileDesign.Request>(cont
sealed class Request {
data class Create(val provider: ProfileProvider) : Request()
data class OpenDetail(val provider: ProfileProvider.External) : Request()
data class LaunchScanner(val provider: ProfileProvider.QR) : Request()
}
private val binding = DesignNewProfileBinding
@@ -38,7 +39,12 @@ class NewProfileDesign(context: Context) : Design<NewProfileDesign.Request>(cont
}
private fun requestCreate(provider: ProfileProvider) {
requests.trySend(Request.Create(provider))
if (provider is ProfileProvider.QR) {
requests.trySend(Request.LaunchScanner(provider))
} else {
requests.trySend(Request.Create(provider))
}
}
private fun requestDetail(provider: ProfileProvider): Boolean {

View File

@@ -5,7 +5,6 @@ import android.view.View
import com.github.kr328.clash.core.model.ConfigurationOverride
import com.github.kr328.clash.core.model.LogMessage
import com.github.kr328.clash.core.model.TunnelState
import com.github.kr328.clash.design.adapter.SideloadProviderAdapter
import com.github.kr328.clash.design.databinding.DesignSettingsOverideBinding
import com.github.kr328.clash.design.databinding.DialogPreferenceListBinding
import com.github.kr328.clash.design.dialog.FullScreenDialog
@@ -23,7 +22,7 @@ class OverrideSettingsDesign(
configuration: ConfigurationOverride
) : Design<OverrideSettingsDesign.Request>(context) {
enum class Request {
ResetOverride, EditSideloadGeoip
ResetOverride
}
private val binding = DesignSettingsOverideBinding
@@ -52,49 +51,6 @@ class OverrideSettingsDesign(
}
}
suspend fun requestSelectSideload(initial: String, apps: List<AppInfo>): String =
withContext(Dispatchers.Main) {
suspendCancellableCoroutine { ctx ->
val binding = DialogPreferenceListBinding
.inflate(context.layoutInflater, context.root, false)
val adapter = SideloadProviderAdapter(context, apps, initial)
val dialog = FullScreenDialog(context)
dialog.setContentView(binding.root)
binding.surface = dialog.surface
binding.titleView.text = context.getString(R.string.sideload_geoip)
binding.newView.visibility = View.INVISIBLE
binding.mainList.applyLinearAdapter(context, adapter)
binding.resetView.setOnClickListener {
ctx.resume("")
dialog.dismiss()
}
binding.cancelView.setOnClickListener {
dialog.dismiss()
}
binding.okView.setOnClickListener {
ctx.resume(adapter.selectedPackageName)
dialog.dismiss()
}
dialog.setOnDismissListener {
if (!ctx.isCompleted)
ctx.resume(initial)
}
dialog.show()
}
}
init {
binding.self = this
@@ -185,6 +141,44 @@ class OverrideSettingsDesign(
empty = R.string.default_
)
editableText(
value = configuration::externalController,
adapter = NullableTextAdapter.String,
title = R.string.external_controller,
placeholder = R.string.dont_modify,
empty = R.string.default_
)
editableText(
value = configuration::externalControllerTLS,
adapter = NullableTextAdapter.String,
title = R.string.external_controller_tls,
placeholder = R.string.dont_modify,
empty = R.string.default_
)
editableTextList(
value = configuration.externalControllerCors::allowOrigins,
adapter = TextAdapter.String,
title = R.string.allow_origins,
placeholder = R.string.dont_modify,
)
selectableList(
value = configuration.externalControllerCors::allowPrivateNetwork,
values = booleanValues,
valuesText = booleanValuesText,
title = R.string.allow_private_network,
)
editableText(
value = configuration::secret,
adapter = NullableTextAdapter.String,
title = R.string.secret,
placeholder = R.string.dont_modify,
empty = R.string.default_
)
selectableList(
value = configuration::mode,
values = arrayOf(
@@ -231,15 +225,6 @@ class OverrideSettingsDesign(
placeholder = R.string.dont_modify,
)
clickable(
title = R.string.sideload_geoip,
summary = R.string.sideload_geoip_summary
) {
clicked {
requests.trySend(Request.EditSideloadGeoip)
}
}
category(R.string.dns)
val dnsDependencies: MutableList<Preference> = mutableListOf()
@@ -362,6 +347,22 @@ class OverrideSettingsDesign(
configure = dnsDependencies::add,
)
selectableList(
value = configuration.dns::fakeIPFilterMode,
values = arrayOf(
null,
ConfigurationOverride.FilterMode.BlackList,
ConfigurationOverride.FilterMode.WhiteList
),
valuesText = arrayOf(
R.string.dont_modify,
R.string.blacklist,
R.string.whitelist
),
title = R.string.fakeip_filter_mode,
configure = dnsDependencies::add,
)
selectableList(
value = configuration.dns.fallbackFilter::geoIp,
values = booleanValues,

View File

@@ -55,8 +55,9 @@ class ProvidersDesign(
fun requestUpdateAll() {
adapter.states.filter { !it.updating }.forEachIndexed { index, state ->
state.updating = true
requests.trySend(Request.Update(index, state.provider))
if (state.provider.vehicleType != Provider.VehicleType.Inline) {
requests.trySend(Request.Update(index, state.provider))
}
}
}
}

View File

@@ -108,7 +108,7 @@ class ProxyDesign(
binding.urlTestFloatView.visibility = View.GONE
} else {
binding.urlTestFloatView.supportImageTintList = ColorStateList.valueOf(
context.resolveThemedColor(R.attr.colorOnPrimary)
context.resolveThemedColor(com.google.android.material.R.attr.colorOnPrimary)
)
binding.pagesView.apply {

View File

@@ -15,9 +15,9 @@ class PopupListAdapter(
private val texts: List<CharSequence>,
private val selected: Int,
) : BaseAdapter() {
private val colorPrimary = context.resolveThemedColor(R.attr.colorPrimary)
private val colorOnPrimary = context.resolveThemedColor(R.attr.colorOnPrimary)
private val colorControlNormal = context.resolveThemedColor(R.attr.colorControlNormal)
private val colorPrimary = context.resolveThemedColor(com.google.android.material.R.attr.colorPrimary)
private val colorOnPrimary = context.resolveThemedColor(com.google.android.material.R.attr.colorOnPrimary)
private val colorControlNormal = context.resolveThemedColor(com.google.android.material.R.attr.colorControlNormal)
override fun getCount(): Int {
return texts.size

View File

@@ -55,10 +55,17 @@ class ProviderAdapter(
holder.binding.provider = state.provider
holder.binding.state = state
holder.binding.update = View.OnClickListener {
state.updating = true
requestUpdate(position, state.provider)
if (state.provider.vehicleType == Provider.VehicleType.Inline) {
holder.binding.endView.visibility = View.GONE
holder.binding.elapsedView.visibility = View.GONE
holder.binding.divider.visibility = View.GONE
} else {
holder.binding.endView.visibility = View.VISIBLE
holder.binding.elapsedView.visibility = View.VISIBLE
holder.binding.update = View.OnClickListener {
state.updating = true
requestUpdate(position, state.provider)
}
}
}

View File

@@ -1,48 +0,0 @@
package com.github.kr328.clash.design.adapter
import android.content.Context
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.github.kr328.clash.design.databinding.AdapterSideloadProviderBinding
import com.github.kr328.clash.design.model.AppInfo
import com.github.kr328.clash.design.util.layoutInflater
import com.github.kr328.clash.design.util.root
class SideloadProviderAdapter(
private val context: Context,
private val apps: List<AppInfo>,
var selectedPackageName: String
) : RecyclerView.Adapter<SideloadProviderAdapter.Holder>() {
class Holder(val binding: AdapterSideloadProviderBinding) :
RecyclerView.ViewHolder(binding.root)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): Holder {
return Holder(
AdapterSideloadProviderBinding
.inflate(context.layoutInflater, context.root, false)
)
}
override fun onBindViewHolder(holder: Holder, position: Int) {
val current = apps[position]
holder.binding.appInfo = current
holder.binding.selected = selectedPackageName == current.packageName
holder.binding.root.setOnClickListener {
val index = apps.indexOfFirst { it.packageName == selectedPackageName }
selectedPackageName = current.packageName
if (index >= 0)
notifyItemChanged(index)
notifyItemChanged(position)
}
}
override fun getItemCount(): Int {
return apps.size
}
}

View File

@@ -8,15 +8,15 @@ import com.github.kr328.clash.design.util.resolveThemedColor
import com.github.kr328.clash.design.util.resolveThemedResourceId
class ProxyViewConfig(val context: Context, var proxyLine: Int) {
private val colorSurface = context.resolveThemedColor(R.attr.colorSurface)
private val colorSurface = context.resolveThemedColor(com.google.android.material.R.attr.colorSurface)
val clickableBackground =
context.resolveThemedResourceId(android.R.attr.selectableItemBackground)
val selectedControl = context.resolveThemedColor(R.attr.colorOnPrimary)
val selectedBackground = context.resolveThemedColor(R.attr.colorPrimary)
val selectedControl = context.resolveThemedColor(com.google.android.material.R.attr.colorOnPrimary)
val selectedBackground = context.resolveThemedColor(com.google.android.material.R.attr.colorPrimary)
val unselectedControl = context.resolveThemedColor(R.attr.colorOnSurface)
val unselectedControl = context.resolveThemedColor(com.google.android.material.R.attr.colorOnSurface)
val unselectedBackground: Int
get() = if (proxyLine==1) Color.TRANSPARENT else colorSurface

View File

@@ -14,6 +14,8 @@ sealed class ProfileProvider {
get() = context.getString(R.string.import_from_file)
override val icon: Drawable?
get() = context.getDrawableCompat(R.drawable.ic_baseline_attach_file)
}
class Url(private val context: Context) : ProfileProvider() {
@@ -25,6 +27,14 @@ sealed class ProfileProvider {
get() = context.getDrawableCompat(R.drawable.ic_baseline_cloud_download)
}
class QR(private val context: Context) : ProfileProvider() {
override val name: String
get() = context.getString(R.string.qr)
override val summary: String
get() = context.getString(R.string.import_from_qr)
override val icon: Drawable?
get() = context.getDrawableCompat(R.drawable.baseline_qr_code_scanner)
}
class External(
override val name: String,
override val summary: String,

View File

@@ -1,6 +1,8 @@
package com.github.kr328.clash.design.store
import android.content.ComponentName
import android.content.Context
import android.content.pm.PackageManager
import com.github.kr328.clash.common.store.Store
import com.github.kr328.clash.common.store.asStoreProvider
import com.github.kr328.clash.core.model.ProxySort
@@ -25,6 +27,20 @@ class UiStore(context: Context) {
values = DarkMode.values()
)
var hideAppIcon: Boolean by store.boolean(
key = "hide_app_icon",
defaultValue = context.packageManager.getComponentEnabledSetting(context.mainActivityAlias)
.let { state ->
state != PackageManager.COMPONENT_ENABLED_STATE_ENABLED &&
state != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
},
)
var hideFromRecents: Boolean by store.boolean(
key = "hide_from_recents",
defaultValue = false,
)
var proxyExcludeNotSelectable by store.boolean(
key = "proxy_exclude_not_selectable",
defaultValue = false,
@@ -64,5 +80,8 @@ class UiStore(context: Context) {
companion object {
private const val PREFERENCE_NAME = "ui"
val Context.mainActivityAlias: ComponentName
get() = ComponentName(this, "com.github.kr328.clash.MainActivityAlias")
}
}

View File

@@ -8,8 +8,8 @@ import com.github.kr328.clash.design.model.AppInfo
fun PackageInfo.toAppInfo(pm: PackageManager): AppInfo {
return AppInfo(
packageName = packageName,
icon = applicationInfo.loadIcon(pm).foreground(),
label = applicationInfo.loadLabel(pm).toString(),
icon = applicationInfo!!.loadIcon(pm).foreground(),
label = applicationInfo!!.loadLabel(pm).toString(),
installTime = firstInstallTime,
updateDate = lastUpdateTime,
)

View File

@@ -29,6 +29,7 @@ fun Provider.type(context: Context): String {
val vehicle = when (vehicleType) {
Provider.VehicleType.HTTP -> context.getString(R.string.http)
Provider.VehicleType.File -> context.getString(R.string.file)
Provider.VehicleType.Inline -> context.getString(R.string.inline)
Provider.VehicleType.Compatible -> context.getString(R.string.compatible)
}

Some files were not shown because too many files have changed in this diff Show More