App Store Packaging Specification
1. App identity (Package name)
App identity/Package name (appid) is the unique identification of an application. Only applications named under the reverse domain name rule are accepted by the App Store. For example:
com.deepin.demo
We recommend to use your own domain name as your app name. Using unauthorized domain names might lead to complaints filed by relevant domain owners, which may cause your app to be removed from the App Store.
2. App installation
2.1 Installation path
All installation files of your apps must be saved in below directory: /opt/apps/${appid}/ Modification to the system is strictly prohibited against hooks such as postinst which utilize deb packages. All app packages including such scripts will not be allowed to enter the App Store.
3. Structure of directories
drwxr-xr-x 6 root root 4.0K 11月 20 22:25 entries
drwxr-xr-x 3 root root 4.0K 11月 20 19:58 files
-rw-r--r-- 1 root root 0 11月 20 19:01 info
There are two directories, namely “entries” and “files”, and one “info” file in the app root directory (/opt/apps/${appid}/).
3.1 Info document
Info document is a descriptive file of your app and is written in json format. Please check below for its content:
{
"appid": "com.deepin.demo",
"name": "Demo",
"version": "5.0.0.0",
"arch": ["amd64", "mips64"],
"permissions": {
"autostart": false,
"notification": false,
"trayicon": false,
"clipboard": false,
"account": false,
"bluetooth": false,
"camera": false,
"audio_record": false,
"installed_apps": false
},
"support-plugins": [
"plugin/demo"
],
"plugins": [
"plugin/webbrowser",
"plugin/office"
]
}
Introductions of fields included in the info document are as below: appid: identity of an app name: name of an app version: version of an app, including {MAJOR}.{MINOR}.{PATCH}.{BUILD}. Only numeric numbers are allowed in these fields. arch: architecture of an app. App Store currently supports following CPU architectures:
- amd64: X86 CPU
- mips64el: Loongson series CPU
- arm64: ARM 64-Bit CPU
- sw_64: Sunway CPU
permissions: description of app permissions
- autostart: allow auto-start when system startup
- notification: allow giving notification
- trayicon: display icon in tray area
- clipboard: allow the use of clipboard
- account: allow the reading of logged account info
- bluetooth: allow the use of Bluetooth devices
- camera: allow the use of webcam
- audio_record: allow audio recording
- installed_apps: allow reading on the list of installed apps
Developers should notice that all apps are only allowed to run under the common user permissions. Apps are strictly prohibited from accessing the root access by any means.
support-plugins: plugin types that are supported Plugins: plugin types that are implemented. In the corresponding “plugins” directory, files should be placed in accordance with the plugin types that are implemented. During installation, system will link the plugin with its corresponding app directory.
Notes:
- desktop/serverice should be directed to the files in your app directory /opt/apps/com.deepin.demo/files.
- For special apps with multiple entries to their desktop files, it is indicated that there are different software with different functions. For such apps in need of multiple entries, applications should be submitted under a rigorously restricted whitelist. Normally, desktop files with multiple entries are not allowed for apps.
- During developing process, please pay special attention that mutual access between each and every subdirectory and the directory of main program is not available under the mechanism of plugins.
3.2 Directory of entries
3.2.1 Directory of applications
The "applications" directory is used to place program startup files. Generally, a desktop file named appid is in this directory. Currently, the standard desktop file format is adopted, which can be referred to https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html For example, the content of com.apps.demo.desktop is as follows:
[Desktop Entry]
Categories=Audio;AudioVideo;Qt;
Name=Deepin Demo
GenericName=Demo
Type=Application
Exec=/opt/apps/com.apps.demo/files/bin/com.apps.demo %F
Icon=com.apps.demo
MimeType=audio/aac;application/aac;
Comment[en]=Play your music collection
GenericName[en]=Music
Name[en]=Deepin Music
The keys in the desktop file that you should pay attention to are:
Key | Description |
---|---|
Name | The program name. |
Icon | The program icon displayed in the system. It is recommended to use a relative path for the name so that the system can find the corresponding icon file according to the theme specification. In special cases, if an absolute path is used, the theme icon is not supported. |
Exec | The entry of the program. It is generally the executable binary of the program, which will be started later by the sandbox. |
MimeType | The associated types supported by the program. |
Categories | The categories of the program. |
Example:
Packaging path | Installation path |
---|---|
entries/applications/com.apps.demo.desktop | /usr/share/applications/com.apps.demo.desktop |
3.2.2 Directory of icons
It is recommended to place your app icons in the below path - icons/hicolor/scalable/apps/com.deepin.demo.svg. All icons should use svg format. If you want to use non-vector-based images, please place your app icons in accordance with image resolutions. For example:
icons/hicolor/24x24/apps/com.deepin.demo.png
icons/hicolor/16x16/apps/com.deepin.demo.png
Image resolutions supported include: 16/24/32/48/96/128/256/512
3.3 Directory of files
This directory is used to place all necessary documents of the app. There is no limitation on the files to be placed in this directory. However, we recommend you to place the executable programs in the bin subdirectory.
4. File system permissions
4.1 System directory
System Partition is set as read-only which aims to provide basic dependent libraries for the running of apps. Please do not create any dependencies in accordance with the system directory, because all apps will run in the sandbox thus no contents in the system directory will be reliable.
4.2 App data directory
No files are allowed to be written into the $HOME directory by any software packages. $HOME will be redirected via the sandbox technology. Therefore, any behaviors depending on such feature may turn invalid or fail. App data and configurations are written into directories indicated by the environmental variables as below:
$XDG_DATA_HOME
$XDG_CONFIG_HOME
$XDG_CACHE_HOME
For an app whose appid is com.deepin.demo, the app data and configurations are written into below directories:
$XDG_DATA_HOME/com.deepin.demo
$XDG_CONFIG_HOME/com.deepin.demo
$XDG_CACHE_HOME/com.deepin.demo
4.3 User data directory
You cannot write any data into user data directory without the approval of user. User data directory is a collection of paths defined in ~/.config/user-dirs.dirs and is written as below:
cat ~/.config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_VIDEOS_DIR="$HOME/Videos"
Common UI frameworks, including Qt, provide support to the data directory. You can prioritize to use framework interfaces to access these directories. You can also refer to below link for the definition of directory. https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html
5 Package format
5.1 Binary format
Deepin App Store supports binary packages in deb format, which can be built with the debuild tool.