English 简体中文
A fork of V2ray for Android
This is a Xray module for Magisk, and includes binaries for arm, arm64, x86, x64.
I'm not responsible for bricked devices, dead SD cards, or burning your SoC.
Make sure you are not going to loopback traffic again and again. It might cause your phone reset, then bootloop.
You can download the release installer zip file and install it via the Magisk Manager App.
NOTE: This module doesn't contain Xray-core binary. Instead, the installation process download the latest binary file from Xray's github releases.
Download the Xray-core zip file and put it in /sdcard/Download
.
NOTICE: It is important to check your device's CPU Architecture, and select the correct .zip file.
For example, for sdm855, we choose "Xray-android-arm64-v8a.zip".
-
Xray config files are store in
/data/adb/xray/confs/*.json
. -
proxy config is
/data/adb/xray/confs/proxy.json
. -
Tips: Please notice that the default configuration has already set inbounds section to cooperate work with transparent proxy script. It is recommended that you only edit the
proxy.json
to your proxy server and edit file/data/adb/xray/appid.list
to select which App to proxy. Edit fileignore_out.list
can help you to ignore some OUTPUT interfaces.
- xray service is auto-run after system boot up by default.
- You can start or stop xray service by simply turn on or turn off the module via Magisk Manager App. Start service may wait about 10 second and stop service may take effect immediately.
-
If you expect transparent proxy ( read Transparent proxy section for more detail ) for specific Apps, just write down these Apps' uid in file
/data/adb/xray/appid.list
.Each App's uid should separate by space or just one App's uid per line. ( for Android App's uid , you can search App's package name in file
/data/system/packages.list
, or you can look into some App like Shadowsocks. ) -
If you expect all Apps proxy by xray with transparent proxy, just write
ALL
in file/data/adb/xray/appid.list
. -
If you expect all Apps proxy by xray with transparent proxy EXCEPT specific Apps, write down
bypass
at the first line then these Apps' uid separated as above in file/data/adb/xray/appid.list
. -
Transparent proxy won't take effect until the xray service start normally and file
/data/adb/xray/appid.list
is not empty.
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.
-
xray service script is
$MODDIR/scripts/xray.service
. -
For example, in my environment ( Magisk-alpha version: 23001 )
-
Start service :
/data/adb/xray/scripts/xray.service start
-
Stop service :
/data/adb/img/xray/scripts/xray.service stop
-
-
Transparent proxy script is
/data/adb/xray/scripts/xray.tproxy
. -
For example, in my environment ( Magisk-alpha version: 23001 )
-
Enable Transparent proxy :
/data/adb/xray/scripts/xray.tproxy enable
-
Disable Transparent proxy :
/data/adb/xray/scripts/xray.tproxy disable
-
TODO
TODO
For best compatibility, this module disable IPv6 by default.
To enable IPv6 proxy, execute touch /data/adb/xray/ipv6
To enable DNS AAAA record querying, edit dns.json
, change "queryStrategy"
from "UseIPv4" to "UseIP".
To enable local IPv6 out, edit base.json
, find the first inbound with "freedom" tag, change its "domainStrategy"
from "UseIPv4" to "UseIP".
To enable proxy IPv6 out, edit proxy.json
, change its "domainStrategy"
as what you do in base.json
.
- Uninstall the module via Magisk Manager App.
- You can clean xray data dir by running command
rm -rf /data/adb/xray && rm -rf /data/adb/service.d/xray4magisk_service.sh
.
No such file or directory?
You might need Busybox for Android NDK
Error calling service activity?
This module is designed to automatically turn on and off Flight mode, in order to clear DNS cache. However, this only work when SELinux is premissive. So just ignore this error message in
service.log
, and if you like, do turn on and off Flight mode manually.
Why I need turn on WIFI hotspot otherwise I cannot connect to Internet? Why I cannot connect to proxy server while using domain name?
It is a DNS issue. You need add
"sockopt": { "domainStrategy": "UseIP" }
to your proxy's"streamSettings"
. By the way, this fix needs correct dns and routing configuration. If you don't know how to do, I suggest use IP address instead of domain name. Or use a Xray binary compiled with CGO enabled. Reference: #12
This module cause battery drain really quick.
It might be a DNS issue, check
/data/adb/xray/run/error.log
.
GUI support?
Not done yet.
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.