Skip to content

Add injectable ADB transport and bounded stream open - #31

Open
wuzw21 wants to merge 1 commit into
MuntashirAkon:masterfrom
omnimind-ai:omnilink-usb-transport
Open

Add injectable ADB transport and bounded stream open#31
wuzw21 wants to merge 1 commit into
MuntashirAkon:masterfrom
omnimind-ai:omnilink-usb-transport

Conversation

@wuzw21

@wuzw21 wuzw21 commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • add an AdbTransport duplex-stream seam while preserving the existing Socket API
  • add bounded open(..., timeout, unit) overloads and clean up half-open streams on timeout/interruption
  • fix the reversed success check in both Builder.connect overloads and close transports on failure
  • keep STLS restricted to the existing Socket transport
  • handle effectively unbounded deadlines without Long.MAX_VALUE overflow

Motivation

Android USB Host integrations already own a UsbDeviceConnection; routing that connection through a process-wide loopback TCP listener creates an avoidable local attack surface. An injectable transport lets callers connect USB bulk endpoints directly while libadb continues to own authentication and stream multiplexing.

Compatibility

Existing public methods and signatures are unchanged. javap comparison against 3.1.1 found no removed or changed public signatures.

Verification

  • 12 unit tests pass
  • release AAR assembles
  • custom transport close/error/timeout paths are covered
  • existing Socket construction remains the default

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.

2 participants