Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The SxeProgramInfo class is a data transfer object that models a program on disk. More...
#include <SxeProgramInfo>
The SxeProgramInfo class is a data transfer object that models a program on disk.
Used for registration of binaries with the SXE system.
Registration can happen at run-time of the qtopia device or at install-time, when building the qtopia ROM image on a development host.
For example, consider the following binaries installed onto a device:
/opt/Qtopia.rom/bin/calculator /opt/Qtopia.user/packages/bin/bomber
These examples are referenced in the documentation of public variables below. The table below summarizes the difference between "qbuild image" time and run time.
install root on dev host | run root on device |
---|---|
$HOME/build/qtopia42/image | /opt/Qtopia.rom |
The runRoot must be one of the elements which will be returned by the Qtopia::installPaths() method at runtime.
The installRoot is optional and will be empty in the case of a binary installed at run-time by the package manager.
Construct a new SxeProgramInfo
Destroy this SxeProgramInfo object
Return the QString of the absolute path to the binary for this SxeProgramInfo object.
This is simply the concatenation of installRoot, relPath and fileName. If the installRoot is null, the runRoot is used instead.
isValid() can be called to check that the returned path will point to a valid binary.
Return true if the SxeProgramInfo object represents a valid binary for SXE registration, and otherwise return false.
The binary is valid if all of the components of absolutePath() above are non-empty, and the resulting path is to a file which exists
Try to find this binary in the current file-system. First a check is made to see if isValid() returns true: if so this method simply returns true.
Otherwise an attempt to find the binary is made by traversing the entries in Qtopia::installPaths().
The fileName member should be set to non-empty before calling this method otherwise it simply returns false.
If the relPath member is set, then only that path is checked under each of the installPaths().
If the relPath member is empty, then the path searched is decided by checking if the filename refers to a shared library or not: if the fileName starts with "lib" and ends with ".so" then "application/plugins" are checked, otherwise only "bin" is checked.
If the binary is found, the relPath and runRoot entries are set to the the location, and the method returns true.
If the binary is not found, no entries are altered and the method returns false.
For example:
SxeProgramInfo calcBin; calcBin.fileName = "calculator"; if ( calcBin.locateBinary() ) qDebug() << "Calculator is a standalone app at" << calcBin.absolutePath(); else { calcBin.fileName = "libcalculator.so"; if ( calcBin.locateBinary() ) qDebug() << "Calculator is a quicklaunched app at" << calcBin.absolutePath(); else qDebug() << "Calculator is not available"; }
Make the current process assume the SXE identity of the executable represented by this SxeProgramInfo.
Internally this is done by writing to the /proc/lids/suid pseudo file.
This method only succeeds on a suitably patched SXE linux kernel.
security domains, a list of comma seperated values
the binaries file name, eg calculator, bomber
SXE program identity
for example $HOME/build/qtopia/42-phone/image this should only ever be set when running under sxe_installer
SXE shared secret key
for example bin, packages/bin, plugings/application
for example /opt/Qtopia.rom, /opt/Qtopia.user
Ensure the SXE key for this executable is valid, and then call the transport authorizer method to set it.
After this call all QWS calls by app will be authorized with this key.
A check is made that the binary has been keyed, and if not then the method will qFatal, with the message "SXE key has not been set".
(This function is stubbed out with an empty implementation if Qt Extended is configured without SXE.)
This is an overloaded member function, provided for convenience.
Sends the SxeProgramInfo progInfo to the debug stream.
This macro causes the key storage to be allocated and initialized. An application without this macro cannot be used on a SXE-enabled system. It is needed if you are not using the QTOPIA_MAIN macro.
QSXE_APP_KEY int main( int argc, char **argv ) { QSXE_SET_APP_KEY(argv[0]); ...
See also Applications and QTOPIA_APP_KEY.
This macro causes the key storage to be allocated and initialized. An application without this macro cannot be used on a SXE-enabled system. It is needed if you are not using the QTOPIA_MAIN macro.
Note that this macro only applies to quicklaunch plugins.
See also Applications and QTOPIA_APP_KEY.
This macro causes the SXE key to be copied into memory. It is needed if you are not using the QTOPIA_MAIN macro. It must be the first line of your main() function. The name value should be set to the binary's name.
QSXE_APP_KEY int main( int argc, char **argv ) { QSXE_SET_APP_KEY(argv[0]); ...
See also Applications and QTOPIA_SET_KEY().
This macro causes the SXE key to be copied into memory. It is needed if you are not using the QTOPIA_MAIN macro. It must be called before constructing QtopiaApplication. The name value should be set to the binary's name.
Note that this macro only applies to quicklaunch plugins.
See also Applications and QTOPIA_SET_KEY().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |