Click package¶
Every click
application package must embed at least 3 files:
manifest.json
文件Contains application declarations such as application name, description, author, framework sdk target, and version.
manifest.json
文件示例:{ "name": "myapp.author", "title": "App Title", "version": "0.1" "description": "Description of the app", "framework": "ubuntu-sdk-15.04", "maintainer": "xxxx <xxx@xxxx>", "hooks": { "myapp": { "apparmor": "apparmor.json", "desktop": "app.desktop" } }, }
- AppArmor profile policy file
- Contains which policy the app needs to work properly. See Security and app isolation below for more information on this file.
.desktop
文件启动器文件将告诉 Ubuntu Touch 如何启动应用程序,在主屏幕上显示什么样的名称和图标,以及其他一些属性。
``app.desktop``示例:
[Desktop Entry] Name=Application title Exec=qmlscene qml/Main.qml Icon=assets/logo.svg Terminal=false Type=Application X-Ubuntu-Touch=true
非详尽的属性列表:
- Name:显示在 Dash 中的应用程序标题
- Exec:可执行文件路径
- Icon:显示的图标路径
- Terminal:
false
if will not run in terminal window - Type: Specifies the type of the launcher file. The type can be Application, Link or Directory.
- X-Ubuntu-Touch:
true
to make the app visible - X-Ubuntu-XMir-Enable:
true
if your app is built for X
Security and app isolation¶
All Ubuntu apps and scopes are confined respecting AppArmor access control mechanism (see Application Confinement) , meaning they only have access to their own resources and are isolated from other apps and parts of the system. The developer must declare which policy groups are needed for the app or scope to function properly with an apparmor .json
file.
Example apparmor.json
file:
{
"policy_version": 1.3,
"policy_groups": [
"networking",
"webview",
"content_exchange"
]
}
For a full list of available policy groups, see AppArmor Policy Groups.