API DocumentationDocumentation for developing SailfishOS applications
Seamless Software Update configuration
SSU registration and configurations can be managed through the Ssu and SsuProxy APIs. The Ssu object can be used for querying data from MDM, but will not have the necessary permissions to change SSU data. For this, the SsuProxy should be used which forwards requests over DBus to the ssud daemon, which allows calls from the root and sailfish-mdm users. These calls are asynchronous, and return QDBusPendingReply objects.
These APIs can be imported into a project using the ssu pkgconfig file. e.g. for a qmake based project:
CONFIG += link_pkgconfig PKGCONFIG += ssu
Create an SsuProxy object like so:
ssuProxy = new SsuProxy();
After use it should be closed:
The 'ssu' utility command can be used for most of these interactions. Please see the ssu documentation, or the commands usage information for further details.
The following methods deal with registration of a device with an SSU domain:
- registerDevice(string username, string password) - Registers the device. The domain to use should be specified in the username parameter as user@domain.
- unregisterDevice() - Removes existing registration data
- boolean isRegistered() - Reports whether the device has been successfully registered.
- string domain() - Returns the current domain
These methods report system information, though accessing this through Mdm:SysInfo is simpler as it reads the config file directly rather than making a DBus call.
- string deviceModel() - The device model e.g. p4903
- string deviceFamily() - The device family
- string deviceUid() - The device's unique ID. Either IMEI or WLAN mac based, depending on whether there is a modem.
- string deviceVariant() - The device variant e.g. sony-nile
- string displayName(int type) - The pretty name for the device e.g. INOI R7. Type can be manufacturer, designation or model. See ssu docs for further info.
Although these methods enable manual manipulation of each configured repository individually, it is generally not recommended to do this programatically at the device management level. Instead, configure standard repositories in domains whenever possible.
- int deviceMode() - The repository configuration mode e.g. Release, RnD, Upgrade. See ssu docs for further info.
- setDeviceMode(int) - Sets the above
- release(bool rnd) - The configured release version (release or rnd)
- setRelease(string release, bool rnd) - Set the release version (release or rnd)
- QList<SsuRepo> listRepos() - Return a list of configured repositories (See ssu docs for structure)
- addRepo(string name, string url) - Add custom repo. Url can be empty for repos already defined in ssu config.
- modifyRepo(int action, string repo) - Change a repo: 0 - remove, 1 - add, 2 - disable, 3 - enable
- updateRepos() - Regenerate repositories from config. Use when e.g. changing domains.
Domains can be dynamically created, and their variables created or modified. Some domains may be predefined by vendor config in /usr/share/ssu/repos.d as part of basic device config, and these values may be modified. However, these values will be overwritten by a newer version of the vendor config.
- listDomains() - Returns a list of configured SSU domains
- QVariantMap getDomainConfig(string domain) - returns custom variables defined for the given domain
- setDomainConfig(string domain, QVariantMap config) - Overwrites the full set of variable for a given domain, removing any existing variables not defined in the new set. Changes to predefined domains will persist unless overridden by newer predefined data.