Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Qt Service Framework on Symbian

How to register and unregister service plugins in S60?

Registration phase is a little different compared to other platforms because of the authenticity of the provider is done during (un)registering phase based on the verification of VID/SID (vendor ID or secure ID). A tiny installer application must be implemented by the service provider. Installer application is responsible for the registering (and the unregistering) of the service. The example code for the installer is shown below. The whole installer project can be found under examples/serviceinstaller_sfw_symbian.

    const QString filemanagerxml = "c:\\resource\\apps\\xmldata\\filemanagerservice.xml";
    const QString bluetoothxml = "c:\\resource\\apps\\xmldata\\bluetoothtransferservice.xml";

    int main(int argc, char *argv[])
    {
        QCoreApplication app(argc, argv);

        QServiceManager s;

            if (QFile::exists(filemanagerxml)) {
                    s.addService(filemanagerxml);
            } else {
                    s.removeService("FileManagerService");
            }

            if (QFile::exists(bluetoothxml)) {
                    s.addService(bluetoothxml);
            } else {
                    s.removeService("BluetoothTransferService");
            }
    }

If you want to create your own installer take a copy from the installer project (examples/serviceinstaller_sfw_symbian) and modify only the necessary parts e.g a target for your installer and define plugins which are deployed etc.

If the installer defines the VID (non-zero value) then the VID is stored to the database, otherwise SID is used. When unregistering the plugin the VID/SID verification is done to ensure that only the application which actually registered the service is only allowed to remove it. VID/SID is left to the database even the service has been unregistered. This prevents the exactly same way named services to be installed afterwards because the VID/SID information is locked to the service name.

More info about VID and SID can be found from:

What's special from the security perspective?

There is only one database in S60 because both databases (user and system) are combined to the same database. The database is located behind the server's private folder, (c:\private\E3b48c24). This ensures the database can't be thumbered (e.g. remove, move or replace) without Allfiles capability which isn't user-grantable (More about the capabilities: http://wiki.forum.nokia.com/index.php/Capabilities). That makes it impossible for example to replace the whole database with the new one which might contain malicious services.

Note! It doesn't matter which scope is used on Symbian as QService::UserScope and QService::SystemScope are mapped to the same database.

Directory structure

There are different implementations for the both emulator and device because emulator doesn't support multiple applications to be loaded at the same time, (Known issue: QTBUG-2950). The dll approach must be used in the emulator environment and the exe approach instead of dll in the real device.

Note! The greatest part of the S60 specific code is located under the symbian folder in a directory hierarchy of Service FW. ServiceDatabase class contains also S60 specific code and the DatabaseManager class has been replaced totally with the corresponding class.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année

Le Qt Developer Network au hasard

Logo

Utiliser QML et QtWebKit avec PySide

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web