Android walking skeleton for lsync. Transport only.
Milestone: the phone pairs with the laptop over a typed host:port and
sends a generated file, and the laptop confirms the SHA-256 matches. Nothing
beyond that.
Not here, deliberately: no discovery (milestone two), no clipboard (D-04), no file picker, no notifications.
pubspec.yaml has a path dependency on ../lsync_transport, so the two repos
must sit side by side:
<parent>/
lsync_transport/
lsync_app/
A clone of this repo alone will not resolve. That is the intended arrangement while the two are developed together.
On the laptop, listening and willing to pair:
cd ..\lsync_transport
dart run bin/lsync.dart --config ./beta --name laptop listen --dir ./received --pairNote the address it prints and the fingerprint.
On the phone:
- Type
host:port— for example192.168.1.241:4917. - Pair. Both screens show six digits. They must be identical: comparing
them is the whole of D-02, and nothing secret crosses the wire. Accept on
the phone and answer
yon the laptop. - Send. The app generates 8 MB of random bytes into its own storage and transfers them.
The laptop prints the received SHA-256. The app logs the digest it sent. They
must match — and in fact FileSender throws unless the receiver echoes a
matching digest, so the app reaching "receiver confirmed" is itself the pass
condition.
lib/
main.dart entry, single screen
src/
app_paths.dart path_provider -> config dir; the Android answer
to the package's desktop-only config_dir.dart
identity_loader.dart first-run RSA keygen off the UI thread
payload.dart generates the file to send
transfer_controller.dart pair / send orchestration, emits the log
ui/
home_page.dart address field, Pair, Send, log
sas_dialog.dart the six digits, and the D-02 comparison
The app writes only what D-06 permits, into
getApplicationSupportDirectory()/lsync — app-private internal storage, so no
permission is needed and no other app can read the private key:
lsync/device.key.pem this device's private key
lsync/device.crt.pem its self-signed certificate
lsync/peers.json peer fingerprints, device names, clipboard bond
The generated payload goes to a separate payload/ directory, so it can never
be mistaken for retained state.
flutter testCovers the two things this repo owns rather than inherits: that the generated
payload's reported digest is the digest of the bytes on disk, and that a typed
address is judged before it can be dialled — including 192.168.1.241.4917, a
colon typed as a dot, which parses cleanly as a hostname and then fails DNS
several seconds later reporting a name nobody typed.
Everything else the milestone depends on is already tested in lsync_transport,
and duplicating it here would only test the path dependency.
The milestone passed: paired over Wi-Fi with the digits compared on both screens, and an 8 MB file transferred with the digest agreeing three ways. The address validation above is covered by unit tests but has not yet been exercised on the handset.
MIT. See LICENSE.