Click package#
Totes les aplicacions click
han d’incorporar almenys 3 fitxers:
- el fitxer
manifest.json
Conté les declaracions de l’aplicació com ara el nom de l’aplicació, la descripció, l’autor, el destí de l’entorn de desenvolupament (sdk) i la versió.
Exemple de fitxer
manifest.json
:{ "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" } } }
- Fitxer de política de perfil de l’AppArmor
Conté quina política li cal a l’aplicació per funcionar correctament. Vegeu Seguretat i aïllament de l’aplicació a sota per a més informació sobre aquest fitxer.
- fitxer
.desktop
El fitxer llançador li dirà a l’UT com llençar l’aplicació, quin nom i quina icona mostrar a la pantalla d’inici, i algunes altres propietats.
Exemple d”app.desktop`:
[Desktop Entry] Name=Application title Exec=qmlscene qml/Main.qml Icon=assets/logo.svg Terminal=false Type=Application X-Ubuntu-Touch=true
Llista no exhaustiva de propietats:
Nom: el títol de l’aplicació s’ha mostrat al traç
Exec: camí al fitxer executable
Icona: camí a la icona a mostrar
Terminal: ``false``si no s’executarà a la finestra de terminal
Tipus: Especifica el tipus del fitxer llançador. El tipus pot ser Application (aplicació), Link (enllaç) o Directory (directori).
X-Ubuntu-Touch:
true
per fer visible l’aplicacióX-Ubuntu-XMir-Enable: ``true``si la vostra aplicació està construïda sobre les X
X-Ubuntu-Supported-Orientations:
landscape
orportrait
to force your app start in landscape mode and portrait mode respectively.
Seguretat i aïllament de les aplicacions#
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.
Exemple de fitxer apparmor.json
:
{
"policy_version": 16.04,
"policy_groups": [
"networking",
"webview",
"content_exchange"
]
}
For a full list of available policy groups, see Grups de política de l’AppArmor.