English | 简体中文
A fork from V2ray for Android
This is a Magisk module for Xray/V2ray/Sing-box/Mihomo/Hysteria2, and includes xrayhelper binaries for arm64, x64.
I'm not responsible for bricked devices, dead SD cards, or burning your SoC.
Make sure your config file does not cause traffic to loop back, otherwise it may cause your phone to constantly reboot.
If you really don't know how to configure this module, you mignt need apps like v2rayNG, SagerNet(or AnXray), ClashMeta For Android etc.
Download the module zip from Release and install it via Magisk
This module does not contain binaries such as Xray-core, When installing, the relevant files are downloaded automatically. If your network has poor access to Github, please consider using a network proxy or choose not install core online.
If your device don't have volume keys, you can create file /sdcard/xray4magisk.setup
, first line of the file will determine the core type, xray
for Xray, v2ray
for V2ray, sing-box
for Sing-box, mihomo
for Mihomo and hysteria2
for Hysteria2, any other content will skip core installation; second line of the file will control whether to overwrite old config files, keep
will preserve them, otherwise will be overwritten. The third line of the file selects the webUI type, leave it blank for default, currently the mihomo
UI option is supported 1
for yacd-meta, 2
for metacubexd.
/data/adb/xray/xrayhelper.yml
/data/adb/xray/confs/*.json
/data/adb/xray/v2rayconfs/config.json
/data/adb/xray/singconfs/*.json
/data/adb/xray/mihomoconfs/template.yaml
/data/adb/xray/hy2confs/config.yaml
/data/adb/xray/adghomeconfs/config.yaml
, and the default username and password are both xray4magisk
Tip: The default config already sets the inbounds section to work with transparent proxy scripts. It is recommended that use xrayhelper to manage your proxy server, for advanced configurations please refer to the appropriate official documentation, such as Xray, V2ray, Sing-box, Mihomo and Hysteria2
The following core services are collectively referred to as Xray
Install Termux :
Config alias (bash):
echo "alias xrayhelper=\"su -c /data/adb/xray/bin/xrayhelper\"" >> ~/.bashrc && source ~/.bashrc
Start service :
xrayhelper service start
Stop service :
xrayhelper service stop
Enable Transparent proxy :
xrayhelper proxy enable
Disable Transparent proxy :
xrayhelper proxy disable
XrayHelper is used in version 3.0 and above, for more detailed configuration please refer to XrayHelper
If you want to control xray by running command totally, just add a file /data/adb/xray/manual
. In this situation, xray service won't start on boot automatically and you cann't manage service start/stop via Magisk Manager App.
Just add the option -v
or --verbose
when you using xrayhelper
rm -rf /data/adb/xray && rm -rf /data/adb/service.d/xray4magisk_service.sh
.What is the difference between 3.0 and previous version?
Rewritten with Golang, implements some functions that are difficult to implement with shell scripts, does not depend on BusyBox, and can be installed on KernelSU.
This module cause battery drain really quick.
It might be a DNS issue, check
/data/adb/xray/run/error.log
.
GUI support?
Please use KernelSU or KsuWebUIStandalone.
Why not store config files in Internal Storage?
For privacy. Some apps may read your data, check Storage Isolation
Project X is a set of network tools that help you to build your own computer network. It secures your network connections and thus protects your privacy. See Project X for more information.
XrayHelper, A unified proxy helper for Android, some scripts in Xray4Magisk rewritten with golang, provide arm64 and amd64 binary.