15 This document describes what we intend to do. It may happen that our
16 current implementation and the content of this document differ.
18 In case of differences, it is assumed that this document is right
19 and the implementation is wrong.
25 The daemon **afm-system-daemon** is in charge of installing
26 applications on the system. Its main tasks are:
28 - installs the applications and setup the security framework
31 - uninstall the applications
33 The **afm-system-daemon** takes its orders from the system
36 The figure below summarizes the situation of the
37 **afm-system-daemon** in the system.
39 +------------------------------------------------------------+
42 | +-------------------------------------------------+ |
44 | | afm-user-daemon | |
46 | +----------+----------------------+----------+----+ |
49 :================|======================|==========:=========:
51 | +----------+----------+ +-----+-----+ : |
52 | | D-Bus system +-----+ CYNARA | : |
53 | +----------+----------+ +-----+-----+ : |
55 | +----------+---------+ +-------+----------+----+ |
56 | | afm-system-daemon +----+ SECURITY-MANAGER | |
57 | +--------------------+ +-----------------------+ |
60 +------------------------------------------------------------+
63 Starting **afm-system-daemon**
64 ------------------------------
66 **afm-system-daemon** is launched as a **systemd** service
67 attached to system. Normally, the service file is
68 located at /lib/systemd/system/afm-system-daemon.service.
70 The options for launching **afm-system-daemon** are:
75 Set the root application directory.
77 Note that the default root directory is defined
78 to be /usr/share/afm/applications (may change).
83 Daemonizes the process. It is not needed by sytemd.
88 Reduces the verbosity (can be repeated).
93 Increases the verbosity (can be repeated).
103 ### Overview of the dbus interface
105 ***afm-system-daemon*** takes its orders from the session instance
106 of D-Bus. The use of D-Bus is great because it allows to implement
107 discovery and signaling.
109 The **afm-system-daemon** is listening with the destination name
110 ***org.AGL.afm.system*** at the object of path ***/org/AGL/afm/system***
111 on the interface ***org.AGL.afm.system*** for the below detailed
112 members ***install*** and ***uninstall***.
114 D-Bus is mainly used for signaling and discovery. Its optimized
115 typed protocol is not used except for transmitting only one string
118 The client and the service are using JSON serialisation to
121 The D-Bus interface is defined by:
123 * DESTINATION: **org.AGL.afm.system**
125 * PATH: **/org/AGL/afm/system**
127 * INTERFACE: **org.AGL.afm.system**
129 The signature of any member of the interface is ***string -> string***
130 for ***JSON -> JSON***.
132 This is the normal case. In case of error, the current implmentation
133 returns a dbus error that is a string.
135 Here is an example that use *dbus-send* to query data on
136 installed applications.
138 dbus-send --session --print-reply \
139 --dest=org.AGL.afm.system \
140 /org/AGL/afm/system \
141 org.AGL.afm.system.install 'string:"/tmp/appli.wgt"'
143 ### The protocol over D-Bus
147 #### Method org.AGL.afm.system.install
149 **Description**: Install an application from its widget file.
151 If an application of the same *id* and *version* exists, it is not
152 reinstalled except if *force=true*.
154 Applications are installed in the subdirectories of the common directory
156 If *root* is specified, the application is installed under the
157 sub-directories of the *root* defined.
159 Note that this methods is a simple accessor to the method
160 ***org.AGL.afm.system.install*** of ***afm-system-daemon***.
162 After the installation and before returning to the sender,
163 ***afm-system-daemon*** sends the signal ***org.AGL.afm.system.changed***.
165 **Input**: The *path* of the widget file to install and, optionaly,
166 a flag to *force* reinstallation, and, optionaly, a *root* directory.
168 Either just a string being the absolute path of the widget file:
170 "/a/path/driving/to/the/widget"
175 "wgt": "/a/path/to/the/widget",
177 "root": "/a/path/to/the/root"
180 "wgt" and "root" must be absolute paths.
182 **output**: An object with the field "added" being the string for
183 the id of the added application.
185 {"added":"appli@x.y"}
189 #### Method org.AGL.afm.system.uninstall
191 **Description**: Uninstall an application from its id.
194 Note that this methods is a simple accessor to the method
195 ***org.AGL.afm.system.uninstall*** of ***afm-system-daemon***.
197 After the uninstallation and before returning to the sender,
198 ***afm-system-daemon*** sends the signal ***org.AGL.afm.system.changed***.
200 **Input**: the *id* of the application and, otpionaly, the path to
201 *root* of the application.
211 "root": "/a/path/to/the/root"
214 **output**: the value 'true'.
248 [meta-intel]: https://github.com/01org/meta-intel-iot-security "A collection of layers providing security technologies"
249 [widgets]: http://www.w3.org/TR/widgets "Packaged Web Apps"
250 [widgets-digsig]: http://www.w3.org/TR/widgets-digsig "XML Digital Signatures for Widgets"
251 [libxml2]: http://xmlsoft.org/html/index.html "libxml2"
252 [openssl]: https://www.openssl.org "OpenSSL"
253 [xmlsec]: https://www.aleksey.com/xmlsec "XMLSec"
254 [json-c]: https://github.com/json-c/json-c "JSON-c"
255 [d-bus]: http://www.freedesktop.org/wiki/Software/dbus "D-Bus"
256 [libzip]: http://www.nih.at/libzip "libzip"
257 [cmake]: https://cmake.org "CMake"
258 [security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
259 [app-manifest]: http://www.w3.org/TR/appmanifest "Web App Manifest"
260 [tizen-security]: https://wiki.tizen.org/wiki/Security "Tizen security home page"
261 [tizen-secu-3]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview "Tizen 3 security overview"