Skip to content

About

A Windows AppContainer loopback exemption tool for clash-nyanpasu, built with Rust and WinUI 3.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

enable-loopback

A Windows AppContainer loopback exemption tool for clash-nyanpasu, built with Rust and WinUI 3. It provides a localized table, multi-selection, sorting, copy, and exemption editing.

On Windows x64 or arm64, install the nightly Rust MSVC toolchain and Visual Studio C++ build tools (including the Windows SDK). The GUI requires Windows App Runtime 2.5.1.0 or later, matching the process architecture:

Download the official 2.5.1 installer for x64 or arm64. See also the Windows App SDK downloads. When the runtime is missing, the GUI offers to install it from the Microsoft Store (where the Store is available) or opens these downloads.

On Windows builds before Windows 11 24H1, including Windows 10, the GUI also needs Microsoft.WindowsAppRuntime.Bootstrap.dll for the process architecture beside enableLoopback.exe. It ships in the Microsoft.WindowsAppSDK.Foundation 2.3.12 NuGet package under runtimes/win-<arch>/native/. Each release also publishes it, with its pinned SHA-256 and Microsoft signature checked, as Microsoft.WindowsAppRuntime.Bootstrap-<target>.dll; rename it when placing it beside the executable.

Build and run in Git Bash:

git clone --recursive https://github.com/libnyanpasu/enable-loopback.git
cd enable-loopback
# For an existing checkout:
git submodule update --init
export CARGO_INCREMENTAL=0
cargo build
cargo run -- --lang zh-cn

If a global Cargo configuration uses a compiler wrapper, set RUSTC_WRAPPER= to bypass it for these commands. Do not change the global configuration.

For a size-optimized release, use the same command as the release workflow:

cargo build --release --locked --target x86_64-pc-windows-msvc \
  -Z build-std=std,panic_abort -Z build-std-features=optimize_for_size

Use aarch64-pc-windows-msvc for arm64. This requires nightly and rust-src (included in rust-toolchain.toml). The executable is in target/<target>/release/enableLoopback.exe. A plain cargo build --release also uses the size profile, but keeps the precompiled standard library and is slightly larger. Release builds use full LTO, one codegen unit, size optimization, stripped symbols, and abort on panic; development builds retain unwinding and line tables. Recoverable application errors still use the existing error dialogs.

See release size measurements for the measured tradeoffs.

enableLoopback.exe [--lang CODE] opens the GUI. Supported languages: en, zh-cn, zh-tw, ja, ko, ru; otherwise the system language is used, with English as the fallback. manual skips automatic refresh and -registry selects registry enumeration.

CLI commands: -all, -none, -allow NAME..., -deny NAME..., and ? for localized syntax. Commands ignore case; the leading - or / is optional. Names may contain spaces; * matches all. CLI dispatch does not initialize WinAppSDK or check its runtime. Exemption commands apply the requested configuration; syntax errors exit -10.

The executable requests the highest available privilege level. Read the design specification for the planned behavior and architecture.

Run tests with cargo test; only the GUI executable embeds the elevation manifest.

The vendored windows-rs fork is a separate workspace. Check application formatting with cargo fmt -p enable-loopback -- --check; cargo fmt --all recursively visits the fork too and can exceed Windows' command-line limit.

To release, set the version in crates/enable-loopback/Cargo.toml, regenerate CHANGELOG.md with git-cliff as git cliff --tag vX.Y.Z -o CHANGELOG.md, commit both with Cargo.lock as Release X.Y.Z, and push the vX.Y.Z tag. The release workflow builds the executables and uses the version's changelog section as the release notes.

About

A Windows AppContainer loopback exemption tool for clash-nyanpasu, built with Rust and WinUI 3.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages