diff --git a/box/ap.list.cfg b/box/ap.list.cfg index 69df095..5d5406a 100644 --- a/box/ap.list.cfg +++ b/box/ap.list.cfg @@ -2,14 +2,12 @@ # allow allow ap+ allow wlan+ -# allow wlan1 allow rndis+ allow swlan+ allow ncm+ allow eth+ # -----------------🌼🌼----------------------- # -# Ignore network interface -# Ignore -# ignore wlan0 -# ignore swlan0 +# Ignore specific network interfaces that may conflict with the allowed list +# ignore +# ignore swlan+ # ignore wlan+ \ No newline at end of file diff --git a/box/crontab.cfg b/box/crontab.cfg index a72a314..aff3cf0 100644 --- a/box/crontab.cfg +++ b/box/crontab.cfg @@ -1 +1 @@ -# cron tasks for root \ No newline at end of file +# This is the system crontab in which scheduled tasks can be defined \ No newline at end of file diff --git a/box/package.list.cfg b/box/package.list.cfg index 068e996..0d3ce3f 100644 --- a/box/package.list.cfg +++ b/box/package.list.cfg @@ -1,8 +1,17 @@ -# 黑/白 名单模式;black/white list mode. +# black/white list mode. mode:blacklist -# 格式/format: +# +----------------+------+ +# | User | ID | +# +----------------+------+ +# | Owner | 0 | +# | Second Space | 10 | +# | App Clone | 999 | +# +----------------+------+ + # package_name ▼ # com.topjohnwu.magisk +# 0:com.termux + # Gid ▼ -# 10450 alook -# 99910450 999_alook \ No newline at end of file +# 12345 +# 1000 \ No newline at end of file diff --git a/box/scripts/box.iptables b/box/scripts/box.iptables index 4ea7aa3..5462ada 100755 --- a/box/scripts/box.iptables +++ b/box/scripts/box.iptables @@ -113,11 +113,32 @@ bin_alive() { find_packages_uid() { echo -n "" > "${uid_list}" + for package in "${packages_list[@]}"; do - busybox awk -v p="${package}" '$1~p{print $2}' "${system_packages_file}" >> "${uid_list}" + if [[ "$package" == *:* ]]; then + user="${package%%:*}" + pkg="${package##*:}" + else + user=0 + pkg="$package" + fi + + appid="$(busybox awk -v p="$pkg" '$1 == p {print $2}' "$system_packages_file")" + + if [[ -n "$appid" ]]; then + uid=$((user * 100000 + appid)) + echo "$uid" >> "${uid_list}" + fi done } +# find_packages_uid() { + # echo -n "" > "${uid_list}" + # for package in "${packages_list[@]}"; do + # busybox awk -v p="${package}" '$1~p{print $2}' "${system_packages_file}" >> "${uid_list}" + # done +# } + probe_user_group() { if PID=$(busybox pidof ${bin_name}) ; then box_user=$(stat -c %U /proc/$PID) diff --git a/box/settings.ini b/box/settings.ini index f3606e6..815029b 100755 --- a/box/settings.ini +++ b/box/settings.ini @@ -106,16 +106,14 @@ write_listap=$(dirname "$settings")/ap.list.cfg # allow allow ap+ allow wlan+ -# allow wlan1 allow rndis+ allow swlan+ allow ncm+ allow eth+ # -----------------🌼🌼----------------------- # -# Ignore network interface -# Ignore -# ignore wlan0 -# ignore swlan0 +# Ignore specific network interfaces that may conflict with the allowed list +# ignore +# ignore swlan+ # ignore wlan+ init @@ -129,14 +127,23 @@ pkg_config=$(dirname "$settings")/package.list.cfg # Check pkg config file [ -d ${pkg_config} ] && rm -rf ${pkg_config} [ ! -f ${pkg_config} ] && cat > ${pkg_config}<