If someone is till interested in how to work around the problem of a Snap not being able to install UDEV rules into the system, I have found a solution, as I need UDEV for my printing-related Snaps.
I have applied my solution in the ipp-usb Snap (in the Snap Store), which is a daemon which allows connecting driverless IPP printers via USB and use them driverless also this way.
The classic installation of ipp-usb installs a UDEV rules file to trigger the launch of the daemon as soon as an appropriate printer gets connected to USB (or if such a device is already connected). The Snap cannot install such a file.
So I wrote an auxiliary daemon (a shell script) which runs udevadm monitor
and checks the output lines for USB devices which are appearing. On these it does udevadm info
to get the properties of the device and if it is IPP-over-USB (has 7/1/4 USB interface) the ipp-usb daemon gets launched. Do check for an already connected device udevadm trigger
is run on startup. With this it behaves exactly like the classic installation, without needing its own UDEV rules. Note that it has to plug hardware-observe
for this.
More detailed info here, in the end of the section.
I hope this workaround helps anyone in the desire of having a Snap adding UDEV rules.