Skip to content
LewisCodesWebsitesPublic

About

Android walking skeleton for lsync: pairs over a typed host:port and sends a file, transport only

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

lsync_app

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.

Requires a sibling checkout

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.

Running the milestone

On the laptop, listening and willing to pair:

cd ..\lsync_transport
dart run bin/lsync.dart --config ./beta --name laptop listen --dir ./received --pair

Note the address it prints and the fingerprint.

On the phone:

  1. Type host:port — for example 192.168.1.241:4917.
  2. 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 y on the laptop.
  3. 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.

Layout

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

Storage

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.

Tests

flutter test

Covers 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.

Status

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.

Licence

MIT. See LICENSE.

About

Android walking skeleton for lsync: pairs over a typed host:port and sends a file, transport only

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages