Click 套件

Every click application package must embed at least 3 files:

manifest.json file

包含應用程式聲明,如應用程式名稱、說明、作者、SDK 框架目標和版本。

Example manifest.json file:

{
    "name": "myapp.author",
    "title": "App Title",
    "version": "0.1"
    "description": "Description of the app",
    "framework": "ubuntu-sdk-16.04",
    "maintainer": "xxxx <xxx@xxxx>",
    "hooks": {
        "myapp": {
            "apparmor": "apparmor.json",
            "desktop": "app.desktop"
        }
    }
}
AppArmor 配置文件策略策略檔案

Contains which policy the app needs to work properly. See Security and app isolation below for more information on this file.

.desktop file

啟動檔案將告訴 Ubuntu Touch 如何啟動應用程式、要在主畫面上顯示的名稱和圖示以及其他一些屬性。

Example of app.desktop:

[Desktop Entry]
Name=Application title
Exec=qmlscene qml/Main.qml
Icon=assets/logo.svg
Terminal=false
Type=Application
X-Ubuntu-Touch=true

非詳細的屬性列表:

  • 名稱:應用程式標題顯示在目錄中

  • 執行:可執行文件的路徑

  • 圖示:要顯示的圖示的路徑

  • Terminal: false if will not run in terminal window

  • 類型:指定啟動器文件的類型。 類型可以是應用程式,連接或目錄。

  • X-Ubuntu-Touch: true to make the app visible

  • X-Ubuntu-XMir-Enable: true if your app is built for X

  • X-Ubuntu-Supported-Orientations: landscape or portrait to force your app start in landscape mode and portrait mode respectively.

安全性和應用程式隔離

All Ubuntu apps 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": 16.04,
    "policy_groups": [
        "networking",
        "webview",
        "content_exchange"
    ]

}

For a full list of available policy groups, see AppArmor 政策組.