- box.inotify: redirect service actions to inotify.log instead of service.log - box.iptables: add help|-h|--help commands with usage descriptions, remove color codes from errors - box.service: - rewrite log cleanup to timestamped backup with clearer messages - add help menu for service control commands - remove unnecessary inline comments - box.tool: - add detailed logging for config checks, reload, and update operations - improve error handling and skip steps on failure - add backup steps before updating curl, yq, and other binaries - enhance geo data update with explicit logging and cleanup - refine kernel updates for sing-box, clash, xray/v2fly, hysteria with clearer output and checks - improve cgroup management log messages - add comprehensive help menu for all commands
Box for Root
BOX
Transparent Proxy for Android (Root)
Introduction
Box for Root (BFR) is a Magisk, KernelSU, APatch, module that provides a suite of proxy tools, including clash, sing-box, v2ray, hysteria and xray. It allows you to configure a transparent proxy on Android devices with root access.
Features
- Support for multiple proxy tools:
clash,sing-box,v2ray,hysteria, andxray. - Transparent proxy for Android with root access.
- Seamless integration with Magisk, KernelSU, and APatch.
- Manage proxy services with ease.
Apk Manager
You can use the BFR Manager app (optional) to manage Box for Root on your device. Download BFR Manager
⚠️ If you receive continuous notifications, open Magisk Manager, navigate to SuperUser, search for
BoxForRoot, and disable logs and notifications.
Module Directory
The core files of the module are stored in the following directories:
MODDIR=/data/adb/boxMODLOG=/data/adb/box/runSETTINGS=/data/adb/box/settings.ini
⚠️ Before editing the
settings.inifile located at/data/adb/box/settings.ini, ensure that BFR is turned off to avoid configuration issues.
Manage Service Start/Stop
The following core services are collectively referred to as BFR. By default, the BFR service auto-starts after a system boot. You can manage the service through Magisk/KernelSU Manager App, with the service start taking a few seconds, and stopping it taking effect immediately.
To start the service:
su -c /data/adb/box/scripts/box.service start && su -c /data/adb/box/scripts/box.iptables enable
To stop the service:
su -c /data/adb/box/scripts/box.iptables disable && su -c /data/adb/box/scripts/box.service stop
Here are some additional instructions:
- When modifying any of the core configuration files, ensure that the tproxy-related configurations match the definitions in the /data/adb/box/settings.ini file.
- If your device has a public IP address, you can add that IP address to the internal network in the /data/adb/box/scripts/box.iptables file to prevent loopback traffic.
- The logs for the BFM service can be found in the directory /data/adb/box/run.
- Please note that modifying these files requires appropriate permissions. Make sure to carefully follow the instructions and validate any changes made to the configuration files.
You can run the following command to get other related operating instructions:
su -c /data/adb/box/scripts/box.tool
# usage: {check|geosub|geox|subs|upkernel|upxui|upyq|upcurl|reload|all}
su -c /data/adb/box/scripts/box.service
# usage: $0 {start|stop|restart|status|cron|kcron}
su -c /data/adb/box/scripts/box.iptables
# usage: $0 {enable|disable|renew}
Uninstall
Remove the module from Magisk/KernelSU/APatch Manager and run the following command to wipe the data:
su -c rm -rf /data/adb/box
su -c rm -rf /data/adb/service.d/box_service.sh
su -c rm -rf /data/adb/modules/box_for_root
Credits
- CHIZI-0618/box4magisk for the original Box for Magisk module.
License
This project is licensed under the GPL-3.0 license - see the LICENSE file for details.