This raises a peculiar question: is it possible to create a Snapcraft package of Flatpak, and still install applications on Flathub using this method? I’m not sure if Snapcraft allows apps with such high permissions to be listed on the snap-store. I’m assuming the operation is similar to this.
I downloaded the deb and unpack it , it’s a simple .so share library, so the path for flatpak binary maybe a fixed value, probally need to patch the source and rebuilt it for the snap.
You probably couldn’t because you’d struggle to keep the ABI compatibility unless gnome-software was also made into a snap (the original snap-store snap - though this never had the Flatpak plugin in the snap version due to sandboxing); and then versioned explicitly to work together or gnome-software ending up part of the hypothetical flatpak snap.
The thing is, personally I’m not sure how much the flatpak binary alone would contribute, because there’s other components like the XDG desktop portals that help both snap and flatpak massively, and even though snap can keep snapd up to date, it can’t keep the portals installed via Apt up to date. There used to be a PPA that covered flatpakxdg-desktop-portals and a few others up to date but at some point the Flathub website stopped promoting it. I think a part of that was partially linked to build system changes that weren’t easy to backport and Flatpak itself gained some better handling around e.g., handling permissions that are newer than the binary supports.
Or e.g., there’s currently some bugs in interaction between Wayland apps & the Yaru mouse theme in the most recent Gnome Flatpak runtimes that exist on Ubuntu 24.04 because it uses Gnome 46 not Gnome 48 with some modern Wayland magic, you can see how the scope continues to grow depending how comprehensive you want that overall integration to be. Some of the responses I’d seen on that one in particular basically suggested that’s Ubuntu’s fault for having LTS releases to begin with.
So on the one hand I’m personally here like I’d love this to exist in theory, but the practise might not end up being much better than the current status quo even if it did exist. But it does create an interesting hypothetical where an Ubuntu Core desktop could do better than the default distribution, because things like Gnome Shell or the Portals suddenly would be within snapd’s control technically.