Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
change logos
renovate[bot] committed Aug 14, 2023
1 parent 39b6d71 commit 383ef5a
Showing 6 changed files with 54 additions and 178 deletions.
Binary file modified docs/box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
154 changes: 1 addition & 153 deletions docs/box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/index_cn.md
Original file line number Diff line number Diff line change
@@ -67,6 +67,16 @@ su -c /data/adb/box/scripts/box.tool all
- 当 proxy_mode 的值为 tun 时,透明代理将不起作用,仅启动相应的内核,用于支持 TUN,目前仅有 clash 和 sing-box 可用。
- 如果使用 Clash,在 fake-ip 模式下,黑名单和白名单将无法生效。

### 特定进程的透明代理

- BFM 默认透明代理所有进程

- 如果您希望 BFM 代理所有进程,除了某些特定的进程,那么请打开 `/data/adb/box/settings.ini` 文件,修改 `proxy_mode` 的值为 `blacklist`(默认值),在 `gid_list` 数组中添加 GID 元素,GID 之间用空格隔开。即可**不代理**相应 GID 的进程

- 如果您希望只对特定的进程进行透明代理,那么请打开 `/data/adb/box/settings.ini` 文件,修改 `proxy_mode` 的值为 `whitelist`,在 `gid_list` 数组中添加 GID 元素,GID 之间用空格隔开。即可**仅代理**相应 GID 进程

> 小贴士:因为安卓 iptables 不支持 PID 扩展匹配,所以 Box 匹配进程是通过匹配 GID 间接达到的。安卓可以使用 busybox setuidgid 命令使用特定 UID 任意 GID 启动特定进程
### 更改代理模式

- BFM 使用 TPROXY 来透明代理 TCP + UDP(默认)。如果检测到设备不支持 TPROXY,请打开/data/adb/box/settings.ini 并将 network_mode="redirect"更改为仅使用 TCP 代理的 redirect。
26 changes: 18 additions & 8 deletions docs/index_en.md
Original file line number Diff line number Diff line change
@@ -61,15 +61,25 @@ su -c /data/adb/box/scripts/box.tool all
### To apply filtering using a blacklist or whitelist, you can follow these general steps:

- By default, BFM provides a proxy for all applications (APP) from all Android users.
- If you want BFM to proxy all applications (APP), except for some specific applications, please open the file /data/adb/box/settings.ini, change the value of proxy_mode to "blacklist" (default), and add the applications to be excluded to the packages_list, for example: packages_list=("com.termux" "org.telegram.messenger").
- If you only want to proxy specific applications (APP), use the "whitelist" mode.
- When the value of proxy_mode is set to "TUN", transparent proxy will not function, and only the corresponding kernel will start supporting TUN. Currently, only "clash" and "sing-box" are available.
- If Clash is used, the blacklist and whitelist will not apply in fake-ip mode
- If you want BFM to proxy all applications (APP), except for some specific applications, please open the file `/data/adb/box/settings.ini`, change the value of `proxy_mode` to `blacklist` (default), and add the applications to be excluded to the `packages_list`, for **example: packages_list=("com.termux" "org.telegram.messenger")**.
- If you only want to proxy specific applications (APP), use the `whitelist` mode.
- When the value of `proxy_mode` is set to `TUN`, transparent proxy will not function, and only the corresponding kernel will start supporting TUN. Currently, **only clash and sing-box are available**.
> Notes: If Clash is used, the blacklist and whitelist will not apply in fake-ip mode
### Transparent Proxies for Specific Processes

- BFM by default performs a transparent proxy for all processes.

- If you want BFM to proxy for all processes except specific ones, open the file `/data/adb/box/settings.ini`, change the value of `proxy_mode` to `blacklist` (the default value), then add GID elements to the `gid_list` array, with GID separated by spaces. This will result in processes with the corresponding GID **not being proxied**.

- If you wish to perform transparent proxying only for specific processes, open the file `/data/adb/box/settings.ini`, change the value of `proxy_mode` to `whitelist`, then add GID elements to the `gid_list` array, with GID separated by spaces. This will result in only processes with the corresponding GID being **proxied**.

> Tips: Since Android iptables does not support extension PID matching, process matching by Box is done via GID matching indirectly. On Android you can use busybox setuidgid command to start a specific process with a specific UID, any GID.
### Change the proxy mode in BFM, follow these steps:

- BFM utilizes TPROXY to transparently proxy TCP+UDP traffic (default). If it is detected that the device does not support TPROXY, open the file **/data/adb/box/settings.ini** and change network_mode="redirect" to REDIRECT, which only uses TCP proxying.
- Open the file /data/adb/box/settings.ini and change the value of network_mode to redirect, tproxy, or mixed.
- BFM utilizes TPROXY to transparently proxy TCP+UDP traffic (default). If it is detected that the device does not support TPROXY, open the file **/data/adb/box/settings.ini** and change `network_mode="redirect"` to `redirect`, which only uses TCP proxying.
- Open the file `/data/adb/box/settings.ini` and change the value of `network_mode` to **redirect, tproxy, or mixed**.
- redirect: Use redirect mode for TCP proxying.
- tproxy: Use tproxy mode for TCP + UDP proxying.
- mixed: Use redirect mode for TCP and tun mode for UDP proxying
@@ -106,8 +116,8 @@ su -c /data/adb/box/scripts/box.tool all

### manual mode

- If you want to have full control over BFM by running commands manually, you can create a new file named /data/adb/box/manual. In this case, the BFM service will not start automatically when your device is powered on, and you will not be able to control the start or stop of the service through the Magisk Manager application.
- By creating the /data/adb/box/manual file, you take manual control over BFM and can execute commands as needed to manage its operations. Please note that modifying system files requires appropriate permissions, and any manual changes should be made with caution.
- If you want to have full control over BFM by running commands manually, you can create a new file named **/data/adb/box/manual**. In this case, the BFM service will not start automatically when your device is powered on, and you will not be able to control the start or stop of the service through the Magisk Manager application.
- By creating the **/data/adb/box/manual** file, you take manual control over BFM and can execute commands as needed to manage its operations. Please note that modifying system files requires appropriate permissions, and any manual changes should be made with caution.

### Start and stop the management service

39 changes: 24 additions & 15 deletions docs/index_id.md
Original file line number Diff line number Diff line change
@@ -62,29 +62,38 @@ su -c /data/adb/box/scripts/box.tool all
### Menerapkan pemfilteran (blacklist/whitelist)

- BFM menyediakan proxy untuk semua aplikasi (APP) dari semua pengguna Android secara default.
- Jika Anda ingin BFM mem-proxy semua aplikasi (APP), kecuali beberapa aplikasi, silakan buka file /data/adb/box/settings.ini, ubah nilai proxy_mode menjadi blacklist (default), tambahkan aplikasi yang akan dikecualikan ke packages_list , misalnya: packages_list=("com.termux" "org.telegram.messenger")
- Jika Anda hanya ingin mem-proxy aplikasi (APP) tertentu, gunakan whitelist.
- Ketika nilai proxy_mode adalah TUN, proxy transparan tidak akan berfungsi, dan hanya kernel yang sesuai yang akan mulai mendukung TUN. Saat ini, hanya clash dan sing-box yang tersedia.
- Jika Clash digunakan, blacklist dan whitelist tidak akan berlaku dalam mode fake-ip.
- Jika Anda ingin BFM **mem-proxy semua aplikasi (APP), kecuali beberapa aplikasi**, silakan buka file `/data/adb/box/settings.ini`, ubah nilai `proxy_mode` menjadi `blacklist` (default), tambahkan aplikasi yang akan dikecualikan ke packages_list , misalnya: **packages_list=("com.termux" "org.telegram.messenger")**
- Jika Anda hanya ingin **mem-proxy aplikasi (APP) tertentu**, gunakan `whitelist`, dan tambahkan (APP) yang hanya ingin di proxy, misalnya: **packages_list=("com.termux" "org.telegram.messenger")**.
- Ketika nilai `proxy_mode` adalah TUN, **proxy transparan tidak akan berfungsi**, dan hanya kernel yang sesuai yang akan mulai mendukung TUN. Saat ini, hanya **clash** dan **sing-box** yang tersedia.

> Notes: Jika Clash digunakan, blacklist dan whitelist tidak akan berlaku dalam mode fake-ip.
### Proxy Transparan untuk Proses Tertentu

- BFM secara default melakukan proxy transparan untuk semua proses.
- Jika Anda ingin BFM melakukan proxy untuk semua proses kecuali beberapa proses tertentu, buka berkas `/data/adb/box/settings.ini`, ubah nilai `proxy_mode` menjadi `blacklist` (nilai default), lalu tambahkan elemen GID ke dalam array `gid_list`, dengan GID dipisahkan oleh spasi. Ini akan mengakibatkan proses dengan GID yang sesuai **tidak diproksikan**.
- Jika Anda ingin hanya melakukan proxy transparan untuk proses tertentu, buka berkas **/data/adb/box/settings.ini**, ubah nilai `proxy_mode` menjadi `whitelist`, lalu tambahkan elemen GID ke dalam array `gid_list`, dengan GID dipisahkan oleh spasi. Ini akan mengakibatkan hanya proses dengan GID yang sesuai yang akan **diproksikan**.

> Tip: Karena iptables Android tidak mendukung pencocokan ekstensi PID, pencocokan proses oleh Box dilakukan melalui pencocokan GID secara tidak langsung. Di Android dapat menggunakan perintah setuidgid busybox untuk memulai proses tertentu dengan UID tertentu, GID apa pun.
### mengubah mode proxy

- BFM menggunakan TPROXY untuk mem-proxy TCP+UDP secara transparan (default). Jika terdeteksi bahwa perangkat tidak mendukung TPROXY, buka /data/adb/box/settings.ini dan ubah network_mode="redirect" menjadi REDIRECT yang hanya menggunakan proxy TCP.
- Buka file /data/adb/box/settings.ini dan ubah nilai network_mode menjadi redirect, tproxy atau mixed.
- BFM menggunakan TPROXY untuk mem-proxy TCP+UDP secara transparan (default). Jika terdeteksi bahwa perangkat tidak mendukung TPROXY, buka `/data/adb/box/settings.ini` dan ubah `network_mode="redirect"` menjadi `redirect` yang hanya menggunakan proxy TCP.
- Buka file `/data/adb/box/settings.ini` dan ubah nilai `network_mode` menjadi `redirect`, `tproxy` atau `mixed`.
- redirect:redirect(TCP).
- tproxy:tproxy(TCP + UDP).
- mixed:redirect(TCP) and tun(UDP).

### Lewati proxy transparan saat menghubungkan ke Wi-Fi atau hotspot

- BFM secara transparan memproksi localhost dan hotspot (termasuk tethering USB) secara default.
- Buka file /data/adb/box/settings.ini, ubah ignore_out_list dan tambahkan wlan+, sehingga proxy transparan akan mem-bypass wlan dan hotspot tidak akan terhubung ke proxy.
- Buka file /data/adb/box/settings.ini, ubah ap_list dan tambahkan wlan+. BFM akan mem-proxy hotspot (mungkin ap+ / wlan+ untuk perangkat Mediatek).
- Gunakan perintah ifconfig di Terminal untuk mengetahui nama AP.
- BFM secara transparan memproksi `localhost` dan `hotspot` (termasuk tethering USB) secara default.
- Buka file `/data/adb/box/settings.ini`, ubah `ignore_out_list` dan tambahkan `wlan+`, sehingga proxy transparan akan mem-bypass `wlan` dan `hotspot` **tidak akan terhubung ke proxy**.
- Buka file `/data/adb/box/settings.ini`, ubah `ap_list` dan tambahkan `wlan+`. BFM akan **mem-proxy hotspot** (mungkin **ap+ / wlan+** untuk perangkat **Mediatek**).
- Gunakan perintah `ifconfig` di Terminal untuk mengetahui nama AP.

### Aktifkan Cron Job untuk memperbarui Geo dan Subs sesuai jadwal secara otomatis

- Buka file /data/adb/box/settings.ini, ubah nilai run_crontab=true, dan atur interva_update="@daily" (default), sesuaikan dengan yang anda inginkan.
- Buka file `/data/adb/box/settings.ini`, ubah nilai `run_crontab=true`, dan atur `interva_update="@daily"` (default), sesuaikan dengan yang anda inginkan.

```shell
# jalankan perintah
@@ -97,7 +106,7 @@ su -c /data/adb/box/scripts/box.tool all

### Masuk ke mode manual

- Jika Anda ingin memiliki kontrol penuh atas BFM dengan menjalankan perintah, buat saja file baru bernama /data/adb/box/manual. Dalam hal ini, layanan BFM tidak akan dimulai secara otomatis saat perangkat Anda dihidupkan, Anda juga tidak dapat mengatur mulai atau berhentinya layanan melalui aplikasi Magisk Manager.
- Jika Anda ingin memiliki kontrol penuh atas BFM dengan menjalankan perintah, buat saja file baru bernama `/data/adb/box/manual`. Dalam hal ini, layanan BFM **tidak akan dimulai secara otomatis saat perangkat Anda dihidupkan)**, Anda juga tidak dapat mengatur mulai atau berhentinya layanan melalui aplikasi Magisk Manager.

### Memulai dan menghentikan layanan manajemen

@@ -157,9 +166,9 @@ Atau Anda dapat memperbaruinya satu per satu.

## instruksi lainnya

- Saat memodifikasi salah satu file konfigurasi inti, pastikan konfigurasi terkait tproxy cocok dengan definisi di file /data/adb/box/settings.ini.
- Jika perangkat memiliki alamat IP publik, tambahkan IP tersebut ke jaringan internal di file /data/adb/box/scripts/box.iptables untuk mencegah pengulangan lalu lintas.
- Log untuk layanan BFM dapat ditemukan di direktori /data/adb/box/run.
- Saat memodifikasi salah satu file konfigurasi inti, pastikan konfigurasi terkait tproxy cocok dengan definisi di file `/data/adb/box/settings.ini`.
- Jika perangkat memiliki alamat IP publik, tambahkan IP tersebut ke jaringan internal di file `/data/adb/box/scripts/box.iptables` untuk mencegah pengulangan lalu lintas.
- Log untuk layanan BFM dapat ditemukan di direktori **/data/adb/box/run**.

Anda dapat menjalankan perintah berikut untuk mendapatkan instruksi operasi terkait lainnya:

3 changes: 1 addition & 2 deletions docs/tubot.py
Original file line number Diff line number Diff line change
@@ -20,8 +20,7 @@
```
{commit_message}
```
[Commit]({commit_url})
[Workflow run]({run_url})
[commit]({commit_url})
""".strip()


0 comments on commit 383ef5a

Please sign in to comment.