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