Mdm Api Example
Aurora OS application to demonstrate the MDM API.
Terms of Use and Participation
The source code of the project is provided under the license, which allows its use in third-party applications.
The contributor agreement documents the rights granted by contributors of the Open Mobile Platform.
Information about the contributors is specified in the AUTHORS file.
Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.
Project Structure
The project has a standard structure of an application based on C++ and QML for Aurora OS.
-
ru.auroraos.MdmApiExample subproject contains an application source code.
- ru.auroraos.MdmApiExample.pro file describes the ru.auroraos.MdmApiExample subproject structure for the qmake build system.
- icons directory contains the application icons for different screen resolutions.
-
qml directory contains the QML source code and the UI resources.
- cover directory contains the application cover implementations.
- icons directory contains the additional custom UI icons.
- pages directory contains the application pages.
- components directory contains common QML components used across different pages.
- MdmApiExample.qml file provides the application window implementation.
-
src directory contains the C++ source code.
- main.cpp file is the application entry point.
- base-handler.h and base-handler.cpp files are source code of the BaseHandler class is a proxy-class to use the ru.auroraos.MdmApiExample DBus-service with different DBus-paths.
- Sources like {modulename}-handler.h and {modulename}-handler.cpp files represent the source code of classes implementing BaseHandler and containing work with a specific Mdm Api module and the corresponding DBus path.
- gui-modules.h and gui-modules.cpp files represent the source code for registering various handlers for use in different QML pages.
- translations directory contains the UI translation files.
- ru.auroraos.MdmApiExample.desktop file defines the display and parameters for launching the application.
-
ru.auroraos.MdmApiExampleDaemon subproject contains the systemd-service source code that uses MDM API.
- ru.auroraos.MdmApiExampleDaemon.pro file describes the ru.auroraos.MdmApiExampleDaemon subproject structure for the qmake build system.
-
src directory contains the C++ source code.
- main.cpp file is the service entry point.
-
rpm directory contains the rpm-package build settings.
- ru.auroraos.MdmApiExample.spec file is used by rpmbuild tool.
Modules of the ru.auroraos.MdmApiExampleDaemon and ru.auroraos.MdmApiExample:
| Module name | Description |
|---|---|
| Applications | Installing and uninstalling applications |
| DeviceControl | Shutdown and reboot the device |
| Files | Download a file via network |
| Location | Location settings and getting current location info |
| Networks | Managing Wi-Fi connections |
| Policy | Working with security policies on the device |
| Report | Generating an encrypted system report |
| SSU | Managing package repositories |
| SysInfo | Obtaining system information |
| SystemEvent | Receiving SDJD events |
| SystemUpdate | Download, install, and schedule system updates |
| VPN | Managing VPN connections |
Compatibility
The project is compatible with current versions of Aurora OS.
Architecture schema
┌──────────────────┐
│ Aurora OS │
┌───────────────────┐ └────────▲─────────┘
│ RPM-package │ │
User ├───────────────────┴────────────────────────┼──────────────────────┐
│ │MDM API │
│ @ │ │ ┌────────────────┐ ┌──────────┴───────────┐ │
└─┬─┘ │ │ GUI │ DBus │ MdmApiExample │ │
│ ◄────┼───►│ MdmApiExample │◄─────────►│ systemd-service │ │
┌─┴─┐ │ └────────────────┘ └──────────▲───────────┘ │
│ │ │ │ │
└────────────────────────────────────────────┼──────────────────────┘
│
┌─────▼─────┐
│ TCP │
└─────▲─────┘
│
│
┌──────▼───────┐
│ MDM Server │
└──────────────┘
Notes
For proper operation, the application must be signed by the MDM developer signature and installed via APM (Aurora Package Manager).
After installation, the OS will create and start the systemd service rm_task.ru.auroraos.MdmApiExample.task_MdmClient.service
based on the data in the [X-Task MdmClient] section of the ru.auroraos.MdmApiExample.desktop file.
Installing and uninstalling ru.auroraos.MdmApiExample via APM d-bus api:
gdbus call -y -d ru.omp.APM -o /ru/omp/APM -m ru.omp.APM.Install <full-path-to>/ru.auroraos.MdmApiExample-*.rpm {}
gdbus call -y -d ru.omp.APM -o /ru/omp/APM -m ru.omp.APM.Remove ru.auroraos.MdmApiExample {}
Obtaining mdm systemd-service status:
systemctl status rm_task.ru.auroraos.MdmApiExample.task_MdmClient.service
