An open-source proxy client built on Xray-core, with a Kotlin Multiplatform foundation.
Android downloads are available; iOS has not been officially released.
| Platform | System version | Availability |
|---|---|---|
| Android | Android 9.0 (API 28) and later | Downloads available |
| iOS | - | - |
- Nodes and subscriptions: Import node links; add, manage, and update subscriptions.
- Import options: Clipboard, QR codes, and complete Xray JSON configurations.
- Connection and traffic display: VPN status and upload/download speeds.
- Routing and DNS: Configure routing, DNS, and related network options.
- Node sharing: Share ordinary nodes as links or QR codes.
- UI and themes: Shared Compose Multiplatform UI, dark mode, and large-screen layouts.
- Android integration: Per-app proxy settings, log viewing, and a resizable home-screen connection widget with current node, connection duration, and session traffic.
Supported protocols, transports, and configuration fields depend on the current parsers and the Xray-core version used by this repository.
Choose a universal APK if you are unsure of your device architecture. Packages from different channels may use different signing keys; switching channels may require reinstalling. Save your configurations first.
- Install the app and import node links or add a subscription.
- Select a node from the configuration list.
- Start the connection on Home and allow the system VPN permission request.
- Check status and traffic; adjust routing and DNS as needed.
The Home screen widget switch in Settings → General controls whether XrayFA appears in the system widget picker. It is disabled by default; enable it before adding a widget. Disabling removes existing instances, which must be added again after re-enabling.
To add the Android widget, long-press the home screen, open Widgets, and select XrayFA. Resize it for a compact switch or an expanded connection card; the switch controls the VPN and “Switch” opens the node list. The first connection requests VPN permission when needed.
Complete Xray JSON configurations have limitations for node-link sharing, latency tests, and some traffic statistics.
| Type | Supported |
|---|---|
| Proxy protocols | VLESS, VMess, Shadowsocks, Trojan, Hysteria2, SOCKS, HTTP |
| Network transports | RAW (TCP), XHTTP, WebSocket (WS), gRPC, HTTPUpgrade, KCP, XDRIVE (VLESS) |
XrayFA uses Gradle Kotlin DSL and a version catalog for dependencies, with Kotlin Multiplatform for shared logic, Compose Multiplatform for UI, and Android VPN and native integrations.
| Layer | Technology |
|---|---|
| Shared language and logic | Kotlin Multiplatform |
| Shared UI | Compose Multiplatform, Material 3 |
| Navigation and state | Decompose, Essenty |
| Dependency injection | Koin |
| Storage | Room Multiplatform, DataStore |
| Networking and serialization | Ktor, kotlinx.serialization |
| Proxy core | Xray-core, AndroidLibXrayLite |
| TUN forwarding | hev-socks5-tunnel |
| Android host | Android app, VpnService, JNI |
View project structure
XrayFA/
├── androidApp/ Android app and platform integration
├── shared/ Shared UI, navigation, and components
├── common/ Common types and utilities
├── domain/ Protocol parsing and configuration models
├── core/
│ ├── data/ Repositories
│ ├── database/ Room database
│ ├── datastore/ Settings storage
│ ├── network/ Networking
│ └── native-bridge/ Xray native bridge
├── platform/vpn/ Platform VPN interfaces and implementations
├── AndroidLibXrayLite/ Go native library submodule
├── tun2socks/ TUN forwarding and Android JNI
├── scripts/ Native library and build preparation
└── gradle/ Wrapper and dependency version catalog
Expand Android build instructions
git clone --recursive https://github.com/Q7DF1/XrayFA.git
cd XrayFAFor an existing clone:
git submodule update --init --recursiveRequirements:
- JDK 17, matching Android CI; Java/JVM bytecode targets version 11.
- Android SDK Platform 37, Platform Tools, and the corresponding Build Tools.
- Android NDK
28.2.13676358. - Go: the native submodule declares
go 1.26; build configuration recordsGO_VERSION=1.27.1. - Git; repository scripts also require Bash and curl or wget.
- Android Studio can be used for project sync, running, and debugging.
Configure the Android SDK path and use the required NDK. The first build downloads Gradle, dependencies, Go tools, and routing data.
Prepare routing data and the native Xray AAR:
bash scripts/fdroid.sh prebuild
bash scripts/fdroid.sh bindBuild the app:
# Debug
./gradlew :androidApp:assembleDebug
# Release
./gradlew :androidApp:assembleReleaseOutput directories:
androidApp/build/outputs/apk/debug/
androidApp/build/outputs/apk/release/
Native preparation generates androidApp/libs/libv2ray.aar. The ordinary preBuild task does not compile this AAR automatically.
Before packaging, preBuild verifies that the Xray AAR contains libgojni.so for all requested ABIs. A regular build requires all four Android architectures; an intentional single-ABI build must use -PfdroidAbi=<abi>. A partial AAR must be rebuilt with gomobile bind -target=android before producing the universal APK.
To sign a release, provide androidApp/xrayfa.jks and set the following values in environment variables or the root .release-signing.properties file. Non-empty environment variables take priority; the local properties file is ignored by Git.
KEYSTORE_PASSWORD=your-store-password
KEY_ALIAS=your-key-alias
KEY_PASSWORD=your-key-password
Caution
Without a keystore, the release APK is unsigned and must be signed before installation. Evaluate performance with Release; Debug includes debugging overhead and LeakCanary.
Run Android/JVM unit tests:
./gradlew :common:testDebugUnitTest :domain:testDebugUnitTest :core:datastore:testDebugUnitTestSome modules require the native AAR before testing.
Include the app version, OS version, architecture, installation channel, and reproduction steps when reporting an issue. Remove subscription URLs and authentication details from logs and screenshots.
For background kills and VPN drops, docs/TROUBLESHOOTING.md collects the log-capture commands and the per-OEM battery settings worth checking before filing a report.
Bug reports, fixes, translations, and documentation improvements are welcome. Read the contribution guide to get started.
- Xray-core
- AndroidLibXrayLite
- hev-socks5-tunnel
- Kotlin Multiplatform, Compose Multiplatform, Decompose, Koin, and other open-source dependencies
XrayFA uses the Apache-2.0 license. Third-party dependencies retain their respective licenses.
