Click package¶
Ogni pacchetto di applicazione click deve contenere almeno 3 files:
- il file
manifest.json Contiene dichiarazioni dell’applicazione quali il nome dell’applicazione, la descrizione, l’autore, l’obiettivo sdk del framework e la versione.
Example
manifest.jsonfile:{ "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" } } }
- File della politica (policy) del profilo AppArmor
Contains which policy the app needs to work properly. See Security and app isolation below for more information on this file.
- il file
.desktop Il file di avvio indicherà a UT come avviare l’app, quale nome e icona visualizzare nella schermata iniziale e alcune altre proprietà.
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
Elenco non esaustivo delle proprietà:
Nome: il titolo dell’applicazione è mostrato nella dash
Exec: Percorso al file eseguibile
Icon: Percorso dell’icona da mostrare
Terminal:
falsenon funzionerà in una finestra del terminaleType: Specifica il tipo di file eseguibile. Può essere Application, Link o Directory.
X-Ubuntu-Touch:
trueaffinchè la app sia visibileX-Ubuntu-XMir-Enable:
truese la app è creata per XX-Ubuntu-Supported-Orientations:
landscapeorportraitto force your app start in landscape mode and portrait mode respectively.
Sicurezza e isolamento della app¶
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 Policy Groups.