diff --git a/src/helper/darwin/install_helper b/src/helper/darwin/install_helper index 9998f8a..3b40459 100755 --- a/src/helper/darwin/install_helper +++ b/src/helper/darwin/install_helper @@ -9,7 +9,17 @@ cp "$RES_PATH/geosite.dat" "$INSTALL_PATH" cp "$RES_PATH/geo.mmdb" "$INSTALL_PATH" cp "$RES_PATH/core" "$INSTALL_PATH" cp "$RES_PATH/md5sum" "$INSTALL_PATH" -cp "$RES_PATH/route" "$INSTALL_PATH" + +# /sbin/route from macOS 13 will crash if argv[0] is not /sbin/route +# As a workaround, the following wrapper is created to set argv[0] +clang -o "$INSTALL_PATH/route" -x c - <<'EOF' +#include +int main(int argc, char *argv[]) { + argv[0] = "/sbin/route"; + execv(argv[0], argv); +} +EOF + chown root "$INSTALL_PATH/core" chown root "$INSTALL_PATH/md5sum" diff --git a/src/helper/darwin/route b/src/helper/darwin/route deleted file mode 100755 index 0803693..0000000 Binary files a/src/helper/darwin/route and /dev/null differ