7 The widgets are described by the technical recommendations
8 [widgets] and [widgets-digsig].
10 In summary, **widgets are ZIP files that can be signed and
11 whose content is described by the file <config.xml>**.
13 ### The configuration file config.xml
15 This is one of the important file of the widget.
16 It fully describes the widget.
18 Here is the example of the config file for the QML application SmartHome.
21 <?xml version="1.0" encoding="UTF-8"?>
22 <widget xmlns="http://www.w3.org/ns/widgets" id="smarthome" version="0.1">
23 <name>SmartHome</name>
24 <icon src="smarthome.png"/>
25 <content src="qml/smarthome/smarthome.qml" type="text/vnd.qt.qml"/>
26 <description>This is the Smarthome QML demo application. It shows some user interfaces for controlling an
27 automated house. The user interface is completely done with QML.</description>
28 <author>Qt team</author>
29 <license>GPL</license>
33 The most important items are:
35 - **\<widget id="......"\>**: gives the id of the widget. It must be unique.
37 - **\<widget version="......"\>**: gives the version of the widget
39 - **\<icon src="..."\>**: gives a path to the icon of the application
40 (can be repeated with different sizes)
42 - **\<content src="..." type="..."\>**: this indicates the entry point and its type.
43 The types handled are set through the file /etc/afm/afm-launch.conf
45 Further development will add handling of <feature> for requiring and providing
46 permissions and services.
48 ### Tools for managing widgets
50 This project includes tools for managing widgets.
53 - ***wgtpkg-info***: command line tool to display
54 informations about a widget file.
56 - ***wgtpkg-installer***: command line tool to
57 install a widget file.
59 - ***wgtpkg-pack***: command line tool to create
60 a widget file from a widget directory.
62 - ***wgtpkg-sign***: command line tool to add a signature
63 to a widget directory.
65 For all these commands, a tiny help is available with
66 options **-h** or **--help**.
68 There is no tool for unpacking a widget. For doing such operation,
69 you can use the command **unzip**.
71 To list the files of a widget:
77 To extract a widget in some directory:
80 $ unzip WIDGET -d DIRECTORY
83 *Note that DIRECTORY will be created if needed*.
87 To sign a widget, you need a private key and its certificate.
89 The tool **wgtpkg-sign** creates or replace a signature file in
90 the directory of the widget BEFORE its packaging.
92 There are two types of signature files: author and distributor.
94 Example 1: add an author signature
97 $ wgtpkg-sign -a -k me.key.pem -c me.cert.pem DIRECTORY
100 Example 2: add a distributor signature
103 $ wgtpkg-sign -k authority.key.pem -c authority.cert.pem DIRECTORY
108 This operation can be done using the command **zip** but
109 we provide the tool **wgtpkg-pack** that may add checking.
113 $ wgtpkg-pack DIRECTORY -o file.wgt
116 ### Getting data about a widget file
118 The command **wgtpkg-info** opens a widget file, reads its **config.xml**
119 file and displays its content in a human readable way.
124 ### What kind of application?
126 The file **/etc/afm/afm-launch.conf** explain how to launch applications.
127 (It is the current state that use afm-user-daemon. In a future, it may be
128 replace by systemd features.)
130 Currently the applications that can be run are:
132 - binary applications: their type is ***application/x-executable***
134 - HTML5 applications: their type is ***text/html***
136 - QML applications: their type is ***text/vnd.qt.qml***
138 ### The steps for writing a widget
140 1. make your application
142 2. create its configuration file **config.xml**
150 Organization of directory of applications
151 -----------------------------------------
153 ### directory where are stored applications
155 Applications can be installed in different places: the system itself, extension device.
156 On a phone application are typically installed on the sd card.
160 - /usr/applications: system wide applications
161 - /opt/applications: removable applications
163 From here those paths are referenced as: "APPDIR".
165 The main path for applications is: APPDIR/PKGID/VER.
169 - APPDIR is as defined above
170 - PKGID is a directory whose name is the package identifier
171 - VER is the version of the package MAJOR.MINOR
173 This organization has the advantage to allow several versions to leave together.
174 This is needed for some good reasons (rolling back) and also for less good reasons (user habits).
176 ### Identity of installed files
178 All files are installed as user "afm" and group "afm".
179 All files have rw(x) for user and r-(x) for group and others.
181 This allows every user to read every file.
183 ### labeling the directories of applications
185 The data of a user are in its directory and are labelled by the security-manager
186 using the labels of the application.
188 [meta-intel]: https://github.com/01org/meta-intel-iot-security "A collection of layers providing security technologies"
189 [widgets]: http://www.w3.org/TR/widgets "Packaged Web Apps"
190 [widgets-digsig]: http://www.w3.org/TR/widgets-digsig "XML Digital Signatures for Widgets"
191 [libxml2]: http://xmlsoft.org/html/index.html "libxml2"
192 [openssl]: https://www.openssl.org "OpenSSL"
193 [xmlsec]: https://www.aleksey.com/xmlsec "XMLSec"
194 [json-c]: https://github.com/json-c/json-c "JSON-c"
195 [d-bus]: http://www.freedesktop.org/wiki/Software/dbus "D-Bus"
196 [libzip]: http://www.nih.at/libzip "libzip"
197 [cmake]: https://cmake.org "CMake"
198 [security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
199 [app-manifest]: http://www.w3.org/TR/appmanifest "Web App Manifest"
200 [tizen-security]: https://wiki.tizen.org/wiki/Security "Tizen security home page"
201 [tizen-secu-3]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview "Tizen 3 security overview"