14 This document describes what we intend to do. It may happen that our
15 current implementation and the content of this document differ.
17 In case of differences, it is assumed that this document is right
18 and the implementation is wrong.
24 The daemon **afm-system-daemon** is in charge of installing
25 applications on the system. Its main tasks are:
27 - installs the applications and setup the security framework
30 - uninstall the applications
32 The **afm-system-daemon** takes its orders from the system
35 The figure below summarizes the situation of the
36 **afm-system-daemon** in the system.
38 +------------------------------------------------------------+
41 | +-------------------------------------------------+ |
43 | | afm-user-daemon | |
45 | +----------+----------------------+----------+----+ |
48 :================|======================|==========:=========:
50 | +----------+----------+ +-----+-----+ : |
51 | | D-Bus system +-----+ CYNARA | : |
52 | +----------+----------+ +-----+-----+ : |
54 | +----------+---------+ +-------+----------+----+ |
55 | | afm-system-daemon +----+ SECURITY-MANAGER | |
56 | +--------------------+ +-----------------------+ |
59 +------------------------------------------------------------+
62 Starting **afm-system-daemon**
63 ------------------------------
65 **afm-system-daemon** is launched as a **systemd** service
66 attached to system. Normally, the service file is
67 located at /lib/systemd/system/afm-system-daemon.service.
69 The options for launching **afm-system-daemon** are:
74 Set the root application directory.
76 Note that the default root directory is defined
77 to be /usr/share/afm/applications (may change).
82 Daemonizes the process. It is not needed by sytemd.
87 Reduces the verbosity (can be repeated).
92 Increases the verbosity (can be repeated).
102 ### Overview of the dbus interface
104 ***afm-system-daemon*** takes its orders from the session instance
105 of D-Bus. The use of D-Bus is great because it allows to implement
106 discovery and signaling.
108 The **afm-system-daemon** is listening with the destination name
109 ***org.AGL.afm.system*** at the object of path ***/org/AGL/afm/system***
110 on the interface ***org.AGL.afm.system*** for the below detailed
111 members ***install*** and ***uninstall***.
113 D-Bus is mainly used for signaling and discovery. Its optimized
114 typed protocol is not used except for transmitting only one string
117 The client and the service are using JSON serialisation to
120 The D-Bus interface is defined by:
122 * DESTINATION: **org.AGL.afm.system**
124 * PATH: **/org/AGL/afm/system**
126 * INTERFACE: **org.AGL.afm.system**
128 The signature of any member of the interface is ***string -> string***
129 for ***JSON -> JSON***.
131 This is the normal case. In case of error, the current implmentation
132 returns a dbus error that is a string.
134 Here is an example that use *dbus-send* to query data on
135 installed applications.
137 dbus-send --session --print-reply \
138 --dest=org.AGL.afm.system \
139 /org/AGL/afm/system \
140 org.AGL.afm.system.install 'string:"/tmp/appli.wgt"'
142 ### The protocol over D-Bus
146 #### Method org.AGL.afm.system.install
148 **Description**: Install an application from its widget file.
150 If an application of the same *id* and *version* exists, it is not
151 reinstalled except if *force=true*.
153 Applications are installed in the subdirectories of the common directory
155 If *root* is specified, the application is installed under the
156 sub-directories of the *root* defined.
158 Note that this methods is a simple accessor to the method
159 ***org.AGL.afm.system.install*** of ***afm-system-daemon***.
161 After the installation and before returning to the sender,
162 ***afm-system-daemon*** sends the signal ***org.AGL.afm.system.changed***.
164 **Input**: The *path* of the widget file to install and, optionaly,
165 a flag to *force* reinstallation, and, optionaly, a *root* directory.
167 Either just a string being the absolute path of the widget file:
169 "/a/path/driving/to/the/widget"
174 "wgt": "/a/path/to/the/widget",
176 "root": "/a/path/to/the/root"
179 "wgt" and "root" must be absolute paths.
181 **output**: An object with the field "added" being the string for
182 the id of the added application.
184 {"added":"appli@x.y"}
188 #### Method org.AGL.afm.system.uninstall
190 **Description**: Uninstall an application from its id.
193 Note that this methods is a simple accessor to the method
194 ***org.AGL.afm.system.uninstall*** of ***afm-system-daemon***.
196 After the uninstallation and before returning to the sender,
197 ***afm-system-daemon*** sends the signal ***org.AGL.afm.system.changed***.
199 **Input**: the *id* of the application and, otpionaly, the path to
200 *root* of the application.
210 "root": "/a/path/to/the/root"
213 **output**: the value 'true'.
247 [meta-intel]: https://github.com/01org/meta-intel-iot-security "A collection of layers providing security technologies"
248 [widgets]: http://www.w3.org/TR/widgets "Packaged Web Apps"
249 [widgets-digsig]: http://www.w3.org/TR/widgets-digsig "XML Digital Signatures for Widgets"
250 [libxml2]: http://xmlsoft.org/html/index.html "libxml2"
251 [openssl]: https://www.openssl.org "OpenSSL"
252 [xmlsec]: https://www.aleksey.com/xmlsec "XMLSec"
253 [json-c]: https://github.com/json-c/json-c "JSON-c"
254 [d-bus]: http://www.freedesktop.org/wiki/Software/dbus "D-Bus"
255 [libzip]: http://www.nih.at/libzip "libzip"
256 [cmake]: https://cmake.org "CMake"
257 [security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
258 [app-manifest]: http://www.w3.org/TR/appmanifest "Web App Manifest"
259 [tizen-security]: https://wiki.tizen.org/wiki/Security "Tizen security home page"
260 [tizen-secu-3]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview "Tizen 3 security overview"