Repository navigation
Conversation
… shown on the device - LinkGuard: a central that is not encrypted and authenticated within 5 s (60 s while pairing) is disconnected, so one stranger cannot hold the only slot. - Pairing code: advertises features.pairing_code, shows the code the phone sends (pair_code) until pair_ok. Generated files synced from the retink spec (protocol version unchanged). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t hooks) While a phone sync runs, every TCP connection leaves through the phone's proxy: a name lookup returns a fake address (198.18.x.y) and connecting to it sends CONNECT name:port to the proxy; TLS then runs through the tunnel unchanged. Disabled, both hooks pass straight through. Done with linker --wrap of lwip_connect and lwip_getaddrinfo (the same technique as the OTA loop hook), so neither the FreeInk SDK nor any upstream file changes. - core/ProxyShim: fake host table and the CONNECT request/reply (pure, host-tested). - device/ProxyHook: the two wrappers and enable/disable; host-tested against a fake proxy with lwIP mapped to POSIX (tests/stubs). - generated/: protocol_gen.h synced from the retink spec (wifi_sync feature, SyncRequest/SyncOffer). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…on, OPDS sync, always undo) - core/PhoneSync: the whole sequence against a PhoneSyncIo interface; host-tested order, refusals, failures, cleanup. - Session: sendSyncRequest / takeSyncOffer (control template, sync schema); capabilities advertise wifi_sync. - device/MirrorPhoneSync.cpp: the radio, the shim and opdssync::syncNow(); MirrorActivity gets a 'Sync books over phone' button and runs it from loop() after releasing its mutex (the render task needs it). - MirrorUpdateActivity switches the shim off on entry: the updater always uses plain sockets. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ynsgnr
changed the base branch from
feat/mirror-link-security
to
develop-retink
November 22, 2026 13:57
Firmware buildsAutomatically generated for the latest commit of this PR ( Download the file for your device, extract the |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The SDK's HTTP client refused header lines over 4096 bytes, and GitHub's 302 for a release download carries a 4.2 KB Content-Security-Policy header: every release download (Firmware channels, font downloads) failed with status -1. FreeInk SDK 6a208c0c skips oversized header lines. This is the one-line bump upstream made for the same reason (crosspoint-reader#4420, ddd3b1d). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…changes The mirror build and the OTA publisher only watched mirror/**, platformio.ini and the Home files, so a submodule bump built nothing mirror-related and published no channel. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… feat/mirror-wifi-sync
… heap around the phone sync OpdsSyncCore counts a failure without logging when canContinue() is false (deadline, or free heap under the TLS floor): a phone sync that reaches the feed but downloads nothing showed only 'failed=1'. canContinue now logs the reason with free heap and largest block, and the phone sync logs both before and after syncNow(). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…/mirror-wifi-sync
Covers the fix in 1dda517: the CONNECT exchange's 10 s step timeout must not stay on the socket (it limited the TLS session that followed). Verified to fail on the previous ProxyHook.cpp (rcv=10 snd=10) and pass now. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Serial log of a failing sync: 'OSY Stopping: low memory (free 44540, max block 15860)'. With Wi-Fi and Bluetooth both up only 54 KB / 31 KB is free before TLS and the largest block falls under the 20 KB the download needs (a normal Wi-Fi sync without Bluetooth has 105 KB / 63 KB). The sequence now stops Bluetooth after the offer, joins the hotspot, syncs, undoes Wi-Fi and the shim, restarts Bluetooth, waits for the phone to reconnect and sends done. Host-tested order; the phone keeps its hotspot through the gap (retink WifiSyncController). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…be joined Replaces the 'Sync books over phone' button. opdssync::syncNow() (timer wake) and Sync Now ask a registered NetworkFallback when no saved Wi-Fi can be joined; the mirror build registers the phone (device/PhoneRoute.cpp). Sleep-time joins keep using joinWifi() and never start it. Any failure (no phone, no answer, refusal, hotspot not joined) leaves Bluetooth, Wi-Fi and the shim off and skips the round; the next timer wake or Sync Now tries again. - core/PhoneRoute: the sequence against a PhoneRouteIo interface (host-tested, every failure), plus the frames of a link without a Session and capabilities without templates. - device/PhoneRoute.cpp: the screen-less link (MirrorBle), the hotspot join, the shim; registration at start-up. - OpdsAutoSync.h/.cpp (upstream, +20 lines), OpdsSyncPopup.cpp (+4): the hook, and Sync Now gets online before it opens the Wi-Fi selection. - Removed: the button, MirrorActivity's sync code, the Session sync messages. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: not run on hardware. App side: ynsgnr/retink#11 (stacked on #8/#10). Contains #21's commits (the pairing code and link guard): this PR targets develop-retink so that CI publishes it as the OTA channel
pr-26; its own change is the two commits after #21.What it does
Mirror > Sync books over phone runs the stock OPDS sync through the phone's mobile data. The phone (Retink app, Wi-Fi sync switched on) opens a LocalOnlyHotspot and a proxy that leads out through cellular and offers both over the encrypted BLE link. The device joins the hotspot, turns on a proxy shim, runs
opdssync::syncNow()(it finds Wi-Fi already up and skips its own join) and then always undoes everything: shim off, Wi-Fi off, phone tolddone. The phone also stops on its own after 10 minutes or when the BLE link drops.The shim, and why it is not in the SDK
All HTTP goes through the FreeInk SDK's
SecureHttpClient, which opens its own sockets. Instead of changing the SDK, the two lwIP calls every connection ends in (lwip_getaddrinfo,lwip_connect) are wrapped by the linker (-Wl,--wrap=...inplatformio_mirror.ini, the same technique as the OTA loop hook). While on: a host name gets a fake address and connecting to it sendsCONNECT name:portto the phone and waits for 2xx; TLS runs through the tunnel as before. While off (always, except during this sync) both hooks pass straight through. UDP, IPv6 lookups, the proxy itself and the hotspot subnet are never touched. No SDK change, no upstream file change.The updater is protected from it
MirrorUpdateActivityswitches the shim off when it opens and uses the plain sockets, so a build with a broken shim can still fetch its own fix over normal Wi-Fi and does not need a USB cable. A build that does not boot is still handled by the fallback (#22).Checks run
cmake/ctest mirror: 596 checks, 0 failures. New:
ProxyShim(fake addresses, CONNECT reply parsing),ProxyHook(the realProxyHook.cppagainst a fake proxy, lwIP mapped to POSIX),PhoneSync(order, refusals, failures, cleanup), session sync messages. macro ctest,check-manifest.sh, OTAtest.shok; clang-format ok.MirrorPhoneSync.cppand the hook's lwIP linkage are compiled for the device only by CI.Verify on hardware (in this order)
PROXYlog lines show each tunnel.🤖 Generated with Claude Code