Open source

Luch uses open-source components. The app’s network engine is based on Xray-core and REALITY (Mozilla Public License 2.0) with our modifications. Under the terms of MPL-2.0, we publish the source code of the modified files.

Xray-core

Our changes (applied in this order: file replacement, path removal, then the numbered patches):

  • proxy/socks/temp_udp_listen.goWhole-file replacement of proxy/socks/temp_udp_listen.go: fixes closing a UDP connection when the handshake has not completed.SHA-256: 3116c447aa0c641e6240c8abe42190d410ef00c5c68f20f0b3b6bbcdce604274
  • removed.listList of removed paths: packages that depend on GPL-licensed modules (Shadowsocks 2022).SHA-256: 0f72cb5a285d21e319b155c39751b1ca7e7a593b0cc11eb8a927c2918be051e9
  • 0001-amneziawg-3.1.patchAmneziaWG 3.1 support.SHA-256: 2f4627197213546a2c884760fd2d000dec0af6abf0870cf992aca76ee297c3d0
  • 0002-awg-review-fixes.patchAmneziaWG configuration and error-handling fixes.SHA-256: 9c52d88c0fac1f06e0fe25dbb4247ccd760284feb6245e9c4acf189e9ce0d929
  • 0003-awg-device-lifecycle.patchAmneziaWG device creation and shutdown.SHA-256: 31160f0f5cb6ecff9c650464ea381fde80b1fa6762a7a2d82e9a85cb9d6f2253
  • 0004-transport-pool-lifecycle.patchTransport connection pool lifecycle.SHA-256: fc16fd01a8e4d5e0bffccfe6c0089b560ba725237455cd20d3fea227fc7457d5
  • 0005-xhttp-hysteria-client-fixes.patchXHTTP and Hysteria client fixes.SHA-256: 3259834d17cf6e3ca3580999910a830f2ed04c38046033303305299c2e5e5644
  • 0006-drop-gpl-modules.patchRemoves the remaining Shadowsocks 2022 references and GPL/LGPL dependencies from go.mod.SHA-256: 5344625a1ae1f887fb4c2294e683670d171f96c38d3512f1494eea98acdaa146

REALITY

Our changes:

  • 0001-drop-juju-ratelimit.patchReplaces the github.com/juju/ratelimit rate limiter (LGPL-3.0) with golang.org/x/time/rate.SHA-256: 92707fba3c6d4bb163908ef1c725e58d305e0361bfcb81bebea2b4807873d67b

Checksums of all files: SHA256SUMS.

How to reproduce

Download the files keeping their paths, verify the checksums and apply the changes to the sources at the listed commits:

mkdir luch-src && cd luch-src
B=https://luchvpn.com/oss/src
curl -fsSL -o SHA256SUMS "$B/SHA256SUMS"
for f in $(awk '{print $2}' SHA256SUMS); do curl -fsSL --create-dirs -o "$f" "$B/$f"; done
shasum -a 256 -c SHA256SUMS

git clone https://github.com/XTLS/Xray-core upstream-xray
git -C upstream-xray checkout 5ca6f4b7d4dc20a881d4330e498892697627ec0c
cp xray-core/proxy/socks/temp_udp_listen.go upstream-xray/proxy/socks/
grep -v '^#' xray-core/removed.list | grep . | (cd upstream-xray && xargs rm -rf)
for p in xray-core/0*.patch; do patch -p1 --forward -d upstream-xray < "$p"; done

git clone https://github.com/XTLS/REALITY upstream-reality
git -C upstream-reality checkout 9234c772ba8f181f31c3e81dc2b4177322e5a9a9
patch -p1 --forward -d upstream-reality < reality/0001-drop-juju-ratelimit.patch

The patches were made against the Go module sources of the listed versions, that is, the repository contents at the listed commits.

Other components

Network engine

  • Xray-core 26.7.28 — MPL-2.0, modified (see above).
  • REALITY — MPL-2.0, modified (see above).
  • The Go standard library and the Go modules used by the engine — BSD-3-Clause, MIT, Apache-2.0 and similar permissive licenses.

Traffic forwarding

  • hev-socks5-tunnel 2.19.3, hev-socks5-core, hev-task-system, yaml — MIT, © hev (Heiher).
  • lwIP — BSD-3-Clause, © Swedish Institute of Computer Science.

Routing data

  • russia-v2ray-rules-dat (runetfreedom) — data compiled with GPL-3.0 tools.
  • Country IP data: GeoLite by MaxMind, under the GeoLite End User License Agreement and CC BY-SA 4.0 (www.maxmind.com).
  • Domain lists: v2fly/domain-list-community — MIT.

App libraries

  • Kotlin standard library, kotlinx.coroutines, kotlinx.serialization — Apache-2.0, © JetBrains s.r.o.
  • AndroidX (Core, Activity, Lifecycle, Compose, Material 3) — Apache-2.0, © The Android Open Source Project.

Source code requests

If a file is unavailable or you need the source code of the modified files in another form, email support@luchvpn.com.