diff --git a/src/system/bin/zaprett b/src/system/bin/zaprett index 780d9a8..bc91f1b 100644 --- a/src/system/bin/zaprett +++ b/src/system/bin/zaprett @@ -12,16 +12,34 @@ start_service() { echo "Starting zaprett..." hostlist="" - for itm in $(echo "$activelists" | tr ',' ' ' | sort -u); do - if [ -f "$itm" ]; then - dst="/data/adb/modules/zaprett/tmp/$(basename "$itm")" - cp "$itm" "$dst" - case "$hostlist" in - *"--hostlist=$dst"*) ;; - *) hostlist="$hostlist --hostlist=$dst" ;; - esac - fi - done + case "$list_type" in + whitelist) + lists="$active_lists" + opt="--hostlist" + ;; + blacklist) + lists="$active_exclude_lists" + opt="--hostlist-exclude" + ;; + *) + echo "Unknown list-type: $list_type" >&2 + lists="" + opt="" + ;; + esac + + if [ -n "$lists" ] && [ -n "$opt" ]; then + for itm in $(echo "$lists" | tr ',' ' ' | sort -u); do + if [ -f "$itm" ]; then + dst="/data/adb/modules/zaprett/tmp/$(basename "$itm")" + cp "$itm" "$dst" + case "$hostlist" in + *"$opt=$dst"*) ;; + *) hostlist="$hostlist $opt=$dst" ;; + esac + fi + done + fi config="" if [[ -n "$strategy" && -f "$strategy" ]]; then @@ -30,10 +48,10 @@ start_service() { if [[ -z "$config" ]]; then config="--filter-tcp=80 --dpi-desync=fake,split2 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new" - config="$config --filter-tcp=443 $hostlist --dpi-desync=fake,split2 --dpi-desync-repeats=6 --dpi-desync-fooling=md5sig,badsum --dpi-desync-fake-tls=${zaprettdir}/bin/tls_clienthello_www_google_com.bin --new" + config="$config --filter-tcp=443 $hostlist --dpi-desync=fake,split2 --dpi-desync-repeats=6 --dpi-desync-fooling=md5sig,badsum --dpi-desync-fake-tls=${zaprett_dir}/bin/tls_clienthello_www_google_com.bin --new" config="$config --filter-tcp=80,443 --dpi-desync=fake,disorder2 --dpi-desync-repeats=6 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new" config="$config --filter-udp=50000-50100 --dpi-desync=fake --dpi-desync-any-protocol --dpi-desync-fake-quic=0xC30000000108 --new" - config="$config --filter-udp=443 $hostlist --dpi-desync=fake --dpi-desync-repeats=6 --dpi-desync-fake-quic=${zaprettdir}/bin/quic_initial_www_google_com.bin --new" + config="$config --filter-udp=443 $hostlist --dpi-desync=fake --dpi-desync-repeats=6 --dpi-desync-fake-quic=${zaprett_dir}/bin/quic_initial_www_google_com.bin --new" config="$config --filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 $hostlist" fi