The Problem
Linux users need a native way to exchange files with Android devices that support Google’s Quick Share protocol. Existing solutions are either closed‑source, require manual pairing, or depend on heavyweight desktop environments.
What This Does
packet implements the Quick Share “Wi‑Fi LAN” mode in Rust and exposes a GTK 4 UI. The core logic lives in src/ – e.g. src/application.rs creates the PacketApplication, src/window.rs builds the main window UI, and src/widgets/* render file cards and transfer dialogs. The client talks to Android via the protocol defined in src/objects/send_transfer.rs and src/objects/receive_transfer.rs.
The repository also ships a Nautilus plugin (data/resources/plugins/packet_nautilus.py.in) and Flatpak metadata (data/*.desktop.in, data/*.gschema.xml.in) so the app can be distributed as a sandboxed package.
How It Is Wired
Execution starts at src/main.rs:29 in fn main().
maincallstokio_runtime(defined in the same file) to initialise the async runtime.- The runtime invokes
run(src/application.rs:319), which calls theactivatemethod ofPacketApplication. activate(insrc/application.rs) creates the main UI viastartup, registers DBus services (dbus_register), and parses command‑line options (handle_local_options).
startup (still in src/application.rs) wires the UI: it calls setup_css, setup_gactions, and setup_accels.
setup_gactionsregisters actions that ultimately callactivate(6 ×) andmain_window.main_window(implemented insrc/window.rs) constructs the top‑level GTK window, connects signals, and populates it with widgets defined insrc/widgets/*.
Key functions with the widest impact:
tokio_runtime– called from 7 locations, provides the async backbone.as_client_unchecked– also called from 7 places, bridges DBus messages to the client.plugin_files– referenced twice, resolves plugin installation paths.
File‑level responsibilities (ordered by call volume):
src/window.rs– 47 functions, owns the GTKclass_init,instance_init, signal handling, and window lifecycle.src/utils.rs– 13 functions, includes file‑system helpers (xdg_data_dirs,spawn_notification,remove_notification).src/application.rs– 15 functions, orchestrates activation, DBus registration, shutdown.
The only external effect is file I/O: src/utils.rs reads/writes configuration or notification files. No database or network sockets are visible in the static call graph; network handling resides in the protocol objects and is invoked from the UI callbacks.
No circular imports are present; the internal import graph consists of a single module hierarchy.
How To Use It
# Clone the repo
git clone https://github.com/moses-y/packet
cd packet
# Build with Meson (native)
meson setup build_dir
meson compile -C build_dir
# Run from the build environment
meson devenv -C build_dir packet
For Flatpak development (as documented in the README):
flatpak-builder --user flatpak_build_dir \
build-aux/io.github.nozwock.Packet.Devel.json
flatpak-builder --run flatpak_build_dir \
build-aux/io.github.nozwock.Packet.Devel.json packet
Configuration files are generated from the *.in templates in data/ during the build; no additional environment variables are required. The Nautilus plugin can be installed from the generated .py file after a Flatpak install.
Real‑World Use
A user on GNOME installs the Flatpak, enables “Static Port” in Preferences, and runs packet. When an Android phone broadcasts a Quick Share offer, the app receives the advertisement via the async runtime, displays the incoming file list in a receive_transfer widget, and writes the files to the user‑selected download directory (handled by src/utils.rs::xdg_download_with_fallback).
Code Health & Issues
- HIGH – Pin third‑party GitHub Actions to commit SHAs (
.github/workflows/*.yml). - HIGH – No test suite; 17 source files with zero tests.
- MEDIUM – GitHub token permissions not declared (
.github/workflows/ci.yml). - MEDIUM – Dependabot / Renovate missing; no automated vulnerability updates.
- MEDIUM – No dependency‑vulnerability scan in CI.
- LOW – Workflow jobs lack
timeout-minutes.
Additional static findings:
- HIGH – Deep nesting (max depth 10) in
src/application.rs,src/widgets/receive_transfer.rs,src/widgets/recipient_card.rs. - HIGH – Oversized files (
src/window.rs,src/widgets/receive_transfer.rs> 2000 lines). - MEDIUM – Repeated 6‑line code blocks across multiple widget files.
- LOW – Numerous TODO/FIXME markers in
src/widgets/receive_transfer.rsandsrc/window.rs.
The Bottom Line
packet delivers a functional Quick Share client with a complete GTK UI and Flatpak packaging, but the codebase suffers from high cognitive load, large monolithic files, and a complete lack of automated testing. It is suitable for developers comfortable refactoring Rust/GTK code and who can add a test harness and CI hardening before relying on it in production.