Conversation
Handle handshake acceptance, relative mouse packets, and macOS physical keycodes. Include the macOS registration/status helper, setup guide, and regression tests.
Persist manually added, used, and favorite servers and restore them into the UI. Recover legacy connection records and test on-disk persistence and scan merging.
Reviewer's GuideThis PR adds experimental Synergy 3.7.2 interoperability by enforcing the post-dimension handshake, supporting signed 16-bit motion and macOS physical keycodes, while also making server addresses durable and introducing a guarded macOS setup/status helper with documentation and CI coverage. Sequence diagram for the Synergy 3 connection handshakesequenceDiagram
participant App as InputLeaf
participant Server as SynergyCore
App->>Server: TLS/mTLS connection
Server-->>App: Hello
App->>Server: ClientHello
App->>Server: QINF
Server-->>App: DINF
App->>Server: CIAK
Server-->>App: CROP
Server-->>App: DSOP
alt Unknown screen
Server-->>App: EUNK
App-->>App: ConnectResult.UNKNOWN_SCREEN
else Protocol error
Server-->>App: BadMessage
App-->>App: ConnectResult.PROTOCOL_ERROR
else Accepted
App->>App: Start readLoop
end
Flow diagram for persistent server list mergingflowchart LR
Saved[Saved addresses]
Scan[Network scan results]
Merge[mergeServerLists]
List[Server list]
Add[addManualServer]
Store[saveServer]
Add --> Store --> Saved
Saved --> Merge
Scan --> Merge
Merge --> List
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="app/src/main/java/com/inputleaf/android/inject/ProtocolScanCodeDecoder.kt" line_range="30" />
<code_context>
+ }
+
+ @Synchronized
+ fun clearPressedKeys() = pressedKeys.clear()
fun toEvdev(button: Int, keysym: Int): Int {
</code_context>
<issue_to_address>
**issue (bug_risk):** `clearPressedKeys()` releases the pressed-key map but leaves the learned `encoding` unchanged. After disconnecting from a macOS server and connecting to an evdev or X11 server, the decoder continues applying the previous server's encoding and injects incorrect physical keys.
**Triggers:** When the same input injector instance reconnects to a server using a different keycode encoding.
**Suggested fix:** Reset `encoding` to null as part of decoder connection cleanup, or provide a separate reset method that clears both pressed keys and the learned encoding.
```suggestion
fun clearPressedKeys() {
pressedKeys.clear()
encoding = null
}
```
</issue_to_address>| } | ||
|
|
||
| @Synchronized | ||
| fun clearPressedKeys() = pressedKeys.clear() |
There was a problem hiding this comment.
issue (bug_risk): clearPressedKeys() releases the pressed-key map but leaves the learned encoding unchanged. After disconnecting from a macOS server and connecting to an evdev or X11 server, the decoder continues applying the previous server's encoding and injects incorrect physical keys.
Triggers: When the same input injector instance reconnects to a server using a different keycode encoding.
Suggested fix: Reset encoding to null as part of decoder connection cleanup, or provide a separate reset method that clears both pressed keys and the learned encoding.
| fun clearPressedKeys() = pressedKeys.clear() | |
| fun clearPressedKeys() { | |
| pressedKeys.clear() | |
| encoding = null | |
| } |
Issue Adressed
Related to #47.
Synergy difference
Synergy 3.7.2 on macOS can acknowledge screen dimensions before accepting the
client, sends relative mouse deltas as signed 16-bit values, and uses Mac physical
keycodes.
Input Leaf could report a connection before an unknown-screen refusal,
reject relative motion packets, or inject the wrong physical keys.
This change
handles those cases using the existing Synergy greeting and TLS/mTLS support.
Manually added servers also disappeared after restarting the app. Favorite
addresses were persisted but were only displayed when rediscovered. The server
list now restores saved addresses and merges them with scan results.
Changes
Complete the input handshake on
DSOP, rather thanCIAK; report unknownscreens and protocol errors directly, and reject unsupported protocol majors.
Decode signed 16-bit
DMRMdeltas while retaining the previously accepted32-bit variant.
Map Carbon keycodes plus one to evdev for Android HID input, retaining evdev/X11
decoding and matching key-up events when source detection changes during a chord.
Persist manually added, used, and favorited servers; recover addresses from
existing favorites and connection records. Empty scans no longer hide saved servers.
Add an optional macOS Synergy setup/status helper and guide. Registration is a
dry run by default; applying requires a stopped service and creates private
backups with rollback on write failure. The helper targets observed Synergy
settings schemas 17/8 and reports the exact screen name, LAN address hints, and
server fingerprint.
Add protocol, input, persistence, and helper regression coverage; run the
Python helper tests in the existing CI job.
Android instrumented smoke tests were not run locally.
manual testing
confirmed working with 2 macos tahohe macbook + pixel 10 android 17 with Shizuku
Summary by Sourcery
Add experimental Synergy 3 support while preserving server addresses across app restarts.
New Features:
Bug Fixes:
Enhancements:
CI:
Documentation:
Tests: