adb-hawk is a desktop tray companion utility for Android developers to monitor, explain, diagnose, and pair Android Debug Bridge (ADB) devices in real time.
It qualifies under the Developer Tools category for classic confinement due to the following technical requirements:
Host adb binary discovery & execution: Android developers install the Android SDK in arbitrary host locations (~/Android/Sdk, /opt/android-sdk, $ANDROID_HOME, distro package paths, or custom $PATH directories). Strict confinement blocks locating and executing the developer’s host ADB binary.
Host ADB daemon socket & lifecycle: The app communicates with the host ADB server on localhost:5037 (or ANDROID_ADB_SERVER_PORT) and provides user-initiated diagnostic repair actions (such as restarting an unresponsive ADB daemon).
mDNS discovery & pairing: It performs local mDNS discovery on 224.0.0.251:5353 / [ff02::fb]:5353 to discover wireless debugging endpoints (_adb-tls-pairing._tcp and _adb-tls-connect._tcp) alongside any existing host mDNS daemons (e.g. avahi-daemon).
Desktop integration: It runs as a system tray utility (via StatusNotifierItem / D-Bus and GTK3) to display device connectivity notifications and a slide-out status flyout anchored to the tray.
Because adb-hawk functions as a companion to the host’s existing Android development environment, strict confinement prevents it from accessing the developer’s SDK toolchain.
Please see the page below, you snap must fit into one of the supported categories to be considered for classic confinement:
Also take a look at the last paragraph on that page, your snap must ship all dependencies inside, if your app is a desktop app that might mean 100MB or more of gnome/gtk libraries and integration bits (extensions are not usable in classic snaps and you can not use any host libraries at runtime else you will get libc version mistmatches).
Packaging classic is significantly harder than packaging strict and you should have experience with binary patching of RPATH and linker paths in binary libs and applications.
There are interfaces for strictly confined snaps to access the adb bridge, avahi (for mdns) and for desktop integration to use the notification area and if you define some system-files interfaces for the most common install locations of Android Studio, you should be able to package it strictly without forcing the user to download a multi 100MB snap for a single system tray notification tool…
A few notes on the packaging, since I think some of the earlier context was unclear:
Package size
The snap that built and uploaded is 4.8 MB (adb-hawk_1.0.0_amd64.snap), not 100 MB+. It’s a native C++20 GTK3/D-Bus app. No Electron, no bundled runtime.
Executing the host adb binarysystem-files / personal-files can expose paths, but strict confinement isn’t designed to execute arbitrary host binaries. Those interfaces don’t grant AppArmor execute transitions (ix/Px), and Android devs keep platform-tools wherever their SDK happens to live ($ANDROID_HOME, ~/Android/Sdk, /opt/...). So even if some common paths could be whitelisted, a strictly confined snap can’t reliably execute the host’s adb across real dev setups.
Why I don’t bundle an adb client
The ADB server on localhost:5037 is shared. If any adb client connects with a different protocol version, the server gets killed: adb server version doesn't match this client; killing.... If the snap bundled its own adb and it didn’t match the developer’s host version, it would kill their active Android Studio / Gradle debugging session. adb-hawk is designed to inspect the existing host environment, not replace it.
mDNS discovery
It uses a small raw multicast parser (SO_REUSEADDR on 224.0.0.251:5353) to find _adb-tls-pairing._tcp services. No Avahi/D-Bus dependency.
I understand Canonical’s confinement policy, and I’m not trying to work around it.
If the security team decides adb-hawk doesn’t qualify for classic confinement, which path would you recommend?
Strict confinement — repackage as a socket-level observer on localhost:5037 with network, desktop, and adb-support; no host binary execution; user restarts the daemon manually.
Native packages — .deb / AppImage for users who need host SDK toolchain integration.
This will likely not work, it must ship any required runtime dependencies as stage packages if you want to make it a classic snap, I can’t imagine the gtk stack with all it’s pixbuf loaders and their library dependencies to fit into 4.8MB…
Each library and binary inside the snap must be binary patched to have its RPATH point to the base snap or into the snap itself for library path resolution, each library and binary must be patched to use the ld.so linker from the base snap.
If you do not do this the snap will only run on Ubuntu on one specific release but badly crash everywhere else with libc version mistmatches or worse issues since these libs will have different versions and compiler flags. A classic snap must never use any host libraries at runtime (you can indeed execute host binaries that then use their respective host libraries, this is the one advantage of classic confinement, but these run independent from the snap environment)
Try to integrate testing of your snap on fedora, debian and an older Ubuntu release in your QA process…
Properly functioning classic packaging is seriously hard, “strict” simply keeps the runtime environments separate for you, in classic packages you are the one needing to make sure they stay apart.
Whatever the reviewers decide, if you want to go forward with classic you will need to adjust your packaging…
Classic confinement is a sensitive matter and according to the policy it is reserved for mature, well-known applications published by mature, well-known entities. As of today, I believe that adb-hawk doesn’t meet this criteria because of the following reasons:
The project seems to be very fresh, according to the upstream repository
The projects seems to have little/none community around according to upstream repository (contributors, issues, PRs, etc.)
I could not find evidences that the project has a strong enough user base currently
That is why I do not think adb-hawk should get classic confinement as of now.
In terms of the the best path forward, I think strict confinement may make perfect sense in this case.
the adb binary is staged in the snap
the adb client inside the snap communicates to the host ADB server on localhost:5037
you could possibly serve different tracks for this snap bundling different versions of adb so that developers could install the version that matches their adb server version, and therefore preventing the restart issue