This project is not responsible for: damaged devices, damaged SD cards, or burnt SoCs.
Make sure your configuration file does not cause traffic loopback, otherwise it may cause your phone to restart endlessly.
If you really don't know how to configure this module, you may need an application like ClashForAndroid, ClashMetaForAndroid, v2rayNG, Surfboard, SagerNet, AnXray, NekoBox etc.
- Download the module zip package from RELEASE and install it via MAGISK. Then reboot.
- Make sure you are connected to the internet, and execute the following command to download binaries etc:
su -c /data/adb/box/scripts/box.tool upyacd
su -c /data/adb/box/scripts/box.tool subgeo
su -c /data/adb/box/scripts/box.tool upcore
- Support for the next online module update in Magisk Manager (updating the module will take effect without rebooting).
This module includes:
After installing the module, download the appropriate core file for your device's architecture and place it in the /data/adb/box/bin/ directory, or execute:
su -c /data/adb/box/scripts/box.tool upcore
# list of available kernel binaries
bin_list=("clash" "sing-box" "xray" "v2fly")
# select the client to use : clash / sing-box / xray / v2fly
bin_name="good day"
- Each core works in the directory
/data/adb/box/bin/${bin_name}
, and the core name is determined bybin_name
in the fileBFM
. - Each core configuration file needs to be customized by the user, and the scripts will check the validity of the configuration, and the check result will be saved in the file
/data/adb/box/run/runs.log.
- Tip:
clash
andsing-box
come with ready-to-work default configurations with the transparent proxy script. For further configuration, see the official documentation. Address: dokumen clash, dokumen sing-box
Layanan inti berikut secara kolektif disebut sebagai BFM
- The following core services are collectively referred to as
BFM
- You can enable or disable the module through the Magisk Manager application in real time to start or stop the
BFM
service, without restarting the device. Starting the service may take a few seconds, and stopping the service can take effect immediately.
BFM
defaults to proxying all applications (APPs) for all Android users.- If you want
BFM
to proxy all applications (APP), except for certain ones, please open the file/data/adb/box/settings.ini
and change the value ofproxy_mode
toblacklist
(default), add packages topackages_list
, for example:packages_list=("com.termux" "org.telegram.messenger")
- Use
whitelist
if you only want to proxy certain applications (APP). - blacklist / whitelist does not work on
Clash fake-ip
- When the value of
proxy_mode
istun
, transparent proxy will not work, only the corresponding kernel will start, which can be used to support TUN(auto-route
), currently onlyclash
andsing-box
are available.
BFM
usesTPROXY
to transparently proxy TCP + UDP (default). If it detects that the device does not support TPROXY, open/data/adb/box/settings.ini
and changenetwork_mode="redirect"
to useredirect
for TCP proxy only.- Open the file
/data/adb/box/settings.ini
, change the value ofnetwork_mode
toredirect
,tproxy
, ormixed
. - redirect:
redirec TCP only.
- tproxy:
tproxy TCP + UDP.
- mixed:
redirec TCP + tun UDP.
BFM
transparently proxies localhost and hotspot (including USB tethering) by default.- Open the file
/data/adb/box/settings.ini
, modifyignore_out_list
and addwlan+
, then transparent proxy will bypass wlan, and hotspot won't connect to the proxy. - Open the file
/data/adb/box/settings.ini
, modifyap_list
and addwlan+
.BFM
will proxy the hotspot (for MediaTek devices, it may be ap+ / wlan+). - Use the
ifconfig/ipconfig
command in the terminal to find out the name of the AP.
~ 06.12 PM ➤ #ifconfig
wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.x.x.x netmask 255.255.255.0 broadcast 192.168.43.255
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 3000 (UNSPEC)
# Set update interval using cron, for more information: https://crontab.guru/
crontab_sec='false'
update_interval="0 12 */3 * *" # updates will run at 12 noon every three days.
# Update sub&geo
# execute manual, Type "su -c /data/adb/box/scripts/box.tool subgeo" to update
auto_update_geox="false"
# Only update clash subscription URL
auto_update_subscription="false"
subscription_url=""
- Located at
/data/adb/box/settings.ini
, the configuration facilitates an automatic update of the geo sab subscription every 3 days upon activation. Customization of thesubscription_url
andupdate_interval
variables is possible, and executing the process manually can be achieved using the following command:su -c /data/adb/box/scripts/box.tool subgeo
.
- If you want to fully control
BFM
by running commands, just create a new file/data/adb/box/manual
. In this case, theBFM
service will not start automatically when your device is turned on, and you also cannot set the start or stop of the service through the Magisk Manager app.
The BFM
service script is /data/adb/box/scripts/box.service
- Start
BFM
:
su -c /data/adb/box/scripts/box.service start
- Stop
BFM
:
su -c /data/adb/box/scripts/box.service stop
- The terminal will print logs and output them to a log file simultaneously.
- The transparent proxy script is
/data/adb/box/scripts/box.iptables
- Enable transparent proxy:
su -c /data/adb/box/scripts/box.iptables enable
- Disable transparent proxy:
su -c /data/adb/box/scripts/box.iptables disable
- When modifying any of the core configuration files, please ensure that the tproxy related configurations are consistent with the definitions in the
/data/adb/box/settings.ini
file. - If the machine has a public IP address, add the IP to the intranet in the
/data/adb/box/settings.ini
file to prevent traffic loops. - Logs for the
BFM
service can be found in the/data/adb/box/run
directory.
- Removing the installation of this module from Magisk Manager will remove
/data/adb/service.d/box_service.sh
and keep theBFM
data directory at /data/adb/box. - You can use the following commands to remove the
BFM
data:
su -c rm -rf /data/adb/box
su -c rm -rf /data/adb/service.d/box_service.sh