Skip to content

feat(outbound): accept the desync methods Android checks per connection - #180

Merged
Nemu-x merged 2 commits into
devfrom
feat/desync-android-conditional
Oct 30, 2026
Merged

Nemu-x merged 2 commits into
devfrom
feat/desync-android-conditional

Conversation

@Nemu-x

@Nemu-x Nemu-x commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

On Android, SELinux stops apps from reading a socket's unsent bytes through SIOCOUTQNSD. desync main (Nemu-x/desync#11) falls back to TCP_INFO there, and its PlatformCapabilities now reports fake TCP, disorder and split-wait: sent as conditional: the library allows them but checks them on each connection.

Until now the type: desync outbound rejected a config that used any of those methods whenever the platform report said "unsupported", so Android configs with them failed to load. This PR:

  • bumps github.com/Nemu-x/desync from v0.1.0 to main at 673cbef (pseudo-version v0.2.1-0.20261029232908-673cbefddb80), which becomes v0.2.1 once tagged;
  • accepts fake, disorder and split-wait: sent when the library lists the method as conditional, and logs one Info line saying it is checked per connection;
  • leaves every other check unchanged.

A socket that cannot read its unsent bytes fails on its first write (the ClientHello), so the failure shows up as a connection error, not when the config loads.

The docs give Android its own column in the OS table, with a footnote on the per-connection check, and update the docs/config.yaml comments.

Testing

  • New tests: TestDesyncConditionalMethods covers three cases:
    • Android-like capabilities are accepted;
    • the same capabilities without Conditional are rejected;
    • the auto-ttl and missing-split errors still fire.
  • Existing tests: TestDesyncMethodsOnThisOS now counts conditional methods as supported.
  • Run locally: go test passes for adapter/outbound, adapter and tunnel, and vet and build pass for windows/amd64, linux/amd64 and android/arm64.
  • Not run: the tests on an Android device.

Bump github.com/Nemu-x/desync to main (673cbef, PR Nemu-x/desync#11),
pinned as v0.2.1-0.20261029232908-673cbefddb80; it becomes v0.2.1 once
tagged.

Android denies apps SIOCOUTQNSD, so PlatformCapabilities there no longer
claims split-wait sent, disorder and the TCP fake: it lists them in
Unsupported and in the new Capabilities.Conditional, and a socket that
cannot read its unsent bytes from TCP_INFO fails the first write before
any byte is sent. Validation now accepts a method listed in Conditional
and logs once per outbound that it is verified per connection, so
Android configs with these methods load again. The other checks
(positions, auto-ttl, combinations) are unchanged.
split-wait sent, disorder and fake are checked per connection on
Android (TCP_INFO unsent bytes, Linux 4.6+); the config is accepted and
a socket without them fails before sending.
@Nemu-x
Nemu-x merged commit 62d1f56 into dev Oct 30, 2026
21 of 22 checks passed
@Nemu-x
Nemu-x deleted the feat/desync-android-conditional branch October 30, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant