namespace common_installer {
namespace backup {
+/**
+ *\brief Step responsible for backuping icons during update and uninstallation.
+ * Used by TPK and WGT backend
+ */
class StepBackupIcons : public Step {
public:
using Step::Step;
+ /**
+ * \brief main logic of backuping icons
+ *
+ * \return Status::OK, if successful backup, Status::ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief removes backup files after successful update/deinstallation
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status clean() override;
+
+ /**
+ * \brief restores backup icons.
+ *
+ * \return Status:OK if success, Status::ERROR othewise
+ */
Status undo() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
private:
namespace common_installer {
namespace backup {
+/**
+ * \brief Step responsbile for backing manifest file during update and
+ * uninstallation. Used by WGT and TPK backend
+ */
class StepBackupManifest : public Step {
public:
using Step::Step;
+ /**
+ * \brief main logic of backuping manifest
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief removes backup file after successful update/deinstallation
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status clean() override;
+
+ /**
+ * \brief restores backup manifest.
+ *
+ * \return Status:OK if success, Status::ERROR othewise
+ */
Status undo() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override;
SCOPE_LOG_TAG(BackupManifest)
namespace common_installer {
namespace security {
+/**
+ * \brief step responsible for checking and comparing certificates of
+ * current and new version of application. Used by WGT and TPK
+ */
class StepCheckOldCertificate : public Step {
public:
using Step::Step;
+ /**
+ * \brief main checking/comparing logic.
+ *
+ * \return Status::OK if certificates are OK. ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
SCOPE_LOG_TAG(CheckOldCertificate)
namespace common_installer {
namespace security {
+/**
+ * \brief Step responsible for checking signature of given package.
+ * Used by WGT and TPK backend
+ */
class StepCheckSignature : public Step {
public:
using Step::Step;
+ /**
+ * \brief main logic of checking signature
+ *
+ * \return Status::OK if signature correct, Status:ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief checks if unpacked dir is available
+ *
+ * \return Status::OK if available, Status::ERRO otherwise
+ */
Status precheck() override;
SCOPE_LOG_TAG(Signature)
*/
class StepConfigure : public Step {
public:
+
+ /**
+ * \brief Constuctor
+ *
+ * \param context pointer to InstallerContext structure
+ * \param pkgmgr pointer to Pkgmgr interface
+ */
StepConfigure(InstallerContext* context, PkgMgrPtr pkgmgr);
+ /**
+ * \brief configuration based on pacakge typ, request mode, user
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief Recovery file reset
+ *
+ * \return Status::OK
+ */
Status clean() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief checks, if backend not launched with root uid
+ *
+ * \return Status::OK if normal user, Status::ERROR if root
+ */
Status precheck() override;
private:
bool SetupRootAppDirectory();
namespace common_installer {
namespace filesystem {
+/**
+ * \brief step responsible for moving/copying files from temp unpacked dir to
+ * final installed package destination during INSTALLATION.
+ * Used by WGT and TPK
+ */
class StepCopy : public Step {
public:
using Step::Step;
+ /**
+ * \brief main logic of moving/copying files
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief removes files from final package destination
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status undo() override;
+
+ /**
+ * \brief checks if necessary paths/data are provided
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status precheck() override;
SCOPE_LOG_TAG(Copy)
namespace common_installer {
namespace backup {
+/**
+ * \brief Responsible for backuping original package resources during
+ * update or uninstallation and copying new content of the package.
+ * Used by WGT and TPK backend
+ */
class StepCopyBackup : public Step {
public:
using Step::Step;
+ /**
+ * \brief main logic of creating backup and copying new content
+ *
+ * \return Status::OK
+ */
Status process() override;
+
+ /**
+ * \brief removing backup files
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status clean() override;
+
+ /**
+ * \brief Restoring original pacakge files
+ *
+ * \return Status::OK if success, Status::Error otherwise
+ */
Status undo() override;
+
+ /**
+ * \brief checks if necessary paths are available
+ *
+ * \return Status::OK if success, Status::Error otherwise
+ */
Status precheck() override;
private:
namespace common_installer {
namespace filesystem {
+/**
+ * \brief step responsible for copying "data" and "shared" dirs
+ * to the proper location during update or deinstallation.
+ * Used by TPK and WGT
+ */
class StepCopyStorageDirectories : public common_installer::Step {
public:
using Step::Step;
+ /**
+ * \brief main logic of copying data into directories
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief restores original content of data and shared dirs
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status undo() override;
+
+ /**
+ * \brief checks if needed paths/data are provided
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status precheck() override;
protected:
namespace common_installer {
namespace filesystem {
+/**
+ * \brief Step responsible for creating icons for applications used during
+ * installation and update. Used by WGT and TPK backend
+ */
class StepCreateIcons : public Step {
public:
using Step::Step;
+ /**
+ * \brief main logic for creating icons
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status process() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief removes icons from system
+ *
+ * \return Status::OK
+ */
Status undo() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
protected:
namespace common_installer {
namespace configuration {
+/**
+ * \brief step used to indicate wrong request provided to the backend.
+ * Used by TPK and WGT.
+ */
class StepFail : public Step {
public:
using Step::Step;
+ /**
+ * \brief returns error
+ *
+ * \return Status::ERROR
+ */
Status process() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status precheck() override { return Status::OK; }
SCOPE_LOG_TAG(Fail)
namespace common_installer {
namespace pkgmgr {
+/**
+ * \brief Step responsible for killing applications of the package that
+ * is being updated, uninstalled
+ *
+ */
class StepKillApps : public Step {
public:
using Step::Step;
+ /**
+ * \brief main logic for killing applications
+ *
+ * \return Status::OK
+ */
Status process() override;
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status clean() override { return Status::OK; }
+
+ /**
+ * \brief empty method
+ *
+ * \return Status::OK
+ */
Status undo() override { return Status::OK; }
+
+ /**
+ * \brief checks if neccessary data is provided
+ *
+ * \return Status::OK if success, Status::ERROR otherwise
+ */
Status precheck() override;
SCOPE_LOG_TAG(KillApps)